buffer.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavcodec/avcodec.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Functions

void ff_avfilter_default_free_buffer (AVFilterBuffer *ptr)
 default handler for freeing audio/video buffer when there are no references left More...
 
AVFilterBufferRefavfilter_ref_buffer (AVFilterBufferRef *ref, int pmask)
 Add a new reference to a buffer. More...
 
void avfilter_unref_buffer (AVFilterBufferRef *ref)
 Remove a reference to a buffer. More...
 
void avfilter_unref_bufferp (AVFilterBufferRef **ref)
 Remove a reference to a buffer and set the pointer to NULL. More...
 
int avfilter_copy_frame_props (AVFilterBufferRef *dst, const AVFrame *src)
 Copy the frame properties of src to dst, without copying the actual image data. More...
 
int avfilter_copy_buf_props (AVFrame *dst, const AVFilterBufferRef *src)
 Copy the frame properties and data pointers of src to dst, without copying the actual data. More...
 
void avfilter_copy_buffer_ref_props (AVFilterBufferRef *dst, AVFilterBufferRef *src)
 Copy properties of src to dst, without copying the actual data. More...
 

Function Documentation

int avfilter_copy_buf_props ( AVFrame dst,
const AVFilterBufferRef src 
)

Copy the frame properties and data pointers of src to dst, without copying the actual data.

Returns
0 on success, a negative number on error.

Definition at line 120 of file buffer.c.

Referenced by poll_filter(), and video_thread().

void avfilter_copy_buffer_ref_props ( AVFilterBufferRef dst,
AVFilterBufferRef src 
)

Copy properties of src to dst, without copying the actual data.

Definition at line 164 of file buffer.c.

Referenced by ff_filter_frame(), filter_frame(), and return_frame().

int avfilter_copy_frame_props ( AVFilterBufferRef dst,
const AVFrame src 
)

Copy the frame properties of src to dst, without copying the actual image data.

Returns
0 on success, a negative number on error.

Definition at line 94 of file buffer.c.

Referenced by av_buffersrc_write_frame(), decode_video(), movie_get_frame(), and video_thread().

AVFilterBufferRef* avfilter_ref_buffer ( AVFilterBufferRef ref,
int  pmask 
)

Add a new reference to a buffer.

Parameters
refan existing reference to the buffer
pmaska bitmask containing the allowable permissions in the new reference
Returns
a new reference to the buffer with the same properties as the old, excluding any permissions denied by pmask

Definition at line 35 of file buffer.c.

Referenced by filter_frame(), request_frame(), and return_audio_frame().

void avfilter_unref_buffer ( AVFilterBufferRef ref)

Remove a reference to a buffer.

If this is the last reference to the buffer, the buffer itself is also automatically freed.

Parameters
refreference to the buffer, may be NULL
Note
it is recommended to use avfilter_unref_bufferp() instead of this function

Definition at line 75 of file buffer.c.

Referenced by add_to_queue(), av_buffersink_read_samples(), av_buffersrc_write_frame(), avfilter_unref_bufferp(), channelmap_filter_frame(), ff_filter_frame(), filter_frame(), flush_fifo(), join_request_frame(), output_frame(), poll_filter(), request_frame(), return_audio_frame(), uninit(), and write_to_fifo().

void avfilter_unref_bufferp ( AVFilterBufferRef **  ref)

Remove a reference to a buffer and set the pointer to NULL.

If this is the last reference to the buffer, the buffer itself is also automatically freed.

Parameters
refpointer to the buffer reference

Definition at line 88 of file buffer.c.

Referenced by alloc_picture(), filter_frame(), join_free_buffer(), join_uninit(), null_filter_frame(), queue_picture(), request_frame(), stream_close(), uninit(), and write_to_fifo().

void ff_avfilter_default_free_buffer ( AVFilterBuffer ptr)

default handler for freeing audio/video buffer when there are no references left

Definition at line 27 of file buffer.c.

Referenced by avfilter_get_audio_buffer_ref_from_arrays(), and avfilter_get_video_buffer_ref_from_arrays().