GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
text_import.c File Reference
#include <gpac/constants.h>
#include <gpac/utf.h>
#include <gpac/xml.h>
#include <gpac/token.h>
#include <gpac/internal/media_dev.h>
#include <gpac/internal/isomedia_dev.h>
#include <gpac/internal/swf_dev.h>
+ Include dependency graph for text_import.c:

Data Structures

struct  GF_ISOFlusher
 
struct  Marker
 

Macros

#define REM_TRAIL_MARKS(__str, __sep)
 
#define TTXT_DEFAULT_WIDTH   400
 
#define TTXT_DEFAULT_HEIGHT   60
 
#define TTXT_DEFAULT_FONT_SIZE   18
 
#define CHECK_STR(__str)
 
#define GET_MARKER_POS(_val, __isend)
 

Enumerations

enum  {
  GF_TEXT_IMPORT_NONE = 0, GF_TEXT_IMPORT_SRT, GF_TEXT_IMPORT_SUB, GF_TEXT_IMPORT_TTXT,
  GF_TEXT_IMPORT_TEXML, GF_TEXT_IMPORT_WEBVTT, GF_TEXT_IMPORT_TTML, GF_TEXT_IMPORT_SWF_SVG
}
 

Functions

s32 gf_text_get_utf_type (FILE *in_src)
 
static GF_Err gf_text_guess_format (char *filename, u32 *fmt)
 
void gf_text_get_video_size (GF_MediaImporter *import, u32 *width, u32 *height)
 
void gf_text_import_set_language (GF_MediaImporter *import, u32 track)
 
char * gf_text_get_utf8_line (char *szLine, u32 lineSize, FILE *txt_in, s32 unicode_type)
 
static GF_Err gf_text_import_srt (GF_MediaImporter *import)
 
static GF_Err gf_webvtt_import_report (void *user, GF_Err e, char *message, const char *line)
 
static void gf_webvtt_import_header (void *user, const char *config)
 
static void gf_webvtt_flush_sample_to_iso (void *user, GF_WebVTTSample *samp)
 
static GF_Err gf_text_import_webvtt (GF_MediaImporter *import)
 
static GF_Err gf_text_import_ttml (GF_MediaImporter *import)
 
GF_SimpleTextSampleEntryBoxgf_isom_get_simpletext_description (GF_ISOFile *movie, u32 trackNumber, u32 descriptionIndex)
 
GF_Boxboxstring_new_with_data (u32 type, const char *string)
 
GF_Err gf_isom_update_simpletext_description (GF_ISOFile *movie, u32 trackNumber, u32 descriptionIndex, const char *config)
 
GF_Err gf_isom_new_simpletext_description (GF_ISOFile *movie, u32 trackNumber, GF_TextSampleDescriptor *desc, char *URLname, char *URNname, const char *content_encoding, const char *mime, u32 *outDescriptionIndex)
 
static GF_Err swf_svg_add_iso_sample (void *user, const char *data, u32 length, u64 timestamp, Bool isRap)
 
static GF_Err swf_svg_add_iso_header (void *user, const char *data, u32 length)
 
GF_Err gf_text_import_swf (GF_MediaImporter *import)
 
static GF_Err gf_text_import_sub (GF_MediaImporter *import)
 
u32 ttxt_get_color (GF_MediaImporter *import, char *val)
 
void ttxt_parse_text_box (GF_MediaImporter *import, GF_XMLNode *n, GF_BoxRecord *box)
 
void ttxt_parse_text_style (GF_MediaImporter *import, GF_XMLNode *n, GF_StyleRecord *style)
 
char * ttxt_parse_string (GF_MediaImporter *import, char *str, Bool strip_lines)
 
static void ttxt_import_progress (void *cbk, u64 cur_samp, u64 count)
 
static GF_Err gf_text_import_ttxt (GF_MediaImporter *import)
 
u32 tx3g_get_color (GF_MediaImporter *import, char *value)
 
void tx3g_parse_text_box (GF_MediaImporter *import, GF_XMLNode *n, GF_BoxRecord *box)
 
static void texml_import_progress (void *cbk, u64 cur_samp, u64 count)
 
static GF_Err gf_text_import_texml (GF_MediaImporter *import)
 
GF_Err gf_import_timed_text (GF_MediaImporter *import)
 

Data Structure Documentation

struct GF_ISOFlusher
+ Collaboration diagram for GF_ISOFlusher:
Data Fields
GF_MediaImporter * import
u32 timescale
u32 track
u32 descriptionIndex
struct Marker
+ Collaboration diagram for Marker:
Data Fields
u32 id
u32 pos

Macro Definition Documentation

