aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/avcodec.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-07-21 00:47:52 +0200
committerNicolas George <nicolas.george@normalesup.org>2012-07-23 17:14:59 +0200
commit5c5f75b92bed707738a2ea6efa0d3b5c003616b6 (patch)
tree8e138c77d8254c5230512f46d400129f94783a86 /libavfilter/avcodec.c
parenta8fb7690d94075388306b80dc48a6ae7f5128ef7 (diff)
downloadffmpeg-5c5f75b92bed707738a2ea6efa0d3b5c003616b6.tar.gz
lavfi: add avfilter_get_buffer_ref_from_frame.
Diffstat (limited to 'libavfilter/avcodec.c')
-rw-r--r--libavfilter/avcodec.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavfilter/avcodec.c b/libavfilter/avcodec.c
index c50cd18f0b..734357c3f1 100644
--- a/libavfilter/avcodec.c
+++ b/libavfilter/avcodec.c
@@ -80,6 +80,20 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame
return picref;
}
+AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
+ const AVFrame *frame,
+ int perms)
+{
+ switch (type) {
+ case AVMEDIA_TYPE_VIDEO:
+ return avfilter_get_video_buffer_ref_from_frame(frame, perms);
+ case AVMEDIA_TYPE_AUDIO:
+ return avfilter_get_audio_buffer_ref_from_frame(frame, perms);
+ default:
+ return NULL;
+ }
+}
+
int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
{
int planes, nb_channels;