public class MediaSegmentDecrypter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MediaSegmentDecrypter.HlsInitData
The InitData specific to the HLS media format.
|
static class |
MediaSegmentDecrypter.InitData
A base InitData class.
|
static class |
MediaSegmentDecrypter.Mp4CencInitData
The InitData specific to the MP4/CENC media format.
|
static class |
MediaSegmentDecrypter.Type
Media type a decrypter object can be used with.
|
Constructor and Description |
---|
MediaSegmentDecrypter(java.lang.String ms3_url,
MediaSegmentDecrypter.Type type)
Create a new instance of the Media Segment Decrypter object.
|
Modifier and Type | Method and Description |
---|---|
MediaSegmentDecrypter |
cloneDecrypter()
Create a new instance of Media Segment Decrypter from another
Media Segment Decrypter object.
|
int |
decrypt(byte[] input,
byte[] output)
A convenience method, assuming offset 0 and full array length for both
input and output.
|
int |
decrypt(byte[] input,
int in_offset,
int in_size,
byte[] output,
int out_offset,
int out_size)
Perform decryption of a media buffer.
|
void |
destroy()
Destroy a Media Segment Decrypter object earlier successfully
created through MediaSegmentDecrypter().
|
void |
init(MediaSegmentDecrypter.InitData init_data)
Initialize decrypter for a new segment.
|
public MediaSegmentDecrypter(java.lang.String ms3_url, MediaSegmentDecrypter.Type type) throws ErrorCodeException
ms3_url
- the MS3 URL, must be ms3:// scheme,
for Marlin MS3 license form, can be null if using BB
license.type
- the media type.ErrorCodeException
public MediaSegmentDecrypter cloneDecrypter() throws ErrorCodeException
ErrorCodeException
public void destroy() throws ErrorCodeException
ErrorCodeException
public void init(MediaSegmentDecrypter.InitData init_data) throws ErrorCodeException
init_data
- a media format specific initialization
data. For HLS, this must be an HlsInitData object.
For MP4/CENC, this must be an Mp4CencInitData object.ErrorCodeException
public int decrypt(byte[] input, int in_offset, int in_size, byte[] output, int out_offset, int out_size) throws ErrorCodeException
input
- the media data to be decrypted.
For decrypting HLS segment, 'input' can be null to signal end of a
segment, flush decrypter and receive any buffered decrypted data.
For decrypting MP4/CENC segment, 'input' must not be NULL except when
this function is used to obtain the estimated decrypted data size
(see description of return value).in_offset
- data offset in the input buffer, in bytes.in_size
- size of the 'input' buffer in bytes.output
- the output buffer where the decrypted media
data is returned.
For decrypting HLS segment, 'output' must not be NULL.
For decrypting MP4/CENC segment, 'output' must not be NULL except when
this function is used to obtain the estimate decrypted data size.out_offset
- data offset in the output buffer, in bytes.out_size
- the number of bytes available from out_offset in the output bufferErrorCodeException
public int decrypt(byte[] input, byte[] output) throws ErrorCodeException
input
- the media data to be decrypted.
For decrypting HLS segment, 'input' can be null to signal end of a
segment, flush decrypter and receive any buffered decrypted data.
For decrypting MP4/CENC segment, 'input' must not be NULL except when
this function is used to obtain the estimated decrypted data size
(see description of return value).output
- the output buffer where the decrypted media
data is returned.
For decrypting HLS segment, 'output' must not be NULL.
For decrypting MP4/CENC segment, 'output' must not be NULL except when
this function is used to obtain the estimate decrypted data size.ErrorCodeException