Commit 5c5f75b9 authored by Nicolas George's avatar Nicolas George

lavfi: add avfilter_get_buffer_ref_from_frame.

parent a8fb7690
...@@ -80,6 +80,20 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame ...@@ -80,6 +80,20 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame
return picref; 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 avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
{ {
int planes, nb_channels; int planes, nb_channels;
......
...@@ -65,6 +65,16 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame ...@@ -65,6 +65,16 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame, AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
int perms); int perms);
/**
* Create and return a buffer reference from the data and properties
* contained in frame.
*
* @param perms permissions to assign to the new buffer reference
*/
AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
const AVFrame *frame,
int perms);
#ifdef FF_API_FILL_FRAME #ifdef FF_API_FILL_FRAME
/** /**
* Fill an AVFrame with the information stored in samplesref. * Fill an AVFrame with the information stored in samplesref.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment