libgpac
Documentation of the core library of GPAC
|
MPEG-DASH and HLS Client. More...
Data Structures | |
struct | GF_DASHFileIO |
struct | GF_DASHQualityInfo |
struct | GF_DASHCustomAlgoInfo |
Typedefs | |
typedef void * | GF_DASHFileIOSession |
typedef struct __dash_client | GF_DashClient |
typedef s32(* | gf_dash_rate_adaptation) (void *udta, u32 group_idx, u32 base_group_idx, Bool force_lower_complexity, GF_DASHCustomAlgoInfo *stats) |
typedef s32(* | gf_dash_download_monitor) (void *udta, u32 group_idx, u32 bits_per_sec, u64 total_bytes, u64 bytes_done, u64 us_since_start, u32 buffer_dur_ms, u32 current_seg_dur) |
Variables | |
static const char *const | GF_DASH_MPD_MIME_TYPES [] = { "application/dash+xml", "video/vnd.3gpp.mpd", "audio/vnd.3gpp.mpd", "video/vnd.mpeg.dash.mpd", "audio/vnd.mpeg.dash.mpd", NULL } |
static const char *const | GF_DASH_M3U8_MIME_TYPES [] = { "video/x-mpegurl", "audio/x-mpegurl", "application/x-mpegURL", "application/vnd.apple.mpegURL", NULL} |
static const char *const | GF_DASH_SMOOTH_MIME_TYPES [] = { "application/vnd.ms-sstr+xml", NULL} |
struct GF_DASHQualityInfo |
DASH/HLS quality information structure
Data Fields | ||
---|---|---|
u32 | bandwidth |
bandwidth in bits per second |
const char * | ID |
ID |
const char * | mime |
mime type |
const char * | codec |
codec parameter of mime type |
u32 | width |
video width |
u32 | height |
video width |
Bool | interlaced |
video interlaced flag |
u32 | fps_num |
video framerate numerator |
u32 | fps_den |
video framerate denominator |
u32 | par_num |
video sample aspect ratio numerator |
u32 | par_den |
video sample aspect ratio denominator |
u32 | sample_rate |
audio sample rate |
u32 | nb_channels |
audio channel count |
Bool | disabled |
disabled flag (not supported by DASH client) |
Bool | is_selected |
selected flag |
Double | ast_offset |
AST offset in seconds, 0 if not low latency |
Double | average_duration |
average segment duration, 0 if unknown |
const GF_List * | seg_urls |
list of segmentURLs if known, NULL otherwise. Used for onDemand profile to get segment sizes |
const char * | hls_variant_url |
URL (relative) of variant playlist |
u32 | ssr |
SSR flag, set to estimated num parts in SSR |
struct GF_DASHCustomAlgoInfo |
Information passed to DASH custom algorithm
Data Fields | ||
---|---|---|
u32 | download_rate |
last segment download rate in bits per second |
u32 | file_size |
size of last downloaded segment |
Double | speed |
current playback speed |
Double | max_available_speed |
max supported playback speed according to associated decoder stats |
u32 | display_width |
display width of the video in pixels, 0 if audio stream |
u32 | display_height |
display height of the video in pixels, 0 if audio stream |
u32 | active_quality_idx |
index of currently selected quality |
u32 | buffer_min_ms |
minimum buffer level in milliseconds below witch rebuffer will happen |
u32 | buffer_max_ms |
maximum buffer level allowed in milliseconds. Packets won't get dropped if overflow, but the algorithm should try not to overflow this buffer |
u32 | buffer_occupancy_ms |
current buffer level in milliseconds |
u32 | quality_degradation_hint |
degradation hint, 0 means no degradation, 100 means tile completely hidden |
u32 | total_rate |
cumulated download rate of all active groups in bytes per seconds - 0 means all files are local |
typedef void* GF_DASHFileIOSession |
structure used for all IO sessions for DASH
typedef struct __dash_client GF_DashClient |
DASH client object
typedef s32(* gf_dash_rate_adaptation) (void *udta, u32 group_idx, u32 base_group_idx, Bool force_lower_complexity, GF_DASHCustomAlgoInfo *stats) |
Callback function for custom rate adaptation
udta | user data |
group_idx | index of group to adapt |
base_group_idx | index of associated base group if group is a dependent group |
force_lower_complexity | set to true if the dash client would like a lower complexity |
stats | statistics for last downloaded segment |
-1
to not take decision now and postpone it until dependent groups are done-2
to disable qualitytypedef s32(* gf_dash_download_monitor) (void *udta, u32 group_idx, u32 bits_per_sec, u64 total_bytes, u64 bytes_done, u64 us_since_start, u32 buffer_dur_ms, u32 current_seg_dur) |
Callback function for custom rate monitor, not final yet
udta | user data |
group_idx | index of group to adapt |
bits_per_sec | estimated download rate (not premultiplied by playback speed) |
total_bytes | size of segment being downloaded, 0 if unknown |
bytes_done | bytes received for segment |
us_since_start | microseconds ellapse since segment was sheduled for download |
buffer_dur_ms | current buffer duration in milliseconds |
current_seg_dur | duration of segment being downloaded, 0 if unknown |
enum GF_DASHEventType |
DASH Event type. The DASH client communicates with the user through a callback mechanism using events
Quality selection mode of initial segments
DASH descriptor types
enum GF_DASHCrossASMode |
Tile adaptation mode This mode specifies how bitrate is allocated across tiles of the same video
DASH client adaptation algorithm
GF_DashClient* gf_dash_new | ( | GF_DASHFileIO * | dash_io, |
u32 | max_cache_duration, | ||
s32 | auto_switch_count, | ||
Bool | keep_files, | ||
Bool | disable_switching, | ||
GF_DASHInitialSelectionMode | first_select_mode, | ||
u32 | initial_time_shift_value | ||
) |
create a new DASH client
dash_io | DASH callbacks to the user |
max_cache_duration | maximum duration in milliseconds for the cached media. If less than mpd@minBufferTime
mpd@minBufferTime
|
auto_switch_count | forces representation switching (quality up if positive, down if negative) every auto_switch_count segments, set to 0 to disable |
keep_files | do not delete files from the cache |
disable_switching | turn off bandwidth switching algorithm |
first_select_mode | indicates which representation to select upon startup |
initial_time_shift_value | sets initial buffering: if between 0 and 100, this is a percentage of the time shift window of the session. If greater than 100, this is a time shift in milliseconds. |
void gf_dash_del | ( | GF_DashClient * | dash | ) |
destroys a DASH client
dash | the target dash clien |
GF_Err gf_dash_open | ( | GF_DashClient * | dash, |
const char * | manifest_url | ||
) |
opens the DASH client for the specific manifest file
dash | the target dash client |
manifest_url | the URL of the manifest to open |
void gf_dash_close | ( | GF_DashClient * | dash | ) |
closes the dash client
dash | the target dash client |
GF_Err gf_dash_process | ( | GF_DashClient * | dash | ) |
for unthreaded session, executes DASH logic
dash | the target dash client |
const char* gf_dash_get_url | ( | GF_DashClient * | dash | ) |
returns URL of the DASH manifest file
dash | the target dash client |
Bool gf_dash_is_m3u8 | ( | GF_DashClient * | dash | ) |
tells whether we are playing some Apple HLS M3U8
dash | the target dash client |
Bool gf_dash_is_smooth_streaming | ( | GF_DashClient * | dash | ) |
tells whether we are playing some MS SmoothStreaming
dash | the target dash client |
void gf_dash_get_info | ( | GF_DashClient * | dash, |
const char ** | title, | ||
const char ** | source | ||
) |
gets title and source for this MPD
dash | the target dash client |
title | set to the title of the manifest (may be NULL) |
source | set to the source of the manifest (may be NULL) |
void gf_dash_switch_quality | ( | GF_DashClient * | dash, |
Bool | switch_up | ||
) |
switches quality up or down
dash | the target dash client |
switch_up | indicates if the quality should be increased (GF_TRUE) or decreased (GF_FALSE) |
Bool gf_dash_is_running | ( | GF_DashClient * | dash | ) |
indicates whether the DASH client is running or not
dash | the target dash client |
Bool gf_dash_is_in_setup | ( | GF_DashClient * | dash | ) |
indicates whether the DASH client is in setup stage (sloving periods, destroying or creating playback chain) or not
dash | the target dash client |
Double gf_dash_get_duration | ( | GF_DashClient * | dash | ) |
gets duration of the presentation
dash | the target dash client |
GF_Err gf_dash_set_timeshift | ( | GF_DashClient * | dash, |
u32 | ms_in_timeshift | ||
) |
sets timeshift for the presentation - this function does not trigger a seek, this has to be done by the caller
dash | the target dash client |
ms_in_timeshift | if between 0 and 100, this is a percentage of the time shift window of the session. If greater than 100, this is a time shift in milliseconds |
u32 gf_dash_get_group_count | ( | GF_DashClient * | dash | ) |
returns the number of groups. A group is a set of media resources that are alternate of each other in terms of bandwidth/quality
dash | the target dash client |
GF_Err gf_dash_set_group_udta | ( | GF_DashClient * | dash, |
u32 | group_index, | ||
void * | udta | ||
) |
associates user data (or NULL) with a given group
dash | the target dash client |
group_index | the 0-based index of the target group |
udta | the opaque data to associate to the group |
void* gf_dash_get_group_udta | ( | GF_DashClient * | dash, |
u32 | group_index | ||
) |
returns the user data associated with this group
dash | the target dash client |
group_index | the 0-based index of the target group |
Bool gf_dash_is_group_selected | ( | GF_DashClient * | dash, |
u32 | group_index | ||
) |
indicates whether a group is selected for playback or not. Currently groups cannot be selected during playback
dash | the target dash client |
group_index | the 0-based index of the target group |
s32 gf_dash_group_has_dependent_group | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
indicates whether this group is dependent on another group (because representations are). If this is the case, all representations of this group will be made available through the base group (and has_next_segment flag) if the group is selected. returns -1 if not dependent on another group, otherwise return dependent group index
dash | the target dash client |
group_idx | the 0-based index of the target group |
u32 gf_dash_group_get_num_groups_depending_on | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
gives the number of groups depending on this one for decoding
dash | the target dash client |
group_idx | the 0-based index of the target group |
s32 gf_dash_get_dependent_group_index | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 | group_depending_on_dep_idx | ||
) |
gets the index of the depending_on group with the specified group_depending_on_dep_idx (between 0 and gf_dash_group_get_num_groups_depending_on -1)
dash | the target dash client |
group_idx | the 0-based index of the target group |
group_depending_on_dep_idx | the 0-based index of the queried dependent group |
Bool gf_dash_is_group_selectable | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
indicates whether a group can be selected for playback or not. Some groups may have been disabled because of non supported features
dash | the target dash client |
group_idx | the 0-based index of the target group |
void gf_dash_group_select | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
Bool | select | ||
) |
selects a group for playback. If group selection is enabled, other groups are alternate to this group (through the group attribute), they are automatically deselected
Seeking is NOT performed, it is the responsability to call gf_dash_group_seek - this can be called before or after selecting
dash | the target dash client |
group_idx | the 0-based index of the target group |
select | if GF_TRUE, will select this group and disable any alternate group. If GF_FALSE, only deselects the group |
s32 gf_dash_group_get_id | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
gets group ID (through the group attribute), -1 if undefined
dash | the target dash client |
group_idx | the 0-based index of the target group |
const char* gf_dash_get_period_id | ( | GF_DashClient * | dash | ) |
gets cuirrent period ID
dash | the target dash client |
void gf_dash_enable_group_selection | ( | GF_DashClient * | dash, |
Bool | enable | ||
) |
enables group selection through the group attribute
dash | the target dash client |
enable | if GF_TRUE, group selection will be done whenever selecting a new group |
Bool gf_dash_group_init_segment_is_media | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
checks if first segment (used to initialize) was an init segment or the first in a sequence (aka M2TS)
dash | the target dash client |
group_idx | the 0-based index of the target group |
void gf_dash_groups_set_language | ( | GF_DashClient * | dash, |
const char * | lang_code_rfc_5646 | ||
) |
performs selection of representations based on language code
dash | the target dash client |
lang_code_rfc_5646 | the language code used by the default group selection |
const char* gf_dash_group_get_segment_init_url | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u64 * | start_range, | ||
u64 * | end_range, | ||
const char ** | mime | ||
) |
returns the URL of the first media resource to play (init segment or first media segment depending on format). start_range and end_range are optional
dash | the target dash client |
group_idx | the 0-based index of the target group |
start_range | set to the byte start offset in the init segment |
end_range | set to the byte end offset in the init segment |
mime | the mime type of the init segment |
const char* gf_dash_group_get_segment_init_keys | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 * | crypto_type, | ||
bin128 * | key_IV | ||
) |
returns the URL and IV associated with the first media segment if any (init segment or first media segment depending on format). This is used for full segment encryption modes of MPEG-2 TS segments. key_IV is optional
dash | the target dash client |
group_idx | the 0-based index of the target group |
crypto_type | set to 0 if no encryption in segments, 1 if full segment encryption, 2 if CENC/per-sample encryption is used - may be NULL |
key_IV | set to the IV used for the first media segment (can be NULL) |
const char* gf_dash_group_get_language | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
returns the language of the group
dash | the target dash client |
group_idx | the 0-based index of the target group |
u32 gf_dash_group_get_audio_channels | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
returns the number of audio channelsof the group
dash | the target dash client |
group_idx | the 0-based index of the target group |
u32 gf_dash_group_get_time_shift_buffer_depth | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
gets time shift buffer depth of the group
dash | the target dash client |
group_idx | the 0-based index of the target group |
Double gf_dash_get_timeshift_buffer_pos | ( | GF_DashClient * | dash | ) |
gets current time in time shift buffer This functions retrieves the maximum value (further in the past) of all selected/active groups
dash | the target dash client |
void gf_dash_group_set_codec_stat | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 | avg_dec_time, | ||
u32 | max_dec_time, | ||
u32 | irap_avg_dec_time, | ||
u32 | irap_max_dec_time, | ||
Bool | codec_reset, | ||
Bool | decode_only_rap | ||
) |
sets codec statistics of a group for playback rate adjustment
dash | the target dash client |
group_idx | the 0-based index of the target group |
avg_dec_time | average decode time in microseconds of a frame, 0 if unknown |
max_dec_time | maximum decode time in microseconds of a frame, 0 if unknown |
irap_avg_dec_time | average decode time of SAP 1/2/3 pictures in microseconds of a frame, 0 if unknown |
irap_max_dec_time | maximum decode time of SAP 1/2/3 pictures in microseconds of a frame, 0 if unknown |
codec_reset | indicates a codec reset is pending (pipeline flush is needed before reinit) |
decode_only_rap | indicates only SAP1/2/3 are currently being decoded. This may trigger a switch to a trick mode representation |
void gf_dash_group_set_buffer_levels | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 | buffer_min_ms, | ||
u32 | buffer_max_ms, | ||
u32 | buffer_occupancy_ms | ||
) |
sets buffer levels of a group
dash | the target dash client |
group_idx | the 0-based index of the target group |
buffer_min_ms | minimum buffer in milliseconds (pipeline would rebuffer below this level) |
buffer_max_ms | maximum buffer in milliseconds (pipeline would block above this level) |
buffer_occupancy_ms | current buffer occupancy in milliseconds |
GF_Err gf_dash_group_set_max_buffer_playout | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 | max_target_buffer_ms | ||
) |
indicates the buffer time in ms after which the player resumes playback. This value is less or equal to the buffer_max_ms indicated in gf_dash_group_set_buffer_levels
dash | the target dash client |
group_idx | the 0-based index of the target group |
max_target_buffer_ms | buffer in milliseconds above which pipeline resumes after a rebuffering event |
Bool gf_dash_group_enum_descriptor | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
GF_DashDescriptorType | desc_type, | ||
u32 | role_idx, | ||
const char ** | desc_id, | ||
const char ** | desc_scheme, | ||
const char ** | desc_value | ||
) |
enumerates descriptors of the given type
dash | the target dash client |
group_idx | the 0-based index of the target group |
desc_type | type of descriptor being checked |
role_idx | index of the descriptor being checked for this type |
desc_id | set to the ID of the descriptor if found (optional, may be NULL) |
desc_scheme | set to the scheme of the descriptor if found (optional, may be NULL) |
desc_value | set to the desc_value of the descriptor if found (optional, may be NULL) |
GF_Err gf_dash_group_get_next_segment_location | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 | dependent_representation_index, | ||
const char ** | url, | ||
u64 * | start_range, | ||
u64 * | end_range, | ||
s32 * | switching_index, | ||
const char ** | switching_url, | ||
u64 * | switching_start_range, | ||
u64 * | switching_end_range, | ||
const char ** | original_url, | ||
Bool * | has_next_segment, | ||
const char ** | key_url, | ||
bin128 * | key_IV, | ||
u64 * | utc | ||
) |
returns the URL and byte range of the next media resource to play in this group.
dash | the target dash client |
group_idx | the 0-based index of the target group |
dependent_representation_index | index of the dependent representation to query, 0-based |
url | set to the URL of the next segment |
start_range | set to the start byte offset in the segment (optional, may be NULL) |
end_range | set to the end byte offset in the segment (optional, may be NULL) |
switching_index | set to the quality index of the segment (optional, may be NULL) |
switching_url | set to the URL of the switching segment if needed (optional, may be NULL) |
switching_start_range | set to start byte offset of the switching segment if needed (optional, may be NULL) |
switching_end_range | set to end byte offset of the switching segment if needed (optional, may be NULL) |
original_url | set to original URL value of the segment (optional, may be NULL) |
has_next_segment | set to GF_TRUE if next segment location is known (unthreaded mode) or next segment is downloaded (threaded mode) (optional, may be NULL) |
key_url | set to the key URL of the next segment for MPEG-2 TS full segment encryption (optional, may be NULL). The URL is either a URN or a resolved URL |
key_IV | set to the key initialization vector of the next segment for MPEG-2 TS full segment encryption (optional, may be NULL) |
utc | set to UTC mapping for first sample of segment, 0 if none defined |
GF_Err gf_dash_group_next_seg_info | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 | dependent_representation_index, | ||
const char ** | seg_name, | ||
u32 * | seg_number, | ||
GF_Fraction64 * | seg_time, | ||
u32 * | seg_dur_ms, | ||
const char ** | init_segment | ||
) |
gets some info on the segment
dash | the target dash client |
group_idx | the 0-based index of the target group |
dependent_representation_index | index of the dependent representation to query, 0-based |
seg_name | set to the segment name, without base url - optional, may be NULL |
seg_number | set to the segment number for $Number$ addressing - optional, may be NULL |
seg_time | set to the segment start time - optional, may be NULL |
seg_dur_ms | set to the segment estimated duration in ms - optional, may be NULL |
init_segment | set to the init segment name, without base url - optional, may be NULL |
Bool gf_dash_group_loop_detected | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
checks if loop was detected in playback. This is mostly used for broadcast (eMBMS, ROUTE) based on pcap replay.
dash | the target dash client |
group_idx | the 0-based index of the target group |
Bool gf_dash_is_low_latency | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
checks if group is using low latency delivery.
dash | the target dash client |
group_idx | the 0-based index of the target group |
GF_Err gf_dash_group_get_segment_duration | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 * | duration, | ||
u32 * | timescale | ||
) |
gets average duration of segments for the current rep.
dash | the target dash client |
group_idx | the 0-based index of the target group |
duration | set to average segment duration |
timescale | set to timescale used to exprss duration |
const char* gf_dash_group_get_representation_id | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
gets ID of active representaion.
dash | the target dash client |
group_idx | the 0-based index of the target group |
Double gf_dash_group_get_start_range | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
returns number of seconds at which playback shall start for the group in the current period. The first segment available for the period will be so that gf_dash_group_get_start_range is in this range after the caller adjusts it with PTO (eg the returned time is in period timeline, not media timeline)
dash | the target dash client |
group_idx | the 0-based index of the target group |
void gf_dash_group_discard_segment | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
discards the first media resource in the queue of this group
dash | the target dash client |
group_idx | the 0-based index of the target group |
void gf_dash_set_group_done | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
Bool | done | ||
) |
indicates to the DASH engine that the group playback has been stopped by the user
dash | the target dash client |
group_idx | the 0-based index of the target group |
done | mark group as done if GF_TRUE, or not done if GF_FALSE |
GF_Err gf_dash_group_get_presentation_time_offset | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u64 * | presentation_time_offset, | ||
u32 * | timescale | ||
) |
gets presentationTimeOffset and timescale for the active representation
dash | the target dash client |
group_idx | the 0-based index of the target group |
presentation_time_offset | set to the presentation time offset for the group |
timescale | set to the timescale used to represent the presentation time offset |
Bool gf_dash_in_last_period | ( | GF_DashClient * | dash, |
Bool | check_eos | ||
) |
checks if the session is in the last period
dash | the target dash client |
check_eos | if GF_TRUE, return GF_TRUE only if the last period is known to be the last one (not an open period in live) |
Bool gf_dash_get_group_done | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
checks if the group is playing
dash | the target dash client |
group_idx | the 0-based index of the target group |
u32 gf_dash_get_period_switch_status | ( | GF_DashClient * | dash | ) |
gets current period switching status for the session.
dash | the target dash client |
void gf_dash_request_period_switch | ( | GF_DashClient * | dash | ) |
request period switch - this is typically called when the media engine signals that no more data is available for playback
dash | the target dash client |
Bool gf_dash_in_period_setup | ( | GF_DashClient * | dash | ) |
checks if the client is in a period setup state
dash | the target dash client |
void gf_dash_seek | ( | GF_DashClient * | dash, |
Double | start_range | ||
) |
seeks playback to the given time. If period changes, all playback is stopped and restarted If the session is dynamic (live), the start_range is ignored and recomputed from current UTC clock to be at the live point. If timeshifting is desired, use gf_dash_set_timeshift before seeking
dash | the target dash client |
start_range | the desired seek time in seconds |
Bool gf_dash_group_segment_switch_forced | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
checks if seeking time is in the previously playing segment
dash | the target dash client |
group_idx | the 0-based index of the target group |
GF_Err gf_dash_group_get_video_info | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 * | max_width, | ||
u32 * | max_height | ||
) |
gets video info for this group if video
dash | the target dash client |
group_idx | the 0-based index of the target group |
max_width | set to the maximum width in the group |
max_height | set to the maximum height in the group |
void gf_dash_group_seek | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
Double | seek_to | ||
) |
seeks only a given group - results are undefined if the seek operation triggers a period switch
dash | the target dash client |
group_idx | the 0-based index of the target group |
seek_to | the desired seek time in seconds |
void gf_dash_set_speed | ( | GF_DashClient * | dash, |
Double | speed | ||
) |
sets playback speed of the session. Speed is used in adaptation logic
dash | the target dash client |
speed | current playback speed |
GF_Err gf_dash_group_check_bandwidth | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 | bits_per_sec, | ||
u64 | total_bytes, | ||
u64 | bytes_done, | ||
u64 | us_since_start | ||
) |
updates media bandwidth for the given group. Only allowed for groups without dependencies to other groups
dash | the target dash client |
group_idx | the 0-based index of the target group |
bits_per_sec | current download rate in bits per seconds |
total_bytes | total size of segment being downloaded |
bytes_done | number of bytes already downloaded in current segment |
us_since_start | time elapsed in microseconds since segment has been scheduled for download |
void gf_dash_enable_utc_drift_compensation | ( | GF_DashClient * | dash, |
Bool | estimate_utc_drift | ||
) |
enables UTC drift computation using HTTP header "Server-UTC: UTC", where UTC is in ms
dash | the target dash client |
estimate_utc_drift | if GF_TRUE, enables UTC drift compensation, otherwise disables it |
Bool gf_dash_is_dynamic_mpd | ( | GF_DashClient * | dash | ) |
checks if session is dynamic offering (live)
dash | the target dash client |
u32 gf_dash_get_min_buffer_time | ( | GF_DashClient * | dash | ) |
gets minimum buffer time of session indicated in MPD
dash | the target dash client |
u32 gf_dash_get_max_segment_duration | ( | GF_DashClient * | dash | ) |
gets the maximum segment duration in session
dash | the target dash client |
s32 gf_dash_get_utc_drift_estimate | ( | GF_DashClient * | dash | ) |
gets the difference between the local UTC clock and the one reported by the server
dash | the target dash client |
void gf_dash_set_utc_shift | ( | GF_DashClient * | dash, |
s32 | shift_utc_ms | ||
) |
shifts UTC clock of server by shift_utc_ms so that new UTC in MPD is old + shift_utc_ms
dash | the target dash client |
shift_utc_ms | UTC clock shift in milliseconds. A positive value will move the clock in the future, a negative value in the past |
GF_Err gf_dash_set_max_resolution | ( | GF_DashClient * | dash, |
u32 | width, | ||
u32 | height, | ||
u8 | max_display_bpp | ||
) |
sets max video display capabilities
dash | the target dash client |
width | the maximum width of the display |
height | the maximum height of the display |
max_display_bpp | the maximum bits per pixel of the display |
GF_Err gf_dash_set_min_timeout_between_404 | ( | GF_DashClient * | dash, |
u32 | min_timeout_between_404 | ||
) |
sets min time in ms between a 404 and the next request on the same group. The default value is 500 ms.
dash | the target dash client |
min_timeout_between_404 | minimum delay in milliseconds between retries |
GF_Err gf_dash_set_segment_expiration_threshold | ( | GF_DashClient * | dash, |
u32 | expire_after_ms | ||
) |
sets time in ms after which 404 request for a segment will indicate segment lost. The client always retries for segment availability time + segment duration. This allows extending slightly the probe time (used when segment durations varies, or for VBR broadcast). The default value is 100 ms.
dash | the target dash client |
expire_after_ms | delay in milliseconds |
void gf_dash_debug_groups | ( | GF_DashClient * | dash, |
const u32 * | groups_idx, | ||
u32 | nb_groups | ||
) |
only enables the given groups - this shall be set before calling gf_dash_open. If NULL, no groups will be disabled
dash | the target dash client |
groups_idx | list of 0-based index of the target groups to enable, |
nb_groups | number of group indexes in list |
void gf_dash_split_adaptation_sets | ( | GF_DashClient * | dash | ) |
split all adatation sets so that they contain only one representation (quality)
dash | the target dash client |
void gf_dash_set_low_latency_mode | ( | GF_DashClient * | dash, |
GF_DASHLowLatencyMode | low_lat_mode | ||
) |
allow early segment fetch in low latency mode
dash | the target dash client |
low_lat_mode | low latency mode |
void gf_dash_set_user_buffer | ( | GF_DashClient * | dash, |
u32 | buffer_time_ms | ||
) |
indicates typical buffering used by the user app before playback starts. This allows fetching data earlier in live mode, if the timeshiftbuffer allows for it
dash | the target dash client |
buffer_time_ms | typical playout buffer in milliseconds |
void gf_dash_set_switching_probe_count | ( | GF_DashClient * | dash, |
u32 | switch_probe_count | ||
) |
indicates the number of segments to wait before switching up bandwidth. The default value is 1 (ie stay in current bandwidth or one more segment before switching up, event if download rate is enough). Setting this to 0 means the switch will happen instantly, but this is more prone to quality changes due to network variations
dash | the target dash client |
switch_probe_count | the number of probes before switching |
void gf_dash_set_agressive_adaptation | ( | GF_DashClient * | dash, |
Bool | enable_agressive_switch | ||
) |
enables agressive switching mode. If agressive switching is enabled, switching targets to the closest bandwidth fitting the available download rate. Otherwise, switching targets the lowest bitrate representation that is above the currently played (eg does not try to switch to max bandwidth). Default value is no.
dash | the target dash client |
enable_agressive_switch | if GF_TRUE, enables agressive mode, otherwise disables it |
void gf_dash_enable_single_range_llhls | ( | GF_DashClient * | dash, |
Bool | enable_single_range | ||
) |
enables single-range requests for LL-HLS byterange, rather than issuing a request per PART. This assumes that:
Errors will be thrown if these are not met on future parts and merging will be disabled, however the scheduled buggy segment will NOT be disarded
dash | the target dash client |
enable_single_range | if GF_TRUE, enables single range, otherwise disables it |
void gf_dash_set_auto_switch | ( | GF_DashClient * | dash, |
s32 | auto_switch_count, | ||
Bool | auto_switch_loop | ||
) |
enable auto-switch mode
dash | the target dash cleint |
auto_switch_count | forces representation switching (quality up if positive, down if negative) every auto_switch_count segments, set to 0 to disable |
auto_switch_loop | if false (default when creating dasher), restart at lowest quality when higher quality is reached and vice-versa. If true, quality switches decreases then increase in loop |
void gf_dash_enable_cross_as_switch | ( | GF_DashClient * | dash, |
GF_DASHCrossASMode | cross_as_mode | ||
) |
enable switching across adaptation sets
When switching across adaptation sets is enabled and such sets are declared in the manifest, a single group will be declared for all sets in the switching set, and switching will be handled by the client.
dash | the target dash cleint |
cross_as_mode | enable or disable |
u64 gf_dash_get_period_start | ( | GF_DashClient * | dash | ) |
returns active period start
dash | the target dash client |
u64 gf_dash_get_period_duration | ( | GF_DashClient * | dash | ) |
gets active period duration
dash | the target dash client |
u32 gf_dash_group_get_num_qualities | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
gets number of quality available for a group
dash | the target dash client |
group_idx | the 0-based index of the target group |
u32 gf_dash_group_get_num_components | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
gets the number of components in a group
dash | the target dash client |
group_idx | the 0-based index of the target group |
void gf_dash_disable_speed_adaptation | ( | GF_DashClient * | dash, |
Bool | disable | ||
) |
disable speed adaptation
dash | the target dash client |
disable | if GF_TRUE? speed adaptation is disabled, otherwise it is enabled |
GF_Err gf_dash_group_get_quality_info | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 | quality_idx, | ||
GF_DASHQualityInfo * | quality | ||
) |
gets information on a given quality
dash | the target dash client |
group_idx | the 0-based index of the target group |
quality_idx | the 0-based index of the quality |
quality | filled with information for the desired quality |
char* gf_dash_group_get_template | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 * | segment_timeline_timescale, | ||
const char ** | init_url, | ||
const char ** | hls_variant | ||
) |
gets segment template info used by group
dash | the target dash client |
group_idx | the 0-based index of the target group |
segment_timeline_timescale | set to segment timeline timescale, or to 0 if no segment timeline |
init_url | set to initialization URL (template, timeline or base URL for VoD) as indicated in manifest (no resolution to base URL) |
hls_variant | set toHLS variant name or NULL |
Bool gf_dash_get_automatic_switching | ( | GF_DashClient * | dash | ) |
checks automatic switching mode
dash | the target dash client |
GF_Err gf_dash_set_automatic_switching | ( | GF_DashClient * | dash, |
Bool | enable_switching | ||
) |
sets automatic quality switching mode. If automatic switching is off, switching can only happen based on caller inputs
dash | the target dash client |
enable_switching | if GF_TRUE, automatic switching is enabled; otherwise it is disabled |
GF_Err gf_dash_group_select_quality | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
const char * | ID, | ||
u32 | q_idx | ||
) |
selects quality of a group, either by ID or by index if ID is null
dash | the target dash client |
group_idx | the 0-based index of the target group |
ID | the ID of the desired quality |
q_idx | the 0-based index of the desired quality |
s32 gf_dash_group_get_active_quality | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
gets currently active quality of a group
dash | the target dash client |
group_idx | the 0-based index of the target group |
void gf_dash_override_ntp | ( | GF_DashClient * | dash, |
u64 | server_ntp | ||
) |
forces NTP of the DASH client to be the given NTP
dash | the target dash client |
server_ntp | NTP timestamp to set as server clock |
void gf_dash_set_tile_adaptation_mode | ( | GF_DashClient * | dash, |
GF_DASHTileAdaptationMode | mode, | ||
u32 | tile_rate_decrease | ||
) |
sets tile adaptation mode
dash | the target dash client |
mode | the desired tile adaptation mode |
tile_rate_decrease | percentage (0->100) of global bandwidth to use at each level (recursive rate decrease for all level). If 0% or 100%, automatic rate allocation among tiles is performed (default mode) |
void gf_dash_disable_low_quality_tiles | ( | GF_DashClient * | dash, |
Bool | disable_tiles | ||
) |
consider tile with highest quality degradation hints (not visible ones or not gazed at) as lost, triggering a GF_URL_REMOVE upon gf_dash_group_get_next_segment_location calls. Mostly used to debug tiling adaptation
dash | the target dash client |
disable_tiles | if GF_TRUE, tiles with highest quality degradation hints will not be played. |
GF_DASHTileAdaptationMode gf_dash_get_tile_adaptation_mode | ( | GF_DashClient * | dash | ) |
gets current tile adaptation mode
dash | the target dash client |
Bool gf_dash_group_get_srd_max_size_info | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 * | max_width, | ||
u32 * | max_height | ||
) |
gets max width and height in pixels of the SRD (Spatial Relationship Descriptor) a given group belongs to, if any
dash | the target dash client |
group_idx | the 0-based index of the target group |
max_width | set to the maximum width of the SRD of this group |
max_height | set to the maximum height of the SRD of this group |
Bool gf_dash_group_get_srd_info | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 * | srd_id, | ||
u32 * | srd_x, | ||
u32 * | srd_y, | ||
u32 * | srd_w, | ||
u32 * | srd_h, | ||
u32 * | srd_width, | ||
u32 * | srd_height | ||
) |
gets SRD info, in SRD coordinate, of the SRD this group belongs to, if any
dash | the target dash client |
group_idx | the 0-based index of the target group |
srd_id | set to the id of the SRD of this group |
srd_x | set to the horizontal coordinate of the SRD of this group |
srd_y | set to the vertical coordinate of the SRD of this group |
srd_w | set to the width of the SRD of this group |
srd_h | set to the height of the SRD of this group |
srd_width | set to the reference width (usually max width) of the SRD of this group |
srd_height | set to the reference height (usually max height) of the SRD of this group |
GF_Err gf_dash_group_set_quality_degradation_hint | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 | quality_degradation_hint | ||
) |
sets quality hint for the given group
dash | the target dash client |
group_idx | the 0-based index of the target group |
quality_degradation_hint | quality degradation from 0 (no degradation) to 100 (worse quality possible) |
GF_Err gf_dash_group_set_visible_rect | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 | min_x, | ||
u32 | max_x, | ||
u32 | min_y, | ||
u32 | max_y, | ||
Bool | is_gaze | ||
) |
sets visible rectangle of a video object, may be used for adaptation. If min_x==max_x==min_y=max_y==0, disable adaptation
dash | the target dash client |
group_idx | the 0-based index of the target group |
min_x | horizontal coordinate of first visible column |
max_x | horizontal coordinate of last visible column |
min_y | horizontal coordinate of first visible row |
max_y | horizontal coordinate of last visible row |
is_gaze | if set, {min_x, min_y} indicate the position of the gaze (and {max_x, max_y} are ignored) |
void gf_dash_ignore_xlink | ( | GF_DashClient * | dash, |
Bool | ignore_xlink | ||
) |
Ignores xlink on periods if some adaptation sets are specified in the period with xlink
dash | the target dash client |
ignore_xlink | if GF_TRUE? xlinks will be ignored on periods containing both xlinks and adaptation sets |
Bool gf_dash_all_groups_done | ( | GF_DashClient * | dash | ) |
checks if all groups are done
dash | the target dash client |
void gf_dash_set_period_xlink_query_string | ( | GF_DashClient * | dash, |
const char * | query_string | ||
) |
sets a query string to append to xlink on periods
dash | the target dash client |
query_string | the query string to append to xlinks on periods |
void gf_dash_set_chaining_mode | ( | GF_DashClient * | dash, |
u32 | chaining_mode | ||
) |
sets MPD chaining mode
dash | the target dash client |
chaining_mode | if 0, no chaining. If 1, chain at end. If 2 chain on error or at end |
void gf_dash_set_algo | ( | GF_DashClient * | dash, |
GF_DASHAdaptationAlgorithm | algo | ||
) |
sets dash adaptation algorithm. Cannot be called on an active session
dash | the target dash client |
algo | the algorithm to use |
void gf_dash_set_group_download_state | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 | dep_rep_idx, | ||
GF_Err | err | ||
) |
sets group download status of the last downloaded segment for non threaded modes
dash | the target dash client |
group_idx | the 0-based index of the target group |
dep_rep_idx | the 0-based index of the current dependent rep |
err | error status of the download, GF_OK if no error |
void gf_dash_group_store_stats | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
u32 | dep_rep_idx, | ||
u32 | bytes_per_sec, | ||
u64 | file_size, | ||
Bool | is_broadcast, | ||
u64 | us_since_start | ||
) |
sets group download statistics of the last downloaded segment for non threaded modes
dash | the target dash client |
group_idx | the 0-based index of the target group |
dep_rep_idx | the 0-based index of the dependent rep |
bytes_per_sec | transfer rates in bytes per seconds |
file_size | segment size in bytes |
is_broadcast | set to GF_TRUE if the file is received over a multicast/broadcast link such as eMBMS or ROUTE (i.e. file was pushed to cache) |
us_since_start | time in microseconds since start of the download |
void gf_dash_set_suggested_presentation_delay | ( | GF_DashClient * | dash, |
s32 | spd | ||
) |
Shifts the computed availabilityStartTime by offsetting (or resetting) the SuggestedPresentationDelay value parsed in the DASH manifest
dash | the target dash client |
spd | availabilityStartTime shift in milliseconds. Positive values shift the clock in the future, negative ones in the past, "-I" will force the SuggestedPresentationDelay value to zero |
void gf_dash_set_mcast_ast_shift | ( | GF_DashClient * | dash, |
s32 | ast_shift | ||
) |
sets availabilityStartTime shift for multicast (ROUTE, FLUTE). By default the multicast tune-in is done by matching the last received segment name to the segment template and deriving the UTC reference from that. The function allows shifting the computed value by a given amount.
dash | the target dash client |
ast_shift | clock shift in milliseconds of the multicast receiver tune-in. Positive values shift the clock in the future, negative ones in the past |
u32 gf_dash_get_min_wait_ms | ( | GF_DashClient * | dash | ) |
gets the minimum wait time before calling gf_dash_process again for unthreaded mode
dash | the target dash client |
s32 gf_dash_group_get_as_id | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
gets the adaptation set ID of a given group
dash | the target dash client |
group_idx | the 0-based index of the target group |
Bool gf_dash_group_has_init_segment | ( | GF_DashClient * | dash, |
u32 | group_idx | ||
) |
check if the group has an init segment associated
dash | the target dash client |
group_idx | the 0-based index of the target group |
void gf_dash_group_get_sar | ( | GF_DashClient * | dash, |
u32 | group_idx, | ||
GF_Fraction * | sar | ||
) |
get sample aspect ratio for video group
dash | the target dash client |
group_idx | the 0-based index of the target group |
sar | filled with representation SAR if any, set to 0 otherwise - may be NULL |
void gf_dash_set_algo_custom | ( | GF_DashClient * | dash, |
void * | udta, | ||
gf_dash_rate_adaptation | algo_custom, | ||
gf_dash_download_monitor | download_monitor_custom | ||
) |
sets custom rate adaptation logic
dash | the target dash client |
udta | user data to pass back to callback functions |
algo_custom | rate adaptation custom logic |
download_monitor_custom | download monitor custom logic |
|
static |
All the possible Mime-types for MPD files
|
static |
All the possible Mime-types for M3U8 files
|
static |
All the possible Mime-types for Smooth files