tedcaptionsdec.c File Reference
#include "libavutil/bprint.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "internal.h"
#include "subtitles.h"
Include dependency graph for tedcaptionsdec.c:

Go to the source code of this file.

Data Structures

struct  TEDCaptionsDemuxer
 

Macros

#define BETWEEN(a, amin, amax)   ((unsigned)((a) - (amin)) <= (amax) - (amin))
 
#define HEX_DIGIT_TEST(c)   (BETWEEN(c, '0', '9') || BETWEEN((c) | 32, 'a', 'z'))
 
#define HEX_DIGIT_VAL(c)   ((c) <= '9' ? (c) - '0' : ((c) | 32) - 'a' + 10)
 
#define ERR_CODE(c)   (c < 0 ? c : AVERROR_INVALIDDATA)
 

Functions

static void av_bprint_utf8 (AVBPrint *bp, unsigned c)
 
static void next_byte (AVIOContext *pb, int *cur_byte)
 
static void skip_spaces (AVIOContext *pb, int *cur_byte)
 
static int expect_byte (AVIOContext *pb, int *cur_byte, uint8_t c)
 
static int parse_string (AVIOContext *pb, int *cur_byte, AVBPrint *bp, int full)
 
static int parse_label (AVIOContext *pb, int *cur_byte, AVBPrint *bp)
 
static int parse_boolean (AVIOContext *pb, int *cur_byte, int *result)
 
static int parse_int (AVIOContext *pb, int *cur_byte, int64_t *result)
 
static int parse_file (AVIOContext *pb, FFDemuxSubtitlesQueue *subs)
 
static av_cold int tedcaptions_read_header (AVFormatContext *avf)
 
static int tedcaptions_read_packet (AVFormatContext *avf, AVPacket *packet)
 
static int tedcaptions_read_close (AVFormatContext *avf)
 
static av_cold int tedcaptions_read_probe (AVProbeData *p)
 
static int tedcaptions_read_seek (AVFormatContext *avf, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
 

Variables

static const AVOption tedcaptions_options []
 
static const AVClass tedcaptions_demuxer_class
 
AVInputFormat ff_tedcaptions_demuxer
 

Macro Definition Documentation

#define BETWEEN (   a,
  amin,
  amax 
)    ((unsigned)((a) - (amin)) <= (amax) - (amin))

Definition at line 50 of file tedcaptionsdec.c.

Referenced by parse_boolean(), and parse_int().

#define ERR_CODE (   c)    (c < 0 ? c : AVERROR_INVALIDDATA)

Definition at line 54 of file tedcaptionsdec.c.

Referenced by expect_byte(), parse_file(), and parse_string().

#define HEX_DIGIT_TEST (   c)    (BETWEEN(c, '0', '9') || BETWEEN((c) | 32, 'a', 'z'))

Definition at line 52 of file tedcaptionsdec.c.

Referenced by parse_string().

#define HEX_DIGIT_VAL (   c)    ((c) <= '9' ? (c) - '0' : ((c) | 32) - 'a' + 10)

Definition at line 53 of file tedcaptionsdec.c.

Referenced by parse_string().

Function Documentation

static void av_bprint_utf8 ( AVBPrint bp,
unsigned  c 
)
static

Definition at line 56 of file tedcaptionsdec.c.

Referenced by parse_string().

static int expect_byte ( AVIOContext pb,
int *  cur_byte,
uint8_t  c 
)
static

Definition at line 84 of file tedcaptionsdec.c.

Referenced by parse_file(), parse_label(), and parse_string().

static void next_byte ( AVIOContext pb,
int *  cur_byte 
)
static
static int parse_boolean ( AVIOContext pb,
int *  cur_byte,
int *  result 
)
static

Definition at line 154 of file tedcaptionsdec.c.

Referenced by parse_file().

static int parse_file ( AVIOContext pb,
FFDemuxSubtitlesQueue subs 
)
static

Definition at line 190 of file tedcaptionsdec.c.

Referenced by tedcaptions_read_header().

static int parse_int ( AVIOContext pb,
int *  cur_byte,
int64_t *  result 
)
static

Definition at line 175 of file tedcaptionsdec.c.

Referenced by parse_file().

static int parse_label ( AVIOContext pb,
int *  cur_byte,
AVBPrint bp 
)
static

Definition at line 141 of file tedcaptionsdec.c.

Referenced by parse_file().

static int parse_string ( AVIOContext pb,
int *  cur_byte,
AVBPrint bp,
int  full 
)
static

Definition at line 93 of file tedcaptionsdec.c.

Referenced by parse_file(), and parse_label().

static void skip_spaces ( AVIOContext pb,
int *  cur_byte 
)
static

Definition at line 77 of file tedcaptionsdec.c.

Referenced by expect_byte(), parse_boolean(), parse_file(), and parse_int().

static int tedcaptions_read_close ( AVFormatContext avf)
static

Definition at line 315 of file tedcaptionsdec.c.

static av_cold int tedcaptions_read_header ( AVFormatContext avf)
static

Definition at line 274 of file tedcaptionsdec.c.

static int tedcaptions_read_packet ( AVFormatContext avf,
AVPacket packet 
)
static

Definition at line 308 of file tedcaptionsdec.c.

static av_cold int tedcaptions_read_probe ( AVProbeData p)
static

Definition at line 323 of file tedcaptionsdec.c.

static int tedcaptions_read_seek ( AVFormatContext avf,
int  stream_index,
int64_t  min_ts,
int64_t  ts,
int64_t  max_ts,
int  flags 
)
static

Definition at line 346 of file tedcaptionsdec.c.

Variable Documentation

AVInputFormat ff_tedcaptions_demuxer
Initial value:
= {
.name = "tedcaptions",
.long_name = NULL_IF_CONFIG_SMALL("TED Talks captions"),
.priv_data_size = sizeof(TEDCaptionsDemuxer),
.priv_class = &tedcaptions_demuxer_class,
.read_seek2 = 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)
static const AVClass tedcaptions_demuxer_class
static int tedcaptions_read_packet(AVFormatContext *avf, AVPacket *packet)
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int tedcaptions_read_close(AVFormatContext *avf)
static int read_probe(AVProbeData *pd)
static av_cold int tedcaptions_read_header(AVFormatContext *avf)
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:517
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: libcdio.c:114
static av_cold int tedcaptions_read_probe(AVProbeData *p)

Definition at line 355 of file tedcaptionsdec.c.

const AVClass tedcaptions_demuxer_class
static
Initial value:
= {
.class_name = "tedcaptions_demuxer",
.item_name = av_default_item_name,
}
av_default_item_name
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
static const AVOption tedcaptions_options[]

Definition at line 43 of file tedcaptionsdec.c.

const AVOption tedcaptions_options[]
static
Initial value:
= {
{ "start_time", "set the start time (offset) of the subtitles, in ms",
{ .i64 = 15000 }, INT64_MIN, INT64_MAX,
{ NULL },
}
#define AV_OPT_FLAG_SUBTITLE_PARAM
Definition: opt.h:286
static int64_t start_time
Definition: ffplay.c:293
NULL
Definition: eval.c:55
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Definition: opt.h:282

Definition at line 35 of file tedcaptionsdec.c.