libgpac
Documentation of the core library of GPAC
MPD/M3U8/Smooth Manifest Parsing

Utility tools DASH manifests. More...

+ Collaboration diagram for MPD/M3U8/Smooth Manifest Parsing:

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
 

Enumerations

enum  GF_DashTemplateSegmentType {
  GF_DASH_TEMPLATE_SEGMENT = 0 , GF_DASH_TEMPLATE_INITIALIZATION , GF_DASH_TEMPLATE_TEMPLATE , GF_DASH_TEMPLATE_TEMPLATE_WITH_PATH ,
  GF_DASH_TEMPLATE_INITIALIZATION_TEMPLATE , GF_DASH_TEMPLATE_REPINDEX , GF_DASH_TEMPLATE_REPINDEX_TEMPLATE , GF_DASH_TEMPLATE_REPINDEX_TEMPLATE_WITH_PATH ,
  GF_DASH_TEMPLATE_INITIALIZATION_SKIPINIT , GF_DASH_TEMPLATE_INITIALIZATION_TEMPLATE_SKIPINIT , GF_DASH_TEMPLATE_SEGMENT_SUBNUMBER
}
 
enum  GF_MPD_ScanType { GF_MPD_SCANTYPE_UNKNOWN , GF_MPD_SCANTYPE_PROGRESSIVE , GF_MPD_SCANTYPE_INTERLACED }
 
enum  GF_MPD_ProducerRefType { GF_MPD_PRODUCER_REF_ENCODER = 0 , GF_MPD_PRODUCER_REF_CAPTURED , GF_MPD_PRODUCER_REF_APPLICATION }
 
enum  GF_MPD_Type { GF_MPD_TYPE_STATIC , GF_MPD_TYPE_DYNAMIC , GF_MPD_TYPE_DYNAMIC_LAST }
 
enum  GF_M3U8WriteMode { GF_M3U8_WRITE_ALL =0 , GF_M3U8_WRITE_MASTER , GF_M3U8_WRITE_CHILD }
 
enum  GF_MPD_URLResolveType {
  GF_MPD_RESOLVE_URL_MEDIA , GF_MPD_RESOLVE_URL_INIT , GF_MPD_RESOLVE_URL_INDEX , GF_MPD_RESOLVE_URL_MEDIA_TEMPLATE ,
  GF_MPD_RESOLVE_URL_MEDIA_NOSTART , GF_MPD_RESOLVE_URL_MEDIA_TEMPLATE_NO_BASE
}
 
enum  MPDSeekMode { MPD_SEEK_PREV , MPD_SEEK_NEAREST }
 

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_MPDgf_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_Periodgf_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_Descriptorgf_mpd_descriptor_new (const char *id, const char *uri, const char *value)
 
GF_MPD_AdaptationSetgf_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_SegmentListgf_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_Representationgf_mpd_representation_new ()
 
void gf_mpd_representation_free (void *_item)
 
GF_MPD_SegmentTimelinegf_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_Descriptorgf_mpd_get_descriptor (GF_List *desclist, char *scheme_id)
 
char * gf_mpd_resolve_subnumber (char *llhas_template, char *segment_filename, u32 part_idx)
 

Detailed Description

This section documents the DASH, Smooth and HLS manifest parsing functions of the GPAC framework.


Data Structure Documentation

◆ GF_MPD_Metrics

struct GF_MPD_Metrics

metrics, not yet supported

Data Fields
u32 dummy

◆ GF_MPD_ContentComponent

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

◆ GF_MPD_Descriptor

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

◆ GF_MPD_Subset

struct GF_MPD_Subset

subset, not yet supported

Data Fields
u32 dummy

◆ GF_MPD_SegmentTimelineEntry

struct GF_MPD_SegmentTimelineEntry

SegmentTimeline entry

Data Fields
u64 start_time

startTime in representation's MPD timescale

u32 duration

duration in representation's MPD timescale - mandatory

u32 repeat_count

may be 0xFFFFFFFF (-1) (

Warning
this needs further testing)
u32 nb_parts

for DASH SSR

◆ GF_MPD_SegmentTimeline

struct GF_MPD_SegmentTimeline

Segment Timeline

Data Fields
GF_List * entries

list of entries

◆ GF_MPD_ByteRange

struct GF_MPD_ByteRange

Byte range info

Data Fields
u64 start_range

