FFmpeg
Functions
cbs_bsf.c File Reference
#include "bsf.h"
#include "bsf_internal.h"
#include "cbs_bsf.h"

Go to the source code of this file.

Functions

static int cbs_bsf_update_side_data (AVBSFContext *bsf, AVPacket *pkt)
 
int ff_cbs_bsf_generic_filter (AVBSFContext *bsf, AVPacket *pkt)
 Filter operation for CBS BSF. More...
 
int ff_cbs_bsf_generic_init (AVBSFContext *bsf, const CBSBSFType *type)
 Initialise generic CBS BSF setup. More...
 
void ff_cbs_bsf_generic_close (AVBSFContext *bsf)
 Close a generic CBS BSF instance. More...
 

Function Documentation

◆ cbs_bsf_update_side_data()

static int cbs_bsf_update_side_data ( AVBSFContext bsf,
AVPacket pkt 
)
static

Definition at line 23 of file cbs_bsf.c.

Referenced by ff_cbs_bsf_generic_filter().

◆ ff_cbs_bsf_generic_filter()

int ff_cbs_bsf_generic_filter ( AVBSFContext bsf,
AVPacket pkt 
)

Filter operation for CBS BSF.

Reads the input packet into a CBS fragment, calls update_fragment() on it, then writes the result to an output packet. If the input packet has AV_PKT_DATA_NEW_EXTRADATA side-data associated with it then it does the same thing to that new extradata to form the output side-data first.

If the BSF does not do anything else then this function can be used directly as FFBitStreamFilter.filter.

Definition at line 61 of file cbs_bsf.c.

◆ ff_cbs_bsf_generic_init()

int ff_cbs_bsf_generic_init ( AVBSFContext bsf,
const CBSBSFType type 
)

Initialise generic CBS BSF setup.

Creates the input and output CBS instances, and applies the filter to the extradata on the input codecpar if any is present.

Since it calls the update_fragment() function immediately to deal with extradata, this should be called after any codec-specific setup is done (probably at the end of the FFBitStreamFilter.init function).

Definition at line 110 of file cbs_bsf.c.

Referenced by av1_metadata_init(), h264_metadata_init(), h264_redundant_pps_init(), h265_metadata_init(), h266_metadata_init(), mpeg2_metadata_init(), and vp9_metadata_init().

◆ ff_cbs_bsf_generic_close()

void ff_cbs_bsf_generic_close ( AVBSFContext bsf)

Close a generic CBS BSF instance.

If no other deinitialisation is required then this function can be used directly as FFBitStreamFilter.close.

Definition at line 155 of file cbs_bsf.c.