diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-14 11:46:14 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-19 23:15:33 +0200 |
commit | 9fdf77217b39646afdb8907b977e3d7a59f1cb9e (patch) | |
tree | 166faedba1db3476bd48b0d48840f5fa477f7c5e /libavfilter/avcodec.c | |
parent | 6070b7e1c520e9ca389403bae20a2ad04c7d54c7 (diff) | |
download | ffmpeg-9fdf77217b39646afdb8907b977e3d7a59f1cb9e.tar.gz |
lavfi: add avfilter_get_video_buffer_ref_from_frame to avcodec.h
Simplify passing AVFrame data to av_vsrc_buffer_add_video_buffer_ref().
Diffstat (limited to 'libavfilter/avcodec.c')
-rw-r--r-- | libavfilter/avcodec.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavfilter/avcodec.c b/libavfilter/avcodec.c index c2f8651106..50670bc55e 100644 --- a/libavfilter/avcodec.c +++ b/libavfilter/avcodec.c @@ -40,3 +40,16 @@ void avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src) dst->video->pict_type = src->pict_type; } } + +AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, + int perms) +{ + AVFilterBufferRef *picref = + avfilter_get_video_buffer_ref_from_arrays(frame->data, frame->linesize, perms, + frame->width, frame->height, + frame->format); + if (!picref) + return NULL; + avfilter_copy_frame_props(picref, frame); + return picref; +} |