FFmpeg
Loading...
Searching...
No Matches
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/attributes_internal.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)
 
#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 attribute_nonstring const char cc_pad [27] = CCPAD3 CCPAD3 CCPAD3
 
static const alias aliases [20]
 
static const 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 85 of file mccdec.c.

◆ CCPAD3

#define CCPAD3   CCPAD CCPAD CCPAD

Definition at line 86 of file mccdec.c.

◆ OFFSET

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

Definition at line 399 of file mccdec.c.

◆ SD

Definition at line 400 of file mccdec.c.

Function Documentation

◆ mcc_probe()

static int mcc_probe ( const AVProbeData * p)
static

Definition at line 50 of file mccdec.c.

◆ convert()

static int convert ( uint8_t x)
static

Definition at line 68 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 121 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 142 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 172 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 193 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 212 of file mccdec.c.

Referenced by mcc_read_header().

◆ mcc_read_header()

static int mcc_read_header ( AVFormatContext * s)
static

Definition at line 242 of file mccdec.c.

◆ mcc_read_packet()

static int mcc_read_packet ( AVFormatContext * s,
AVPacket * pkt )
static

Definition at line 380 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 386 of file mccdec.c.

◆ mcc_read_close()

static int mcc_read_close ( AVFormatContext * s)
static

Definition at line 392 of file mccdec.c.

Variable Documentation

◆ cc_pad

attribute_nonstring const char cc_pad[27] = CCPAD3 CCPAD3 CCPAD3
static

Definition at line 88 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", },
}
#define NULL
Definition coverity.c:32
static attribute_nonstring const char cc_pad[27]
Definition mccdec.c:88

Definition at line 90 of file mccdec.c.

Referenced by mcc_read_header().

◆ valid_time_code_rates

const 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 162 of file mccdec.c.

Referenced by mcc_init(), and 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 },
}
#define SD
#define OFFSET(x)
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326

Definition at line 402 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,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
@ AV_CLASS_CATEGORY_DEMUXER
Definition log.h:33
static const AVOption mcc_options[]
Definition mccdec.c:402

Definition at line 408 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,
}
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int read_probe(const AVProbeData *p)
Definition cdg.c:30
#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
static int read_header(FFV1Context *f, RangeCoder *c)
Definition ffv1dec.c:578
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static av_cold int read_close(AVFormatContext *ctx)
Definition libcdio.c:143
static const AVClass mcc_class
Definition mccdec.c:408
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:386
static int mcc_read_header(AVFormatContext *s)
Definition mccdec.c:242
static int mcc_read_close(AVFormatContext *s)
Definition mccdec.c:392
static int mcc_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition mccdec.c:380
static int mcc_probe(const AVProbeData *p)
Definition mccdec.c:50

Definition at line 416 of file mccdec.c.