libgpac
Documentation of the core library of GPAC
ttml_conv.c File Reference
#include <gpac/filters.h>
#include <gpac/constants.h>
#include <gpac/bitstream.h>
#include <gpac/internal/isomedia_dev.h>
#include <gpac/internal/media_dev.h>
#include <gpac/color.h>
#include <gpac/xml.h>
+ Include dependency graph for ttml_conv.c:

Data Structures

struct  TTMLConvCtx
 

Functions

GF_Err ttmlconv_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
GF_XMLNodettml_get_body (GF_XMLNode *root)
 
GF_XMLAttributettml_get_attr (GF_XMLNode *node, char *name)
 
u64 ttml_get_timestamp_ex (char *value, u32 tick_rate, u32 *ttml_fps_num, u32 *ttml_fps_den, u32 *ttml_sfps)
 
GF_Err ttml_parse_root (GF_XMLNode *root, const char **lang, u32 *tick_rate, u32 *ttml_fps_num, u32 *ttml_fps_den, u32 *ttml_sfps)
 
static void ttmlconv_dump_node (TTMLConvCtx *ctx, GF_XMLNode *p, FILE *dump)
 
GF_Err ttmlconv_process (GF_Filter *filter)
 
static void ttmlconv_finalize (GF_Filter *filter)
 
const GF_FilterRegister * ttml2vtt_register (GF_FilterSession *session)
 
static GF_Err ttmlconv2_initialize (GF_Filter *filter)
 
const GF_FilterRegister * ttml2srt_register (GF_FilterSession *session)
 

Variables

static const GF_FilterCapability TTMLConvCaps []
 
GF_FilterRegister TTMLConvRegister
 
static const GF_FilterCapability TTMLConv2Caps []
 
GF_FilterRegister TTMLConv2Register
 

Data Structure Documentation

◆ TTMLConvCtx

struct TTMLConvCtx
Data Fields
GF_FilterPid * ipid
GF_FilterPid * opid
u32 timescale
u8 * buf
u32 buf_alloc
u64 last_end_ts
s64 delay
Bool srt_conv

Function Documentation

◆ ttmlconv_configure_pid()

GF_Err ttmlconv_configure_pid ( GF_Filter *  filter,
GF_FilterPid *  pid,
Bool  is_remove 
)
+ Here is the call graph for this function:

◆ ttml_get_body()

GF_XMLNode* ttml_get_body ( GF_XMLNode root)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttml_get_attr()

GF_XMLAttribute* ttml_get_attr ( GF_XMLNode node,
char *  name 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttml_get_timestamp_ex()

u64 ttml_get_timestamp_ex ( char *  value,
u32  tick_rate,
u32 ttml_fps_num,
u32 ttml_fps_den,
u32 ttml_sfps 
)
+ Here is the caller graph for this function:

◆ ttml_parse_root()

GF_Err ttml_parse_root ( GF_XMLNode root,
const char **  lang,
u32 tick_rate,
u32 ttml_fps_num,
u32 ttml_fps_den,
u32 ttml_sfps 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttmlconv_dump_node()

static void ttmlconv_dump_node ( TTMLConvCtx ctx,
GF_XMLNode p,
FILE *  dump 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttmlconv_process()

GF_Err ttmlconv_process ( GF_Filter *  filter)
+ Here is the call graph for this function:

◆ ttmlconv_finalize()

static void ttmlconv_finalize ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ ttml2vtt_register()

const GF_FilterRegister* ttml2vtt_register ( GF_FilterSession *  session)

◆ ttmlconv2_initialize()

static GF_Err ttmlconv2_initialize ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ ttml2srt_register()

const GF_FilterRegister* ttml2srt_register ( GF_FilterSession *  session)

Variable Documentation

◆ TTMLConvCaps

const GF_FilterCapability TTMLConvCaps[]
static
Initial value:
=
{
{0},
}
@ GF_CODECID_SUBS_XML
Definition: constants.h:528
@ GF_CODECID_WEBVTT
Definition: constants.h:518
@ GF_STREAM_TEXT
Definition: constants.h:82
#define GF_CAPS_OUTPUT
Definition: filters.h:2232
#define CAP_UINT(_f, _a, _b)
Definition: filters.h:2172
#define GF_CAPS_INPUT_EXCLUDED
Definition: filters.h:2228
#define CAP_BOOL(_f, _a, _b)
Definition: filters.h:2180
#define GF_CAPS_INPUT
Definition: filters.h:2220
@ GF_PROP_PID_CODECID
Definition: filters.h:1116
@ GF_PROP_PID_STREAM_TYPE
Definition: filters.h:1112
@ GF_PROP_PID_UNFRAMED
Definition: filters.h:1118
@ GF_TRUE
Definition: setup.h:474

◆ TTMLConvRegister

GF_FilterRegister TTMLConvRegister
Initial value:
= {
.name = "ttml2vtt",
GF_FS_SET_HELP("This filter converts TTML frames to unframed WebVTT.\n"
"\n"
"Conversion is quite limited: only the first div is analyzed and only basic styling is implemented.\n"
)
.private_size = sizeof(TTMLConvCtx),
.finalize = ttmlconv_finalize,
.configure_pid = ttmlconv_configure_pid,
.process = ttmlconv_process,
.priority = 128,
.hint_class_type = GF_FS_CLASS_SUBTITLE
}
#define GF_FS_SET_HELP(_help)
Definition: filters.h:2372
#define SETCAPS(__struct)
Definition: filters.h:2364
@ GF_FS_CLASS_SUBTITLE
Definition: filters.h:2451
static void ttmlconv_finalize(GF_Filter *filter)
Definition: ttml_conv.c:295
static const GF_FilterCapability TTMLConvCaps[]
Definition: ttml_conv.c:301
GF_Err ttmlconv_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
Definition: ttml_conv.c:53
GF_Err ttmlconv_process(GF_Filter *filter)
Definition: ttml_conv.c:147
Definition: ttml_conv.c:38

◆ TTMLConv2Caps

◆ TTMLConv2Register

GF_FilterRegister TTMLConv2Register
Initial value:
= {
.name = "ttml2srt",
GF_FS_SET_HELP("This filter converts TTML frames to unframed SRT.\n"
"\n"
"Conversion is quite limited: only the first div is analyzed and only basic styling is implemented.\n"
)
.private_size = sizeof(TTMLConvCtx),
.initialize = ttmlconv2_initialize,
.finalize = ttmlconv_finalize,
.configure_pid = ttmlconv_configure_pid,
.process = ttmlconv_process,
.hint_class_type = GF_FS_CLASS_SUBTITLE
}
static const GF_FilterCapability TTMLConv2Caps[]
Definition: ttml_conv.c:343
static GF_Err ttmlconv2_initialize(GF_Filter *filter)
Definition: ttml_conv.c:336