diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-04-28 13:05:09 +0200 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-05-04 23:26:40 +0200 |
commit | 32094285adea48eb2ad5a23f94fc289ac225a3b7 (patch) | |
tree | 702be70a36c46f68c948ffeaf95541e9e28bfbf8 /libavfilter/avcodec.c | |
parent | 9e6a1c8981bffcb5401f60b3eec6c65b6e846a52 (diff) | |
download | ffmpeg-32094285adea48eb2ad5a23f94fc289ac225a3b7.tar.gz |
lavfi: implement avfilter_get_audio_buffer_ref_from_frame.
Diffstat (limited to 'libavfilter/avcodec.c')
-rw-r--r-- | libavfilter/avcodec.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavfilter/avcodec.c b/libavfilter/avcodec.c index 3581aef83a..e5f2bc3c53 100644 --- a/libavfilter/avcodec.c +++ b/libavfilter/avcodec.c @@ -56,6 +56,20 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame return picref; } +AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame, + int perms) +{ + AVFilterBufferRef *picref = + avfilter_get_audio_buffer_ref_from_arrays((uint8_t **)frame->data, (int *)frame->linesize, perms, + frame->nb_samples, frame->format, + av_frame_get_channel_layout(frame), + av_sample_fmt_is_planar(frame->format)); + if (!picref) + return NULL; + avfilter_copy_frame_props(picref, frame); + return picref; +} + int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame, const AVFilterBufferRef *samplesref) { |