FFmpeg
Loading...
Searching...
No Matches
mccenc.c File Reference
#include "avformat.h"
#include "internal.h"
#include "mux.h"
#include "version.h"
#include "libavcodec/codec_id.h"
#include "libavcodec/smpte_436m.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/error.h"
#include "libavutil/log.h"
#include "libavutil/macros.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/rational.h"
#include "libavutil/time_internal.h"
#include "libavutil/timecode.h"

Go to the source code of this file.

Data Structures

struct  MCCContext
 

Macros

#define MCC_HEADER
 
#define MCC_HEADER_PRINTF_ARGS(mcc_version)
 
#define OFFSET(x)
 
#define ENC   AV_OPT_FLAG_ENCODING_PARAM
 

Enumerations

enum  MCCVersion { MCC_VERSION_1 = 1 , MCC_VERSION_2 = 2 , MCC_VERSION_MIN = MCC_VERSION_1 , MCC_VERSION_MAX = MCC_VERSION_2 }
 

Functions

static int mcc_write_header (AVFormatContext *avf)
 
static void mcc_bytes_to_hex (char *dest, const uint8_t *bytes, size_t bytes_size, int use_u_alias)
 convert the input bytes to hexadecimal with mcc's aliases
 
static int mcc_write_packet (AVFormatContext *avf, AVPacket *pkt)
 
static int mcc_init (AVFormatContext *avf)
 
static int mcc_query_codec (enum AVCodecID codec_id, int std_compliance)
 

Variables

static const char mcc_ffmpeg_uuid [] = "0087C4F6-A6B4-5469-8C8E-BBF44950401D"
 generated with the bash command:
 
static const AVRational valid_time_code_rates []
 
static const AVOption options []
 
static const AVClass mcc_muxer_class
 
const FFOutputFormat ff_mcc_muxer
 

Macro Definition Documentation

◆ MCC_HEADER

#define MCC_HEADER

Definition at line 61 of file mccenc.c.

Referenced by mcc_write_header().

◆ MCC_HEADER_PRINTF_ARGS

#define MCC_HEADER_PRINTF_ARGS ( mcc_version)
Value:
(mcc_version) + '0', \
(mcc_version) == MCC_VERSION_1 ? "" : ", 60DF"
@ MCC_VERSION_1
Definition mccenc.c:55

Definition at line 100 of file mccenc.c.

Referenced by mcc_write_header().

◆ OFFSET

#define OFFSET ( x)
Value:
offsetof(MCCContext, x)

Definition at line 455 of file mccenc.c.

◆ ENC

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 456 of file mccenc.c.

Enumeration Type Documentation

◆ MCCVersion

enum MCCVersion
Enumerator
MCC_VERSION_1 
MCC_VERSION_2 
MCC_VERSION_MIN 
MCC_VERSION_MAX 

Definition at line 53 of file mccenc.c.

Function Documentation

◆ mcc_write_header()

static int mcc_write_header ( AVFormatContext * avf)
static

Definition at line 122 of file mccenc.c.

◆ mcc_bytes_to_hex()

static void mcc_bytes_to_hex ( char * dest,
const uint8_t * bytes,
size_t bytes_size,
int use_u_alias )
static

convert the input bytes to hexadecimal with mcc's aliases

Definition at line 196 of file mccenc.c.

Referenced by mcc_write_packet().

◆ mcc_write_packet()

static int mcc_write_packet ( AVFormatContext * avf,
AVPacket * pkt )
static

Definition at line 272 of file mccenc.c.

◆ mcc_init()

static int mcc_init ( AVFormatContext * avf)
static

Definition at line 367 of file mccenc.c.

◆ mcc_query_codec()

static int mcc_query_codec ( enum AVCodecID codec_id,
int std_compliance )
static

Definition at line 447 of file mccenc.c.

Variable Documentation

◆ mcc_ffmpeg_uuid

const char mcc_ffmpeg_uuid[] = "0087C4F6-A6B4-5469-8C8E-BBF44950401D"
static

generated with the bash command:

