Wasabi ExpressPlay SDK for Embedded Systems  1.23.0
Data Structures | Macros | Typedefs | Enumerations | Functions
WSB_MediaSource Class

(DASH) Media data access. More...

Data Structures

struct  WSB_MediaSourceStatistics
 Media Source statistics. More...
 
struct  WSB_MediaSourceInfoExtension
 Info extensions. More...
 
struct  WSB_MediaSourceMediaInfo
 Media information, used to convey, amongst other things, the codec information for downloaded media buffers. More...
 
struct  WSB_MediaPresentationInfo
 Media Presentation Info. More...
 
struct  WSB_MediaPeriodInfo
 Media Period Info. More...
 
struct  WSB_MediaInitSegmentInfo
 Segment information for initialization segments. More...
 
struct  WSB_MediaFileInfo
 File information for a DASH representation consisting of a single URL and no segment such as subtitles. More...
 
struct  WSB_MediaSegmentInfo
 Segment information for media segments. More...
 
struct  WSB_DashCencInfo
 MPEG DASH Common Encryption information. More...
 
struct  WSB_DashDvInfo
 Dolby Vision information for video segments. More...
 
struct  WSB_DashIsoFfMediaSegmentInfo
 Subclass of WSB_MediaSegmentInfo for MPEG DASH media segments. More...
 
struct  WSB_MediaDataInfo
 Media data information/. More...
 
struct  WSB_DashIsoFfMediaDataInfo
 Subclass of WSB_MediaDataInfo for MPEG DASH ISOFF media data. More...
 
struct  WSB_MediaRepresentationInfo
 Representation info. More...
 
struct  WSB_MediaStreamVariantInfo
 Stream variant info. More...
 
struct  WSB_MediaSourceEvent
 Event base class. More...
 
struct  WSB_MediaSourceStateChangedEvent
 This event is sent when the state of the media source changes. More...
 
struct  WSB_MediaSourcePresentationEvent
 This event is sent when a new presentation has been received. More...
 
struct  WSB_MediaSourcePeriodEvent
 This event is sent when a new period has started. More...
 
struct  WSB_MediaSourceInitSegmentEvent
 This event is sent when a new initialization segment has been received. More...
 
struct  WSB_MediaSourceMediaSegmentEvent
 This event is sent when the download of a new segment has started. More...
 
struct  WSB_MediaSourceMediaDataEvent
 This event is sent when new data is available for one of downloading segment. More...
 
struct  WSB_MediaSourceSeekDoneEvent
 This event is sent when a seek operation has been completed. More...
 
struct  WSB_MediaSourceStartDoneEvent
 This event is sent when a start operation has been completed. More...
 
struct  WSB_MediaSourceStopDoneEvent
 This event is sent when a stop operation has been completed. More...
 
struct  WSB_MediaSourceFlushDoneEvent
 This event is sent when a flush operation has been completed. More...
 
struct  WSB_MediaSourceListener
 
struct  WSB_MediaSourceListenerInterface
 
struct  WSB_MediaSourceCodecFilter
 
struct  WSB_MediaSourceCodecFilterInterface
 
struct  WSB_MediaSourceStreamSelector
 
struct  WSB_MediaSourceStreamSelectorInterface
 
struct  WSB_MediaSourceRepresentationSelector
 
struct  WSB_MediaSourceRepresentationSelectorInterface
 
struct  WSB_MediaSourceConfig
 WSB_MediaSource configuration options. More...
 
struct  WSB_MediaSourceStatus
 Status of a WSB_MediaSource instance. More...
 

Macros

#define WSB_MEDIA_SOURCE_TIMEOUT_INFINITE   ((WSB_Int32)(-1))
 
#define WSB_DASH_ISOFF_MEDIA_DATA_FLAG_SYNC   1
 
#define WSB_MEDIA_SOURCE_INFO_EXTENSION_TYPE_PSSH   0x70737368 /* 'pssh' */
 
