FFmpeg
Loading...
Searching...
No Matches
filters.h File Reference

Go to the source code of this file.

Data Structures

struct  AVBitStreamFilterPad
 A filter pad used for either input or output. More...
 
struct  AVBitStreamFilterLink
 Link properties exposed to filter code, but not external callers. More...
 

Macros

#define FFERROR_BSF_NOT_READY   FFERRTAG('N','R','D','Y')
 Special return code when activate() did not do anything.
 
#define FFERROR_SOURCE_EMPTY   FFERRTAG('M','P','T','Y')
 
#define FF_BSF_PAD_FLAG_NEEDS_WRITABLE   (1 << 0)
 The filter expects writable packets from its input link, duplicating data buffers if needed.
 
#define FF_BSF_PAD_FLAG_FREE_NAME   (1 << 1)
 The pad's name is allocated and should be freed generically.
 
#define BSFILTER_INOUTPADS(inout, array)
 
#define BSFILTER_INPUTS(array)
 
#define BSFILTER_OUTPUTS(array)
 
#define BSF_DEFINE_CLASS_EXT(name, desc, options)
 
#define BSF_DEFINE_CLASS(fname)
 

Functions

void ff_bsf_set_ready (AVBitStreamFilterContext *filter, unsigned priority)
 Mark a filter ready and schedule it for activation.
 
int ff_bsf_filter_packet (AVBitStreamFilterLink *link, AVPacket *pkt)
 Send a packet of data to the next filter.
 
int ff_bsf_request_packet (AVBitStreamFilterLink *link)
 
int ff_bsf_inlink_consume_packet (AVBitStreamFilterLink *link, AVPacket **pkt)
 
void ff_bsf_inlink_request_packet (AVBitStreamFilterLink *link)
 
int ff_bsf_inlink_acknowledge_status (AVBitStreamFilterLink *link, int *rstatus, int64_t *rpts)
 
size_t ff_bsf_inlink_queued_packets (AVBitStreamFilterLink *link)
 
int ff_bsf_inlink_check_available_packet (AVBitStreamFilterLink *link)
 
void ff_bsf_inlink_set_status (AVBitStreamFilterLink *link, int status)
 
void ff_bsf_link_set_in_status (AVBitStreamFilterLink *link, int status, int64_t pts)
 
int ff_bsf_outlink_get_status (AVBitStreamFilterLink *link)
 
int ff_bsf_outlink_packet_wanted (AVBitStreamFilterLink *link)
 
unsigned ff_bsf_source_get_nb_failed_requests (const AVBitStreamFilterContext *src)
 Get the number of failed requests.
 

Variables

const AVBitStreamFilterPad ff_default_bsf_pad [1]
 

Macro Definition Documentation

◆ FFERROR_BSF_NOT_READY

#define FFERROR_BSF_NOT_READY   FFERRTAG('N','R','D','Y')

Special return code when activate() did not do anything.

Definition at line 32 of file filters.h.

Referenced by consume_from_fifos(), ff_bsf_activate(), and filter_activate_default().

◆ FFERROR_SOURCE_EMPTY

#define FFERROR_SOURCE_EMPTY   FFERRTAG('M','P','T','Y')

Definition at line 33 of file filters.h.

Referenced by activate(), av_bsf_sink_get_packet(), and push_packet().

◆ FF_BSF_PAD_FLAG_NEEDS_WRITABLE

#define FF_BSF_PAD_FLAG_NEEDS_WRITABLE   (1 << 0)

The filter expects writable packets from its input link, duplicating data buffers if needed.

input pads only.

Definition at line 56 of file filters.h.

Referenced by filter_packet_framed().

◆ FF_BSF_PAD_FLAG_FREE_NAME

#define FF_BSF_PAD_FLAG_FREE_NAME   (1 << 1)

The pad's name is allocated and should be freed generically.

Definition at line 61 of file filters.h.

Referenced by ff_bsf_free().

◆ BSFILTER_INOUTPADS

#define BSFILTER_INOUTPADS ( inout,
array )
Value:
.inout = array, \
.nb_ ## inout = FF_ARRAY_ELEMS(array)
#define FF_ARRAY_ELEMS(a)
static int array[MAX_W *MAX_W]

Definition at line 142 of file filters.h.

◆ BSFILTER_INPUTS

#define BSFILTER_INPUTS ( array)
Value:
static const AVFilterPad inputs[]
Definition af_aap.c:299
#define BSFILTER_INOUTPADS(inout, array)
Definition filters.h:142

Definition at line 145 of file filters.h.

◆ BSFILTER_OUTPUTS

#define BSFILTER_OUTPUTS ( array)
Value:
static const AVFilterPad outputs[]
Definition af_aap.c:310

