本文整理汇总了C++中pa_threaded_mainloop_stop函数的典型用法代码示例。如果您正苦于以下问题:C++ pa_threaded_mainloop_stop函数的具体用法?C++ pa_threaded_mainloop_stop怎么用?C++ pa_threaded_mainloop_stop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pa_threaded_mainloop_stop函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveSound
////////////////////////////////////////////////////////////////////////
// REMOVE SOUND
////////////////////////////////////////////////////////////////////////
void RemoveSound (void)
{
if (device.mainloop != NULL)
pa_threaded_mainloop_stop (device.mainloop);
// Release in reverse order of acquisition
if (device.stream != NULL)
{
pa_stream_unref (device.stream);
device.stream = NULL;
}
if (device.context != NULL)
{
pa_context_disconnect (device.context);
pa_context_unref (device.context);
device.context = NULL;
}
if (device.mainloop != NULL)
{
pa_threaded_mainloop_free (device.mainloop);
device.mainloop = NULL;
}
}
示例2: uninit
/** Destroy libao driver */
static void uninit(int immed) {
if (stream && !immed) {
pa_threaded_mainloop_lock(mainloop);
waitop(pa_stream_drain(stream, success_cb, NULL));
}
if (mainloop)
pa_threaded_mainloop_stop(mainloop);
if (stream) {
pa_stream_disconnect(stream);
pa_stream_unref(stream);
stream = NULL;
}
if (context) {
pa_context_disconnect(context);
pa_context_unref(context);
context = NULL;
}
if (mainloop) {
pa_threaded_mainloop_free(mainloop);
mainloop = NULL;
}
}
示例3: audin_pulse_free
static void audin_pulse_free(IAudinDevice* device)
{
AudinPulseDevice* pulse = (AudinPulseDevice*) device;
DEBUG_DVC("");
if (!pulse)
return;
if (pulse->mainloop)
{
pa_threaded_mainloop_stop(pulse->mainloop);
}
if (pulse->context)
{
pa_context_disconnect(pulse->context);
pa_context_unref(pulse->context);
pulse->context = NULL;
}
if (pulse->mainloop)
{
pa_threaded_mainloop_free(pulse->mainloop);
pulse->mainloop = NULL;
}
xfree(pulse);
}
示例4: uninit
static void uninit(aout_instance_t *p_aout){
struct aout_sys_t * p_sys = p_aout->output.p_sys;
if (p_sys->mainloop)
pa_threaded_mainloop_stop(p_sys->mainloop);
if (p_sys->stream) {
pa_stream_disconnect(p_sys->stream);
pa_stream_unref(p_sys->stream);
p_sys->stream = NULL;
}
if (p_sys->context) {
pa_context_disconnect(p_sys->context);
pa_context_unref(p_sys->context);
p_sys->context = NULL;
}
if (p_sys->mainloop) {
pa_threaded_mainloop_free(p_sys->mainloop);
p_sys->mainloop = NULL;
}
free(p_sys);
p_aout->output.p_sys = NULL;
}
示例5: backend_destroy
void backend_destroy(context_t *context) {
pa_threaded_mainloop_stop(context->loop);
pa_context_disconnect(context->context);
pa_context_unref(context->context);
pa_threaded_mainloop_free(context->loop);
free(context);
}
示例6: pulse_enumerate_devices
/*
* enumerate input/output devices
*/
static void pulse_enumerate_devices(obs_properties_t props, bool input)
{
pa_context *c;
pa_operation *op;
pa_threaded_mainloop *m = pa_threaded_mainloop_new();
struct pulse_enumerate e;
e.mainloop = m;
e.devices = obs_properties_add_list(props, "device_id", "Device",
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
e.input = input;
pa_threaded_mainloop_start(m);
c = pulse_context_create(m);
if (pulse_context_connect(m, c) < 0)
goto fail;
pa_threaded_mainloop_lock(m);
op = pa_context_get_source_info_list(c, pulse_source_info, (void *) &e);
while (pa_operation_get_state(op) == PA_OPERATION_RUNNING)
pa_threaded_mainloop_wait(m);
pa_operation_unref(op);
pa_threaded_mainloop_unlock(m);
pa_context_disconnect(c);
fail:
pa_context_unref(c);
pa_threaded_mainloop_stop(m);
pa_threaded_mainloop_free(m);
}
示例7: pulse_close
static void pulse_close(ALCdevice *device)
{
pulse_data *data = device->ExtraData;
pa_threaded_mainloop_lock(data->loop);
if(data->stream)
{
#if PA_CHECK_VERSION(0,9,15)
if(pa_stream_set_buffer_attr_callback)
pa_stream_set_buffer_attr_callback(data->stream, NULL, NULL);
#endif
pa_stream_disconnect(data->stream);
pa_stream_unref(data->stream);
}
pa_context_disconnect(data->context);
pa_context_unref(data->context);
pa_threaded_mainloop_unlock(data->loop);
pa_threaded_mainloop_stop(data->loop);
pa_threaded_mainloop_free(data->loop);
free(data->device_name);
device->ExtraData = NULL;
pa_xfree(data);
}
示例8: pulse_close
static void pulse_close(void)
{
connected = 0;
if (mainloop)
pa_threaded_mainloop_stop(mainloop);
if (stream) {
pa_stream_disconnect(stream);
pa_stream_unref(stream);
stream = NULL;
}
if (context) {
pa_context_disconnect(context);
pa_context_unref(context);
context = NULL;
}
if (mainloop) {
pa_threaded_mainloop_free(mainloop);
mainloop = NULL;
}
volume_time_event = NULL;
volume_valid = 0;
}
示例9: pulse_free
static void pulse_free(void *data)
{
pa_t *pa = (pa_t*)data;
if (!pa)
return;
if (pa->mainloop)
pa_threaded_mainloop_stop(pa->mainloop);
if (pa->stream)
{
pa_stream_disconnect(pa->stream);
pa_stream_unref(pa->stream);
}
if (pa->context)
{
pa_context_disconnect(pa->context);
pa_context_unref(pa->context);
}
if (pa->mainloop)
pa_threaded_mainloop_free(pa->mainloop);
free(pa);
}
示例10: gst_pulsemixer_ctrl_close
static void
gst_pulsemixer_ctrl_close (GstPulseMixerCtrl * c)
{
g_assert (c);
if (c->mainloop)
pa_threaded_mainloop_stop (c->mainloop);
if (c->context) {
pa_context_disconnect (c->context);
pa_context_unref (c->context);
c->context = NULL;
}
if (c->mainloop) {
pa_threaded_mainloop_free (c->mainloop);
c->mainloop = NULL;
c->time_event = NULL;
}
if (c->tracklist) {
g_list_free (c->tracklist);
c->tracklist = NULL;
}
if (c->track) {
GST_PULSEMIXER_TRACK (c->track)->control = NULL;
g_object_unref (c->track);
c->track = NULL;
}
}
示例11: uninit
static void uninit(struct ao *ao)
{
struct priv *priv = ao->priv;
if (priv->mainloop)
pa_threaded_mainloop_stop(priv->mainloop);
if (priv->stream) {
pa_stream_disconnect(priv->stream);
pa_stream_unref(priv->stream);
priv->stream = NULL;
}
if (priv->context) {
pa_context_disconnect(priv->context);
pa_context_unref(priv->context);
priv->context = NULL;
}
if (priv->mainloop) {
pa_threaded_mainloop_free(priv->mainloop);
priv->mainloop = NULL;
}
pthread_cond_destroy(&priv->wakeup);
pthread_mutex_destroy(&priv->wakeup_lock);
}
示例12: lock
void CAESinkPULSE::Deinitialize()
{
CSingleLock lock(m_sec);
m_IsAllocated = false;
m_passthrough = false;
m_periodSize = 0;
if (m_Stream)
Drain();
if (m_MainLoop)
pa_threaded_mainloop_stop(m_MainLoop);
if (m_Stream)
{
pa_stream_disconnect(m_Stream);
pa_stream_unref(m_Stream);
m_Stream = NULL;
m_IsStreamPaused = false;
}
if (m_Context)
{
pa_context_disconnect(m_Context);
pa_context_unref(m_Context);
m_Context = NULL;
}
if (m_MainLoop)
{
pa_threaded_mainloop_free(m_MainLoop);
m_MainLoop = NULL;
}
}
示例13: rdpsnd_pulse_free
static void
rdpsnd_pulse_free(rdpsndDevicePlugin * devplugin)
{
struct pulse_device_data * pulse_data;
pulse_data = (struct pulse_device_data *) devplugin->device_data;
LLOGLN(10, ("rdpsnd_pulse_free:"));
if (!pulse_data)
return;
rdpsnd_pulse_close(devplugin);
if (pulse_data->mainloop)
{
pa_threaded_mainloop_stop(pulse_data->mainloop);
}
if (pulse_data->context)
{
pa_context_disconnect(pulse_data->context);
pa_context_unref(pulse_data->context);
pulse_data->context = NULL;
}
if (pulse_data->mainloop)
{
pa_threaded_mainloop_free(pulse_data->mainloop);
pulse_data->mainloop = NULL;
}
free(pulse_data);
devplugin->device_data = NULL;
}
示例14: quisk_close_sound_pulseaudio
// Close all streams/contexts/loops and return
void quisk_close_sound_pulseaudio() {
int i = 0;
if (quisk_sound_state.verbose_pulse)
printf("Closing Pulseaudio interfaces \n ");
while (OpenPulseDevices[i]) {
pa_stream_disconnect(OpenPulseDevices[i]);
pa_stream_unref(OpenPulseDevices[i]);
OpenPulseDevices[i] = '\0';
i++;
}
if (quisk_sound_state.verbose_pulse)
printf("Waiting for %d streams to disconnect\n", streams_ready);
while(streams_ready > 0);
if (pa_IQ_ctx) {
pa_context_disconnect(pa_IQ_ctx);
pa_context_unref(pa_IQ_ctx);
}
if (pa_ctx) {
pa_context_disconnect(pa_ctx);
pa_context_unref(pa_ctx);
}
if (pa_ml) {
pa_threaded_mainloop_stop(pa_ml);
pa_threaded_mainloop_free(pa_ml);
}
}
示例15: tsmf_pulse_free
static void
tsmf_pulse_free(ITSMFAudioDevice * audio)
{
TSMFPulseAudioDevice * pulse = (TSMFPulseAudioDevice *) audio;
LLOGLN(0, ("tsmf_pulse_free:"));
tsmf_pulse_close_stream(pulse);
if (pulse->mainloop)
{
pa_threaded_mainloop_stop(pulse->mainloop);
}
if (pulse->context)
{
pa_context_disconnect(pulse->context);
pa_context_unref(pulse->context);
pulse->context = NULL;
}
if (pulse->mainloop)
{
pa_threaded_mainloop_free(pulse->mainloop);
pulse->mainloop = NULL;
}
free(pulse);
}