diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-06-11 18:21:53 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-06-12 22:46:02 +0200 |
commit | 3fe6bbd5dcdf603a8dac78b48adf6f0b6604143c (patch) | |
tree | e587b065f89d83202500860aad88c564f26db4b0 /libavfilter/avcodec.c | |
parent | c535494268069282cc1147c4d61d4a88ce39e078 (diff) | |
download | ffmpeg-3fe6bbd5dcdf603a8dac78b48adf6f0b6604143c.tar.gz |
libavfilter: implement avfilter_fill_frame_from_video_buffer_ref()
Diffstat (limited to 'libavfilter/avcodec.c')
-rw-r--r-- | libavfilter/avcodec.c | 18 |
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; +} |