#define WSB_MEDIA_SOURCE_USE_DEFAULT_SELECTOR   (-1)
 
#define WSB_MEDIA_SOURCE_NO_COMPATIBLE_SELECTION   (-2)
 

Typedefs

typedef struct WSB_MediaSource WSB_MediaSource
 
typedef struct WSB_MediaFileInfo WSB_MediaFileInfo
 File information for a DASH representation consisting of a single URL and no segment such as subtitles. More...
 
typedef struct WSB_MediaSourceListenerInstance WSB_MediaSourceListenerInstance
 Recipient of Media Source event callbacks. More...
 
typedef struct WSB_MediaSourceListenerInterface WSB_MediaSourceListenerInterface
 
typedef struct WSB_MediaSourceCodecFilterInstance WSB_MediaSourceCodecFilterInstance
 Interface used to check which codecs are supported and which are not. More...
 
typedef struct WSB_MediaSourceCodecFilterInterface WSB_MediaSourceCodecFilterInterface
 
typedef struct WSB_MediaSourceStreamSelectorInstance WSB_MediaSourceStreamSelectorInstance
 Interface used to select amongst different available streams. More...
 
typedef struct WSB_MediaSourceStreamSelectorInterface WSB_MediaSourceStreamSelectorInterface
 
typedef struct WSB_MediaSourceRepresentationSelectorInstance WSB_MediaSourceRepresentationSelectorInstance
 Interface used to select amongst different available representations (typically different bitrates) More...
 
typedef struct WSB_MediaSourceRepresentationSelectorInterface WSB_MediaSourcRepresentationSelectorInterface
 

Enumerations

enum  WSB_MediaSourceEventType {
  WSB_MEDIA_SOURCE_EVENT_STATE_CHANGED = 0,
  WSB_MEDIA_SOURCE_EVENT_PRESENTATION,
  WSB_MEDIA_SOURCE_EVENT_PERIOD,
  WSB_MEDIA_SOURCE_EVENT_INIT_SEGMENT,
  WSB_MEDIA_SOURCE_EVENT_MEDIA_SEGMENT,
  WSB_MEDIA_SOURCE_EVENT_MEDIA_DATA,
  WSB_MEDIA_SOURCE_EVENT_SEEK_DONE,
  WSB_MEDIA_SOURCE_EVENT_START_DONE,
  WSB_MEDIA_SOURCE_EVENT_STOP_DONE,
  WSB_MEDIA_SOURCE_EVENT_FLUSH_DONE
}
 Event types. More...
 
enum  WSB_MediaSourceState {
  WSB_MEDIA_SOURCE_STATE_IDLE,
  WSB_MEDIA_SOURCE_STATE_RUNNING,
  WSB_MEDIA_SOURCE_STATE_STOPPED
}
 Media Source states. More...
 
enum  WSB_MediaPresentationType { WSB_MEDIA_PRESENTATION_TYPE_MPEG_DASH }
 Presentation types. More...
 
enum  WSB_MediaPresentationMode {
  WSB_MEDIA_PRESENTATION_MODE_STATIC,
  WSB_MEDIA_PRESENTATION_MODE_DYNAMIC
}
 Presentation modes. More...
 
enum  WSB_MediaContainerFormat {
  WSB_MEDIA_CONTAINER_FORMAT_MP4,
  WSB_MEDIA_CONTAINER_FORMAT_MPEG2TS,
  WSB_MEDIA_CONTAINER_FORMAT_FILE
}
 Media container formats. More...
 
enum  WSB_MediaSegmentType {
  WSB_MEDIA_SEGMENT_TYPE_DASH_ISOFF,
  WSB_MEDIA_SEGMENT_TYPE_DASH_MP2T,
  WSB_MEDIA_SEGMENT_TYPE_SINGLE_FILE
}
 Media segment types. More...
 
