FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
webvttdec.c File Reference

WebVTT subtitle demuxer. More...

#include "avformat.h"
#include "internal.h"
#include "subtitles.h"
#include "libavutil/bprint.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"

Go to the source code of this file.

Data Structures

struct  WebVTTContext
 

Macros

#define SET_SIDE_DATA(name, type)
 
#define OFFSET(x)   offsetof(WebVTTContext, x)
 
#define KIND_FLAGS   AV_OPT_FLAG_SUBTITLE_PARAM
 

Functions

static int webvtt_probe (AVProbeData *p)
 
static int64_t read_ts (const char *s)
 
static int webvtt_read_header (AVFormatContext *s)
 
static int webvtt_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int webvtt_read_seek (AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
 
static int webvtt_read_close (AVFormatContext *s)
 

Variables

static const AVOption options []
 
static const AVClass webvtt_demuxer_class
 
AVInputFormat ff_webvtt_demuxer
 

Detailed Description

WebVTT subtitle demuxer.

See Also
http://dev.w3.org/html5/webvtt/

Definition in file webvttdec.c.

Macro Definition Documentation

#define SET_SIDE_DATA (   name,
  type 
)
Value:
do { \
if (name##_len) { \
if (!buf) { \
res = AVERROR(ENOMEM); \
goto end; \
} \
memcpy(buf, name, name##_len); \
} \
} while (0)
uint8_t
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:90
#define AVERROR(e)
Definition: error.h:43
void * buf
Definition: avisynth_c.h:690
GLint GLenum type
Definition: opengl_enc.c:105
if(ret< 0)
Definition: vf_mcdeint.c:282
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
Definition: avpacket.c:317
const char * name
Definition: opengl_enc.c:103

Referenced by webvtt_read_header().

#define OFFSET (   x)    offsetof(WebVTTContext, x)

Definition at line 194 of file webvttdec.c.

#define KIND_FLAGS   AV_OPT_FLAG_SUBTITLE_PARAM

Definition at line 195 of file webvttdec.c.

Function Documentation

static int webvtt_probe ( AVProbeData p)
static

Definition at line 40 of file webvttdec.c.

static int64_t read_ts ( const char *  s)
static

Definition at line 52 of file webvttdec.c.

Referenced by webvtt_read_header().

static int webvtt_read_header ( AVFormatContext s)
static

Definition at line 60 of file webvttdec.c.

static int webvtt_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 173 of file webvttdec.c.

static int webvtt_read_seek ( AVFormatContext s,
int  stream_index,
int64_t  min_ts,
int64_t  ts,
int64_t  max_ts,
int  flags 
)
static

Definition at line 179 of file webvttdec.c.

static int webvtt_read_close ( AVFormatContext s)
static

Definition at line 187 of file webvttdec.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "kind", "Set kind of WebVTT track", OFFSET(kind), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, KIND_FLAGS, "webvtt_kind" },
{ "subtitles", "WebVTT subtitles kind", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
{ "captions", "WebVTT captions kind", 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CAPTIONS }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
{ "descriptions", "WebVTT descriptions kind", 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DESCRIPTIONS }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
{ "metadata", "WebVTT metadata kind", 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_METADATA }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
{ NULL }
}
#define AV_DISPOSITION_METADATA
Definition: avformat.h:865
#define NULL
Definition: coverity.c:32
#define KIND_FLAGS
Definition: webvttdec.c:195
#define AV_DISPOSITION_CAPTIONS
To specify text track kind (different from subtitles default).
Definition: avformat.h:863
#define AV_DISPOSITION_DESCRIPTIONS
Definition: avformat.h:864
#define OFFSET(x)
Definition: webvttdec.c:194

Definition at line 197 of file webvttdec.c.

const AVClass webvtt_demuxer_class
static
Initial value:
= {
.class_name = "WebVTT demuxer",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
static const AVOption options[]
Definition: webvttdec.c:197
av_default_item_name

Definition at line 206 of file webvttdec.c.

AVInputFormat ff_webvtt_demuxer
Initial value:
= {
.name = "webvtt",
.long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
.priv_data_size = sizeof(WebVTTContext),
.read_seek2 = webvtt_read_seek,
.extensions = "vtt",
.priv_class = &webvtt_demuxer_class,
}
static int webvtt_read_close(AVFormatContext *s)
Definition: webvttdec.c:187
static int webvtt_read_header(AVFormatContext *s)
Definition: webvttdec.c:60
static int webvtt_read_seek(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
Definition: webvttdec.c:179
static const AVClass webvtt_demuxer_class
Definition: webvttdec.c:206
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. ...
Definition: internal.h:176
static int read_probe(AVProbeData *pd)
Definition: jvdec.c:55
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:514
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
static int webvtt_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: webvttdec.c:173
static int webvtt_probe(AVProbeData *p)
Definition: webvttdec.c:40

Definition at line 213 of file webvttdec.c.