FFmpeg
|
Data Structures | |
struct | AVBSFContext |
The bitstream filter state. More... | |
struct | AVBitStreamFilter |
Functions | |
const AVBitStreamFilter * | av_bsf_get_by_name (const char *name) |
const AVBitStreamFilter * | av_bsf_iterate (void **opaque) |
Iterate over all registered bitstream filters. More... | |
int | av_bsf_alloc (const AVBitStreamFilter *filter, AVBSFContext **ctx) |
Allocate a context for a given bitstream filter. More... | |
int | av_bsf_init (AVBSFContext *ctx) |
Prepare the filter for use, after all the parameters and options have been set. More... | |
int | av_bsf_send_packet (AVBSFContext *ctx, AVPacket *pkt) |
Submit a packet for filtering. More... | |
int | av_bsf_receive_packet (AVBSFContext *ctx, AVPacket *pkt) |
Retrieve a filtered packet. More... | |
void | av_bsf_flush (AVBSFContext *ctx) |
Reset the internal bitstream filter state. More... | |
void | av_bsf_free (AVBSFContext **ctx) |
Free a bitstream filter context and everything associated with it; write NULL into the supplied pointer. More... | |
const AVClass * | av_bsf_get_class (void) |
Get the AVClass for AVBSFContext. More... | |
AVBSFList * | av_bsf_list_alloc (void) |
Allocate empty list of bitstream filters. More... | |
void | av_bsf_list_free (AVBSFList **lst) |
Free list of bitstream filters. More... | |
int | av_bsf_list_append (AVBSFList *lst, AVBSFContext *bsf) |
Append bitstream filter to the list of bitstream filters. More... | |
int | av_bsf_list_append2 (AVBSFList *lst, const char *bsf_name, AVDictionary **options) |
Construct new bitstream filter context given it's name and options and append it to the list of bitstream filters. More... | |
int | av_bsf_list_finalize (AVBSFList **lst, AVBSFContext **bsf) |
Finalize list of bitstream filters. More... | |
int | av_bsf_list_parse_str (const char *str, AVBSFContext **bsf) |
Parse string describing list of bitstream filters and create single AVBSFContext describing the whole chain of bitstream filters. More... | |
int | av_bsf_get_null_filter (AVBSFContext **bsf) |
Get null/pass-through bitstream filter. More... | |
Bitstream filters transform encoded media data without decoding it. This allows e.g. manipulating various header values. Bitstream filters operate on AVPackets.
The bitstream filtering API is centered around two structures: AVBitStreamFilter and AVBSFContext. The former represents a bitstream filter in abstract, the latter a specific filtering process. Obtain an AVBitStreamFilter using av_bsf_get_by_name() or av_bsf_iterate(), then pass it to av_bsf_alloc() to create an AVBSFContext. Fill in the user-settable AVBSFContext fields, as described in its documentation, then call av_bsf_init() to prepare the filter context for use.
Submit packets for filtering using av_bsf_send_packet(), obtain filtered results with av_bsf_receive_packet(). When no more input packets will be sent, submit a NULL AVPacket to signal the end of the stream to the filter. av_bsf_receive_packet() will then return trailing packets, if any are produced by the filter.
Finally, free the filter context with av_bsf_free().
const AVBitStreamFilter* av_bsf_get_by_name | ( | const char * | name | ) |
Definition at line 83 of file bitstream_filters.c.
Referenced by aom_init(), av1_read_header(), bsf_list_append_internal(), detect_stream_specific(), extract_extradata_check(), extract_extradata_init(), ff_stream_add_bitstream_filter(), qsv_enc_init(), and show_help_bsf().
const AVBitStreamFilter* av_bsf_iterate | ( | void ** | opaque | ) |
Iterate over all registered bitstream filters.
opaque | a pointer where libavcodec will store the iteration state. Must point to NULL to start the iteration. |
Definition at line 71 of file bitstream_filters.c.
Referenced by av_bsf_get_by_name(), ff_bsf_child_class_iterate(), and show_bsfs().
int av_bsf_alloc | ( | const AVBitStreamFilter * | filter, |
AVBSFContext ** | ctx | ||
) |
Allocate a context for a given bitstream filter.
The caller must fill in the context parameters as described in the documentation and then call av_bsf_init() before sending any data to the filter.
filter | the filter for which to allocate an instance. | |
[out] | ctx | a pointer into which the pointer to the newly-allocated context will be written. It must be freed with av_bsf_free() after the filtering is done. |
Definition at line 105 of file bsf.c.
Referenced by aom_init(), av1_read_header(), av_bsf_get_null_filter(), av_bsf_list_finalize(), bsf_list_append_internal(), detect_stream_specific(), extract_extradata_init(), ff_stream_add_bitstream_filter(), LLVMFuzzerTestOneInput(), and qsv_enc_init().
int av_bsf_init | ( | AVBSFContext * | ctx | ) |
Prepare the filter for use, after all the parameters and options have been set.
ctx | a AVBSFContext previously allocated with av_bsf_alloc() |
Definition at line 150 of file bsf.c.
Referenced by aom_init(), av1_read_header(), bsf_init(), bsf_list_init(), decode_bsfs_init(), detect_stream_specific(), extract_extradata_init(), ff_stream_add_bitstream_filter(), LLVMFuzzerTestOneInput(), mediacodec_init_bsf(), open_slave(), and qsv_enc_init().
int av_bsf_send_packet | ( | AVBSFContext * | ctx, |
AVPacket * | pkt | ||
) |
Submit a packet for filtering.
After sending each packet, the filter must be completely drained by calling av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or AVERROR_EOF.
ctx | an initialized AVBSFContext |
pkt | the packet to filter. The bitstream filter will take ownership of the packet and reset the contents of pkt. pkt is not touched if an error occurs. If pkt is empty (i.e. NULL, or pkt->data is NULL and pkt->side_data_elems zero), it signals the end of the stream (i.e. no more non-empty packets will be sent; sending more empty packets does nothing) and will cause the filter to output any packets it may have buffered internally. |
Definition at line 203 of file bsf.c.
Referenced by avcodec_send_packet(), bsf_list_filter(), extract_extradata(), filter_packet(), LLVMFuzzerTestOneInput(), mediacodec_encode(), of_output_packet(), qsv_enc_frame(), storeframe(), tee_write_packet(), and write_packets_from_bsfs().
int av_bsf_receive_packet | ( | AVBSFContext * | ctx, |
AVPacket * | pkt | ||
) |
Retrieve a filtered packet.
ctx | an initialized AVBSFContext | |
[out] | pkt | this struct will be filled with the contents of the filtered packet. It is owned by the caller and must be freed using av_packet_unref() when it is no longer needed. This parameter should be "clean" (i.e. freshly allocated with av_packet_alloc() or unreffed with av_packet_unref()) when this function is called. If this function returns successfully, the contents of pkt will be completely overwritten by the returned data. On failure, pkt is not touched. |
Definition at line 231 of file bsf.c.
Referenced by bsf_list_filter(), extract_extradata(), ff_decode_get_packet(), filter_packet(), LLVMFuzzerTestOneInput(), mediacodec_encode(), of_output_packet(), qsv_enc_frame(), storeframe(), tee_write_packet(), and write_packets_from_bsfs().
void av_bsf_flush | ( | AVBSFContext * | ctx | ) |
Reset the internal bitstream filter state.
Should be called e.g. when seeking.
Definition at line 191 of file bsf.c.
Referenced by avcodec_flush_buffers(), bsf_list_flush(), and LLVMFuzzerTestOneInput().
void av_bsf_free | ( | AVBSFContext ** | ctx | ) |
Free a bitstream filter context and everything associated with it; write NULL into the supplied pointer.
Definition at line 53 of file bsf.c.
Referenced by aom_free(), av1_read_close(), av_bsf_alloc(), av_bsf_list_free(), avcodec_close(), avformat_find_stream_info(), bsf_list_append_internal(), bsf_list_close(), close_slave(), concat_read_close(), decode_bsfs_init(), extract_extradata_init(), ff_free_stream(), ff_stream_add_bitstream_filter(), LLVMFuzzerTestOneInput(), mediacodec_close(), ost_free(), and qsv_enc_close().
const AVClass* av_bsf_get_class | ( | void | ) |
Get the AVClass for AVBSFContext.
It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options.
Definition at line 100 of file bsf.c.
Referenced by show_help_default().
AVBSFList* av_bsf_list_alloc | ( | void | ) |
Allocate empty list of bitstream filters.
The list must be later freed by av_bsf_list_free() or finalized by av_bsf_list_finalize().
Definition at line 421 of file bsf.c.
Referenced by av_bsf_list_parse_str().
void av_bsf_list_free | ( | AVBSFList ** | lst | ) |
Free list of bitstream filters.
lst | Pointer to pointer returned by av_bsf_list_alloc() |
Definition at line 426 of file bsf.c.
Referenced by av_bsf_list_parse_str().
int av_bsf_list_append | ( | AVBSFList * | lst, |
AVBSFContext * | bsf | ||
) |
Append bitstream filter to the list of bitstream filters.
lst | List to append to |
bsf | Filter context to be appended |
Definition at line 439 of file bsf.c.
Referenced by bsf_list_append_internal().
int av_bsf_list_append2 | ( | AVBSFList * | lst, |
const char * | bsf_name, | ||
AVDictionary ** | options | ||
) |
Construct new bitstream filter context given it's name and options and append it to the list of bitstream filters.
lst | List to append to |
bsf_name | Name of the bitstream filter |
options | Options for the bitstream filter, can be set to NULL |
int av_bsf_list_finalize | ( | AVBSFList ** | lst, |
AVBSFContext ** | bsf | ||
) |
Finalize list of bitstream filters.
This function will transform AVBSFList to single AVBSFContext, so the whole chain of bitstream filters can be treated as single filter freshly allocated by av_bsf_alloc(). If the call is successful, AVBSFList structure is freed and lst will be set to NULL. In case of failure, caller is responsible for freeing the structure by av_bsf_list_free()
lst | Filter list structure to be transformed | |
[out] | bsf | Pointer to be set to newly created AVBSFContext structure representing the chain of bitstream filters |
Definition at line 490 of file bsf.c.
Referenced by av_bsf_list_parse_str().
int av_bsf_list_parse_str | ( | const char * | str, |
AVBSFContext ** | bsf | ||
) |
Parse string describing list of bitstream filters and create single AVBSFContext describing the whole chain of bitstream filters.
Resulting AVBSFContext can be treated as any other AVBSFContext freshly allocated by av_bsf_alloc().
str | String describing chain of bitstream filters in format bsf1[=opt1=val1:opt2=val2][,bsf2] | |
[out] | bsf | Pointer to be set to newly created AVBSFContext structure representing the chain of bitstream filters |
Definition at line 527 of file bsf.c.
Referenced by decode_bsfs_init(), mediacodec_init_bsf(), new_output_stream(), and open_slave().
int av_bsf_get_null_filter | ( | AVBSFContext ** | bsf | ) |
Get null/pass-through bitstream filter.
[out] | bsf | Pointer to be set to new instance of pass-through bitstream filter |
Definition at line 554 of file bsf.c.
Referenced by av_bsf_list_parse_str(), LLVMFuzzerTestOneInput(), and open_slave().