enum  WSB_MediaDataDecrypterType { WSB_MEDIA_DATA_DECRYPTER_TYPE_CENC }
 
enum  WSB_MediaDataDecrypterKeyFormat {
  WSB_MEDIA_DATA_DECRYPTER_KEY_FORMAT_RAW,
  WSB_MEDIA_DATA_DECRYPTER_KEY_FORMAT_SKB
}
 
enum  WSB_MediaSourceSeekFlag {
  WSB_SEEK_FLAG_BOTH,
  WSB_SEEK_FLAG_VIDEO_ONLY,
  WSB_SEEK_FLAG_AUDIO_ONLY
}
 Seek operationn modifier flags. More...
 
enum  WSB_MediaSourceFlushFlag {
  WSB_FLUSH_FLAG_BOTH,
  WSB_FLUSH_FLAG_VIDEO_ONLY,
  WSB_FLUSH_FLAG_AUDIO_ONLY
}
 Flush operation modifier flags. More...
 
enum  WSB_MediaSourceResumeFlag {
  WSB_RESUME_FLAG_FROM_CURRENT_POSITON,
  WSB_RESUME_FLAG_CATCHUP_TO_LIVE
}
 Resume operation modifier flags. More...
 

Functions

WSB_EXPORT WSB_Result WSB_MediaSource_Create (const char *url, const char *mime_type, const WSB_MediaSourceListener *listener, const WSB_MediaSourceCodecFilter *codec_filter, const WSB_MediaSourceStreamSelector *stream_selector, const WSB_MediaSourceRepresentationSelector *representation_selector, const WSB_MediaSourceConfig *config, WSB_MediaSource **source)
 Create a WSB_MediaSource instance to handle a streaming URL. More...
 
WSB_EXPORT WSB_Result WSB_MediaSource_Start (WSB_MediaSource *self, WSB_MediaSourceResumeFlag resume_flag)
 Start the media source. More...
 
WSB_EXPORT WSB_Result WSB_MediaSource_Stop (WSB_MediaSource *self)
 Stop the media source. More...
 
WSB_EXPORT WSB_Result WSB_MediaSource_Flush (WSB_MediaSource *self, WSB_MediaSourceFlushFlag flush_flag)
 Flush the media source buffers. More...
 
WSB_EXPORT WSB_Result WSB_MediaSource_Advance (WSB_MediaSource *self, WSB_Int32 timeout)
 Process the next message from the media source queue and call the listener's OnEvent callback with a corresponding event. More...
 
WSB_EXPORT WSB_Result WSB_MediaSource_Seek (WSB_MediaSource *self, WSB_UInt64 position_in_ms, WSB_MediaSourceSeekFlag seek_flag)
 Seek to a specific time position in the media source. More...
 
WSB_EXPORT WSB_Result WSB_MediaSource_ReselectStreams (WSB_MediaSource *self)
 Reselect streams from the media source. More...
 
WSB_EXPORT WSB_Result WSB_MediaSource_GetStatus (WSB_MediaSource *self, WSB_MediaSourceStatus *status)
 Obtain the status of a WSB_MediaSource instance. More...
 
WSB_EXPORT WSB_Result WSB_MediaSource_Destroy (WSB_MediaSource *self)
 Destroy a WSB_MediaSource instance. More...
 

Detailed Description

(DASH) Media data access.

Macro Definition Documentation

◆ WSB_DASH_ISOFF_MEDIA_DATA_FLAG_SYNC

#define WSB_DASH_ISOFF_MEDIA_DATA_FLAG_SYNC   1

◆ WSB_MEDIA_SOURCE_INFO_EXTENSION_TYPE_PSSH

#define WSB_MEDIA_SOURCE_INFO_EXTENSION_TYPE_PSSH   0x70737368 /* 'pssh' */

◆ WSB_MEDIA_SOURCE_NO_COMPATIBLE_SELECTION

#define WSB_MEDIA_SOURCE_NO_COMPATIBLE_SELECTION   (-2)

