libgpac
Documentation of the core library of GPAC
dmx_dash.c File Reference
#include <gpac/filters.h>
#include <gpac/constants.h>
#include <gpac/dash.h>
#include <gpac/network.h>
+ Include dependency graph for dmx_dash.c:

Data Structures

struct  GF_DASHDmxCtx
 
struct  GF_DASHGroup
 
struct  GF_DASHDownloadStats
 

Macros

#define DASHIN_MIMES   "application/dash+xml|video/vnd.3gpp.mpd|audio/vnd.3gpp.mpd|video/vnd.mpeg.dash.mpd|audio/vnd.mpeg.dash.mpd|audio/mpegurl|video/mpegurl|application/vnd.ms-sstr+xml|application/x-mpegURL|application/vnd.apple.mpegURL"
 
#define DASHIN_FILE_EXT   "mpd|m3u8|3gm|ism"
 
#define OFFS(_n)   #_n, offsetof(GF_DASHDmxCtx, _n)
 

Enumerations

enum  { DFWD_OFF = 0 , DFWD_FILE , DFWD_SBOUND , DFWD_SBOUND_MANIFEST }
 
enum  { BMIN_NO = 0 , BMIN_AUTO , BMIN_MPD }
 
enum  { FLAG_PERIOD_SWITCH = 1 , FLAG_TIME_OVERFLOW = 1<<1 , FLAG_FIRST_IN_SEG = 1<<2 }
 
enum  { BURL_STRIP , BURL_KEEP , BURL_INJECT }
 

Functions

static void dashdmx_notify_group_quality (GF_DASHDmxCtx *ctx, GF_DASHGroup *group)
 
static void dashdmx_set_string_list_prop (GF_FilterPacket *ref, u32 prop_name, GF_List **str_list)
 
static void dashdmx_forward_packet (GF_DASHDmxCtx *ctx, GF_FilterPacket *in_pck, GF_FilterPid *in_pid, GF_FilterPid *out_pid, GF_DASHGroup *group)
 
static Bool dashdmx_on_filter_setup_error (GF_Filter *failed_filter, void *udta, GF_Err err)
 
void gf_cryptfin_set_kms (GF_Filter *f, const char *key_url, bin128 key_IV)
 
static GF_Err dashdmx_load_source (GF_DASHDmxCtx *ctx, u32 group_index, const char *mime, const char *init_segment_name, u64 start_range, u64 end_range)
 
void dashdmx_io_delete_cache_file (GF_DASHFileIO *dashio, GF_DASHFileIOSession session, const char *cache_url)
 
GF_DASHFileIOSession dashdmx_io_create (GF_DASHFileIO *dashio, Bool persistent, const char *url, s32 group_idx)
 
void dashdmx_io_del (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
GF_Err dashdmx_io_init (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
GF_Err dashdmx_io_run (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
const char * dashdmx_io_get_url (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
const char * dashdmx_io_get_cache_name (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
const char * dashdmx_io_get_mime (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
const char * dashdmx_io_get_header_value (GF_DASHFileIO *dashio, GF_DASHFileIOSession session, const char *header_name)
 
u64 dashdmx_io_get_utc_start_time (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
GF_Err dashdmx_io_setup_from_url (GF_DASHFileIO *dashio, GF_DASHFileIOSession session, const char *url, s32 group_idx)
 
GF_Err dashdmx_io_set_range (GF_DASHFileIO *dashio, GF_DASHFileIOSession session, u64 start_range, u64 end_range, Bool discontinue_cache)
 
u32 dashdmx_io_get_bytes_per_sec (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
GF_Err dashdmx_io_get_status (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
static void dashdmx_declare_group (GF_DASHDmxCtx *ctx, u32 group_idx)
 
void process_base_url (char *manifest_payload, u32 manifest_payload_len, u32 keep_base_url, const char *relative_url)
 
void dashdmx_io_manifest_updated (GF_DASHFileIO *dashio, const char *manifest_name, const char *cache_url, s32 group_idx)
 
static GF_Err dashin_abort (GF_DASHDmxCtx *ctx)
 
GF_Err dashdmx_io_on_dash_event (GF_DASHFileIO *dashio, GF_DASHEventType dash_evt, s32 group_idx, GF_Err error_code)
 
static void dashdmx_setup_buffer (GF_DASHDmxCtx *ctx, GF_DASHGroup *group)
 
static u32 dashdmx_dash_playback_mode (GF_DASHDmxCtx *ctx)
 
static s32 dashdmx_group_idx_from_pid (GF_DASHDmxCtx *ctx, GF_FilterPid *src_pid)
 
static GF_FilterPid * dashdmx_opid_from_group (GF_DASHDmxCtx *ctx, GF_DASHGroup *group)
 
static GF_FilterPid * dashdmx_create_output_pid (GF_DASHDmxCtx *ctx, GF_FilterPid *input, u32 *run_status, GF_DASHGroup *for_group)
 
Bool dashdmx_merge_prop (void *cbk, u32 prop_4cc, const char *prop_name, const GF_PropertyValue *src_prop)
 
static void dashdm_format_qinfo (char **q_desc, GF_DASHQualityInfo *qinfo)
 
const char * gf_dash_group_get_clearkey_uri (GF_DashClient *dash, u32 group_idx, bin128 *def_kid)
 
static void dashdmx_declare_properties (GF_DASHDmxCtx *ctx, GF_DASHGroup *group, u32 group_idx, GF_FilterPid *opid, GF_FilterPid *ipid, Bool is_period_switch)
 
static GF_Err dashdmx_configure_pid (GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
 
static GF_Err dashdmx_initialize (GF_Filter *filter)
 
static void dashdmx_finalize (GF_Filter *filter)
 
static Bool dashdmx_process_event (GF_Filter *filter, const GF_FilterEvent *fevt)
 
GF_Err gf_dash_group_push_tfrf (GF_DashClient *dash, u32 idx, void *tfrf, u32 timescale)
 
static void dashdmx_update_group_stats (GF_DASHDmxCtx *ctx, GF_DASHGroup *group)
 
static void dashdmx_switch_segment (GF_DASHDmxCtx *ctx, GF_DASHGroup *group)
 
GF_Err dashdmx_process (GF_Filter *filter)
 
static const char * dashdmx_probe_data (const u8 *data, u32 size, GF_FilterProbeScore *score)
 
const GF_FilterRegister * dashin_register (GF_FilterSession *session)
 
static s32 dashdmx_rate_adaptation_ext (void *udta, u32 group_idx, u32 base_group_idx, Bool force_lower_complexity, GF_DASHCustomAlgoInfo *stats)
 
static s32 dashdmx_download_monitor_ext (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)
 
GF_EXPORT GF_Err gf_filter_bind_dash_algo_callbacks (GF_Filter *filter, void *udta, void(*period_reset)(void *udta, u32 type), void(*new_group)(void *udta, u32 group_idx, void *dash), s32(*rate_adaptation)(void *udta, u32 group_idx, u32 base_group_idx, Bool force_low_complex, void *stats), s32(*download_monitor)(void *udta, u32 group_idx, void *stats))
 

Variables

static const GF_FilterCapability DASHDmxFileModeCaps []
 
static const GF_FilterArgs DASHDmxArgs []
 
static const GF_FilterCapability DASHDmxCaps []
 
GF_FilterRegister DASHDmxRegister
 

Data Structure Documentation

◆ GF_DASHGroup

struct GF_DASHGroup
+ Collaboration diagram for GF_DASHGroup:
Data Fields
GF_DASHDmxCtx * ctx
GF_Filter * seg_filter_src
u32 idx
Bool init_switch_seg_sent
Bool segment_sent
Bool in_is_cryptfile
u32 nb_eos
u32 nb_pids
Bool stats_uploaded
Bool wait_for_pck
Bool eos_detected
u32 next_dependent_rep_idx
u32 current_dependent_rep_idx
u64 utc_map
Bool is_timestamp_based
Bool pto_setup
Bool prev_is_init_segment
Bool init_from_media
u32 timescale
s64 pto
u64 max_cts_in_period
u64 timedisc_ts_offset
bin128 key_IV
Bool seg_was_not_ready
Bool in_error
Bool is_playing
Bool force_seg_switch
u32 nb_group_deps
u32 current_group_dep
u32 last_bw_check
u64 us_at_seg_start
Bool signal_seg_name
Bool init_ok
Bool notify_quality_change
u32 seg_discard_state
u32 nb_pending
char * template
const char * hls_key_uri
bin128 hls_key_IV
char * current_url
Bool url_changed
u64 queue_ntp_ts

◆ GF_DASHDownloadStats

struct GF_DASHDownloadStats
Data Fields
u32 bits_per_sec
u64 total_bytes
u64 bytes_done
u64 us_since_start
u32 buffer_dur
u32 current_seg_dur

Macro Definition Documentation

◆ DASHIN_MIMES

#define DASHIN_MIMES   "application/dash+xml|video/vnd.3gpp.mpd|audio/vnd.3gpp.mpd|video/vnd.mpeg.dash.mpd|audio/vnd.mpeg.dash.mpd|audio/mpegurl|video/mpegurl|application/vnd.ms-sstr+xml|application/x-mpegURL|application/vnd.apple.mpegURL"

◆ DASHIN_FILE_EXT

#define DASHIN_FILE_EXT   "mpd|m3u8|3gm|ism"

◆ OFFS

#define OFFS (   _n)    #_n, offsetof(GF_DASHDmxCtx, _n)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DFWD_OFF 
DFWD_FILE 
DFWD_SBOUND 
DFWD_SBOUND_MANIFEST 

◆ anonymous enum

anonymous enum
Enumerator
BMIN_NO 
BMIN_AUTO 
BMIN_MPD 

◆ anonymous enum

anonymous enum
Enumerator
FLAG_PERIOD_SWITCH 
FLAG_TIME_OVERFLOW 
FLAG_FIRST_IN_SEG 

◆ anonymous enum

anonymous enum
Enumerator
BURL_STRIP 
BURL_KEEP 
BURL_INJECT 

Function Documentation

◆ dashdmx_notify_group_quality()

static void dashdmx_notify_group_quality ( GF_DASHDmxCtx ctx,
GF_DASHGroup group 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_set_string_list_prop()

static void dashdmx_set_string_list_prop ( GF_FilterPacket *  ref,
u32  prop_name,
GF_List **  str_list 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_forward_packet()

static void dashdmx_forward_packet ( GF_DASHDmxCtx ctx,
GF_FilterPacket *  in_pck,
GF_FilterPid *  in_pid,
GF_FilterPid *  out_pid,
GF_DASHGroup group 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_on_filter_setup_error()

static Bool dashdmx_on_filter_setup_error ( GF_Filter *  failed_filter,
void *  udta,
GF_Err  err 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_cryptfin_set_kms()

void gf_cryptfin_set_kms ( GF_Filter *  f,
const char *  key_url,
bin128  key_IV 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_load_source()

static GF_Err dashdmx_load_source ( GF_DASHDmxCtx ctx,
u32  group_index,
const char *  mime,
const char *  init_segment_name,
u64  start_range,
u64  end_range 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_delete_cache_file()

void dashdmx_io_delete_cache_file ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session,
const char *  cache_url 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_create()

GF_DASHFileIOSession dashdmx_io_create ( GF_DASHFileIO *  dashio,
Bool  persistent,
const char *  url,
s32  group_idx 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_del()

void dashdmx_io_del ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_init()

GF_Err dashdmx_io_init ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_run()

GF_Err dashdmx_io_run ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_get_url()

const char* dashdmx_io_get_url ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_get_cache_name()

const char* dashdmx_io_get_cache_name ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_get_mime()

const char* dashdmx_io_get_mime ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_get_header_value()

const char* dashdmx_io_get_header_value ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session,
const char *  header_name 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_get_utc_start_time()

u64 dashdmx_io_get_utc_start_time ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_setup_from_url()

GF_Err dashdmx_io_setup_from_url ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session,
const char *  url,
s32  group_idx 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_set_range()

GF_Err dashdmx_io_set_range ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session,
u64  start_range,
u64  end_range,
Bool  discontinue_cache 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_get_bytes_per_sec()

u32 dashdmx_io_get_bytes_per_sec ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_get_status()

GF_Err dashdmx_io_get_status ( GF_DASHFileIO *  dashio,
GF_DASHFileIOSession  session 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_declare_group()

static void dashdmx_declare_group ( GF_DASHDmxCtx ctx,
u32  group_idx 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ process_base_url()

void process_base_url ( char *  manifest_payload,
u32  manifest_payload_len,
u32  keep_base_url,
const char *  relative_url 
)
+ Here is the caller graph for this function:

◆ dashdmx_io_manifest_updated()

void dashdmx_io_manifest_updated ( GF_DASHFileIO *  dashio,
const char *  manifest_name,
const char *  cache_url,
s32  group_idx 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashin_abort()

static GF_Err dashin_abort ( GF_DASHDmxCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_io_on_dash_event()

GF_Err dashdmx_io_on_dash_event ( GF_DASHFileIO *  dashio,
GF_DASHEventType  dash_evt,
s32  group_idx,
GF_Err  error_code 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_setup_buffer()

static void dashdmx_setup_buffer ( GF_DASHDmxCtx ctx,
GF_DASHGroup group 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_dash_playback_mode()

static u32 dashdmx_dash_playback_mode ( GF_DASHDmxCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_group_idx_from_pid()

static s32 dashdmx_group_idx_from_pid ( GF_DASHDmxCtx ctx,
GF_FilterPid *  src_pid 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_opid_from_group()

static GF_FilterPid* dashdmx_opid_from_group ( GF_DASHDmxCtx ctx,
GF_DASHGroup group 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_create_output_pid()

static GF_FilterPid* dashdmx_create_output_pid ( GF_DASHDmxCtx ctx,
GF_FilterPid *  input,
u32 run_status,
GF_DASHGroup for_group 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_merge_prop()

Bool dashdmx_merge_prop ( void *  cbk,
u32  prop_4cc,
const char *  prop_name,
const GF_PropertyValue *  src_prop 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdm_format_qinfo()

static void dashdm_format_qinfo ( char **  q_desc,
GF_DASHQualityInfo qinfo 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_dash_group_get_clearkey_uri()

const char* gf_dash_group_get_clearkey_uri ( GF_DashClient *  dash,
u32  group_idx,
bin128 def_kid 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_declare_properties()

static void dashdmx_declare_properties ( GF_DASHDmxCtx ctx,
GF_DASHGroup group,
u32  group_idx,
GF_FilterPid *  opid,
GF_FilterPid *  ipid,
Bool  is_period_switch 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_configure_pid()

static GF_Err dashdmx_configure_pid ( GF_Filter *  filter,
GF_FilterPid *  pid,
Bool  is_remove 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_initialize()

static GF_Err dashdmx_initialize ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ dashdmx_finalize()

static void dashdmx_finalize ( GF_Filter *  filter)
static
+ Here is the call graph for this function:

◆ dashdmx_process_event()

static Bool dashdmx_process_event ( GF_Filter *  filter,
const GF_FilterEvent *  fevt 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_dash_group_push_tfrf()

GF_Err gf_dash_group_push_tfrf ( GF_DashClient *  dash,
u32  idx,
void *  tfrf,
u32  timescale 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_update_group_stats()

static void dashdmx_update_group_stats ( GF_DASHDmxCtx ctx,
GF_DASHGroup group 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_switch_segment()

static void dashdmx_switch_segment ( GF_DASHDmxCtx ctx,
GF_DASHGroup group 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dashdmx_process()

GF_Err dashdmx_process ( GF_Filter *  filter)
+ Here is the call graph for this function:

◆ dashdmx_probe_data()

static const char* dashdmx_probe_data ( const u8 data,
u32  size,
GF_FilterProbeScore score 
)
static

◆ dashin_register()

const GF_FilterRegister* dashin_register ( GF_FilterSession *  session)

◆ dashdmx_rate_adaptation_ext()

static s32 dashdmx_rate_adaptation_ext ( void *  udta,
u32  group_idx,
u32  base_group_idx,
Bool  force_lower_complexity,
GF_DASHCustomAlgoInfo stats 
)
static
+ Here is the caller graph for this function:

◆ dashdmx_download_monitor_ext()

static s32 dashdmx_download_monitor_ext ( 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 
)
static
+ Here is the caller graph for this function:

◆ gf_filter_bind_dash_algo_callbacks()

GF_EXPORT GF_Err gf_filter_bind_dash_algo_callbacks ( GF_Filter *  filter,
void *  udta,
void(*)(void *udta, u32 type)  period_reset,
void(*)(void *udta, u32 group_idx, void *dash)  new_group,
s32(*)(void *udta, u32 group_idx, u32 base_group_idx, Bool force_low_complex, void *stats)  rate_adaptation,
s32(*)(void *udta, u32 group_idx, void *stats)  download_monitor 
)
+ Here is the call graph for this function:

Variable Documentation

◆ DASHDmxFileModeCaps

const GF_FilterCapability DASHDmxFileModeCaps[]
static
Initial value:
=
{
CAP_STRING(GF_CAPS_INPUT, GF_PROP_PID_MIME, "application/dash+xml|video/vnd.3gpp.mpd|audio/vnd.3gpp.mpd|video/vnd.mpeg.dash.mpd|audio/vnd.mpeg.dash.mpd|audio/mpegurl|video/mpegurl|application/vnd.ms-sstr+xml|application/x-mpegURL|application/vnd.apple.mpegURL"),
{0},
}
@ GF_CODECID_RAW
Definition: constants.h:600
@ GF_STREAM_AUDIO
Definition: constants.h:66
@ GF_STREAM_FILE
Definition: constants.h:104
@ GF_STREAM_VISUAL
Definition: constants.h:64
#define GF_CAPS_OUTPUT
Definition: filters.h:2232
#define CAP_UINT(_f, _a, _b)
Definition: filters.h:2172
#define CAP_STRING(_f, _a, _b)
Definition: filters.h:2194
#define GF_CAPS_OUTPUT_EXCLUDED
Definition: filters.h:2236
#define GF_CAPS_INPUT
Definition: filters.h:2220
@ GF_CAPFLAG_IN_BUNDLE
Definition: filters.h:2202
@ GF_CAPFLAG_OUTPUT
Definition: filters.h:2206
@ GF_CAPFLAG_LOADED_FILTER
Definition: filters.h:2210
@ GF_CAPFLAG_INPUT
Definition: filters.h:2204
@ GF_PROP_PID_CODECID
Definition: filters.h:1116
@ GF_PROP_PID_STREAM_TYPE
Definition: filters.h:1112
@ GF_PROP_PID_FILE_EXT
Definition: filters.h:1190
@ GF_PROP_PID_MIME
Definition: filters.h:1189
@ GF_PROP_UINT
Definition: filters.h:852

◆ DASHDmxArgs

const GF_FilterArgs DASHDmxArgs[]
static

◆ DASHDmxCaps

◆ DASHDmxRegister

GF_FilterRegister DASHDmxRegister