FFmpeg
Data Structures | Macros | Functions | Variables
mpeg2_metadata_bsf.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "bsf.h"
#include "bsf_internal.h"
#include "cbs.h"
#include "cbs_mpeg2.h"
#include "mpeg12.h"

Go to the source code of this file.

Data Structures

struct  MPEG2MetadataContext
 

Macros

#define VALIDITY_CHECK(name)
 
#define OFFSET(x)   offsetof(MPEG2MetadataContext, x)
 
#define FLAGS   (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
 

Functions

static int mpeg2_metadata_update_fragment (AVBSFContext *bsf, CodedBitstreamFragment *frag)
 
static int mpeg2_metadata_filter (AVBSFContext *bsf, AVPacket *pkt)
 
static int mpeg2_metadata_init (AVBSFContext *bsf)
 
static void mpeg2_metadata_close (AVBSFContext *bsf)
 

Variables

static const AVOption mpeg2_metadata_options []
 
static const AVClass mpeg2_metadata_class
 
static enum AVCodecID mpeg2_metadata_codec_ids []
 
const AVBitStreamFilter ff_mpeg2_metadata_bsf
 

Macro Definition Documentation

#define VALIDITY_CHECK (   name)
Value:
do { \
if (!ctx->name) { \
av_log(bsf, AV_LOG_ERROR, "The value 0 for %s is " \
"forbidden.\n", #name); \
return AVERROR(EINVAL); \
} \
} while (0)
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
AVFormatContext * ctx
Definition: movenc.c:48
if(ret)
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
const char * name
Definition: opengl_enc.c:102

Referenced by mpeg2_metadata_init().

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

Definition at line 267 of file mpeg2_metadata_bsf.c.

Definition at line 268 of file mpeg2_metadata_bsf.c.

Function Documentation

static int mpeg2_metadata_update_fragment ( AVBSFContext bsf,
CodedBitstreamFragment frag 
)
static

Definition at line 50 of file mpeg2_metadata_bsf.c.

Referenced by mpeg2_metadata_filter(), and mpeg2_metadata_init().

static int mpeg2_metadata_filter ( AVBSFContext bsf,
AVPacket pkt 
)
static

Definition at line 173 of file mpeg2_metadata_bsf.c.

static int mpeg2_metadata_init ( AVBSFContext bsf)
static

Definition at line 211 of file mpeg2_metadata_bsf.c.

static void mpeg2_metadata_close ( AVBSFContext bsf)
static

Definition at line 259 of file mpeg2_metadata_bsf.c.

Variable Documentation

const AVOption mpeg2_metadata_options[]
static
Initial value:
= {
{ "display_aspect_ratio", "Set display aspect ratio (table 6-3)",
OFFSET(display_aspect_ratio), AV_OPT_TYPE_RATIONAL,
{ .dbl = 0.0 }, 0, 65535, FLAGS },
{ "frame_rate", "Set frame rate",
{ .dbl = 0.0 }, 0, UINT_MAX, FLAGS },
{ "video_format", "Set video format (table 6-6)",
OFFSET(video_format), AV_OPT_TYPE_INT,
{ .i64 = -1 }, -1, 7, FLAGS },
{ "colour_primaries", "Set colour primaries (table 6-7)",
OFFSET(colour_primaries), AV_OPT_TYPE_INT,
{ .i64 = -1 }, -1, 255, FLAGS },
{ "transfer_characteristics", "Set transfer characteristics (table 6-8)",
{ .i64 = -1 }, -1, 255, FLAGS },
{ "matrix_coefficients", "Set matrix coefficients (table 6-9)",
OFFSET(matrix_coefficients), AV_OPT_TYPE_INT,
{ .i64 = -1 }, -1, 255, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
static const struct TransferCharacteristics transfer_characteristics[AVCOL_TRC_NB]
#define FLAGS
#define OFFSET(x)

Definition at line 269 of file mpeg2_metadata_bsf.c.

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

Definition at line 294 of file mpeg2_metadata_bsf.c.

enum AVCodecID mpeg2_metadata_codec_ids[]
static
Initial value:
= {
}
preferred ID for MPEG-1/2 video decoding
Definition: codec_id.h:51

Definition at line 301 of file mpeg2_metadata_bsf.c.

const AVBitStreamFilter ff_mpeg2_metadata_bsf
Initial value:
= {
.name = "mpeg2_metadata",
.priv_data_size = sizeof(MPEG2MetadataContext),
.priv_class = &mpeg2_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
static void mpeg2_metadata_close(AVBSFContext *bsf)
static const AVClass mpeg2_metadata_class
static enum AVCodecID mpeg2_metadata_codec_ids[]
static int mpeg2_metadata_filter(AVBSFContext *bsf, AVPacket *pkt)
static enum AVCodecID codec_ids[]
static int mpeg2_metadata_init(AVBSFContext *bsf)

Definition at line 305 of file mpeg2_metadata_bsf.c.