◆ WSB_MEDIA_SOURCE_TIMEOUT_INFINITE

#define WSB_MEDIA_SOURCE_TIMEOUT_INFINITE   ((WSB_Int32)(-1))

◆ WSB_MEDIA_SOURCE_USE_DEFAULT_SELECTOR

#define WSB_MEDIA_SOURCE_USE_DEFAULT_SELECTOR   (-1)

Typedef Documentation

◆ WSB_MediaFileInfo

File information for a DASH representation consisting of a single URL and no segment such as subtitles.

◆ WSB_MediaSource

◆ WSB_MediaSourceCodecFilterInstance

Interface used to check which codecs are supported and which are not.

◆ WSB_MediaSourceCodecFilterInterface

◆ WSB_MediaSourceListenerInstance

Recipient of Media Source event callbacks.

◆ WSB_MediaSourceListenerInterface

◆ WSB_MediaSourceRepresentationSelectorInstance

Interface used to select amongst different available representations (typically different bitrates)

◆ WSB_MediaSourceStreamSelectorInstance

Interface used to select amongst different available streams.

(for example, different languages, or alternative viewpoints)

◆ WSB_MediaSourceStreamSelectorInterface

◆ WSB_MediaSourcRepresentationSelectorInterface

Enumeration Type Documentation

◆ WSB_MediaContainerFormat

Media container formats.

Enumerator
WSB_MEDIA_CONTAINER_FORMAT_MP4 
WSB_MEDIA_CONTAINER_FORMAT_MPEG2TS 
WSB_MEDIA_CONTAINER_FORMAT_FILE 

◆ WSB_MediaDataDecrypterKeyFormat

Enumerator
WSB_MEDIA_DATA_DECRYPTER_KEY_FORMAT_RAW 
WSB_MEDIA_DATA_DECRYPTER_KEY_FORMAT_SKB 

◆ WSB_MediaDataDecrypterType

Enumerator
WSB_MEDIA_DATA_DECRYPTER_TYPE_CENC 

◆ WSB_MediaPresentationMode

Presentation modes.

Enumerator
WSB_MEDIA_PRESENTATION_MODE_STATIC 
WSB_MEDIA_PRESENTATION_MODE_DYNAMIC 

◆ WSB_MediaPresentationType

Presentation types.

Enumerator
WSB_MEDIA_PRESENTATION_TYPE_MPEG_DASH 

◆ WSB_MediaSegmentType

Media segment types.

Enumerator
WSB_MEDIA_SEGMENT_TYPE_DASH_ISOFF 
WSB_MEDIA_SEGMENT_TYPE_DASH_MP2T 
WSB_MEDIA_SEGMENT_TYPE_SINGLE_FILE 

◆ WSB_MediaSourceEventType

Event types.

Enumerator
WSB_MEDIA_SOURCE_EVENT_STATE_CHANGED 
WSB_MEDIA_SOURCE_EVENT_PRESENTATION 
WSB_MEDIA_SOURCE_EVENT_PERIOD 
WSB_MEDIA_SOURCE_EVENT_INIT_SEGMENT 
WSB_MEDIA_SOURCE_EVENT_MEDIA_SEGMENT 
WSB_MEDIA_SOURCE_EVENT_MEDIA_DATA 
WSB_MEDIA_SOURCE_EVENT_SEEK_DONE 
WSB_MEDIA_SOURCE_EVENT_START_DONE 
WSB_MEDIA_SOURCE_EVENT_STOP_DONE 
WSB_MEDIA_SOURCE_EVENT_FLUSH_DONE 

◆ WSB_MediaSourceFlushFlag

Flush operation modifier flags.

The constants are mutually exclusive, i.e. cannot be combined using the bitwise OR, '|'.

Enumerator
WSB_FLUSH_FLAG_BOTH 

Flush both audio and video.