URL="https://code.ffmpeg.org/FFmpeg/FFmpeg/src/branch/master/libavformat/mccenc.c"
python3 -c "from uuid import *; print(str(uuid5(NAMESPACE_URL, '$URL')).upper())"

Definition at line 110 of file mccenc.c.

Referenced by mcc_write_header().

◆ valid_time_code_rates

const AVRational valid_time_code_rates[]
static
Initial value:
= {
{ .num = 24, .den = 1 },
{ .num = 25, .den = 1 },
{ .num = 30000, .den = 1001 },
{ .num = 30, .den = 1 },
{ .num = 50, .den = 1 },
{ .num = 60000, .den = 1001 },
{ .num = 60, .den = 1 },
}

Definition at line 112 of file mccenc.c.

◆ options

const AVOption options[]
static
Initial value:
= {
{ "override_time_code_rate", "override the `Time Code Rate` value in the output", OFFSET(override_time_code_rate), AV_OPT_TYPE_STRING, { .str = NULL }, 0, INT_MAX, ENC },
{ "use_u_alias", "use the U alias for E1h 00h 00h 00h, disabled by default because some .mcc files disagree on whether it has 2 or 3 zero bytes", OFFSET(use_u_alias), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC },
{ "mcc_version", "the mcc file format version", OFFSET(mcc_version), AV_OPT_TYPE_UINT, { .i64 = MCC_VERSION_2 }, MCC_VERSION_MIN, MCC_VERSION_MAX, ENC },
{ "creation_program", "the creation program", OFFSET(creation_program), AV_OPT_TYPE_STRING, { .str = NULL }, 0, INT_MAX, ENC },
{ "creation_time", "the creation time", OFFSET(creation_time), AV_OPT_TYPE_STRING, { .str = "now" }, 0, INT_MAX, ENC },
{ NULL },
}
#define ENC
Definition caca.c:198
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275
@ AV_OPT_TYPE_UINT
Underlying C type is unsigned int.
Definition opt.h:334
@ MCC_VERSION_MAX
Definition mccenc.c:58
@ MCC_VERSION_2
Definition mccenc.c:56
@ MCC_VERSION_MIN
Definition mccenc.c:57

Definition at line 458 of file mccenc.c.

◆ mcc_muxer_class

const AVClass mcc_muxer_class
static
Initial value:
= {
.class_name = "mcc muxer",
.item_name = av_default_item_name,
.option = options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 468 of file mccenc.c.

◆ ff_mcc_muxer

const FFOutputFormat ff_mcc_muxer
Initial value:
= {
.p.name = "mcc",
.p.long_name = NULL_IF_CONFIG_SMALL("MacCaption"),
.p.extensions = "mcc",
.p.flags = AVFMT_GLOBALHEADER,
.p.video_codec = AV_CODEC_ID_NONE,
.p.audio_codec = AV_CODEC_ID_NONE,
.p.subtitle_codec = AV_CODEC_ID_EIA_608,
.p.priv_class = &mcc_muxer_class,
.priv_data_size = sizeof(MCCContext),
}
#define AVFMT_GLOBALHEADER
Format wants global header.
Definition avformat.h:497
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
Definition ffmpeg_mux.c:204
static void write_header(FFV1Context *f)
Definition ffv1enc.c:384
@ AV_CODEC_ID_NONE
Definition codec_id.h:48
@ AV_CODEC_ID_EIA_608
Definition codec_id.h:576
static int query_codec(enum AVCodecID id, int std_compliance)
Definition img2enc.c:361
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static const AVClass mcc_muxer_class
Definition mccenc.c:468
static int mcc_query_codec(enum AVCodecID codec_id, int std_compliance)
Definition mccenc.c:447
static int mcc_write_header(AVFormatContext *avf)
Definition mccenc.c:122
static int mcc_init(AVFormatContext *avf)
Definition mccenc.c:367
static int mcc_write_packet(AVFormatContext *avf, AVPacket *pkt)
Definition mccenc.c:272

Definition at line 475 of file mccenc.c.