Wasabi ExpressPlay SDK for Desktop Systems  1.10
Data Structures | Typedefs | Enumerations | Functions
WSB_MediaStream Class

A general Marlin protected data access interface. More...

Data Structures

struct  WSB_MediaStreamInterface
 
struct  WSB_MediaStream
 
union  WSB_MediaStream_FormatInfo
 Source data format information. More...
 

Typedefs

typedef struct WSB_MediaStream WSB_MediaStream
 
typedef struct WSB_KeyManager WSB_MediaStreamKey
 

Enumerations

enum  WSB_MediaStream_SourceType {
  WSB_MEDIASTREAM_SOURCE_TYPE_DCF,
  WSB_MEDIASTREAM_SOURCE_TYPE_AES128CBC
}
 

Functions

WSB_EXPORT WSB_Result WSB_MediaStream_OpenUrl (const char *source_url, WSB_MediaStream_SourceType source_type, const WSB_MediaStream_FormatInfo *format_info, WSB_MediaStream **stream)
 Open a Marlin protected source. More...
 
WSB_EXPORT WSB_Result WSB_MediaStream_Open (WSB_MediaStream *source_stream, const WSB_MediaStream_FormatInfo *format_info, WSB_MediaStream **stream)
 Open a Marlin protected source stream. More...
 
WSB_EXPORT WSB_Result WSB_MediaStream_Read (WSB_MediaStream *self, void *buffer, WSB_Size *read_bytes)
 Read data from a media stream object. More...
 
WSB_EXPORT WSB_Result WSB_MediaStream_Seek (WSB_MediaStream *self, WSB_Position position)
 Change the current read position for a media stream. More...
 
WSB_EXPORT WSB_Result WSB_MediaStream_Tell (WSB_MediaStream *self, WSB_Position *position)
 Get the current read position for a media stream. More...
 
WSB_EXPORT WSB_Result WSB_MediaStream_GetSize (WSB_MediaStream *self, WSB_LargeSize *size)
 Get the size of the media stream in bytes, if known (or an error code if the size is unknown or an error occurs). More...
 
WSB_EXPORT WSB_Result WSB_MediaStream_GetContentType (WSB_MediaStream *self, const char **content_type)
 Get the content type of the data in the media stream. More...
 
WSB_EXPORT WSB_Result WSB_MediaStream_GetKey (WSB_MediaStream *self, const WSB_MediaStreamKey **key)
 Extract the crypto context from a Media Stream object. More...
 
WSB_EXPORT WSB_Result WSB_MediaStream_Close (WSB_MediaStream *self)
 Release a media stream object once it is no longer needed. More...
 

Detailed Description

A general Marlin protected data access interface.

Since
1.6

Typedef Documentation

typedef struct WSB_KeyManager WSB_MediaStreamKey

Enumeration Type Documentation

Enumerator
WSB_MEDIASTREAM_SOURCE_TYPE_DCF 

Marlin DCF document format.

WSB_MEDIASTREAM_SOURCE_TYPE_AES128CBC 

See http://www.w3.org/TR/xmlenc-core/#sec-Alg-Block for the encryption format.

The IV block of 16 bytes may be prepended to the encrypted block for easy reference, but could also be omitted from the data and provided through the API in the WSB_MediaStream_FormatInfo.generic.iv.

Function Documentation

WSB_EXPORT WSB_Result WSB_MediaStream_Close ( WSB_MediaStream self)

Release a media stream object once it is no longer needed.

Parameters
selfthe media stream object.
WSB_EXPORT WSB_Result WSB_MediaStream_GetContentType ( WSB_MediaStream self,
const char **  content_type 
)

Get the content type of the data in the media stream.

If the content type is not known an error code is returned.

Parameters
selfthe media stream object.
content_typepointer to where the 0-terminated content type string is returned. The returned string is owned by the media stream object and is valid for the lifetime of the media stream object.
WSB_EXPORT WSB_Result WSB_MediaStream_GetKey ( WSB_MediaStream self,
const WSB_MediaStreamKey **  key 
)