WSB_FLUSH_FLAG_VIDEO_ONLY 

Flush video, keep audio continuous.

WSB_FLUSH_FLAG_AUDIO_ONLY 

Flush audio, keep video continuous.

◆ WSB_MediaSourceResumeFlag

Resume operation modifier flags.

The constants are mutually exclusive, i.e. cannot be combined using the bitwise OR, '|'.

Enumerator
WSB_RESUME_FLAG_FROM_CURRENT_POSITON 

Resume from the current position, regardless whether static or dynamic MPD.

WSB_RESUME_FLAG_CATCHUP_TO_LIVE 

Seek to the most current media if live presentation.

◆ WSB_MediaSourceSeekFlag

Seek operationn modifier flags.

The constants are mutually exclusive, i.e. cannot be combined using the bitwise OR, '|'.

Enumerator
WSB_SEEK_FLAG_BOTH 

Seek both audio and video streams.

WSB_SEEK_FLAG_VIDEO_ONLY 

Seek only on the video stream.

WSB_SEEK_FLAG_AUDIO_ONLY 

Seek only on the audio stream.

◆ WSB_MediaSourceState

Media Source states.

Enumerator
WSB_MEDIA_SOURCE_STATE_IDLE 
WSB_MEDIA_SOURCE_STATE_RUNNING 
WSB_MEDIA_SOURCE_STATE_STOPPED 

Function Documentation

◆ WSB_MediaSource_Advance()

WSB_EXPORT WSB_Result WSB_MediaSource_Advance ( WSB_MediaSource self,
WSB_Int32  timeout 
)

Process the next message from the media source queue and call the listener's OnEvent callback with a corresponding event.

Parameters
selfPointer to the WSB_MediaSource instance to advance.
timeoutTimeout in milliseconds.
Returns
WSB_SUCCESS if a message has been processed, WSB_ERROR_TIMEOUT or WSB_ERROR_DASH_NO_MESSAGE_IN_QUEUE if more than 'timeout' milliseconds have elapsed without a message being available, WSB_ERROR_EOS if the media source has reached the end of the presentation, or a negative error code if an unrecoverable error has been encountered.

◆ WSB_MediaSource_Create()

WSB_EXPORT WSB_Result WSB_MediaSource_Create ( const char *  url,
const char *  mime_type,
const WSB_MediaSourceListener listener,
const WSB_MediaSourceCodecFilter codec_filter,
const WSB_MediaSourceStreamSelector stream_selector,
const WSB_MediaSourceRepresentationSelector representation_selector,
const WSB_MediaSourceConfig config,
WSB_MediaSource **  source 
)

Create a WSB_MediaSource instance to handle a streaming URL.

Parameters
urlThe URL to stream
mime_typeThe MIME Type of the content referenced by the URL, or NULL if it is not known.
listenerPointer to a WSB_MediaSourceListener instance that will receive callbacks when calling WSB_MediaSource_Advance().
codec_filterPointer to a WSB_MediaSourceCodecFilter if the caller wants to override the default codec filtering logic, or NULL to use the default codec filtering logic.
stream_selectorPointer to a WSB_MediaSourceStreamSelector if the caller wants to override the default stream selection logic, or NULL to use the default stream selection logic.
representation_selectorPointer to a WSB_MediaSourceRepresentationSelector if the caller wants to override the default representation selection logic, or NULL to use the default representation selection logic.
configPointer to the configuration parameters for the media source, or NULL to use the default configuration parameters.
sourceAddress of a WSB_MediaSource pointer that will be set to refer to the newly created WSB_MediaSource object.
Returns
WSB_SUCCESS if the call succeeds, or a negative error code if it fails.

◆ WSB_MediaSource_Destroy()

WSB_EXPORT WSB_Result WSB_MediaSource_Destroy ( WSB_MediaSource self)

Destroy a WSB_MediaSource instance.

