vsrc_buffer: add av_vsrc_buffer_add_frame()

The new function is a wrapper around
av_vsrc_buffer_add_video_buffer_ref(), and allows to simplify the act
of pushing AVFrame data to the source buffer.
This commit is contained in:
Stefano Sabatini
2011-05-19 01:17:16 +02:00
parent d3fddb8454
commit c000a9f783
5 changed files with 31 additions and 7 deletions

View File

@@ -1643,18 +1643,13 @@ static int output_packet(AVInputStream *ist, int ist_index,
#if CONFIG_AVFILTER
if(ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
for(i=0;i<nb_ostreams;i++) {
AVFilterBufferRef *picref;
ost = ost_table[i];
if (ost->input_video_filter && ost->source_index == ist_index) {
if (!picture.sample_aspect_ratio.num)
picture.sample_aspect_ratio = ist->st->sample_aspect_ratio;
picture.pts = ist->pts;
picref =
avfilter_get_video_buffer_ref_from_frame(&picture, AV_PERM_WRITE);
av_vsrc_buffer_add_video_buffer_ref(ost->input_video_filter, picref);
picref->buf->data[0] = NULL;
avfilter_unref_buffer(picref);
av_vsrc_buffer_add_frame(ost->input_video_filter, &picture);
}
}
}