Browse Source

lavfi: add avfilter_get_buffer_ref_from_frame.

tags/n1.0
Nicolas George 13 years ago
parent
commit
5c5f75b92b
2 changed files with 24 additions and 0 deletions
  1. +14
    -0
      libavfilter/avcodec.c
  2. +10
    -0
      libavfilter/avcodec.h

+ 14
- 0
libavfilter/avcodec.c View File

@@ -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;


+ 10
- 0
libavfilter/avcodec.h View File

@@ -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,
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
/**
* Fill an AVFrame with the information stored in samplesref.


Loading…
Cancel
Save