start range (offset of first byte in associated resource)

u64 end_range

start range (offset of last byte in associated resource)

◆ GF_MPD_BaseURL

struct GF_MPD_BaseURL

base URL

+ Collaboration diagram for GF_MPD_BaseURL:
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

◆ GF_MPD_URL

struct GF_MPD_URL

MPD URL

+ Collaboration diagram for GF_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

◆ GF_MPD_Fractional

struct GF_MPD_Fractional

MPD fraction

Data Fields
u32 num

numerator

u32 den

denominator

◆ GF_MPD_ISOBMFInfo

struct GF_MPD_ISOBMFInfo

GPAC internal, ISOBMFF info for base64 and other embedding, see N. Bouzakaria thesis

Data Fields
u32 trackID

ID of track/pid

char * stsd

base64 STSD entry

s64 mediaOffset

media offset

◆ GF_MPD_SegmentBase

struct GF_MPD_SegmentBase

MPD segment base

◆ GF_MPD_MultipleSegmentBase

struct GF_MPD_MultipleSegmentBase

Multiple segment base

◆ GF_MPD_SegmentURL

struct GF_MPD_SegmentURL

segment URL

+ Collaboration diagram for GF_MPD_SegmentURL:
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

◆ GF_MPD_SegmentList

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

◆ GF_MPD_SegmentTemplate

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

◆ GF_MPD_CommonAttributes

struct GF_MPD_CommonAttributes

common attributes

◆ GF_MPD_ProducerReferenceTime

struct GF_MPD_ProducerReferenceTime

producer reference time

+ Collaboration diagram for GF_MPD_ProducerReferenceTime:
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

◆ GF_MPD_SubRepresentation

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

◆ GF_DASH_RepresentationPlayback

struct GF_DASH_RepresentationPlayback

State for representation playback, GPAC internal

+ Collaboration diagram for GF_DASH_RepresentationPlayback:
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

◆ GF_DASH_SegmenterContext

struct GF_DASH_SegmenterContext

segment context used by the dasher, GPAC internal

+ Collaboration diagram for GF_DASH_SegmenterContext:
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

◆ GF_DASH_FragmentContext

struct GF_DASH_FragmentContext

fragment context info for LL-HLS

Data Fields
u64 offset

frag offset in bytes

u64 size

frag size in bytes

u32 duration

frag duration in representation timescale

Bool independent

fragment contains an IDR

◆ GF_DASH_SegmentContext

struct GF_DASH_SegmentContext

Segment context - GPAC internal, used to produce HLS manifests and segment lists/timeline

+ Collaboration diagram for GF_DASH_SegmentContext:
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

◆ GF_MPD_Representation

struct GF_MPD_Representation

Representation

+ Collaboration diagram for GF_MPD_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

◆ GF_MPD_AdaptationSet

struct GF_MPD_AdaptationSet

AdaptationSet

+ Collaboration diagram for GF_MPD_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 represenation 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

◆ GF_MPD_Inband_Event

struct GF_MPD_Inband_Event

structure used to signal inband events

Data Fields
char * scheme_id_uri

Scheme ID Uri of the inband event

char * value

Value of the inband event

◆ GF_MPD_Period

struct GF_MPD_Period

Period

+ Collaboration diagram for GF_MPD_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

  • identify already resolved xlinks in MPD updates
  • resolve URLs in remote period if no baseURL is explictly listed
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

◆ GF_MPD_ProgramInfo

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

◆ GF_MPD

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

◆ GF_DASHCueInfo

struct GF_DASHCueInfo

DASHer cues information

Data Fields
u32 sample_num

target splice point sample number (1-based), or 0 if not set

u64 dts

target splice point dts in cues timescale

s64 cts

target splice point cts in cues timescale

Bool is_processed

internal flag indicating if the cues is processed or not

Macro Definition Documentation

◆ MPD_EXTENSIBLE

#define MPD_EXTENSIBLE
Value:
GF_List *x_attributes; \
GF_List *x_children; \
struct _tag_array GF_List
Definition: list.h:50

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

◆ GF_MPD_SEGMENT_BASE

#define GF_MPD_SEGMENT_BASE
Value:
u32 timescale; \
u64 presentation_time_offset; \
u32 time_shift_buffer_depth; /* expressed in milliseconds */ \
GF_MPD_ByteRange *index_range; \
Bool index_range_exact; \
Double availability_time_offset; \
GF_MPD_URL *initialization_segment; \
GF_MPD_URL *representation_index; \
uint32_t u32
Definition: setup.h:326

macro for MPD segment base

◆ GF_MPD_MULTIPLE_SEGMENT_BASE

#define GF_MPD_MULTIPLE_SEGMENT_BASE
Value:
GF_MPD_SEGMENT_BASE \
u64 duration; \
u32 start_number; \
GF_MPD_SegmentTimeline *segment_timeline; \
u32 tsb_first_entry; \
GF_MPD_URL *bitstream_switching_url; \

macro for multiple segment base WARNING: duration is expressed in GF_MPD_SEGMENT_BASE timescale unit startnumber=(u32)-1 if unused, 1 bydefault.

◆ GF_MPD_COMMON_ATTRIBUTES_ELEMENTS

#define GF_MPD_COMMON_ATTRIBUTES_ELEMENTS
Value:
GF_List *x_attributes; \
GF_List *x_children; \
char *profiles; \
u32 width; \
u32 height; \
GF_MPD_Fractional *sar; \
GF_MPD_Fractional *framerate; \
u32 samplerate; \
char *mime_type; \
char *segmentProfiles; \
char *codecs; \
u32 maximum_sap_period; \
u32 starts_with_sap; \
Double max_playout_rate; \
Bool coding_dependency; \
GF_MPD_ScanType scan_type; \
u32 selection_priority; \
char *tag; \
GF_List *frame_packing; \
GF_List *audio_channels; \
GF_List *content_protection; \
GF_List *essential_properties; \
GF_List *supplemental_properties; \
GF_List *producer_reference_time; \
GF_List *isobmf_tracks; \

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

Enumeration Type Documentation

◆ GF_DashTemplateSegmentType

DASH template resolution mode

Enumerator
GF_DASH_TEMPLATE_SEGMENT 

resolve template for segment

GF_DASH_TEMPLATE_INITIALIZATION 

resolve template for initialization segment

GF_DASH_TEMPLATE_TEMPLATE 

resolve template for segment template

GF_DASH_TEMPLATE_TEMPLATE_WITH_PATH 

resolve template for segment template with d padding

GF_DASH_TEMPLATE_INITIALIZATION_TEMPLATE 

resolve template for initialization segment template

GF_DASH_TEMPLATE_REPINDEX 

resolve template for segment index

GF_DASH_TEMPLATE_REPINDEX_TEMPLATE 

resolve template for segment index template

GF_DASH_TEMPLATE_REPINDEX_TEMPLATE_WITH_PATH 

resolve template for segment index template with d padding

GF_DASH_TEMPLATE_INITIALIZATION_SKIPINIT 

same as GF_DASH_TEMPLATE_INITIALIZATION but skip default "init" concatenation

GF_DASH_TEMPLATE_INITIALIZATION_TEMPLATE_SKIPINIT 

same as GF_DASH_TEMPLATE_INITIALIZATION_TEMPLATE but skip default "init" concatenation

GF_DASH_TEMPLATE_SEGMENT_SUBNUMBER 

resolve template for segment but keep $SubNumber$

◆ GF_MPD_ScanType

MPD scan types

Enumerator
GF_MPD_SCANTYPE_UNKNOWN 

unknown

GF_MPD_SCANTYPE_PROGRESSIVE 

progressive

GF_MPD_SCANTYPE_INTERLACED 

interlaced

◆ GF_MPD_ProducerRefType

type of reference clock

◆ GF_MPD_Type

MPD offering type

Enumerator
GF_MPD_TYPE_STATIC 

content is statically available

GF_MPD_TYPE_DYNAMIC 

content is dynamically available

GF_MPD_TYPE_DYNAMIC_LAST 

content is the last if a dynamical offering, converts MPD to static (GPAC internal)

◆ GF_M3U8WriteMode

write mode for M3U8

Enumerator
GF_M3U8_WRITE_ALL 

write both master and child playlists

GF_M3U8_WRITE_MASTER 

write master playlist only

GF_M3U8_WRITE_CHILD 

write child playlist only

◆ GF_MPD_URLResolveType

MPD URL resolutio mode

Enumerator
GF_MPD_RESOLVE_URL_MEDIA_TEMPLATE 

same as GF_MPD_RESOLVE_URL_MEDIA but does not replace $Time$ and $Number$

GF_MPD_RESOLVE_URL_MEDIA_NOSTART 

same as GF_MPD_RESOLVE_URL_MEDIA but does not use startNumber

GF_MPD_RESOLVE_URL_MEDIA_TEMPLATE_NO_BASE 

same as GF_MPD_RESOLVE_URL_MEDIA_TEMPLATE but ignores base URL

◆ MPDSeekMode

MPD seek mode

Enumerator
MPD_SEEK_PREV 

will return the segment containing the requested time

MPD_SEEK_NEAREST 

will return the nearest segment start time, may be the previous or the next one

Function Documentation

◆ gf_media_mpd_format_segment_name()

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

Parameters
seg_typethe desired format mode
is_bs_switchingset to GF_TRUE to indicate the target segment is a bitstream switching segment
segment_nametarget buffer where the segment name is formatted - size must be GF_MAX_PATH
rep_idID of the target representation
base_urlbase URL, may be NULL
seg_rad_namebase name of the output segmeents (eg, myfile_ZZZ), shall not be NULL, may be empty ("")
seg_extsegment extensions
start_timestart time of the segment in MPD timescale
bandwidthbandwidth used for the representation
segment_numbernumber of the target segment
use_segment_timelineindicates if segmentTimeline is used for segment addressing in the MPD
forcedif true, do not append extension or missing $Number$ or $Time$ when resolving template
Returns
error if any

◆ gf_mpd_init_from_dom()

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

Parameters
rootroot of DOM parsing result
mpdMPD structure to fill
base_urlbase URL of the DOM document
Returns
error if any

◆ gf_mpd_complete_from_dom()

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

Parameters
rootroot of DOM parsing result
mpdMPD structure to fill
base_urlbase URL of the DOM document
Returns
error if any

◆ gf_mpd_new()

GF_MPD* gf_mpd_new ( )

MPD constructor

Returns
a new MPD

◆ gf_mpd_del()

void gf_mpd_del ( GF_MPD mpd)

MPD destructor

Parameters
mpdthe target MPD

◆ gf_mpd_segment_url_free()

void gf_mpd_segment_url_free ( void *  ptr)

frees a GF_MPD_SegmentURL structure (type-casted to void *)

Parameters
ptrthe target GF_MPD_SegmentURL

◆ gf_mpd_segment_base_free()

void gf_mpd_segment_base_free ( void *  ptr)

frees a GF_MPD_SegmentBase structure (type-casted to void *)

Parameters
ptrthe target GF_MPD_SegmentBase

◆ gf_mpd_parse_segment_url()

void gf_mpd_parse_segment_url ( GF_List container,
GF_XMLNode root 
)

parses a new GF_MPD_SegmentURL from its DOM description

Parameters
containerthe container list where to insert the segment URL
rootthe DOM description of the segment URL

◆ gf_mpd_parse_date()

u64 gf_mpd_parse_date ( const char *const  attr)

parses a xsDateTime

Parameters
attrthe date time value
Returns
value as UTC timestamp

◆ gf_mpd_url_free()

void gf_mpd_url_free ( void *  _item)

frees a GF_MPD_URL structure (type-casted to void *)

Parameters
_itemthe target GF_MPD_URL

◆ gf_mpd_period_new()

GF_MPD_Period* gf_mpd_period_new ( )

MPD Period constructor

Returns
a new MPD Period

◆ gf_mpd_period_free()

void gf_mpd_period_free ( void *  _item)

MPD Period destructor

Parameters
_itemthe MPD Period to free

◆ gf_mpd_write()

GF_Err gf_mpd_write ( GF_MPD const *const  mpd,
FILE *  out,
Bool  compact 
)

writes an MPD to a file stream

Parameters
mpdthe target MPD to write
outthe target file object
compactif set, removes all new line and indentation in the output
Returns
error if any

◆ gf_mpd_write_file()

GF_Err gf_mpd_write_file ( GF_MPD const *const  mpd,
const char *  file_name 
)

writes an MPD to a local file

Parameters
mpdthe target MPD to write
file_namethe target file name
Returns
error if any

◆ gf_mpd_write_m3u8_master_playlist()

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

Parameters
mpdthe target MPD to write
outthe target file object
m3u8_namethe base m3u8 name to use (needed when generating variant playlist file names)
periodthe MPD period for that m3u8
modethe write operation desired
Returns
error if any

