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
webvtt.c File Reference
+ Include dependency graph for webvtt.c:

Data Structures

struct  GF_WebVTTSample
 
struct  GF_VTTCueBox
 
struct  GF_WebVTTParser
 

Macros

#define REM_TRAIL_MARKS(__str, __sep)
 
#define SKIP_WHITESPACE
 

Enumerations

enum  GF_WebVTTParserState {
  WEBVTT_PARSER_STATE_WAITING_SIGNATURE, WEBVTT_PARSER_STATE_WAITING_HEADER, WEBVTT_PARSER_STATE_WAITING_CUE, WEBVTT_PARSER_STATE_WAITING_CUE_TIMESTAMP,
  WEBVTT_PARSER_STATE_WAITING_CUE_PAYLOAD
}
 

Functions

GF_Boxboxstring_New (u32 type)
 
GF_Boxboxstring_new_with_data (u32 type, const char *string)
 
GF_Boxvtcu_New ()
 
GF_Boxvtte_New ()
 
GF_Boxwvtt_New ()
 
void boxstring_del (GF_Box *s)
 
void vtcu_del (GF_Box *s)
 
void vtte_del (GF_Box *s)
 
void wvtt_del (GF_Box *s)
 
GF_Err boxstring_Read (GF_Box *s, GF_BitStream *bs)
 
static GF_Err vtcu_Add (GF_Box *s, GF_Box *box)
 
GF_Err vtcu_Read (GF_Box *s, GF_BitStream *bs)
 
GF_Err vtte_Read (GF_Box *s, GF_BitStream *bs)
 
static GF_Err wvtt_Add (GF_Box *s, GF_Box *box)
 
GF_Err wvtt_Read (GF_Box *s, GF_BitStream *bs)
 
GF_Err boxstring_Write (GF_Box *s, GF_BitStream *bs)
 
GF_Err vtcu_Write (GF_Box *s, GF_BitStream *bs)
 
GF_Err vtte_Write (GF_Box *s, GF_BitStream *bs)
 
GF_Err wvtt_Write (GF_Box *s, GF_BitStream *bs)
 
GF_Err boxstring_Size (GF_Box *s)
 
GF_Err vtcu_Size (GF_Box *s)
 
GF_Err vtte_Size (GF_Box *s)
 
GF_Err wvtt_Size (GF_Box *s)
 
static GF_Err webvtt_write_cue (GF_BitStream *bs, GF_WebVTTCue *cue)
 
GF_ISOSamplegf_isom_webvtt_to_sample (void *s)
 
GF_Err DumpBox (GF_Box *a, FILE *trace)
 
void gf_box_dump_done (char *name, GF_Box *ptr, FILE *trace)
 
GF_Err boxstring_dump (GF_Box *a, FILE *trace)
 
GF_Err vtcu_dump (GF_Box *a, FILE *trace)
 
GF_Err vtte_dump (GF_Box *a, FILE *trace)
 
GF_Err wvtt_dump (GF_Box *a, FILE *trace)
 
GF_WebVTTSampleEntryBoxgf_webvtt_isom_get_description (GF_ISOFile *movie, u32 trackNumber, u32 descriptionIndex)
 
GF_Err gf_isom_update_webvtt_description (GF_ISOFile *movie, u32 trackNumber, u32 descriptionIndex, const char *config)
 
GF_Err gf_isom_new_webvtt_description (GF_ISOFile *movie, u32 trackNumber, GF_TextSampleDescriptor *desc, char *URLname, char *URNname, u32 *outDescriptionIndex)
 
static GF_WebVTTCuegf_webvtt_cue_split_at (GF_WebVTTCue *cue, GF_WebVTTTimestamp *time)
 
static GF_Err gf_webvtt_cue_add_property (GF_WebVTTCue *cue, GF_WebVTTCuePropertyType type, char *text_data, u32 text_len)
 
static GF_WebVTTCuegf_webvtt_cue_new ()
 
void gf_webvtt_cue_del (GF_WebVTTCue *cue)
 
static GF_WebVTTSample * gf_webvtt_sample_new ()
 
u64 gf_webvtt_sample_get_start (GF_WebVTTSample *samp)
 
void gf_webvtt_sample_del (GF_WebVTTSample *samp)
 
GF_WebVTTParser * gf_webvtt_parser_new ()
 
s32 gf_text_get_utf_type (FILE *in_src)
 
GF_Err gf_webvtt_parser_init (GF_WebVTTParser *parser, const char *input_file, void *user, GF_Err(*report_message)(void *, GF_Err, char *, const char *), void(*on_sample_parsed)(void *, GF_WebVTTSample *), void(*on_header_parsed)(void *, const char *))
 
void gf_webvtt_parser_reset (GF_WebVTTParser *parser)
 
void gf_webvtt_parser_del (GF_WebVTTParser *parser)
 
u64 gf_webvtt_parser_last_duration (GF_WebVTTParser *parser)
 
Bool gf_webvtt_timestamp_is_zero (GF_WebVTTTimestamp *ts)
 
void gf_webvtt_timestamp_set (GF_WebVTTTimestamp *ts, u64 value)
 
