ml_media_crypto.h
Functions
Name | |
---|---|
MLResult | MLMediaCryptoCreate(MLUUID uuid, const MLMediaDRMByteArray data, MLHandle out_handle) Create a MLMediaCrypto instance from a UUID. |
MLResult | MLMediaCryptoRelease(MLHandle media_crypto) Release the MLMediaCrypto instance. |
MLResult | MLMediaCryptoIsCryptoSchemeSupported(MLUUID uuid, bool * out_supported) Query if the given scheme identified by its UUID is supported on this device. |
MLResult | MLMediaCryptoRequiresSecureDecoderComponent(const char mime_type, bool out_required) Query if the crypto scheme requires the use of a secure decoder to decode data of the given mime type. |
MLResult | MLMediaCryptoSetMediaDRMSession(MLHandle media_crypto, const MLMediaDRMByteArray * session_id) Associate a #MediaDRM session with this MLMediaCrypto instance. |
Functions Documentation
MLMediaCryptoCreate
MLResult MLMediaCryptoCreate(
MLUUID uuid,
const MLMediaDRMByteArray * data,
MLHandle * out_handle
)
Create a MLMediaCrypto instance from a UUID.
Parameters
MLUUID | uuid | The universal unique ID of the crypto scheme. uuid must be 16 bytes. |
const MLMediaDRMByteArray * | data | Opaque initialization data specific to the crypto scheme, This value must never be NULL. |
MLHandle * | out_handle | Upon successful return will point to handle to the created MLMediaCrypto. Or else, it will point to ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | MLMediaCrypto 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.
MLMediaCryptoRelease
MLResult MLMediaCryptoRelease(
MLHandle media_crypto
)
Release the MLMediaCrypto instance.
Parameters
MLHandle | media_crypto | MLHandle to the MLMediaCrypto. |
Returns
MLResult | MLResult_InvalidParam | MLMediaCrypto object is invalid. |
MLResult | MLResult_Ok | MLMediaCrypto object was successfully destroyed. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCryptoIsCryptoSchemeSupported
MLResult MLMediaCryptoIsCryptoSchemeSupported(
MLUUID uuid,
bool * out_supported
)
Query if the given scheme identified by its UUID is supported on this device.
Parameters
MLUUID | uuid | Identifies the universal unique ID of the crypto scheme. uuid must be 16 bytes. |
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.
MLMediaCryptoRequiresSecureDecoderComponent
MLResult MLMediaCryptoRequiresSecureDecoderComponent(
const char * mime_type,
bool * out_required
)
Query if the crypto scheme requires the use of a secure decoder to decode data of the given mime type.
Parameters
const char * | mime_type | The MIME type of the media container, e.g. "video/mp4". |
bool * | out_required | On successful return contains true or false based on whether the given mime type requires a secure decoder. |
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.
MLMediaCryptoSetMediaDRMSession
MLResult MLMediaCryptoSetMediaDRMSession(
MLHandle media_crypto,
const MLMediaDRMByteArray * session_id
)
Associate a #MediaDRM session with this MLMediaCrypto instance.
Parameters
MLHandle | media_crypto | MLHandle to the MLMediaCrypto. |
const MLMediaDRMByteArray * | session_id | Session ID for the DRM session. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Media DRM session was set successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
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_media_drm.h"
ML_EXTERN_C_BEGIN
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaCryptoCreate(MLUUID uuid, const MLMediaDRMByteArray *data, MLHandle *out_handle);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaCryptoRelease(MLHandle media_crypto);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaCryptoIsCryptoSchemeSupported(MLUUID uuid, bool *out_supported);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaCryptoRequiresSecureDecoderComponent(const char *mime_type, bool *out_required);
ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaCryptoSetMediaDRMSession(MLHandle media_crypto, const MLMediaDRMByteArray *session_id);
ML_EXTERN_C_END