FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
bsf.c File Reference
#include <string.h>
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "avcodec.h"
#include "bsf.h"

Go to the source code of this file.

Data Structures

struct  AVBSFInternal
 
struct  BSFListContext
 
struct  AVBSFList
 Structure for chain/list of bitstream filters. More...
 

Functions

void av_bsf_free (AVBSFContext **pctx)
 Free a bitstream filter context and everything associated with it; write NULL into the supplied pointer. More...
 
static voidbsf_child_next (void *obj, void *prev)
 
const AVClassav_bsf_get_class (void)
 Get the AVClass for AVBSFContext. More...
 
int av_bsf_alloc (const AVBitStreamFilter *filter, AVBSFContext **pctx)
 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...
 
int ff_bsf_get_packet (AVBSFContext *ctx, AVPacket **pkt)
 Called by the bitstream filters to get the next packet for filtering. More...
 
int ff_bsf_get_packet_ref (AVBSFContext *ctx, AVPacket *pkt)
 Called by bitstream filters to get packet for filtering. More...
 
static int bsf_list_init (AVBSFContext *bsf)
 
static int bsf_list_filter (AVBSFContext *bsf, AVPacket *out)
 
static void bsf_list_close (AVBSFContext *bsf)
 
static const char * bsf_list_item_name (void *ctx)
 
AVBSFListav_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...
 
static int bsf_parse_single (const char *str, AVBSFList *bsf_lst)
 
int av_bsf_list_parse_str (const char *str, AVBSFContext **bsf_lst)
 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...
 

Variables

static const AVClass bsf_class
 
static const AVClass bsf_list_class
 
const AVBitStreamFilter ff_list_bsf
 

Function Documentation

static void* bsf_child_next ( void obj,
void prev 
)
static

Definition at line 61 of file bsf.c.

int ff_bsf_get_packet ( AVBSFContext ctx,
AVPacket **  pkt 
)

Called by the bitstream filters to get the next packet for filtering.

The filter is responsible for either freeing the packet or passing it to the caller.

Definition at line 204 of file bsf.c.

Referenced by aac_adtstoasc_filter(), chomp_filter(), dca_core_filter(), dump_extradata(), extract_extradata_filter(), h264_mp4toannexb_filter(), hevc_mp4toannexb_filter(), imx_dump_header(), mjpeg2jpeg_filter(), mjpega_dump_header(), mov2textsub(), mp3_header_decompress(), mpeg4_unpack_bframes_filter(), noise(), remove_extradata(), text2movsub(), and vp9_superframe_filter().

int ff_bsf_get_packet_ref ( AVBSFContext ctx,
AVPacket pkt 
)

Called by bitstream filters to get packet for filtering.

The reference to packet is moved to provided packet structure.

Parameters
ctxpointer to AVBSFContext of filter
pktpointer to packet to move reference to
Returns
0>= on success, negative AVERROR in case of failure

Definition at line 226 of file bsf.c.

Referenced by bsf_list_filter().

static int bsf_list_init ( AVBSFContext bsf)
static

Definition at line 255 of file bsf.c.

static int bsf_list_filter ( AVBSFContext bsf,
AVPacket out 
)
static

Definition at line 284 of file bsf.c.

static void bsf_list_close ( AVBSFContext bsf)
static

Definition at line 341 of file bsf.c.

static const char* bsf_list_item_name ( void ctx)
static

Definition at line 352 of file bsf.c.

static int bsf_parse_single ( const char *  str,
AVBSFList bsf_lst 
)
static

Definition at line 475 of file bsf.c.

Referenced by av_bsf_list_parse_str().

Variable Documentation

const AVClass bsf_class
static
Initial value:
= {
.class_name = "AVBSFContext",
.item_name = av_default_item_name,
.child_next = bsf_child_next,
.child_class_next = ff_bsf_child_class_next,
}
static void * bsf_child_next(void *obj, void *prev)
Definition: bsf.c:61
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
av_default_item_name
const AVClass * ff_bsf_child_class_next(const AVClass *prev)

Definition at line 69 of file bsf.c.

Referenced by av_bsf_alloc(), and av_bsf_get_class().

const AVClass bsf_list_class
static
Initial value:
= {
.class_name = "bsf_list",
.item_name = bsf_list_item_name,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
static const char * bsf_list_item_name(void *ctx)
Definition: bsf.c:352

Definition at line 377 of file bsf.c.

const AVBitStreamFilter ff_list_bsf
Initial value:
= {
.name = "bsf_list",
.priv_data_size = sizeof(BSFListContext),
.priv_class = &bsf_list_class,
.close = bsf_list_close,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static const AVClass bsf_list_class
Definition: bsf.c:377
static void filter(int16_t *output, ptrdiff_t out_stride, int16_t *low, ptrdiff_t low_stride, int16_t *high, ptrdiff_t high_stride, int len, uint8_t clip)
Definition: cfhd.c:80
static int bsf_list_filter(AVBSFContext *bsf, AVPacket *out)
Definition: bsf.c:284
static void bsf_list_close(AVBSFContext *bsf)
Definition: bsf.c:341
static int bsf_list_init(AVBSFContext *bsf)
Definition: bsf.c:255

Definition at line 383 of file bsf.c.