libavfilter/internal.h File Reference

internal API functions More...

#include "avfilter.h"
#include "avfiltergraph.h"
#include "formats.h"
#include "video.h"
Include dependency graph for libavfilter/internal.h:

Go to the source code of this file.

Data Structures

struct  AVFilterPool
 
struct  AVFilterCommand
 
struct  AVFilterPad
 A filter pad used for either input or output. More...
 

Macros

#define POOL_SIZE   32
 
#define ff_tlog(pctx, ...)   do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
 
#define FF_TPRINTF_START(ctx, func)   ff_tlog(NULL, "%-16s: ", #func)
 
#define AVFILTER_DEFINE_CLASS(fname)
 
#define FF_INLINK_IDX(link)   ((int)((link)->dstpad - (link)->dst->input_pads))
 Find the index of a link. More...
 
#define FF_OUTLINK_IDX(link)   ((int)((link)->srcpad - (link)->src->output_pads))
 

Typedefs

typedef struct AVFilterPool AVFilterPool
 
typedef struct AVFilterCommand AVFilterCommand
 

Enumerations

enum  { FF_LINK_FLAG_REQUEST_LOOP = 1 }
 Flags for AVFilterLink.flags. More...
 

Functions

void ff_avfilter_graph_update_heap (AVFilterGraph *graph, AVFilterLink *link)
 Update the position of a link in the age heap. More...
 
void ff_avfilter_default_free_buffer (AVFilterBuffer *buf)
 default handler for freeing audio/video buffer when there are no references left More...
 
int ff_fmt_is_in (int fmt, const int *fmts)
 Tell is a format is contained in the provided list terminated by -1. More...
 
int * ff_copy_int_list (const int *const list)
 Return a copy of a list of integers terminated by -1, or NULL in case of copy failure. More...
 
int64_t * ff_copy_int64_list (const int64_t *const list)
 Return a copy of a list of 64-bit integers, or NULL in case of copy failure. More...
 
int ff_parse_pixel_format (enum AVPixelFormat *ret, const char *arg, void *log_ctx)
 Parse a pixel format. More...
 
int ff_parse_sample_rate (int *ret, const char *arg, void *log_ctx)
 Parse a sample rate. More...
 
int ff_parse_time_base (AVRational *ret, const char *arg, void *log_ctx)
 Parse a time base. More...
 
int ff_parse_sample_format (int *ret, const char *arg, void *log_ctx)
 Parse a sample format name or a corresponding integer representation. More...
 
int ff_parse_channel_layout (int64_t *ret, const char *arg, void *log_ctx)
 Parse a channel layout or a corresponding integer representation. More...
 
void ff_update_link_current_pts (AVFilterLink *link, int64_t pts)
 
void ff_command_queue_pop (AVFilterContext *filter)
 
char * ff_get_ref_perms_string (char *buf, size_t buf_size, int perms)
 
void ff_tlog_ref (void *ctx, AVFrame *ref, int end)
 
void ff_tlog_link (void *ctx, AVFilterLink *link, int end)
 
void ff_insert_pad (unsigned idx, unsigned *count, size_t padidx_off, AVFilterPad **pads, AVFilterLink ***links, AVFilterPad *newpad)
 Insert a new pad. More...
 
static void ff_insert_inpad (AVFilterContext *f, unsigned index, AVFilterPad *p)
 Insert a new input pad for the filter. More...
 
static void ff_insert_outpad (AVFilterContext *f, unsigned index, AVFilterPad *p)
 Insert a new output pad for the filter. More...
 
int ff_poll_frame (AVFilterLink *link)
 Poll a frame from the filter chain. More...
 
int ff_request_frame (AVFilterLink *link)
 Request an input frame from the filter at the other end of the link. More...
 
AVFilterBufferRef * ff_copy_buffer_ref (AVFilterLink *outlink, AVFilterBufferRef *ref)
 
int ff_buffersink_read_compat (AVFilterContext *ctx, AVFilterBufferRef **buf)
 
int ff_buffersink_read_samples_compat (AVFilterContext *ctx, AVFilterBufferRef **pbuf, int nb_samples)
 
int ff_filter_frame (AVFilterLink *link, AVFrame *frame)
 Send a frame of data to the next filter. More...
 
AVFilterContextff_filter_alloc (const AVFilter *filter, const char *inst_name)
 Allocate a new filter context and return it. More...
 
void ff_filter_graph_remove_filter (AVFilterGraph *graph, AVFilterContext *filter)
 Remove a filter from a graph;. More...
 

Detailed Description

internal API functions

Definition in file libavfilter/internal.h.

Macro Definition Documentation

