libgpac
Documentation of the core library of GPAC
|
Utility tools DASH manifests. More...
Data Structures | |
struct | GF_MPD_Metrics |
struct | GF_MPD_ContentComponent |
struct | GF_MPD_Descriptor |
struct | GF_MPD_Subset |
struct | GF_MPD_SegmentTimelineEntry |
struct | GF_MPD_SegmentTimeline |
struct | GF_MPD_ByteRange |
struct | GF_MPD_BaseURL |
struct | GF_MPD_URL |
struct | GF_MPD_Fractional |
struct | GF_MPD_ISOBMFInfo |
struct | GF_MPD_SegmentBase |
struct | GF_MPD_MultipleSegmentBase |
struct | GF_MPD_SegmentURL |
struct | GF_MPD_SegmentList |
struct | GF_MPD_SegmentTemplate |
struct | GF_MPD_CommonAttributes |
struct | GF_MPD_ProducerReferenceTime |
struct | GF_MPD_SubRepresentation |
struct | GF_DASH_RepresentationPlayback |
struct | GF_DASH_SegmenterContext |
struct | GF_DASH_FragmentContext |
struct | GF_DASH_SegmentContext |
struct | GF_MPD_Representation |
struct | GF_MPD_AdaptationSet |
struct | GF_MPD_Inband_Event |
struct | GF_MPD_Period |
struct | GF_MPD_ProgramInfo |
struct | GF_MPD |
struct | GF_FileDownload |
struct | GF_DASHCueInfo |
Macros | |
#define | MPD_EXTENSIBLE |
#define | GF_MPD_SEGMENT_BASE |
#define | GF_MPD_MULTIPLE_SEGMENT_BASE |
#define | GF_MPD_COMMON_ATTRIBUTES_ELEMENTS |
Functions | |
GF_Err | gf_media_mpd_format_segment_name (GF_DashTemplateSegmentType seg_type, Bool is_bs_switching, char *segment_name, const char *rep_id, const char *base_url, const char *seg_rad_name, const char *seg_ext, u64 start_time, u32 bandwidth, u32 segment_number, Bool use_segment_timeline, Bool forced) |
GF_Err | gf_mpd_init_from_dom (GF_XMLNode *root, GF_MPD *mpd, const char *base_url) |
GF_Err | gf_mpd_complete_from_dom (GF_XMLNode *root, GF_MPD *mpd, const char *base_url) |
GF_MPD * | gf_mpd_new () |
void | gf_mpd_del (GF_MPD *mpd) |
void | gf_mpd_segment_url_free (void *ptr) |
void | gf_mpd_segment_base_free (void *ptr) |
void | gf_mpd_parse_segment_url (GF_List *container, GF_XMLNode *root) |
u64 | gf_mpd_parse_date (const char *const attr) |
void | gf_mpd_url_free (void *_item) |
GF_MPD_Period * | gf_mpd_period_new () |
void | gf_mpd_period_free (void *_item) |
GF_Err | gf_mpd_write (GF_MPD const *const mpd, FILE *out, Bool compact) |
GF_Err | gf_mpd_write_file (GF_MPD const *const mpd, const char *file_name) |
GF_Err | gf_mpd_write_m3u8_master_playlist (GF_MPD const *const mpd, FILE *out, const char *m3u8_name, GF_MPD_Period *period, GF_M3U8WriteMode mode) |
GF_Err | gf_mpd_parse_period (GF_MPD *mpd, GF_XMLNode *root) |
GF_MPD_Descriptor * | gf_mpd_descriptor_new (const char *id, const char *uri, const char *value) |
GF_MPD_AdaptationSet * | gf_mpd_adaptation_set_new () |
GF_Err | gf_m3u8_to_mpd (const char *m3u8_file, const char *base_url, const char *mpd_file, u32 reload_count, char *mimeTypeForM3U8Segments, Bool do_import, Bool use_mpd_templates, Bool use_segment_timeline, GF_FileDownload *getter, GF_MPD *mpd, Bool parse_sub_playlist, Bool keep_files) |
GF_Err | gf_m3u8_solve_representation_xlink (GF_MPD_Representation *rep, const char *base_url, GF_FileDownload *getter, Bool *is_static, u64 *duration, u8 signature[GF_SHA1_DIGEST_SIZE]) |
GF_MPD_SegmentList * | gf_mpd_solve_segment_list_xlink (GF_MPD *mpd, GF_XMLNode *root) |
GF_Err | gf_mpd_init_smooth_from_dom (GF_XMLNode *root, GF_MPD *mpd, const char *default_base_url) |
void | gf_mpd_delete_segment_list (GF_MPD_SegmentList *segment_list) |
void | gf_mpd_del_list (GF_List *list, void(*__destructor)(void *), Bool reset_only) |
void | gf_mpd_descriptor_free (void *item) |
GF_Err | gf_mpd_split_adaptation_sets (GF_MPD *mpd) |
GF_Err | gf_mpd_smooth_to_mpd (char *smooth_file, GF_MPD *mpd, const char *default_base_url) |
u32 | gf_mpd_get_base_url_count (GF_MPD *mpd, GF_MPD_Period *period, GF_MPD_AdaptationSet *set, GF_MPD_Representation *rep) |
GF_Err | gf_mpd_resolve_url (GF_MPD *mpd, GF_MPD_Representation *rep, GF_MPD_AdaptationSet *set, GF_MPD_Period *period, const char *mpd_url, u32 base_url_index, GF_MPD_URLResolveType resolve_type, u32 item_index, u32 nb_segments_removed, char **out_url, u64 *out_range_start, u64 *out_range_end, u64 *segment_duration, Bool *is_in_base_url, char **out_key_url, bin128 *key_iv, u32 *out_start_number, s32 subseg_index) |
Double | gf_mpd_get_duration (GF_MPD *mpd) |
void | gf_mpd_resolve_segment_duration (GF_MPD_Representation *rep, GF_MPD_AdaptationSet *set, GF_MPD_Period *period, u64 *out_duration, u32 *out_timescale, u64 *out_pts_offset, GF_MPD_SegmentTimeline **out_segment_timeline) |
GF_Err | gf_mpd_get_segment_start_time_with_timescale (s32 in_segment_index, GF_MPD_Period const *const in_period, GF_MPD_AdaptationSet const *const in_set, GF_MPD_Representation const *const in_rep, u64 *out_segment_start_time, u64 *out_opt_segment_duration, u32 *out_opt_scale) |
GF_Err | gf_mpd_seek_in_period (Double seek_time, MPDSeekMode seek_mode, GF_MPD_Period const *const in_period, GF_MPD_AdaptationSet const *const in_set, GF_MPD_Representation const *const in_rep, u32 *out_segment_index, Double *out_opt_seek_time, Double *out_seg_dur) |
void | gf_mpd_base_url_free (void *_item) |
GF_MPD_Representation * | gf_mpd_representation_new () |
void | gf_mpd_representation_free (void *_item) |
GF_MPD_SegmentTimeline * | gf_mpd_segmentimeline_new () |
GF_Err | gf_mpd_load_cues (const char *cues_file, u32 stream_id, u32 *cues_timescale, Bool *use_edit_list, s32 *ts_offset, GF_DASHCueInfo **out_cues, u32 *nb_cues) |
GF_MPD_Descriptor * | gf_mpd_get_descriptor (GF_List *desclist, char *scheme_id) |
char * | gf_mpd_resolve_subnumber (char *llhas_template, char *segment_filename, u32 part_idx) |
This section documents the DASH, Smooth and HLS manifest parsing functions of the GPAC framework.
struct GF_MPD_Metrics |
metrics, not yet supported
Data Fields | ||
---|---|---|
u32 | dummy |
struct GF_MPD_ContentComponent |
Content Component description
Data Fields | ||
---|---|---|
u32 | id |
content component ID |
char * | type |
content component mime type |
char * | lang |
content component language |
struct GF_MPD_Descriptor |
basic extensible MPD descriptor
Data Fields | ||
---|---|---|
MPD_EXTENSIBLE char * | scheme_id_uri |
mandatory schemeid URL |
char * | value |
associated value, may be NULL |
char * | id |
associated ID, may be NULL |
struct GF_MPD_Subset |
subset, not yet supported
Data Fields | ||
---|---|---|
u32 | dummy |
struct GF_MPD_SegmentTimelineEntry |
struct GF_MPD_ByteRange |
struct GF_MPD_BaseURL |
base URL
Data Fields | ||
---|---|---|
char * | URL |
URL |
char * | service_location |
service location if any |
GF_MPD_ByteRange * | byte_range |
byte range if any |
char * | redirection |
GPAC internal: redirection for that URL |
const char * | hls_vp_rel_url |
GPAC internal: original URL relative to HLS variant playlist |
struct GF_MPD_URL |
MPD URL
Data Fields | ||
---|---|---|
char * | sourceURL |
URL of source |
GF_MPD_ByteRange * | byte_range |
byte range if any |
Bool | is_resolved |
GPAC internal - indicates the URL has already been solved |
struct GF_MPD_ISOBMFInfo |
struct GF_MPD_SegmentBase |
MPD segment base
struct GF_MPD_MultipleSegmentBase |
Multiple segment base
struct GF_MPD_SegmentURL |
segment URL
Data Fields | ||
---|---|---|
char * | media |
media URL if any |
GF_MPD_ByteRange * | media_range |
media range if any |
char * | index |
index url if any |
GF_MPD_ByteRange * | index_range |
index range if any |
u64 | duration |
duration of segment |
char * | key_url |
key URL of segment, HLS only |
bin128 | key_iv |
key IV of segment, HLS only |
u32 | hls_seq_num |
sequence number of segment, HLS only |
u64 | hls_utc_time |
informative UTC start time of segment, HLS only |
u8 | hls_ll_chunk_type |
0: full segment, 1: LL-HLS part, 2: independent LL-HLS part |
u8 | can_merge |
merge flag for byte-range subsegs 0: cannot merge, 1: can merge |
u8 | is_first_part |
merge flag for byte-range subsegs 0: cannot merge, 1: can merge |
u64 | first_tfdt | |
u64 | first_pck_seq | |
u64 | frag_start_offset | |
u64 | frag_tfdt | |
u32 | split_first_dur | |
u32 | split_last_dur |
struct GF_MPD_SegmentList |
SegmentList
Data Fields | ||
---|---|---|
GF_MPD_MULTIPLE_SEGMENT_BASE GF_List * | segment_URLs |
inherits multiple segment base list of segments - can be NULL if no segment |
char * | xlink_href |
xlink URL for external list |
Bool | xlink_actuate_on_load |
xlink evaluation on load if set, otherwise on use |
u32 | consecutive_xlink_count |
GPAC internal, number of consecutive xlink while solving |
char * | dasher_segment_name |
GPAC internal, we store the segment template here |
char * | previous_xlink_href |
GPAC internal, we store the previous xlink before resolution |
Bool | index_mode |
GPAC internal for index mode |
Bool | use_split_dur | |
u32 | sample_duration | |
u32 | src_timescale | |
u32 | pid_delay | |
s32 | first_cts_offset |
struct GF_MPD_SegmentTemplate |
SegmentTemplate
Data Fields | ||
---|---|---|
GF_MPD_MULTIPLE_SEGMENT_BASE char * | media |
inherits multiple segment base media segment template |
char * | index |
index segment template |
char * | initialization |
init segment template |
char * | bitstream_switching |
bitstream switching segment template |
u32 | nb_parts |
part count for sub-segment representations |
const char * | hls_init_name |
internal, for HLS generation |
struct GF_MPD_CommonAttributes |
common attributes
struct GF_MPD_ProducerReferenceTime |
producer reference time
Data Fields | ||
---|---|---|
u32 | ID |
ID of producer |
Bool | inband |
is timing inband (prft in segment) |
GF_MPD_ProducerRefType | type |
clock type |
char * | scheme |
scheme for application ref type |
char * | wallclock |
wallclock time as UTC timestamp |
u64 | presentation_time |
presentation time in timescale of the Representation |
GF_MPD_Descriptor * | utc_timing |
UTC timing desc if any |
struct GF_MPD_SubRepresentation |
SubRepresentation
Data Fields | ||
---|---|---|
GF_MPD_COMMON_ATTRIBUTES_ELEMENTS u32 | level |
inherits common attributes level of subrepresentation |
char * | dependecy_level |
dependency level of subrepresentation |
u32 | bandwidth |
bandwidth of subrepresentation, MANDATORY if level set |
char * | content_components |
content comonents string |
struct GF_DASH_RepresentationPlayback |
State for representation playback, GPAC internal
Data Fields | ||
---|---|---|
Bool | disabled |
disabled |
char * | cached_init_segment_url |
name of cahed init segment URL (usually local cache or gmem:// url) |
Bool | owned_gmem |
if set indicates the associated gmem memory is owned by this representation |
u64 | init_start_range |
start range of the init segment |
u64 | init_end_range |
end range of the init segment |
u32 | probe_switch_count |
number of switching probes |
GF_Blob | init_segment |
init segment blob |
char * | key_url |
associated key URL if any, for HLS |
bin128 | key_IV |
associated key IV if any, for HLS |
Double | prev_max_available_speed |
previous maximum speed that this representation can be played, or 0 if it has never been played |
Bool | waiting_codec_reset |
after switch we may have some buffered segments of the previous representation; so codec stats at this moment is unreliable. we should wait after the codec reset |
Double | bola_v |
BOLA Utility |
u32 | enhancement_rep_index_plus_one |
index of the next enhancement representation plus 1, 0 is reserved in case of the highest representation |
Bool | broadcast_flag |
set to true if the representation comes from a broadcast link (ATSC3, eMBMS) |
Bool | vvc_rpr_switch |
if set indicates the associated representations use vvc rpr switching |
const char * | init_seg_name_start |
start of segment name in full url |
void * | udta |
opaque data |
u8 | xlink_digest[GF_SHA1_DIGEST_SIZE] |
SHA1 digest for xlinks / m3u8 |
Bool | not_modified |
set to TRUE if not modified in the update of an xlink |
u32 | use_ssr |
representation uses SSR, value is estimated nb parts |
struct GF_DASH_SegmenterContext |
segment context used by the dasher, GPAC internal
Data Fields | ||
---|---|---|
char * | period_id |
ID of active period |
GF_Fraction64 | period_start |
start of active period |
GF_Fraction64 | period_duration |
duration of active period |
Bool | done |
if GF_TRUE, representation is over |
u64 | last_pck_idx |
niumber of last packet processed (to resume dashing) |
u32 | seg_number |
number of last produced segment |
char * | src_url |
source URL |
char * | init_seg |
name of init segment |
char * | template_seg |
segment template (half-resolved, no more s in it) |
char * | template_idx |
index template (half-resolved, no more s in it) |
u32 | pid_id |
ID of output PID |
u32 | source_pid |
ID of source PID |
u32 | dep_pid_id |
ID of source dependent PID |
Bool | owns_set |
indicates if this representation drives the AS segmentation |
Bool | multi_pids |
indicates if uses multi PID (eg, multiple sample descriptions in init segment) |
GF_Fraction | dash_dur |
target segment duration for this stream |
u64 | next_seg_start |
estimated next segment start time in MPD timescale |
u64 | first_cts |
first CTS of stream in stream timescale |
u64 | first_dts |
first DCTS of stream in stream timescale |
u32 | nb_repeat |
number of past repetitions of the stream |
u64 | ts_offset |
timestamp offset (in stream timescale) due to repetitions |
u32 | mpd_timescale |
mpd timescale of the stream |
u64 | est_next_dts |
estimated next DTS of the stream in media timescale |
Double | cumulated_subdur |
cumulated sub duration of the stream (to handle partial file dashing) |
Double | cumulated_dur |
cumulated duration of the stream (to handle loops) |
char * | mux_pids |
space-separated list of PID IDs of streams muxed with this stream in a multiplex representation |
u32 | segs_purged |
number of segments purged from the timeline and from disk |
Double | dur_purged |
cumulated duration of segments purged |
u32 | moof_sn |
next moof sequence number |
u32 | moof_sn_inc |
next moof sequence number increment |
u32 | last_dyn_period_id |
ID of last dynamic period in manifest |
Bool | subdur_forced |
one subdur was forced on this rep due to looping |
struct GF_DASH_FragmentContext |
struct GF_DASH_SegmentContext |
Segment context - GPAC internal, used to produce HLS manifests and segment lists/timeline
Data Fields | ||
---|---|---|
u64 | time |
time in mpd timescale |
u64 | dur |
duration in mpd timescale |
char * | filename |
name as printed in segment lists / m3u8 |
char * | filepath |
full path of file |
u32 | file_size |
file size in bytes |
u64 | file_offset |
file offset in bytes |
u32 | index_size |
index size in bytes |
u64 | index_offset |
index offset in bytes |
u32 | seg_num |
segment number |
u32 | nb_frags |
number of fragment infos |
GF_DASH_FragmentContext * | frags |
number of fragment infos |
u32 | llhls_mode |
HLS LL signaling - 0: disabled, 1: byte range, 2: files |
Bool | llhls_done |
HLS LL segment done |
Bool | encrypted |
HLS set to TRUE if encrypted |
char * | hls_key_uri |
HLS key params (URI and co) |
bin128 | hls_iv |
HLS IV |
u64 | stl_start |
start time of segment timeline entry |
u32 | stl_rcount |
repeat count of segment timeline |
char * | llhas_template |
LLHAS template |
struct GF_MPD_Representation |
Representation
Data Fields | ||
---|---|---|
GF_MPD_COMMON_ATTRIBUTES_ELEMENTS char * | id |
inherits common attributes ID of representation, mandatory |
u32 | bandwidth |
bandwidth in bits per secon, mandatory |
u32 | quality_ranking |
quality ranking |
char * | dependency_id |
dependency IDs of dependent representations |
char * | media_stream_structure_id |
stream structure ID, not used by GPAC |
GF_List * | base_URLs |
list of baseURLs if any |
GF_MPD_SegmentBase * | segment_base |
segment base of representation, or NULL if list or template is used |
GF_MPD_SegmentList * | segment_list |
segment list of representation, or NULL if base or template is used |
GF_MPD_SegmentTemplate * | segment_template |
segment template of representation, or NULL if base or list is used |
GF_List * | sub_representations |
number of subrepresentation |
GF_DASH_RepresentationPlayback | playback |
all the below members are GPAC internal GPAC playback implementation |
u32 | m3u8_media_seq_min |
internal, HLS: min sequence number of segments in playlist |
u32 | m3u8_media_seq_max |
internal, HLS: max sequence number of segments in playlist |
u32 | m3u8_low_latency |
internal, HLS: indicate this is a low latency rep |
u32 | m3u8_media_seq_indep_last |
internal, HLS: sequence number of last indeendent segment or PART in playlist |
GF_DASH_SegmenterContext * | dasher_ctx |
GPAC dasher context |
GF_List * | state_seg_list |
list of segment states |
s32 | tsb_first_entry | |
u32 | timescale |
segment timescale (for HLS) |
u32 | streamtype |
stream type (for HLS) |
u32 | timescale_mpd |
segment manifest timescale (for HLS) |
GF_Fraction | dash_dur |
dash duration |
const char * | hls_single_file_name |
init segment name for HLS single file |
u32 | nb_chan |
number of audio channels - HLS only |
Double | fps |
video FPS - HLS only |
const char * | groupID |
groupID (for HLS) |
char * | m3u8_name |
user assigned m3u8 name for this representation |
char * | m3u8_var_name |
generated m3u8 name if no user-assigned one |
FILE * | m3u8_var_file |
temp file for m3u8 generation |
u8 | crypto_type |
for m3u8: 0: not encrypted, 1: full segment, 2: CENC |
u8 | def_kms_used | |
u32 | nb_hls_master_tags | |
const char ** | hls_master_tags | |
u32 | nb_hls_variant_tags | |
const char ** | hls_variant_tags | |
Double | hls_ll_part_dur |
target part (cmaf chunk) duration for HLS LL |
u64 | first_tfdt_plus_one |
tfdt of first segment |
u32 | first_tfdt_timescale | |
GF_Fraction | hls_max_seg_dur | |
Bool | in_progress | |
char * | res_url | |
u32 | trackID | |
Bool | sub_forced | |
const char * | hls_forced |
struct GF_MPD_AdaptationSet |
AdaptationSet
Data Fields | ||
---|---|---|
GF_MPD_COMMON_ATTRIBUTES_ELEMENTS s32 | id |
inherits common attributes ID of this set, -1 if not set |
s32 | group |
group ID for this set, default value is -1: not set in MPD |
char * | lang |
language |
char * | content_type |
mime type |
GF_MPD_Fractional * | par |
picture aspect ratio |
u32 | min_bandwidth |
min bandwidth in bps |
u32 | max_bandwidth |
max bandwidth in bps |
u32 | min_width |
min width in pixels |
u32 | max_width |
max width in pixels |
u32 | min_height |
min height in pixels |
u32 | max_height |
max height in pixels |
GF_MPD_Fractional | min_framerate |
min framerate |
GF_MPD_Fractional | max_framerate |
max framerate |
u32 | ssr_mode |
set if sub-segment representation is used 0: not used 1: LL-HLS compatibiliity 2: regular SSR |
Bool | segment_alignment |
set if segment boundaries are time-aligned across qualities |
Bool | bitstream_switching |
set if a single init segment is needed (no reinit at quality switch) |
Bool | subsegment_alignment |
set if subsegment boundaries are time-aligned across qualities |
u32 | subsegment_starts_with_sap |
set if subsegment all start with given SAP type, 0 otherwise |
GF_List * | accessibility |
accessibility descriptor list if any |
GF_List * | role |
role descriptor list if any |
GF_List * | rating |
rating descriptor list if any |
GF_List * | viewpoint |
viewpoint descriptor list if any |
GF_List * | content_component |
content component descriptor list if any |
GF_List * | inband_event |
inband streams events |
GF_List * | base_URLs |
base URL (alternate location) list if any |
GF_MPD_SegmentBase * | segment_base |
segment base of representation, or NULL if list or template is used |
GF_MPD_SegmentList * | segment_list |
segment list of representation, or NULL if base or template is used |
GF_MPD_SegmentTemplate * | segment_template |
segment template of representation, or NULL if base or list is used |
GF_List * | representations |
list of representations |
char * | xlink_href |
xlink URL for the adaptation set |
Bool | xlink_actuate_on_load |
xlink evaluation on load if set, otherwise on use |
void * | udta |
user private, eg used by dasher |
u32 | nb_alt_mha_profiles |
mpegh compatible profile hack |
u32 * | alt_mha_profiles | |
Bool | alt_mha_profiles_only | |
u32 | smooth_max_chunks |
max number of valid chunks in smooth manifest |
Bool | intra_only |
INTRA-ONLY trick mode |
Bool | use_hls_ll |
adaptation set uses HLS LL |
Double | hls_ll_target_frag_dur |
struct GF_MPD_Inband_Event |
struct GF_MPD_Period |
Period
Data Fields | ||
---|---|---|
MPD_EXTENSIBLE char * | ID |
inherits from extensible ID of period |
u64 | start |
start time in milliseconds, relative to the start of the MPD |
u64 | duration |
duration in milliseconds |
Bool | bitstream_switching |
set to GF_TRUE if adaptation sets in the period don't need reinit when switching quality |
GF_List * | base_URLs |
base URL (alternate location) list if any |
GF_MPD_SegmentBase * | segment_base |
segment base of representation, or NULL if list or template is used |
GF_MPD_SegmentList * | segment_list |
segment list of representation, or NULL if base or template is used |
GF_MPD_SegmentTemplate * | segment_template |
segment template of representation, or NULL if base or list is used |
GF_List * | adaptation_sets |
list of adaptation sets |
GF_List * | subsets |
list of subsets (not yet implemented) |
char * | xlink_href |
xlink URL for the period |
Bool | xlink_actuate_on_load |
xlink evaluation on load if set, otherwise on use |
char * | origin_base_url |
original xlink URL before resolution - GPAC internal. Used to
|
char * | broken_xlink |
broken/ignored xlink, used to identify ignored xlinks in MPD updates - GPAC internal |
GF_MPD_Type | type |
type of the period - GPAC internal |
Bool | is_preroll |
period is preroll - test only, GPAC internal |
struct GF_MPD_ProgramInfo |
Program info
Data Fields | ||
---|---|---|
MPD_EXTENSIBLE char * | lang |
inherits from extensible languae |
char * | title |
title |
char * | source |
source |
char * | copyright |
copyright |
char * | more_info_url |
URL to get more info |
struct GF_MPD |
MPD
Data Fields | ||
---|---|---|
MPD_EXTENSIBLE char * | ID |
inherits from extensible ID of the MPD |
char * | profiles |
profile, mandatory |
GF_MPD_Type | type |
offering type |
u64 | availabilityStartTime |
UTC of availability start anchor, expressed in milliseconds, MANDATORY if type=dynamic |
u64 | availabilityEndTime |
UTC of availability end anchor, expressed in milliseconds |
u64 | publishTime |
UTC of last publishing of the manifest |
u64 | media_presentation_duration |
presentation duration in milliseconds, MANDATORY if type=static |
u32 | minimum_update_period |
refresh rate of MPD for dynamic offering, in milliseconds |
u32 | min_buffer_time |
minimum buffer time in milliseconds, MANDATORY |
u32 | time_shift_buffer_depth |
time shift depth in milliseconds |
u32 | suggested_presentation_delay |
presentation delay in milliseconds |
u32 | max_segment_duration |
maximum segment duration in milliseconds |
u32 | max_subsegment_duration |
maximum subsegment duration in milliseconds |
GF_List * | program_infos |
list of GF_MPD_ProgramInfo |
GF_List * | base_URLs |
list of GF_MPD_BaseURL |
GF_List * | locations |
list of strings |
GF_List * | metrics |
list of Metrics |
GF_List * | periods |
list of GF_MPD_Period |
const char * | xml_namespace |
set during parsing, to set during authoring, won't be freed by GPAC |
GF_List * | utc_timings |
UTC timing desc if any |
GF_List * | essential_properties |
Essential properties |
GF_List * | supplemental_properties |
Supplemental properties |
Bool | inject_service_desc |
inject DASHIF-LL profile service desc |
Bool | index_mode | |
u64 | gpac_init_ntp_ms |
dasher init NTP clock in ms - GPAC internal |
u64 | gpac_next_ntp_ms |
dasher next generation time NTP clock in ms - GPAC internal |
u64 | gpac_mpd_time |
dasher current MPD time in milliseconds - GPAC internal |
Bool | write_context |
indicates the GPAC state info should be written |
Bool | use_gpac_ext | |
Bool | was_dynamic |
indicates this is the last static serialization of a previously dynamic MPD |
Bool | create_m3u8_files |
indicates the HLS variant files shall be created, otherwise temp files are used |
Bool | m3u8_time |
indicates to insert clock reference in variant playlists |
u32 | force_llhls_mode |
indicates LL-HLS forced generation. 0: regular write, 1: write as byterange, 2: write as independent files |
u32 | nb_hls_ext_master |
HLS extensions to append in the master playlist |
const char ** | hls_ext_master | |
Bool | llhls_preload |
if true inject EXT-X-PRELOAD-HINT |
Bool | llhls_rendition_reports |
if true inject EXT-X-RENDITION-REPORT |
Double | llhls_part_holdback |
user-defined PART-HOLD-BACK, auto computed if <=0 |
u32 | hls_abs_url | |
Bool | m3u8_use_repid | |
Bool | hls_audio_primary | |
u32 | segment_duration |
requested segment duration for index mode |
char * | segment_template | |
Bool | allow_empty_reps |
struct GF_DASHCueInfo |
#define MPD_EXTENSIBLE |
macro for extensible MPD element Some elments are typically overloaded in XML, we keep the attributes / children nodes here. The attributes list is NULL if no extensions were found, otherwise it is a list of GF_XMLAttribute. The children list is NULL if no extensions were found, otherwise it is a list of GF_XMLNode
#define GF_MPD_SEGMENT_BASE |
macro for MPD segment base
#define GF_MPD_MULTIPLE_SEGMENT_BASE |
macro for multiple segment base WARNING: duration is expressed in GF_MPD_SEGMENT_BASE timescale unit startnumber=(u32)-1 if unused, 1 bydefault.
#define GF_MPD_COMMON_ATTRIBUTES_ELEMENTS |
Macro for common attributes and elements (representation, AdaptationSet, Preselection, ...)
not yet implemented; GF_List *inband_event_stream; \ GF_List *switching; \ GF_List *random_access; \ GF_List *group_labels; \ GF_List *labels; \ GF_List *content_popularity; \
MANDATORY: mime_type codecs
DASH template resolution mode
enum GF_MPD_ScanType |
enum GF_MPD_Type |
enum GF_M3U8WriteMode |
MPD URL resolutio mode
enum MPDSeekMode |
GF_Err gf_media_mpd_format_segment_name | ( | GF_DashTemplateSegmentType | seg_type, |
Bool | is_bs_switching, | ||
char * | segment_name, | ||
const char * | rep_id, | ||
const char * | base_url, | ||
const char * | seg_rad_name, | ||
const char * | seg_ext, | ||
u64 | start_time, | ||
u32 | bandwidth, | ||
u32 | segment_number, | ||
Bool | use_segment_timeline, | ||
Bool | forced | ||
) |
formats the segment name according to its template
seg_type | the desired format mode |
is_bs_switching | set to GF_TRUE to indicate the target segment is a bitstream switching segment |
segment_name | target buffer where the segment name is formatted - size must be GF_MAX_PATH |
rep_id | ID of the target representation |
base_url | base URL, may be NULL |
seg_rad_name | base name of the output segmeents (eg, myfile_ZZZ), shall not be NULL, may be empty ("") |
seg_ext | segment extensions |
start_time | start time of the segment in MPD timescale |
bandwidth | bandwidth used for the representation |
segment_number | number of the target segment |
use_segment_timeline | indicates if segmentTimeline is used for segment addressing in the MPD |
forced | if true, do not append extension or missing $Number$ or $Time$ when resolving template |
GF_Err gf_mpd_init_from_dom | ( | GF_XMLNode * | root, |
GF_MPD * | mpd, | ||
const char * | base_url | ||
) |
parses an MPD Element (and subtree) from DOM
root | root of DOM parsing result |
mpd | MPD structure to fill |
base_url | base URL of the DOM document |
GF_Err gf_mpd_complete_from_dom | ( | GF_XMLNode * | root, |
GF_MPD * | mpd, | ||
const char * | base_url | ||
) |
parses an MPD Period element (and subtree) from DOM
root | root of DOM parsing result |
mpd | MPD structure to fill |
base_url | base URL of the DOM document |
GF_MPD* gf_mpd_new | ( | ) |
MPD constructor
void gf_mpd_del | ( | GF_MPD * | mpd | ) |
MPD destructor
mpd | the target MPD |
void gf_mpd_segment_url_free | ( | void * | ptr | ) |
frees a GF_MPD_SegmentURL structure (type-casted to void *)
ptr | the target GF_MPD_SegmentURL |
void gf_mpd_segment_base_free | ( | void * | ptr | ) |
frees a GF_MPD_SegmentBase structure (type-casted to void *)
ptr | the target GF_MPD_SegmentBase |
void gf_mpd_parse_segment_url | ( | GF_List * | container, |
GF_XMLNode * | root | ||
) |
parses a new GF_MPD_SegmentURL from its DOM description
container | the container list where to insert the segment URL |
root | the DOM description of the segment URL |
u64 gf_mpd_parse_date | ( | const char *const | attr | ) |
parses a xsDateTime
attr | the date time value |
void gf_mpd_url_free | ( | void * | _item | ) |
frees a GF_MPD_URL structure (type-casted to void *)
_item | the target GF_MPD_URL |
GF_MPD_Period* gf_mpd_period_new | ( | ) |
MPD Period constructor
void gf_mpd_period_free | ( | void * | _item | ) |
MPD Period destructor
_item | the MPD Period to free |
writes an MPD to a file stream
mpd | the target MPD to write |
out | the target file object |
compact | if set, removes all new line and indentation in the output |
writes an MPD to a local file
mpd | the target MPD to write |
file_name | the target file name |
GF_Err gf_mpd_write_m3u8_master_playlist | ( | GF_MPD const *const | mpd, |
FILE * | out, | ||
const char * | m3u8_name, | ||
GF_MPD_Period * | period, | ||
GF_M3U8WriteMode | mode | ||
) |
writes an MPD to a m3u8 playlist
mpd | the target MPD to write |
out | the target file object |
m3u8_name | the base m3u8 name to use (needed when generating variant playlist file names) |
period | the MPD period for that m3u8 |
mode | the write operation desired |
GF_Err gf_mpd_parse_period | ( | GF_MPD * | mpd, |
GF_XMLNode * | root | ||
) |
parses an MPD Period and appends it to the MPD period list
mpd | the target MPD to write |
root | the DOM element describing the period |
GF_MPD_Descriptor* gf_mpd_descriptor_new | ( | const char * | id, |
const char * | uri, | ||
const char * | value | ||
) |
creates a new MPD descriptor
id | the descriptor ID, may be NULL |
uri | the descriptor schemeid URI, mandatory |
value | the descriptor value, may be NULL |
GF_MPD_AdaptationSet* gf_mpd_adaptation_set_new | ( | ) |
creates a new MPD AdaptationSet
GF_Err gf_m3u8_to_mpd | ( | const char * | m3u8_file, |
const char * | base_url, | ||
const char * | mpd_file, | ||
u32 | reload_count, | ||
char * | mimeTypeForM3U8Segments, | ||
Bool | do_import, | ||
Bool | use_mpd_templates, | ||
Bool | use_segment_timeline, | ||
GF_FileDownload * | getter, | ||
GF_MPD * | mpd, | ||
Bool | parse_sub_playlist, | ||
Bool | keep_files | ||
) |
converts M3U8 to MPD - getter is optional (download will still be processed if NULL)
m3u8_file | the path to the local m3u8 master playlist file |
base_url | the original URL of the file if any |
mpd_file | the destination MPD file, or NULL when filling an MPD structure |
reload_count | number of times the manifest was reloaded |
mimeTypeForM3U8Segments | default mime type for the segments in case not found in the m3u8 |
do_import | if GF_TRUE, will try to load the media segments to extract more info |
use_mpd_templates | if GF_TRUE, will use MPD SegmentTemplate instead of SegmentList (only if parse_sub_playlist is GF_TRUE) |
use_segment_timeline | if GF_TRUE, uses SegmentTimeline to describe the varying duration of segments |
getter | HTTP interface object |
mpd | MPD structure to fill, or NULL if converting to file |
parse_sub_playlist | if GF_TRUE, parses sub playlists, otherwise only the master playlist is parsed and xlink are added on each representation to the target m3u8 sub playlist |
keep_files | if GF_TRUE, will not delete any files downloaded in the conversion process |
GF_Err gf_m3u8_solve_representation_xlink | ( | GF_MPD_Representation * | rep, |
const char * | base_url, | ||
GF_FileDownload * | getter, | ||
Bool * | is_static, | ||
u64 * | duration, | ||
u8 | signature[GF_SHA1_DIGEST_SIZE] | ||
) |
solves an m3u8 xlink on a representation, and fills the SegmentList accordingly
rep | the target representation |
base_url | base URL of master manifest (representation xlink is likely relative to this URL) |
getter | HTTP interface object |
is_static | set to GF_TRUE if the variant subplaylist is on demand |
duration | set to the duration of the parsed subplaylist |
signature | SHA1 digest of last solved version, updated if changed |
GF_MPD_SegmentList* gf_mpd_solve_segment_list_xlink | ( | GF_MPD * | mpd, |
GF_XMLNode * | root | ||
) |
creates a segment list from a remote segment list DOM root
mpd | the target MPD to write |
root | the DOM element describing the segment list |
GF_Err gf_mpd_init_smooth_from_dom | ( | GF_XMLNode * | root, |
GF_MPD * | mpd, | ||
const char * | default_base_url | ||
) |
inits an MPD from a smooth manifest root node
root | the root node of a smooth manifest |
mpd | the MPD to fill |
default_base_url | the default URL of the smooth manifest |
void gf_mpd_delete_segment_list | ( | GF_MPD_SegmentList * | segment_list | ) |
deletes a segment list
segment_list | the segment list to delete |
void gf_mpd_del_list | ( | GF_List * | list, |
void(*)(void *) | __destructor, | ||
Bool | reset_only | ||
) |
deletes a list content and optionally destructs the list
list | the target list |
__destructor | the destructor function to use to destroy list items |
reset_only | if GF_TRUE, does not destroy the target list |
void gf_mpd_descriptor_free | ( | void * | item | ) |
deletes a GF_MPD_Descriptor object
item | the descriptor to delete |
splits all adaptation sets of a source MPD, creating one adaptation set per quality of each orgingal adaptation sets
mpd | the target MPD |
converts a smooth manifest (local file) to an MPD
smooth_file | local path to the smooth manifest |
mpd | MPD structure to fill |
default_base_url | the default URL of the smooth manifest |
u32 gf_mpd_get_base_url_count | ( | GF_MPD * | mpd, |
GF_MPD_Period * | period, | ||
GF_MPD_AdaptationSet * | set, | ||
GF_MPD_Representation * | rep | ||
) |
get the number of base URLs for the given representation. This cumuluates all base URLs at MPD, period, AdaptationSet and Representation levels
mpd | the target MPD |
period | the target period |
set | the target adaptation set |
rep | the target representation |
GF_Err gf_mpd_resolve_url | ( | GF_MPD * | mpd, |
GF_MPD_Representation * | rep, | ||
GF_MPD_AdaptationSet * | set, | ||
GF_MPD_Period * | period, | ||
const char * | mpd_url, | ||
u32 | base_url_index, | ||
GF_MPD_URLResolveType | resolve_type, | ||
u32 | item_index, | ||
u32 | nb_segments_removed, | ||
char ** | out_url, | ||
u64 * | out_range_start, | ||
u64 * | out_range_end, | ||
u64 * | segment_duration, | ||
Bool * | is_in_base_url, | ||
char ** | out_key_url, | ||
bin128 * | key_iv, | ||
u32 * | out_start_number, | ||
s32 | subseg_index | ||
) |
resolves a URL based for a given segment, based on the MPD url, the type of resolution
mpd | the target MPD |
rep | the target Representation |
set | the target AdaptationSet |
period | the target Period |
mpd_url | the original URL of the MPD |
base_url_index | 0-based index of the baseURL to use |
resolve_type | the type of URL resolution desired |
item_index | the index of the target segment (startNumber based) |
nb_segments_removed | number of segments removed when purging the MPD after updates (can be 0). The start number will be offset by this value |
out_url | set to the resolved URL, to be freed by caller |
out_range_start | set to the resolved start range, 0 if no range |
out_range_end | set to the resolved end range, 0 if no range |
segment_duration | set to the resolved segment duartion, 0 if unknown |
is_in_base_url | set to GF_TRUE if the resuloved URL is a sub-part of the baseURL (optional, may be NULL) |
out_key_url | set to the key URL for the segment for HLS (optional, may be NULL) |
key_iv | set to the key IV for the segment for HLS (optional, may be NULL) |
out_start_number | set to the start_number used (optional, may be NULL) |
subseg_index | index of subseg, -1 means no SSR is used |
get duration of the presentation
mpd | the target MPD |
void gf_mpd_resolve_segment_duration | ( | GF_MPD_Representation * | rep, |
GF_MPD_AdaptationSet * | set, | ||
GF_MPD_Period * | period, | ||
u64 * | out_duration, | ||
u32 * | out_timescale, | ||
u64 * | out_pts_offset, | ||
GF_MPD_SegmentTimeline ** | out_segment_timeline | ||
) |
gets the duration of media segments
rep | the target Representation |
set | the target AdaptationSet |
period | the target Period |
out_duration | set to the average media segment duration |
out_timescale | set to the MPD timescale used by this representation |
out_pts_offset | set to the presentation time offset if any (optional, may be NULL) |
out_segment_timeline | set to the segment timeline description if any (optional, may be NULL) |
GF_Err gf_mpd_get_segment_start_time_with_timescale | ( | s32 | in_segment_index, |
GF_MPD_Period const *const | in_period, | ||
GF_MPD_AdaptationSet const *const | in_set, | ||
GF_MPD_Representation const *const | in_rep, | ||
u64 * | out_segment_start_time, | ||
u64 * | out_opt_segment_duration, | ||
u32 * | out_opt_scale | ||
) |
gets the start_time from the segment index of a period/set/rep
in_segment_index | the index of the target segment (startNumber based) |
in_period | the target Period |
in_set | the target AdaptationSet |
in_rep | the target Representation |
out_segment_start_time | set to the MPD start time of the segment |
out_opt_segment_duration | set to the segment duration (optional, may be NULL) |
out_opt_scale | set to the MPD timescale for this segment (optional, may be NULL) |
GF_Err gf_mpd_seek_in_period | ( | Double | seek_time, |
MPDSeekMode | seek_mode, | ||
GF_MPD_Period const *const | in_period, | ||
GF_MPD_AdaptationSet const *const | in_set, | ||
GF_MPD_Representation const *const | in_rep, | ||
u32 * | out_segment_index, | ||
Double * | out_opt_seek_time, | ||
Double * | out_seg_dur | ||
) |
returns the segment index in the given period for the given time
seek_time | the desired time in seconds |
seek_mode | the desired seek mode |
in_period | the target Period |
in_set | the target AdaptationSet |
in_rep | the target Representation |
out_segment_index | the corresponding segment index |
out_opt_seek_time | the corresponding seek time (start time of segment in seconds) (optional, may be NULL) |
out_seg_dur | the corresponding segment duration in seconds, may be null |
void gf_mpd_base_url_free | ( | void * | _item | ) |
deletes a GF_MPD_BaseURL structure (type-casted to void *)
_item | the GF_MPD_BaseURL to free |
GF_MPD_Representation* gf_mpd_representation_new | ( | ) |
creates a new GF_MPD_Representation
void gf_mpd_representation_free | ( | void * | _item | ) |
deletes a GF_MPD_Representation structure (type-casted to void *)
_item | the GF_MPD_Representation to free |
GF_MPD_SegmentTimeline* gf_mpd_segmentimeline_new | ( | ) |
creates a new GF_MPD_SegmentTimeline
GF_Err gf_mpd_load_cues | ( | const char * | cues_file, |
u32 | stream_id, | ||
u32 * | cues_timescale, | ||
Bool * | use_edit_list, | ||
s32 * | ts_offset, | ||
GF_DASHCueInfo ** | out_cues, | ||
u32 * | nb_cues | ||
) |
loads a cue file and allocates cues as needed
cues_file | the XML cue file to load |
stream_id | the ID of the stream for which we load cues (typically, TrackID or GF_PROP_PID_ID) |
cues_timescale | set to the timescale used in the cues document |
use_edit_list | set to GF_TRUE if the cts values of cues have edit list applied (i.e. are ISOBMFF presentation times) |
ts_offset | set to the timestamp offset to subtract from DTS/CTS values |
out_cues | set to a newly allocated list of cues, to free by the caller |
nb_cues | set to the number of cues parsed |
GF_MPD_Descriptor* gf_mpd_get_descriptor | ( | GF_List * | desclist, |
char * | scheme_id | ||
) |
gets first MPD descriptor from descriptor list for a given scheme_id
desclist | list of MPD Descriptors |
scheme_id | scheme ID to look for |
char* gf_mpd_resolve_subnumber | ( | char * | llhas_template, |
char * | segment_filename, | ||
u32 | part_idx | ||
) |
resolve the SubNumber template, utility function used by some output filters
llhas_template | template for the segment, or NULL if none |
segment_filename | segment filename |
part_idx | index of part to use |