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_bsf.h"
#include "cbs_h264.h"
#include "h264.h"
#include "h264_levels.h"
#include "h264_sei.h"

Go to the source code of this file.

Data Structures

struct  H264MetadataContext


#define SET_VUI_FIELD(field)
#define CROP(border, unit)
#define OFFSET(x)   offsetof(H264MetadataContext, x)
#define LEVEL(name, value)


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


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)


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 AVBitStreamFilter ff_h264_metadata_bsf

Macro Definition Documentation

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

Referenced by h264_metadata_update_sps().

#define CROP (   border,
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); \
} \
sps->frame_crop_ ## border ## _offset = \
ctx->crop_ ## border / unit; \
sps->frame_cropping_flag = 1; \
} \
} while (0)
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:194
AVFormatContext * ctx
Definition: movenc.c:48
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a it should return
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions

Referenced by h264_metadata_update_sps().

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

Definition at line 581 of file h264_metadata_bsf.c.

Definition at line 582 of file h264_metadata_bsf.c.

#define LEVEL (   name,
{ .i64 = value }, .flags = FLAGS, .unit = "level"
#define NULL
Definition: coverity.c:32
#define FLAGS
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:108
const char * name
Definition: opengl_enc.c:102

Referenced by ff_mpeg1_init_uni_ac_vlc().

Enumeration Type Documentation

anonymous enum

Definition at line 32 of file h264_metadata_bsf.c.

anonymous enum

Definition at line 37 of file h264_metadata_bsf.c.

Function Documentation

static int h264_metadata_insert_aud ( AVBSFContext bsf,
CodedBitstreamFragment au 

Definition at line 84 of file h264_metadata_bsf.c.

Referenced by h264_metadata_update_fragment().

static int h264_metadata_update_sps ( AVBSFContext bsf,
H264RawSPS sps 

Definition at line 137 of file h264_metadata_bsf.c.

Referenced by h264_metadata_update_fragment().

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

Definition at line 325 of file h264_metadata_bsf.c.

Referenced by h264_metadata_update_fragment().

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

Definition at line 458 of file h264_metadata_bsf.c.

static int h264_metadata_init ( AVBSFContext bsf)

Definition at line 541 of file h264_metadata_bsf.c.

Variable Documentation

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

Definition at line 534 of file h264_metadata_bsf.c.

const AVOption h264_metadata_options[]

Definition at line 583 of file h264_metadata_bsf.c.

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

Definition at line 691 of file h264_metadata_bsf.c.

enum AVCodecID h264_metadata_codec_ids[]
Initial value:

Definition at line 698 of file h264_metadata_bsf.c.

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
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
void ff_cbs_bsf_generic_close(AVBSFContext *bsf)
Close a generic CBS BSF instance.
Definition: cbs_bsf.c:152
int ff_cbs_bsf_generic_filter(AVBSFContext *bsf, AVPacket *pkt)
Filter operation for CBS BSF.
Definition: cbs_bsf.c:63
static enum AVCodecID h264_metadata_codec_ids[]
static int h264_metadata_init(AVBSFContext *bsf)
static const AVClass h264_metadata_class
static enum AVCodecID codec_ids[]

Definition at line 702 of file h264_metadata_bsf.c.