FFmpeg
Loading...
Searching...
No Matches
h264_metadata.c File Reference

Go to the source code of this file.

Data Structures

struct  H264MetadataContext
 

Macros

#define SET_VUI_FIELD(field)
 
#define CROP(border, unit)
 
#define OFFSET(x)
 
#define FLAGS   (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
 
#define LEVEL(name, value)
 

Enumerations

enum  { FLIP_HORIZONTAL = 1 , FLIP_VERTICAL = 2 }
 
enum  { LEVEL_UNSET = -2 , LEVEL_AUTO = -1 }
 

Functions

static int h264_metadata_insert_aud (AVBSFContext *bsf, CodedBitstreamFragment *au)
 
static int h264_metadata_update_sps (AVBSFContext *bsf, H264RawSPS *sps)
 
static int h264_metadata_handle_display_orientation (AVBSFContext *bsf, AVPacket *pkt, CodedBitstreamFragment *au, int seek_point)
 
static int h264_metadata_update_fragment (AVBSFContext *bsf, AVPacket *pkt, CodedBitstreamFragment *au)
 
static int h264_metadata_init (AVBSFContext *bsf)
 

Variables

static const CBSBSFType h264_metadata_type
 
static const AVOption h264_metadata_options []
 
static const AVClass h264_metadata_class
 
static enum AVCodecID h264_metadata_codec_ids []
 
const FFBitStreamFilter ff_h264_metadata_bsf
 

Macro Definition Documentation

◆ SET_VUI_FIELD

#define SET_VUI_FIELD ( field)
Value:
do { \
if (ctx->field >= 0) { \
sps->vui.field = ctx->field; \
need_vui = 1; \
} \
} while (0)
static int FUNC sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
static AVFormatContext * ctx
Definition movenc.c:49

Referenced by h264_metadata_update_sps().

◆ CROP

#define CROP ( border,
unit )
Value:
do { \
if (ctx->crop_ ## border >= 0) { \
if (ctx->crop_ ## border % unit != 0) { \
av_log(bsf, AV_LOG_ERROR, "Invalid value for crop_%s: " \
"must be a multiple of %d.\n", #border, unit); \
return AVERROR(EINVAL); \
} \
sps->frame_crop_ ## border ## _offset = \
ctx->crop_ ## border / unit; \
sps->frame_cropping_flag = 1; \
} \
} while (0)
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210

Referenced by h264_metadata_update_sps().

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 592 of file h264_metadata.c.

◆ FLAGS

Definition at line 593 of file h264_metadata.c.

◆ LEVEL

#define LEVEL ( name,
value )
Value:
{ .i64 = value }, .flags = FLAGS, .unit = "level"
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
double value
Definition eval.c:102
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
const char * name
Definition qsvenc.c:142

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FLIP_HORIZONTAL 
FLIP_VERTICAL 

Definition at line 36 of file h264_metadata.c.

◆ anonymous enum

anonymous enum
Enumerator
LEVEL_UNSET 
LEVEL_AUTO 

Definition at line 41 of file h264_metadata.c.

Function Documentation

◆ h264_metadata_insert_aud()

static int h264_metadata_insert_aud ( AVBSFContext * bsf,
CodedBitstreamFragment * au )
static

Definition at line 89 of file h264_metadata.c.

Referenced by h264_metadata_update_fragment().

◆ h264_metadata_update_sps()

static int h264_metadata_update_sps ( AVBSFContext * bsf,
H264RawSPS * sps )
static

Definition at line 142 of file h264_metadata.c.

Referenced by h264_metadata_update_fragment().

◆ h264_metadata_handle_display_orientation()

static int h264_metadata_handle_display_orientation ( AVBSFContext * bsf,
AVPacket * pkt,
CodedBitstreamFragment * au,
int seek_point )
static

Definition at line 326 of file h264_metadata.c.

Referenced by h264_metadata_update_fragment().

◆ h264_metadata_update_fragment()

static int h264_metadata_update_fragment ( AVBSFContext * bsf,
AVPacket * pkt,
CodedBitstreamFragment * au )
static

Definition at line 468 of file h264_metadata.c.

◆ h264_metadata_init()

static int h264_metadata_init ( AVBSFContext * bsf)
static

Definition at line 552 of file h264_metadata.c.

Variable Documentation

◆ h264_metadata_type

const CBSBSFType h264_metadata_type
static
Initial value:
= {
.codec_id = AV_CODEC_ID_H264,
.fragment_name = "access unit",
.unit_name = "NAL unit",
.update_fragment = &h264_metadata_update_fragment,
}
@ AV_CODEC_ID_H264
Definition codec_id.h:77
static int h264_metadata_update_fragment(AVBSFContext *bsf, AVPacket *pkt, CodedBitstreamFragment *au)

Definition at line 545 of file h264_metadata.c.

Referenced by h264_metadata_init().

◆ h264_metadata_options

const AVOption h264_metadata_options[]
static

Definition at line 594 of file h264_metadata.c.

◆ h264_metadata_class

const AVClass h264_metadata_class
static
Initial value:
= {
.class_name = "h264_metadata_bsf",
.item_name = av_default_item_name,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
static const AVOption h264_metadata_options[]

Definition at line 705 of file h264_metadata.c.

◆ h264_metadata_codec_ids

enum AVCodecID h264_metadata_codec_ids[]
static
Initial value:

Definition at line 712 of file h264_metadata.c.

◆ ff_h264_metadata_bsf

const FFBitStreamFilter ff_h264_metadata_bsf
Initial value:
= {
.p.name = "h264_metadata",
.p.codec_ids = h264_metadata_codec_ids,
.p.priv_class = &h264_metadata_class,
.priv_data_size = sizeof(H264MetadataContext),
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
int ff_cbs_bsf_generic_filter(AVBSFContext *bsf, AVPacket *pkt)
Filter operation for CBS BSF.
Definition cbs_bsf.c:97
av_cold void ff_cbs_bsf_generic_close(AVBSFContext *bsf)
Close a generic CBS BSF instance.
Definition cbs_bsf.c:191
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
static int h264_metadata_init(AVBSFContext *bsf)
static enum AVCodecID h264_metadata_codec_ids[]
static const AVClass h264_metadata_class
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
Definition h263dsp.c:29

Definition at line 716 of file h264_metadata.c.