libgpac
Documentation of the core library of GPAC
dec_ttxt.c File Reference
#include <gpac/filters.h>
#include <gpac/constants.h>
#include <gpac/internal/isomedia_dev.h>
#include <gpac/utf.h>
#include <gpac/nodes_mpeg4.h>
#include <gpac/internal/compositor_dev.h>
+ Include dependency graph for dec_ttxt.c:

Data Structures

struct  GF_TTXTDec
 
struct  TTDTextChunk
 

Macros

#define OFFS(_n)   #_n, offsetof(GF_TTXTDec, _n)
 

Functions

static void ttd_set_blink_fraction (GF_Node *node, GF_Route *route)
 
static void ttd_set_scroll_fraction (GF_Node *node, GF_Route *route)
 
static void ttd_reset_display (GF_TTXTDec *ctx)
 
static void ttd_setup_scene (GF_TTXTDec *ctx)
 
static void ttd_toggle_display (GF_TTXTDec *ctx)
 
static void ttd_update_size_info (GF_TTXTDec *ctx)
 
static GFINLINE void ttd_add_child (GF_Node *n1, GF_Node *par)
 
static GFINLINE GF_Nodettd_create_node (GF_TTXTDec *ttd, u32 tag, const char *def_name)
 
static GF_Err ttd_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
static void ttd_reset_scene (GF_TTXTDec *ctx)
 
static char * ttd_find_font (GF_TextSampleDescriptor *tsd, u32 ID)
 
static void ttd_add_item (M_Form *form)
 
static void ttd_add_line (M_Form *form)
 
static void ttd_new_text_chunk (GF_TTXTDec *ctx, GF_TextSampleDescriptor *tsd, M_Form *form, u16 *utf16_txt, u32 utf_alloc_size, TTDTextChunk *tc)
 
static void ttd_split_chunks (GF_TextSample *txt, u32 nb_chars, GF_List *chunks, GF_Box *mod)
 
static void ttd_apply_sample (GF_TTXTDec *ctx, GF_TextSample *txt, u32 sample_desc_index, Bool is_utf_16, u32 sample_duration)
 
static Bool ttd_process_event (GF_Filter *filter, const GF_FilterEvent *evt)
 
static GF_Err ttd_render_simple_text (GF_TTXTDec *ctx, const char *pck_data, u32 pck_size, u32 sample_duration)
 
static GF_Err ttd_process (GF_Filter *filter)
 
static GF_Err ttd_initialize (GF_Filter *filter)
 
void ttd_finalize (GF_Filter *filter)
 
const GF_FilterRegister * ttxtdec_register (GF_FilterSession *session)
 

Variables

static const GF_FilterArgs TTXTDecArgs []
 
static const GF_FilterCapability TTXTDecCaps []
 
GF_FilterRegister TTXTDecRegister
 

Data Structure Documentation

◆ GF_TTXTDec

struct GF_TTXTDec
+ Collaboration diagram for GF_TTXTDec:
Data Fields
Bool texture
Bool outline
u32 txtw
u32 txth
GF_FilterPid * ipid
GF_FilterPid * opid
GF_ObjectManager * odm
GF_Scene * scene
u32 dsi_crc
Bool is_tx3g
Bool is_playing
Bool graph_registered
Bool is_eos
u32 timescale
s64 delay
GF_TextConfig * cfg
GF_BitStream * bs_r
GF_SceneGraph * scenegraph
M_Transform2D * tr_track
M_Transform2D * tr_box
M_Transform2D * tr_scroll
M_Material2D * mat_track
M_Material2D * mat_box
M_Layer2D * dlist
M_Rectangle * rec_box
M_Rectangle * rec_track
M_TimeSensor * ts_blink
M_TimeSensor * ts_scroll
M_ScalarInterpolator * process_blink
M_ScalarInterpolator * process_scroll
GF_Route * time_route
GF_List * blink_nodes
u32 scroll_type
u32 scroll_mode
Fixed scroll_time
Fixed scroll_delay
Bool timer_active
Bool simple_text
u8 * static_text
u32 txt_static_alloc
u64 sample_end
u32 forced_sub

◆ TTDTextChunk

struct TTDTextChunk
+ Collaboration diagram for TTDTextChunk:
Data Fields
u32 start_char
u32 end_char
GF_StyleRecord * srec
Bool is_highlight
u32 highlight_col
GF_TextHyperTextBox * hlink
Bool has_blink

Macro Definition Documentation

◆ OFFS

#define OFFS (   _n)    #_n, offsetof(GF_TTXTDec, _n)

Function Documentation

◆ ttd_set_blink_fraction()

