FFmpeg  4.0
Data Structures | Macros | Enumerations | Functions | Variables
h264_metadata_bsf.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/display.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "bsf.h"
#include "cbs.h"
#include "cbs_h264.h"
#include "h264.h"
#include "h264_sei.h"

Go to the source code of this file.

Data Structures

struct  H264MetadataContext
 

Macros

#define SET_OR_INFER(field, value, present_flag, infer)
 
#define CROP(border, unit)
 
#define OFFSET(x)   offsetof(H264MetadataContext, x)
 
#define FLAGS   (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
 

Enumerations

enum  { PASS, INSERT, REMOVE, EXTRACT }
 
enum  { FLIP_HORIZONTAL = 1, FLIP_VERTICAL = 2 }
 

Functions

static int h264_metadata_update_sps (AVBSFContext *bsf, H264RawSPS *sps)
 
static int h264_metadata_filter (AVBSFContext *bsf, AVPacket *out)
 
static int h264_metadata_init (AVBSFContext *bsf)
 
static void h264_metadata_close (AVBSFContext *bsf)
 

Variables

static const AVOption h264_metadata_options []
 
static const AVClass h264_metadata_class
 
static enum AVCodecID h264_metadata_codec_ids []
 
const AVBitStreamFilter ff_h264_metadata_bsf
 

Macro Definition Documentation

◆ SET_OR_INFER

#define SET_OR_INFER (   field,
  value,
  present_flag,
  infer 
)
Value:
do { \
if (value >= 0) { \
field = value; \
need_vui = 1; \
} else if (!present_flag) \
field = infer; \
} while (0)
#define infer(name, value)
Definition: cbs_h2645.c:352
double value
Definition: eval.c:98

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 AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
#define AVERROR(e)
Definition: error.h:43
AVFormatContext * ctx
Definition: movenc.c:48

Referenced by h264_metadata_update_sps().

◆ OFFSET

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

Definition at line 599 of file h264_metadata_bsf.c.

◆ FLAGS

Definition at line 600 of file h264_metadata_bsf.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PASS 
INSERT 
REMOVE 
EXTRACT 

Definition at line 30 of file h264_metadata_bsf.c.

◆ anonymous enum

anonymous enum
Enumerator
FLIP_HORIZONTAL 
FLIP_VERTICAL 

Definition at line 37 of file h264_metadata_bsf.c.

Function Documentation

◆ h264_metadata_update_sps()

static int h264_metadata_update_sps ( AVBSFContext bsf,
H264RawSPS sps 
)
static

Definition at line 80 of file h264_metadata_bsf.c.

Referenced by h264_metadata_filter(), and h264_metadata_init().

◆ h264_metadata_filter()

static int h264_metadata_filter ( AVBSFContext bsf,
AVPacket out 
)
static

Definition at line 217 of file h264_metadata_bsf.c.

◆ h264_metadata_init()

static int h264_metadata_init ( AVBSFContext bsf)
static

Definition at line 555 of file h264_metadata_bsf.c.

◆ h264_metadata_close()

static void h264_metadata_close ( AVBSFContext bsf)
static

Definition at line 593 of file h264_metadata_bsf.c.

Variable Documentation

◆ h264_metadata_options

const AVOption h264_metadata_options[]
static

Definition at line 601 of file h264_metadata_bsf.c.

◆ h264_metadata_class

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

Definition at line 690 of file h264_metadata_bsf.c.

◆ h264_metadata_codec_ids

enum AVCodecID h264_metadata_codec_ids[]
static
Initial value:

Definition at line 697 of file h264_metadata_bsf.c.

◆ ff_h264_metadata_bsf

const AVBitStreamFilter ff_h264_metadata_bsf
Initial value:
= {
.name = "h264_metadata",
.priv_data_size = sizeof(H264MetadataContext),
.priv_class = &h264_metadata_class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
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, int clip)
Definition: cfhd.c:114
static enum AVCodecID h264_metadata_codec_ids[]
static int h264_metadata_init(AVBSFContext *bsf)
static const AVClass h264_metadata_class
static void h264_metadata_close(AVBSFContext *bsf)
static enum AVCodecID codec_ids[]
static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *out)

Definition at line 701 of file h264_metadata_bsf.c.