FFmpeg
Data Structures | Functions | Variables
ttmlenc.c File Reference
#include "avcodec.h"
#include "internal.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/internal.h"
#include "ass_split.h"
#include "ass.h"
#include "ttmlenc.h"

Go to the source code of this file.

Data Structures

struct  TTMLContext
 

Functions

static void ttml_text_cb (void *priv, const char *text, int len)
 
static void ttml_new_line_cb (void *priv, int forced)
 
static int ttml_encode_frame (AVCodecContext *avctx, uint8_t *buf, int bufsize, const AVSubtitle *sub)
 
static av_cold int ttml_encode_close (AVCodecContext *avctx)
 
static av_cold int ttml_encode_init (AVCodecContext *avctx)
 

Variables

static const ASSCodesCallbacks ttml_callbacks
 
AVCodec ff_ttml_encoder
 

Detailed Description

TTML subtitle encoder

See also
https://www.w3.org/TR/ttml1/
https://www.w3.org/TR/ttml2/
https://www.w3.org/TR/ttml-imsc/rec

Definition in file ttmlenc.c.

Function Documentation

◆ ttml_text_cb()

static void ttml_text_cb ( void *  priv,
const char *  text,
int  len 
)
static

Definition at line 45 of file ttmlenc.c.

◆ ttml_new_line_cb()

static void ttml_new_line_cb ( void *  priv,
int  forced 
)
static

Definition at line 68 of file ttmlenc.c.

◆ ttml_encode_frame()

static int ttml_encode_frame ( AVCodecContext avctx,
uint8_t buf,
int  bufsize,
const AVSubtitle sub 
)
static

Definition at line 80 of file ttmlenc.c.

◆ ttml_encode_close()

static av_cold int ttml_encode_close ( AVCodecContext avctx)
static

Definition at line 165 of file ttmlenc.c.

◆ ttml_encode_init()

static av_cold int ttml_encode_init ( AVCodecContext avctx)
static

Definition at line 176 of file ttmlenc.c.

Variable Documentation

◆ ttml_callbacks

const ASSCodesCallbacks ttml_callbacks
static
Initial value:
= {
.text = ttml_text_cb,
.new_line = ttml_new_line_cb,
}

Definition at line 75 of file ttmlenc.c.

Referenced by ttml_encode_frame().

◆ ff_ttml_encoder

AVCodec ff_ttml_encoder
Initial value:
= {
.name = "ttml",
.long_name = NULL_IF_CONFIG_SMALL("TTML subtitle"),
.priv_data_size = sizeof(TTMLContext),
.encode_sub = ttml_encode_frame,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 200 of file ttmlenc.c.

AVMEDIA_TYPE_SUBTITLE
@ AVMEDIA_TYPE_SUBTITLE
Definition: avutil.h:204
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
ttml_text_cb
static void ttml_text_cb(void *priv, const char *text, int len)
Definition: ttmlenc.c:45
ttml_new_line_cb
static void ttml_new_line_cb(void *priv, int forced)
Definition: ttmlenc.c:68
ttml_encode_frame
static int ttml_encode_frame(AVCodecContext *avctx, uint8_t *buf, int bufsize, const AVSubtitle *sub)
Definition: ttmlenc.c:80
TTMLContext
Definition: ttmlenc.c:39
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:117
ttml_encode_init
static av_cold int ttml_encode_init(AVCodecContext *avctx)
Definition: ttmlenc.c:176
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:49
AV_CODEC_ID_TTML
@ AV_CODEC_ID_TTML
Definition: codec_id.h:548
ttml_encode_close
static av_cold int ttml_encode_close(AVCodecContext *avctx)
Definition: ttmlenc.c:165