static void ttd_set_blink_fraction ( GF_Node node,
GF_Route *  route 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_set_scroll_fraction()

static void ttd_set_scroll_fraction ( GF_Node node,
GF_Route *  route 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_reset_display()

static void ttd_reset_display ( GF_TTXTDec ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_setup_scene()

static void ttd_setup_scene ( GF_TTXTDec ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_toggle_display()

static void ttd_toggle_display ( GF_TTXTDec ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_update_size_info()

static void ttd_update_size_info ( GF_TTXTDec ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_add_child()

static GFINLINE void ttd_add_child ( GF_Node n1,
GF_Node par 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_create_node()

static GFINLINE GF_Node* ttd_create_node ( GF_TTXTDec ttd,
u32  tag,
const char *  def_name 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_configure_pid()

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

◆ ttd_reset_scene()

static void ttd_reset_scene ( GF_TTXTDec ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_find_font()

static char* ttd_find_font ( GF_TextSampleDescriptor tsd,
u32  ID 
)
static
+ Here is the caller graph for this function:

◆ ttd_add_item()

static void ttd_add_item ( M_Form *  form)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_add_line()

static void ttd_add_line ( M_Form *  form)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_new_text_chunk()

static void ttd_new_text_chunk ( GF_TTXTDec ctx,
GF_TextSampleDescriptor tsd,
M_Form *  form,
u16 utf16_txt,
u32  utf_alloc_size,
TTDTextChunk tc 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_split_chunks()

static void ttd_split_chunks ( GF_TextSample *  txt,
u32  nb_chars,
GF_List *  chunks,
GF_Box mod 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_apply_sample()

static void ttd_apply_sample ( GF_TTXTDec ctx,
GF_TextSample *  txt,
u32  sample_desc_index,
Bool  is_utf_16,
u32  sample_duration 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_process_event()

static Bool ttd_process_event ( GF_Filter *  filter,
const GF_FilterEvent *  evt 
)
static
+ Here is the call graph for this function:

◆ ttd_render_simple_text()

static GF_Err ttd_render_simple_text ( GF_TTXTDec ctx,
const char *  pck_data,
u32  pck_size,
u32  sample_duration 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ttd_process()

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

◆ ttd_initialize()

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

◆ ttd_finalize()

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

◆ ttxtdec_register()

const GF_FilterRegister* ttxtdec_register ( GF_FilterSession *  session)

Variable Documentation

◆ TTXTDecArgs

const GF_FilterArgs TTXTDecArgs[]
static
Initial value:
=
{
{ OFFS(texture), "use texturing for output text", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(outline), "draw text outline", GF_PROP_BOOL, "false", NULL, GF_FS_ARG_HINT_ADVANCED},
{ OFFS(txtw), "default width in standalone rendering", GF_PROP_UINT, "400", NULL, GF_FS_ARG_HINT_EXPERT},
{ OFFS(txth), "default height in standalone rendering", GF_PROP_UINT, "200", NULL, GF_FS_ARG_HINT_EXPERT},
{0}
}
#define OFFS(_n)
Definition: dec_ttxt.c:1494
@ GF_FS_ARG_HINT_EXPERT
Definition: filters.h:2104
@ GF_FS_ARG_HINT_ADVANCED
Definition: filters.h:2102
@ GF_PROP_BOOL
Definition: filters.h:858
@ GF_PROP_UINT
Definition: filters.h:852

◆ TTXTDecCaps

const GF_FilterCapability TTXTDecCaps[]
static
Initial value:
=
{
}
@ GF_CODECID_TX3G
Definition: constants.h:531
@ GF_CODECID_SIMPLE_TEXT
Definition: constants.h:520
@ GF_CODECID_RAW
Definition: constants.h:600
@ GF_CODECID_TEXT_MPEG4
Definition: constants.h:403
@ GF_CODECID_SUBS_TEXT
Definition: constants.h:526
@ 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

◆ TTXTDecRegister

GF_FilterRegister TTXTDecRegister
Initial value:
= {
.name = "ttxtdec",
GF_FS_SET_HELP("This filter decodes TTXT/TX3G streams into a BIFS scene graph of the compositor filter.\n"
"The TTXT documentation is available at https://wiki.gpac.io/xmlformats/TTXT-Format-Documentation\n"
"\n"
"In stand-alone rendering (no associated video), the filter will use:\n"
"- `Width` and `Height` properties of input pid if any\n"
"- otherwise, `osize` option of compositor if set\n"
"- otherwise, [-txtw]() and [-txth]()\n"
)
.private_size = sizeof(GF_TTXTDec),
.priority = 1,
.initialize = ttd_initialize,
.finalize = ttd_finalize,
.process = ttd_process,
.configure_pid = ttd_configure_pid,
.process_event = ttd_process_event,
.hint_class_type = GF_FS_CLASS_DECODER
}
static GF_Err ttd_process(GF_Filter *filter)
Definition: dec_ttxt.c:1346
static GF_Err ttd_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
Definition: dec_ttxt.c:249
static GF_Err ttd_initialize(GF_Filter *filter)
Definition: dec_ttxt.c:1474
static const GF_FilterCapability TTXTDecCaps[]
Definition: dec_ttxt.c:1504
void ttd_finalize(GF_Filter *filter)
Definition: dec_ttxt.c:1481
static Bool ttd_process_event(GF_Filter *filter, const GF_FilterEvent *evt)
Definition: dec_ttxt.c:1282
static const GF_FilterArgs TTXTDecArgs[]
Definition: dec_ttxt.c:1495
Definition: dec_ttxt.c:74
#define GF_FS_SET_HELP(_help)
Definition: filters.h:2372
#define SETCAPS(__struct)
Definition: filters.h:2364
@ GF_FS_REG_MAIN_THREAD
Definition: filters.h:2387
@ GF_FS_CLASS_DECODER
Definition: filters.h:2465
attribute Array args
Definition: jsf.idl:24