libgpac
Documentation of the core library of GPAC
WebVTT parsing

Helper functions for WebVTT parsing. More...

+ Collaboration diagram for WebVTT parsing:

Data Structures

struct  _webvtt_timestamp
 
struct  _webvtt_cue
 

Enumerations

enum  GF_WebVTTCuePropertyType {
  WEBVTT_ID, WEBVTT_SETTINGS, WEBVTT_PAYLOAD, WEBVTT_POSTCUE_TEXT,
  WEBVTT_PRECUE_TEXT
}
 

Functions

u64 gf_webvtt_timestamp_get (GF_WebVTTTimestamp *wvtt_ts)
 
void gf_webvtt_timestamp_set (GF_WebVTTTimestamp *wvtt_ts, u64 value)
 
void gf_webvtt_timestamp_dump (GF_WebVTTTimestamp *wvtt_ts, FILE *dump, Bool dump_hour)
 
void gf_webvtt_cue_del (GF_WebVTTCue *cue)
 
GF_Err gf_webvtt_dump_header_boxed (FILE *dump, const u8 *data, u32 dataLength, u32 *printLength)
 
GF_Listgf_webvtt_parse_cues_from_data (const u8 *data, u32 dataLength, u64 start, u64 end)
 

Detailed Description

This section documents the audio and video parsing functions of the GPAC framework.


Data Structure Documentation

◆ _webvtt_timestamp

struct _webvtt_timestamp

WebVTT timestamp information

Data Fields
u32 hour
u32 min
u32 sec
u32 ms

◆ _webvtt_cue

struct _webvtt_cue

WebVTT cue structure

Data Fields
GF_WebVTTTimestamp start
GF_WebVTTTimestamp end
char * id
char * settings
char * text
char * pre_text
char * post_text
Bool split
GF_WebVTTTimestamp orig_start
GF_WebVTTTimestamp orig_end

Enumeration Type Documentation

◆ GF_WebVTTCuePropertyType

WebVTT types

Function Documentation

◆ gf_webvtt_timestamp_get()

u64 gf_webvtt_timestamp_get ( GF_WebVTTTimestamp *  wvtt_ts)

gets webvtt timestamp

Parameters
wvtt_tsthe target WebVTT timestamp
Returns
timestamp in millisecond

◆ gf_webvtt_timestamp_set()

void gf_webvtt_timestamp_set ( GF_WebVTTTimestamp *  wvtt_ts,
u64  value 
)

sets webvtt timestamp

Parameters
wvtt_tsthe target WebVTT timestamp
valuetimestamp in millisecond

◆ gf_webvtt_timestamp_dump()

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

dumps webvtt timestamp

Parameters
wvtt_tsthe target WebVTT timestamp
dumpthe output file to write to
dump_hourif GF_TRUE, dumps hours

◆ gf_webvtt_cue_del()

void gf_webvtt_cue_del ( GF_WebVTTCue *  cue)

destroys a WebVTT cue

Parameters
cuethe target WebVTT cue

◆ gf_webvtt_dump_header_boxed()

GF_Err gf_webvtt_dump_header_boxed ( FILE *  dump,
const u8 data,
u32  dataLength,
u32 printLength 
)

dumps webvtt sample boxes

Parameters
dumpthe output file to write to
datathe WebVTT ISOBMFF sample payload
dataLengththe size of the payload in bytes
printLengthset to the printed size in bytes
Returns
error if any

◆ gf_webvtt_parse_cues_from_data()

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

dumps webvtt sample boxes

Parameters
datathe WebVTT ISOBMFF sample payload
dataLengththe size of the payload in bytes
startthe start time in milliseconds of the WebVTT cue
endthe end time in milliseconds of the WebVTT cue
Returns
new list of cues, to destroy by caller