FFmpeg
Functions | Variables
webvttdec.c File Reference
#include "avcodec.h"
#include "ass.h"
#include "codec_internal.h"
#include "libavutil/bprint.h"

Go to the source code of this file.

Functions

static int webvtt_event_to_ass (AVBPrint *buf, const char *p)
 
static int webvtt_decode_frame (AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *avpkt)
 

Variables

struct {
   const char *   from
 
   const char *   to
 
webvtt_tag_replace []
 
const FFCodec ff_webvtt_decoder
 

Detailed Description

WebVTT subtitle decoder

See also
http://dev.w3.org/html5/webvtt/
Todo:
need to support extended markups and cue settings

Definition in file webvttdec.c.

Function Documentation

◆ webvtt_event_to_ass()

static int webvtt_event_to_ass ( AVBPrint *  buf,
const char *  p 
)
static

Definition at line 46 of file webvttdec.c.

Referenced by webvtt_decode_frame().

◆ webvtt_decode_frame()

static int webvtt_decode_frame ( AVCodecContext avctx,
AVSubtitle sub,
int got_sub_ptr,
const AVPacket avpkt 
)
static

Definition at line 83 of file webvttdec.c.

Variable Documentation

◆ from

const char* from

Definition at line 34 of file webvttdec.c.

Referenced by webvtt_event_to_ass().

◆ to

const char* to

◆ webvtt_tag_replace

const { ... } webvtt_tag_replace[]
Initial value:
= {
{"<i>", "{\\i1}"}, {"</i>", "{\\i0}"},
{"<b>", "{\\b1}"}, {"</b>", "{\\b0}"},
{"<u>", "{\\u1}"}, {"</u>", "{\\u0}"},
{"{", "\\{"}, {"}", "\\}"},
{"&gt;", ">"}, {"&lt;", "<"},
{"&lrm;", ""}, {"&rlm;", ""},
{"&amp;", "&"}, {"&nbsp;", "\\h"},
}

Referenced by webvtt_event_to_ass().

◆ ff_webvtt_decoder

const FFCodec ff_webvtt_decoder
Initial value:
= {
.p.name = "webvtt",
CODEC_LONG_NAME("WebVTT subtitle"),
.priv_data_size = sizeof(FFASSDecoderContext),
}

Definition at line 101 of file webvttdec.c.

AVMEDIA_TYPE_SUBTITLE
@ AVMEDIA_TYPE_SUBTITLE
Definition: avutil.h:204
ff_ass_subtitle_header_default
int ff_ass_subtitle_header_default(AVCodecContext *avctx)
Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS with default style.
Definition: ass.c:98
webvtt_decode_frame
static int webvtt_decode_frame(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *avpkt)
Definition: webvttdec.c:83
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
AV_CODEC_ID_WEBVTT
@ AV_CODEC_ID_WEBVTT
Definition: codec_id.h:562
ff_ass_decoder_flush
void ff_ass_decoder_flush(AVCodecContext *avctx)
Helper to flush a text subtitles decoder making use of the FFASSDecoderContext.
Definition: ass.c:166
FF_CODEC_DECODE_SUB_CB
#define FF_CODEC_DECODE_SUB_CB(func)
Definition: codec_internal.h:309
FFASSDecoderContext
Definition: ass.h:46