Go to the documentation of this file.
45 if (!memcmp(buf,
"File Format=MacCaption_MCC V", 28))
69 { .
key = 16, .len = 3, .value =
"\xFA\x0\x0", },
70 { .key = 17, .len = 6, .value =
"\xFA\x0\x0\xFA\x0\x0", },
71 { .key = 18, .len = 9, .value =
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0", },
72 { .key = 19, .len = 12, .value =
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0", },
73 { .key = 20, .len = 15, .value =
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0", },
74 { .key = 21, .len = 18, .value =
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0", },
75 { .key = 22, .len = 21, .value =
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0", },
76 { .key = 23, .len = 24, .value =
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0", },
77 { .key = 24, .len = 27, .value =
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0", },
78 { .key = 25, .len = 3, .value =
"\xFB\x80\x80", },
79 { .key = 26, .len = 3, .value =
"\xFC\x80\x80", },
80 { .key = 27, .len = 3, .value =
"\xFD\x80\x80", },
81 { .key = 28, .len = 2, .value =
"\x96\x69", },
82 { .key = 29, .len = 2, .value =
"\x61\x01", },
83 { .key = 30, .len = 3, .value =
"\xFC\x80\x80", },
84 { .key = 31, .len = 3, .value =
"\xFC\x80\x80", },
85 { .key = 32, .len = 4, .value =
"\xE1\x00\x00\x00", },
86 { .key = 33, .len = 0, .value =
NULL, },
87 { .key = 34, .len = 0, .value =
NULL, },
88 { .key = 35, .len = 1, .value =
"\x0", },
111 int hh, mm,
ss,
fs,
i = 0, j = 0;
112 int start = 12, count = 0;
117 if (!strncmp(
line,
"File Format=MacCaption_MCC V", 28))
119 if (!strncmp(
line,
"//", 2))
121 if (!strncmp(
line,
"Time Code Rate=", 15)) {
122 char *rate_str =
line + 15;
124 int num = -1, den = -1;
127 num = strtol(rate_str, &
df, 10);
130 av_reduce(&num, &den, num * 1000LL, 1001, INT_MAX);
134 if (num > 0 && den > 0) {
146 lline = (
char *)&
line;
153 if (v >= 16 && v <= 35) {
166 if (
i + 13 >=
sizeof(
line) - 1)
169 if (j >=
sizeof(
out) - 1) {
173 out[j++] = vv | (v << 4);
183 count = (
out[11] & 0x1f) * 3;
184 if (j < start + count + 1)
int ff_subtitles_read_close(AVFormatContext *s)
int ff_text_r8(FFTextReader *r)
Return the next byte.
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
enum AVMediaType codec_type
General type of the encoded data.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
static int convert(uint8_t x)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int buf_size
Size of buf except extra allocated bytes.
ptrdiff_t ff_subtitles_read_line(FFTextReader *tr, char *buf, size_t size)
Read a line of text.
static av_cold int read_close(AVFormatContext *ctx)
#define ss(width, name, subs,...)
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
int ff_subtitles_read_packet(AVFormatContext *s, AVPacket *pkt)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
void ff_text_read(FFTextReader *r, char *buf, size_t size)
Read the given number of bytes (in UTF-8).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int av_sscanf(const char *string, const char *format,...)
See libc sscanf manual for more information.
static int read_header(FFV1Context *f)
#define fs(width, name, subs,...)
Rational number (pair of numerator and denominator).
This structure contains the data a format has to probe a file.
AVPacket * ff_subtitles_queue_insert(FFDemuxSubtitlesQueue *q, const uint8_t *event, size_t len, int merge)
Insert a new subtitle event.
void ff_text_init_avio(void *s, FFTextReader *r, AVIOContext *pb)
Initialize the FFTextReader from the given AVIOContext.
int av_strncasecmp(const char *a, const char *b, size_t n)
Locale-independent case-insensitive compare.
const AVInputFormat ff_mcc_demuxer
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static AVRational av_make_q(int num, int den)
Create an AVRational.
void ff_subtitles_queue_finalize(void *log_ctx, FFDemuxSubtitlesQueue *q)
Set missing durations, sort subtitles by PTS (and then byte position), and drop duplicated events.
static const alias aliases[20]
static int mcc_probe(const AVProbeData *p)
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int64_t ff_text_pos(FFTextReader *r)
Return the byte position of the next byte returned by ff_text_r8().
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
int ff_subtitles_read_seek(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
int ff_text_peek_r8(FFTextReader *r)
Like ff_text_r8(), but don't remove the byte from the buffer.
void ff_text_init_buf(FFTextReader *r, const void *buf, size_t size)
Similar to ff_text_init_avio(), but sets it up to read from a bounded buffer.
static int read_probe(const AVProbeData *p)
int ff_text_eof(FFTextReader *r)
Return non-zero if EOF was reached.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int64_t pos
byte position in stream, -1 if unknown
static int mcc_read_header(AVFormatContext *s)