Wasabi ExpressPlay SDK for iOS
1.23.0
|
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... | |
Marlin Media Segment Decrypter API module.
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.
decrypter | pointer to the Media Segment Decrypter object |
cloned | pointer to where the pointer to the newly created object is returned. |
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.
source_url | the 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. |
type | the media type. |
decrypter | pointer to where the pointer to the newly created object is returned. |
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.
decrypter | pointer to the Media Segment Decrypter object |
in | pointer 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_size | size of the 'in' buffer in bytes. |
out | pointer 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_size | an 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". |
WSB_EXPORT WSB_Result WSB_MediaSegmentDecrypter_Destroy | ( | WSB_MediaSegmentDecrypter * | decrypter | ) |
Destroy a Media Segment Decrypter object earlier successfully created through WSB_MediaSegmentDecrypter_Create.
decrypter | pointer to the object being destroyed. |
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.
decrypter | pointer to the Media Segment Decrypter object |
init_data | pointer 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. |