Exemplo n.º 1
0
void
video_decoder_stop(video_decoder_t *vd)
{
  media_pipe_t *mp = vd->vd_mp;

  mp_send_cmd_head(mp, &mp->mp_video, MB_CTRL_EXIT);

  hts_thread_join(&vd->vd_decoder_thread);
  mp_ref_dec(vd->vd_mp);
  vd->vd_mp = NULL;
}
Exemplo n.º 2
0
void
audio_fini(void)
{
  audio_run = 0;

  audio_mode_set(NULL);

  TRACE(TRACE_DEBUG, "AUDIO", "Waiting for audio output thread to terminate");
  hts_thread_join(&audio_thread_id);
  TRACE(TRACE_DEBUG, "AUDIO", "Audio system finialized");
}
Exemplo n.º 3
0
void
video_playback_destroy(video_playback_t *vp)
{
  event_t *e = event_create_type(EVENT_EXIT);

  mp_enqueue_event(vp->vp_mp, e);
  event_release(e);

  hts_thread_join(&vp->vp_thread);
  free(vp);
}
Exemplo n.º 4
0
/**
 * Destroy an audio decoder pipeline.
 *
 * Called from media.c
 */
void
audio_decoder_destroy(audio_decoder_t *ad)
{
  mp_send_cmd_head(ad->ad_mp, &ad->ad_mp->mp_audio, MB_CTRL_EXIT);

  hts_thread_join(&ad->ad_tid);

  audio_decoder_flush(ad);

  hfree(ad->ad_outbuf, AVCODEC_MAX_AUDIO_FRAME_SIZE * 2);
 
  free(ad);
}
Exemplo n.º 5
0
Arquivo: omx.c Projeto: Ezio-PS/movian
static void
omx_mp_fini(media_pipe_t *mp)
{
  if(mp->mp_extra == NULL)
    return;

  omx_clk_t *clk = mp->mp_extra;

  hts_mutex_lock(&mp->mp_mutex);
  omx_clk_do(clk, OMX_CLK_QUIT, 0);
  hts_mutex_unlock(&mp->mp_mutex);
  hts_thread_join(&clk->tid);
  omx_component_destroy(clk->c);
  free(clk);
}
Exemplo n.º 6
0
void
audio_decoder_destroy(struct audio_decoder *ad)
{
  mp_send_cmd(ad->ad_mp, &ad->ad_mp->mp_audio, MB_CTRL_EXIT);
  hts_thread_join(&ad->ad_tid);

  avcodec_free_frame(&ad->ad_frame);

  if(ad->ad_avr != NULL) {
    avresample_close(ad->ad_avr);
    avresample_free(&ad->ad_avr);
  }

  free(ad);
}
Exemplo n.º 7
0
void
audio_decoder_destroy(struct audio_decoder *ad)
{
  mp_send_cmd(ad->ad_mp, &ad->ad_mp->mp_audio, MB_CTRL_EXIT);
  hts_thread_join(&ad->ad_tid);
  mq_flush(ad->ad_mp, &ad->ad_mp->mp_audio, 1);
  av_frame_free(&ad->ad_frame);

  if(ad->ad_avr != NULL) {
    avresample_close(ad->ad_avr);
    avresample_free(&ad->ad_avr);
  }

  audio_cleanup_spdif_muxer(ad);
  free(ad);
}
Exemplo n.º 8
0
static void
enable_test_thread(int on)
{
  if(!generator_tid == !on)
    return;

  if(on) {
    assert(gen_mp == NULL);

    gen_mp = mp_create("testsignal", MP_PRIMABLE);
    hts_thread_create_joinable("audiotest", &generator_tid,
			       test_generator_thread, gen_mp,
			       THREAD_PRIO_DEMUXER);
  } else {
    event_t *e = event_create_type(EVENT_EXIT);
    mp_enqueue_event(gen_mp, e);
    event_release(e);
    hts_thread_join(&generator_tid);
    mp_shutdown(gen_mp);
    mp_ref_dec(gen_mp);
    gen_mp = NULL;
    generator_tid = 0;
  }
}