summaryrefslogtreecommitdiff
path: root/libavfilter/avcodec.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-05-14 11:46:14 +0200
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-05-19 23:15:33 +0200
commit9fdf77217b39646afdb8907b977e3d7a59f1cb9e (patch)
tree166faedba1db3476bd48b0d48840f5fa477f7c5e /libavfilter/avcodec.c
parent6070b7e1c520e9ca389403bae20a2ad04c7d54c7 (diff)
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.c13
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;
+}