Definition at line 146 of file filters.h.

◆ BSF_DEFINE_CLASS_EXT

#define BSF_DEFINE_CLASS_EXT ( name,
desc,
options )
Value:
static const AVClass name##_class = { \
.class_name = desc, \
.item_name = av_default_item_name, \
.option = options, \
.version = LIBAVUTIL_VERSION_INT, \
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
const char * desc
Definition libsvtav1.c:83
@ AV_CLASS_CATEGORY_BITSTREAM_FILTER
Definition log.h:37
const char * name
Definition qsvenc.c:142
Describe the class of an AVClass context structure.
Definition log.h:76

Definition at line 150 of file filters.h.

◆ BSF_DEFINE_CLASS

#define BSF_DEFINE_CLASS ( fname)
Value:
BSF_DEFINE_CLASS_EXT(fname, #fname, fname##_options)
#define BSF_DEFINE_CLASS_EXT(name, desc, options)
Definition filters.h:150

Definition at line 158 of file filters.h.

Function Documentation

◆ ff_bsf_set_ready()

void ff_bsf_set_ready ( AVBitStreamFilterContext * filter,
unsigned priority )

Mark a filter ready and schedule it for activation.

This is automatically done when something happens to the filter (queued packet, status change, request on output). Filters implementing the activate callback can call it directly to perform one more round of processing later. It is also useful for filters reacting to external or asynchronous events.

Definition at line 400 of file bitstreamfilter.c.

Referenced by ff_bsf_filter_packet(), ff_bsf_inlink_request_packet(), ff_bsf_link_set_in_status(), ff_bsf_request_packet(), filter_packet_to_filter(), forward_status_change(), and link_set_out_status().

◆ ff_bsf_filter_packet()

int ff_bsf_filter_packet ( AVBitStreamFilterLink * link,
AVPacket * pkt )

Send a packet of data to the next filter.

Parameters
linkthe output link over which the data is being sent
pkta 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 pkt in case of error.

Definition at line 666 of file bitstreamfilter.c.

Referenced by av_bsf_source_add_packet(), default_filter_packet(), and lcevc_merge().

◆ ff_bsf_request_packet()

int ff_bsf_request_packet ( AVBitStreamFilterLink * link)

Definition at line 568 of file bitstreamfilter.c.

Referenced by request_packet_to_filter().

◆ ff_bsf_inlink_consume_packet()

int ff_bsf_inlink_consume_packet ( AVBitStreamFilterLink * link,
AVPacket ** pkt )

◆ ff_bsf_inlink_request_packet()

void ff_bsf_inlink_request_packet ( AVBitStreamFilterLink * link)

◆ ff_bsf_inlink_acknowledge_status()

int ff_bsf_inlink_acknowledge_status ( AVBitStreamFilterLink * link,
int * rstatus,
int64_t * rpts )

Definition at line 810 of file bitstreamfilter.c.

Referenced by av_bsf_sink_get_packet(), and consume_from_fifos().

◆ ff_bsf_inlink_queued_packets()

size_t ff_bsf_inlink_queued_packets ( AVBitStreamFilterLink * link)

Definition at line 826 of file bitstreamfilter.c.

◆ ff_bsf_inlink_check_available_packet()

int ff_bsf_inlink_check_available_packet ( AVBitStreamFilterLink * link)

Definition at line 832 of file bitstreamfilter.c.

◆ ff_bsf_inlink_set_status()

void ff_bsf_inlink_set_status ( AVBitStreamFilterLink * link,
int status )

Definition at line 875 of file bitstreamfilter.c.

Referenced by ff_packetsync_activate(), and filter_activate_default().

◆ ff_bsf_link_set_in_status()

void ff_bsf_link_set_in_status ( AVBitStreamFilterLink * link,
int status,
int64_t pts )

◆ ff_bsf_outlink_get_status()

int ff_bsf_outlink_get_status ( AVBitStreamFilterLink * link)

◆ ff_bsf_outlink_packet_wanted()

int ff_bsf_outlink_packet_wanted ( AVBitStreamFilterLink * link)

Definition at line 901 of file bitstreamfilter.c.

Referenced by consume_from_fifos().

◆ ff_bsf_source_get_nb_failed_requests()

unsigned ff_bsf_source_get_nb_failed_requests ( const AVBitStreamFilterContext * src)

Get the number of failed requests.

A failed request is when the request_packet method is called while no packet is present in the buffer. The number is reset when a packet is added.

Definition at line 161 of file source.c.

Referenced by av_bsf_graph_source_needs_input().

Variable Documentation

◆ ff_default_bsf_pad

const AVBitStreamFilterPad ff_default_bsf_pad[1]
extern

Definition at line 907 of file bitstreamfilter.c.