ml_media_drm.h
Classes
Name | |
---|---|
struct | MLMediaDRMByteArray |
struct | MLMediaDRMByteArrayList |
struct | MLMediaDRMKeyValue |
struct | MLMediaDRMKeyValueArray |
struct | MLMediaDRMKeyRequestInputParam |
struct | MLMediaDRMRequestMessage Data type that encapsulates either of the following along with an URL: |
struct | MLMediaDRMCryptoInputParam |
struct | MLMediaDRMHMACInputParam |
struct | MLMediaDRMRSAInputParam |
struct | MLMediaDRMEventInfo MediaDRM event info associated with a session. |
struct | MLMediaDRMExpirationUpdateInfo MediaDRM expiration update info associated with a session. |
struct | MLMediaDRMKeyStatus MediaDRM key status. |
struct | MLMediaDRMKeyStatusInfo MediaDRM session keys status change info. |
struct | MLMediaDRMEventCallbacks Callbacks for notifying client about MLMediaDRM events. |
Types
Enums
Name | |
---|---|
enum | MLMediaDRMKeyType { MLMediaDRMKeyType_Streaming = 1, MLMediaDRMKeyType_Offline = 2, MLMediaDRMKeyType_Release = 3, MLMediaDRMKeyType_Ensure32Bits = 0x7FFFFFFF } |
enum | MLMediaDRMEventType { MLMediaDRMEventType_ProvisionRequired = 1, MLMediaDRMEventType_KeyRequired = 2, MLMediaDRMEventType_KeyExpired = 3, MLMediaDRMEventType_VendorDefined = 4, MLMediaDRMEventType_SessionReclaimed = 5, MLMediaDRMEventType_ExpirationUpdate = 6, MLMediaDRMEventType_KeysChange = 7, MLMediaDRMEventType_Ensure32Bits = 0x7FFFFFFF } Request event types. |
enum | MLMediaDRMKeyStatusCode { MLMediaDRMKeyStatusCode_KeyStatusUsable = 0, MLMediaDRMKeyStatusCode_KeyStatusExpired = 1, MLMediaDRMKeyStatusCode_KeyStatusOutputNotAllowed = 2, MLMediaDRMKeyStatusCode_KeyStatusPending = 3, MLMediaDRMKeyStatusCode_KeyStatusInternalError = 4, MLMediaDRMKeyStatusCode_Ensure32Bits = 0x7FFFFFFF } Status code associated with a DRM session key. |
Functions
Name | |
---|---|
void | MLMediaDRMEventCallbacksInit(MLMediaDRMEventCallbacks * inout_callbacks) Initializes MLMediaDRMEventCallbacks with default values. |
MLResult | MLMediaDRMByteArrayAllocate(size_t size, MLMediaDRMByteArray * out_array) Allocate byte array buffer. |
MLResult | MLMediaDRMByteArrayAllocAndCopy(const uint8_t copy_from, size_t size, MLMediaDRMByteArray out_array) Allocate and Copy to byte array buffer. |
MLResult | MLMediaDRMKeyValueArrayAllocate(size_t size, MLMediaDRMKeyValueArray * out_array) Allocate array of key/value pairs. |
MLResult | MLMediaDRMCreate(MLUUID uuid, MLHandle * out_handle) Create a MLMediaDRM instance from a UUID. |
MLResult | MLMediaDRMRelease(MLHandle media_drm) Release the MLMediaDRM instance. |
MLResult | MLMediaDRMByteArrayRelease(MLMediaDRMByteArray * array) Release byte array buffer. |
MLResult | MLMediaDRMByteArrayListRelease(MLMediaDRMByteArrayList * array) Release list of byte array buffer. |
MLResult | MLMediaDRMKeyValueArrayRelease(MLMediaDRMKeyValueArray * array) Release key/value pair array. |
MLResult | MLMediaDRMRequestMessageRelease(MLMediaDRMRequestMessage * request) Release Request Message. |
MLResult | MLMediaDRMKeyValueArrayAdd(const MLMediaDRMKeyValue pair, MLMediaDRMKeyValueArray out_array) Add a key/value pair to the array of key/value pairs. |
MLResult | MLMediaDRMIsCryptoSchemeSupported(MLUUID uuid, const char mime_type, bool out_supported) Query if the given scheme identified by its UUID is supported on this device. And whether the drm plugin is able to handle the media container format. |
MLResult | MLMediaDRMSetOnEventListenerEx(MLHandle media_drm, MLMediaDRMEventCallbacks callbacks, void data) Register a callback to be invoked when DRM events or updates or status change occurs. |
MLResult | MLMediaDRMOpenSession(MLHandle media_drm, MLMediaDRMByteArray * out_session_id) Opens a new session. A session ID is returned. |
MLResult | MLMediaDRMCloseSession(MLHandle media_drm, MLMediaDRMByteArray * session_id) Closes a session on the MLMediaDRM object that was previously opened with openSession(). |
MLResult | MLMediaDRMGetKeyRequest(MLHandle media_drm, const MLMediaDRMByteArray session_id, const MLMediaDRMKeyRequestInputParam key_request_param, MLMediaDRMRequestMessage * out_key_request) A key request/response exchange occurs between the app and a license server to obtain or release keys used to decrypt encrypted content. |
MLResult | MLMediaDRMProvideKeyResponse(MLHandle media_drm, const MLMediaDRMByteArray session_id, const MLMediaDRMByteArray response, MLMediaDRMByteArray * out_key_set_id) A key response is received from the license server by the app, then it is provided to the DRM engine plugin using MLMediaDRMProvideKeyResponse(). |
MLResult | MLMediaDRMRestoreKeys(MLHandle media_drm, const MLMediaDRMByteArray session_id, const MLMediaDRMByteArray key_set_id) Restore persisted offline keys into a new session. key_set_id identifies the keys to load, obtained from a prior call to MLMediaDRMProvideKeyResponse(). |
MLResult | MLMediaDRMRemoveKeys(MLHandle media_drm, MLMediaDRMByteArray * key_set_id) Remove the current keys from a session. |
MLResult | MLMediaDRMQueryKeyStatus(MLHandle media_drm, const MLMediaDRMByteArray session_id, MLMediaDRMKeyValueArray out_info_map) Request an informative description of the key status for the session. |
MLResult | MLMediaDRMGetProvisionRequest(MLHandle media_drm, const char cert_type, MLMediaDRMRequestMessage out_provision_request) A provision request/response exchange occurs between the app and a provisioning server to retrieve a device certificate. |
MLResult | MLMediaDRMProvideProvisionResponse(MLHandle media_drm, const MLMediaDRMByteArray response, MLMediaDRMByteArray out_certificate, MLMediaDRMByteArray * out_wrapped_key) After a provision response is received by the app, it is provided to the DRM engine plugin using this method. |
MLResult | MLMediaDRMGetSecureStops(MLHandle media_drm, MLMediaDRMByteArrayList * out_secure_stops) Access all secure stops. |
MLResult | MLMediaDRMGetSecureStop(MLHandle media_drm, const MLMediaDRMByteArray ss_id, MLMediaDRMByteArray out_secure_stop) Access secure stop by secure stop ID. |
MLResult | MLMediaDRMReleaseSecureStops(MLHandle media_drm, const MLMediaDRMByteArray * secure_stop) Process the SecureStop server response message. After authenticating the message, remove the SecureStops identified in the response. See MLMediaDRMGetSecureStops() for details. |
MLResult | MLMediaDRMReleaseAllSecureStops(MLHandle media_drm) Remove all the SecureStops. |
MLResult | MLMediaDRMGetPropertyString(MLHandle media_drm, MLMediaDRMProperty property_name, char ** out_property_value) Read a DRM engine plugin String property value, given the property name. |
MLResult | MLMediaDRMGetPropertyByteArray(MLHandle media_drm, MLMediaDRMProperty property_name, MLMediaDRMByteArray * out_property_value) Read a DRM engine plugin byte array property value, given the property name. |
MLResult | MLMediaDRMSetPropertyString(MLHandle media_drm, MLMediaDRMProperty property_name, const char * property_value) Set a DRM engine plugin String property value. |
MLResult | MLMediaDRMSetPropertyByteArray(MLHandle media_drm, MLMediaDRMProperty property_name, const MLMediaDRMByteArray * property_value) Set a DRM engine plugin byte array property value. |
MLResult | MLMediaDRMEncrypt(MLHandle media_drm, const MLMediaDRMByteArray session_id, const MLMediaDRMCryptoInputParam crypto_key_param, const MLMediaDRMByteArray input, MLMediaDRMByteArray out_output) Encrypt the data referenced by input using algorithm if specified, and write the encrypted result into output. |
MLResult | MLMediaDRMDecrypt(MLHandle media_drm, const MLMediaDRMByteArray session_id, const MLMediaDRMCryptoInputParam crypto_key_param, const MLMediaDRMByteArray input, MLMediaDRMByteArray out_output) Decrypt the data referenced by input using algorithm if specified, and write the encrypted result into output. |
MLResult | MLMediaDRMSign(MLHandle media_drm, const MLMediaDRMByteArray session_id, const MLMediaDRMHMACInputParam hmac_key_param, const MLMediaDRMByteArray message, MLMediaDRMByteArray out_signature) Generate a signature using the specified algorithm (if provided) over the message data and store the signature. |
MLResult | MLMediaDRMVerify(MLHandle media_drm, const MLMediaDRMByteArray session_id, const MLMediaDRMHMACInputParam hmac_key_param, const MLMediaDRMByteArray message, const MLMediaDRMByteArray signature, bool * out_match) Perform a signature verification using the specified algorithm (if specified) over the message data referenced by the message parameter. |
MLResult | MLMediaDRMSignRSA(MLHandle media_drm, const MLMediaDRMByteArray session_id, const MLMediaDRMRSAInputParam rsa_key_param, const MLMediaDRMByteArray message, MLMediaDRMByteArray out_signature) Generate a signature using the specified RSA Key and algorithm. |
Attributes
Name | |
---|---|
const typedef char * | MLMediaDRMProperty |
MLMediaDRMProperty | MLMediaDRMProperty_Vendor |
MLMediaDRMProperty | MLMediaDRMProperty_Version |
MLMediaDRMProperty | MLMediaDRMProperty_Description |
MLMediaDRMProperty | MLMediaDRMProperty_Algorithms String property name: a comma-separated list of cipher and mac algorithms supported by #CryptoSession. The list may be empty if the DRM engine plugin does not support #CryptoSession operations. |
MLMediaDRMProperty | MLMediaDRMProperty_DeviceUniqueID Byte array property name: the device unique identifier is established during device provisioning and provides a means of uniquely identifying each device. |
Enums Documentation
MLMediaDRMKeyType
Enumerator | Value | Description |
---|---|---|
MLMediaDRMKeyType_Streaming | 1 | This key request type specifies that the keys will be for online use, they will not be saved to the device for subsequent use when the device is not connected to a network. |
MLMediaDRMKeyType_Offline | 2 | This key request type specifies that the keys will be for offline use, they will be saved to the device for use when the device is not connected to a network. |
MLMediaDRMKeyType_Release | 3 | This key request type specifies that previously saved offline keys should be released. |
MLMediaDRMKeyType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Request types.
MLMediaDRMEventType
Enumerator | Value | Description |
---|---|---|
MLMediaDRMEventType_ProvisionRequired | 1 | This event type indicates that the app needs to request a certificate from the provisioning server. The request message data is obtained using MLMediaDRMGetProvisionRequest(). |
MLMediaDRMEventType_KeyRequired | 2 | This event type indicates that the app needs to request keys from a license server. The request message data is obtained using MLMediaDRMGetKeyRequest(). |
MLMediaDRMEventType_KeyExpired | 3 | This event type indicates that the licensed usage duration for keys in a session has expired. The keys are no longer valid. |
MLMediaDRMEventType_VendorDefined | 4 | This event may indicate some specific vendor-defined condition, see your DRM provider documentation for details. |
MLMediaDRMEventType_SessionReclaimed | 5 | This event indicates that a session opened by the app has been reclaimed by the resource manager. |
MLMediaDRMEventType_ExpirationUpdate | 6 | This event is issued when a session expiration update occurs, to inform the app about the change in expiration time. If MLMediaDRMEventCallbacks is setup with a valid on_expiration_update callback, then this event is not notified. |
MLMediaDRMEventType_KeysChange | 7 | This event is issued when the keys in a session change status, such as when the license is renewed or expires. If MLMediaDRMEventCallbacks is setup with a valid on_key_status_change callback, then this event is not notified. |
MLMediaDRMEventType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Request event types.
API Level:
- 7
MLMediaDRMKeyStatusCode
Enumerator | Value | Description |
---|---|---|
MLMediaDRMKeyStatusCode_KeyStatusUsable | 0 | The key is currently usable to decrypt media data. |
MLMediaDRMKeyStatusCode_KeyStatusExpired | 1 | The key is no longer usable to decrypt media data because its expiration time has passed. |
MLMediaDRMKeyStatusCode_KeyStatusOutputNotAllowed | 2 | The key is not currently usable to decrypt media data because its output requirements cannot currently be met. |
MLMediaDRMKeyStatusCode_KeyStatusPending | 3 | The status of the key is not yet known and is being determined. The status will be updated with the actual status when it has been determined. |
MLMediaDRMKeyStatusCode_KeyStatusInternalError | 4 | The key is not currently usable to decrypt media data because of an internal error in processing unrelated to input parameters. This error is not actionable by an app. |
MLMediaDRMKeyStatusCode_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Status code associated with a DRM session key.
API Level:
- 20
Types Documentation
MLMediaDRMByteArray
typedef struct MLMediaDRMByteArray MLMediaDRMByteArray;
Data type containing byte array buffer and the size.
MLMediaDRMByteArrayList
typedef struct MLMediaDRMByteArrayList MLMediaDRMByteArrayList;
Data type containing list of byte array buffers and the size.
MLMediaDRMKeyValue
typedef struct MLMediaDRMKeyValue MLMediaDRMKeyValue;
Data type containing key/value pair.
MLMediaDRMKeyValueArray
typedef struct MLMediaDRMKeyValueArray MLMediaDRMKeyValueArray;
Data type containing array of key/value pair.
MLMediaDRMKeyRequestInputParam
typedef struct MLMediaDRMKeyRequestInputParam MLMediaDRMKeyRequestInputParam;
Data type that encapsulates Key Request input arguments.
MLMediaDRMRequestMessage
typedef struct MLMediaDRMRequestMessage MLMediaDRMRequestMessage;
Data type that encapsulates either of the following along with an URL:
For Key Request Message: an opaque key request byte array that should be delivered to the license server.
For Provision Request Message: an opaque provision request byte array that should be delivered to the provisioning server.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMCryptoInputParam
typedef struct MLMediaDRMCryptoInputParam MLMediaDRMCryptoInputParam;
Data type that encapsulates algorithm, key_set_id and IV for Encryption/Decryption.
MLMediaDRMHMACInputParam
typedef struct MLMediaDRMHMACInputParam MLMediaDRMHMACInputParam;
Data type that encapsulates algorithm, key_set_id for HMAC based Sign/Verify.
MLMediaDRMRSAInputParam
typedef struct MLMediaDRMRSAInputParam MLMediaDRMRSAInputParam;
Data type that encapsulates algorithm, wrapped_key for RSA operation.
MLMediaDRMEventInfo
typedef struct MLMediaDRMEventInfo MLMediaDRMEventInfo;
MediaDRM event info associated with a session.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaDRMExpirationUpdateInfo
typedef struct MLMediaDRMExpirationUpdateInfo MLMediaDRMExpirationUpdateInfo;
MediaDRM expiration update info associated with a session.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaDRMKeyStatus
typedef struct MLMediaDRMKeyStatus MLMediaDRMKeyStatus;
MediaDRM key status.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaDRMKeyStatusInfo
typedef struct MLMediaDRMKeyStatusInfo MLMediaDRMKeyStatusInfo;
MediaDRM session keys status change info.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaDRMEventCallbacks
typedef struct MLMediaDRMEventCallbacks MLMediaDRMEventCallbacks;
Callbacks for notifying client about MLMediaDRM events.
User of MLMediaDRM should implement this.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
Functions Documentation
MLMediaDRMEventCallbacksInit
static inline void MLMediaDRMEventCallbacksInit(
MLMediaDRMEventCallbacks * inout_callbacks
)
Initializes MLMediaDRMEventCallbacks with default values.
Parameters
MLMediaDRMEventCallbacks * | inout_callbacks | MediaDRM Callback structure defined by MLMediaDRMEventCallbacks that needs to be initialized. |
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMByteArrayAllocate
MLResult MLMediaDRMByteArrayAllocate(
size_t size,
MLMediaDRMByteArray * out_array
)
Allocate byte array buffer.
Parameters
size_t | size | Maximum size of the desirable byte array to be allocated. |
MLMediaDRMByteArray * | out_array | Pointer to byte array buffer that needs to be allocated. To free/release, call MLMediaDRMByteArrayRelease(). |
Returns
MLResult | MLResult_AllocFailed | Failed because of allocation failure. |
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Byte Array is allocated successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMByteArrayAllocAndCopy
MLResult MLMediaDRMByteArrayAllocAndCopy(
const uint8_t * copy_from,
size_t size,
MLMediaDRMByteArray * out_array
)
Allocate and Copy to byte array buffer.
Parameters
const uint8_t * | copy_from | Buffer from which copy into byte array. |
size_t | size | Number of bytes to be copied. |
MLMediaDRMByteArray * | out_array | Pointer to byte array buffer that needs to be allocated and copied to. To free/release, call MLMediaDRMByteArrayRelease(). |
Returns
MLResult | MLResult_AllocFailed | Failed because of allocation failure. |
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Byte Array is allocated and copied successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMKeyValueArrayAllocate
MLResult MLMediaDRMKeyValueArrayAllocate(
size_t size,
MLMediaDRMKeyValueArray * out_array
)
Allocate array of key/value pairs.
Parameters
size_t | size | Maximum size of the desirable array of key/value pair to be allocated. |
MLMediaDRMKeyValueArray * | out_array | Pointer to array of key/value pair that needs to be allocated. To free/release, call MLMediaDRMKeyValueArrayRelease(). |
Returns
MLResult | MLResult_AllocFailed | Failed because of allocation failure. |
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Key/value pair array is allocated successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMCreate
MLResult MLMediaDRMCreate(
MLUUID uuid,
MLHandle * out_handle
)
Create a MLMediaDRM instance from a UUID.
Parameters
MLUUID | uuid | The universal unique ID of the crypto scheme. uuid must be 16 bytes. |
MLHandle * | out_handle | Upon successful return will point to handle to the created MLMediaDRM. Or else, it will point to ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_AllocFailed | MLMediaDRM object creation failed with resource allocation failure. |
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | MLMediaDRM object was created successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMRelease
MLResult MLMediaDRMRelease(
MLHandle media_drm
)
Release the MLMediaDRM instance.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | MLMediaDRM object was released successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMByteArrayRelease
MLResult MLMediaDRMByteArrayRelease(
MLMediaDRMByteArray * array
)
Release byte array buffer.
Parameters
MLMediaDRMByteArray * | array | Byte array buffer that needs to be released. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Byte Array was released successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMByteArrayListRelease
MLResult MLMediaDRMByteArrayListRelease(
MLMediaDRMByteArrayList * array
)
Release list of byte array buffer.
Parameters
MLMediaDRMByteArrayList * | array | List of byte array buffer that needs to be released. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Byte Array List was released successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMKeyValueArrayRelease
MLResult MLMediaDRMKeyValueArrayRelease(
MLMediaDRMKeyValueArray * array
)
Release key/value pair array.
Parameters
MLMediaDRMKeyValueArray * | array | Key/value pair array that needs to be released. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Key/value pair array was released successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMRequestMessageRelease
MLResult MLMediaDRMRequestMessageRelease(
MLMediaDRMRequestMessage * request
)
Release Request Message.
Parameters
MLMediaDRMRequestMessage * | request | Pointer to Request Message that needs to be released. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | DRM Request Message was released successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMKeyValueArrayAdd
MLResult MLMediaDRMKeyValueArrayAdd(
const MLMediaDRMKeyValue * pair,
MLMediaDRMKeyValueArray * out_array
)
Add a key/value pair to the array of key/value pairs.
Parameters
const MLMediaDRMKeyValue * | pair | The source key/value pair that needs to be added. |
MLMediaDRMKeyValueArray * | out_array | Pointer to array of key/value pair to which the pair needs to be added to. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | key/value pair is added successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMIsCryptoSchemeSupported
MLResult MLMediaDRMIsCryptoSchemeSupported(
MLUUID uuid,
const char * mime_type,
bool * out_supported
)
Query if the given scheme identified by its UUID is supported on this device. And whether the drm plugin is able to handle the media container format.
Parameters
MLUUID | uuid | Identifies the universal unique ID of the crypto scheme. UUID must be 16 bytes. |
const char * | mime_type | The MIME type of the media container, e.g. "video/mp4". If mime_type is not known or required, it can be provided as NULL. |
bool * | out_supported | On successful return contains true or false based on whether the given crypto scheme is supported or not. |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | The query has run successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMSetOnEventListenerEx
MLResult MLMediaDRMSetOnEventListenerEx(
MLHandle media_drm,
MLMediaDRMEventCallbacks * callbacks,
void * data
)
Register a callback to be invoked when DRM events or updates or status change occurs.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
MLMediaDRMEventCallbacks * | callbacks | Set of event callbacks. Can be set to NULL to unset the callbacks altogether. |
void * | data | Custom data to be returned when any callback is fired. |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | Event listener was set successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaDRMOpenSession
MLResult MLMediaDRMOpenSession(
MLHandle media_drm,
MLMediaDRMByteArray * out_session_id
)
Opens a new session. A session ID is returned.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
MLMediaDRMByteArray * | out_session_id | ID of the session created/opened. This byte array will be released when MLMediaDRMCloseSession() is called. |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM session was opened successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMCloseSession
MLResult MLMediaDRMCloseSession(
MLHandle media_drm,
MLMediaDRMByteArray * session_id
)
Closes a session on the MLMediaDRM object that was previously opened with openSession().
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
MLMediaDRMByteArray * | session_id | The session ID for the DRM session, which will be released on return. |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM session was closed successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMGetKeyRequest
MLResult MLMediaDRMGetKeyRequest(
MLHandle media_drm,
const MLMediaDRMByteArray * session_id,
const MLMediaDRMKeyRequestInputParam * key_request_param,
MLMediaDRMRequestMessage * out_key_request
)
A key request/response exchange occurs between the app and a license server to obtain or release keys used to decrypt encrypted content.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const MLMediaDRMByteArray * | session_id | The session ID for the DRM session. |
const MLMediaDRMKeyRequestInputParam * | key_request_param | Placeholder for needed arguments for generating a key request message. |
MLMediaDRMRequestMessage * | out_key_request | Upon successful return, contains key request message. To free/release this, call MLMediaDRMRequestMessageRelease(). |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM Key Request message is constructed successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
MLMediaDRMGetKeyRequest() is used to obtain an opaque key request byte array that is delivered to the license server. The opaque key request byte array is returned in out_key_request.request The recommended URL to deliver the key request to is returned in out_key_request.default_URL.
After the app has received the key request response from the server, it should deliver to the response to the DRM engine plugin using the method MLMediaDRMProvideKeyResponse().
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMProvideKeyResponse
MLResult MLMediaDRMProvideKeyResponse(
MLHandle media_drm,
const MLMediaDRMByteArray * session_id,
const MLMediaDRMByteArray * response,
MLMediaDRMByteArray * out_key_set_id
)
A key response is received from the license server by the app, then it is provided to the DRM engine plugin using MLMediaDRMProvideKeyResponse().
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const MLMediaDRMByteArray * | session_id | The session ID for the DRM session. |
const MLMediaDRMByteArray * | response | The opaque response from the server. |
MLMediaDRMByteArray * | out_key_set_id | Upon successful return, contains the key identifier. To free/release this buffer, call MLMediaDRMByteArrayRelease(). |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM Key Response message was consumed successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
When the response is for an offline key request, a key_set_id is returned that can be used to later restore the keys to a new session with restoreKeys(). When the response is for a streaming or release request, a null key_set_id is returned.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMRestoreKeys
MLResult MLMediaDRMRestoreKeys(
MLHandle media_drm,
const MLMediaDRMByteArray * session_id,
const MLMediaDRMByteArray * key_set_id
)
Restore persisted offline keys into a new session. key_set_id identifies the keys to load, obtained from a prior call to MLMediaDRMProvideKeyResponse().
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const MLMediaDRMByteArray * | session_id | The session ID for the DRM session. |
const MLMediaDRMByteArray * | key_set_id | The saved key set to restore. |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM Keys are restored successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMRemoveKeys
MLResult MLMediaDRMRemoveKeys(
MLHandle media_drm,
MLMediaDRMByteArray * key_set_id
)
Remove the current keys from a session.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
MLMediaDRMByteArray * | key_set_id | The keys to remove, which will be released on success. |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM Keys are removed successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMQueryKeyStatus
MLResult MLMediaDRMQueryKeyStatus(
MLHandle media_drm,
const MLMediaDRMByteArray * session_id,
MLMediaDRMKeyValueArray * out_info_map
)
Request an informative description of the key status for the session.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const MLMediaDRMByteArray * | session_id | The session ID for the DRM session. |
MLMediaDRMKeyValueArray * | out_info_map | The Key-Value pair place-holder for the key status. To release/free this call MLMediaDRMKeyValueArrayRelease(). |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | Query for MLMediaDRM Key status completed successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The status is in the form of key/value pairs. Since DRM license policies vary by vendor, the specific status field names are determined by each DRM vendor. Refer to your DRM provider documentation for definitions of the field names for a particular DRM engine plugin.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMGetProvisionRequest
MLResult MLMediaDRMGetProvisionRequest(
MLHandle media_drm,
const char * cert_type,
MLMediaDRMRequestMessage * out_provision_request
)
A provision request/response exchange occurs between the app and a provisioning server to retrieve a device certificate.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const char * | cert_type | The device certificate type, which can be "none" or "X.509". |
MLMediaDRMRequestMessage * | out_provision_request | Upon successful return, contains provision request message. To free/release this, call MLMediaDRMRequestMessageRelease(). |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | Device Provision Request message is constructed successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
If provisioning is required, the #EVENT_PROVISION_REQUIRED event will be sent to the event handler. MLMediaDRMGetProvisionRequest() is used to obtain the opaque provision request byte array that should be delivered to the provisioning server.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMProvideProvisionResponse
MLResult MLMediaDRMProvideProvisionResponse(
MLHandle media_drm,
const MLMediaDRMByteArray * response,
MLMediaDRMByteArray * out_certificate,
MLMediaDRMByteArray * out_wrapped_key
)
After a provision response is received by the app, it is provided to the DRM engine plugin using this method.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const MLMediaDRMByteArray * | response | The opaque provisioning response byte array to provide to the DRM engine plugin. |
MLMediaDRMByteArray * | out_certificate | The device certificate upon sucessful return. To release/free this call MLMediaDRMByteArrayRelease(). |
MLMediaDRMByteArray * | out_wrapped_key | The wrapped device key upon sucessful return. To release/free this call MLMediaDRMByteArrayRelease(). |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | Device Provision Response message is consumed successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMGetSecureStops
MLResult MLMediaDRMGetSecureStops(
MLHandle media_drm,
MLMediaDRMByteArrayList * out_secure_stops
)
Access all secure stops.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
MLMediaDRMByteArrayList * | out_secure_stops | List of all the secure stops upon successful return. To free/release call MLMediaDRMByteArrayListRelease(). |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM Secure stops are retrieved successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Secure Stop:
A means of enforcing limits on the number of concurrent streams per subscriber across devices is provided via #SecureStop. This is achieved by securely monitoring the lifetime of sessions.
Information from the server related to the current playback session is written to persistent storage on the device when each #MediaCrypto object is created.
In the normal case, playback will be completed, the session destroyed and the Secure Stops will be queried. The app queries secure stops and forwards the secure stop message to the server which verifies the signature and notifies the server side database that the session destruction has been confirmed.
The persisted record on the client is only removed after positive confirmation that the server received the message using releaseSecureStops().
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMGetSecureStop
MLResult MLMediaDRMGetSecureStop(
MLHandle media_drm,
const MLMediaDRMByteArray * ss_id,
MLMediaDRMByteArray * out_secure_stop
)
Access secure stop by secure stop ID.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const MLMediaDRMByteArray * | ss_id | The ID for the DRM securestop session. |
MLMediaDRMByteArray * | out_secure_stop | The secure stop upon successful return. To free/release call MLMediaDRMByteArrayRelease(). |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM Secure stop is retrieved successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
See: MLMediaDRMGetSecureStops().
MLMediaDRMReleaseSecureStops
MLResult MLMediaDRMReleaseSecureStops(
MLHandle media_drm,
const MLMediaDRMByteArray * secure_stop
)
Process the SecureStop server response message. After authenticating the message, remove the SecureStops identified in the response. See MLMediaDRMGetSecureStops() for details.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const MLMediaDRMByteArray * | secure_stop | The server response indicating which secure stops to release. |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM Secure stops are released successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMReleaseAllSecureStops
MLResult MLMediaDRMReleaseAllSecureStops(
MLHandle media_drm
)
Remove all the SecureStops.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | All secure stops for the MLMediaDRM are released successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
See: MLMediaDRMGetSecureStops().
MLMediaDRMGetPropertyString
MLResult MLMediaDRMGetPropertyString(
MLHandle media_drm,
MLMediaDRMProperty property_name,
char ** out_property_value
)
Read a DRM engine plugin String property value, given the property name.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
MLMediaDRMProperty | property_name | The property to query. Standard property names are: |
* MLMediaDRMProperty_Vendor. * MLMediaDRMProperty_Version. * MLMediaDRMProperty_Description. * MLMediaDRMProperty_Algorithms. | | char ** |out_property_value|The property value upon successful return. Ownership is passed, call free(*out_property_value) to free it.|
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM property is retrieved successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMGetPropertyByteArray
MLResult MLMediaDRMGetPropertyByteArray(
MLHandle media_drm,
MLMediaDRMProperty property_name,
MLMediaDRMByteArray * out_property_value
)
Read a DRM engine plugin byte array property value, given the property name.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
MLMediaDRMProperty | property_name | The property to query. Standard property names are: |
* MLMediaDRMProperty_DeviceUniqueID. | | MLMediaDRMByteArray * |out_property_value|The property value upon successful return. To release/free call MLMediaDRMByteArrayRelease().|
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM property is retrieved successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMSetPropertyString
MLResult MLMediaDRMSetPropertyString(
MLHandle media_drm,
MLMediaDRMProperty property_name,
const char * property_value
)
Set a DRM engine plugin String property value.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
MLMediaDRMProperty | property_name | The property to query. Standard property names are: |
* MLMediaDRMProperty_Vendor. * MLMediaDRMProperty_Version. * MLMediaDRMProperty_Description. * MLMediaDRMProperty_Algorithms. | | const char * |property_value|The value of the corresponding property.|
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM property is set successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMSetPropertyByteArray
MLResult MLMediaDRMSetPropertyByteArray(
MLHandle media_drm,
MLMediaDRMProperty property_name,
const MLMediaDRMByteArray * property_value
)
Set a DRM engine plugin byte array property value.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
MLMediaDRMProperty | property_name | The property to query. Standard property names are: |
* MLMediaDRMProperty_DeviceUniqueID. | | const MLMediaDRMByteArray * |property_value|The value of the corresponding property.|
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM property is set successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMEncrypt
MLResult MLMediaDRMEncrypt(
MLHandle media_drm,
const MLMediaDRMByteArray * session_id,
const MLMediaDRMCryptoInputParam * crypto_key_param,
const MLMediaDRMByteArray * input,
MLMediaDRMByteArray * out_output
)
Encrypt the data referenced by input using algorithm if specified, and write the encrypted result into output.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const MLMediaDRMByteArray * | session_id | The session ID for the DRM session. |
const MLMediaDRMCryptoInputParam * | crypto_key_param | Pointer to the structure that contains needed crypto arguments for encryption operation. |
const MLMediaDRMByteArray * | input | The data that needs to be encrypted. |
MLMediaDRMByteArray * | out_output | The encrypted input upon successful return. To free/release this buffer, call MLMediaDRMByteArrayRelease(). |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM encryption operation has been completed successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The key to use is identified by the 16 byte keyId. The key must have been loaded into the session using MLMediaDRMProvideKeyResponse().
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMDecrypt
MLResult MLMediaDRMDecrypt(
MLHandle media_drm,
const MLMediaDRMByteArray * session_id,
const MLMediaDRMCryptoInputParam * crypto_key_param,
const MLMediaDRMByteArray * input,
MLMediaDRMByteArray * out_output
)
Decrypt the data referenced by input using algorithm if specified, and write the encrypted result into output.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const MLMediaDRMByteArray * | session_id | The session ID for the DRM session. |
const MLMediaDRMCryptoInputParam * | crypto_key_param | Pointer to the structure that contains needed crypto arguments for decryption operation. |
const MLMediaDRMByteArray * | input | The data that needs to be decrypted. |
MLMediaDRMByteArray * | out_output | The decrypted input upon successful return. To free/release this buffer, call MLMediaDRMByteArrayRelease(). |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM decryption operation has been completed successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The key to use is identified by the 16 byte keyId. The key must have been loaded into the session using MLMediaDRMProvideKeyResponse().
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMSign
MLResult MLMediaDRMSign(
MLHandle media_drm,
const MLMediaDRMByteArray * session_id,
const MLMediaDRMHMACInputParam * hmac_key_param,
const MLMediaDRMByteArray * message,
MLMediaDRMByteArray * out_signature
)
Generate a signature using the specified algorithm (if provided) over the message data and store the signature.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const MLMediaDRMByteArray * | session_id | The session ID for the DRM session. |
const MLMediaDRMHMACInputParam * | hmac_key_param | Pointer to the structure that contains needed crypto arguments for HMAC operation. |
const MLMediaDRMByteArray * | message | The data that needs to be signed. |
MLMediaDRMByteArray * | out_signature | The signature of the input message upon success. To free/release this buffer, call MLMediaDRMByteArrayRelease(). |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM HMAC Sign operation has been completed successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The key to use is identified by the 16 byte keyId. The key must have been loaded into the session using MLMediaDRMProvideKeyResponse().
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMVerify
MLResult MLMediaDRMVerify(
MLHandle media_drm,
const MLMediaDRMByteArray * session_id,
const MLMediaDRMHMACInputParam * hmac_key_param,
const MLMediaDRMByteArray * message,
const MLMediaDRMByteArray * signature,
bool * out_match
)
Perform a signature verification using the specified algorithm (if specified) over the message data referenced by the message parameter.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const MLMediaDRMByteArray * | session_id | The session ID for the DRM session. |
const MLMediaDRMHMACInputParam * | hmac_key_param | Pointer to the structure that contains needed crypto arguments for HMAC operation. |
const MLMediaDRMByteArray * | message | The data for which signature needs to be verified. |
const MLMediaDRMByteArray * | signature | The signature of the input message. |
bool * | out_match | Pointer to bool, which would return "true" if the signature matches, "false" otherwise. |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM HMAC Verify operation has been completed successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The key must have been loaded into the session using MLMediaDRMProvideKeyResponse().
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMSignRSA
MLResult MLMediaDRMSignRSA(
MLHandle media_drm,
const MLMediaDRMByteArray * session_id,
const MLMediaDRMRSAInputParam * rsa_key_param,
const MLMediaDRMByteArray * message,
MLMediaDRMByteArray * out_signature
)
Generate a signature using the specified RSA Key and algorithm.
Parameters
MLHandle | media_drm | Handle to the MLMediaDRM. |
const MLMediaDRMByteArray * | session_id | The session ID for the DRM session. |
const MLMediaDRMRSAInputParam * | rsa_key_param | Pointer to the structure that contains needed key arguments for this RSA operation. |
const MLMediaDRMByteArray * | message | The data that needs to be signed. |
MLMediaDRMByteArray * | out_signature | The signature of the input message upon success. To free/release this buffer, call MLMediaDRMByteArrayRelease(). |
Returns
MLResult | MLResult_InvalidParam | Parameter is invalid. |
MLResult | MLResult_Ok | MLMediaDRM RSA Sign operation has been completed successfully. |
MLResult | MLResult_PermissionDenied | Necessary permission is missing. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
Attributes Documentation
MLMediaDRMProperty
const typedef char * MLMediaDRMProperty;
MLMediaDRMProperty_Vendor
MLMediaDRMProperty MLMediaDRMProperty_Vendor;
String property name: identifies the maker of the DRM engine plugin.
MLMediaDRMProperty_Version
MLMediaDRMProperty MLMediaDRMProperty_Version;
String property name: identifies the version of the DRM engine plugin.
MLMediaDRMProperty_Description
MLMediaDRMProperty MLMediaDRMProperty_Description;
String property name: describes the DRM engine plugin.
MLMediaDRMProperty_Algorithms
MLMediaDRMProperty MLMediaDRMProperty_Algorithms;
String property name: a comma-separated list of cipher and mac algorithms supported by #CryptoSession. The list may be empty if the DRM engine plugin does not support #CryptoSession operations.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDRMProperty_DeviceUniqueID
MLMediaDRMProperty MLMediaDRMProperty_DeviceUniqueID;
Byte array property name: the device unique identifier is established during device provisioning and provides a means of uniquely identifying each device.
Deprecated since 1.4.0. Scheduled for removal.
Source code
// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) 2017 Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement,
// located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying
// this distribution may also be found in the top-level NOTICE file
// appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%
#pragma once
#include "ml_api.h"
#include "ml_types.h"
ML_EXTERN_C_BEGIN
typedef const char *MLMediaDRMProperty;
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API extern MLMediaDRMProperty MLMediaDRMProperty_Vendor;
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API extern MLMediaDRMProperty MLMediaDRMProperty_Version;
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API extern MLMediaDRMProperty MLMediaDRMProperty_Description;
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API extern MLMediaDRMProperty MLMediaDRMProperty_Algorithms;
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API extern MLMediaDRMProperty MLMediaDRMProperty_DeviceUniqueID;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMByteArray {
uint8_t *ptr;
size_t length;
} MLMediaDRMByteArray;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMByteArrayList {
MLMediaDRMByteArray *ptr;
size_t length;
} MLMediaDRMByteArrayList;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMKeyValue {
const char *key;
const char *value;
} MLMediaDRMKeyValue;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMKeyValueArray {
MLMediaDRMKeyValue *ptr;
size_t length;
size_t index;
} MLMediaDRMKeyValueArray;
typedef enum MLMediaDRMKeyType {
MLMediaDRMKeyType_Streaming = 1,
MLMediaDRMKeyType_Offline = 2,
MLMediaDRMKeyType_Release = 3,
MLMediaDRMKeyType_Ensure32Bits = 0x7FFFFFFF
} MLMediaDRMKeyType;
typedef enum MLMediaDRMEventType {
MLMediaDRMEventType_ProvisionRequired = 1,
MLMediaDRMEventType_KeyRequired = 2,
MLMediaDRMEventType_KeyExpired = 3,
MLMediaDRMEventType_VendorDefined = 4,
MLMediaDRMEventType_SessionReclaimed = 5,
MLMediaDRMEventType_ExpirationUpdate = 6,
MLMediaDRMEventType_KeysChange = 7,
MLMediaDRMEventType_Ensure32Bits = 0x7FFFFFFF
} MLMediaDRMEventType;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMKeyRequestInputParam {
MLMediaDRMByteArray *init_data;
char *mime_type;
MLMediaDRMKeyType key_type;
MLMediaDRMKeyValueArray *optional_params;
} MLMediaDRMKeyRequestInputParam;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMRequestMessage {
MLMediaDRMByteArray request;
char *default_URL;
} MLMediaDRMRequestMessage;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMCryptoInputParam {
char *algorithm;
MLMediaDRMByteArray *key_set_id;
MLMediaDRMByteArray *iv;
} MLMediaDRMCryptoInputParam;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMHMACInputParam {
char *algorithm;
MLMediaDRMByteArray *key_set_id;
} MLMediaDRMHMACInputParam;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMRSAInputParam {
char *algorithm;
MLMediaDRMByteArray *wrapped_rsa_key;
} MLMediaDRMRSAInputParam;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMEventInfo {
MLMediaDRMByteArray *session_id;
MLMediaDRMEventType event_type;
int extra;
MLMediaDRMByteArray *event_data;
void *data;
} MLMediaDRMEventInfo;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMExpirationUpdateInfo {
MLMediaDRMByteArray *session_id;
uint64_t expiration_time_ms;
void *data;
} MLMediaDRMExpirationUpdateInfo;
typedef enum MLMediaDRMKeyStatusCode {
MLMediaDRMKeyStatusCode_KeyStatusUsable = 0,
MLMediaDRMKeyStatusCode_KeyStatusExpired = 1,
MLMediaDRMKeyStatusCode_KeyStatusOutputNotAllowed = 2,
MLMediaDRMKeyStatusCode_KeyStatusPending = 3,
MLMediaDRMKeyStatusCode_KeyStatusInternalError = 4,
MLMediaDRMKeyStatusCode_Ensure32Bits = 0x7FFFFFFF
} MLMediaDRMKeyStatusCode;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMKeyStatus {
MLMediaDRMByteArray key_id;
MLMediaDRMKeyStatusCode status_code;
} MLMediaDRMKeyStatus;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMKeyStatusInfo {
MLMediaDRMByteArray *session_id;
size_t key_status_count;
MLMediaDRMKeyStatus *key_status;
bool has_new_usable_key;
void *data;
} MLMediaDRMKeyStatusInfo;
typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaDRMEventCallbacks {
uint32_t version;
void (*on_event)(MLHandle media_drm, const MLMediaDRMEventInfo *event_info);
void (*on_expiration_update)(MLHandle media_drm, const MLMediaDRMExpirationUpdateInfo *update_info);
void (*on_key_status_change)(MLHandle media_drm, const MLMediaDRMKeyStatusInfo *key_status_info);
} MLMediaDRMEventCallbacks;
ML_STATIC_INLINE void MLMediaDRMEventCallbacksInit(MLMediaDRMEventCallbacks *inout_callbacks) {
if (inout_callbacks) {
inout_callbacks->version = 1;
inout_callbacks->on_event = NULL;
inout_callbacks->on_expiration_update = NULL;
inout_callbacks->on_key_status_change = NULL;
}
}
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMByteArrayAllocate(size_t size, MLMediaDRMByteArray *out_array);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMByteArrayAllocAndCopy(const uint8_t *copy_from, size_t size, MLMediaDRMByteArray *out_array);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMKeyValueArrayAllocate(size_t size, MLMediaDRMKeyValueArray *out_array);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMCreate(MLUUID uuid, MLHandle *out_handle);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMRelease(MLHandle media_drm);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMByteArrayRelease(MLMediaDRMByteArray *array);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMByteArrayListRelease(MLMediaDRMByteArrayList *array);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMKeyValueArrayRelease(MLMediaDRMKeyValueArray *array);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMRequestMessageRelease(MLMediaDRMRequestMessage *request);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMKeyValueArrayAdd(const MLMediaDRMKeyValue *pair, MLMediaDRMKeyValueArray *out_array);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMIsCryptoSchemeSupported(MLUUID uuid, const char *mime_type, bool *out_supported);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMSetOnEventListenerEx(MLHandle media_drm, MLMediaDRMEventCallbacks *callbacks, void *data);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMOpenSession(MLHandle media_drm, MLMediaDRMByteArray *out_session_id);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMCloseSession(MLHandle media_drm, MLMediaDRMByteArray *session_id);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMGetKeyRequest(MLHandle media_drm, const MLMediaDRMByteArray *session_id, const MLMediaDRMKeyRequestInputParam *key_request_param, MLMediaDRMRequestMessage *out_key_request);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMProvideKeyResponse(MLHandle media_drm, const MLMediaDRMByteArray *session_id, const MLMediaDRMByteArray *response, MLMediaDRMByteArray *out_key_set_id);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMRestoreKeys(MLHandle media_drm, const MLMediaDRMByteArray *session_id, const MLMediaDRMByteArray *key_set_id);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMRemoveKeys(MLHandle media_drm, MLMediaDRMByteArray *key_set_id);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMQueryKeyStatus(MLHandle media_drm, const MLMediaDRMByteArray *session_id, MLMediaDRMKeyValueArray *out_info_map);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMGetProvisionRequest(MLHandle media_drm, const char *cert_type, MLMediaDRMRequestMessage *out_provision_request);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMProvideProvisionResponse(MLHandle media_drm, const MLMediaDRMByteArray *response, MLMediaDRMByteArray *out_certificate, MLMediaDRMByteArray *out_wrapped_key);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMGetSecureStops(MLHandle media_drm, MLMediaDRMByteArrayList *out_secure_stops);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMGetSecureStop(MLHandle media_drm, const MLMediaDRMByteArray *ss_id, MLMediaDRMByteArray *out_secure_stop);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMReleaseSecureStops(MLHandle media_drm, const MLMediaDRMByteArray *secure_stop);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMReleaseAllSecureStops(MLHandle media_drm);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMGetPropertyString(MLHandle media_drm, MLMediaDRMProperty property_name, char **out_property_value);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMGetPropertyByteArray(MLHandle media_drm, MLMediaDRMProperty property_name, MLMediaDRMByteArray *out_property_value);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMSetPropertyString(MLHandle media_drm, MLMediaDRMProperty property_name, const char *property_value);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMSetPropertyByteArray(MLHandle media_drm, MLMediaDRMProperty property_name, const MLMediaDRMByteArray *property_value);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMEncrypt(MLHandle media_drm, const MLMediaDRMByteArray *session_id, const MLMediaDRMCryptoInputParam *crypto_key_param, const MLMediaDRMByteArray *input, MLMediaDRMByteArray *out_output);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMDecrypt(MLHandle media_drm, const MLMediaDRMByteArray *session_id, const MLMediaDRMCryptoInputParam *crypto_key_param, const MLMediaDRMByteArray *input, MLMediaDRMByteArray *out_output);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMSign(MLHandle media_drm, const MLMediaDRMByteArray *session_id, const MLMediaDRMHMACInputParam *hmac_key_param, const MLMediaDRMByteArray *message, MLMediaDRMByteArray *out_signature);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMVerify(MLHandle media_drm, const MLMediaDRMByteArray *session_id, const MLMediaDRMHMACInputParam *hmac_key_param, const MLMediaDRMByteArray *message, const MLMediaDRMByteArray *signature, bool *out_match);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaDRMSignRSA(MLHandle media_drm, const MLMediaDRMByteArray *session_id, const MLMediaDRMRSAInputParam *rsa_key_param, const MLMediaDRMByteArray *message, MLMediaDRMByteArray *out_signature);
ML_EXTERN_C_END