FFmpeg
Enumerations | Functions

The source filter is there to connect filter graphs to applications They have a single output, connected to the graph, and no input. Packets must be fed to it using av_bsf_source_add_packet(). More...

Enumerations

enum  { AV_BSF_SOURCE_FLAG_PUSH = 1 << 0, AV_BSF_SOURCE_FLAG_KEEP_REF = 1 << 1 }
 

Functions

int av_bsf_source_parameters_set (AVBitStreamFilterContext *ctx, const AVCodecParameters *par)
 Initialize the source filter with the provided parameters. More...
 
av_warn_unused_result int av_bsf_source_add_packet (AVBitStreamFilterContext *ctx, AVPacket *pkt, int flags)
 Add a packet to the buffer source. More...
 
int av_bsf_source_get_status (AVBitStreamFilterContext *ctx)
 Returns 0 or a negative AVERROR code. More...
 
int av_bsf_source_close (AVBitStreamFilterContext *ctx, int64_t pts, unsigned flags)
 Close the source after EOF. More...
 

Detailed Description

The source filter is there to connect filter graphs to applications They have a single output, connected to the graph, and no input. Packets must be fed to it using av_bsf_source_add_packet().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
AV_BSF_SOURCE_FLAG_PUSH 

Immediately push the packet to the output.

AV_BSF_SOURCE_FLAG_KEEP_REF 

Keep a reference to the packet.

Definition at line 590 of file bsf.h.

Function Documentation

◆ av_bsf_source_parameters_set()

int av_bsf_source_parameters_set ( AVBitStreamFilterContext ctx,
const AVCodecParameters par 
)

Initialize the source filter with the provided parameters.

This function may be called multiple times, the later calls override the previous ones. Some of the parameters may also be set through AVOptions, then whatever method is used last takes precedence.

Parameters
ctxan instance of the source filter
paramthe stream parameters. The packet later passed to this filter must conform to those parameters. All the allocated fields in param remain owned by the caller, libavcodec will make internal copies or references when necessary.
Returns
0 on success, a negative AVERROR code on failure.

Definition at line 46 of file source.c.

Referenced by istg_parse_lcevc().

◆ av_bsf_source_add_packet()

av_warn_unused_result int av_bsf_source_add_packet ( AVBitStreamFilterContext ctx,
AVPacket pkt,
int  flags 
)

Add a packet to the buffer source.

By default, this function will take ownership of the reference(s) and reset the packet. This can be controlled using the flags.

If this function returns an error, the input packet is not touched.

Parameters
buffer_srcpointer to a source filter context
packeta packet, or NULL to mark EOF
flagsa combination of AV_BSF_FLAG_*
Returns
>= 0 in case of success, a negative AVERROR code in case of failure

Definition at line 67 of file source.c.

Referenced by do_bsf_graph().

◆ av_bsf_source_get_status()

int av_bsf_source_get_status ( AVBitStreamFilterContext ctx)

Returns 0 or a negative AVERROR code.

Currently, this will only ever return AVERROR(EOF), to indicate that the buffer source has been closed, either as a result of av_bsf_source_close(), or because the downstream filter is no longer accepting new data.

Definition at line 127 of file source.c.

Referenced by av_bsf_graph_source_needs_input().

◆ av_bsf_source_close()

int av_bsf_source_close ( AVBitStreamFilterContext ctx,
int64_t  pts,
unsigned  flags 
)

Close the source after EOF.

This is similar to passing NULL to av_bsf_source_add_packet() except it takes the timestamp of the EOF, i.e. the timestamp of the end of the last packet.

Definition at line 118 of file source.c.

Referenced by av_bsf_source_add_packet().