FFmpeg  4.3
tedcaptionsdec.c
Go to the documentation of this file.
1 /*
2  * TED Talks captions format decoder
3  * Copyright (c) 2012 Nicolas George
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "libavutil/bprint.h"
23 #include "libavutil/log.h"
24 #include "libavutil/opt.h"
25 #include "avformat.h"
26 #include "internal.h"
27 #include "subtitles.h"
28 
29 typedef struct {
30  AVClass *class;
31  int64_t start_time;
34 
35 static const AVOption tedcaptions_options[] = {
36  { "start_time", "set the start time (offset) of the subtitles, in ms",
38  { .i64 = 15000 }, INT64_MIN, INT64_MAX,
40  { NULL },
41 };
42 
44  .class_name = "tedcaptions_demuxer",
45  .item_name = av_default_item_name,
46  .option = tedcaptions_options,
47  .version = LIBAVUTIL_VERSION_INT,
48 };
49 
50 #define BETWEEN(a, amin, amax) ((unsigned)((a) - (amin)) <= (amax) - (amin))
51 
52 #define HEX_DIGIT_TEST(c) (BETWEEN(c, '0', '9') || BETWEEN((c) | 32, 'a', 'z'))
53 #define HEX_DIGIT_VAL(c) ((c) <= '9' ? (c) - '0' : ((c) | 32) - 'a' + 10)
54 #define ERR_CODE(c) ((c) < 0 ? (c) : AVERROR_INVALIDDATA)
55 
56 static void av_bprint_utf8(AVBPrint *bp, unsigned c)
57 {
58  int bytes, i;
59 
60  if (c <= 0x7F) {
61  av_bprint_chars(bp, c, 1);
62  return;
63  }
64  bytes = (av_log2(c) - 2) / 5;
65  av_bprint_chars(bp, (c >> (bytes * 6)) | ((0xFF80 >> bytes) & 0xFF), 1);
66  for (i = bytes - 1; i >= 0; i--)
67  av_bprint_chars(bp, ((c >> (i * 6)) & 0x3F) | 0x80, 1);
68 }
69 
70 static void next_byte(AVIOContext *pb, int *cur_byte)
71 {
72  uint8_t b;
73  int ret = avio_read(pb, &b, 1);
74  *cur_byte = ret > 0 ? b : ret == 0 ? AVERROR_EOF : ret;
75 }
76 
77 static void skip_spaces(AVIOContext *pb, int *cur_byte)
78 {
79  while (*cur_byte == ' ' || *cur_byte == '\t' ||
80  *cur_byte == '\n' || *cur_byte == '\r')
81  next_byte(pb, cur_byte);
82 }
83 
84 static int expect_byte(AVIOContext *pb, int *cur_byte, uint8_t c)
85 {
86  skip_spaces(pb, cur_byte);
87  if (*cur_byte != c)
88  return ERR_CODE(*cur_byte);
89  next_byte(pb, cur_byte);
90  return 0;
91 }
92 
93 static int parse_string(AVIOContext *pb, int *cur_byte, AVBPrint *bp, int full)
94 {
95  int ret;
96 
98  ret = expect_byte(pb, cur_byte, '"');
99  if (ret < 0)
100  goto fail;
101  while (*cur_byte > 0 && *cur_byte != '"') {
102  if (*cur_byte == '\\') {
103  next_byte(pb, cur_byte);
104  if (*cur_byte < 0) {
106  goto fail;
107  }
108  if ((*cur_byte | 32) == 'u') {
109  unsigned chr = 0, i;
110  for (i = 0; i < 4; i++) {
111  next_byte(pb, cur_byte);
112  if (!HEX_DIGIT_TEST(*cur_byte)) {
113  ret = ERR_CODE(*cur_byte);
114  goto fail;
115  }
116  chr = chr * 16 + HEX_DIGIT_VAL(*cur_byte);
117  }
118  av_bprint_utf8(bp, chr);
119  } else {
120  av_bprint_chars(bp, *cur_byte, 1);
121  }
122  } else {
123  av_bprint_chars(bp, *cur_byte, 1);
124  }
125  next_byte(pb, cur_byte);
126  }
127  ret = expect_byte(pb, cur_byte, '"');
128  if (ret < 0)
129  goto fail;
130  if (full && !av_bprint_is_complete(bp)) {
131  ret = AVERROR(ENOMEM);
132  goto fail;
133  }
134  return 0;
135 
136 fail:
138  return ret;
139 }
140 
141 static int parse_label(AVIOContext *pb, int *cur_byte, AVBPrint *bp)
142 {
143  int ret;
144 
145  ret = parse_string(pb, cur_byte, bp, 0);
146  if (ret < 0)
147  return ret;
148  ret = expect_byte(pb, cur_byte, ':');
149  if (ret < 0)
150  return ret;
151  return 0;
152 }
153 
154 static int parse_boolean(AVIOContext *pb, int *cur_byte, int *result)
155 {
156  static const char * const text[] = { "false", "true" };
157  const char *p;
158  int i;
159 
160  skip_spaces(pb, cur_byte);
161  for (i = 0; i < 2; i++) {
162  p = text[i];
163  if (*cur_byte != *p)
164  continue;
165  for (; *p; p++, next_byte(pb, cur_byte))
166  if (*cur_byte != *p)
167  return AVERROR_INVALIDDATA;
168  if (BETWEEN(*cur_byte | 32, 'a', 'z'))
169  return AVERROR_INVALIDDATA;
170  *result = i;
171  return 0;
172  }
173  return AVERROR_INVALIDDATA;
174 }
175 
176 static int parse_int(AVIOContext *pb, int *cur_byte, int64_t *result)
177 {
178  int64_t val = 0;
179 
180  skip_spaces(pb, cur_byte);
181  if ((unsigned)*cur_byte - '0' > 9)
182  return AVERROR_INVALIDDATA;
183  while (BETWEEN(*cur_byte, '0', '9')) {
184  val = val * 10 + (*cur_byte - '0');
185  next_byte(pb, cur_byte);
186  }
187  *result = val;
188  return 0;
189 }
190 
192 {
193  int ret, cur_byte, start_of_par;
194  AVBPrint label, content;
195  int64_t pos, start, duration;
196  AVPacket *pkt;
197 
198  next_byte(pb, &cur_byte);
199  ret = expect_byte(pb, &cur_byte, '{');
200  if (ret < 0)
201  return AVERROR_INVALIDDATA;
202  ret = parse_label(pb, &cur_byte, &label);
203  if (ret < 0 || strcmp(label.str, "captions"))
204  return AVERROR_INVALIDDATA;
205  ret = expect_byte(pb, &cur_byte, '[');
206  if (ret < 0)
207  return AVERROR_INVALIDDATA;
208  while (1) {
209  content.size = 0;
210  start = duration = AV_NOPTS_VALUE;
211  ret = expect_byte(pb, &cur_byte, '{');
212  if (ret < 0)
213  return ret;
214  pos = avio_tell(pb) - 1;
215  while (1) {
216  ret = parse_label(pb, &cur_byte, &label);
217  if (ret < 0)
218  return ret;
219  if (!strcmp(label.str, "startOfParagraph")) {
220  ret = parse_boolean(pb, &cur_byte, &start_of_par);
221  if (ret < 0)
222  return ret;
223  } else if (!strcmp(label.str, "content")) {
224  ret = parse_string(pb, &cur_byte, &content, 1);
225  if (ret < 0)
226  return ret;
227  } else if (!strcmp(label.str, "startTime")) {
228  ret = parse_int(pb, &cur_byte, &start);
229  if (ret < 0)
230  return ret;
231  } else if (!strcmp(label.str, "duration")) {
232  ret = parse_int(pb, &cur_byte, &duration);
233  if (ret < 0)
234  return ret;
235  } else {
236  return AVERROR_INVALIDDATA;
237  }
238  skip_spaces(pb, &cur_byte);
239  if (cur_byte != ',')
240  break;
241  next_byte(pb, &cur_byte);
242  }
243  ret = expect_byte(pb, &cur_byte, '}');
244  if (ret < 0)
245  return ret;
246 
247  if (!content.size || start == AV_NOPTS_VALUE ||
249  return AVERROR_INVALIDDATA;
250  pkt = ff_subtitles_queue_insert(subs, content.str, content.len, 0);
251  if (!pkt)
252  return AVERROR(ENOMEM);
253  pkt->pos = pos;
254  pkt->pts = start;
255  pkt->duration = duration;
256  av_bprint_finalize(&content, NULL);
257 
258  skip_spaces(pb, &cur_byte);
259  if (cur_byte != ',')
260  break;
261  next_byte(pb, &cur_byte);
262  }
263  ret = expect_byte(pb, &cur_byte, ']');
264  if (ret < 0)
265  return ret;
266  ret = expect_byte(pb, &cur_byte, '}');
267  if (ret < 0)
268  return ret;
269  skip_spaces(pb, &cur_byte);
270  if (cur_byte != AVERROR_EOF)
271  return ERR_CODE(cur_byte);
272  return 0;
273 }
274 
276 {
278  AVStream *st = avformat_new_stream(avf, NULL);
279  int ret, i;
280  AVPacket *last;
281 
282  if (!st)
283  return AVERROR(ENOMEM);
284 
285  ret = parse_file(avf->pb, &tc->subs);
286  if (ret < 0) {
287  if (ret == AVERROR_INVALIDDATA)
288  av_log(avf, AV_LOG_ERROR, "Syntax error near offset %"PRId64".\n",
289  avio_tell(avf->pb));
291  return ret;
292  }
293  ff_subtitles_queue_finalize(avf, &tc->subs);
294  for (i = 0; i < tc->subs.nb_subs; i++)
295  tc->subs.subs[i].pts += tc->start_time;
296 
297  last = &tc->subs.subs[tc->subs.nb_subs - 1];
300  avpriv_set_pts_info(st, 64, 1, 1000);
301  st->probe_packets = 0;
302  st->start_time = 0;
303  st->duration = last->pts + last->duration;
304  st->cur_dts = 0;
305 
306  return 0;
307 }
308 
310 {
312 
313  return ff_subtitles_queue_read_packet(&tc->subs, packet);
314 }
315 
317 {
319 
321  return 0;
322 }
323 
325 {
326  static const char *const tags[] = {
327  "\"captions\"", "\"duration\"", "\"content\"",
328  "\"startOfParagraph\"", "\"startTime\"",
329  };
330  unsigned i, count = 0;
331  const char *t;
332 
333  if (p->buf[strspn(p->buf, " \t\r\n")] != '{')
334  return 0;
335  for (i = 0; i < FF_ARRAY_ELEMS(tags); i++) {
336  if (!(t = strstr(p->buf, tags[i])))
337  continue;
338  t += strlen(tags[i]);
339  t += strspn(t, " \t\r\n");
340  if (*t == ':')
341  count++;
342  }
343  return count == FF_ARRAY_ELEMS(tags) ? AVPROBE_SCORE_MAX :
344  count ? AVPROBE_SCORE_EXTENSION : 0;
345 }
346 
347 static int tedcaptions_read_seek(AVFormatContext *avf, int stream_index,
348  int64_t min_ts, int64_t ts, int64_t max_ts,
349  int flags)
350 {
352  return ff_subtitles_queue_seek(&tc->subs, avf, stream_index,
353  min_ts, ts, max_ts, flags);
354 }
355 
357  .name = "tedcaptions",
358  .long_name = NULL_IF_CONFIG_SMALL("TED Talks captions"),
359  .priv_data_size = sizeof(TEDCaptionsDemuxer),
360  .priv_class = &tedcaptions_demuxer_class,
365  .read_seek2 = tedcaptions_read_seek,
366 };
skip_spaces
static void skip_spaces(AVIOContext *pb, int *cur_byte)
Definition: tedcaptionsdec.c:77
AVMEDIA_TYPE_SUBTITLE
@ AVMEDIA_TYPE_SUBTITLE
Definition: avutil.h:204
AV_BPRINT_SIZE_UNLIMITED
#define AV_BPRINT_SIZE_UNLIMITED
AVERROR
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
opt.h
avformat_new_stream
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
Definition: utils.c:4519
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:56
av_bprint_finalize
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
Definition: bprint.c:235
tedcaptions_options
static const AVOption tedcaptions_options[]
Definition: tedcaptionsdec.c:35
av_bprint_init
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Definition: bprint.c:69
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:55
tedcaptions_read_seek
static int tedcaptions_read_seek(AVFormatContext *avf, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
Definition: tedcaptionsdec.c:347
AVOption
AVOption.
Definition: opt.h:246
b
#define b
Definition: input.c:41
AVStream::cur_dts
int64_t cur_dts
Definition: avformat.h:1068
AVPacket::duration
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: packet.h:373
ERR_CODE
#define ERR_CODE(c)
Definition: tedcaptionsdec.c:54
AVPROBE_SCORE_MAX
#define AVPROBE_SCORE_MAX
maximum score
Definition: avformat.h:453
ff_tedcaptions_demuxer
AVInputFormat ff_tedcaptions_demuxer
Definition: tedcaptionsdec.c:356
fail
#define fail()
Definition: checkasm.h:123
TEDCaptionsDemuxer::start_time
int64_t start_time
Definition: tedcaptionsdec.c:31
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
avio_tell
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:557
AV_BPRINT_SIZE_AUTOMATIC
#define AV_BPRINT_SIZE_AUTOMATIC
val
static double val(void *priv, double ch)
Definition: aeval.c:76
AVStream::duration
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition: avformat.h:914
ff_subtitles_queue_seek
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.
Definition: subtitles.c:250
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
AVInputFormat
Definition: avformat.h:636
av_cold
#define av_cold
Definition: attributes.h:90
HEX_DIGIT_VAL
#define HEX_DIGIT_VAL(c)
Definition: tedcaptionsdec.c:53
duration
int64_t duration
Definition: movenc.c:63
TEDCaptionsDemuxer
Definition: tedcaptionsdec.c:29
tedcaptions_demuxer_class
static const AVClass tedcaptions_demuxer_class
Definition: tedcaptionsdec.c:43
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:641
AVProbeData::buf
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:443
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:224
TEDCaptionsDemuxer::subs
FFDemuxSubtitlesQueue subs
Definition: tedcaptionsdec.c:32
ff_subtitles_queue_read_packet
int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue *q, AVPacket *pkt)
Generic read_packet() callback for subtitles demuxers using this queue system.
Definition: subtitles.c:212
AVFormatContext
Format I/O context.
Definition: avformat.h:1335
internal.h
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:1012
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:527
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:67
result
and forward the result(frame or status change) to the corresponding input. If nothing is possible
NULL
#define NULL
Definition: coverity.c:32
read_probe
static int read_probe(const AVProbeData *pd)
Definition: jvdec.c:55
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
AVFormatContext::pb
AVIOContext * pb
I/O context.
Definition: avformat.h:1377
AVProbeData
This structure contains the data a format has to probe a file.
Definition: avformat.h:441
tedcaptions_read_packet
static int tedcaptions_read_packet(AVFormatContext *avf, AVPacket *packet)
Definition: tedcaptionsdec.c:309
ff_subtitles_queue_insert
AVPacket * ff_subtitles_queue_insert(FFDemuxSubtitlesQueue *q, const uint8_t *event, size_t len, int merge)
Insert a new subtitle event.
Definition: subtitles.c:111
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
AVPROBE_SCORE_EXTENSION
#define AVPROBE_SCORE_EXTENSION
score for file extension
Definition: avformat.h:451
av_bprint_is_complete
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
Definition: bprint.h:185
HEX_DIGIT_TEST
#define HEX_DIGIT_TEST(c)
Definition: tedcaptionsdec.c:52
AVIOContext
Bytestream IO Context.
Definition: avio.h:161
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:186
start_time
static int64_t start_time
Definition: ffplay.c:332
avpriv_set_pts_info
void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits, unsigned int pts_num, unsigned int pts_den)
Set the time base and wrapping info for a given stream.
Definition: utils.c:4938
AVStream::probe_packets
int probe_packets
Number of packets to buffer for codec probing.
Definition: avformat.h:1075
AV_NOPTS_VALUE
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:248
ff_subtitles_queue_finalize
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.
Definition: subtitles.c:194
av_bprint_utf8
static void av_bprint_utf8(AVBPrint *bp, unsigned c)
Definition: tedcaptionsdec.c:56
FFDemuxSubtitlesQueue
Definition: subtitles.h:102
ff_subtitles_queue_clean
void ff_subtitles_queue_clean(FFDemuxSubtitlesQueue *q)
Remove and destroy all the subtitles packets.
Definition: subtitles.c:302
tedcaptions_read_probe
static av_cold int tedcaptions_read_probe(const AVProbeData *p)
Definition: tedcaptionsdec.c:324
parse_string
static int parse_string(AVIOContext *pb, int *cur_byte, AVBPrint *bp, int full)
Definition: tedcaptionsdec.c:93
av_log2
#define av_log2
Definition: intmath.h:83
parse_int
static int parse_int(AVIOContext *pb, int *cur_byte, int64_t *result)
Definition: tedcaptionsdec.c:176
bprint.h
log.h
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
AVPacket::pts
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: packet.h:348
expect_byte
static int expect_byte(AVIOContext *pb, int *cur_byte, uint8_t c)
Definition: tedcaptionsdec.c:84
AV_OPT_FLAG_DECODING_PARAM
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Definition: opt.h:277
uint8_t
uint8_t
Definition: audio_convert.c:194
next_byte
static void next_byte(AVIOContext *pb, int *cur_byte)
Definition: tedcaptionsdec.c:70
tedcaptions_read_close
static int tedcaptions_read_close(AVFormatContext *avf)
Definition: tedcaptionsdec.c:316
ret
ret
Definition: filter_design.txt:187
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
AVStream
Stream structure.
Definition: avformat.h:865
AVClass::class_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:72
pos
unsigned int pos
Definition: spdifenc.c:410
avformat.h
AV_CODEC_ID_TEXT
@ AV_CODEC_ID_TEXT
raw UTF-8 text
Definition: codec_id.h:510
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen_template.c:38
subtitles.h
pkt
static AVPacket pkt
Definition: demuxing_decoding.c:54
avio_read
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:625
parse_file
static int parse_file(AVIOContext *pb, FFDemuxSubtitlesQueue *subs)
Definition: tedcaptionsdec.c:191
parse_boolean
static int parse_boolean(AVIOContext *pb, int *cur_byte, int *result)
Definition: tedcaptionsdec.c:154
tc
#define tc
Definition: regdef.h:69
AV_OPT_FLAG_SUBTITLE_PARAM
#define AV_OPT_FLAG_SUBTITLE_PARAM
Definition: opt.h:280
AVCodecParameters::codec_id
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition: codec_par.h:60
AVPacket
This structure stores compressed data.
Definition: packet.h:332
AVPacket::pos
int64_t pos
byte position in stream, -1 if unknown
Definition: packet.h:375
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:564
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
AVStream::start_time
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
Definition: avformat.h:904
AVFormatContext::priv_data
void * priv_data
Format private data.
Definition: avformat.h:1363
parse_label
static int parse_label(AVIOContext *pb, int *cur_byte, AVBPrint *bp)
Definition: tedcaptionsdec.c:141
tedcaptions_read_header
static av_cold int tedcaptions_read_header(AVFormatContext *avf)
Definition: tedcaptionsdec.c:275
BETWEEN
#define BETWEEN(a, amin, amax)
Definition: tedcaptionsdec.c:50
av_bprint_chars
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
Definition: bprint.c:140