Parameters
selfPointer to the WSB_MediaSource instance to detroy.
Returns
WSB_SUCCESS if the call succeeds, or a negative error code if it fails.

◆ WSB_MediaSource_Flush()

WSB_EXPORT WSB_Result WSB_MediaSource_Flush ( WSB_MediaSource self,
WSB_MediaSourceFlushFlag  flush_flag 
)

Flush the media source buffers.

Parameters
selfPointer to the WSB_MediaSource instance to operate on. Flush any messages queued between the media source implementation module and the client listener. The operation will execute potentially out of order of issue, resulting in out of order completion with respect to other commands issued before it. As a result, any responses to commands issued before the flush, e.g. a seek, may or may not have the corresponding responses reach the client. The media source listener interface will be notified of the flush command processing with a WSB_MEDIA_SOURCE_EVENT_FLUSH_DONE event.
flush_flagthe modifier for how the flush operation is to be performed. If
Returns
WSB_SUCCESS if the call succeeds, or a negative error code if it fails.

◆ WSB_MediaSource_GetStatus()

WSB_EXPORT WSB_Result WSB_MediaSource_GetStatus ( WSB_MediaSource self,
WSB_MediaSourceStatus status 
)

Obtain the status of a WSB_MediaSource instance.

Parameters
selfPointer to the WSB_MediaSource instance to obtain the status of.
statusPointer to a WSB_MediaSourceStatus structure where the status will be returned.
Returns
WSB_SUCCESS if the call succeeds, or a negative error code if it fails.

◆ WSB_MediaSource_ReselectStreams()

WSB_EXPORT WSB_Result WSB_MediaSource_ReselectStreams ( WSB_MediaSource self)

Reselect streams from the media source.

Parameters
selfPointer to the WSB_MediaSource instance to reselect streams with. Reselecting streams from the media source is asynchronous: the streams may not change by the time this function returns and the change will happen at the starting of the segment boundary. The media source stream selector interface will be called to perform the stream selection.
Returns
WSB_SUCCESS if the call succeeds, or a negative error code if it fails.

◆ WSB_MediaSource_Seek()

WSB_EXPORT WSB_Result WSB_MediaSource_Seek ( WSB_MediaSource self,
WSB_UInt64  position_in_ms,
WSB_MediaSourceSeekFlag  seek_flag 
)

Seek to a specific time position in the media source.

Parameters
selfPointer to the WSB_MediaSource instance to seek with. Seeking a media source is asynchronous: the media source position may not yet have changed by the time this function returns. The media source listener interface will be notified of the completion of the seek operation.
position_in_msPosition to seek to, expressed in milliseconds.
seek_flagthe modifier for the way seek is to be performed.
Returns
WSB_SUCCESS if the call succeeds, or a negative error code if it fails.

◆ WSB_MediaSource_Start()

WSB_EXPORT WSB_Result WSB_MediaSource_Start ( WSB_MediaSource self,
WSB_MediaSourceResumeFlag  resume_flag 
)

Start the media source.

Parameters
selfPointer to the WSB_MediaSource instance to start. Starting a media source is asynchronous: the media source may not be started by the time this function returns. The media source listener interface will be notified of the state change when the source actually starts with a WSB_MEDIA_SOURCE_EVENT_START_DONE event.
resume_flagthe modifier for how the resume operation is to be performed.
Returns
WSB_SUCCESS if the call succeeds, or a negative error code if it fails.

◆ WSB_MediaSource_Stop()

WSB_EXPORT WSB_Result WSB_MediaSource_Stop ( WSB_MediaSource self)

Stop the media source.

Parameters
selfPointer to the WSB_MediaSource instance to stop. Stopping a media source is asynchronous: the media source may not be stopped by the time this function returns. The media source listener interface will be notified of the state change when the source actually stops with a WSB_MEDIA_SOURCE_EVENT_STOP_DONE event.
Returns
WSB_SUCCESS if the call succeeds, or a negative error code if it fails.