Extract the crypto context from a Media Stream object.

A new Media Stream object can be constructed efficiently using such crypto context in place of MS3 or BB license.

Parameters
selfthe media stream object.
keypointer to an opaque crypto context object pointer. The returned object remains owned by the current Media Stream and remains valid for the duration of the owner Media Stream object.
Returns
WSB_SUCCESS on success or WSB_ERROR_NOT_SUPPORTED if this Media Stream object does not support this method.
Since
1.8
WSB_EXPORT WSB_Result WSB_MediaStream_GetSize ( WSB_MediaStream self,
WSB_LargeSize size 
)

Get the size of the media stream in bytes, if known (or an error code if the size is unknown or an error occurs).

Parameters
selfthe media stream object.
sizepointer to where the media stream size is returned.
WSB_EXPORT WSB_Result WSB_MediaStream_Open ( WSB_MediaStream source_stream,
const WSB_MediaStream_FormatInfo format_info,
WSB_MediaStream **  stream 
)

Open a Marlin protected source stream.

Returns a WSB_MediaStream object that allows random access to the source data in cleartext. The returned object must be destroyed through WSB_MediaStream_Close.

Parameters
source_streama random access input stream object implementing the WSB_MediaStream_Interface interface. Client must ensure this object exists for the duration of the returned stream object.
format_infofurther information about the source data, that otherwise may not be available in the source data directly. Can be NULL.
streampointer to where the pointer to the newly created object is returned.
WSB_EXPORT WSB_Result WSB_MediaStream_OpenUrl ( const char *  source_url,
WSB_MediaStream_SourceType  source_type,
const WSB_MediaStream_FormatInfo format_info,
WSB_MediaStream **  stream 
)

Open a Marlin protected source.

Returns a WSB_MediaStream object that allows random access to the source data in cleartext. The returned object must be destroyed through WSB_MediaStream_Close.

Parameters
source_urleither an ms3:// URL or directly a source file URL (http:// or file://) for BB.
source_typethe format type of the source data. See WSB_MediaStream_SourceType.
format_infofurther information about the source data, that otherwise may not be available in the source data directly. Can be NULL.
streampointer to where the pointer to the newly created object is returned.

NOTE: the BB license or MS3 SAS used with MediaStream must relax the default marlin output controls or the content will not be decrypted. This requires the SAS to carry an MS3 extension (of type “wudo”) or a the Marlin Broadband license to indicate a Marlin Broadband output control override (type “urn:marlin:organization:intertrust:wudo”).

WSB_EXPORT WSB_Result WSB_MediaStream_Read ( WSB_MediaStream self,
void *  buffer,
WSB_Size read_bytes 
)

Read data from a media stream object.

The requested number of bytes and the actually read number of bytes is passed in and returned through *read_bytes. The number of actually read bytes can be less than requested.

At the end of data, WSB_ERROR_EOS is returned.

Parameters
selfthe media stream object.
bufferpointer to the data buffer of at least *read_bytes bytes.
read_bytesthe number of bytes requested as input parameter, the number of bytes actually read as output parameter.

NOTE: the BB license or MS3 SAS used with MediaStream must relax the default marlin output controls or the content will not be decrypted. This requires the SAS to carry an MS3 extension (of type “wudo”) or a the Marlin Broadband license to indicate a Marlin Broadband output control override (type “urn:marlin:organization:intertrust:wudo”).

WSB_EXPORT WSB_Result WSB_MediaStream_Seek ( WSB_MediaStream self,
WSB_Position  position 
)

Change the current read position for a media stream.

Parameters
selfthe media stream object.
positionthe number of bytes from the start of the media stream.
WSB_EXPORT WSB_Result WSB_MediaStream_Tell ( WSB_MediaStream self,
WSB_Position position 
)

Get the current read position for a media stream.

Parameters
selfthe media stream object.
positionpointer to where the current media stream position as the number of bytes from the start of the media stream is returned.