示例#1
0
文件: ov.c 项目: Jheengut/gmerlin
void bg_ov_close(bg_ov_t * ov)
  {
  LOCK(ov);
  ov->plugin->close(ov->priv);
  UNLOCK(ov);

  if(ov->still_frame)
    {
    gavl_video_frame_destroy(ov->still_frame);
    ov->still_frame = NULL;
    }

  if(ov->num_ovl_str)
    {
    int i;
    for(i = 0; i < ov->num_ovl_str; i++)
      {
      if(ov->ovl_str[i].ctx)
        gavl_overlay_blend_context_destroy(ov->ovl_str[i].ctx);
      }
    free(ov->ovl_str);
    ov->ovl_str = NULL;
    ov->num_ovl_str = 0;
    }

  if(ov->sink_ext)
    {
    gavl_video_sink_destroy(ov->sink_ext);
    ov->sink_ext = NULL;
    }
  }
示例#2
0
文件: gavf.c 项目: kidaa/gmerlin
static void gavf_stream_free(gavf_stream_t * s)
{
    if(s->asrc)
        gavl_audio_source_destroy(s->asrc);
    if(s->vsrc)
        gavl_video_source_destroy(s->vsrc);
    if(s->psrc)
        gavl_packet_source_destroy(s->psrc);

    if(s->asink)
        gavl_audio_sink_destroy(s->asink);
    if(s->vsink)
        gavl_video_sink_destroy(s->vsink);
    if(s->psink)
        gavl_packet_sink_destroy(s->psink);
    if(s->pb)
        gavf_packet_buffer_destroy(s->pb);

    if(s->aframe)
    {
        gavl_audio_frame_null(s->aframe);
        gavl_audio_frame_destroy(s->aframe);
    }
    if(s->vframe)
    {
        gavl_video_frame_null(s->vframe);
        gavl_video_frame_destroy(s->vframe);
    }
}
示例#3
0
文件: ov.c 项目: Jheengut/gmerlin
void bg_ov_destroy(bg_ov_t * ov)
  {
  if(ov->flags & FLAG_OPEN)
    {
    LOCK(ov);
    ov->plugin->close(ov->priv);
    UNLOCK(ov);
    }
  bg_plugin_unref(ov->h);
  if(ov->sink_ext)
    gavl_video_sink_destroy(ov->sink_ext);
  free(ov);
  }
示例#4
0
int bg_ogg_encoder_close(void * data, int do_delete)
  {
  int ret = 1;
  int i;
  bg_ogg_encoder_t * e = data;

  if(!e->write_callback_data)
    return 1;
  
  for(i = 0; i < e->num_audio_streams; i++)
    {
    bg_ogg_stream_t * s = &e->audio_streams[i];
    
    if(!s->codec->close(e->audio_streams[i].codec_priv))
      {
      ret = 0;
      break;
      }

    flush_stream(s);
    ogg_stream_clear(&s->os);
    
    if(s->asink)
      {
      gavl_audio_sink_destroy(s->asink);
      s->asink = NULL;
      }
    if(s->psink_out)
      {
      gavl_packet_sink_destroy(s->psink_out);
      s->psink_out = NULL;
      }
    }
  for(i = 0; i < e->num_video_streams; i++)
    {
    bg_ogg_stream_t * s = &e->video_streams[i];
    if(!s->codec->close(s->codec_priv))
      {
      ret = 0;
      break;
      }
    flush_stream(s);
    ogg_stream_clear(&s->os);

    if(s->vsink)
      {
      gavl_video_sink_destroy(s->vsink);
      s->vsink = NULL;
      }
    if(s->psink_out)
      {
      gavl_packet_sink_destroy(s->psink_out);
      s->psink_out = NULL;
      }
    }
  
  e->close_callback(e->write_callback_data);
  e->write_callback_data = NULL;
  if(do_delete && e->filename)
    remove(e->filename);
  return ret;
  }