#define REM_TRAIL_MARKS (   __str,
  __sep 
)
Value:
while (1) { \
u32 _len = (u32) strlen(__str); \
if (!_len) break; \
_len--; \
if (strchr(__sep, __str[_len])) __str[_len] = 0; \
else break; \
} \
uint32_t u32
Definition: setup.h:246
#define TTXT_DEFAULT_WIDTH   400
#define TTXT_DEFAULT_HEIGHT   60
#define TTXT_DEFAULT_FONT_SIZE   18
#define CHECK_STR (   __str)
Value:
if (!__str) { \
e = gf_import_message(import, GF_BAD_PARAM, "Invalid XML formatting (line %d)", parser.line); \
goto exit; \
} \
GF_Err gf_import_message(GF_MediaImporter *import, GF_Err e, char *format,...)
Definition: media_import.c:46
Definition: tools.h:187
#define GET_MARKER_POS (   _val,
  __isend 
)
Value:
{ \
u32 i, __m = atoi(att->value); \
_val = 0; \
for (i=0; i<nb_marks; i++) { if (__m==marks[i].id) { _val = marks[i].pos; /*if (__isend) _val--; */break; } } \
}
uint32_t u32
Definition: setup.h:246

Enumeration Type Documentation

anonymous enum
Enumerator
GF_TEXT_IMPORT_NONE 
GF_TEXT_IMPORT_SRT 
GF_TEXT_IMPORT_SUB 
GF_TEXT_IMPORT_TTXT 
GF_TEXT_IMPORT_TEXML 
GF_TEXT_IMPORT_WEBVTT 
GF_TEXT_IMPORT_TTML 
GF_TEXT_IMPORT_SWF_SVG 

Function Documentation

s32 gf_text_get_utf_type ( FILE *  in_src)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err gf_text_guess_format ( char *  filename,
u32 fmt 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_text_get_video_size ( GF_MediaImporter import,
u32 width,
u32 height 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_text_import_set_language ( GF_MediaImporter import,
u32  track 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char* gf_text_get_utf8_line ( char *  szLine,
u32  lineSize,
FILE *  txt_in,
s32  unicode_type 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err gf_text_import_srt ( GF_MediaImporter import)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err gf_webvtt_import_report ( void *  user,
GF_Err  e,
char *  message,
const char *  line 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gf_webvtt_import_header ( void *  user,
const char *  config 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gf_webvtt_flush_sample_to_iso ( void *  user,
GF_WebVTTSample *  samp 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err gf_text_import_webvtt ( GF_MediaImporter import)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err gf_text_import_ttml ( GF_MediaImporter import)
static

+ Here is the caller graph for this function:

GF_SimpleTextSampleEntryBox* gf_isom_get_simpletext_description ( GF_ISOFile *  movie,
u32  trackNumber,
u32  descriptionIndex 
)

+ Here is the call graph for this function:

GF_Box* boxstring_new_with_data ( u32  type,
const char *  string 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_isom_update_simpletext_description ( GF_ISOFile *  movie,
u32  trackNumber,
u32  descriptionIndex,
const char *  config 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_isom_new_simpletext_description ( GF_ISOFile *  movie,
u32  trackNumber,
GF_TextSampleDescriptor desc,
char *  URLname,
char *  URNname,
const char *  content_encoding,
const char *  mime,
u32 outDescriptionIndex 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err swf_svg_add_iso_sample ( void *  user,
const char *  data,
u32  length,
u64  timestamp,
Bool  isRap 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err swf_svg_add_iso_header ( void *  user,
const char *  data,
u32  length 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_text_import_swf ( GF_MediaImporter import)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err gf_text_import_sub ( GF_MediaImporter import)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 ttxt_get_color ( GF_MediaImporter import,
char *  val 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ttxt_parse_text_box ( GF_MediaImporter import,
GF_XMLNode n,
GF_BoxRecord box 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ttxt_parse_text_style ( GF_MediaImporter import,
GF_XMLNode n,
GF_StyleRecord style 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char* ttxt_parse_string ( GF_MediaImporter import,
char *  str,
Bool  strip_lines 
)

+ Here is the caller graph for this function:

static void ttxt_import_progress ( void *  cbk,
u64  cur_samp,
u64  count 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err gf_text_import_ttxt ( GF_MediaImporter import)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 tx3g_get_color ( GF_MediaImporter import,
char *  value 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tx3g_parse_text_box ( GF_MediaImporter import,
GF_XMLNode n,
GF_BoxRecord box 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void texml_import_progress ( void *  cbk,
u64  cur_samp,
u64  count 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err gf_text_import_texml ( GF_MediaImporter import)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_import_timed_text ( GF_MediaImporter import)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: