libgpac
Documentation of the core library of GPAC
dash.h File Reference

DASH Client API. The DASH client can be used without GPAC player but requires at least the base utils (threads, lists, NTP timing). The HTTP interface used can be either GPAC's one or any other downloader. More...

#include <gpac/tools.h>
#include <gpac/list.h>
+ Include dependency graph for dash.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  GF_DASHFileIO
 
struct  GF_DASHQualityInfo
 
struct  GF_DASHCustomAlgoInfo
 

Typedefs

typedef void * GF_DASHFileIOSession
 
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)
 

Enumerations

enum  GF_DASHEventType {
  GF_DASH_EVENT_MANIFEST_INIT_ERROR , GF_DASH_EVENT_SELECT_GROUPS , GF_DASH_EVENT_PERIOD_SETUP_ERROR , GF_DASH_EVENT_CREATE_PLAYBACK ,
  GF_DASH_EVENT_DESTROY_PLAYBACK , GF_DASH_EVENT_SEGMENT_AVAILABLE , GF_DASH_EVENT_QUALITY_SWITCH , GF_DASH_EVENT_TIMESHIFT_UPDATE ,
  GF_DASH_EVENT_TIMESHIFT_OVERFLOW , GF_DASH_EVENT_CODEC_STAT_QUERY , GF_DASH_EVENT_ABORT_DOWNLOAD , GF_DASH_EVENT_CACHE_FULL ,
  GF_DASH_EVENT_END_OF_PERIOD
}
 
enum  GF_DASHInitialSelectionMode {
  GF_DASH_SELECT_QUALITY_LOWEST =0 , GF_DASH_SELECT_QUALITY_HIGHEST , GF_DASH_SELECT_BANDWIDTH_LOWEST , GF_DASH_SELECT_BANDWIDTH_HIGHEST ,
  GF_DASH_SELECT_BANDWIDTH_HIGHEST_TILES
}
 
enum  GF_DashDescriptorType {
  GF_MPD_DESC_ACCESSIBILITY , GF_MPD_DESC_AUDIOCONFIG , GF_MPD_DESC_CONTENT_PROTECTION , GF_MPD_DESC_ESSENTIAL_PROPERTIES ,
  GF_MPD_DESC_SUPPLEMENTAL_PROPERTIES , GF_MPD_DESC_FRAME_PACKING , GF_MPD_DESC_ROLE , GF_MPD_DESC_RATING ,
  GF_MPD_DESC_VIEWPOINT
}
 
enum  GF_DASHLowLatencyMode { GF_DASH_LL_DISABLE = 0 , GF_DASH_LL_STRICT , GF_DASH_LL_EARLY_FETCH }
 
enum  GF_DASHCrossASMode { GF_DASH_XAS_NONE = 0 , GF_DASH_XAS_CODEC , GF_DASH_XAS_ALL }
 
enum  GF_DASHTileAdaptationMode {
  GF_DASH_ADAPT_TILE_NONE =0 , GF_DASH_ADAPT_TILE_ROWS , GF_DASH_ADAPT_TILE_ROWS_REVERSE , GF_DASH_ADAPT_TILE_ROWS_MIDDLE ,
  GF_DASH_ADAPT_TILE_COLUMNS , GF_DASH_ADAPT_TILE_COLUMNS_REVERSE , GF_DASH_ADAPT_TILE_COLUMNS_MIDDLE , GF_DASH_ADAPT_TILE_CENTER ,
  GF_DASH_ADAPT_TILE_EDGES
}
 
enum  GF_DASHAdaptationAlgorithm {
  GF_DASH_ALGO_NONE = 0 , GF_DASH_ALGO_GPAC_LEGACY_RATE , GF_DASH_ALGO_GPAC_LEGACY_BUFFER , GF_DASH_ALGO_BBA0 ,
  GF_DASH_ALGO_BOLA_FINITE , GF_DASH_ALGO_BOLA_BASIC , GF_DASH_ALGO_BOLA_U , GF_DASH_ALGO_BOLA_O ,
  GF_DASH_ALGO_CUSTOM
}
 

Functions

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)
 
void gf_dash_del (GF_DashClient *dash)
 
GF_Err gf_dash_open (GF_DashClient *dash, const char *manifest_url)
 
void gf_dash_close (GF_DashClient *dash)
 
GF_Err gf_dash_process (GF_DashClient *dash)
 
const char * gf_dash_get_url (GF_DashClient *dash)
 
Bool gf_dash_is_m3u8 (GF_DashClient *dash)
 
Bool gf_dash_is_smooth_streaming (GF_DashClient *dash)
 
void gf_dash_get_info (GF_DashClient *dash, const char **title, const char **source)
 
void gf_dash_switch_quality (GF_DashClient *dash, Bool switch_up)
 
Bool gf_dash_is_running (GF_DashClient *dash)
 
Bool gf_dash_is_in_setup (GF_DashClient *dash)
 
Double gf_dash_get_duration (GF_DashClient *dash)
 
GF_Err gf_dash_set_timeshift (GF_DashClient *dash, u32 ms_in_timeshift)
 
u32 gf_dash_get_group_count (GF_DashClient *dash)
 
GF_Err gf_dash_set_group_udta (GF_DashClient *dash, u32 group_index, void *udta)
 
void * gf_dash_get_group_udta (GF_DashClient *dash, u32 group_index)
 
Bool gf_dash_is_group_selected (GF_DashClient *dash, u32 group_index)
 
s32 gf_dash_group_has_dependent_group (GF_DashClient *dash, u32 group_idx)
 
u32 gf_dash_group_get_num_groups_depending_on (GF_DashClient *dash, u32 group_idx)
 
s32 gf_dash_get_dependent_group_index (GF_DashClient *dash, u32 group_idx, u32 group_depending_on_dep_idx)
 
Bool gf_dash_is_group_selectable (GF_DashClient *dash, u32 group_idx)
 
void gf_dash_group_select (GF_DashClient *dash, u32 group_idx, Bool select)
 
s32 gf_dash_group_get_id (GF_DashClient *dash, u32 group_idx)
 
const char * gf_dash_get_period_id (GF_DashClient *dash)
 
void gf_dash_enable_group_selection (GF_DashClient *dash, Bool enable)
 
Bool gf_dash_group_init_segment_is_media (GF_DashClient *dash, u32 group_idx)
 
void gf_dash_groups_set_language (GF_DashClient *dash, const char *lang_code_rfc_5646)
 
const char * gf_dash_group_get_segment_init_url (GF_DashClient *dash, u32 group_idx, u64 *start_range, u64 *end_range, const char **mime)
 
const char * gf_dash_group_get_segment_init_keys (GF_DashClient *dash, u32 group_idx, u32 *crypto_type, bin128 *key_IV)
 
const char * gf_dash_group_get_language (GF_DashClient *dash, u32 group_idx)
 
u32 gf_dash_group_get_audio_channels (GF_DashClient *dash, u32 group_idx)
 
u32 gf_dash_group_get_time_shift_buffer_depth (GF_DashClient *dash, u32 group_idx)
 
Double gf_dash_get_timeshift_buffer_pos (GF_DashClient *dash)
 
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)
 
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)
 
GF_Err gf_dash_group_set_max_buffer_playout (GF_DashClient *dash, u32 group_idx, u32 max_target_buffer_ms)
 
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)
 
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)
 
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)
 
Bool gf_dash_group_loop_detected (GF_DashClient *dash, u32 group_idx)
 
Bool gf_dash_is_low_latency (GF_DashClient *dash, u32 group_idx)
 
GF_Err gf_dash_group_get_segment_duration (GF_DashClient *dash, u32 group_idx, u32 *duration, u32 *timescale)
 
const char * gf_dash_group_get_representation_id (GF_DashClient *dash, u32 group_idx)
 
Double gf_dash_group_get_start_range (GF_DashClient *dash, u32 group_idx)
 
void gf_dash_group_discard_segment (GF_DashClient *dash, u32 group_idx)
 
void gf_dash_set_group_done (GF_DashClient *dash, u32 group_idx, Bool done)
 
GF_Err gf_dash_group_get_presentation_time_offset (GF_DashClient *dash, u32 group_idx, u64 *presentation_time_offset, u32 *timescale)
 
Bool gf_dash_in_last_period (GF_DashClient *dash, Bool check_eos)
 
Bool gf_dash_get_group_done (GF_DashClient *dash, u32 group_idx)
 
u32 gf_dash_get_period_switch_status (GF_DashClient *dash)
 
void gf_dash_request_period_switch (GF_DashClient *dash)
 
Bool gf_dash_in_period_setup (GF_DashClient *dash)
 
void gf_dash_seek (GF_DashClient *dash, Double start_range)
 
Bool gf_dash_group_segment_switch_forced (GF_DashClient *dash, u32 group_idx)
 
GF_Err gf_dash_group_get_video_info (GF_DashClient *dash, u32 group_idx, u32 *max_width, u32 *max_height)
 
void gf_dash_group_seek (GF_DashClient *dash, u32 group_idx, Double seek_to)
 
void gf_dash_set_speed (GF_DashClient *dash, Double 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)
 
void gf_dash_enable_utc_drift_compensation (GF_DashClient *dash, Bool estimate_utc_drift)
 
Bool gf_dash_is_dynamic_mpd (GF_DashClient *dash)
 
u32 gf_dash_get_min_buffer_time (GF_DashClient *dash)
 
u32 gf_dash_get_max_segment_duration (GF_DashClient *dash)
 
s32 gf_dash_get_utc_drift_estimate (GF_DashClient *dash)
 
void gf_dash_set_utc_shift (GF_DashClient *dash, s32 shift_utc_ms)
 
GF_Err gf_dash_set_max_resolution (GF_DashClient *dash, u32 width, u32 height, u8 max_display_bpp)
 
GF_Err gf_dash_set_min_timeout_between_404 (GF_DashClient *dash, u32 min_timeout_between_404)
 
GF_Err gf_dash_set_segment_expiration_threshold (GF_DashClient *dash, u32 expire_after_ms)
 
void gf_dash_debug_groups (GF_DashClient *dash, const u32 *groups_idx, u32 nb_groups)
 
void gf_dash_split_adaptation_sets (GF_DashClient *dash)
 
void gf_dash_set_low_latency_mode (GF_DashClient *dash, GF_DASHLowLatencyMode low_lat_mode)
 
void gf_dash_set_user_buffer (GF_DashClient *dash, u32 buffer_time_ms)
 
void gf_dash_set_switching_probe_count (GF_DashClient *dash, u32 switch_probe_count)
 
void gf_dash_set_agressive_adaptation (GF_DashClient *dash, Bool enable_agressive_switch)
 
void gf_dash_enable_single_range_llhls (GF_DashClient *dash, Bool enable_single_range)
 
void gf_dash_set_auto_switch (GF_DashClient *dash, s32 auto_switch_count, Bool auto_switch_loop)
 
void gf_dash_enable_cross_as_switch (GF_DashClient *dash, GF_DASHCrossASMode cross_as_mode)
 
u64 gf_dash_get_period_start (GF_DashClient *dash)
 
u64 gf_dash_get_period_duration (GF_DashClient *dash)
 
u32 gf_dash_group_get_num_qualities (GF_DashClient *dash, u32 group_idx)
 
u32 gf_dash_group_get_num_components (GF_DashClient *dash, u32 group_idx)
 
void gf_dash_disable_speed_adaptation (GF_DashClient *dash, Bool disable)
 
GF_Err gf_dash_group_get_quality_info (GF_DashClient *dash, u32 group_idx, u32 quality_idx, GF_DASHQualityInfo *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)
 
Bool gf_dash_get_automatic_switching (GF_DashClient *dash)
 
GF_Err gf_dash_set_automatic_switching (GF_DashClient *dash, Bool enable_switching)
 
GF_Err gf_dash_group_select_quality (GF_DashClient *dash, u32 group_idx, const char *ID, u32 q_idx)
 
s32 gf_dash_group_get_active_quality (GF_DashClient *dash, u32 group_idx)
 
void gf_dash_override_ntp (GF_DashClient *dash, u64 server_ntp)
 
void gf_dash_set_tile_adaptation_mode (GF_DashClient *dash, GF_DASHTileAdaptationMode mode, u32 tile_rate_decrease)
 
void gf_dash_disable_low_quality_tiles (GF_DashClient *dash, Bool disable_tiles)
 
GF_DASHTileAdaptationMode gf_dash_get_tile_adaptation_mode (GF_DashClient *dash)
 
Bool gf_dash_group_get_srd_max_size_info (GF_DashClient *dash, u32 group_idx, u32 *max_width, u32 *max_height)
 
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)
 
GF_Err gf_dash_group_set_quality_degradation_hint (GF_DashClient *dash, u32 group_idx, u32 quality_degradation_hint)
 
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)
 
void gf_dash_ignore_xlink (GF_DashClient *dash, Bool ignore_xlink)
 
Bool gf_dash_all_groups_done (GF_DashClient *dash)
 
void gf_dash_set_period_xlink_query_string (GF_DashClient *dash, const char *query_string)
 
void gf_dash_set_chaining_mode (GF_DashClient *dash, u32 chaining_mode)
 
void gf_dash_set_algo (GF_DashClient *dash, GF_DASHAdaptationAlgorithm algo)
 
void gf_dash_set_group_download_state (GF_DashClient *dash, u32 group_idx, u32 dep_rep_idx, GF_Err err)
 
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)
 
void gf_dash_set_suggested_presentation_delay (GF_DashClient *dash, s32 spd)
 
void gf_dash_set_mcast_ast_shift (GF_DashClient *dash, s32 ast_shift)
 
u32 gf_dash_get_min_wait_ms (GF_DashClient *dash)
 
s32 gf_dash_group_get_as_id (GF_DashClient *dash, u32 group_idx)
 
Bool gf_dash_group_has_init_segment (GF_DashClient *dash, u32 group_idx)
 
void gf_dash_group_get_sar (GF_DashClient *dash, u32 group_idx, GF_Fraction *sar)
 
void gf_dash_set_algo_custom (GF_DashClient *dash, void *udta, gf_dash_rate_adaptation algo_custom, gf_dash_download_monitor download_monitor_custom)
 

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}
 

Detailed Description

>