Documentation of the core library of GPAC
JSDASHClient Interface Reference

JSDASHClient API. More...


Public Member Functions

attribute void new_group (JSDASHGroup group)
attribute void period_reset (unsigned long reset_type)
attribute int rate_adaptation (unsigned long group_idx, unsigned long base_group_idx, Boolean force_lower_complexity, JSDASHStats stats)
attribute int download_monitor (unsigned long group_idx, JSDASHDownloadStats stats)

Detailed Description

The JSDASHClient interface has a single instance exposed to the script under the name "dashin". It implements callbacks from the DASH client. The object can also be bound to a running filter using JSFSFilter.bind

Member Function Documentation

◆ new_group()

attribute void JSDASHClient::new_group ( JSDASHGroup  group)

indicate a new group is being created

this function is optional
groupgroup being created, can be kept for future use

◆ period_reset()

attribute void JSDASHClient::period_reset ( unsigned long  reset_type)

indicate the period has changed

this function is optional
reset_typeindicates the type of reset:
  • 0: end of period, groups are no longer valid
  • 1: start of a static period
  • 2: start of a dynamic (live) period

◆ rate_adaptation()

attribute int JSDASHClient::rate_adaptation ( unsigned long  group_idx,
unsigned long  base_group_idx,
Boolean  force_lower_complexity,
JSDASHStats  stats 

perform rate adaptation on the given group (AdaptationSet in DASH, corresponds to one adaptable media)

group_idxindex of group on which to perform adaptation
base_group_idxindex of associated base group (usually same as group, differs in tiling mode),
force_lower_complexityset to true if the dash client would like a lower complexity
statscurrent statistics for the group JSDASHStats
value can be:
  • the index of the new quality to select (as listed in group.reps[])
  • -1 to not take decision now
  • -2 to disable the group (debug, will drop segment)
  • other negative values are handled as error

◆ download_monitor()

attribute int JSDASHClient::download_monitor ( unsigned long  group_idx,
JSDASHDownloadStats  stats 

monitor download of the current segment in a group

this function is optional
group_idxindex of group on which to perform adaptation
statscurrent download statistics for the group JSDASHDownloadStats
integer value indicating the action to take. Return value can be:
  • -1 to continue download
  • -2 to abort download but without retrying to download the same segment at lower quality
  • the index of the new quality to download for the same segment index (same time)