Libav
Files | Functions

Files

file  buffersink.h
 memory buffer sink API
 
file  buffersink.h
 memory buffer sink API
 

Functions

int av_buffersink_get_frame (AVFilterContext *ctx, AVFrame *frame)
 Get a frame with filtered data from sink and put it in frame. More...
 
int av_buffersink_get_samples (AVFilterContext *ctx, AVFrame *frame, int nb_samples)
 Same as av_buffersink_get_frame(), but with the ability to specify the number of samples read. More...
 

Detailed Description

Function Documentation

int av_buffersink_get_frame ( AVFilterContext ctx,
AVFrame frame 
)

Get a frame with filtered data from sink and put it in frame.

Parameters
ctxpointer to a context of a buffersink or abuffersink AVFilter.
framepointer to an allocated frame that will be filled with data. The data must be freed using av_frame_unref() / av_frame_free()
Returns
  • >= 0 if a frame was successfully returned.
  • AVERROR(EAGAIN) if no frames are available at this point; more input frames must be added to the filtergraph to get more output.
  • AVERROR_EOF if there will be no more output frames on this sink.
  • A different negative AVERROR code in other failure cases.

Definition at line 62 of file buffersink.c.

Referenced by compat_read(), main(), poll_filter(), and video_thread().

int av_buffersink_get_samples ( AVFilterContext ctx,
AVFrame frame,
int  nb_samples 
)

Same as av_buffersink_get_frame(), but with the ability to specify the number of samples read.

This function is less efficient than av_buffersink_get_frame(), because it copies the data around.

Parameters
ctxpointer to a context of the abuffersink AVFilter.
framepointer to an allocated frame that will be filled with data. The data must be freed using av_frame_unref() / av_frame_free() frame will contain exactly nb_samples audio samples, except at the end of stream, when it can contain less than nb_samples.
Returns
The return codes have the same meaning as for av_buffersink_get_samples().
Warning
do not mix this function with av_buffersink_get_frame(). Use only one or the other with a single sink, not both.

Definition at line 102 of file buffersink.c.

Referenced by compat_read(), and poll_filter().