#define AVFILTER_DEFINE_CLASS (   fname)
Value:
static const AVClass fname##_class = { \
.class_name = #fname, \
.item_name = av_default_item_name, \
.option = fname##_options, \
.version = LIBAVUTIL_VERSION_INT, \
.category = AV_CLASS_CATEGORY_FILTER, \
}
av_default_item_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:55
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
Describe the class of an AVClass context structure.
Definition: log.h:50

Definition at line 292 of file libavfilter/internal.h.

Referenced by compute_dar(), filter_frame(), movie_request_frame(), query_formats(), and request_frame().

#define FF_INLINK_IDX (   link)    ((int)((link)->dstpad - (link)->dst->input_pads))

Find the index of a link.

I.e. find i such that link == ctx->(in|out)puts[i]

Definition at line 309 of file libavfilter/internal.h.

Referenced by filter_frame(), get_audio_buffer(), get_video_buffer(), and process_frame().

#define FF_OUTLINK_IDX (   link)    ((int)((link)->srcpad - (link)->src->output_pads))
#define ff_tlog (   pctx,
  ... 
)    do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)

Definition at line 225 of file libavfilter/internal.h.

Referenced by ff_filter_frame(), ff_tlog_link(), and ff_tlog_ref().

#define FF_TPRINTF_START (   ctx,
  func 
)    ff_tlog(NULL, "%-16s: ", #func)

Definition at line 228 of file libavfilter/internal.h.

Referenced by ff_filter_frame(), ff_get_video_buffer(), and ff_request_frame().

#define POOL_SIZE   32

Definition at line 32 of file libavfilter/internal.h.

Referenced by ff_default_get_video_buffer().

Typedef Documentation

typedef struct AVFilterPool AVFilterPool

Enumeration Type Documentation

anonymous enum

Flags for AVFilterLink.flags.

Enumerator
FF_LINK_FLAG_REQUEST_LOOP 

Frame requests may need to loop in order to be fulfilled.

A filter must set this flags on an output link if it may return 0 in request_frame() without filtering a frame.

Definition at line 331 of file libavfilter/internal.h.

Function Documentation

void ff_avfilter_default_free_buffer ( AVFilterBuffer *  buf)

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

Definition at line 34 of file libavfilter/buffer.c.

Referenced by ff_default_get_video_buffer(), and ff_get_audio_buffer().

void ff_avfilter_graph_update_heap ( AVFilterGraph graph,
AVFilterLink link 
)

Update the position of a link in the age heap.

Definition at line 1159 of file avfiltergraph.c.

Referenced by ff_update_link_current_pts().

int ff_buffersink_read_compat ( AVFilterContext ctx,
AVFilterBufferRef **  buf 
)
int ff_buffersink_read_samples_compat ( AVFilterContext ctx,
AVFilterBufferRef **  pbuf,
int  nb_samples 
)
void ff_command_queue_pop ( AVFilterContext filter)

Definition at line 84 of file avfilter.c.

Referenced by avfilter_free(), and ff_filter_frame_framed().

AVFilterBufferRef* ff_copy_buffer_ref ( AVFilterLink outlink,
AVFilterBufferRef *  ref 
)
int64_t* ff_copy_int64_list ( const int64_t *const  list)

Return a copy of a list of 64-bit integers, or NULL in case of copy failure.

Definition at line 284 of file formats.c.

int* ff_copy_int_list ( const int *const  list)

Return a copy of a list of integers terminated by -1, or NULL in case of copy failure.

Definition at line 277 of file formats.c.

AVFilterContext* ff_filter_alloc ( const AVFilter filter,
const char *  inst_name 
)

Allocate a new filter context and return it.

Parameters
filterwhat filter to create an instance of
inst_namename to give to the new filter context
Returns
newly created filter context or NULL on failure

Definition at line 495 of file avfilter.c.

Referenced by avfilter_graph_alloc_filter(), and ff_filter_alloc().

int ff_filter_frame ( AVFilterLink link,
AVFrame frame 
)

Send a frame of data to the next filter.

Parameters
linkthe output link over which the data is being sent
framea reference to the buffer of data being sent. The receiving filter will free this reference when it no longer needs it or pass it on to the next filter.
Returns
>= 0 on success, a negative AVERROR on error. The receiving filter is responsible for unreferencing frame in case of error.

Definition at line 964 of file avfilter.c.

Referenced by default_filter_frame().

void ff_filter_graph_remove_filter ( AVFilterGraph graph,
AVFilterContext filter 
)

Remove a filter from a graph;.

Definition at line 62 of file avfiltergraph.c.

Referenced by avfilter_free().

int ff_fmt_is_in ( int  fmt,
const int *  fmts 
)

Tell is a format is contained in the provided list terminated by -1.

Definition at line 254 of file formats.c.

Referenced by config_input(), config_input_main(), config_input_overlay(), config_out_props(), and config_props().

char* ff_get_ref_perms_string ( char *  buf,
size_t  buf_size,
int  perms 
)
static void ff_insert_inpad ( AVFilterContext f,
unsigned  index,
AVFilterPad p 
)
inlinestatic

Insert a new input pad for the filter.

Definition at line 254 of file libavfilter/internal.h.

Referenced by decimate_init(), fieldmatch_init(), init(), and join_init().

static void ff_insert_outpad ( AVFilterContext f,
unsigned  index,
AVFilterPad p 
)
inlinestatic

Insert a new output pad for the filter.

Definition at line 265 of file libavfilter/internal.h.

Referenced by init(), movie_common_init(), and split_init().

void ff_insert_pad ( unsigned  idx,
unsigned *  count,
size_t  padidx_off,
AVFilterPad **  pads,
AVFilterLink ***  links,
AVFilterPad newpad 
)

Insert a new pad.

Parameters
idxInsertion point. Pad is inserted at the end if this point is beyond the end of the list of pads.
countPointer to the number of pads in the list
padidx_offOffset within an AVFilterLink structure to the element to increment when inserting a new pad causes link numbering to change
padsPointer to the pointer to the beginning of the list of pads
linksPointer to the pointer to the beginning of the list of links
newpadThe new pad to add. A copy is made when adding.

Definition at line 93 of file avfilter.c.

Referenced by ff_insert_inpad(), and ff_insert_outpad().

int ff_parse_channel_layout ( int64_t *  ret,
const char *  arg,
void log_ctx 
)

Parse a channel layout or a corresponding integer representation.

Parameters
ret64bit integer pointer to where the value should be written.
argstring to parse
log_ctxlog context
Returns
0 in case of success, a negative AVERROR code on error

Definition at line 632 of file formats.c.

Referenced by init().

int ff_parse_pixel_format ( enum AVPixelFormat ret,
const char *  arg,
void log_ctx 
)

Parse a pixel format.

Parameters
retpixel format pointer to where the value should be written
argstring to parse
log_ctxlog context
Returns
0 in case of success, a negative AVERROR code on error

Definition at line 579 of file formats.c.

Referenced by init().

int ff_parse_sample_format ( int *  ret,
const char *  arg,
void log_ctx 
)

Parse a sample format name or a corresponding integer representation.

Parameters
retinteger pointer to where the value should be written
argstring to parse
log_ctxlog context
Returns
0 in case of success, a negative AVERROR code on error

Definition at line 594 of file formats.c.

Referenced by init().

int ff_parse_sample_rate ( int *  ret,
const char *  arg,
void log_ctx 
)

Parse a sample rate.

Parameters
retunsigned integer pointer to where the value should be written
argstring to parse
log_ctxlog context
Returns
0 in case of success, a negative AVERROR code on error

Definition at line 620 of file formats.c.

Referenced by init().

int ff_parse_time_base ( AVRational ret,
const char *  arg,
void log_ctx 
)

Parse a time base.

Parameters
retunsigned AVRational pointer to where the value should be written
argstring to parse
log_ctxlog context
Returns
0 in case of success, a negative AVERROR code on error

Definition at line 609 of file formats.c.

int ff_poll_frame ( AVFilterLink link)

Poll a frame from the filter chain.

Parameters
linkthe input link
Returns
the number of immediately available frames, a negative number in case of error

Definition at line 350 of file avfilter.c.

Referenced by av_buffersink_poll_frame(), av_buffersink_set_frame_size(), ff_insert_outpad(), and ff_poll_frame().

int ff_request_frame ( AVFilterLink link)

Request an input frame from the filter at the other end of the link.

Parameters
linkthe input link
Returns
zero on success

Definition at line 319 of file avfilter.c.

Referenced by av_buffersink_get_frame_flags(), avfilter_graph_request_oldest(), ff_insert_outpad(), ff_request_frame(), join_request_frame(), request_frame(), request_inlink(), request_samples(), return_audio_frame(), and while().

void ff_tlog_link ( void ctx,
AVFilterLink link,
int  end 
)

Definition at line 295 of file avfilter.c.

Referenced by ff_filter_frame(), ff_get_video_buffer(), and ff_request_frame().

void ff_tlog_ref ( void ctx,
AVFrame ref,
int  end 
)

Definition at line 40 of file avfilter.c.

Referenced by ff_filter_frame().

void ff_update_link_current_pts ( AVFilterLink link,
int64_t  pts 
)

Definition at line 368 of file avfilter.c.

Referenced by ff_filter_frame_framed().