FFmpeg
Macros | Functions | Variables
bsfgraph.c File Reference
#include "config.h"
#include <stddef.h>
#include <string.h>
#include "libavutil/avassert.h"
#include "libavutil/error.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "bsf.h"
#include "bsf_internal.h"

Go to the source code of this file.

Macros

#define OFFSET(x)   offsetof(AVBitStreamFilterGraph, x)
 
#define FLAGS   (AV_OPT_FLAG_BSF_PARAM|AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_VIDEO_PARAM)
 

Functions

AVBitStreamFilterGraphav_bsf_graph_alloc (void)
 Allocate a filter graph. More...
 
void ff_bsf_graph_remove_filter (AVBitStreamFilterGraph *graph, AVBitStreamFilterContext *filter)
 Remove a filter from a graph;. More...
 
AVBitStreamFilterContextav_bsf_graph_get_filter (AVBitStreamFilterGraph *graph, const char *name)
 Get a filter instance identified by instance name from graph. More...
 
void av_bsf_graph_free (AVBitStreamFilterGraph **graphp)
 Free a graph, destroy its links, and set *graph to NULL. More...
 
int av_bsf_graph_create_filter (AVBitStreamFilterContext **filt_ctx, const AVBitStreamFilter *filt, const char *name, AVDictionary **options, AVBitStreamFilterGraph *graph_ctx)
 A convenience wrapper that allocates and initializes a filter in a single step. More...
 
int av_bsf_graph_alloc_filter (AVBitStreamFilterContext **filt_ctx, const AVBitStreamFilter *filter, const char *name, AVBitStreamFilterGraph *graph)
 Create a new filter instance in a filter graph. More...
 
static int graph_check_validity (AVBitStreamFilterGraph *graph, void *log_ctx)
 Check for the validity of graph. More...
 
static int graph_config_links (AVBitStreamFilterGraph *graph, void *log_ctx)
 Configure all the links of graphctx. More...
 
static int graph_config_pointers (AVBitStreamFilterGraph *graph, void *log_ctx)
 
int av_bsf_graph_config (AVBitStreamFilterGraph *graphctx, void *log_ctx)
 Check validity and configure all the links and formats in the graph. More...
 
static void heap_bubble_up (FFBitStreamFilterGraph *graph, BitStreamFilterLinkInternal *li, int index)
 
static void heap_bubble_down (FFBitStreamFilterGraph *graph, BitStreamFilterLinkInternal *li, int index)
 
void ff_bsf_graph_update_heap (AVBitStreamFilterGraph *graph, BitStreamFilterLinkInternal *li)
 
int ff_bsf_graph_run_once (AVBitStreamFilterGraph *graph)
 Run one round of processing on a filter graph. More...
 
int av_bsf_graph_source_needs_input (const AVBitStreamFilterGraph *graph)
 Get the index of the source filter in the filtergraph that reported needing input more urgently. More...
 

Variables

static const AVOption filtergraph_options []
 
static const AVClass filtergraph_class
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(AVBitStreamFilterGraph, x)

Definition at line 32 of file bsfgraph.c.

◆ FLAGS

Definition at line 33 of file bsfgraph.c.

Function Documentation

◆ ff_bsf_graph_remove_filter()

void ff_bsf_graph_remove_filter ( AVBitStreamFilterGraph graph,
AVBitStreamFilterContext filter 
)

Remove a filter from a graph;.

Definition at line 64 of file bsfgraph.c.

Referenced by ff_bsf_free().

◆ graph_check_validity()

static int graph_check_validity ( AVBitStreamFilterGraph graph,
void *  log_ctx 
)
static

Check for the validity of graph.

A graph is considered valid if all its input and output pads are connected.

Returns
>= 0 in case of success, a negative value otherwise

Definition at line 177 of file bsfgraph.c.

Referenced by av_bsf_graph_config().

◆ graph_config_links()

static int graph_config_links ( AVBitStreamFilterGraph graph,
void *  log_ctx 
)
static

Configure all the links of graphctx.

Returns
>= 0 in case of success, a negative value otherwise

Definition at line 215 of file bsfgraph.c.

Referenced by av_bsf_graph_config().

◆ graph_config_pointers()

static int graph_config_pointers ( AVBitStreamFilterGraph graph,
void *  log_ctx 
)
static

Definition at line 232 of file bsfgraph.c.

Referenced by av_bsf_graph_config().

◆ heap_bubble_up()

static void heap_bubble_up ( FFBitStreamFilterGraph graph,
BitStreamFilterLinkInternal li,
int  index 
)
static

Definition at line 310 of file bsfgraph.c.

Referenced by ff_bsf_graph_update_heap().

◆ heap_bubble_down()

static void heap_bubble_down ( FFBitStreamFilterGraph graph,
BitStreamFilterLinkInternal li,
int  index 
)
static

Definition at line 329 of file bsfgraph.c.

Referenced by ff_bsf_graph_update_heap().

◆ ff_bsf_graph_update_heap()

void ff_bsf_graph_update_heap ( AVBitStreamFilterGraph graph,
BitStreamFilterLinkInternal li 
)

Definition at line 353 of file bsfgraph.c.

Referenced by update_link_current_pts().

◆ ff_bsf_graph_run_once()

int ff_bsf_graph_run_once ( AVBitStreamFilterGraph graph)

Run one round of processing on a filter graph.

Definition at line 361 of file bsfgraph.c.

Referenced by av_bsf_sink_get_packet(), and push_packet().

Variable Documentation

◆ filtergraph_options

const AVOption filtergraph_options[]
static
Initial value:
= {
{"max_buffered_packets" , "maximum number of buffered packets allowed", OFFSET(max_buffered_packets),
AV_OPT_TYPE_UINT, {.i64 = 0}, 0, UINT_MAX, FLAGS },
{ NULL },
}

Definition at line 34 of file bsfgraph.c.

◆ filtergraph_class

const AVClass filtergraph_class
static
Initial value:
= {
.class_name = "AVBitStreamFilterGraph",
.item_name = av_default_item_name,
}

Definition at line 40 of file bsfgraph.c.

Referenced by av_bsf_graph_alloc().

OFFSET
#define OFFSET(x)
Definition: bsfgraph.c:32
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
FLAGS
#define FLAGS
Definition: bsfgraph.c:33
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:242
AV_OPT_TYPE_UINT
@ AV_OPT_TYPE_UINT
Underlying C type is unsigned int.
Definition: opt.h:334
filtergraph_options
static const AVOption filtergraph_options[]
Definition: bsfgraph.c:34
AV_CLASS_CATEGORY_BITSTREAM_FILTER
@ AV_CLASS_CATEGORY_BITSTREAM_FILTER
Definition: log.h:37