u64 gf_webvtt_timestamp_get (GF_WebVTTTimestamp *ts)
 
void gf_webvtt_timestamp_dump (GF_WebVTTTimestamp *ts, FILE *dump, Bool dump_hour)
 
static GF_Err gf_webvtt_add_cue_to_samples (GF_WebVTTParser *parser, GF_List *samples, GF_WebVTTCue *cue)
 
char * gf_text_get_utf8_line (char *szLine, u32 lineSize, FILE *txt_in, s32 unicode_type)
 
GF_Err gf_webvtt_parse_timestamp (GF_WebVTTParser *parser, GF_WebVTTTimestamp *ts, const char *line)
 
GF_Err gf_webvtt_parser_parse_timings_settings (GF_WebVTTParser *parser, GF_WebVTTCue *cue, char *line, u32 len)
 
GF_Err gf_webvtt_parser_parse (GF_WebVTTParser *parser, u32 duration)
 
GF_Err gf_webvtt_dump_header_boxed (FILE *dump, const char *data, u32 dataLength, u32 *dumpedLength)
 
GF_Err gf_webvtt_dump_header (FILE *dump, GF_ISOFile *file, u32 track, u32 index)
 
GF_Err gf_webvtt_dump_iso_sample (FILE *dump, u32 timescale, GF_ISOSample *iso_sample)
 
GF_List * gf_webvtt_parse_iso_cues (GF_ISOSample *iso_sample, u64 start)
 
GF_List * gf_webvtt_parse_cues_from_data (const char *data, u32 dataLength, u64 start)
 
GF_Err gf_webvtt_merge_cues (GF_WebVTTParser *parser, u64 start, GF_List *cues)
 
GF_Err gf_webvtt_parse_iso_sample (GF_WebVTTParser *parser, u32 timescale, GF_ISOSample *iso_sample, Bool merge)
 
static GF_Err gf_webvtt_parser_dump_finalize (GF_WebVTTParser *parser, u64 duration)
 
void gf_webvtt_dump_cue (void *user, GF_WebVTTCue *cue)
 
GF_Err gf_webvtt_dump_cues (FILE *dump, GF_List *cues)
 
GF_Err gf_webvtt_dump_sample (FILE *dump, GF_WebVTTSample *samp)
 
GF_Err gf_webvtt_dump_iso_track (GF_MediaExporter *dumper, char *szName, u32 track, Bool merge)
 

Data Structure Documentation

struct _webvtt_sample
+ Collaboration diagram for GF_WebVTTSample:
Data Fields
u64 start
u64 end
GF_List * cues
struct GF_VTTCueBox
+ Collaboration diagram for GF_VTTCueBox:
Data Fields
u32 type
u64 size
GF_List * other_boxes
GF_StringBox * id
GF_StringBox * time
GF_StringBox * settings
GF_StringBox * payload

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])) { \
had_marks = GF_TRUE; \
__str[_len] = 0; \
} else break; \
}
Definition: setup.h:317
uint32_t u32
Definition: setup.h:246
#define SKIP_WHITESPACE
Value:
while (pos < len && (line[pos] == ' ' || line[pos] == '\t' || \
line[pos] == '\r' || line[pos] == '\f' || line[pos] == '\n')) pos++;

Enumeration Type Documentation

Enumerator
WEBVTT_PARSER_STATE_WAITING_SIGNATURE 
WEBVTT_PARSER_STATE_WAITING_HEADER 
WEBVTT_PARSER_STATE_WAITING_CUE 
WEBVTT_PARSER_STATE_WAITING_CUE_TIMESTAMP 
WEBVTT_PARSER_STATE_WAITING_CUE_PAYLOAD 

Function Documentation

GF_Box* boxstring_New ( u32  type)

+ Here is the caller 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_Box* vtcu_New ( )

+ Here is the caller graph for this function:

GF_Box* vtte_New ( )

+ Here is the caller graph for this function:

GF_Box* wvtt_New ( )

+ Here is the caller graph for this function:

void boxstring_del ( GF_Box s)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vtcu_del ( GF_Box s)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vtte_del ( GF_Box s)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void wvtt_del ( GF_Box s)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err boxstring_Read ( GF_Box s,
GF_BitStream *  bs 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err vtcu_Add ( GF_Box s,
GF_Box box 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err vtcu_Read ( GF_Box s,
GF_BitStream *  bs 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err vtte_Read ( GF_Box s,
GF_BitStream *  bs 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err wvtt_Add ( GF_Box s,
GF_Box box 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err wvtt_Read ( GF_Box s,
GF_BitStream *  bs 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err boxstring_Write ( GF_Box s,
GF_BitStream *  bs 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err vtcu_Write ( GF_Box s,
GF_BitStream *  bs 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err vtte_Write ( GF_Box s,
GF_BitStream *  bs 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err wvtt_Write ( GF_Box s,
GF_BitStream *  bs 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err boxstring_Size ( GF_Box s)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err vtcu_Size ( GF_Box s)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err vtte_Size ( GF_Box s)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err wvtt_Size ( GF_Box s)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err webvtt_write_cue ( GF_BitStream *  bs,
GF_WebVTTCue cue 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_ISOSample* gf_isom_webvtt_to_sample ( void *  s)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err DumpBox ( GF_Box a,
FILE *  trace 
)

+ Here is the call graph for this function:

void gf_box_dump_done ( char *  name,
GF_Box ptr,
FILE *  trace 
)

+ Here is the call graph for this function:

GF_Err boxstring_dump ( GF_Box a,
FILE *  trace 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err vtcu_dump ( GF_Box a,
FILE *  trace 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err vtte_dump ( GF_Box a,
FILE *  trace 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err wvtt_dump ( GF_Box a,
FILE *  trace 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_WebVTTSampleEntryBox* gf_webvtt_isom_get_description ( GF_ISOFile *  movie,
u32  trackNumber,
u32  descriptionIndex 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_isom_update_webvtt_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_webvtt_description ( GF_ISOFile *  movie,
u32  trackNumber,
GF_TextSampleDescriptor desc,
char *  URLname,
char *  URNname,
u32 outDescriptionIndex 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_WebVTTCue* gf_webvtt_cue_split_at ( GF_WebVTTCue cue,
GF_WebVTTTimestamp time 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err gf_webvtt_cue_add_property ( GF_WebVTTCue cue,
GF_WebVTTCuePropertyType  type,
char *  text_data,
u32  text_len 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_WebVTTCue* gf_webvtt_cue_new ( )
static

+ Here is the caller graph for this function:

void gf_webvtt_cue_del ( GF_WebVTTCue cue)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_WebVTTSample* gf_webvtt_sample_new ( )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u64 gf_webvtt_sample_get_start ( GF_WebVTTSample *  samp)

+ Here is the caller graph for this function:

void gf_webvtt_sample_del ( GF_WebVTTSample *  samp)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_WebVTTParser* gf_webvtt_parser_new ( )

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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:

GF_Err gf_webvtt_parser_init ( GF_WebVTTParser *  parser,
const char *  input_file,
void *  user,
GF_Err(*)(void *, GF_Err, char *, const char *)  report_message,
void(*)(void *, GF_WebVTTSample *)  on_sample_parsed,
void(*)(void *, const char *)  on_header_parsed 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_webvtt_parser_reset ( GF_WebVTTParser *  parser)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_webvtt_parser_del ( GF_WebVTTParser *  parser)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u64 gf_webvtt_parser_last_duration ( GF_WebVTTParser *  parser)

+ Here is the caller graph for this function:

Bool gf_webvtt_timestamp_is_zero ( GF_WebVTTTimestamp ts)

+ Here is the caller graph for this function:

void gf_webvtt_timestamp_set ( GF_WebVTTTimestamp ts,
u64  value 
)

+ Here is the caller graph for this function:

u64 gf_webvtt_timestamp_get ( GF_WebVTTTimestamp ts)

+ Here is the caller graph for this function:

void gf_webvtt_timestamp_dump ( GF_WebVTTTimestamp ts,
FILE *  dump,
Bool  dump_hour 
)

+ Here is the caller graph for this function:

static GF_Err gf_webvtt_add_cue_to_samples ( GF_WebVTTParser *  parser,
GF_List *  samples,
GF_WebVTTCue cue 
)
static

+ 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:

GF_Err gf_webvtt_parse_timestamp ( GF_WebVTTParser *  parser,
GF_WebVTTTimestamp ts,
const char *  line 
)

+ Here is the caller graph for this function:

GF_Err gf_webvtt_parser_parse_timings_settings ( GF_WebVTTParser *  parser,
GF_WebVTTCue cue,
char *  line,
u32  len 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_webvtt_parser_parse ( GF_WebVTTParser *  parser,
u32  duration 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_webvtt_dump_header_boxed ( FILE *  dump,
const char *  data,
u32  dataLength,
u32 dumpedLength 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_webvtt_dump_header ( FILE *  dump,
GF_ISOFile *  file,
u32  track,
u32  index 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_webvtt_dump_iso_sample ( FILE *  dump,
u32  timescale,
GF_ISOSample iso_sample 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_List* gf_webvtt_parse_iso_cues ( GF_ISOSample iso_sample,
u64  start 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_List* gf_webvtt_parse_cues_from_data ( const char *  data,
u32  dataLength,
u64  start 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_webvtt_merge_cues ( GF_WebVTTParser *  parser,
u64  start,
GF_List *  cues 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_webvtt_parse_iso_sample ( GF_WebVTTParser *  parser,
u32  timescale,
GF_ISOSample iso_sample,
Bool  merge 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static GF_Err gf_webvtt_parser_dump_finalize ( GF_WebVTTParser *  parser,
u64  duration 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_webvtt_dump_cue ( void *  user,
GF_WebVTTCue cue 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_webvtt_dump_cues ( FILE *  dump,
GF_List *  cues 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_webvtt_dump_sample ( FILE *  dump,
GF_WebVTTSample *  samp 
)

+ Here is the call graph for this function:

GF_Err gf_webvtt_dump_iso_track ( GF_MediaExporter dumper,
char *  szName,
u32  track,
Bool  merge 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: