FFmpeg
Data Structures | Macros | Functions | Variables
mccdec.c File Reference
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/codec_id.h"
#include "libavcodec/smpte_436m.h"
#include "libavutil/avstring.h"
#include "libavutil/avutil.h"
#include "libavutil/error.h"
#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/macros.h"
#include "libavutil/opt.h"
#include "libavutil/rational.h"
#include "libavutil/timecode.h"
#include "subtitles.h"
#include <inttypes.h>
#include <stdbool.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  MCCContext
 
struct  alias
 
struct  TimeTracker
 
struct  MCCTimecode
 
struct  ValidTimeCodeRate
 

Macros

#define CCPAD   "\xFA\x0\x0"
 
#define CCPAD3   CCPAD CCPAD CCPAD
 
#define OFFSET(x)   offsetof(MCCContext, x)
 
#define SD   AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM
 

Functions

static int mcc_probe (const AVProbeData *p)
 
static int convert (uint8_t x)
 
static int time_tracker_init (TimeTracker *tt, AVStream *st, AVRational rate, void *log_ctx)
 
static int time_tracker_set_time (TimeTracker *tt, const MCCTimecode *tc, void *log_ctx)
 
static int parse_time_code_rate (AVFormatContext *s, AVStream *st, TimeTracker *tt, const char *time_code_rate)
 
static int mcc_parse_time_code_part (char **line_left, unsigned *value, unsigned max, const char *after_set)
 
static int mcc_parse_time_code (char **line_left, MCCTimecode *tc)
 
static int mcc_read_header (AVFormatContext *s)
 
static int mcc_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int mcc_read_seek (AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
 
static int mcc_read_close (AVFormatContext *s)
 

Variables

static const char cc_pad [27] = CCPAD3 CCPAD3 CCPAD3
 
static const alias aliases [20]
 
static struct ValidTimeCodeRate valid_time_code_rates []
 
static const AVOption mcc_options []
 
static const AVClass mcc_class
 
const FFInputFormat ff_mcc_demuxer
 

Macro Definition Documentation

◆ CCPAD

#define CCPAD   "\xFA\x0\x0"

Definition at line 84 of file mccdec.c.

◆ CCPAD3

#define CCPAD3   CCPAD CCPAD CCPAD

Definition at line 85 of file mccdec.c.

◆ OFFSET

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

Definition at line 397 of file mccdec.c.

◆ SD

Definition at line 398 of file mccdec.c.

Function Documentation

◆ mcc_probe()

static int mcc_probe ( const AVProbeData p)
static

Definition at line 49 of file mccdec.c.

◆ convert()

static int convert ( uint8_t  x)
static

Definition at line 67 of file mccdec.c.

Referenced by mcc_read_header().

◆ time_tracker_init()

static int time_tracker_init ( TimeTracker tt,
AVStream st,
AVRational  rate,
void *  log_ctx 
)
static

Definition at line 120 of file mccdec.c.

Referenced by mcc_read_header(), and parse_time_code_rate().

◆ time_tracker_set_time()

static int time_tracker_set_time ( TimeTracker tt,
const MCCTimecode tc,
void *  log_ctx 
)
static

Definition at line 141 of file mccdec.c.

Referenced by mcc_read_header().

◆ parse_time_code_rate()

static int parse_time_code_rate ( AVFormatContext s,
AVStream st,
TimeTracker tt,
const char *  time_code_rate 
)
static

Definition at line 171 of file mccdec.c.

Referenced by mcc_read_header().

◆ mcc_parse_time_code_part()

static int mcc_parse_time_code_part ( char **  line_left,
unsigned *  value,
unsigned  max,
const char *  after_set 
)
static

Definition at line 192 of file mccdec.c.

Referenced by mcc_parse_time_code().

◆ mcc_parse_time_code()

static int mcc_parse_time_code ( char **  line_left,
MCCTimecode tc 
)
static

Definition at line 211 of file mccdec.c.

Referenced by mcc_read_header().

◆ mcc_read_header()

static int mcc_read_header ( AVFormatContext s)
static

Definition at line 241 of file mccdec.c.

◆ mcc_read_packet()

static int mcc_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 378 of file mccdec.c.

◆ mcc_read_seek()

static int mcc_read_seek ( AVFormatContext s,
int  stream_index,
int64_t  min_ts,
int64_t  ts,
int64_t  max_ts,
int  flags 
)
static

Definition at line 384 of file mccdec.c.

◆ mcc_read_close()

static int mcc_read_close ( AVFormatContext s)
static

Definition at line 390 of file mccdec.c.

Variable Documentation

◆ cc_pad

const char cc_pad[27] = CCPAD3 CCPAD3 CCPAD3
static

Definition at line 87 of file mccdec.c.

◆ aliases

const alias aliases[20]
static
Initial value:
= {
{ .key = 16, .len = 3, .value = cc_pad, },
{ .key = 17, .len = 6, .value = cc_pad, },
{ .key = 18, .len = 9, .value = cc_pad, },
{ .key = 19, .len = 12, .value = cc_pad, },
{ .key = 20, .len = 15, .value = cc_pad, },
{ .key = 21, .len = 18, .value = cc_pad, },
{ .key = 22, .len = 21, .value = cc_pad, },
{ .key = 23, .len = 24, .value = cc_pad, },
{ .key = 24, .len = 27, .value = cc_pad, },
{ .key = 25, .len = 3, .value = "\xFB\x80\x80", },
{ .key = 26, .len = 3, .value = "\xFC\x80\x80", },
{ .key = 27, .len = 3, .value = "\xFD\x80\x80", },
{ .key = 28, .len = 2, .value = "\x96\x69", },
{ .key = 29, .len = 2, .value = "\x61\x01", },
{ .key = 30, .len = 3, .value = "\xFC\x80\x80", },
{ .key = 31, .len = 3, .value = "\xFC\x80\x80", },
{ .key = 32, .len = 4, .value = "\xE1\x00\x00\x00", },
{ .key = 33, .len = 0, .value = NULL, },
{ .key = 34, .len = 0, .value = NULL, },
{ .key = 35, .len = 1, .value = "\x0", },
}

Definition at line 89 of file mccdec.c.

Referenced by mcc_read_header().

◆ valid_time_code_rates

struct ValidTimeCodeRate valid_time_code_rates[]
static
Initial value:
= {
{ .rate = { .num = 24, .den = 1 }, .str = "24" },
{ .rate = { .num = 25, .den = 1 }, .str = "25" },
{ .rate = { .num = 30000, .den = 1001 }, .str = "30DF" },
{ .rate = { .num = 30, .den = 1 }, .str = "30" },
{ .rate = { .num = 50, .den = 1 }, .str = "50" },
{ .rate = { .num = 60000, .den = 1001 }, .str = "60DF" },
{ .rate = { .num = 60, .den = 1 }, .str = "60" },
}

Definition at line 161 of file mccdec.c.

Referenced by parse_time_code_rate().

◆ mcc_options

const AVOption mcc_options[]
static
Initial value:
= {
{ "eia608_extract", "extract EIA-608/708 captions from VANC packets", OFFSET(eia608_extract), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, SD },
{ NULL },
}

Definition at line 400 of file mccdec.c.

◆ mcc_class

const AVClass mcc_class
static
Initial value:
= {
.class_name = "mcc demuxer",
.item_name = av_default_item_name,
.option = mcc_options,
}

Definition at line 406 of file mccdec.c.

◆ ff_mcc_demuxer

const FFInputFormat ff_mcc_demuxer
Initial value:
= {
.p.name = "mcc",
.p.long_name = NULL_IF_CONFIG_SMALL("MacCaption"),
.p.extensions = "mcc",
.p.priv_class = &mcc_class,
.priv_data_size = sizeof(MCCContext),
.flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
.read_seek2 = mcc_read_seek,
}

Definition at line 414 of file mccdec.c.

MCCContext
Definition: mccdec.c:43
mcc_read_close
static int mcc_read_close(AVFormatContext *s)
Definition: mccdec.c:390
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:143
mcc_options
static const AVOption mcc_options[]
Definition: mccdec.c:400
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:42
AV_CLASS_CATEGORY_DEMUXER
@ AV_CLASS_CATEGORY_DEMUXER
Definition: log.h:33
FF_INFMT_FLAG_INIT_CLEANUP
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
Definition: demux.h:35
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:241
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
SD
#define SD
Definition: mccdec.c:398
OFFSET
#define OFFSET(x)
Definition: mccdec.c:397
read_header
static int read_header(FFV1Context *f, RangeCoder *c)
Definition: ffv1dec.c:498
mcc_probe
static int mcc_probe(const AVProbeData *p)
Definition: mccdec.c:49
mcc_read_packet
static int mcc_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: mccdec.c:378
mcc_class
static const AVClass mcc_class
Definition: mccdec.c:406
mcc_read_seek
static int mcc_read_seek(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
Definition: mccdec.c:384
cc_pad
static const char cc_pad[27]
Definition: mccdec.c:87
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
mcc_read_header
static int mcc_read_header(AVFormatContext *s)
Definition: mccdec.c:241