◆ gf_mpd_parse_period()

GF_Err gf_mpd_parse_period ( GF_MPD mpd,
GF_XMLNode root 
)

parses an MPD Period and appends it to the MPD period list

Parameters
mpdthe target MPD to write
rootthe DOM element describing the period
Returns
error if any

◆ gf_mpd_descriptor_new()

GF_MPD_Descriptor* gf_mpd_descriptor_new ( const char *  id,
const char *  uri,
const char *  value 
)

creates a new MPD descriptor

Parameters
idthe descriptor ID, may be NULL
urithe descriptor schemeid URI, mandatory
valuethe descriptor value, may be NULL
Returns
the new descriptor or NULL if error

◆ gf_mpd_adaptation_set_new()

GF_MPD_AdaptationSet* gf_mpd_adaptation_set_new ( )

creates a new MPD AdaptationSet

Returns
the new GF_MPD_AdaptationSet or NULL if error

◆ gf_m3u8_to_mpd()

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)

Parameters
m3u8_filethe path to the local m3u8 master playlist file
base_urlthe original URL of the file if any
mpd_filethe destination MPD file, or NULL when filling an MPD structure
reload_countnumber of times the manifest was reloaded
mimeTypeForM3U8Segmentsdefault mime type for the segments in case not found in the m3u8
do_importif GF_TRUE, will try to load the media segments to extract more info
use_mpd_templatesif GF_TRUE, will use MPD SegmentTemplate instead of SegmentList (only if parse_sub_playlist is GF_TRUE)
use_segment_timelineif GF_TRUE, uses SegmentTimeline to describe the varying duration of segments
getterHTTP interface object
mpdMPD structure to fill, or NULL if converting to file
parse_sub_playlistif 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_filesif GF_TRUE, will not delete any files downloaded in the conversion process
Returns
error if any

◆ gf_m3u8_solve_representation_xlink()

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

Parameters
repthe target representation
base_urlbase URL of master manifest (representation xlink is likely relative to this URL)
getterHTTP interface object
is_staticset to GF_TRUE if the variant subplaylist is on demand
durationset to the duration of the parsed subplaylist
signatureSHA1 digest of last solved version, updated if changed
Returns
error if any, GF_EOS if no changes

◆ gf_mpd_solve_segment_list_xlink()

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

Parameters
mpdthe target MPD to write
rootthe DOM element describing the segment list
Returns
a new segment list, or NULL if error

◆ gf_mpd_init_smooth_from_dom()

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

Parameters
rootthe root node of a smooth manifest
mpdthe MPD to fill
default_base_urlthe default URL of the smooth manifest
Returns
error if any

◆ gf_mpd_delete_segment_list()

void gf_mpd_delete_segment_list ( GF_MPD_SegmentList segment_list)

deletes a segment list

Parameters
segment_listthe segment list to delete

◆ gf_mpd_del_list()

void gf_mpd_del_list ( GF_List list,
void(*)(void *)  __destructor,
Bool  reset_only 
)

deletes a list content and optionally destructs the list

Parameters
listthe target list
__destructorthe destructor function to use to destroy list items
reset_onlyif GF_TRUE, does not destroy the target list

◆ gf_mpd_descriptor_free()

void gf_mpd_descriptor_free ( void *  item)

deletes a GF_MPD_Descriptor object

Parameters
itemthe descriptor to delete

◆ gf_mpd_split_adaptation_sets()

GF_Err gf_mpd_split_adaptation_sets ( GF_MPD mpd)

splits all adaptation sets of a source MPD, creating one adaptation set per quality of each orgingal adaptation sets

Parameters
mpdthe target MPD
Returns
error if any

◆ gf_mpd_smooth_to_mpd()

GF_Err gf_mpd_smooth_to_mpd ( char *  smooth_file,
GF_MPD mpd,
const char *  default_base_url 
)

converts a smooth manifest (local file) to an MPD

Parameters
smooth_filelocal path to the smooth manifest
mpdMPD structure to fill
default_base_urlthe default URL of the smooth manifest
Returns
error if any

◆ gf_mpd_get_base_url_count()

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

Parameters
mpdthe target MPD
periodthe target period
setthe target adaptation set
repthe target representation
Returns
the number of base URLs

◆ gf_mpd_resolve_url()

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

Parameters
mpdthe target MPD
repthe target Representation
setthe target AdaptationSet
periodthe target Period
mpd_urlthe original URL of the MPD
base_url_index0-based index of the baseURL to use
resolve_typethe type of URL resolution desired
item_indexthe index of the target segment (startNumber based)
nb_segments_removednumber of segments removed when purging the MPD after updates (can be 0). The start number will be offset by this value
out_urlset to the resolved URL, to be freed by caller
out_range_startset to the resolved start range, 0 if no range
out_range_endset to the resolved end range, 0 if no range
segment_durationset to the resolved segment duartion, 0 if unknown
is_in_base_urlset to GF_TRUE if the resuloved URL is a sub-part of the baseURL (optional, may be NULL)
out_key_urlset to the key URL for the segment for HLS (optional, may be NULL)
key_ivset to the key IV for the segment for HLS (optional, may be NULL)
out_start_numberset to the start_number used (optional, may be NULL)
subseg_indexindex of subseg, -1 means no SSR is used
Returns
error if any

◆ gf_mpd_get_duration()

Double gf_mpd_get_duration ( GF_MPD mpd)

get duration of the presentation

Parameters
mpdthe target MPD
Returns
the duration in seconds

◆ gf_mpd_resolve_segment_duration()

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

Parameters
repthe target Representation
setthe target AdaptationSet
periodthe target Period
out_durationset to the average media segment duration
out_timescaleset to the MPD timescale used by this representation
out_pts_offsetset to the presentation time offset if any (optional, may be NULL)
out_segment_timelineset to the segment timeline description if any (optional, may be NULL)

◆ gf_mpd_get_segment_start_time_with_timescale()

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

Parameters
in_segment_indexthe index of the target segment (startNumber based)
in_periodthe target Period
in_setthe target AdaptationSet
in_repthe target Representation
out_segment_start_timeset to the MPD start time of the segment
out_opt_segment_durationset to the segment duration (optional, may be NULL)
out_opt_scaleset to the MPD timescale for this segment (optional, may be NULL)
Returns
error if any

◆ gf_mpd_seek_in_period()

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

Parameters
seek_timethe desired time in seconds
seek_modethe desired seek mode
in_periodthe target Period
in_setthe target AdaptationSet
in_repthe target Representation
out_segment_indexthe corresponding segment index
out_opt_seek_timethe corresponding seek time (start time of segment in seconds) (optional, may be NULL)
out_seg_durthe corresponding segment duration in seconds, may be null
Returns
error if any

◆ gf_mpd_base_url_free()

void gf_mpd_base_url_free ( void *  _item)

deletes a GF_MPD_BaseURL structure (type-casted to void *)

Parameters
_itemthe GF_MPD_BaseURL to free

◆ gf_mpd_representation_new()

GF_MPD_Representation* gf_mpd_representation_new ( )

creates a new GF_MPD_Representation

Returns
the new representation

◆ gf_mpd_representation_free()

void gf_mpd_representation_free ( void *  _item)

deletes a GF_MPD_Representation structure (type-casted to void *)

Parameters
_itemthe GF_MPD_Representation to free

◆ gf_mpd_segmentimeline_new()

GF_MPD_SegmentTimeline* gf_mpd_segmentimeline_new ( )

creates a new GF_MPD_SegmentTimeline

Returns
the new segment timeline

◆ gf_mpd_load_cues()

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

Parameters
cues_filethe XML cue file to load
stream_idthe ID of the stream for which we load cues (typically, TrackID or GF_PROP_PID_ID)
cues_timescaleset to the timescale used in the cues document
use_edit_listset to GF_TRUE if the cts values of cues have edit list applied (i.e. are ISOBMFF presentation times)
ts_offsetset to the timestamp offset to subtract from DTS/CTS values
out_cuesset to a newly allocated list of cues, to free by the caller
nb_cuesset to the number of cues parsed
Returns
error if any

◆ gf_mpd_get_descriptor()

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

Parameters
desclistlist of MPD Descriptors
scheme_idscheme ID to look for
Returns
descriptor if found, NUL otherwise

◆ gf_mpd_resolve_subnumber()

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

Parameters
llhas_templatetemplate for the segment, or NULL if none
segment_filenamesegment filename
part_idxindex of part to use
Returns
resolved file name for the given part of the segment