当前位置: 首页>>代码示例>>C++>>正文


C++ pa_stream_disconnect函数代码示例

本文整理汇总了C++中pa_stream_disconnect函数的典型用法代码示例。如果您正苦于以下问题:C++ pa_stream_disconnect函数的具体用法?C++ pa_stream_disconnect怎么用?C++ pa_stream_disconnect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pa_stream_disconnect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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);
}
开发者ID:ColinKinloch,项目名称:RetroArch,代码行数:27,代码来源:pulse.c

示例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;
    }
}
开发者ID:interactive-matter,项目名称:ap_led_tile_mplayer,代码行数:27,代码来源:ao_pulse.c

示例3: 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;
}
开发者ID:Pitxyoki,项目名称:audacious-plugins,代码行数:27,代码来源:pulse_audio.c

示例4: pa_stream_set_state_callback

void QPulseAudioInput::close()
{
    if (!m_opened)
        return;

    m_timer->stop();

    QPulseAudioEngine *pulseEngine = QPulseAudioEngine::instance();

    if (m_stream) {
        pulseEngine->lock();

        pa_stream_set_state_callback(m_stream, 0, 0);
        pa_stream_set_read_callback(m_stream, 0, 0);
        pa_stream_set_underflow_callback(m_stream, 0, 0);
        pa_stream_set_overflow_callback(m_stream, 0, 0);

        pa_stream_disconnect(m_stream);
        pa_stream_unref(m_stream);
        m_stream = 0;

        pulseEngine->unlock();
    }

    disconnect(pulseEngine, &QPulseAudioEngine::contextFailed, this, &QPulseAudioInput::onPulseContextFailed);

    if (!m_pullMode && m_audioSource) {
        delete m_audioSource;
        m_audioSource = 0;
    }
    m_opened = false;
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:32,代码来源:qaudioinput_pulse.cpp

示例5: 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);
}
开发者ID:24BitGames,项目名称:LoomSDK,代码行数:29,代码来源:pulseaudio.c

示例6: 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);
}
开发者ID:jmglogow,项目名称:mpv,代码行数:27,代码来源:ao_pulse.c

示例7: uninit

static void uninit(struct ao *ao, bool cut_audio)
{
    struct priv *priv = ao->priv;
    if (priv->stream && !cut_audio) {
        pa_threaded_mainloop_lock(priv->mainloop);
        waitop(priv, pa_stream_drain(priv->stream, success_cb, ao));
    }

    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;
    }
}
开发者ID:Newbleeto,项目名称:mplayer2,代码行数:28,代码来源:ao_pulse.c

示例8: 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;
  }
}
开发者ID:Karlson2k,项目名称:xbmc,代码行数:34,代码来源:AESinkPULSE.cpp

示例9: pulse_close

static void pulse_close(ALCdevice *device) //{{{
{
    pulse_data *data = device->ExtraData;

    pa_threaded_mainloop_lock(data->loop);

    if(data->stream)
    {
        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);

    DestroyRingBuffer(data->ring);
    free(data->device_name);

    device->ExtraData = NULL;
    pa_xfree(data);
} //}}}
开发者ID:siana,项目名称:2p-openal,代码行数:26,代码来源:pulseaudio.c

示例10: pulse_diconnect_stream

/*
 * Disconnect from the pulse audio stream
 */
static void pulse_diconnect_stream(struct pulse_data *data)
{
	if (data->stream) {
		pa_stream_disconnect(data->stream);
		pa_stream_unref(data->stream);
	}
}
开发者ID:Jhonthe7th,项目名称:obs-studio,代码行数:10,代码来源:pulse-input.c

示例11: pulse_stop_playback

static void pulse_stop_playback(ALCdevice *device) //{{{
{
    pulse_data *data = device->ExtraData;

    if(!data->stream)
        return;

    data->killNow = AL_TRUE;
    if(data->thread)
    {
        pa_threaded_mainloop_signal(data->loop, 0);
        StopThread(data->thread);
        data->thread = NULL;
    }
    data->killNow = AL_FALSE;

    pa_threaded_mainloop_lock(data->loop);

#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_set_moved_callback(data->stream, NULL, NULL);
    pa_stream_set_write_callback(data->stream, NULL, NULL);
    pa_stream_set_underflow_callback(data->stream, NULL, NULL);
    pa_stream_disconnect(data->stream);
    pa_stream_unref(data->stream);
    data->stream = NULL;

    pa_threaded_mainloop_unlock(data->loop);
} //}}}
开发者ID:siana,项目名称:2p-openal,代码行数:31,代码来源:pulseaudio.c

示例12: 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;
}
开发者ID:Kafay,项目名称:vlc,代码行数:26,代码来源:pulse.c

示例13: 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);
    }
}
开发者ID:gonesurfing,项目名称:quisk-main,代码行数:35,代码来源:sound_pulseaudio.c

示例14: pa_threaded_mainloop_lock

void AudioOutputPulseAudio::CloseDevice()
{
    if (mainloop)
        pa_threaded_mainloop_lock(mainloop);

    if (pstream)
    {
        FlushStream("CloseDevice");
        pa_stream_disconnect(pstream);
        pa_stream_unref(pstream);
        pstream = NULL;
    }

    if (pcontext)
    {
        pa_context_drain(pcontext, NULL, NULL);
        pa_context_disconnect(pcontext);
        pa_context_unref(pcontext);
        pcontext = NULL;
    }

    if (mainloop)
    {
        pa_threaded_mainloop_unlock(mainloop);
        pa_threaded_mainloop_stop(mainloop);
        mainloop = NULL;
    }
}
开发者ID:microe,项目名称:mythtv,代码行数:28,代码来源:audiooutputpulse.cpp

示例15: GM_DEBUG_PRINT

void PulseOutput::close() {
#ifdef DEBUG
  context->getReactor().debug();
#endif

  if (stream) {
    GM_DEBUG_PRINT("[pulse] disconnecting stream\n");
    pa_stream_disconnect(stream);
    pa_stream_unref(stream);
    stream=nullptr;
    }

  if (pulse_context) {
    GM_DEBUG_PRINT("[pulse] disconnecting context\n");
    pa_context_disconnect(pulse_context);
    pa_context_unref(pulse_context);
    pulse_context=nullptr;
    }
#ifdef DEBUG
  context->getReactor().debug();
#endif

  delete pa_io_event::recycle;
  delete pa_time_event::recycle;
  delete pa_defer_event::recycle;
  pa_io_event::recycle    = nullptr;
  pa_time_event::recycle  = nullptr;
  pa_defer_event::recycle = nullptr;
  pulsevolume             = PA_VOLUME_MUTED;
  af.reset();
  }
开发者ID:gogglesmm,项目名称:gogglesmm,代码行数:31,代码来源:ap_pulse.cpp


注:本文中的pa_stream_disconnect函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。