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 | |
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')
-rw-r--r-- | libavfilter/avcodec.c | 13 | ||||
-rw-r--r-- | libavfilter/avcodec.h | 8 | ||||
-rw-r--r-- | libavfilter/avfilter.h | 2 |
3 files changed, 22 insertions, 1 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; +} diff --git a/libavfilter/avcodec.h b/libavfilter/avcodec.h index f438860d0b..e6ae907391 100644 --- a/libavfilter/avcodec.h +++ b/libavfilter/avcodec.h @@ -37,4 +37,12 @@ */ void avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src); +/** + * Create and return a picref reference from the data and properties + * contained in frame. + * + * @param perms permissions to assign to the new buffer reference + */ +AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms); + #endif /* AVFILTER_AVCODEC_H */ diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 03a1e49a46..171c9e4c74 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -26,7 +26,7 @@ #include "libavutil/samplefmt.h" #define LIBAVFILTER_VERSION_MAJOR 2 -#define LIBAVFILTER_VERSION_MINOR 5 +#define LIBAVFILTER_VERSION_MINOR 6 #define LIBAVFILTER_VERSION_MICRO 0 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ |