libgpac
Documentation of the core library of GPAC
GF_DASHFileIO Struct Reference

#include <dash.h>

Data Fields

void * udta
 
GF_Err(* on_dash_event )(GF_DASHFileIO *dashio, GF_DASHEventType evt, s32 group_idx, GF_Err setup_error)
 
Bool(* dash_codec_supported )(GF_DASHFileIO *dashio, const char *codec, u32 width, u32 height, Bool is_interlaced, u32 fps_num, u32 fps_denum, u32 sample_rate)
 
void(* delete_cache_file )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session, const char *cache_url)
 
GF_DASHFileIOSession(* create )(GF_DASHFileIO *dashio, Bool persistent, const char *url, s32 group_idx)
 
void(* del )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
void(* abort )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
GF_Err(* setup_from_url )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session, const char *url, s32 group_idx)
 
GF_Err(* set_range )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session, u64 start_range, u64 end_range, Bool discontinue_cache)
 
GF_Err(* init )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
GF_Err(* run )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
const char *(* get_url )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
const char *(* get_cache_name )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
const char *(* get_mime )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
const char *(* get_header_value )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session, const char *header_name)
 
u64(* get_utc_start_time )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
u32(* get_bytes_per_sec )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
u32(* get_total_size )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
u32(* get_bytes_done )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
GF_Err(* get_status )(GF_DASHFileIO *dashio, GF_DASHFileIOSession session)
 
void(* manifest_updated )(GF_DASHFileIO *dashio, const char *manifest_name, const char *local_path, s32 group_idx)
 

Detailed Description

DASH network I/O abstraction object

Field Documentation

◆ udta

void* GF_DASHFileIO::udta

user private data

◆ on_dash_event

GF_Err(* GF_DASHFileIO::on_dash_event) (GF_DASHFileIO *dashio, GF_DASHEventType evt, s32 group_idx, GF_Err setup_error)

signals errors or specific actions to perform

◆ dash_codec_supported

Bool(* GF_DASHFileIO::dash_codec_supported) (GF_DASHFileIO *dashio, const char *codec, u32 width, u32 height, Bool is_interlaced, u32 fps_num, u32 fps_denum, u32 sample_rate)

used to check whether a representation is supported or not. Function returns 1 if supported, 0 otherwise if this callback is not set, the representation is assumed to be supported

◆ delete_cache_file

void(* GF_DASHFileIO::delete_cache_file) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session, const char *cache_url)

called whenever a file has to be deleted

◆ create

GF_DASHFileIOSession(* GF_DASHFileIO::create) (GF_DASHFileIO *dashio, Bool persistent, const char *url, s32 group_idx)

create a file download session for the given resource - group_idx may be -1 if this is a global resource , otherwise it indicates the group/adaptationSet in which the download happens

◆ del

void(* GF_DASHFileIO::del) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)

delete a file download session

◆ abort

void(* GF_DASHFileIO::abort) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)

aborts downloading in the given file session

◆ setup_from_url

GF_Err(* GF_DASHFileIO::setup_from_url) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session, const char *url, s32 group_idx)

resetup the file session with a new resource to get - this allows persistent connection usage with HTTP servers

◆ set_range

GF_Err(* GF_DASHFileIO::set_range) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session, u64 start_range, u64 end_range, Bool discontinue_cache)

set download range for the file session

◆ init

GF_Err(* GF_DASHFileIO::init) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)

initialize the file session - all the headers shall be fetched before returning

◆ run

GF_Err(* GF_DASHFileIO::run) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)

download the content - synchronous call: all the file shall be fetched before returning

◆ get_url

const char*(* GF_DASHFileIO::get_url) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)

get URL of the file - it may be different from the original one if resource relocation happened

◆ get_cache_name

const char*(* GF_DASHFileIO::get_cache_name) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)

get the name of the cache file. If NULL is returned, the file cannot be cached and its associated URL will be used when the client request file to play

◆ get_mime

const char*(* GF_DASHFileIO::get_mime) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)

get the MIME type of the file

◆ get_header_value

const char*(* GF_DASHFileIO::get_header_value) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session, const char *header_name)

get the given hedaer value in the last HTTP response. Function is optional

◆ get_utc_start_time

u64(* GF_DASHFileIO::get_utc_start_time) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)

gets the UTC time at which reply has been received. Function is optional

◆ get_bytes_per_sec

u32(* GF_DASHFileIO::get_bytes_per_sec) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)

get the average download rate for the session. If no session is specified, gets the max download rate for the client (used for bandwidth simulation in local files)

◆ get_total_size

u32(* GF_DASHFileIO::get_total_size) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)

get the total size on bytes for the session

◆ get_bytes_done

u32(* GF_DASHFileIO::get_bytes_done) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)

get the total size on bytes for the session

◆ get_status

GF_Err(* GF_DASHFileIO::get_status) (GF_DASHFileIO *dashio, GF_DASHFileIOSession session)

get the status of the session - GF_OK for done, GF_NOT_READY for in progress, other error code indicate download error

◆ manifest_updated

void(* GF_DASHFileIO::manifest_updated) (GF_DASHFileIO *dashio, const char *manifest_name, const char *local_path, s32 group_idx)

callback when manifest (DASH, HLS) or sub-playlist (HLS) is updated