aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/avcodec.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-06-11 18:21:53 +0200
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-06-12 22:46:02 +0200
commit3fe6bbd5dcdf603a8dac78b48adf6f0b6604143c (patch)
treee587b065f89d83202500860aad88c564f26db4b0 /libavfilter/avcodec.c
parentc535494268069282cc1147c4d61d4a88ce39e078 (diff)
downloadffmpeg-3fe6bbd5dcdf603a8dac78b48adf6f0b6604143c.tar.gz
libavfilter: implement avfilter_fill_frame_from_video_buffer_ref()
Diffstat (limited to 'libavfilter/avcodec.c')
-rw-r--r--libavfilter/avcodec.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavfilter/avcodec.c b/libavfilter/avcodec.c
index 50670bc55e..2010040d14 100644
--- a/libavfilter/avcodec.c
+++ b/libavfilter/avcodec.c
@@ -53,3 +53,21 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame
avfilter_copy_frame_props(picref, frame);
return picref;
}
+
+int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
+ const AVFilterBufferRef *picref)
+{
+ if (!picref || !picref->video || !frame)
+ return AVERROR(EINVAL);
+
+ memcpy(frame->data, picref->data, sizeof(frame->data));
+ memcpy(frame->linesize, picref->linesize, sizeof(frame->linesize));
+ frame->pkt_pos = picref->pos;
+ frame->interlaced_frame = picref->video->interlaced;
+ frame->top_field_first = picref->video->top_field_first;
+ frame->key_frame = picref->video->key_frame;
+ frame->pict_type = picref->video->pict_type;
+ frame->sample_aspect_ratio = picref->video->sample_aspect_ratio;
+
+ return 0;
+}