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);
135 if (num > 0 && den > 0) {
142 if (
av_sscanf(line,
"%d:%d:%d:%d", &hh, &mm, &ss, &fs) != 4)
147 lline = (
char *)&line;
154 if (v >= 16 && v <= 35) {
156 if (aliases[idx].
len) {
157 if (j >=
sizeof(out) - 1 - aliases[idx].len) {
161 memcpy(out + j, aliases[idx].
value, aliases[idx].len);
162 j += aliases[idx].
len;
167 if (i + 13 >=
sizeof(line) - 1)
170 if (j >=
sizeof(out) - 1) {
174 out[j++] = vv | (v << 4);
184 count = (out[11] & 0x1f) * 3;
185 if (j < start +
count + 1)
214 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
218 min_ts, ts, max_ts, flags);
static int mcc_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t pos
byte position in stream, -1 if unknown
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
void ff_subtitles_queue_clean(FFDemuxSubtitlesQueue *q)
Remove and destroy all the subtitles packets.
int av_strncasecmp(const char *a, const char *b, size_t n)
Locale-independent case-insensitive compare.
int ff_text_peek_r8(FFTextReader *r)
Like ff_text_r8(), but don't remove the byte from the buffer.
static int mcc_read_header(AVFormatContext *s)
#define fs(width, name, subs,...)
int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue *q, AVPacket *pkt)
Generic read_packet() callback for subtitles demuxers using this queue system.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
GLsizei GLboolean const GLfloat * value
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
static av_cold int read_close(AVFormatContext *ctx)
static const alias aliases[20]
int ff_text_eof(FFTextReader *r)
Return non-zero if EOF was reached.
ptrdiff_t ff_subtitles_read_line(FFTextReader *tr, char *buf, size_t size)
Read a line of text.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
int av_sscanf(const char *string, const char *format,...)
See libc sscanf manual for more information.
void ff_text_init_avio(void *s, FFTextReader *r, AVIOContext *pb)
Initialize the FFTextReader from the given AVIOContext.
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int64_t ff_text_pos(FFTextReader *r)
Return the byte position of the next byte returned by ff_text_r8().
#define ss(width, name, subs,...)
static int mcc_read_close(AVFormatContext *s)
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
static int mcc_probe(const AVProbeData *p)
static int mcc_read_seek(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
void ff_text_read(FFTextReader *r, char *buf, size_t size)
Read the given number of bytes (in UTF-8).
static int read_header(FFV1Context *f)
int ff_text_r8(FFTextReader *r)
Return the next byte.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
int ff_subtitles_queue_seek(FFDemuxSubtitlesQueue *q, AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
Update current_sub_idx to emulate a seek.
AVIOContext * pb
I/O context.
static AVRational av_make_q(int num, int den)
Create an AVRational.
Rational number (pair of numerator and denominator).
This structure contains the data a format has to probe a file.
static int convert(uint8_t x)
#define flags(name, subs,...)
void ff_text_init_buf(FFTextReader *r, void *buf, size_t size)
Similar to ff_text_init_avio(), but sets it up to read from a bounded buffer.
AVInputFormat ff_mcc_demuxer
void * priv_data
Format private data.
static float sub(float src0, float src1)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVPacket * ff_subtitles_queue_insert(FFDemuxSubtitlesQueue *q, const uint8_t *event, size_t len, int merge)
Insert a new subtitle event.
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
This structure stores compressed data.
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...
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...