Wasabi ExpressPlay SDK for Embedded Systems  1.23.0
Functions
WSB_MediaSegmentDecrypter Class

Marlin Media Segment Decrypter API module. More...

Functions

WSB_EXPORT WSB_Result WSB_MediaSegmentDecrypter_Create (const char *source_url, WSB_MediaSegmentDecrypterType type, WSB_MediaSegmentDecrypter **decrypter)
 Create a new instance of the Media Segment Decrypter object. More...
 
WSB_EXPORT WSB_Result WSB_MediaSegmentDecrypter_Clone (WSB_MediaSegmentDecrypter *decrypter, WSB_MediaSegmentDecrypter **cloned)
 Create a new instance of Media Segment Decrypter from another Media Segment Decrypter object. More...
 
WSB_EXPORT WSB_Result WSB_MediaSegmentDecrypter_Destroy (WSB_MediaSegmentDecrypter *decrypter)
 Destroy a Media Segment Decrypter object earlier successfully created through WSB_MediaSegmentDecrypter_Create. More...
 
WSB_EXPORT WSB_Result WSB_MediaSegmentDecrypter_Init (WSB_MediaSegmentDecrypter *decrypter, const void *init_data)
 Initialize decrypter for a new segment. More...
 
WSB_EXPORT WSB_Result WSB_MediaSegmentDecrypter_Decrypt (WSB_MediaSegmentDecrypter *decrypter, const WSB_UInt8 *in, unsigned int in_size, WSB_UInt8 *out, unsigned int *out_size)
 Perform decryption of a media buffer. More...
 

Detailed Description

Marlin Media Segment Decrypter API module.

Function Documentation

◆ WSB_MediaSegmentDecrypter_Clone()

WSB_EXPORT WSB_Result WSB_MediaSegmentDecrypter_Clone ( WSB_MediaSegmentDecrypter decrypter,
WSB_MediaSegmentDecrypter **  cloned 
)

Create a new instance of Media Segment Decrypter from another Media Segment Decrypter object.

The new instance will have the same content keys as the original instance, but won't share any other state of the decrypter object. The new object needs to be initialized through WSB_MediaSegmentDecrypter_Init before it can be used to decrypt.

The original and the cloned object can be used on separate threads.

Parameters
decrypterpointer to the Media Segment Decrypter object
clonedpointer to where the pointer to the newly created object is returned.
Since
1.12.2

◆ WSB_MediaSegmentDecrypter_Create()

WSB_EXPORT WSB_Result WSB_MediaSegmentDecrypter_Create ( const char *  source_url,
WSB_MediaSegmentDecrypterType  type,
WSB_MediaSegmentDecrypter **  decrypter 
)

Create a new instance of the Media Segment Decrypter object.

The object must be destroyed through a call to WSB_MediaSegmentDecrypter_Destroy once no longer needed.

Parameters
source_urlthe URL can either be NULL or a MS3 URL with ms3:// scheme. If the URL is NULL, it will use the appropriate Marlin Broadband license from the License Store. If the URL is a MS3 URL with ms3:// scheme, it will use that Marlin MS3 license. Otherwise the function will return WSB_ERROR_INVALID_PARAMETERS with any other input value.
typethe media type.
decrypterpointer to where the pointer to the newly created object is returned.
Since
1.10

◆ WSB_MediaSegmentDecrypter_Decrypt()

WSB_EXPORT WSB_Result WSB_MediaSegmentDecrypter_Decrypt ( WSB_MediaSegmentDecrypter decrypter,
const WSB_UInt8 in,
unsigned int  in_size,
WSB_UInt8 out,
unsigned int *  out_size 
)

Perform decryption of a media buffer.

The decryptor buffers input data and may return less data than passed in.

When decrypting an HLS segment, a final call must be made with NULL input buffer in order to flush the decrypter and receive any de-padded final bytes.

When decrypting a MPEG/CENC segment, the input should contain the moof atom followed by the mdat atom with encrypted media. Only one fragment (moof/mdat) per input is supported. The returned output contains only decrypted media in the granularity of one or more samples (no moof atom and mdat atom header). It may return no data and WSB_SUCCESS result code when there is not enough input to decrypt a sample. It may also return WSB_ERROR_NOT_ENOUGH_SPACE when the output buffer size is less than current decrypted sample size. When all the samples of the current segment are decrypted and returned to the caller, additional call to this function will return WSB_ERROR_EOS.

Parameters
decrypterpointer to the Media Segment Decrypter object
inpointer to the media data to be decrypted. For decrypting HLS segment, 'in' can be NULL to signal end of a segment, flush decrypter and receive any buffered decrypted data. For decrypting MP4/CENC segment, 'in' must not be NULL except when this function is used to obtain the estimate decrypted data size (see description of 'out_size' parameter).
in_sizesize of the 'in' buffer in bytes.
outpointer to the output buffer where the decrypted media data is returned. For decrypting HLS segment, 'out' must not be NULL. For decrypting MP4/CENC segment, 'out' must not be NULL except when this function is used to obtain the estimate decrypted data size (see description of 'out_size' parameter)
out_sizean input and output parameter describing the 'out' buffer size. As an input parameter, declares the total size of the 'out' buffer. As an output parameter, contains the amount of data written to the 'out' buffer, in bytes. For decrypting HLS segment, when the 'in' parameter is NULL and '*out_size' returned is less than '*out_size' passed in, the decrypter has been flushed of any buffered media data. For decrypting MP4/CENC segment, when the 'out' parameter is NULL, the estimate decrypted data size is returned in '*out_size".
Since
1.10

◆ WSB_MediaSegmentDecrypter_Destroy()

WSB_EXPORT WSB_Result WSB_MediaSegmentDecrypter_Destroy ( WSB_MediaSegmentDecrypter decrypter)

Destroy a Media Segment Decrypter object earlier successfully created through WSB_MediaSegmentDecrypter_Create.

Parameters
decrypterpointer to the object being destroyed.
Since
1.10

◆ WSB_MediaSegmentDecrypter_Init()

WSB_EXPORT WSB_Result WSB_MediaSegmentDecrypter_Init ( WSB_MediaSegmentDecrypter decrypter,
const void *  init_data 
)

Initialize decrypter for a new segment.

Must be called before a new segment can start decrypting, but not before any previous segment has been completely decrypted even if no init_data values have changed.

Parameters
decrypterpointer to the Media Segment Decrypter object
init_datapointer to a media format specific initialization data. For HLS, this must be pointer to a WSB_MediaSegmentDecrypter_HlsInitData object. For MP4/CENC, this must be pointer to a WSB_MediaSegmentDecrypter_Mp4CencInitData.
Since
1.10