FFmpeg
Data Structures | Macros | Functions | Variables
extract_extradata.c File Reference
#include <stdint.h>
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "av1.h"
#include "av1_parse.h"
#include "bsf.h"
#include "bsf_internal.h"
#include "bytestream.h"
#include "h2645_parse.h"
#include "h264.h"
#include "startcode.h"
#include "vc1_common.h"
#include "vvc.h"
#include "hevc/hevc.h"

Go to the source code of this file.

Data Structures

struct  ExtractExtradataContext
 

Macros

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

Functions

static int val_in_array (const int *arr, size_t len, int val)
 
static int metadata_is_global (const AV1OBU *obu)
 
static int obu_is_global (const AV1OBU *obu)
 
static int extract_extradata_av1 (AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
 
static int extract_extradata_h2645 (AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
 
static int extract_extradata_vc1 (AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
 
static int extract_extradata_mpeg12 (AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
 
static int extract_extradata_mpeg4 (AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
 
static int extract_extradata_init (AVBSFContext *ctx)
 
static int extract_extradata_filter (AVBSFContext *ctx, AVPacket *pkt)
 
static void extract_extradata_close (AVBSFContext *ctx)
 

Variables

struct {
   enum AVCodecID   id
 
   int(*   extract )(AVBSFContext *ctx, AVPacket
      *pkt, uint8_t **data, int
      *size)
 
extract_tab []
 
static enum AVCodecID codec_ids []
 
static const AVOption options []
 
static const AVClass extract_extradata_class
 
const FFBitStreamFilter ff_extract_extradata_bsf
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 452 of file extract_extradata.c.

◆ FLAGS

Definition at line 453 of file extract_extradata.c.

Function Documentation

◆ val_in_array()

static int val_in_array ( const int arr,
size_t  len,
int  val 
)
static

Definition at line 54 of file extract_extradata.c.

Referenced by extract_extradata_h2645(), metadata_is_global(), and obu_is_global().

◆ metadata_is_global()

static int metadata_is_global ( const AV1OBU obu)
static

Definition at line 62 of file extract_extradata.c.

Referenced by obu_is_global().

◆ obu_is_global()

static int obu_is_global ( const AV1OBU obu)
static

Definition at line 79 of file extract_extradata.c.

Referenced by extract_extradata_av1().

◆ extract_extradata_av1()

static int extract_extradata_av1 ( AVBSFContext ctx,
AVPacket pkt,
uint8_t **  data,
int size 
)
static

Definition at line 94 of file extract_extradata.c.

◆ extract_extradata_h2645()

static int extract_extradata_h2645 ( AVBSFContext ctx,
AVPacket pkt,
uint8_t **  data,
int size 
)
static

Definition at line 164 of file extract_extradata.c.

◆ extract_extradata_vc1()

static int extract_extradata_vc1 ( AVBSFContext ctx,
AVPacket pkt,
uint8_t **  data,
int size 
)
static

Definition at line 270 of file extract_extradata.c.

◆ extract_extradata_mpeg12()

static int extract_extradata_mpeg12 ( AVBSFContext ctx,
AVPacket pkt,
uint8_t **  data,
int size 
)
static

Definition at line 305 of file extract_extradata.c.

◆ extract_extradata_mpeg4()

static int extract_extradata_mpeg4 ( AVBSFContext ctx,
AVPacket pkt,
uint8_t **  data,
int size 
)
static

Definition at line 334 of file extract_extradata.c.

◆ extract_extradata_init()

static int extract_extradata_init ( AVBSFContext ctx)
static

Definition at line 381 of file extract_extradata.c.

◆ extract_extradata_filter()

static int extract_extradata_filter ( AVBSFContext ctx,
AVPacket pkt 
)
static

Definition at line 398 of file extract_extradata.c.

◆ extract_extradata_close()

static void extract_extradata_close ( AVBSFContext ctx)
static

Definition at line 430 of file extract_extradata.c.

Variable Documentation

◆ id

enum AVCodecID id

Definition at line 364 of file extract_extradata.c.

◆ extract

int(* extract) (AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)

Definition at line 365 of file extract_extradata.c.

◆ extract_tab

const { ... } extract_tab[]

◆ codec_ids

enum AVCodecID codec_ids[]
static

◆ options

const AVOption options[]
static
Initial value:
= {
{ "remove", "remove the extradata from the bitstream", OFFSET(remove), AV_OPT_TYPE_INT,
{ .i64 = 0 }, 0, 1, FLAGS },
{ NULL },
}

Definition at line 454 of file extract_extradata.c.

◆ extract_extradata_class

const AVClass extract_extradata_class
static
Initial value:
= {
.class_name = "extract_extradata",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 460 of file extract_extradata.c.

◆ ff_extract_extradata_bsf

const FFBitStreamFilter ff_extract_extradata_bsf
Initial value:
= {
.p.name = "extract_extradata",
.p.codec_ids = codec_ids,
.p.priv_class = &extract_extradata_class,
.priv_data_size = sizeof(ExtractExtradataContext),
}

Definition at line 467 of file extract_extradata.c.

extract_extradata_h2645
static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
Definition: extract_extradata.c:164
OFFSET
#define OFFSET(x)
Definition: extract_extradata.c:452
extract_extradata_vc1
static int extract_extradata_vc1(AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
Definition: extract_extradata.c:270
AV_CODEC_ID_MPEG4
@ AV_CODEC_ID_MPEG4
Definition: codec_id.h:64
extract_extradata_class
static const AVClass extract_extradata_class
Definition: extract_extradata.c:460
AV_CODEC_ID_AVS2
@ AV_CODEC_ID_AVS2
Definition: codec_id.h:246
filter
void(* filter)(uint8_t *src, int stride, int qscale)
Definition: h263dsp.c:29
extract_extradata_mpeg12
static int extract_extradata_mpeg12(AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
Definition: extract_extradata.c:305
extract_extradata_close
static void extract_extradata_close(AVBSFContext *ctx)
Definition: extract_extradata.c:430
extract_extradata_mpeg4
static int extract_extradata_mpeg4(AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
Definition: extract_extradata.c:334
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition: codec_id.h:79
AV_CODEC_ID_AVS3
@ AV_CODEC_ID_AVS3
Definition: codec_id.h:248
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
AV_CODEC_ID_AV1
@ AV_CODEC_ID_AV1
Definition: codec_id.h:280
codec_ids
static enum AVCodecID codec_ids[]
Definition: extract_extradata.c:437
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
extract_extradata_filter
static int extract_extradata_filter(AVBSFContext *ctx, AVPacket *pkt)
Definition: extract_extradata.c:398
AV_CODEC_ID_MPEG1VIDEO
@ AV_CODEC_ID_MPEG1VIDEO
Definition: codec_id.h:53
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:366
extract_extradata_init
static int extract_extradata_init(AVBSFContext *ctx)
Definition: extract_extradata.c:381
options
static const AVOption options[]
Definition: extract_extradata.c:454
AV_CODEC_ID_VVC
@ AV_CODEC_ID_VVC
Definition: codec_id.h:250
FLAGS
#define FLAGS
Definition: extract_extradata.c:453
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
AV_CODEC_ID_CAVS
@ AV_CODEC_ID_CAVS
Definition: codec_id.h:139
AV_CODEC_ID_HEVC
@ AV_CODEC_ID_HEVC
Definition: codec_id.h:226
AV_CODEC_ID_VC1
@ AV_CODEC_ID_VC1
Definition: codec_id.h:122
extract_extradata_av1
static int extract_extradata_av1(AVBSFContext *ctx, AVPacket *pkt, uint8_t **data, int *size)
Definition: extract_extradata.c:94
ExtractExtradataContext
Definition: extract_extradata.c:38
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:245
AV_CODEC_ID_MPEG2VIDEO
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
Definition: codec_id.h:54