Media Player
Defines Audio Channel Mask to describe the input/output posistion. Position implies, the location of a speaker or a microphone for recording or playback. More...
Classes
Name | |
---|---|
struct | MLCea608CaptionStyleColor Cea608 caption style and color. |
struct | MLCea608CaptionPAC Cea608 caption preamble address code. |
struct | MLCea608CaptionLineEx Cea608 caption line structure. |
struct | MLCea608CaptionSegmentEx Cea608 caption segment structure. |
struct | MLCea708CaptionColor Cea708 Caption Color. |
struct | MLCea708CaptionPenAttr Cea708 Caption Pen Attributes. |
struct | MLCea708CaptionPenColor Cea708 Caption Pen Color. |
struct | MLCea708CaptionPenLocation Cea708 Caption Pen Location. |
struct | MLCea708CaptionWindowAttr Cea708 Caption Window Attributes. |
struct | MLCea708CaptionWindow Cea708 Caption Window. |
struct | MLCea708CaptionEvent Cea708 Caption Event. |
struct | MLMediaCodecBufferInfo |
struct | MLMediaCodecInputBufferInfo MediaCodec Input buffer information. |
struct | MLMediaCodecOutputBufferInfo MediaCodec Output buffer information. |
struct | MLMediaCodecOutputFormatInfo MediaCodec Output Format information. |
struct | MLMediaCodecErrorInfo MediaCodec Output Format information. |
struct | MLMediaCodecCallbacksEx Callbacks for notifying asynchronously of various codec events to the user/client. If user intends to use codec in asynchronous mode, then the user/client is expected to implement these callbacks and take proper actions where appropriate. |
struct | MLMediaCodecFrameRenderedInfo MediaCodec Output Frame Rendered information. |
struct | MLMediaCodecOutputFrameListener Callbacks for notifying when an output frame is available for consumption or has been rendered on the output surface. |
struct | MLMediaCodecCryptoPattern Metadata describing an encryption pattern for the protected bytes in a subsample. |
struct | MLMediaCodecCryptoInfo Metadata describing the structure of a (at least partially) encrypted input sample. A buffer's data is considered to be partitioned into "subSamples", each subSample starts with a (potentially empty) run of plain, unencrypted bytes followed by a (also potentially empty) run of encrypted bytes. If pattern encryption applies, each of the encrypted runs is encrypted only partly, according to a repeating pattern of "encrypt" and "skip" blocks. This information encapsulates per-sample metadata as outlined in ISO/IEC FDIS 23001-7:2011 "Common encryption in ISO base media file format files". |
struct | MLMediaCodecListQueryResults |
struct | MLMediaCodecListProfileLevel Used to store the list of codec profile levels. |
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. |
struct | MLMediaExtractorDRMSchemeInitData |
struct | MLMediaFormatByteArray |
struct | MLMediaPlayerTrackDRMInfo MediaPlayer DRM Info for a Media Track . |
struct | MLMediaPlayerSubtitleData |
struct | MLMediaPlayerBufferingSettings |
struct | MLMediaPlayerOnBufferingUpdateInfo MediaPlayer Buffering update callback Info. |
struct | MLMediaPlayerOnCompletionInfo MediaPlayer Playback completion callback Info. |
struct | MLMediaPlayerOnErrorInfo MediaPlayer Error callback Info. |
struct | MLMediaPlayerOnInfoInfo MediaPlayer Information callback Info. |
struct | MLMediaPlayerOnPreparedInfo MediaPlayer Playback prepared callback Info. |
struct | MLMediaPlayerOnSeekCompleteInfo MediaPlayer Playback seek completion callback Info. |
struct | MLMediaPlayerOnVideoSizeChangedInfo MediaPlayer Video Size Changed callback Info. |
struct | MLMediaPlayerOnTrackDRMInfo MediaPlayer Track DRM Info callback Info. |
struct | MLMediaPlayerOnResetCompleteInfo MediaPlayer reset completion callback Info. |
struct | MLMediaPlayerOnFramePackingInfo MediaPlayer frame packing callback Info. |
struct | MLMediaPlayerEventCallbacksEx Callbacks for notifying client about Media Player error events. |
struct | MLMediaPlayerTrackInfo MediaPlayer Track Information. |
struct | MLMediaPlayerTrackDRMSessionInfo DRM Session information for a MediaPlayer Track. |
struct | MLMediaPlayerMetrics MediaPlayer metrics data. |
struct | MLTTMLImage Byte data for TTML image cues. |
struct | MLTTMLData TTML data structure. |
struct | MLPSSHEntry PSSH entry. |
struct | MLWebVTTData WebVTT data structure. |
struct | MLNativeSurfaceFrameAvailableInfo NativeSurface/NativeSurfaceTexture Output Frame Availability information. |
struct | MLNativeSurfaceConfig Configuration values for creating the Native Surface. |
struct | MLNativeSurfaceOnFrameAvailableCallback Callbacks for notifying when an output frame is available for consumption. |
Types
Name | |
---|---|
typedef struct MLCea608CaptionStyleColor | MLCea608CaptionStyleColor Cea608 caption style and color. |
typedef struct MLCea608CaptionPAC | MLCea608CaptionPAC Cea608 caption preamble address code. |
typedef struct MLCea608CaptionLineEx | MLCea608CaptionLineEx Cea608 caption line structure. |
typedef struct MLCea608CaptionSegmentEx | MLCea608CaptionSegmentEx Cea608 caption segment structure. |
typedef void()(MLHandle cc_handle, const MLCea608CaptionSegmentEx cc_seg, void *data) | MLMediaCCParserDisplayChangedCallback Callback signature called when Cea608 displayable is changed. |
typedef struct MLCea708CaptionColor | MLCea708CaptionColor Cea708 Caption Color. |
typedef struct MLCea708CaptionPenAttr | MLCea708CaptionPenAttr Cea708 Caption Pen Attributes. |
typedef struct MLCea708CaptionPenColor | MLCea708CaptionPenColor Cea708 Caption Pen Color. |
typedef struct MLCea708CaptionPenLocation | MLCea708CaptionPenLocation Cea708 Caption Pen Location. |
typedef struct MLCea708CaptionWindowAttr | MLCea708CaptionWindowAttr Cea708 Caption Window Attributes. |
typedef struct MLCea708CaptionWindow | MLCea708CaptionWindow Cea708 Caption Window. |
typedef struct MLCea708CaptionEvent | MLCea708CaptionEvent Cea708 Caption Event. |
typedef void()(MLHandle cc_handle, const MLCea708CaptionEvent event, void *data) | MLMediaCea708ParserEmitEventCallback Callback signature called when Cea708 parser emits event. |
typedef struct MLMediaCodecBufferInfo | MLMediaCodecBufferInfo |
typedef struct MLMediaCodecInputBufferInfo | MLMediaCodecInputBufferInfo MediaCodec Input buffer information. |
typedef struct MLMediaCodecOutputBufferInfo | MLMediaCodecOutputBufferInfo MediaCodec Output buffer information. |
typedef struct MLMediaCodecOutputFormatInfo | MLMediaCodecOutputFormatInfo MediaCodec Output Format information. |
typedef struct MLMediaCodecErrorInfo | MLMediaCodecErrorInfo MediaCodec Output Format information. |
typedef struct MLMediaCodecCallbacksEx | MLMediaCodecCallbacksEx Callbacks for notifying asynchronously of various codec events to the user/client. If user intends to use codec in asynchronous mode, then the user/client is expected to implement these callbacks and take proper actions where appropriate. |
typedef struct MLMediaCodecFrameRenderedInfo | MLMediaCodecFrameRenderedInfo MediaCodec Output Frame Rendered information. |
typedef struct MLMediaCodecOutputFrameListener | MLMediaCodecOutputFrameListener Callbacks for notifying when an output frame is available for consumption or has been rendered on the output surface. |
typedef struct MLMediaCodecCryptoPattern | MLMediaCodecCryptoPattern Metadata describing an encryption pattern for the protected bytes in a subsample. |
typedef struct MLMediaCodecCryptoInfo | MLMediaCodecCryptoInfo Metadata describing the structure of a (at least partially) encrypted input sample. A buffer's data is considered to be partitioned into "subSamples", each subSample starts with a (potentially empty) run of plain, unencrypted bytes followed by a (also potentially empty) run of encrypted bytes. If pattern encryption applies, each of the encrypted runs is encrypted only partly, according to a repeating pattern of "encrypt" and "skip" blocks. This information encapsulates per-sample metadata as outlined in ISO/IEC FDIS 23001-7:2011 "Common encryption in ISO base media file format files". |
typedef struct MLMediaCodecListQueryResults | MLMediaCodecListQueryResults |
typedef struct MLMediaCodecListProfileLevel | MLMediaCodecListProfileLevel Used to store the list of codec profile levels. |
typedef int64_t()(MLHandle media_data_source, size_t position, size_t size, uint8_t buffer, void *context) | MLMediaDataSourceReadAt Called to request data from the given position. |
typedef int64_t()(MLHandle media_data_source, void context) | MLMediaDataSourceGetSize Called to get the size of the data source. |
typedef void()(MLHandle media_data_source, void context) | MLMediaDataSourceClose Called before deleting |
typedef struct MLMediaDRMByteArray | MLMediaDRMByteArray |
typedef struct MLMediaDRMByteArrayList | MLMediaDRMByteArrayList |
typedef struct MLMediaDRMKeyValue | MLMediaDRMKeyValue |
typedef struct MLMediaDRMKeyValueArray | MLMediaDRMKeyValueArray |
typedef struct MLMediaDRMKeyRequestInputParam | MLMediaDRMKeyRequestInputParam |
typedef struct MLMediaDRMRequestMessage | MLMediaDRMRequestMessage Data type that encapsulates either of the following along with an URL: |
typedef struct MLMediaDRMCryptoInputParam | MLMediaDRMCryptoInputParam |
typedef struct MLMediaDRMHMACInputParam | MLMediaDRMHMACInputParam |
typedef struct MLMediaDRMRSAInputParam | MLMediaDRMRSAInputParam |
typedef struct MLMediaDRMEventInfo | MLMediaDRMEventInfo MediaDRM event info associated with a session. |
typedef struct MLMediaDRMExpirationUpdateInfo | MLMediaDRMExpirationUpdateInfo MediaDRM expiration update info associated with a session. |
typedef struct MLMediaDRMKeyStatus | MLMediaDRMKeyStatus MediaDRM key status. |
typedef struct MLMediaDRMKeyStatusInfo | MLMediaDRMKeyStatusInfo MediaDRM session keys status change info. |
typedef struct MLMediaDRMEventCallbacks | MLMediaDRMEventCallbacks Callbacks for notifying client about MLMediaDRM events. |
typedef MLPSSHEntry | MLMediaExtractorPSSHEntry |
typedef struct MLMediaExtractorDRMSchemeInitData | MLMediaExtractorDRMSchemeInitData |
typedef struct MLMediaFormatByteArray | MLMediaFormatByteArray |
typedef MLPSSHEntry | MLMediaPlayerPSSHEntry |
typedef struct MLMediaPlayerTrackDRMInfo | MLMediaPlayerTrackDRMInfo MediaPlayer DRM Info for a Media Track . |
typedef struct MLMediaPlayerSubtitleData | MLMediaPlayerSubtitleData |
typedef struct MLMediaPlayerBufferingSettings | MLMediaPlayerBufferingSettings |
typedef struct MLMediaPlayerOnBufferingUpdateInfo | MLMediaPlayerOnBufferingUpdateInfo MediaPlayer Buffering update callback Info. |
typedef struct MLMediaPlayerOnCompletionInfo | MLMediaPlayerOnCompletionInfo MediaPlayer Playback completion callback Info. |
typedef struct MLMediaPlayerOnErrorInfo | MLMediaPlayerOnErrorInfo MediaPlayer Error callback Info. |
typedef struct MLMediaPlayerOnInfoInfo | MLMediaPlayerOnInfoInfo MediaPlayer Information callback Info. |
typedef struct MLMediaPlayerOnPreparedInfo | MLMediaPlayerOnPreparedInfo MediaPlayer Playback prepared callback Info. |
typedef struct MLMediaPlayerOnSeekCompleteInfo | MLMediaPlayerOnSeekCompleteInfo MediaPlayer Playback seek completion callback Info. |
typedef struct MLMediaPlayerOnVideoSizeChangedInfo | MLMediaPlayerOnVideoSizeChangedInfo MediaPlayer Video Size Changed callback Info. |
typedef struct MLMediaPlayerOnTrackDRMInfo | MLMediaPlayerOnTrackDRMInfo MediaPlayer Track DRM Info callback Info. |
typedef struct MLMediaPlayerOnResetCompleteInfo | MLMediaPlayerOnResetCompleteInfo MediaPlayer reset completion callback Info. |
typedef struct MLMediaPlayerOnFramePackingInfo | MLMediaPlayerOnFramePackingInfo MediaPlayer frame packing callback Info. |
typedef struct MLMediaPlayerEventCallbacksEx | MLMediaPlayerEventCallbacksEx Callbacks for notifying client about Media Player error events. |
typedef struct MLMediaPlayerTrackInfo | MLMediaPlayerTrackInfo MediaPlayer Track Information. |
typedef struct MLMediaPlayerTrackDRMSessionInfo | MLMediaPlayerTrackDRMSessionInfo DRM Session information for a MediaPlayer Track. |
typedef void()(MLHandle media_player, MLMediaPlayerSubtitleData subtitle_data, void data) | MLMediaPlayerOnMediaSubtitleUpdateCallback Callbacks signature called when subtitle update is available. |
typedef void()(MLHandle media_player, MLHandle timed_text, void data) | MLMediaPlayerOnMediaTimedTextUpdateCallback Callbacks signature called when Timed Text update is available. |
typedef struct MLMediaPlayerMetrics | MLMediaPlayerMetrics MediaPlayer metrics data. |
typedef void()(MLHandle media_stream_source, void context) | MLMediaStreamSourceOnBufferAvailable Called when buffers becomes available. |
typedef struct MLTTMLImage | MLTTMLImage Byte data for TTML image cues. |
typedef struct MLTTMLData | MLTTMLData TTML data structure. |
typedef struct MLPSSHEntry | MLPSSHEntry PSSH entry. |
typedef struct MLWebVTTData | MLWebVTTData WebVTT data structure. |
typedef struct MLNativeSurfaceFrameAvailableInfo | MLNativeSurfaceFrameAvailableInfo NativeSurface/NativeSurfaceTexture Output Frame Availability information. |
typedef struct MLNativeSurfaceConfig | MLNativeSurfaceConfig Configuration values for creating the Native Surface. |
typedef struct MLNativeSurfaceOnFrameAvailableCallback | MLNativeSurfaceOnFrameAvailableCallback Callbacks for notifying when an output frame is available for consumption. |
Enums
Functions
Name | |
---|---|
MLResult | MLMediaCCParserCreate(MLHandle * out_handle) Create internal closed caption parser object. |
MLResult | MLMediaCCParserGetDisplayableEx(MLHandle cc_handle, const uint8_t * subtitle_data, int32_t subtitle_data_size, const MLCea608CaptionSegmentEx ** out_cc_seg) Return closed caption for display. |
MLResult | MLMediaCCParserDestroy(MLHandle cc_handle) Release internal CC parser object. |
MLResult | MLMediaCCParserSetDisplayChangedCallback(MLHandle cc_handle, MLMediaCCParserDisplayChangedCallback on_display_changed_callback, void * data) Set callback to get notified when a caption displayable has changed. |
MLResult | MLMediaCCParserParse(MLHandle cc_handle, const uint8_t * subtitle_data, uint32_t subtitle_data_size) Provide Cea608 parser with subtitle raw data for parsing. If the callback has been set by MLMediaCCParserSetDisplayChangedCallback, then its issued to notify the CC Data. |
MLResult | MLMediaCea708ParserCreate(MLHandle * out_handle) Create Cea708 parser object. |
MLResult | MLMediaCea708ParserParse(MLHandle cc_handle, const uint8_t * subtitle_data, uint32_t subtitle_data_size) Provide Cea708 parser with subtitle raw data for parsing. |
MLResult | MLMediaCea708ParserDestroy(MLHandle cc_handle) Release Cea708 parser object. |
MLResult | MLMediaCea708ParserSetEmitEventCallback(MLHandle cc_handle, MLMediaCea708ParserEmitEventCallback on_emit_event_callback, void * data) Set callback to get notified when a caption event has generated. |
void | MLMediaCodecCallbacksExInit(MLMediaCodecCallbacksEx * inout_callbacks) Initializes MLMediaCodecCallbacksEx with default values. |
void | MLMediaCodecOutputFrameListenerInit(MLMediaCodecOutputFrameListener * inout_callbacks) Initializes MLMediaCodecOutputFrameListener with default values. |
void | MLMediaCodecCryptoInfoInit(MLMediaCodecCryptoInfo * inout_crypto_info) Initializes MLMediaCodecCryptoInfo with default values. |
MLResult | MLMediaCodecCreateCryptoInfo(const MLMediaCodecCryptoInfo crypto_info, MLHandle out_crypto_info_handle) Create a Crypto Info object. |
MLResult | MLMediaCodecReleaseCryptoInfo(MLHandle crypto_info_handle) Release the Crypto Info created by MLMediaCodecCreateCryptoInfo. |
MLResult | MLMediaCodecCreateCodec(MLMediaCodecCreation method, MLMediaCodecType type, const char name_str, MLHandle out_handle) Create a new MLMediaCodec. |
MLResult | MLMediaCodecDestroy(MLHandle handle) Destroy a MLMediaCodec. |
MLResult | MLMediaCodecSetCallbacksEx(MLHandle handle, MLMediaCodecCallbacksEx callbacks, void user_data) Set callbacks to notify client codec events. Client needs to implement the callback functions. |
MLResult | MLMediaCodecSetOutputFrameListener(MLHandle handle, MLMediaCodecOutputFrameListener callbacks, void user_data) Registers a callback to be invoked when an output frame is available or rendered on the output surface. |
MLResult | MLMediaCodecGetName(MLHandle handle, char * out_name) Obtain the name of the created codec. |
MLResult | MLMediaCodecConfigure(MLHandle handle, MLHandle format_handle, MLHandle surface_handle, MLHandle crypto_handle) Configure the MLMediaCodec. |
MLResult | MLMediaCodecStart(MLHandle handle) Start the codec. |
MLResult | MLMediaCodecStop(MLHandle handle) Stop the codec. |
MLResult | MLMediaCodecReset(MLHandle handle) Reset the codec. |
MLResult | MLMediaCodecFlush(MLHandle handle) Flush the both the input and output ports of the codec. |
MLResult | MLMediaCodecSetParameters(MLHandle handle, MLHandle format_handle) Communicate additional parameter changes to a codec. |
MLResult | MLMediaCodecGetInputBufferPointer(MLHandle handle, int64_t buffer_index, uint8_t * out_buffer_ptr, size_t out_buffer_size) Obtain a writable buffer pointer for a dequeued input buffer index to contain the input data. |
MLResult | MLMediaCodecGetOutputBufferPointer(MLHandle handle, int64_t buffer_index, const uint8_t * out_buffer_ptr, size_t out_buffer_size) Obtain a read-only buffer pointer for a dequeued output buffer index. |
MLResult | MLMediaCodecQueueInputBuffer(MLHandle handle, int64_t buffer_index, int64_t offset, size_t size, uint64_t time_us, int flags) After filling a range of the input buffer at the specified index submit it to the component. |
MLResult | MLMediaCodecQueueSecureInputBuffer(MLHandle handle, int64_t buffer_index, int64_t offset, MLHandle crypto_info_handle, uint64_t time_us, int flags) Similar to queueInputBuffer but submits a buffer that is potentially encrypted. |
MLResult | MLMediaCodecDequeueInputBuffer(MLHandle handle, int64_t timeout_us, int64_t * out_buffer_index) Dequeue an input buffer from buffer queue. |
MLResult | MLMediaCodecDequeueOutputBuffer(MLHandle handle, MLMediaCodecBufferInfo out_buffer_info, int64_t timeout_us, int64_t out_buffer_index) Dequeue an output buffer from buffer queue. |
MLResult | MLMediaCodecGetInputFormat(MLHandle handle, MLHandle * out_format_handle) Obtain input format supported by the codec. |
MLResult | MLMediaCodecGetOutputFormat(MLHandle handle, MLHandle * out_format_handle) Return output format supported by the codec, or the format to which the configuration has changed. |
MLResult | MLMediaCodecCreateInputSurface(MLHandle handle, MLHandle * out_input_surface_handle) Create an input surface for a hardware encoder. |
MLResult | MLMediaCodecDestroyInputSurface(MLHandle handle, MLHandle input_surface_handle) Release the Surface that was created by MLMediaCodecCreateInputSurface. |
MLResult | MLMediaCodecSignalEndOfInputStream(MLHandle handle) Signal end-of-stream on input to a surface. |
MLResult | MLMediaCodecReleaseOutputBuffer(MLHandle handle, int64_t buffer_index, bool render) Release buffer to codec or to render it on output surface. |
MLResult | MLMediaCodecReleaseOutputBufferAtTime(MLHandle handle, int64_t buffer_index, int64_t timestamp_ns) Update surface timestamp and returns it to the codec to render it on the output surface. If codec is not configured with output surface, this call simply returns the buffer to codec. |
MLResult | MLMediaCodecListCountCodecs(uint64_t * out_codec_count) Obtain the number of available codecs. |
MLResult | MLMediaCodecListIsSoftwareCodec(const char codec_name, bool out_val) Determine whether a codec is a software codec. |
MLResult | MLMediaCodecListGetMatchingCodecs(const char mime, bool is_encoder, MLMediaCodecListCodecTypeFlag flag, MLMediaCodecListQueryResults out_matching_codecs) Obtain a list of matching codecs for a given codec mime. |
MLResult | MLMediaCodecListGetCodecByType(const char type, bool is_encoder, uint64_t start_index, int64_t out_index) Obtain the codec matching the given codec type from the codec list. |
MLResult | MLMediaCodecListGetCodecByName(const char name, int64_t out_index) Obtain the codec from the codec matching the given codec name from the codec list. |
MLResult | MLMediaCodecListIsEncoder(uint64_t index, bool * out_val) Confirm whether a component is an Encoder or Decoder. |
MLResult | MLMediaCodecListGetCodecName(uint64_t index, char * out_name) Obtain a codec name. |
MLResult | MLMediaCodecListGetSupportedMimes(uint64_t index, MLMediaCodecListQueryResults * out_supported_mimes) Obtain the list of mime types supported by a codec. |
MLResult | MLMediaCodecListGetCapabilityFlag(uint64_t index, const char mime, MLMediaCodecListCapabilityFlag out_capability_flag) Obtain the capability flag for a codec. |
MLResult | MLMediaCodecListGetSecureCodecName(const char mime, bool is_decoder, char out_name) Obtain the name of a secure codec for the given mime type. |
MLResult | MLMediaCodecListQueryResultsRelease(MLMediaCodecListQueryResults * query_results) Release the query results. |
MLResult | MLMediaCodecListGetSupportedProfileLevels(uint64_t index, const char mime, MLMediaCodecListProfileLevel ** out_profile_levels, size_t out_profile_levels_size) Obtain the supported profile levels for a codec. |
MLResult | MLMediaCodecListProfileLevelsRelease(MLMediaCodecListProfileLevel * profile_levels) Release profile levels. |
MLResult | MLMediaCodecListGetSupportedColorFormats(uint64_t index, const char mime, uint32_t ** out_color_formats, size_t out_color_formats_size) Obtain the supported color formats for a codec. All the supported color formats are defined by MLMediaCodecColorFormat. |
MLResult | MLMediaCodecListColorFormatsRelease(uint32_t * color_formats) Release color formats. |
MLResult | MLMediaCodecListGetSupportedBitrateModes(uint64_t index, const char mime, MLMediaCodecBitrateMode ** out_bitrate_modes, size_t out_bitrate_modes_size) Obtain the supported bitrate modes for a codec. |
MLResult | MLMediaCodecBitrateModesRelease(MLMediaCodecBitrateMode * bitrate_modes) Release Bitrate modes. |
MLResult | MLMediaCodecListIsAdaptivePlaybackSupported(uint64_t index, const char mime, bool out_supported) Check whether Adaptive playback is supported. |
MLResult | MLMediaCodecListIsSecurePlaybackSupported(uint64_t index, const char mime, bool out_supported) Check whether Secure playback is supported. |
MLResult | MLMediaCodecListIsIntraRefreshSupported(uint64_t index, const char mime, bool out_supported) Check whether Intra Refresh is supported. |
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. |
MLResult | MLMediaDataSourceCreate(MLMediaDataSourceReadAt read_at, MLMediaDataSourceGetSize get_size, MLMediaDataSourceClose close, void context, MLHandle out_handle) Create a new MediaDataSource object. |
MLResult | MLMediaDataSourceDestroy(MLHandle media_data_source) Destroy a #MediaDataSource object. |
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. |
MLResult | MLMediaExtractorCreate(MLHandle * out_handle) Create a new MLMediaExtractor. |
MLResult | MLMediaExtractorDestroy(MLHandle handle) Destroy a MLMediaExtractor. |
MLResult | MLMediaExtractorSetDataSourceForPath(MLHandle handle, const char * path) Set a local file path as the data source. |
MLResult | MLMediaExtractorSetDataSourceForURI(MLHandle handle, const char * uri) Set a URI string as the data source. |
MLResult | MLMediaExtractorSetDataSourceForURIWithHeaders(MLHandle handle, const char * uri, const char ** headers, size_t len) Set a URI string as the data source. |
MLResult | MLMediaExtractorSetDataSourceForFD(MLHandle handle, int fd, int64_t offset, int64_t length) Set the data source as the file-descriptor to use. |
MLResult | MLMediaExtractorSetMediaDataSource(MLHandle handle, MLHandle media_data_source) Sets the data source as user defined media data source. |
MLResult | MLMediaExtractorGetDRMInitData(MLHandle handle, MLUUID drm_uuid, MLMediaExtractorDRMSchemeInitData * out_drm_init_data) Extract DRM initialization data for a given DRM Scheme if it exists. |
MLResult | MLMediaExtractorReleaseDRMInitData(MLHandle handle, MLMediaExtractorDRMSchemeInitData * drm_init_data) Release DRM initialization data which was previously retrieved. |
MLResult | MLMediaExtractorGetTrackCount(MLHandle handle, uint64_t * out_track_count) Count the number of tracks found in the data source. |
MLResult | MLMediaExtractorGetTrackFormat(MLHandle handle, size_t index, MLHandle * out_track_handle) Get the track format at the specified index. |
MLResult | MLMediaExtractorSelectTrack(MLHandle handle, size_t index) Select a track for the subsequent operations. |
MLResult | MLMediaExtractorUnselectTrack(MLHandle handle, size_t index) Unselect a track for the subsequent operations. |
MLResult | MLMediaExtractorSeekTo(MLHandle handle, int64_t time_us, MLMediaSeekMode mode) All selected tracks seek near the requested time according to the specified mode. |
MLResult | MLMediaExtractorAdvance(MLHandle handle) Advance to the next sample. |
MLResult | MLMediaExtractorReadSampleData(MLHandle handle, uint8_t byte_buf, size_t buf_size, size_t offset, int64_t out_data_size) Retrieve the current encoded sample and store it in the byte buffer starting at the given offset. |
MLResult | MLMediaExtractorGetSampleTrackIndex(MLHandle handle, int64_t * out_track_index) Return the track index the current sample originates from. |
MLResult | MLMediaExtractorGetSampleTime(MLHandle handle, int64_t * out_sample_time) Return the current sample's presentation time in microseconds. |
MLResult | MLMediaExtractorGetSampleFlags(MLHandle handle, int * out_sample_flags) Return the current sample's flags. |
MLResult | MLMediaExtractorGetSampleCryptoInfo(MLHandle handle, MLHandle * out_info_handle) Return the current sample's Crypto info if has encrypted sample. |
MLResult | MLMediaExtractorReleaseCryptoInfo(MLHandle handle, MLHandle * inout_info_handle) Release the Crypto Info. |
MLResult | MLMediaExtractorGetCachedDuration(MLHandle handle, int64_t * out_cached_duration) Return an estimate of how much data is presently cached in memoryexpressed in microseconds. |
MLResult | MLMediaExtractorHasCacheReachedEOS(MLHandle handle) Return true if we are caching data and the cache has reached the end of the data stream (for now, a future seek may of course restart the fetching of data). |
MLResult | MLMediaExtractorGetPSSHInfoCount(MLHandle handle, size_t * out_index) Get the Number of PSSH info if present. |
MLResult | MLMediaExtractorGetPSSHInfo(MLHandle handle, size_t index, MLMediaExtractorPSSHEntry * out_pssh_entry) Get the PSSH info if present. The PSSH(Protection System Specific Header) contains a UUID representing a DRM scheme along with opaque data blob used for creating crypto session, which in turn used to configure codec. |
MLResult | MLMediaExtractorReleasePSSHInfo(MLHandle handle, MLMediaExtractorPSSHEntry * pssh_entry) Clear the PSSH info data. |
MLResult | MLMediaFormatCreateVideo(const char mime_type, int width, int height, MLHandle out_handle) Create a video format object. |
MLResult | MLMediaFormatCreateAudio(const char mime_type, int sample_rate, int channel_count, MLHandle out_handle) Create a audio format object. |
MLResult | MLMediaFormatCreateSubtitle(const char mime_type, const char language, MLHandle * out_handle) Create a subtitle format object. |
MLResult | MLMediaFormatCreate(MLHandle * out_handle) Create an empty format object. |
MLResult | MLMediaFormatCreateCopy(MLHandle handle, MLHandle * out_handle) Create a copy of the format handle provided. |
MLResult | MLMediaFormatDestroy(MLHandle handle) Destroy a MLMediaFormat object. |
MLResult | MLMediaFormatObjectToString(MLHandle handle, char * out_string) Obtain the human readable representation of the format. |
MLResult | MLMediaFormatGetKeyValueInt32(MLHandle handle, MLMediaFormatKey name, int32_t * out_key) Obtain the value of an integer key. |
MLResult | MLMediaFormatGetKeyValueInt64(MLHandle handle, MLMediaFormatKey name, int64_t * out_key) Obtain the value of a long key. |
MLResult | MLMediaFormatGetKeyValueFloat(MLHandle handle, MLMediaFormatKey name, float * out_key) Obtain the value of an float key. |
MLResult | MLMediaFormatGetKeySize(MLHandle handle, MLMediaFormatKey name, size_t * out_size) Obtain the size of a key. |
MLResult | MLMediaFormatGetKeyString(MLHandle handle, MLMediaFormatKey name, char * out_string) Obtain the value of a string key. |
MLResult | MLMediaFormatGetKeyByteBuffer(MLHandle handle, MLMediaFormatKey name, MLMediaFormatByteArray * out_buffer) Obtain the value of a ByteBuffer key. |
MLResult | MLMediaFormatKeyByteBufferRelease(MLHandle handle, MLMediaFormatByteArray * buffer) Release the ByteBuffer acquired by MLMediaFormatGetKeyByteBuffer. |
MLResult | MLMediaFormatSetKeyInt32(MLHandle handle, MLMediaFormatKey name, int32_t key_value) Set the value of an integer key. |
MLResult | MLMediaFormatSetKeyInt64(MLHandle handle, MLMediaFormatKey name, int64_t key_value) Set the value of a long key. |
MLResult | MLMediaFormatSetKeyFloat(MLHandle handle, MLMediaFormatKey name, float key_value) Set the value of a float key. |
MLResult | MLMediaFormatSetKeySize(MLHandle handle, MLMediaFormatKey name, size_t key_size) Set the size of a key. |
MLResult | MLMediaFormatSetKeyString(MLHandle handle, MLMediaFormatKey name, const char * key_value) Set the value of a string key. |
MLResult | MLMediaFormatSetKeyByteBuffer(MLHandle handle, MLMediaFormatKey name, const MLMediaFormatByteArray * buffer) Set the value of a ByteBuffer key. |
void | MLMediaPlayerEventCallbacksExInit(MLMediaPlayerEventCallbacksEx * inout_callbacks) Initializes MediaPlayerEventCallbacks with default values. |
void | MLMediaPlayerTrackInfoInit(MLMediaPlayerTrackInfo * inout_track_info) Initializes Media Track Information with default values. |
void | MLMediaPlayerTrackDRMSessionInfoInit(MLMediaPlayerTrackDRMSessionInfo * inout_drm_session_info) Initializes Media Track DRM Session Information with defult values. |
MLResult | MLMediaPlayerCreate(MLHandle * out_handle) Create a new Media Player object. |
MLResult | MLMediaPlayerDestroy(MLHandle media_player) Destroys a MediaPlayer object. |
MLResult | MLMediaPlayerSetDataSourceForFD(MLHandle media_player, int32_t fd) Sets a file descriptor as the data source. |
MLResult | MLMediaPlayerSetOffsetDataSourceForFD(MLHandle media_player, int32_t fd, int64_t offset, int64_t length) Sets a file descriptor as the data source with offset. |
MLResult | MLMediaPlayerSetDataSourceForPath(MLHandle media_player, const char * path) Sets a local file path as the data source. |
MLResult | MLMediaPlayerSetDataSourceForURI(MLHandle media_player, const char * uri) Sets a URI string as the data source. |
MLResult | MLMediaPlayerSetRemoteDataSourceForURI(MLHandle media_player, const char * uri, char ** headers, size_t len) Sets a URI string as the remote data source. |
MLResult | MLMediaPlayerSetMediaDataSource(MLHandle media_player, MLHandle media_data_source) Sets the data source to use. |
MLResult | MLMediaPlayerSetMediaStreamSource(MLHandle media_player, MLHandle media_stream_source) Sets the data source to use. |
MLResult | MLMediaPlayerAddTimedTextSourceForURI(MLHandle media_player, const char uri, const char mime_type) Adds a TimedText source from a URI. |
MLResult | MLMediaPlayerAddTimedTextSourceForFD(MLHandle media_player, int32_t fd, int64_t offset, int64_t length, const char * mime_type) Adds a TimedText source from a file descriptor. |
MLResult | MLMediaPlayerSetNextPlayer(MLHandle media_player, MLHandle next_media_player) Sets the 'next' Media Player to automatically 'start' when current Media Player playback completes. |
MLResult | MLMediaPlayerGetTrackCount(MLHandle media_player, uint32_t * out_track_count) Counts the number of tracks found in the data source. |
MLResult | MLMediaPlayerGetTrackType(MLHandle media_player, uint32_t track, MLMediaPlayerTrackType * out_track_type) Gets the type of a track. |
MLResult | MLMediaPlayerGetTrackLanguage(MLHandle media_player, uint32_t track, char ** out_track_language) Gets the language of a track. |
MLResult | MLMediaPlayerGetTrackMediaFormat(MLHandle media_player, uint32_t track, MLHandle * out_media_format) Gets the Media Format of a track. |
MLResult | MLMediaPlayerSelectTrack(MLHandle media_player, uint32_t track) Selects a track. |
MLResult | MLMediaPlayerUnselectTrack(MLHandle media_player, uint32_t track) Unselects a track. |
MLResult | MLMediaPlayerPrepare(MLHandle media_player) Prepares the player for playback, synchronously. |
MLResult | MLMediaPlayerPrepareAsync(MLHandle media_player) Prepares the player for playback, asynchronously. |
MLResult | MLMediaPlayerStart(MLHandle media_player) Starts or resumes playback. |
MLResult | MLMediaPlayerStop(MLHandle media_player) Stops playback after playback has been started or paused. |
MLResult | MLMediaPlayerPause(MLHandle media_player) Pauses playback. |
MLResult | MLMediaPlayerReset(MLHandle media_player) Resets the Media Player to its uninitialized state. |
MLResult | MLMediaPlayerSeekTo(MLHandle media_player, int msec, MLMediaSeekMode mode) Seeks to specified time position. |
MLResult | MLMediaPlayerSetEventCallbacksEx(MLHandle media_player, const MLMediaPlayerEventCallbacksEx callbacks, void data) Sets callbacks to notify clients about player events. |
MLResult | MLMediaPlayerGetVideoSize(MLHandle media_player, int32_t out_width, int32_t out_height) Returns the size of the video frame. |
MLResult | MLMediaPlayerGetCurrentPosition(MLHandle media_player, int32_t * out_msec) Returns current position of playback. |
MLResult | MLMediaPlayerGetDuration(MLHandle media_player, int32_t * out_msec) Returns media duration. |
MLResult | MLMediaPlayerGetBufferingUpdate(MLHandle media_player, int32_t * out_percentage) Returns current buffering percentage. |
MLResult | MLMediaPlayerGetInfo(MLHandle media_player, int32_t out_code, int32_t out_extra) Returns last info received by internal Media Player. |
MLResult | MLMediaPlayerGetError(MLHandle media_player, MLResult * out_result) Returns last error received by internal Media Player. |
MLResult | MLMediaPlayerGetTimedText(MLHandle media_player, const char * out_text, int32_t out_start, int32_t * out_end) Returns last timed text event information. |
MLResult | MLMediaPlayerGetSubtitleEx(MLHandle media_player, MLMediaPlayerSubtitleData ** out_subtitle_data) Returns last subtitle event information. |
MLResult | MLMediaPlayerReleaseSubtitleEx(MLHandle media_player) Releases last subtitle event information. |
MLResult | MLMediaPlayerSetOnMediaSubtitleUpdateCallback(MLHandle media_player, MLMediaPlayerOnMediaSubtitleUpdateCallback on_media_subtitle_callback, void * data) Sets callback to get notified when a subtitle update is available along with its data. |
MLResult | MLMediaPlayerGetMetadata(MLHandle media_player, int64_t out_time, int32_t out_size, uint8_t ** out_buffer) Returns last metadata event information. |
MLResult | MLMediaPlayerSetVideoScalingMode(MLHandle media_player, MLMediaPlayerVideoScalingMode mode) Sets video scaling mode. |
MLResult | MLMediaPlayerSetLooping(MLHandle media_player, bool loop) Sets the looping mode of the player. |
MLResult | MLMediaPlayerSetVolume(MLHandle media_player, float volume) Sets the volume on this player. |
MLResult | MLMediaPlayerGetAudioHandle(MLHandle media_player, MLHandle * out_handle) Gets the handle of the audio stream. |
MLResult | MLMediaPlayerPollStates(MLHandle media_player, uint16_t mask, uint16_t * out_polled_states) Polls the desired states from internal Media Player. |
MLResult | MLMediaPlayerGetTrackDRMInfo(MLHandle media_player, const MLMediaPlayerTrackInfo * track_info, MLMediaPlayerTrackDRMInfo ** out_drm_info) Gets the DRM info of the selected media (either audio or video) track. |
MLResult | MLMediaPlayerPrepareTrackDRM(MLHandle media_player, const MLMediaPlayerTrackDRMSessionInfo * drm_session_info) Prepares DRM for the selected media (either audio or video) track. |
MLResult | MLMediaPlayerReleaseDRM(MLHandle media_player) Releases DRM. |
MLResult | MLMediaPlayerGetDefaultBufferingSettings(MLHandle media_player, MLMediaPlayerBufferingSettings * out_buf_settings) Gets default Buffering settings. |
MLResult | MLMediaPlayerGetBufferingSettings(MLHandle media_player, MLMediaPlayerBufferingSettings * out_buf_settings) Gets current Buffering settings. |
MLResult | MLMediaPlayerSetBufferingSettings(MLHandle media_player, MLMediaPlayerBufferingSettings buf_settings) Sets buffering settings. |
MLResult | MLMediaPlayerSetOnMediaTimedTextUpdateCallback(MLHandle media_player, MLMediaPlayerOnMediaTimedTextUpdateCallback on_media_timed_text_callback, void * data) Set callback to get invoked when a Timed Text update is available along with its data. |
MLResult | MLMediaPlayerGetWebVTTData(MLHandle media_player, MLHandle timed_text, MLWebVTTData ** out_webvtt_data) Gets WebVTT data represented by a timed text handle. |
MLResult | MLMediaPlayerGetTTMLData(MLHandle media_player, MLHandle timed_text, MLTTMLData ** out_ttml_data) Gets TTML data represented by a timed text handle. |
MLResult | MLMediaPlayerResetAsync(MLHandle media_player) Resets the Media Player to its uninitialized state asynchronously. |
MLResult | MLMediaPlayerGetMetrics(MLHandle media_player, MLMediaPlayerMetrics * out_metrics) Retrieves metrics recorded on the MediaPlayer. |
MLResult | MLMediaPlayerSetSurface(MLHandle media_player, MLHandle surface) Sets the Native surface to be used as the sink for displaying the video portion of the media. |
MLResult | MLMediaStreamSourceCreate(MLMediaStreamSourceOnBufferAvailable on_buffer_available, void context, MLHandle out_handle) Create a new MediaStreamSource object. |
MLResult | MLMediaStreamSourceDestroy(MLHandle media_stream_source) Destroy a MediaStreamSource object. |
MLResult | MLMediaStreamSourceGetBuffer(MLHandle media_stream_source, size_t out_id, uint8_t ** out_ptr, size_t out_size) Get a buffer where data can be written. |
MLResult | MLMediaStreamSourcePushBuffer(MLHandle media_stream_source, size_t id, size_t size) Push a buffer. |
MLResult | MLMediaStreamSourcePushEOS(MLHandle media_stream_source) Push End-Of-Stream event. |
void | MLNativeSurfaceConfigInit(MLNativeSurfaceConfig * inout_config_values) Initializes MLNativeSurfaceConfig with default values. |
void | MLNativeSurfaceOnFrameAvailableCallbackInit(MLNativeSurfaceOnFrameAvailableCallback * inout_callbacks) Initializes MLNativeSurfaceOnFrameAvailableCallback with default values. |
MLResult | MLNativeSurfaceCreate(const MLNativeSurfaceConfig config_values, MLHandle out_handle) Create a new NativeSurface. |
MLResult | MLNativeSurfaceRelease(MLHandle handle) Release a NativeSurface. |
MLResult | MLNativeSurfaceGetNativeWindow(MLHandle handle, MLHandle out_native_window, int32_t out_format) Gets an implementation of NativeWindow that feeds graphic buffers into MLNativeSurface. |
MLResult | MLNativeSurfaceReleaseNativeWindow(MLHandle handle, MLHandle native_window) Releases NativeWindow previously acquired by MLNativeSurfaceGetNativeWindow. |
MLResult | MLNativeSurfaceAcquireNextAvailableFrame(MLHandle handle, MLHandle * out_native_buffer) Consume next available buffer. |
MLResult | MLNativeSurfaceAcquireHardwareBufferFromNativeBuffer(MLHandle handle, MLHandle native_buffer, struct AHardwareBuffer * out_hardware_buffer, uint32_t out_width, uint32_t * out_height) Acquire an AHardwareBuffer* from a native buffer handle. |
MLResult | MLNativeSurfaceReleaseFrame(MLHandle handle, MLHandle native_buffer) Release a native buffer previously acquired. |
MLResult | MLNativeSurfaceGetFrameTransformationMatrix(MLHandle handle, float out_mtx[16]) Retrieves the 4x4 texture coordinate transform matrix associated with the last acquired Frame. |
MLResult | MLNativeSurfaceGetFrameTimestamp(MLHandle handle, int64_t * out_timestamp_ns) Retrieves the timestamp associated with the last acquired frame. The timestamp is in nanoseconds, and is monotonically increasing from beginning of the playback. Its other semantics (zero point, etc) are codec-dependent and should be documented by the codec vendor. |
MLResult | MLNativeSurfaceGetFrameQueueBufferTimestamp(MLHandle handle, int64_t * out_timestamp_ns) Retrieves the QueueBuffer timestamp associated with the last acquired Frame This timestamp is for profiling purposes only and corresponds to the time when this frame was queued by internal Codec's producer code. The timestamp is in nanoseconds, and is monotonically increasing from beginning of playback. Its other semantics (zero point, etc) are codec-dependent and should by documented by the codec vendor. |
MLResult | MLNativeSurfaceGetFrameNumber(MLHandle handle, uint64_t * out_number) Retrieves the last acquired frame number. The frame number is an incrementing counter set to 0 at Codec configuration time. |
MLResult | MLNativeSurfaceGetFrameCropRect(MLHandle handle, MLRecti * out_crop_rect) Retrieves the cropping rectangle of the current frame/buffer. |
MLResult | MLNativeSurfaceSetOnFrameAvailableCallback(MLHandle handle, const MLNativeSurfaceOnFrameAvailableCallback callback, void user_data) Set callback to notify client when a frame is available. |
MLResult | MLNativeSurfaceTextureCreate(const MLNativeSurfaceConfig config_values, MLNativeSurfaceTextureBackend backend, MLHandle out_handle) Create a new NativeSurfaceTexture. |
MLResult | MLNativeSurfaceTextureRelease(MLHandle handle) Release a NativeSurfaceTexture. |
MLResult | MLNativeSurfaceTextureUpdateTexImage(MLHandle handle) Update the texture image to the most recent frame from the image stream. |
MLResult | MLNativeSurfaceTextureAttachToGLContext(MLHandle handle, uint32_t texture_id) Attach the NativeSurfaceTexture to the graphic context that is current on the calling thread. |
MLResult | MLNativeSurfaceTextureDetachFromGLContext(MLHandle handle) Detach the NativeSurfaceTexture from the graphic context that owns the graphic texture object. |
MLResult | MLNativeSurfaceTextureGetTransformationMatrix(MLHandle handle, float out_matrix[16]) Retrieve the 4x4 texture coordinate transform matrix associated with the texture image set by the most recent call to MLNativeSurfaceTextureUpdateTexImage. |
MLResult | MLNativeSurfaceTextureGetTimestamp(MLHandle handle, int64_t * out_timestamp_ns) Retrieve the timestamp associated with the texture image set by the most recent call to MLNativeSurfaceTextureUpdateTexImage. |
MLResult | MLNativeSurfaceTextureSetOnFrameAvailableCallback(MLHandle handle, const MLNativeSurfaceOnFrameAvailableCallback callback, void user_data) Set callback to notify client when a frame is available. |
Attributes
Name | |
---|---|
const typedef char * | MLMediaDRMProperty |
const typedef char * | MLMediaFormatKey |
const int32_t | MLAudioChannelOutMono |
const int32_t | MLAudioChannelOutStereo |
const int32_t | MLAudioChannelOutQuad |
const int32_t | MLAudioChannelOutSurround |
const int32_t | MLAudioChannelOut5Point1 |
const int32_t | MLAudioChannelOut7Point1 |
const int32_t | MLAudioChannelOut7Point1Surround |
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. |
MLMediaFormatKey | MLMediaFormat_Key_AAC_Encoded_Target_Level The format of media data (video/audio) is specified as key/value pairs. Below is a list of keys used to set/obtain format values. |
MLMediaFormatKey | MLMediaFormat_Key_AAC_DRC_Boost_Factor A key describing the boost factor allowing to adapt the dynamics of the output to the actual listening requirements. This relies on DRC gain sequences that can be transmitted in the encoded bitstream to be able to reduce the dynamics of the output signal upon request. This factor enables the user to select how much of the gains are applied. |
MLMediaFormatKey | MLMediaFormat_Key_AAC_DRC_Attenuation_Factor A key describing the attenuation factor allowing to adapt the dynamics of the output to the actual listening requirements. |
MLMediaFormatKey | MLMediaFormat_Key_AAC_DRC_Heavy_Compression A key describing the selection of the heavy compression profile for DRC. |
MLMediaFormatKey | MLMediaFormat_Key_AAC_DRC_Target_Reference_Level A key describing a gain to be applied so that the output loudness matches the Target Reference Level. This is typically used to normalize loudness across program items. |
MLMediaFormatKey | MLMediaFormat_Key_AAC_Max_Output_Channel_Count A key describing the maximum number of channels that can be output by the AAC decoder. |
MLMediaFormatKey | MLMediaFormat_Key_AAC_Profile A key describing the AAC profile to be used (AAC audio formats only). |
MLMediaFormatKey | MLMediaFormat_Key_AAC_SBR_Mode A key describing the AAC SBR mode to be used (AAC audio formats only). |
MLMediaFormatKey | MLMediaFormat_Key_Bit_Rate A key describing the average bitrate in bits/sec. |
MLMediaFormatKey | MLMediaFormat_Key_Bit_Rate_Mode A key describing the desired bitrate mode to be used by an encoder. |
MLMediaFormatKey | MLMediaFormat_Key_Capture_Rate A key describing the capture rate of a video format in frames/sec. |
MLMediaFormatKey | MLMediaFormat_Key_Channel_Count A key describing the number of channels in an audio format. |
MLMediaFormatKey | MLMediaFormat_Key_Channel_Mask A key describing the channel composition of audio content. |
MLMediaFormatKey | MLMediaFormat_Key_Color_Format A key describing the color format of the content in a video format. |
MLMediaFormatKey | MLMediaFormat_Key_Duration A key describing the duration (in microseconds) of the content. |
MLMediaFormatKey | MLMediaFormat_Key_FLAC_Compression_Level A key describing the FLAC compression level to be used (FLAC audio format only). |
MLMediaFormatKey | MLMediaFormat_Key_Frame_Rate A key describing the frame rate of a video format in frames/sec. |
MLMediaFormatKey | MLMediaFormat_Key_Height A key describing the height of the content in a video format. |
MLMediaFormatKey | MLMediaFormat_Key_I_Frame_Interval A key describing the frequency of key frames expressed in seconds between key frames. |
MLMediaFormatKey | MLMediaFormat_Key_Intra_Refresh_Period An optional key describing the period of intra refresh in frames. |
MLMediaFormatKey | MLMediaFormat_Key_Is_ADTS A key mapping to a value of 1 if the content is AAC audio and audio frames are prefixed with an ADTS header. |
MLMediaFormatKey | MLMediaFormat_Key_Is_Autoselect A key for boolean AUTOSELECT behavior for the track. Tracks with AUTOSELECT=true are considered when automatically selecting a track without specific user choice, based on the current locale. This is currently only used for subtitle tracks, when the user selected 'Default' for the captioning locale. The associated value is an integer, where non-0 means TRUE. This is an optional field; if not specified, AUTOSELECT defaults to TRUE. |
MLMediaFormatKey | MLMediaFormat_Key_Is_Default A key for boolean DEFAULT behavior for the track. The track with DEFAULT=true is selected in the absence of a specific user choice. |
MLMediaFormatKey | MLMediaFormat_Key_Is_Forced_Subtitle A key for the FORCED field for subtitle tracks. |
MLMediaFormatKey | MLMediaFormat_Key_Language A key describing the language of the content, using either ISO 639-1 or 639-2/T codes. |
MLMediaFormatKey | MLMediaFormat_Key_Max_Height A key describing the maximum expected height of the content in a video decoder format, in case there are resolution changes in the video content. |
MLMediaFormatKey | MLMediaFormat_Key_Max_Input_Size Described by this MediaFormat. |
MLMediaFormatKey | MLMediaFormat_Key_Max_Width A key describing the maximum expected width of the content in a video decoder format, in case there are resolution changes in the video content. |
MLMediaFormatKey | MLMediaFormat_Key_Mime A key describing the mime type of the MediaFormat. |
MLMediaFormatKey | MLMediaFormat_Key_PCM_Encoding A key describing the raw audio sample encoding/format. |
MLMediaFormatKey | MLMediaFormat_Key_Push_Blank_Buffers_On_Stop If specified when configuring a video decoder rendering to a surface, causes the decoder to output "blank", i.e. black frames to the surface. |
MLMediaFormatKey | MLMediaFormat_Key_Repeat_Previous_Frame_After Applies only when configuring a video encoder in "surface-input" mode. |
MLMediaFormatKey | MLMediaFormat_Key_Sample_Rate A key describing the sample rate of an audio format. |
MLMediaFormatKey | MLMediaFormat_Key_Stride A key describing the stride of the video bytebuffer layout. |
MLMediaFormatKey | MLMediaFormat_Key_Temporal_Layering A key describing the temporal layering schema. |
MLMediaFormatKey | MLMediaFormat_Key_Width A key describing the width of the content in a video format. |
MLMediaFormatKey | MLMediaFormat_Key_Crop_Left The left-coordinate (x) of the crop rectangle. |
MLMediaFormatKey | MLMediaFormat_Key_Crop_Right The right-coordinate (x) MINUS 1 of the crop rectangle. |
MLMediaFormatKey | MLMediaFormat_Key_Crop_Bottom The bottom-coordinate (y) MINUS 1 of the crop rectangle. |
MLMediaFormatKey | MLMediaFormat_Key_Crop_Top The top-coordinate (y) of the crop rectangle. |
MLMediaFormatKey | MLMediaFormat_Key_Operating_Rate A key describing the desired operating frame rate for video or sample rate for audio that the codec will need to operate at. |
MLMediaFormatKey | MLMediaFormat_Key_Latency An optional key describing the desired encoder latency in frames. |
MLMediaFormatKey | MLMediaFormat_Key_Parameter_Video_Bitrate A key describing the desired video bitrate. |
MLMediaFormatKey | MLMediaFormat_Key_Parameter_Request_Sync_Frame Request that the encoder produce a sync frame "soon". |
MLMediaFormatKey | MLMediaFormat_Key_Parameter_Set_Suspend Temporarily suspend/resume encoding of input data. |
MLMediaFormatKey | MLMediaFormat_Key_Parameter_Set_Suspend_Time When PARAMETER_KEY_SUSPEND is present, the client can also optionally use this key to specify the timestamp (in micro-second) at which the suspend/resume operation takes effect. |
MLMediaFormatKey | MLMediaFormat_Key_Parameter_Drop_Before A key describing the desired before which frames are to be skipped. |
MLMediaFormatKey | MLMediaFormat_Key_Parameter_Drop_After A key describing the desired after which frames are to be skipped. |
MLMediaFormatKey | MLMediaFormat_Key_Parameter_Offset_Time Specify an offset (in micro-second) to be added on top of the timestamps onward. |
MLMediaFormatKey | MLMediaFormat_Key_Priority A key describing the desired codec priority. |
MLMediaFormatKey | MLMediaFormat_Key_Max_B_Frames A key describing the maximum number of B frames between I or P frames, to be used by a video encoder. |
MLMediaFormatKey | MLMediaFormat_Key_Intra_Refresh_Mode An optional key describing the mode of intra refresh in frames. The associated value is an integer. |
MLMediaFormatKey | MLMediaFormat_Key_Intra_Refresh_CIR_Num Number of consecutive macroblocks to be coded as intra when CIR is enabled. |
MLMediaFormatKey | MLMediaFormat_Key_Intra_Refresh_AIR_Num Number of intra macroblocks to refresh in a frame when AIR is enabled. |
MLMediaFormatKey | MLMediaFormat_Key_Intra_Refresh_AIR_Ref Number of times a motion marked macroblock has to be intra coded. |
MLMediaFormatKey | MLMediaFormat_Key_Profile A key describing the desired profile to be used by an encoder. |
MLMediaFormatKey | MLMediaFormat_Key_Level A key describing the desired level to be used by an encoder. |
MLMediaFormatKey | MLMediaFormat_Key_Prepend_Header_To_Sync_Frames An optional key describing whether encoders prepend headers to sync frames (e.g. SPS and PPS to IDR frames for H.264). |
MLMediaFormatKey | MLMediaFormat_Key_Color_Range An optional key describing the range of the component values of the video content. |
MLMediaFormatKey | MLMediaFormat_Key_Color_Standard An optional key describing the color primaries, white point and luminance factors for video content. |
MLMediaFormatKey | MLMediaFormat_Key_Color_Transfer An optional key describing the opto-electronic transfer function used for the video content. |
MLMediaFormatKey | MLMediaFormat_Key_HDR_Static_Info An optional key describing the static metadata of HDR (high-dynamic-range) video content. |
MLMediaFormatKey | MLMediaFormat_Key_CSD A key describing the codec specific data. |
MLMediaFormatKey | MLMediaFormat_Key_CSD0 A key describing the codec specific data buffer #0. |
MLMediaFormatKey | MLMediaFormat_Key_CSD1 A key describing the codec specific data buffer #1. |
MLMediaFormatKey | MLMediaFormat_Key_CSD2 A key describing the codec specific data buffer #2. |
MLMediaFormatKey | MLMediaFormat_Key_CSD_Avc A key describing the codec specific data buffer for AVC (h.264). |
MLMediaFormatKey | MLMediaFormat_Key_CSD_Hevc A key describing the codec specific data buffer for HEVC (h.265). |
MLMediaFormatKey | MLMediaFormat_Key_Album A key describing metadata - album title of the media. |
MLMediaFormatKey | MLMediaFormat_Key_Albumart A key describing metadata. The artwork for the album of the media's original source as a Bitmap. |
MLMediaFormatKey | MLMediaFormat_Key_Albumartist A key describing metadata. The artist for the album of the media's original source. |
MLMediaFormatKey | MLMediaFormat_Key_Artist A key describing metadata. The artist of the media. |
MLMediaFormatKey | MLMediaFormat_Key_Audio_Presentation_Info A key describing metadata. The media presentation info. |
MLMediaFormatKey | MLMediaFormat_Key_Audio_Presentation_Presentation_Id A key describing metadata. The media presentation Id. |
MLMediaFormatKey | MLMediaFormat_Key_Audio_Presentation_Program_Id A key describing metadata. The media program Id. |
MLMediaFormatKey | MLMediaFormat_Key_Audio_Session_Id A key describing the audio session ID of the AudioTrack associated to a tunneled video codec. |
MLMediaFormatKey | MLMediaFormat_Key_Author A key describing metadata. The author of the media. |
MLMediaFormatKey | MLMediaFormat_Key_Bits_Per_Sample Key representing media number of bits per sample. |
MLMediaFormatKey | MLMediaFormat_Key_Cdtracknumber A key describing metadata. The cd track number. |
MLMediaFormatKey | MLMediaFormat_Key_Compilation A key describing metadata. The media compilation. |
MLMediaFormatKey | MLMediaFormat_Key_Complexity A key describing the encoding complexity. |
MLMediaFormatKey | MLMediaFormat_Key_Composer A key describing metadata - composer of the media. |
MLMediaFormatKey | MLMediaFormat_Key_Create_Input_Surface_Suspended If specified when configuring a video encoder that's in "surface-input" mode, it will instruct the encoder to put the surface source in suspended state when it's connected. |
MLMediaFormatKey | MLMediaFormat_Key_Crypto_Default_Iv_Size |
MLMediaFormatKey | MLMediaFormat_Key_Crypto_Encrypted_Byte_Block |
MLMediaFormatKey | MLMediaFormat_Key_Crypto_Encrypted_Sizes |
MLMediaFormatKey | MLMediaFormat_Key_Crypto_Iv |
MLMediaFormatKey | MLMediaFormat_Key_Crypto_Key |
MLMediaFormatKey | MLMediaFormat_Key_Crypto_Mode |
MLMediaFormatKey | MLMediaFormat_Key_Crypto_Plain_Sizes |
MLMediaFormatKey | MLMediaFormat_Key_Crypto_Skip_Byte_Block |
MLMediaFormatKey | MLMediaFormat_Key_D263 |
MLMediaFormatKey | MLMediaFormat_Key_Date A key describing metadata - The date the media was created or published. The format is unspecified but RFC 3339 is recommended. |
MLMediaFormatKey | MLMediaFormat_Key_Discnumber A key describing metadata. The disc number for the media's original source. |
MLMediaFormatKey | MLMediaFormat_Key_Display_Crop A key describing display crop rectangle. |
MLMediaFormatKey | MLMediaFormat_Key_Display_Height |
MLMediaFormatKey | MLMediaFormat_Key_Display_Width |
MLMediaFormatKey | MLMediaFormat_Key_Encoder_Delay A key describing the number of frames to trim from the start of the decoded audio stream. |
MLMediaFormatKey | MLMediaFormat_Key_Encoder_Padding A key describing the number of frames to trim from the end of the decoded audio stream. |
MLMediaFormatKey | MLMediaFormat_Key_Esds A key describing the electrostatic discharge and soldering (ESDS). |
MLMediaFormatKey | MLMediaFormat_Key_Exif_Offset |
MLMediaFormatKey | MLMediaFormat_Key_Exif_Size |
MLMediaFormatKey | MLMediaFormat_Key_Frame_Count |
MLMediaFormatKey | MLMediaFormat_Key_Genre A key describing metadata. The media genre. |
MLMediaFormatKey | MLMediaFormat_Key_Grid_Columns A key describing the number of grid columns in the content in a MIMETYPE_IMAGE_ANDROID_HEIC track. |
MLMediaFormatKey | MLMediaFormat_Key_Grid_Rows A key describing the number of grid rows in the content in a MIMETYPE_IMAGE_ANDROID_HEIC track. |
MLMediaFormatKey | MLMediaFormat_Key_Haptic_Channel_Count A key describing the number of haptic channels in an audio format. |
MLMediaFormatKey | MLMediaFormat_Key_Hdr10_Plus_Info An optional key describing the HDR10+ metadata of the video content. |
MLMediaFormatKey | MLMediaFormat_Key_Icc_Profile |
MLMediaFormatKey | MLMediaFormat_Key_Is_Sync_Frame |
MLMediaFormatKey | MLMediaFormat_Key_Location A key describing metadata. The media location. |
MLMediaFormatKey | MLMediaFormat_Key_Loop A key describing metadata. The media loop. |
MLMediaFormatKey | MLMediaFormat_Key_Lyricist A key describing metadata. The media lyricist. |
MLMediaFormatKey | MLMediaFormat_Key_Manufacturer A key describing metadata. The media manufacturer. |
MLMediaFormatKey | MLMediaFormat_Key_Max_Bit_Rate A key describing the max bitrate in bits/sec. |
MLMediaFormatKey | MLMediaFormat_Key_Max_Fps_To_Encoder Instruct the video encoder in "surface-input" mode to drop excessive frames from the source, so that the input frame rate to the encoder does not exceed the specified fps. |
MLMediaFormatKey | MLMediaFormat_Key_Max_Pts_Gap_To_Encoder Instruct the video encoder in "surface-input" mode to limit the gap of timestamp between any two adjacent frames fed to the encoder to the specified amount (in micro-second). |
MLMediaFormatKey | MLMediaFormat_Key_Mpeg_User_Data |
MLMediaFormatKey | MLMediaFormat_Key_Mpeg2_Stream_Header |
MLMediaFormatKey | MLMediaFormat_Key_PCM_Big_Endian |
MLMediaFormatKey | MLMediaFormat_Key_Pssh |
MLMediaFormatKey | MLMediaFormat_Key_Rotation A key describing the desired clockwise rotation on an output surface. |
MLMediaFormatKey | MLMediaFormat_Key_Sar_Height |
MLMediaFormatKey | MLMediaFormat_Key_Sar_Width |
MLMediaFormatKey | MLMediaFormat_Key_Sei |
MLMediaFormatKey | MLMediaFormat_Key_Slice_Height A key describing the plane height of a multi-planar (YUV) video bytebuffer layout. |
MLMediaFormatKey | MLMediaFormat_Key_Target_Time |
MLMediaFormatKey | MLMediaFormat_Key_Temporal_Layer_Count |
MLMediaFormatKey | MLMediaFormat_Key_Temporal_Layer_Id |
MLMediaFormatKey | MLMediaFormat_Key_Text_Format_Data |
MLMediaFormatKey | MLMediaFormat_Key_Thumbnail_CSD_Hevc |
MLMediaFormatKey | MLMediaFormat_Key_Thumbnail_Height |
MLMediaFormatKey | MLMediaFormat_Key_Thumbnail_Time |
MLMediaFormatKey | MLMediaFormat_Key_Thumbnail_Width |
MLMediaFormatKey | MLMediaFormat_Key_Tile_Height A key describing the height (in pixels) of each tile of the content in a MIMETYPE_IMAGE_ANDROID_HEIC track. The associated value is an integer. |
MLMediaFormatKey | MLMediaFormat_Key_Tile_Width A key describing the width (in pixels) of each tile of the content in a MIMETYPE_IMAGE_ANDROID_HEIC track. The associated value is an integer. |
MLMediaFormatKey | MLMediaFormat_Key_Time_Us |
MLMediaFormatKey | MLMediaFormat_Key_Title A key describing metadata. The title of the media. |
MLMediaFormatKey | MLMediaFormat_Key_Track_Id A key describing a unique ID for the content of a media track. |
MLMediaFormatKey | MLMediaFormat_Key_Track_Index |
MLMediaFormatKey | MLMediaFormat_Key_Valid_Samples |
MLMediaFormatKey | MLMediaFormat_Key_Year A key describing metadata. The year the media was created or published as a long. |
MLMediaFormatKey | MLMediaFormat_Key_AAC_DRC_Effect_Type A key describing for selecting the DRC effect type for MPEG-D DRC. |
MLMediaFormatKey | MLMediaFormat_Key_Quality A key describing the desired encoding quality. |
MLMediaFormatKey | MLMediaFormat_Key_Output_Reorder_Depth An optional key describing the maximum number of non-display-order coded frames. |
MLMediaFormatKey | MLMediaFormat_Key_Is_Timed_Text |
MLMediaFormatKey | MLMediaFormat_Key_Ca_System_Id A key describing the system id of the conditional access system used to scramble a media track. |
MLMediaFormatKey | MLMediaFormat_Key_Ca_Session_Id A key describing the MediaCas.Session object associated with a media track. |
MLMediaFormatKey | MLMediaFormat_Key_Ca_Private_Data A key describing the private data in the CA_descriptor associated with a media track. |
MLMediaFormatKey | MLMediaFormatKey_Feature A key prefix used together with a MLMediaCodecBitrateMode feature name describing a required or optional feature for a codec capabilities query. |
const float | MLTTMLDimen_Unset An unset position, width or size which is negative of maximum finite value of float (-FLT_MAX). |
size_t | size |
uint8_t * | data |
int64_t | start_time_ms |
int64_t | end_time_ms |
char * | text |
MLTTMLLayoutAlignment | text_alignment |
MLTTMLImage | bitmap |
float | line The position of the line_anchor of the cue box within the viewport in the direction orthogonal to the writing direction, or MLTTMLDimen_Unset. |
MLTTMLLineType | line_type The cue line type. |
MLTTMLAnchorType | line_anchor |
float | position The fractional position of the position_anchor of the cue box within the viewport in the direction orthogonal to line, or MLTTMLDimen_Unset. |
MLTTMLAnchorType | position_anchor |
float | size |
float | bitmap_height |
bool | window_color_set |
uint32_t | window_color |
MLTTMLTextSizeType | text_size_type |
float | text_size |
int64_t | start_time_ms |
int64_t | end_time_ms |
char * | body |
char * | id |
bool | snap_to_lines |
MLWebVTTOrientation | orientation |
MLWebVTTDirection | direction |
float | relative_line_position |
int32_t | line_number |
float | text_position |
float | size |
MLWebVTTAlign | align |
Defines
Name | |
---|---|
MAX_CODEC_NAME_SIZE | |
MAX_CODEC_NAME_LENGTH | |
MAX_FORMAT_STRING_SIZE | |
MAX_KEY_STRING_SIZE |
Detailed Description
Defines Audio Channel Mask to describe the input/output posistion. Position implies, the location of a speaker or a microphone for recording or playback.
APIs for creaitng native surface (or surface texture) that works with graphics.
Data Structure for WebVTT Timed Text.
Data Structure for TTML Timed Text.
APIs for accessing streaming media from memory.
APIs for high level management of media playback.
APIs for creating and retrieving media format information.
APIs for to extracting elementary track from media container.
APIs for MediaDRM to obtain the content keys for decrypting protected media streams, in conjunction with ml_mediacrypto.
APIs for defining an user implemented DataSource that acts as media track source.
APIs for creaitng crypto session for setting up encrypted media playback.
APIs for retrieving all supported encoders and decoders.
APIs for encoding and decoding audio and video buffers.
APIs for CEA708 Closed Captions Parser.
APIs for CEA608 Closed Captions Parser.
Stringify the error codes returned by these APIs, call MLMediaResultGetString.
Stringify the error codes returned by these APIs, call MLMediaResultGetString.
Stringify the error codes returned by these APIs, call MLMediaResultGetString.
Stringify the error codes returned by these APIs, call MLMediaResultGetString.
Stringify the error codes returned by these APIs, call MLMediaResultGetString.
Stringify the error codes returned by these APIs, call MLMediaResultGetString.
Stringify the error codes returned by these APIs, call MLMediaResultGetString.
Stringify the error codes returned by these APIs, call MLMediaResultGetString.
Stringify the error codes returned by these APIs, call MLMediaResultGetString.
Stringify the error codes returned by these APIs, call MLMediaResultGetString.
Stringify the error codes returned by these APIs, call MLMediaResultGetString.
Stringify the error codes returned by these APIs, call MLMediaResultGetString.
To stringify the error codes returned by these APIs, call MLMediaResultGetString.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK MEDIA APIs: https://developer.android.com/reference/android/media/MediaFormat#MIMETYPE_TEXT_CEA_608 Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK MEDIA APIs: https://developer.android.com/reference/android/media/MediaFormat#MIMETYPE_TEXT_CEA_708 Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK AND NDK MEDIA APIs: https://developer.android.com/ndk/reference/group/mediahttps://developer.android.com/reference/android/media/MediaCodec Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK AND NDK MEDIA APIs: https://developer.android.com/ndk/reference/group/mediahttps://developer.android.com/reference/android/media/MediaCodecList Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK MEDIA APIs: https://developer.android.com/reference/android/media/MediaPlayer#seekTo(long,%20int) Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK AND NDK MEDIA APIs: https://developer.android.com/ndk/reference/group/mediahttps://developer.android.com/reference/android/media/MediaCrypto Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK MEDIA APIs: https://developer.android.com/reference/android/media/MediaDataSource Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK AND NDK MEDIA APIs: https://developer.android.com/ndk/reference/group/mediahttps://developer.android.com/reference/android/media/MediaPlayer.DrmInfo Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK AND NDK MEDIA APIs: https://developer.android.com/ndk/reference/group/mediahttps://developer.android.com/reference/android/media/MediaExtractor Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK AND NDK MEDIA APIs: https://developer.android.com/ndk/reference/group/mediahttps://developer.android.com/reference/android/media/MediaFormat Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK MEDIA APIs: https://developer.android.com/reference/android/media/MediaPlayer Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK AND NDK MEDIA APIs: https://developer.android.com/ndk/reference/group/mediahttps://developer.android.com/reference/android/media/MediaDataSource Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK MEDIA APIs: https://developer.android.com/reference/android/media/TimedText Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK AND NDK MEDIA APIs: https://developer.android.com/ndk/reference/struct/pssh-entryhttps://developer.android.com/reference/android/media/MediaExtractor#getPsshInfo() Developers are encouraged to consider using ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK MEDIA APIs: https://developer.android.com/reference/android/media/MediaFormat#MIMETYPE_TEXT_VTT Developers are encouraged to use ExoPlayer for all media playback needs.
- THIS API IS DEPRECATED IN FAVOR OF STANDARD ANDROID SDK AND NDK MEDIA APIs: https://developer.android.com/ndk/reference/group/a-hardware-bufferhttps://developer.android.com/ndk/reference/group/media#aimagereaderhttps://developer.android.com/reference/kotlin/android/hardware/HardwareBuffer
Shared Object:
- media_ccparser.magicleap*
Shared Object:
- media_cea708parser.magicleap*
Shared Object:
- media_codec.magicleap*
Shared Object:
- media_codeclist.magicleap*
Shared Object:
- media_crypto.magicleap*
Shared Object:
- media_player.magicleap*
Shared Object:
- media_drm.magicleap*
Shared Object:
- media_extractor.magicleap*
Shared Object:
- media_format.magicleap*
Shared Object:
- media_player.magicleap*
Shared Object:
- media_player.magicleap*
Shared Object:
- native_surface.magicleap*
Enums Documentation
MLAudioChannelOutMask
Enumerator | Value | Description |
---|---|---|
MLAudioChannelOutMask_FrontLeft | 0x1 | |
MLAudioChannelOutMask_FrontRight | 0x2 | |
MLAudioChannelOutMask_FrontCenter | 0x4 | |
MLAudioChannelOutMask_LowFrequency | 0x8 | |
MLAudioChannelOutMask_BackLeft | 0x10 | |
MLAudioChannelOutMask_BackRight | 0x20 | |
MLAudioChannelOutMask_FrontLeftOfCenter | 0x40 | |
MLAudioChannelOutMask_FrontRightOfCenter | 0x80 | |
MLAudioChannelOutMask_BackCenter | 0x100 | |
MLAudioChannelOutMask_SideLeft | 0x200 | |
MLAudioChannelOutMask_SideRight | 0x400 | |
MLAudioChannelOutMask_TopCenter | 0x800 | |
MLAudioChannelOutMask_TopFrontLeft | 0x1000 | |
MLAudioChannelOutMask_TopFrontCenter | 0x2000 | |
MLAudioChannelOutMask_TopFrontRight | 0x4000 | |
MLAudioChannelOutMask_TopBackLeft | 0x8000 | |
MLAudioChannelOutMask_TopBackCenter | 0x10000 | |
MLAudioChannelOutMask_TopBackRight | 0x20000 | |
MLAudioChannelOutMask_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Audio channel output mask.
For a channel position mask, each allowed channel position corresponds to a bit in the channel mask. If that channel position is present in the audio frame, that bit is set, otherwise it is zero. The order of the bits (from lsb to msb) corresponds to the order of that position's sample in the audio frame. The canonical channel position masks by channel count are as follows:
channel count channel position mask
1 MLAudioChannelOutMono 2 MLAudioChannelOutStereo 3 MLAudioChannelOutStereo | MLAudioChannelOutMask_FrontCenter 4 MLAudioChannelOutQuad 5 MLAudioChannelOutQuad | MLAudioChannelOutMask_FrontCenter 6 MLAudioChannelOut5Point1 7 MLAudioChannelOut5Point1 | MLAudioChannelOutMask_BackCenter
8 MLAudioChannelOut7Point1Surround
These masks are an ORed composite of individual channel masks. For example MLAudioChannelOutMask_Stereo is composed of MLAudioChannelOutMask_FrontLeft and MLAudioChannelOutMask_FrontRight.
Reference:
- https://android.googlesource.com/platform/frameworks/base/+/b267554/media/java/android/media/AudioFormat.java
- https://trac.ffmpeg.org/wiki/AudioChannelManipulation#Listchannelnamesandstandardchannellayouts
MLCea608CaptionDimension
Enumerator | Value | Description |
---|---|---|
MLCea608_CCMaxRows | 15 | |
MLCea608_CCMaxCols | 32 | |
MLCea608_CCMaxRowsPlus2 | 17 | |
MLCea608_CCMaxColsPlus2 | 34 | |
MLCea608_CCMaxRowsCols_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cea608 Caption Dimension constants.
API Level:
- 2
MLCea608CaptionColor
Enumerator | Value | Description |
---|---|---|
MLCea608CaptionColor_White | 0 | |
MLCea608CaptionColor_Green | 1 | |
MLCea608CaptionColor_Blue | 2 | |
MLCea608CaptionColor_Cyan | 3 | |
MLCea608CaptionColor_Red | 4 | |
MLCea608CaptionColor_Yellow | 5 | |
MLCea608CaptionColor_Magenta | 6 | |
MLCea608CaptionColor_Invalide | 7 | |
MLCea608CaptionColor_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cea608 caption color code.
API Level:
- 2
MLCea608CaptionStyle
Enumerator | Value | Description |
---|---|---|
MLCea608CaptionStyle_Italics | 0x00000001 | |
MLCea608CaptionStyle_Underline | 0x00000002 | |
MLCea608CaptionStyle_Ensure32Bits | 0x7FFFFFFF |
Cea608 caption style code.
API Level:
- 2
Anonymous Enum 16
Enumerator | Value | Description |
---|---|---|
MLCea608_TS | 0x00A0 | NO-BREAK SPACE. |
Anonymous Enum 17
Enumerator | Value | Description |
---|---|---|
MLCea708CaptionWindows_Max | 8 |
Cea708 Caption maximum windows constant.
API Level:
- 8
Anonymous Enum 18
Enumerator | Value | Description |
---|---|---|
MLCea708CaptionEmitCommandBuffer_MaxSize | 20 |
Maximum size for Cea708 Caption Emit command buffers.
API Level:
- 8
MLCea708CaptionEmitCommand
Enumerator | Value | Description |
---|---|---|
MLCea708CaptionEmitCommand_Buffer | 1 | Buffer. |
MLCea708CaptionEmitCommand_Control | 2 | Control. |
MLCea708CaptionEmitCommand_CWX | 3 | SetCurrentWindow tells the caption decoder which window the following commands describe: SetWindowAttributes SetPenAttributes SetPenColor SetPenLocation. If the window specified has not already been created with a DefineWindow command then, SetCurrentWindow and the window property commands can be safely ignored. |
MLCea708CaptionEmitCommand_CLW | 4 | ClearWindows clears all the windows specified in the 8 bit window bitmap. |
MLCea708CaptionEmitCommand_DSW | 5 | DisplayWindows displays all the windows specified in the 8 bit window bitmap. |
MLCea708CaptionEmitCommand_HDW | 6 | HideWindows hides all the windows specified in the 8 bit window bitmap. |
MLCea708CaptionEmitCommand_TGW | 7 | ToggleWindows hides all displayed windows, and displays all hidden windows specified in the 8 bit window bitmap. |
MLCea708CaptionEmitCommand_DLW | 8 | DeleteWindows deletes all the windows specified in the 8 bit window bitmap. If the current window, as specified by the last SetCurrentWindow command, is deleted then the current window becomes undefined and the window attribute commands should have no effect until after the next SetCurrentWindow or DefineWindow command. |
MLCea708CaptionEmitCommand_DLY | 9 | Delay suspends all processing of the current service, except for DelayCancel and Reset scanning. |
MLCea708CaptionEmitCommand_DLC | 10 | DelayCancel terminates any active delay and resumes normal command processing. DelayCancel should be scanned for during a Delay. |
MLCea708CaptionEmitCommand_RST | 11 | Reset deletes all windows, cancels any active delay, and clears the buffer before the Reset command. Reset should be scanned for during a Delay. |
MLCea708CaptionEmitCommand_SPA | 12 | The SetPenAttributes command specifies how certain attributes of subsequent characters are to be rendered in the current window, until the next SetPenAttributes command. |
MLCea708CaptionEmitCommand_SPC | 13 | SetPenColor sets the foreground, background, and edge color for the subsequent characters. |
MLCea708CaptionEmitCommand_SPL | 14 | SetPenLocation sets the location of for the next bit of appended text in the current window. It has two parameters, row and column. |
MLCea708CaptionEmitCommand_SWA | 15 | SetWindowAttributes Sets the window attributes of the current window. |
MLCea708CaptionEmitCommand_DFX | 16 | DefineWindow0-7 creates one of the eight windows used by a caption decoder. |
MLCea708CaptionEmitCommand_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cea708 Caption Emit Commands constants.
API Level:
- 8
MLCea708CaptionEmitCommandControl
Enumerator | Value | Description |
---|---|---|
MLCea708CaptionEmitCommandControl_ETX | 0x03 | End of Text. |
MLCea708CaptionEmitCommandControl_BS | 0x08 | |
MLCea708CaptionEmitCommandControl_FF | 0x0c | |
MLCea708CaptionEmitCommandControl_HCR | 0x0e | |
MLCea708CaptionEmitCommandControl_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cea708 Caption Emit Command Control constants.
API Level:
- 8
MLCea708CaptionColorOpacity
Enumerator | Value | Description |
---|---|---|
MLCea708CaptionColorOpacity_SOLID | 0 | |
MLCea708CaptionColorOpacity_FLASH | 1 | |
MLCea708CaptionColorOpacity_TRANSLUCENT | 2 | |
MLCea708CaptionColorOpacity_TRANSPARENT | 3 | |
MLCea708CaptionColorOpacity_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cea708 Caption Color Opacity constants.
API Level:
- 8
MLCea708CaptionPenSize
Enumerator | Value | Description |
---|---|---|
MLCea708CaptionPenSize_SMALL | 0 | |
MLCea708CaptionPenSize_STANDARD | 1 | |
MLCea708CaptionPenSize_LARGE | 2 | |
MLCea708CaptionPenSize_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cea708 Caption Pen Size constants.
API Level:
- 8
MLCea708CaptionPenOffset
Enumerator | Value | Description |
---|---|---|
MLCea708CaptionPenOffset_SUBSCRIPT | 0 | |
MLCea708CaptionPenOffset_NORMAL | 1 | |
MLCea708CaptionPenOffset_SUPERSCRIPT | 2 | |
MLCea708CaptionPenOffset_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cea708 Caption Pen Offset constants.
API Level:
- 8
MLMediaCodecCreation
Enumerator | Value | Description |
---|---|---|
MLMediaCodecCreation_ByName | Create by name. | |
MLMediaCodecCreation_ByType | Create by type. | |
MLMediaCodecCreation_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Media codec creation method.
MLMediaCodecType
Enumerator | Value | Description |
---|---|---|
MLMediaCodecType_Encoder | Encoder. | |
MLMediaCodecType_Decoder | Decoder. | |
MLMediaCodecType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Media codec type.
MLMediaCodecBufferFlag
Enumerator | Value | Description |
---|---|---|
MLMediaCodecBufferFlag_KeyFrame | 1 | The (encoded) buffer contains the data for a key frame. |
MLMediaCodecBufferFlag_CodecConfig | 2 | Buffer contains codec initialization OR codec specific data instead of media data. |
MLMediaCodecBufferFlag_EOS | 4 | Signals the end of stream, i.e. no buffers will be available after this. |
MLMediaCodecBufferFlag_PartialFrame | 8 | Buffer only contains part of a frame, and the decoder should batch the data until a buffer without this flag appears before decoding the frame. |
MLMediaCodecBufferFlag_MuxerData | 16 | Buffer contains muxer data - Supported only for Exif data block. |
MLMediaCodecBufferFlag_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Indicate the type of data when queuing the input buffer via MLMediaCodecQueueInputBuffer() or MLMediaCodecQueueSecureInputBuffer().
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecOutputBufferStatus
Enumerator | Value | Description |
---|---|---|
MLMediaCodec_OutputBuffersChanged | -1014 | Output buffer changed. |
MLMediaCodec_FormatChanged | -1012 | Format changed. |
MLMediaCodec_TryAgainLater | -11 | Try again later. |
MLMediaCodecOutputBufferStatus_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Other than the normal buffer index, the output of MLMediaCodecDequeueOutputBuffer() can take on one of these statuses.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecCryptoMode
Enumerator | Value | Description |
---|---|---|
MLMediaCodecCryptoMode_Clear | Clear samples. | |
MLMediaCodecCryptoMode_CTR | Sample encrypted with AES CTR mode. | |
MLMediaCodecCryptoMode_CBC | Sample encrypted with AES CBC mode. | |
MLMediaCodecCryptoMode_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Crypto mode using which media samples are encrypted.
MLMediaCodecListCodecTypeFlag
Enumerator | Value | Description |
---|---|---|
MLMediaCodecListCodecTypeFlag_Software | 1 << 0 | Software. |
MLMediaCodecListCodecTypeFlag_Hardware | 1 << 1 | Hardware. |
MLMediaCodecListCodecTypeFlag_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 Bits. |
Bit mask for specifying the type of codec being queried using MLMediaCodecListGetMatchingCodecs().
MLMediaCodecListCapabilityFlag
Enumerator | Value | Description |
---|---|---|
MLMediaCodecListCapabilityFlag_AdaptivePlayback | 1 << 0 | Adaptive playback. |
MLMediaCodecListCapabilityFlag_SecurePlayback | 1 << 1 | Secure playback. |
MLMediaCodecListCapabilityFlag_TunneledPlayback | 1 << 2 | Tunneled playback. |
MLMediaCodecListCapabilityFlag_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 Bits. |
Bit mask for checking the capability of a codec after queried via MLMediaCodecListGetCapabilityFlag.
MLMediaCodecColorFormat
Enumerator | Value | Description |
---|---|---|
MLMediaCodecColorFormat_Unused | 0 | Unused: Placeholder value when format is N/A. |
MLMediaCodecColorFormat_Monochrome | 1 | Monochrome: black and white. |
MLMediaCodecColorFormat_8BitRGB332 | 2 | 8BitRGB332: Red 7:5, Green 4:2, Blue 1:0. |
MLMediaCodecColorFormat_12BitRGB444 | 3 | 12BitRGB444: Red 11:8, Green 7:4, Blue 3:0. |
MLMediaCodecColorFormat_16BitARGB4444 | 4 | 16BitARGB4444: Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0. |
MLMediaCodecColorFormat_16BitARGB1555 | 5 | 16BitARGB1555: Alpha 15, Red 14:10, Green 9:5, Blue 4:0. |
MLMediaCodecColorFormat_16BitRGB565 | 6 | 16BitRGB565: Red 15:11, Green 10:5, Blue 4:0. |
MLMediaCodecColorFormat_16BitBGR565 | 7 | 16BitBGR565: Blue 15:11, Green 10:5, Red 4:0. |
MLMediaCodecColorFormat_18BitRGB666 | 8 | 18BitRGB666: Red 17:12, Green 11:6, Blue 5:0. |
MLMediaCodecColorFormat_18BitARGB1665 | 9 | 18BitARGB1665: Alpha 17, Red 16:11, Green 10:5, Blue 4:0. |
MLMediaCodecColorFormat_19BitARGB1666 | 10 | 19BitARGB1666: Alpha 18, Red 17:12, Green 11:6, Blue 5:0. |
MLMediaCodecColorFormat_24BitRGB888 | 11 | 24BitRGB888: Red 24:16, Green 15:8, Blue 7:0. |
MLMediaCodecColorFormat_24BitBGR888 | 12 | 24BitBGR888: Blue 24:16, Green 15:8, Red 7:0. |
MLMediaCodecColorFormat_24BitARGB1887 | 13 | 24BitARGB1887: Alpha 23, Red 22:15, Green 14:7, Blue 6:0. |
MLMediaCodecColorFormat_25BitARGB1888 | 14 | 25BitARGB1888: Alpha 24, Red 23:16, Green 15:8, Blue 7:0. |
MLMediaCodecColorFormat_32BitBGRA8888 | 15 | 32BitBGRA8888: Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0. |
MLMediaCodecColorFormat_32BitARGB8888 | 16 | 32BitARGB8888: Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0. |
MLMediaCodecColorFormat_YUV411Planar | 17 | YUV411Planar: U,Y are subsampled by a factor of 4 horizontally. |
MLMediaCodecColorFormat_YUV411PackedPlanar | 18 | YUV411PackedPlanar: packed per payload in planar slices. |
MLMediaCodecColorFormat_YUV420Planar | 19 | YUV420Planar: Three arrays Y,U,V. |
MLMediaCodecColorFormat_YUV420PackedPlanar | 20 | YUV420PackedPlanar: packed per payload in planar slices. |
MLMediaCodecColorFormat_YUV420SemiPlanar | 21 | YUV420SemiPlanar: Two arrays, one is all Y, the other is U and V. |
MLMediaCodecColorFormat_YUV422Planar | 22 | YUV422Planar: Three arrays Y,U,V. |
MLMediaCodecColorFormat_YUV422PackedPlanar | 23 | YUV422PackedPlanar: packed per payload in planar slices. |
MLMediaCodecColorFormat_YUV422SemiPlanar | 24 | YUV422SemiPlanar: Two arrays, one is all Y, the other is U and V. |
MLMediaCodecColorFormat_YCbYCr | 25 | YCbYCr: Organized as 16Bit YUYV (i.e. YCbYCr). |
MLMediaCodecColorFormat_YCrYCb | 26 | YCrYCb: Organized as 16Bit YVYU (i.e. YCrYCb). |
MLMediaCodecColorFormat_CbYCrY | 27 | CbYCrY: Organized as 16Bit UYVY (i.e. CbYCrY). |
MLMediaCodecColorFormat_CrYCbY | 28 | CrYCbY: Organized as 16Bit VYUY (i.e. CrYCbY). |
MLMediaCodecColorFormat_YUV444Interleaved | 29 | YUV444Interleaved: Each pixel contains equal parts YUV. |
MLMediaCodecColorFormat_RawBayer8Bit | 30 | RawBayer8Bit: SMIA camera output format. |
MLMediaCodecColorFormat_RawBayer10Bit | 31 | RawBayer10Bit: SMIA camera output format. |
MLMediaCodecColorFormat_RawBayer8Bitcompressed | 32 | RawBayer8Bitcompressed: SMIA camera output format. |
MLMediaCodecColorFormat_L2 | 33 | Deprecated. Use MLMediaCodecColorFormat_L8. |
MLMediaCodecColorFormat_L4 | 34 | Deprecated. Use MLMediaCodecColorFormat_L8. |
MLMediaCodecColorFormat_L8 | 35 | 8 Bits per pixel Y color format. |
MLMediaCodecColorFormat_L16 | 36 | 16 Bits per pixel, little-endian Y color format. |
MLMediaCodecColorFormat_L24 | 37 | Deprecated. Use MLMediaCodecColorFormat_L16. |
MLMediaCodecColorFormat_L32 | 38 | Deprecated. Use MLMediaCodecColorFormat_L16. |
MLMediaCodecColorFormat_YUV420PackedSemiPlanar | YUV420PackedSemiPlanar. | |
MLMediaCodecColorFormat_YUV422PackedSemiPlanar | YUV422PackedSemiPlanar. | |
MLMediaCodecColorFormat_18BitBGR666 | 18BitBGR666. | |
MLMediaCodecColorFormat_24BitARGB6666 | 24BitARGB6666. | |
MLMediaCodecColorFormat_24BitABGR6666 | 24BitABGR6666. | |
MLMediaCodecColorFormat_KhronosExtensions | 0x6F000000 | Reserved region for introducing Khronos Standard Extensions. |
MLMediaCodecColorFormat_VendorStartUnused | 0x7F000000 | Reserved region for introducing Vendor Extensions. |
MLMediaCodecColorFormat_AndroidOpaque | 0x7F000789 | Reserved android opaque color format. Tells the encoder that the actual color format will be relayed by the Graphics memory allocator Buffers. |
MLMediaCodecColorFormat_32BitRGBA8888 | 0x7F00A000 | 32BitRGBA8888. |
MLMediaCodecColorFormat_YUV420Flexible | 0x7F420888 | Flexible 8-bit YUV format. Codec should report this format as being supported if it supports any YUV420 packed planar or semiplanar formats. When port is set to use this format, codec can substitute any YUV420 packed planar or semiplanar format for it. |
MLMediaCodecColorFormat_YUV420Planar16 | 0x7F42016B | 10-bit or 12-bit YUV format, LSB-justified (0's on higher bits). |
MLMediaCodecColorFormat_YUV444Y410 | 0x7F444AAA | Packed 10-bit YUV444 representation that includes 2 bits of alpha. Each pixel is 32-bit. Bits 0-9 contain the U sample, bits 10-19 contain the Y sample, bits 20-29 contain the V sample, and bits 30-31 contain the alpha value. |
MLMediaCodecColorFormat_TIYUV420PackedSemiPlanar | 0x7F000100 | TI's YUV420PackedSemiPlanar. |
MLMediaCodecColorFormat_QCOMYVU420SemiPlanar | 0x7FA30C00 | QCOM's YVU420SemiPlanar. |
MLMediaCodecColorFormat_QCOMYUV420PackedSemiPlanar64x32Tile2m8ka | 0x7FA30C03 | QCOM's YUV420PackedSemiPlanar64x32Tile2m8ka. |
MLMediaCodecColorFormat_QCOMYUV420PackedSemiPlanar32m | 0x7FA30C04 | QCOM's YUV420PackedSemiPlanar32m. |
MLMediaCodecColorFormat_SECNV12Tiled | 0x7FC00002 | SEC's NV12Tiled. |
MLMediaCodecColorFormat_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 Bits. |
Enumeration defining possible uncompressed image/video formats.
API Level:
- 9
MLMediaCodecPriority
Enumerator | Value | Description |
---|---|---|
MLMediaCodecPriority_RealTime | 0 | Realtime priority. The codec shall support the given performance configuration (e.g. framerate) at realtime. This should only be used by media playback, capture, and possibly by realtime communication scenarios if best effort performance is not suitable. |
MLMediaCodecPriority_NonRealTime | 1 | Non-realtime priority (best effort). |
MLMediaCodecPriority_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 Bits. |
Enumeration defining the Codec priority.
API Level:
- 9
MLMediaCodecIntraRefreshMode
Enumerator | Value | Description |
---|---|---|
MLMediaCodecIntraRefreshMode_Cyclic | 0 | Cyclic. |
MLMediaCodecIntraRefreshMode_Adaptive | 1 | Adaptive. |
MLMediaCodecIntraRefreshMode_Both | 2 | Both. |
MLMediaCodecIntraRefreshMode_Ensure32Bits | 0x7FFFFFFF |
Enumeration of possible methods to use for Intra Refresh.
API Level:
- 9
MLMediaCodecBitrateMode
Enumerator | Value | Description |
---|---|---|
MLMediaCodecBitrateMode_CQ | 0 | Constant quality mode. |
MLMediaCodecBitrateMode_VBR | 1 | Variable bitrate mode. |
MLMediaCodecBitrateMode_CBR | 2 | Constant bitrate mode. |
MLMediaCodecBitrateMode_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 Bits. |
Enumeration defining Codec Bitrate modes.
API Level:
- 9
MLMediaCodecProfileType
Enumerator | Value | Description |
---|---|---|
MLMediaCodecProfileType_H263Baseline | 0x01 | H263 Baseline Profile: H.263 (V1), no optional modes. |
MLMediaCodecProfileType_H263H320Coding | 0x02 | H263 H.320 Coding Efficiency Backward Compatibility Profile: H.263+ (V2), includes annexes I, J, L.4 and T. |
MLMediaCodecProfileType_H263BackwardCompatible | 0x04 | H263 Backward Compatibility Profile: H.263 (V1), includes annex F. |
MLMediaCodecProfileType_H263ISWV2 | 0x08 | H263 Interactive Streaming Wireless Profile: H.263+ (V2), includes annexes I, J, K and T. |
MLMediaCodecProfileType_H263ISWV3 | 0x10 | H263 Interactive Streaming Wireless Profile: H.263++ (V3), includes profile 3 and annexes V and W.6.3.8. |
MLMediaCodecProfileType_H263HighCompression | 0x20 | H263 Conversational High Compression Profile: H.263++ (V3), includes profiles 1 & 2 and annexes D and U. |
MLMediaCodecProfileType_H263Internet | 0x40 | H263 Conversational Internet Profile: H.263++ (V3), includes profile 5 and annex K. |
MLMediaCodecProfileType_H263Interlace | 0x80 | H263 Conversational Interlace Profile: H.263++ (V3), includes profile 5 and annex W.6.3.11. |
MLMediaCodecProfileType_H263HighLatency | 0x100 | H263 High Latency Profile: H.263++ (V3), includes profile 6 and annexes O.1 and P.5. |
MLMediaCodecProfileType_MPEG2Simple | 0 | MPEG-2 Simple Profile. |
MLMediaCodecProfileType_MPEG2Main | 1 | MPEG-2 Main Profile. |
MLMediaCodecProfileType_MPEG2422 | 2 | MPEG-2 4:2:2 Profile. |
MLMediaCodecProfileType_MPEG2SNR | 3 | MPEG-2 SNR Profile. |
MLMediaCodecProfileType_MPEG2Spatial | 4 | MPEG-2 Spatial Profile. |
MLMediaCodecProfileType_MPEG2High | 5 | MPEG-2 High Profile. |
MLMediaCodecProfileType_MPEG4Simple | 0x01 | MPEG-4 Simple Profile, Levels 1-3. |
MLMediaCodecProfileType_MPEG4SimpleScalable | 0x02 | MPEG-4 Simple Scalable Profile, Levels 1-2. |
MLMediaCodecProfileType_MPEG4Core | 0x04 | MPEG-4 Core Profile, Levels 1-2. |
MLMediaCodecProfileType_MPEG4Main | 0x08 | MPEG-4 Main Profile, Levels 2-4. |
MLMediaCodecProfileType_MPEG4Nbit | 0x10 | MPEG-4 N-bit Profile, Level 2. |
MLMediaCodecProfileType_MPEG4ScalableTexture | 0x20 | MPEG-4 Scalable Texture Profile, Level 1. |
MLMediaCodecProfileType_MPEG4SimpleFace | 0x40 | MPEG-4 Simple Face Animation Profile, Levels 1-2. |
MLMediaCodecProfileType_MPEG4SimpleFBA | 0x80 | MPEG-4 Simple Face and Body Animation (FBA) Profile, Levels 1-2. |
MLMediaCodecProfileType_MPEG4BasicAnimated | 0x100 | MPEG-4 Basic Animated Texture Profile, Levels 1-2. |
MLMediaCodecProfileType_MPEG4Hybrid | 0x200 | MPEG-4 Hybrid Profile, Levels 1-2. |
MLMediaCodecProfileType_MPEG4AdvancedRealTime | 0x400 | MPEG-4 Advanced Real Time Simple Profiles, Levels 1-4. |
MLMediaCodecProfileType_MPEG4CoreScalable | 0x800 | MPEG-4 Core Scalable Profile, Levels 1-3. |
MLMediaCodecProfileType_MPEG4AdvancedCoding | 0x1000 | MPEG-4 Advanced Coding Efficiency Profile, Levels 1-4. |
MLMediaCodecProfileType_MPEG4AdvancedCore | 0x2000 | MPEG-4 Advanced Core Profile, Levels 1-2. |
MLMediaCodecProfileType_MPEG4AdvancedScalable | 0x4000 | MPEG-4 Advanced Scalable Texture, Levels 2-3. |
MLMediaCodecProfileType_MPEG4AdvancedSimple | 0x8000 | MPEG-4 Advanced Simple. |
MLMediaCodecProfileType_AVCBaseline | 0x01 | AVC Baseline profile. |
MLMediaCodecProfileType_AVCMain | 0x02 | AVC Main profile. |
MLMediaCodecProfileType_AVCExtended | 0x04 | AVC Extended profile. |
MLMediaCodecProfileType_AVCHigh | 0x08 | AVC High profile. |
MLMediaCodecProfileType_AVCHigh10 | 0x10 | AVC High 10 profile. |
MLMediaCodecProfileType_AVCHigh422 | 0x20 | AVC High 4:2:2 profile. |
MLMediaCodecProfileType_AVCHigh444 | 0x40 | AVC High 4:4:4 profile. |
MLMediaCodecProfileType_VP8Main | 0x01 | VP8 Main profile. |
MLMediaCodecProfileType_VP90 | 0x01 | VP9 Profile 0 4:2:0 8-bit. |
MLMediaCodecProfileType_VP91 | 0x02 | VP9 Profile 1 4:2:2 8-bit. |
MLMediaCodecProfileType_VP92 | 0x04 | VP9 Profile 2 4:2:0 10-bit. |
MLMediaCodecProfileType_VP93 | 0x08 | VP9 Profile 3 4:2:2 10-bit. |
MLMediaCodecProfileType_VP92HDR | 0x1000 | VP9 Profile 2 4:2:0 10-bit HDR. |
MLMediaCodecProfileType_VP93HDR | 0x2000 | VP9 Profile 3 4:2:2 10-bit HDR. |
MLMediaCodecProfileType_VP92HDR10Plus | 0x4000 | VP9 Profile 2 4:2:0 10-bit HDR10Plus. |
MLMediaCodecProfileType_VP93HDR10Plus | 0x8000 | VP9 Profile 3 4:2:2 10-bit HDR10Plus. |
MLMediaCodecProfileType_HEVCMain | 0x01 | HEVC Main profile. |
MLMediaCodecProfileType_HEVCMain10 | 0x02 | HEVC Main 1.0 profile. |
MLMediaCodecProfileType_HEVCMainStill | 0x04 | HEVC Main Still profile. |
MLMediaCodecProfileType_HEVCMain10HDR10 | 0x1000 | HEVC Main HDR profile. |
MLMediaCodecProfileType_HEVCMain10HDR10Plus | 0x2000 | HEVC Main HDR+ profile. |
MLMediaCodecProfileType_AACObjectNull | 0 | AAC Null, not used. |
MLMediaCodecProfileType_AACObjectMain | 1 | AAC Main object. |
MLMediaCodecProfileType_AACObjectLC | 2 | AAC Low Complexity object (AAC profile). |
MLMediaCodecProfileType_AACObjectSS | 3 | AAC Scalable Sample Rate object. |
MLMediaCodecProfileType_AACObjectLTP | 4 | AAC Long Term Prediction object. |
MLMediaCodecProfileType_AACObjectHE | 5 | AAC High Efficiency (object type SBR, HE-AAC profile). |
MLMediaCodecProfileType_AACObjectScalable | 6 | AAC Scalable object. |
MLMediaCodecProfileType_AACObjectERLC | 17 | ER AAC Low Complexity object (Error Resilient AAC-LC). |
MLMediaCodecProfileType_AACObjectLD | 23 | AAC Low Delay object (Error Resilient). |
MLMediaCodecProfileType_AACObjectHE_PS | 29 | AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS). |
MLMediaCodecProfileType_WMAProfileUnused | 0 | WMA profile unused or unknown . |
MLMediaCodecProfileType_WMAProfileL1 | 1 | WMA version 9 profile L1. |
MLMediaCodecProfileType_WMAProfileL2 | 2 | WMA version 9 profile L2. |
MLMediaCodecProfileType_WMAProfileL3 | 3 | WMA version 9 profile L3. |
MLMediaCodecProfileType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 Bits. |
Enumeration defining Codec profile types.
This is a consolidated list for all the codecs that support profiles. Each profile indicates support for various performance bounds and different annexes.
A codec may not support all the profiles and levels listed below. For any given codec, the supported profiles and levels can be queried using MLMediaCodecListGetSupportedProfileLevels.
API Level:
- 9
MLMediaCodecLevelType
Enumerator | Value | Description |
---|---|---|
MLMediaCodecLevelType_H263Level10 | 0x01 | H263 Level 1.0. |
MLMediaCodecLevelType_H263Level20 | 0x02 | H263 Level 2.0. |
MLMediaCodecLevelType_H263Level30 | 0x04 | H263 Level 3.0. |
MLMediaCodecLevelType_H263Level40 | 0x08 | H263 Level 4.0. |
MLMediaCodecLevelType_H263Level45 | 0x10 | H263 Level 4.5. |
MLMediaCodecLevelType_H263Level50 | 0x20 | H263 Level 5.0. |
MLMediaCodecLevelType_H263Level60 | 0x40 | H263 Level 6.0. |
MLMediaCodecLevelType_H263Level70 | 0x80 | H263 Level 7.0. |
MLMediaCodecLevelType_MPEG2LevelLL | 0 | MPEG-2 Low Level. |
MLMediaCodecLevelType_MPEG2LevelML | 1 | MPEG-2 Main Level. |
MLMediaCodecLevelType_MPEG2LevelH14 | 2 | MPEG-2 High 1440. |
MLMediaCodecLevelType_MPEG2LevelHL | 3 | MPEG-2 High Level. |
MLMediaCodecLevelType_MPEG4Level0 | 0x01 | MPEG-4 Level 0. |
MLMediaCodecLevelType_MPEG4Level0b | 0x02 | MPEG-4 Level 0b. |
MLMediaCodecLevelType_MPEG4Level1 | 0x04 | MPEG-4 Level 1. |
MLMediaCodecLevelType_MPEG4Level2 | 0x08 | MPEG-4 Level 2. |
MLMediaCodecLevelType_MPEG4Level3 | 0x10 | MPEG-4 Level 3. |
MLMediaCodecLevelType_MPEG4Level4 | 0x20 | MPEG-4 Level 4. |
MLMediaCodecLevelType_MPEG4Level4a | 0x40 | MPEG-4 Level 4a. |
MLMediaCodecLevelType_MPEG4Level5 | 0x80 | MPEG-4 Level 5. |
MLMediaCodecLevelType_AVCLevel1 | 0x01 | AVC Level 1. |
MLMediaCodecLevelType_AVCLevel1b | 0x02 | AVC Level 1.b. |
MLMediaCodecLevelType_AVCLevel11 | 0x04 | AVC Level 1.1. |
MLMediaCodecLevelType_AVCLevel12 | 0x08 | AVC Level 1.2. |
MLMediaCodecLevelType_AVCLevel13 | 0x10 | AVC Level 1.3. |
MLMediaCodecLevelType_AVCLevel2 | 0x20 | AVC Level 2. |
MLMediaCodecLevelType_AVCLevel21 | 0x40 | AVC Level 2.1. |
MLMediaCodecLevelType_AVCLevel22 | 0x80 | AVC Level 2.2. |
MLMediaCodecLevelType_AVCLevel3 | 0x100 | AVC Level 3. |
MLMediaCodecLevelType_AVCLevel31 | 0x200 | AVC Level 3.1. |
MLMediaCodecLevelType_AVCLevel32 | 0x400 | AVC Level 3.2. |
MLMediaCodecLevelType_AVCLevel4 | 0x800 | AVC Level 4. |
MLMediaCodecLevelType_AVCLevel41 | 0x1000 | AVC Level 4.1. |
MLMediaCodecLevelType_AVCLevel42 | 0x2000 | AVC Level 4.2. |
MLMediaCodecLevelType_AVCLevel5 | 0x4000 | AVC Level 5. |
MLMediaCodecLevelType_AVCLevel51 | 0x8000 | AVC Level 5.1. |
MLMediaCodecLevelType_VP8LevelVersion0 | 0x01 | VP8 Level version 0. |
MLMediaCodecLevelType_VP8LevelVersion1 | 0x02 | VP8 Level version 1. |
MLMediaCodecLevelType_VP8LevelVersion2 | 0x04 | VP8 Level version 2. |
MLMediaCodecLevelType_VP8LevelVersion3 | 0x08 | VP8 Level version 3. |
MLMediaCodecLevelType_VP9Level1 | 0x1 | VP9 Level 5.1. |
MLMediaCodecLevelType_VP9Level11 | 0x2 | VP9 Level 1.1. |
MLMediaCodecLevelType_VP9Level2 | 0x4 | VP9 Level 2. |
MLMediaCodecLevelType_VP9Level21 | 0x8 | VP9 Level 2.1. |
MLMediaCodecLevelType_VP9Level3 | 0x10 | VP9 Level 3. |
MLMediaCodecLevelType_VP9Level31 | 0x20 | VP9 Level 3.1. |
MLMediaCodecLevelType_VP9Level4 | 0x40 | VP9 Level 4. |
MLMediaCodecLevelType_VP9Level41 | 0x80 | VP9 Level 4.1. |
MLMediaCodecLevelType_VP9Level5 | 0x100 | VP9 Level 5. |
MLMediaCodecLevelType_VP9Level51 | 0x200 | VP9 Level 5.1. |
MLMediaCodecLevelType_VP9Level52 | 0x400 | VP9 Level 5.2. |
MLMediaCodecLevelType_VP9Level6 | 0x800 | VP9 Level 6. |
MLMediaCodecLevelType_VP9Level61 | 0x1000 | VP9 Level 6.1. |
MLMediaCodecLevelType_VP9Level62 | 0x2000 | VP9 Level 6.2. |
MLMediaCodecLevelType_HEVCMainTierLevel1 | 0x1 | HEVC Main Level 1. |
MLMediaCodecLevelType_HEVCHighTierLevel1 | 0x2 | HEVC High Level 1. |
MLMediaCodecLevelType_HEVCMainTierLevel2 | 0x4 | HEVC Main Level 2. |
MLMediaCodecLevelType_HEVCHighTierLevel2 | 0x8 | HEVC High Level 2. |
MLMediaCodecLevelType_HEVCMainTierLevel21 | 0x10 | HEVC Main Level 2.1. |
MLMediaCodecLevelType_HEVCHighTierLevel21 | 0x20 | HEVC High Level 2.1. |
MLMediaCodecLevelType_HEVCMainTierLevel3 | 0x40 | HEVC Main Level 3. |
MLMediaCodecLevelType_HEVCHighTierLevel3 | 0x80 | HEVC High Level 3. |
MLMediaCodecLevelType_HEVCMainTierLevel31 | 0x100 | HEVC Main Level 3.1. |
MLMediaCodecLevelType_HEVCHighTierLevel31 | 0x200 | HEVC High Level 3.1. |
MLMediaCodecLevelType_HEVCMainTierLevel4 | 0x400 | HEVC Main Level 4. |
MLMediaCodecLevelType_HEVCHighTierLevel4 | 0x800 | HEVC High Level 4. |
MLMediaCodecLevelType_HEVCMainTierLevel41 | 0x1000 | HEVC Main Level 4.1. |
MLMediaCodecLevelType_HEVCHighTierLevel41 | 0x2000 | HEVC High Level 4.1. |
MLMediaCodecLevelType_HEVCMainTierLevel5 | 0x4000 | HEVC Main Level 5. |
MLMediaCodecLevelType_HEVCHighTierLevel5 | 0x8000 | HEVC High Level 5. |
MLMediaCodecLevelType_HEVCMainTierLevel51 | 0x10000 | HEVC Main Level 5.1. |
MLMediaCodecLevelType_HEVCHighTierLevel51 | 0x20000 | HEVC High Level 5.1. |
MLMediaCodecLevelType_HEVCMainTierLevel52 | 0x40000 | HEVC Main Level 5.2. |
MLMediaCodecLevelType_HEVCHighTierLevel52 | 0x80000 | HEVC High Level 5.2. |
MLMediaCodecLevelType_HEVCMainTierLevel6 | 0x100000 | HEVC Main Level 6. |
MLMediaCodecLevelType_HEVCHighTierLevel6 | 0x200000 | HEVC High Level 6. |
MLMediaCodecLevelType_HEVCMainTierLevel61 | 0x400000 | HEVC Main Level 6.1. |
MLMediaCodecLevelType_HEVCHighTierLevel61 | 0x800000 | HEVC High Level 6.1. |
MLMediaCodecLevelType_HEVCMainTierLevel62 | 0x1000000 | HEVC Main Level 6.2. |
MLMediaCodecLevelType_HEVCHighTierLevel62 | 0x2000000 | HEVC High Level 6.2. |
MLMediaCodecLevelType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 Bits. |
Enumeration defining Codec Level types.
This is a consolidated list for all the codecs that support profiles. Each level indicates support for various frame sizes, bit rates, decoder frame rates.
A codec may not support all the profiles and levels listed below. For any given codec, the supported profiles and levels can be queried using MLMediaCodecListGetSupportedProfileLevels.
API Level:
- 9
MLMediaSeekMode
Enumerator | Value | Description |
---|---|---|
MLMediaSeekMode_Previous_Sync | Seek to the previous key frame. | |
MLMediaSeekMode_Next_Sync | Seek to the next key frame. | |
MLMediaSeekMode_Closest_Sync | Seek to the closest key frame. | |
MLMediaSeekMode_Closest | Seek to the closest frame, more accurate but slower. | |
MLMediaSeekMode_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Mode indicating where exactly to seek to.
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
MLMediaExtractorSampleFlag
Enumerator | Value | Description |
---|---|---|
MLMediaExtractorSampleFlag_Sync | 1 | |
MLMediaExtractorSampleFlag_Encrypted | 2 | |
MLMediaExtractorSampleFlag_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Sample flag output from MLMediaExtractorGetSampleFlags.
MLMediaExtractorSeekPosition
Enumerator | Value | Description |
---|---|---|
MLMediaExtractorSeekPosition_Previous_Sync | ||
MLMediaExtractorSeekPosition_Next_Sync | ||
MLMediaExtractorSeekPosition_Closest_Sync | ||
MLMediaExtractorSeekPosition_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Seek mode used by MLMediaExtractorSeekTo.
MLMediaFormatAudioEncoding
Enumerator | Value | Description |
---|---|---|
MLMediaFormatAudioEncoding_PCM16Bits | 2 | Audio data format: PCM 16 bits per sample. |
MLMediaFormatAudioEncoding_PCM8Bits | 3 | Audio data format: PCM 8 bits per sample. |
MLMediaFormatAudioEncoding_PCMFloat | 4 | Audio data format: single-precision floating-point per sample. |
MLMediaFormatAudioEncoding_PCM32Bits | 201 | Audio data format: PCM 32 bits per sample. |
MLMediaFormatAudioEncoding_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
MLMediaPlayerVideoScalingMode
Enumerator | Value | Description |
---|---|---|
MLMediaPlayerVideoScalingMode_ScaleToFit | 1 | |
MLMediaPlayerVideoScalingMode_ScaleToFitWithCropping | 2 | |
MLMediaPlayerVideoScalingMode_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Codes for setting video scaling mode.
MLMediaPlayerPollingStateFlags
Enumerator | Value | Description |
---|---|---|
MLMediaPlayerPollingStateFlag_IsPlaying | 1 << 0 | Playing. |
MLMediaPlayerPollingStateFlag_IsLooping | 1 << 1 | Looping. |
MLMediaPlayerPollingStateFlag_HasBeenPrepared | 1 << 2 | Prepared. |
MLMediaPlayerPollingStateFlag_HasPlaybackCompleted | 1 << 3 | Playback completed. |
MLMediaPlayerPollingStateFlag_HasSeekCompleted | 1 << 4 | Seek completed. |
MLMediaPlayerPollingStateFlag_HasSizeChanged | 1 << 5 | Size changed. |
MLMediaPlayerPollingStateFlag_HasBufferingUpdated | 1 << 6 | Buffering updated. |
MLMediaPlayerPollingStateFlag_HasReceivedInfo | 1 << 7 | Received info. |
MLMediaPlayerPollingStateFlag_HasReceivedError | 1 << 8 | Received error. |
MLMediaPlayerPollingStateFlag_HasTimedTextUpdated | 1 << 9 | Timed text updated. |
MLMediaPlayerPollingStateFlag_HasSubtitleUpdated | 1 << 10 | Subtitle updated. |
MLMediaPlayerPollingStateFlag_HasMetadataUpdated | 1 << 11 | Metadata updated. |
MLMediaPlayerPollingStateFlag_HasDrmInfoUpdated | 1 << 12 | DRM info updated. |
MLMediaPlayerPollingStateFlag_HasResetCompleted | 1 << 13 | Async Reset completed. |
MLMediaPlayerPollingStateFlag_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
The state to be polled.
MLMediaPlayerInfo
Enumerator | Value | Description |
---|---|---|
MLMediaPlayerInfo_Unknown | 1 | Unknown. |
MLMediaPlayerInfo_StartedAsNext | 2 | The player was started because it was used as the next player. |
MLMediaPlayerInfo_RenderingStart | 3 | The player just pushed the very first video frame for rendering. |
MLMediaPlayerInfo_Looping | 4 | The player just reached EOS and started from beginning (loop). |
MLMediaPlayerInfo_Started | 5 | The player acknowledgement that it has started playing. |
MLMediaPlayerInfo_Paused | 6 | The player acknowledgement that it has paused. |
MLMediaPlayerInfo_Stopped | 7 | The player acknowledgement that it has stopped playing. |
MLMediaPlayerInfo_StartedBySharedPlayer | 8 | The player acknowledgement that it has started playing as result of shared player's request. |
MLMediaPlayerInfo_PausedBySharedPlayer | 9 | The player acknowledgement that it has paused playing as result of shared player's request. |
MLMediaPlayerInfo_SeekBySharedPlayer | 10 | The player acknowledgement that it is seeking as result of shared player's request. |
MLMediaPlayerInfo_StoppedBySharedPlayer | 11 | The player acknowledgement that it has stopped playing as result of shared player's request. |
MLMediaPlayerInfo_SyncStart | 12 | The player has started sync'ing with other shared players. |
MLMediaPlayerInfo_SyncComplete | 13 | The player has completed sync'ing with other shared players. |
MLMediaPlayerInfo_VideoTrackLagging | 700 | The video is too complex for the decoder, it can't decode frames fast enough. |
MLMediaPlayerInfo_BufferingStart | 701 | Media player is temporarily pausing playback. |
MLMediaPlayerInfo_BufferingEnd | 702 | Media player is resuming playback after filling buffers. |
MLMediaPlayerInfo_NetworkBandwidth | 703 | Network bandwidth info. |
MLMediaPlayerInfo_BehindLiveWindow | 704 | Dash Live stream is Behind Live Window. |
MLMediaPlayerInfo_PowerStatePause | 705 | Playback Paused because of Power State Transition. |
MLMediaPlayerInfo_PowerStateResume | 706 | Playback Resumed because of Power State Transition. |
MLMediaPlayerInfo_BufferedDuration | 707 | Duration in milliseconds of buffered content. |
MLMediaPlayerInfo_BadInterleaving | 800 | Bad interleaving means that a media has been improperly interleaved. |
MLMediaPlayerInfo_NotSeekable | 801 | The media is not seekable (e.g live stream). |
MLMediaPlayerInfo_MetadataUpdate | 802 | New media metadata is available. |
MLMediaPlayerInfo_PlayAudioError | 804 | Audio can not be played. |
MLMediaPlayerInfo_PlayVideoError | 805 | Video can not be played. |
MLMediaPlayerInfo_TimedTextError | 900 | Media timed text error. |
MLMediaPlayerInfo_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Info and warning codes for the media player framework.
These are non fatal, the playback is going on but there might be some user visible issues.
Info and warning messages are communicated back to the client using the on_info callback. In this situation, this method is invoked with the following:
Description of 'what' should be a value from the MLMediaPlayerInfo. Description of 'extra' contains an implementation dependent info code to provide more details. Should default to 0 when not used.
MLMediaPlayerTrackType
Enumerator | Value | Description |
---|---|---|
MLMediaPlayerTrackType_Unknown | 0 | Unknown. |
MLMediaPlayerTrackType_Video | 1 | Video. |
MLMediaPlayerTrackType_Audio | 2 | Audio. |
MLMediaPlayerTrackType_TimedText | 3 | Timed text. |
MLMediaPlayerTrackType_Subtitle | 4 | Subtitle. |
MLMediaPlayerTrackType_Metadata | 5 | Metadata. |
MLMediaPlayerTrackType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
MediaTrack types returned by MLMediaPlayerGetTrackType().
MLMediaPlayerBufferingMode
Enumerator | Value | Description |
---|---|---|
MLMediaPlayerBufferingMode_None | 0 | Do not support buffering. |
MLMediaPlayerBufferingMode_TimeOnly | 1 | Support only time based buffering. |
MLMediaPlayerBufferingMode_SizeOnly | 2 | Support only size based buffering. |
MLMediaPlayerBufferingMode_TimeThenSize | 3 | Support both time and size based buffering, time based calculation precedes size based. Size based calculation will be used only when time information is not available for the stream. |
MLMediaPlayerBufferingMode_Count | 4 | Number of modes. |
MLMediaPlayerBufferingMode_Ensure32Bits | 0x7FFFFFFF | Ensure enum size is 32 bits. |
Indicate the mode of buffering settings.
MLMediaFramePackingMode
Enumerator | Value | Description |
---|---|---|
MLMediaFramePackingMode_None | 0 | Not a stereoscopic video. |
MLMediaFramePackingMode_Checkboard | Checkboard. | |
MLMediaFramePackingMode_ColumnInterleaved | Column interleaved. | |
MLMediaFramePackingMode_RowInterleaved | Row interleaved. | |
MLMediaFramePackingMode_SideBySideQuincunx | Side by side quincunx. | |
MLMediaFramePackingMode_SideBySide | Side by side. | |
MLMediaFramePackingMode_TopBottom | Top bottom. | |
MLMediaFramePackingMode_MultiviewFrameByFrame | Multiview frame by frame. | |
MLMediaFramePackingMode_FrameByFrame | Frame by frame. | |
MLMediaFramePackingMode_Anaglyph | Anaglyph. |
Frame Packing Arrangement for stereoscopic videos.
API Level:
- 8
MLMediaFramePackingFlags
Enumerator | Value | Description |
---|---|---|
MLMediaFramePackingFlags_None | 0 | No flags. |
MLMediaFramePackingFlags_RightViewFirst | 1 << 0 | Right view first. |
MLMediaFramePackingFlags_LeftFlipped | 1 << 1 | Left view flipped. |
MLMediaFramePackingFlags_RightFlipped | 1 << 2 | Right view flipped. |
MLMediaFramePackingFlags_Anaglyph_RedCyan | 1 << 3 | Anaglyph red/cyan. |
MLMediaFramePackingFlags_Anaglyph_GreenMagenta | 1 << 4 | Anaglyph green/magenta. |
Frame Packing Arrangement flags for stereoscopic videos.
API Level:
- 8
MLTTMLLayoutAlignment
Enumerator | Value | Description |
---|---|---|
MLTTMLLayoutAlignment_Unspecified | 0x7FFFFFFF | An unspecified alignment value. |
MLTTMLLayoutAlignment_Normal | 0 | Normal alignment relative to text direction. |
MLTTMLLayoutAlignment_Center | 1 | Centered alignment. |
MLTTMLLayoutAlignment_Opposite | 2 | Opposite alignment relative to text direction. |
MLTTMLLayoutAlignment_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cue text alignment within the cue box.
API Level:
- 20
MLTTMLLineType
Enumerator | Value | Description |
---|---|---|
MLTTMLLineType_Unset | 0x7FFFFFFF | An unset line type value. |
MLTTMLLineType_Fraction | 0 | Line position is fractional position within the viewport. |
MLTTMLLineType_Number | 1 | Line position is number of lines, interpretation also depends on the line anchor type. |
MLTTMLLineType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cue line type.
API Level:
- 20
MLTTMLAnchorType
Enumerator | Value | Description |
---|---|---|
MLTTMLAnchorType_Unset | 0x7FFFFFFF | An unset anchor type value. |
MLTTMLAnchorType_Start | 0 | Anchors the left (for horizontal positions) or top (for vertical positions) edge of the cue box. |
MLTTMLAnchorType_Middle | 1 | Anchors the middle of the cue box. |
MLTTMLAnchorType_End | 2 | Anchors the right (for horizontal positions) or bottom (for vertical positions) edge of the cue box. |
MLTTMLAnchorType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cue anchor type.
API Level:
- 20
MLTTMLTextSizeType
Enumerator | Value | Description |
---|---|---|
MLTTMLTextSizeType_Unset | 0x7FFFFFFF | An unset text size type value. |
MLTTMLTextSizeType_Fractional | 0 | Text size is measured as a fraction of the viewport size minus the view padding. |
MLTTMLTextSizeType_Fractional_Ignore_Padding | 1 | Text size is measured as a fraction of the viewport size, ignoring the view padding. |
MLTTMLTextSizeType_Absolute | 2 | Text size is measured in number of pixels. |
MLTTMLTextSizeType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cue text size type.
API Level:
- 20
MLWebVTTOrientation
Enumerator | Value | Description |
---|---|---|
MLWebVTTOrientation_Horizontal | 0 | |
MLWebVTTOrientation_Vertical | 1 | |
MLWebVTTOrientation_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cue orientation setting.
API Level:
- 4
MLWebVTTDirection
Enumerator | Value | Description |
---|---|---|
MLWebVTTDirection_Default | 0 | |
MLWebVTTDirection_LeftToRight | 1 | |
MLWebVTTDirection_RightToLeft | 2 | |
MLWebVTTDirection_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cue direction setting.
API Level:
- 4
MLWebVTTAlign
Enumerator | Value | Description |
---|---|---|
MLWebVTTAlign_Start | 0 | |
MLWebVTTAlign_Middle | 1 | |
MLWebVTTAlign_End | 2 | |
MLWebVTTAlign_Left | 3 | |
MLWebVTTAlign_Right | 4 | |
MLWebVTTAlign_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Cue aligment setting.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 4
MLNativeSurfaceAcquiredBufferCount
Enumerator | Value | Description |
---|---|---|
MLNativeSurfaceAcquiredBufferCount_Min | 1 | Min number of buffer count. |
MLNativeSurfaceAcquiredBufferCount_Max | 16 | Max number of buffer count. |
MLNativeSurfaceAcquiredBufferCount_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Number of acquired buffers to be requested in functions MLNativeSurfaceCreate and MLNativeSurfaceTextureCreate.
MLNativeSurfacePixelFormat
Enumerator | Value | Description |
---|---|---|
MLNativeSurfacePixelFormat_Custom | -4 | Custom format. |
MLNativeSurfacePixelFormat_Translucent | -3 | Translucent format. |
MLNativeSurfacePixelFormat_Transparent | -2 | Transparent format. |
MLNativeSurfacePixelFormat_Opaque | -1 | Opaque format. |
MLNativeSurfacePixelFormat_None | 0 | None. |
MLNativeSurfacePixelFormat_Rgba8888 | 1 | Below enums should match android_pixel_format_t in graphics-base-v1.0.h header.4x8-bit RGBA format. |
MLNativeSurfacePixelFormat_Rgbx8888 | 2 | 4x8-bit RGBX format. |
MLNativeSurfacePixelFormat_Rgb888 | 3 | 3x8-bit RGB format. |
MLNativeSurfacePixelFormat_Rgb565 | 4 | 16-bit RGB format. |
MLNativeSurfacePixelFormat_Bgra8888 | 5 | 4x8-bit BGRA format. |
MLNativeSurfacePixelFormat_RgbaFp16 | 22 | 64-bit RGBA format. |
MLNativeSurfacePixelFormat_Rgba1010102 | 43 | 32-bit RGBA format. |
MLNativeSurfacePixelFormat_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Pixel format to use when creating the native surface. Used in functions MLNativeSurfaceCreate and MLNativeSurfaceTextureCreate.
MLNativeSurfaceTextureBackend
Enumerator | Value | Description |
---|---|---|
MLNativeSurfaceTextureBackend_OpenGL | 0 | OpenGL texture. |
MLNativeSurfaceTextureBackend_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Graphic backend to use.
API Level:
- 20
Types Documentation
MLCea608CaptionStyleColor
typedef struct MLCea608CaptionStyleColor MLCea608CaptionStyleColor;
Cea608 caption style and color.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLCea608CaptionPAC
typedef struct MLCea608CaptionPAC MLCea608CaptionPAC;
Cea608 caption preamble address code.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLCea608CaptionLineEx
typedef struct MLCea608CaptionLineEx MLCea608CaptionLineEx;
Cea608 caption line structure.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLCea608CaptionSegmentEx
typedef struct MLCea608CaptionSegmentEx MLCea608CaptionSegmentEx;
Cea608 caption segment structure.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaCCParserDisplayChangedCallback
typedef void(* MLMediaCCParserDisplayChangedCallback) (MLHandle cc_handle, const MLCea608CaptionSegmentEx *cc_seg, void *data);
Callback signature called when Cea608 displayable is changed.
Parameters
cc_handle | MLHandle is a CC Parser instance for which callback was called. | |
cc_seg | MLCea608CaptionSegmentEx conveys caption displayble to be rendered. | |
data | Custom data to be returned when callback is fired. |
API Level:
- 8
MLCea708CaptionColor
typedef struct MLCea708CaptionColor MLCea708CaptionColor;
Cea708 Caption Color.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLCea708CaptionPenAttr
typedef struct MLCea708CaptionPenAttr MLCea708CaptionPenAttr;
Cea708 Caption Pen Attributes.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLCea708CaptionPenColor
typedef struct MLCea708CaptionPenColor MLCea708CaptionPenColor;
Cea708 Caption Pen Color.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLCea708CaptionPenLocation
typedef struct MLCea708CaptionPenLocation MLCea708CaptionPenLocation;
Cea708 Caption Pen Location.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLCea708CaptionWindowAttr
typedef struct MLCea708CaptionWindowAttr MLCea708CaptionWindowAttr;
Cea708 Caption Window Attributes.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLCea708CaptionWindow
typedef struct MLCea708CaptionWindow MLCea708CaptionWindow;
Cea708 Caption Window.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLCea708CaptionEvent
typedef struct MLCea708CaptionEvent MLCea708CaptionEvent;
Cea708 Caption Event.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaCea708ParserEmitEventCallback
typedef void(* MLMediaCea708ParserEmitEventCallback) (MLHandle cc_handle, const MLCea708CaptionEvent *event, void *data);
Callback signature called when Cea708 parser emits event.
Parameters
cc_handle | MLHandle is a Cea708 Parser instance for which callback was called. | |
event | MLCea708CaptionEvent conveys caption event to listener. | |
data | Custom data to be returned when callback is fired. |
API Level:
- 8
MLMediaCodecBufferInfo
typedef struct MLMediaCodecBufferInfo MLMediaCodecBufferInfo;
Media codec buffer info.
MLMediaCodecInputBufferInfo
typedef struct MLMediaCodecInputBufferInfo MLMediaCodecInputBufferInfo;
MediaCodec Input buffer information.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecOutputBufferInfo
typedef struct MLMediaCodecOutputBufferInfo MLMediaCodecOutputBufferInfo;
MediaCodec Output buffer information.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecOutputFormatInfo
typedef struct MLMediaCodecOutputFormatInfo MLMediaCodecOutputFormatInfo;
MediaCodec Output Format information.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecErrorInfo
typedef struct MLMediaCodecErrorInfo MLMediaCodecErrorInfo;
MediaCodec Output Format information.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecCallbacksEx
typedef struct MLMediaCodecCallbacksEx MLMediaCodecCallbacksEx;
Callbacks for notifying asynchronously of various codec events to the user/client. If user intends to use codec in asynchronous mode, then the user/client is expected to implement these callbacks and take proper actions where appropriate.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecFrameRenderedInfo
typedef struct MLMediaCodecFrameRenderedInfo MLMediaCodecFrameRenderedInfo;
MediaCodec Output Frame Rendered information.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecOutputFrameListener
typedef struct MLMediaCodecOutputFrameListener MLMediaCodecOutputFrameListener;
Callbacks for notifying when an output frame is available for consumption or has been rendered on the output surface.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecCryptoPattern
typedef struct MLMediaCodecCryptoPattern MLMediaCodecCryptoPattern;
Metadata describing an encryption pattern for the protected bytes in a subsample.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecCryptoInfo
typedef struct MLMediaCodecCryptoInfo MLMediaCodecCryptoInfo;
Metadata describing the structure of a (at least partially) encrypted input sample. A buffer's data is considered to be partitioned into "subSamples", each subSample starts with a (potentially empty) run of plain, unencrypted bytes followed by a (also potentially empty) run of encrypted bytes. If pattern encryption applies, each of the encrypted runs is encrypted only partly, according to a repeating pattern of "encrypt" and "skip" blocks. This information encapsulates per-sample metadata as outlined in ISO/IEC FDIS 23001-7:2011 "Common encryption in ISO base media file format files".
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecListQueryResults
typedef struct MLMediaCodecListQueryResults MLMediaCodecListQueryResults;
Used to store the list of available codec names or the list of supported mime types.
MLMediaCodecListProfileLevel
typedef struct MLMediaCodecListProfileLevel MLMediaCodecListProfileLevel;
Used to store the list of codec profile levels.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 6
MLMediaDataSourceReadAt
typedef int64_t(* MLMediaDataSourceReadAt) (MLHandle media_data_source, size_t position, size_t size, uint8_t *buffer, void *context);
Called to request data from the given position.
Parameters
media_data_source | MLHandle as returned by MLMediaDataSourceCreate(). | |
position | The position in the data source to read from. | |
size | The number of bytes to read. | |
buffer | The buffer to read the data into. | |
context | User data as passed to MLMediaDataSourceCreate(). |
Implementations should should write up to size
bytes into buffer
, and return the number of bytes written.
Return 0 to indicate that end of stream is reached. Return -1 on error.
Return: The number of bytes read, or -1 if there was an error.
MLMediaDataSourceGetSize
typedef int64_t(* MLMediaDataSourceGetSize) (MLHandle media_data_source, void *context);
Called to get the size of the data source.
Parameters
media_data_source | MLHandle as returned by MLMediaDataSourceCreate(). | |
context | User data as passed to MLMediaDataSourceCreate(). |
Return: the size of data source in bytes, or -1 if the size is unknown.
MLMediaDataSourceClose
typedef void(* MLMediaDataSourceClose) (MLHandle media_data_source, void *context);
Called before deleting |this|. The other methods may return errors if they're called after calling close().
Parameters
media_data_source | MLHandle as returned by MLMediaDataSourceCreate(). | |
context | User data as passed to MLMediaDataSourceCreate(). |
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
MLMediaExtractorPSSHEntry
typedef MLPSSHEntry MLMediaExtractorPSSHEntry;
MLMediaExtractorDRMSchemeInitData
typedef struct MLMediaExtractorDRMSchemeInitData MLMediaExtractorDRMSchemeInitData;
DRM Scheme initialization data.
MLMediaFormatByteArray
typedef struct MLMediaFormatByteArray MLMediaFormatByteArray;
Data type containing byte array buffer and the size.
MLMediaPlayerPSSHEntry
typedef MLPSSHEntry MLMediaPlayerPSSHEntry;
MLMediaPlayerTrackDRMInfo
typedef struct MLMediaPlayerTrackDRMInfo MLMediaPlayerTrackDRMInfo;
MediaPlayer DRM Info for a Media Track .
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerSubtitleData
typedef struct MLMediaPlayerSubtitleData MLMediaPlayerSubtitleData;
MediaPlayer subtitle data.
MLMediaPlayerBufferingSettings
typedef struct MLMediaPlayerBufferingSettings MLMediaPlayerBufferingSettings;
Indicate the buffering settings.
MLMediaPlayerOnBufferingUpdateInfo
typedef struct MLMediaPlayerOnBufferingUpdateInfo MLMediaPlayerOnBufferingUpdateInfo;
MediaPlayer Buffering update callback Info.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerOnCompletionInfo
typedef struct MLMediaPlayerOnCompletionInfo MLMediaPlayerOnCompletionInfo;
MediaPlayer Playback completion callback Info.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerOnErrorInfo
typedef struct MLMediaPlayerOnErrorInfo MLMediaPlayerOnErrorInfo;
MediaPlayer Error callback Info.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerOnInfoInfo
typedef struct MLMediaPlayerOnInfoInfo MLMediaPlayerOnInfoInfo;
MediaPlayer Information callback Info.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerOnPreparedInfo
typedef struct MLMediaPlayerOnPreparedInfo MLMediaPlayerOnPreparedInfo;
MediaPlayer Playback prepared callback Info.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerOnSeekCompleteInfo
typedef struct MLMediaPlayerOnSeekCompleteInfo MLMediaPlayerOnSeekCompleteInfo;
MediaPlayer Playback seek completion callback Info.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerOnVideoSizeChangedInfo
typedef struct MLMediaPlayerOnVideoSizeChangedInfo MLMediaPlayerOnVideoSizeChangedInfo;
MediaPlayer Video Size Changed callback Info.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerOnTrackDRMInfo
typedef struct MLMediaPlayerOnTrackDRMInfo MLMediaPlayerOnTrackDRMInfo;
MediaPlayer Track DRM Info callback Info.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerOnResetCompleteInfo
typedef struct MLMediaPlayerOnResetCompleteInfo MLMediaPlayerOnResetCompleteInfo;
MediaPlayer reset completion callback Info.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaPlayerOnFramePackingInfo
typedef struct MLMediaPlayerOnFramePackingInfo MLMediaPlayerOnFramePackingInfo;
MediaPlayer frame packing callback Info.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaPlayerEventCallbacksEx
typedef struct MLMediaPlayerEventCallbacksEx MLMediaPlayerEventCallbacksEx;
Callbacks for notifying client about Media Player error events.
Those are async mechanisms that should not be used in parallel with their sync counterpart, i.e. poll-based queries for the same events using MLMediaPlayerPollStatespoll().
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaPlayerTrackInfo
typedef struct MLMediaPlayerTrackInfo MLMediaPlayerTrackInfo;
MediaPlayer Track Information.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerTrackDRMSessionInfo
typedef struct MLMediaPlayerTrackDRMSessionInfo MLMediaPlayerTrackDRMSessionInfo;
DRM Session information for a MediaPlayer Track.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerOnMediaSubtitleUpdateCallback
typedef void(* MLMediaPlayerOnMediaSubtitleUpdateCallback) (MLHandle media_player, MLMediaPlayerSubtitleData subtitle_data, void *data);
Callbacks signature called when subtitle update is available.
Parameters
data | Custom data to be returned when callback is fired. | |
media_player | MLHandle is a Media Player instance for which callback was called. | |
subtitle_data | MLMediaPlayerSubtitleData is the raw subtitle data. |
MLMediaPlayerOnMediaTimedTextUpdateCallback
typedef void(* MLMediaPlayerOnMediaTimedTextUpdateCallback) (MLHandle media_player, MLHandle timed_text, void *data);
Callbacks signature called when Timed Text update is available.
Parameters
media_player | MLHandle is a Media Player instance for which callback was called. | |
timed_text | MLHandle is the handle for timed_text data. | |
data | Custom data to be delivered when callback is invoked. |
Required Permissions:
- None
API Level:
- 4
MLMediaPlayerMetrics
typedef struct MLMediaPlayerMetrics MLMediaPlayerMetrics;
MediaPlayer metrics data.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaStreamSourceOnBufferAvailable
typedef void(* MLMediaStreamSourceOnBufferAvailable) (MLHandle media_stream_source, void *context);
Called when buffers becomes available.
Parameters
media_stream_source | MLHandle as returned by MLMediaStreamSourceCreate(). | |
context | User data as passed to MLMediaStreamSourceCreate(). |
Signal that at least one buffer is now available. Application should then call getBuffer() as much as possible until it returns false, or until no more data is currently available in the application.
MLTTMLImage
typedef struct MLTTMLImage MLTTMLImage;
Byte data for TTML image cues.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLTTMLData
typedef struct MLTTMLData MLTTMLData;
TTML data structure.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLPSSHEntry
typedef struct MLPSSHEntry MLPSSHEntry;
PSSH entry.
Deprecated since 1.4.0. Scheduled for removal.
MLWebVTTData
typedef struct MLWebVTTData MLWebVTTData;
WebVTT data structure.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 4
MLNativeSurfaceFrameAvailableInfo
typedef struct MLNativeSurfaceFrameAvailableInfo MLNativeSurfaceFrameAvailableInfo;
NativeSurface/NativeSurfaceTexture Output Frame Availability information.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLNativeSurfaceConfig
typedef struct MLNativeSurfaceConfig MLNativeSurfaceConfig;
Configuration values for creating the Native Surface.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLNativeSurfaceOnFrameAvailableCallback
typedef struct MLNativeSurfaceOnFrameAvailableCallback MLNativeSurfaceOnFrameAvailableCallback;
Callbacks for notifying when an output frame is available for consumption.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
Functions Documentation
MLMediaCCParserCreate
MLResult MLMediaCCParserCreate(
MLHandle * out_handle
)
Create internal closed caption parser object.
Parameters
MLHandle * | out_handle | A pointer to an MLHandle which will contain the handle to the CC parser. If this operation fails, out_handle will be ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_Ok | Internal closed caption parser 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.
API Level:
- 2
MLMediaCCParserGetDisplayableEx
MLResult MLMediaCCParserGetDisplayableEx(
MLHandle cc_handle,
const uint8_t * subtitle_data,
int32_t subtitle_data_size,
const MLCea608CaptionSegmentEx ** out_cc_seg
)
Return closed caption for display.
Parameters
MLHandle | cc_handle | A handle to a CC parser. |
const uint8_t * | subtitle_data | Subtitle data of MLMediaPlayerSubtitleData structure returned from MLMediaPlayerGetSubtitleEx function. |
int32_t | subtitle_data_size | Subtitle data size of MLMediaPlayerSubtitleData structure returned from MLMediaPlayerGetSubtitleEx function. |
const MLCea608CaptionSegmentEx ** | out_cc_seg | The returned MLCea608CaptionSegmentEx pointer for CC display. NOTE that user doesn't own this memory. |
Returns
MLResult | MLResult_InvalidParam | one of the arguements is incorrect. |
MLResult | MLResult_Ok | CC is ready to display and content is stored in out_ccSeg. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_NoInit | CC parser was not properly built or initialized. |
MLResult | MLMediaGenericResult_NotEnoughData | more data is required and no displayable CC for now. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaCCParserDestroy
MLResult MLMediaCCParserDestroy(
MLHandle cc_handle
)
Release internal CC parser object.
Parameters
MLHandle | cc_handle | A handle to a CC parser. |
Returns
MLResult | MLResult_Ok | internal CC parser 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.
API Level:
- 2
MLMediaCCParserSetDisplayChangedCallback
MLResult MLMediaCCParserSetDisplayChangedCallback(
MLHandle cc_handle,
MLMediaCCParserDisplayChangedCallback on_display_changed_callback,
void * data
)
Set callback to get notified when a caption displayable has changed.
Parameters
MLHandle | cc_handle | A handle to a CC parser. |
MLMediaCCParserDisplayChangedCallback | on_display_changed_callback | Function pointer for display changed callback. See MLMediaCCParserDisplayChangedCallback() callback typedef declaration and comments for explanation on expected callback parameters. This can be 'NULL' to unset the callback. |
void * | data | Custom data to be returned when callback is fired. |
Returns
MLResult | MLResult_InvalidParam | Passed cc_handle handle was not found. |
MLResult | MLResult_Ok | Callback was successfully set. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Setting this callback saves application from handling raw subtitle data. Caption will be delivered in this callback at displayable time.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaCCParserParse
MLResult MLMediaCCParserParse(
MLHandle cc_handle,
const uint8_t * subtitle_data,
uint32_t subtitle_data_size
)
Provide Cea608 parser with subtitle raw data for parsing. If the callback has been set by MLMediaCCParserSetDisplayChangedCallback, then its issued to notify the CC Data.
Parameters
MLHandle | cc_handle | A handle to a Cea608 parser. |
const uint8_t * | subtitle_data | Subtitle data of MLMediaPlayerSubtitleData. |
uint32_t | subtitle_data_size | Subtitle data size of MLMediaPlayerSubtitleData. |
Returns
MLResult | MLResult_InvalidParam | the input parameter(s) is(are) wrong. |
MLResult | MLResult_Ok | the operation was successful. |
MLResult | MLMediaGenericResult_NoInit | Cea708 parser was not properly built or initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaCea708ParserCreate
MLResult MLMediaCea708ParserCreate(
MLHandle * out_handle
)
Create Cea708 parser object.
Parameters
MLHandle * | out_handle | A pointer to an MLHandle which will contain the handle to the Cea708 parser. If this operation fails, out_handle will be ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_AllocFailed | The operation failed with memory allocation error. |
MLResult | MLResult_InvalidParam | out_handle is null. |
MLResult | MLResult_Ok | Internal Cea708 parser object was created successfully. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaCea708ParserParse
MLResult MLMediaCea708ParserParse(
MLHandle cc_handle,
const uint8_t * subtitle_data,
uint32_t subtitle_data_size
)
Provide Cea708 parser with subtitle raw data for parsing.
Parameters
MLHandle | cc_handle | A handle to a Cea708 parser. |
const uint8_t * | subtitle_data | Subtitle data of MLMediaPlayerSubtitleData. |
uint32_t | subtitle_data_size | Subtitle data size of MLMediaPlayerSubtitleData. |
Returns
MLResult | MLResult_InvalidParam | the input parameter(s) is(are) wrong. |
MLResult | MLResult_Ok | the operation was successful. |
MLResult | MLMediaGenericResult_NoInit | Cea708 parser was not properly built or initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaCea708ParserDestroy
MLResult MLMediaCea708ParserDestroy(
MLHandle cc_handle
)
Release Cea708 parser object.
Parameters
MLHandle | cc_handle | A handle to a Cea708 parser. |
Returns
MLResult | MLResult_InvalidParam | cc_handle is wrong or not found. |
MLResult | MLResult_Ok | internal Cea708 parser object was released successfully. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaCea708ParserSetEmitEventCallback
MLResult MLMediaCea708ParserSetEmitEventCallback(
MLHandle cc_handle,
MLMediaCea708ParserEmitEventCallback on_emit_event_callback,
void * data
)
Set callback to get notified when a caption event has generated.
Parameters
MLHandle | cc_handle | A handle to a Cea708 parser. |
MLMediaCea708ParserEmitEventCallback | on_emit_event_callback | Function pointer for event callback. See MLMediaCea708ParserEmitEventCallback() callback declaration and comments for explanation on expected callback parameters. This can be 'NULL' to unset the callback. |
void * | data | Custom data to be returned when callback is fired. |
Returns
MLResult | MLResult_InvalidParam | Passed cc_handle handle was not found. |
MLResult | MLResult_Ok | Callback was successfully set. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaCodecCallbacksExInit
static inline void MLMediaCodecCallbacksExInit(
MLMediaCodecCallbacksEx * inout_callbacks
)
Initializes MLMediaCodecCallbacksEx with default values.
Parameters
MLMediaCodecCallbacksEx * | inout_callbacks | MediaCodec Callback structure defined by MLMediaCodecCallbacksEx that needs to be initialized. |
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecOutputFrameListenerInit
static inline void MLMediaCodecOutputFrameListenerInit(
MLMediaCodecOutputFrameListener * inout_callbacks
)
Initializes MLMediaCodecOutputFrameListener with default values.
Parameters
MLMediaCodecOutputFrameListener * | inout_callbacks | MediaCodec Callback structure defined by MLMediaCodecOutputFrameListener that needs to be initialized. |
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecCryptoInfoInit
static inline void MLMediaCodecCryptoInfoInit(
MLMediaCodecCryptoInfo * inout_crypto_info
)
Initializes MLMediaCodecCryptoInfo with default values.
Parameters
MLMediaCodecCryptoInfo * | inout_crypto_info | CryptoInfo structure defined by MLMediaCodecCryptoInfo that needs to be initialized. |
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecCreateCryptoInfo
MLResult MLMediaCodecCreateCryptoInfo(
const MLMediaCodecCryptoInfo * crypto_info,
MLHandle * out_crypto_info_handle
)
Create a Crypto Info object.
Parameters
const MLMediaCodecCryptoInfo * | crypto_info | Input Structure that encapsulates sample crypto info. |
MLHandle * | out_crypto_info_handle | Upon successful return will point to handle to the created Crypto info. Or else, it will point to ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
Required Permissions:
- None
The CryptoInfo object should be released by calling MLMediaCodecReleaseCryptoInfo.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecReleaseCryptoInfo
MLResult MLMediaCodecReleaseCryptoInfo(
MLHandle crypto_info_handle
)
Release the Crypto Info created by MLMediaCodecCreateCryptoInfo.
Parameters
MLHandle | crypto_info_handle | Handle to Crypto info that needs to be released. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecCreateCodec
MLResult MLMediaCodecCreateCodec(
MLMediaCodecCreation method,
MLMediaCodecType type,
const char * name_str,
MLHandle * out_handle
)
Create a new MLMediaCodec.
Parameters
MLMediaCodecCreation | method | One of the creation methods defined by MLMediaCodecCreation. |
MLMediaCodecType | type | One of the codec types defined by MLMediaCodecType. |
const char * | name_str | If creating a codec by name, this is the name of the codec. If creating a codec by type, this is the mime type of the codec. Refer to APIs in MLMediaCodecList for retrieving the list of names and mime types of supported codecs. |
MLHandle * | out_handle | Upon successful return will point to handle to the created MLMediaCodec. Or else, it will point to ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | MLMediaCodec 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.
MLMediaCodecDestroy
MLResult MLMediaCodecDestroy(
MLHandle handle
)
Destroy a MLMediaCodec.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
Returns
MLResult | MLResult_InvalidParam | MLMediaCodec object is invalid. |
MLResult | MLResult_Ok | MLMediaCodec 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.
MLMediaCodecSetCallbacksEx
MLResult MLMediaCodecSetCallbacksEx(
MLHandle handle,
MLMediaCodecCallbacksEx * callbacks,
void * user_data
)
Set callbacks to notify client codec events. Client needs to implement the callback functions.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
MLMediaCodecCallbacksEx * | callbacks | Set of codec callbacks. Can be set to NULL to unset all the callback altogether. |
void * | user_data | Pointer to user payload data. |
Returns
MLResult | MLResult_InvalidParam | MLMediaCodec object is invalid. |
MLResult | MLResult_Ok | callback was set successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
If the client intends to use the codec component in asynchronous mode, a valid callback should be provided before MLMediaCodecConfigure is called. When asynchronous callback is enabled, the client should not call:
- MLMediaCodecDequeueInputBuffer
- MLMediaCodecDequeueOutputBuffer Calling those functions will return MLMediaGenericResult_InvalidOperation. Also, MLMediaCodecFlush() behaves differently in asynchronous mode. After calling MLMediaCodecFlush, you must call MLMediaCodecStart() to "resume" receiving input buffers, even if an input surface was created.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecSetOutputFrameListener
MLResult MLMediaCodecSetOutputFrameListener(
MLHandle handle,
MLMediaCodecOutputFrameListener * callbacks,
void * user_data
)
Registers a callback to be invoked when an output frame is available or rendered on the output surface.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
MLMediaCodecOutputFrameListener * | callbacks | Set of codec callbacks. Can be set to NULL to unset all the callback altogether. |
void * | user_data | Pointer to user payload data. |
Returns
MLResult | MLResult_InvalidParam | MLMediaCodec object is invalid. |
MLResult | MLResult_Ok | callback was set successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
This method can be called in any codec state, but will only have an effect in the "Executing" state for codecs that render buffers to the output surface.
Note:
- This callback is for informational purposes only: to get precise render timing samples, and can be significantly delayed and batched. Some frames may have been rendered even if there was no callback generated.
- This callback doesn't set the codec to operate in asynchrous mode.
- Since audio codec doesn't use Surface, this callback as no effect when audio codec is instantiated.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecGetName
MLResult MLMediaCodecGetName(
MLHandle handle,
char * out_name
)
Obtain the name of the created codec.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
char * | out_name | Pointer to the user-maintained buffer for storing the output C-style name string. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | MLMediaCodec name was retrieved successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
User shall allocate at least MAX_CODEC_NAME_SIZE bytes of memory for storing the output name string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecConfigure
MLResult MLMediaCodecConfigure(
MLHandle handle,
MLHandle format_handle,
MLHandle surface_handle,
MLHandle crypto_handle
)
Configure the MLMediaCodec.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
MLHandle | format_handle | MLHandle to the #MediaFormat object. |
MLHandle | surface_handle | MLHandle to the Surface object. |
MLHandle | crypto_handle | MLHandle to the #MediaCrypto object. Pass 0 for clear content. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | MLMediaCodec was configured successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Encoder configuration: surface_handle and crypto_handle should be 0. Decoder Configuration: The surface_handle should be provided if using output surface. The crypto_handle should be provided for encrypted content.
The output surface can be:
- Native surface created by MLNativeSurfaceCreate().
- Native surface texture created by MLNativeSurfaceTextureCreate().
- The surface object created on an encoder using MLMediaCodecCreateInputSurface().
- Pass 0 or ML_INVALID_HANDLE if the codec does not generate raw video output (e.g. not a video decoder) and/or if you want to configure the codec with CPU bound output buffers. NOTE that:
- For the first 3 cases (above), the decoded output of the decoder will be consumed direclty by the surface. This allows implementation of fast, zero-copy raw video consumption operation. Also, calling MLMediaCodecGetOutputBufferPointer will return MLMediaGenericResult_InvalidOperation
- For the last case, user will have to explictly consume the output of the decoder by calling MLMediaCodecGetOutputBufferPointer.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 6
MLMediaCodecStart
MLResult MLMediaCodecStart(
MLHandle handle
)
Start the codec.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
Returns
MLResult | MLResult_InvalidParam | MLMediaCodec object is invalid. |
MLResult | MLResult_Ok | MLMediaCodec was started successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Shall be called upon successful configuration.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecStop
MLResult MLMediaCodecStop(
MLHandle handle
)
Stop the codec.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
Returns
MLResult | MLResult_InvalidParam | MLMediaCodec object is invalid. |
MLResult | MLResult_Ok | MLMediaCodec was stopped successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Codec is stopped and not destroyed, therefore can be started again.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecReset
MLResult MLMediaCodecReset(
MLHandle handle
)
Reset the codec.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
Returns
MLResult | MLResult_InvalidParam | MLMediaCodec object is invalid. |
MLResult | MLResult_Ok | MLMediaCodec was stopped successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
This will reset the codec to initial (Uninitialized) state. Call this when:
- Input or output queuing operation fails.
- An error is notified through the asynchronous event MLMediaCodecCallbacks.on_error. Resetting a codec can fail when an unrecoverable error occurs (which is Hardare codec implementation specific), in which case codec will be in unusable state and should be destroyed using MLMediaCodecDestroy.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecFlush
MLResult MLMediaCodecFlush(
MLHandle handle
)
Flush the both the input and output ports of the codec.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
Returns
MLResult | MLResult_InvalidParam | MLMediaCodec object is invalid. |
MLResult | MLResult_Ok | MLMediaCodec was flushed successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Upon return, all indices previously returned in calls to MLMediaCodecDequeueInputBuffer() and MLMediaCodecDequeueOutputBuffer() become invalid, and all buffers are owned by the codec.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecSetParameters
MLResult MLMediaCodecSetParameters(
MLHandle handle,
MLHandle format_handle
)
Communicate additional parameter changes to a codec.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
MLHandle | format_handle | MLHandle to the MLMediaFormat containing the parameters to set. |
Returns
MLResult | MLResult_InvalidParam | At least one of the input parameters or one of the format parameter values is invalid. |
MLResult | MLResult_Ok | The operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_InvalidOperation | At least one format parameter is not applicable. |
MLResult | MLMediaGenericResult_NoInit | MLMediaCodec was not initialized. |
Dynamically modify or add configuration parameters to a configured or started codec.
Create an empty MLMediaFormat object using MLMediaFormatCreate() and set the appropriate parameters. For more details, refer to ml_media_format.h.
Parameters and associated values that may be applied are:
- MLMediaFormat_Key_Parameter_Video_Bitrate: Dynamically change the video encoder's target bitrate. Associated value is an int32_t representing the new encode bitrate in bits-per-second. Applicable to any video encoder.
- MLMediaFormat_Key_Parameter_Request_Sync_Frame: Communicate to the encoder to produce a sync frame soon. Associated value is an int32_t with the value 0. Applicable to any video encoder.
- MLMediaFormat_Key_Parameter_Drop_After: Set the time after which samples should be dropped and not submitted to the encoder. Associated value is an int64_t value representing the system time in micro-seconds. Applicable to an encoder receiving input from a surface.
- MLMediaFormat_Key_Parameter_Drop_Before: Set the time before which samples should be dropped and not submitted to the encoder. Associated value is an int64_t value representing the system time in micro-seconds. Applicable to an encoder receiving input from a surface.
- MLMediaFormat_Key_Parameter_Set_Suspend: Temporarily suspend or resume video encoding of input data. When suspended, all incoming buffers are discarded until suspension is lifted. Used in conjunction with MLMediaFormat_Key_Parameter_Set_Suspend_Time to speficy the time of suspension or resumption. Associated value is an int32_t value with the value 1 or 0 to suspend or resume, respectively. Applicable to an encoder receiving input from a surface.
- MLMediaFormat_Key_Parameter_Set_Suspend_Time: Specifies the time when the action associated with the value of MLMediaFormat_Key_Parameter_Set_Suspend should take effect. Associated value is an int64_t value representing the system time, in micro-seconds, indicating when suspendion or resumption takes effect. Applicable to an encoder receiving input from a surface.
- MLMediaFormat_Key_Parameter_Time_Offset: Describes an offset to adjust timestamps going forward on a video endcoder. Associated value is an int64_t value representing the offset timestamp, in micro-seconds. Applicable to an encoder receiving input from a surface.
- MLMediaFormat_Key_Operating_Rate: Describes the rate at which a codec is expected to operate. For video, this is the operating frame rate; for audio, this is the sample rate. Associated value is a float value representing either the frames-per-second or the samples-per-second for video or audio, respectively. Applicable to any codec. Note: This key is ignored if it fails to apply. Note: This key can also be set as part of the MLMediaFormat provided at configure-time.
- MLMediaFormat_Key_Intra_Refresh_Period: Describes the period of intra refresh in frames. Associated value is a int32_t value representing the period in frames after which the whole frame is completely refreshed. Applicable to any video encoder. Note: This key is ignored if not supported by the codec or it fails to apply. Note: This key can also be set as part of the MLMediaFormat provided at configure-time.
- MLMediaFormat_Key_Latency: Describes the latency, in frames, a video encoder should have queued up before outputting at least one output frame. Associated value is an int32_t value representing the latency, in number of frames. Applicable to any video encoder. Note: This key is ignored if not supported by the codec or it fails to apply. Note: This key can also be set as part of the MLMediaFormat provided at configure-time.
Deprecated since 1.4.0. Scheduled for removal.
Some of these parameter changes may silently fail to apply. Unless specified below, an error will be returned on unsuccesful application.
API Level:
- 9
MLMediaCodecGetInputBufferPointer
MLResult MLMediaCodecGetInputBufferPointer(
MLHandle handle,
int64_t buffer_index,
uint8_t ** out_buffer_ptr,
size_t * out_buffer_size
)
Obtain a writable buffer pointer for a dequeued input buffer index to contain the input data.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
int64_t | buffer_index | The index of a client-owned input buffer previously returned from a call to MLMediaCodecDequeueInputBuffer(). |
uint8_t ** | out_buffer_ptr | Pointer to returned input buffer. |
size_t * | out_buffer_size | Size of returned input buffer. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Input buffer pointer is retrieved successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_InvalidOperation | Buffer pointer could not be retrieved. Note that this API returns MLMediaGenericResult_InvalidOperation especially if video encoder has hardware input surface (see MLMediaCodecCreateInputSurface), and thus, out_buffer_ptr will be set to NULL and out_buffer_size set to 0. |
Required Permissions:
- None
After calling this method any buffer pointer previously returned for the same input index MUST no longer be used.
Note: For VIDEO encoder, this API will fail if an input surface was created by MLMediaCodecCreateInputSurface (see return value documentation below).
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecGetOutputBufferPointer
MLResult MLMediaCodecGetOutputBufferPointer(
MLHandle handle,
int64_t buffer_index,
const uint8_t ** out_buffer_ptr,
size_t * out_buffer_size
)
Obtain a read-only buffer pointer for a dequeued output buffer index.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
int64_t | buffer_index | The index of a client-owned output buffer previously returned from a call to MLMediaCodecDequeueOutputBuffer(). |
const uint8_t ** | out_buffer_ptr | Pointer to returned output buffer. |
size_t * | out_buffer_size | Size of returned output buffer. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Output buffer pointer is retrieved successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_InvalidOperation | Buffer pointer could not be retrieved. Note that this API returns MLMediaGenericResult_InvalidOperation especially if codec was VIDEO and configured with a hardware surface using MLMediaCodecConfigure(), and thus, out_buffer_ptr will be set to NULL and out_buffer_size set to 0 since decoded buffer lives in GPU memory and is not accessible via a pointer. |
Required Permissions:
- None
The position and limit of the returned buffer are set to the valid output data. After calling this method any buffer pointer previously returned for the same output index MUST no longer be used.
Note: For VIDEO decoder, this API will fail if codec was configured with a hardware surface (see return value documentation below).
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecQueueInputBuffer
MLResult MLMediaCodecQueueInputBuffer(
MLHandle handle,
int64_t buffer_index,
int64_t offset,
size_t size,
uint64_t time_us,
int flags
)
After filling a range of the input buffer at the specified index submit it to the component.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
int64_t | buffer_index | Index of a client-owned input buffer previously returned in a call to MLMediaCodecDequeueInputBuffer(). |
int64_t | offset | Byte offset into the input buffer at which the data starts. |
size_t | size | Number of bytes of valid input data. |
uint64_t | time_us | Presentation timestamp in microseconds for this buffer. This is normally the media time at which this buffer should be presented (rendered). |
int | flags | A bitmask of flags defined by MLMediaCodecBufferFlag. While not prohibited, most codecs do not use the MLMediaCodecBufferFlag_KeyFrame flag for input buffers. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Intput buffer is queued successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Once an input buffer is queued to the codec, it MUST NOT be used until it is later retrieved by MLMediaCodecGetInputBufferPointer() in response to a MLMediaCodecDequeueInputBuffer() return value.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecQueueSecureInputBuffer
MLResult MLMediaCodecQueueSecureInputBuffer(
MLHandle handle,
int64_t buffer_index,
int64_t offset,
MLHandle crypto_info_handle,
uint64_t time_us,
int flags
)
Similar to queueInputBuffer but submits a buffer that is potentially encrypted.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
int64_t | buffer_index | Index of a client-owned input buffer previously returned in a call to MLMediaCodecDequeueInputBuffer(). |
int64_t | offset | Byte offset into the input buffer at which the data starts. |
MLHandle | crypto_info_handle | Metadata required to facilitate decryption, the object can be reused immediately after this call returns. |
uint64_t | time_us | Presentation timestamp in microseconds for this buffer. This is normally the media time at which this buffer should be presented (rendered). |
int | flags | A bitmask of flags defined by MLMediaCodecBufferFlag. While not prohibited, most codecs do not use the MLMediaCodecBufferFlag_KeyFrame flag for input buffers. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Secure Intput buffer is queued 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
MLMediaCodecDequeueInputBuffer
MLResult MLMediaCodecDequeueInputBuffer(
MLHandle handle,
int64_t timeout_us,
int64_t * out_buffer_index
)
Dequeue an input buffer from buffer queue.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
int64_t | timeout_us | Timeout in microseconds. Negative timeout indicates "infinite". |
int64_t * | out_buffer_index | Index of an Input buffer from buffer queue, or MLMediaCodec_TryAgainLater status. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Intput buffer is dequeued successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_InvalidOperation | if the codec is configured to operate in async mode. |
Required Permissions:
- None
This method will return immediately if timeoutUs == 0, wait indefinitely for the availability of an input buffer if timeoutUs < 0 or wait up to "timeoutUs" microseconds if timeoutUs > 0.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecDequeueOutputBuffer
MLResult MLMediaCodecDequeueOutputBuffer(
MLHandle handle,
MLMediaCodecBufferInfo * out_buffer_info,
int64_t timeout_us,
int64_t * out_buffer_index
)
Dequeue an output buffer from buffer queue.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
MLMediaCodecBufferInfo * | out_buffer_info | Will be filled with buffer meta data. |
int64_t | timeout_us | Timeout in microseconds. Negative timeout indicates "infinite". |
int64_t * | out_buffer_index | Index of an output buffer from buffer queue, or one of the statuses defined by MLMediaCodecOutputBufferStatus. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Output buffer is dequeued successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_InvalidOperation | if the codec is configured to operate in async mode. |
Required Permissions:
- None
This method will return immediately if timeoutUs == 0, wait indefinitely for the availability of an input buffer if timeoutUs < 0 or wait up to "timeoutUs" microseconds if timeoutUs > 0.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecGetInputFormat
MLResult MLMediaCodecGetInputFormat(
MLHandle handle,
MLHandle * out_format_handle
)
Obtain input format supported by the codec.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
MLHandle * | out_format_handle | Input format supported by the codec. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Input Media format is retrieved successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Call this function, after successful codec configuration, to determine what optional configuration parameters were supported by the codec.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecGetOutputFormat
MLResult MLMediaCodecGetOutputFormat(
MLHandle handle,
MLHandle * out_format_handle
)
Return output format supported by the codec, or the format to which the configuration has changed.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
MLHandle * | out_format_handle | Output format supported by the codec, or the format to which the configuration has changed. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Output Media format is retrieved successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecCreateInputSurface
MLResult MLMediaCodecCreateInputSurface(
MLHandle handle,
MLHandle * out_input_surface_handle
)
Create an input surface for a hardware encoder.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
MLHandle * | out_input_surface_handle | MLHandle to created input native surface. Valid only if result is MLResult_Ok. |
Returns
MLResult | MLResult_AllocFailed | The operation failed to allocate the surface. |
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Input input surface was created successfully. |
MLResult | MLMediaGenericResult_AlreadyExists | An input surface has already been created for the given handle. |
MLResult | MLMediaGenericResult_InvalidOperation | MLMediaCodec is not an encoder. |
MLResult | MLMediaGenericResult_NoInit | MLMediaCodec was not initialized. |
MLResult | MLMediaGenericResult_UnspecifiedFailure | Input surface could not be created. |
Required Permissions:
- None
Requests an input surface to use as the input to an encoder, in place of input buffers.
This API must only be called after MLMediaCodecConfigure() and before MLMediaCodecStart() otherwise the operation will fail and an input surface cannot be created.
An input surface allows video consumers, such as a video encoder, to process raw input video buffers natively. The input surface is intended to act as a destination surface for your input data.
When using an input surface, there are no accessible input buffers, as buffers are automatically passed from the input surface to the codec. In synchronous mode, calling MLMediaCodecDequeueInputBuffer() will return MLMediaGenericResult_InvalidOperation. In asynchronous mode, the client will not be notified when an input buffer is available (i.e. the on_input_buffer_available callback will not fire).
The returned input surface can be passed as a destination surface to a decoder when calling MLMediaCodecConfigure(). Decoded output of the decoder can be consumed direclty as input to an encoder without copying. This allows implementation of fast, zero-copy transcoding.
The returned input surface can also be passed as a destination surface to:
- A video capture session when using MLCameraConnectFlag_CamOnly.
- A virtual capture session when using MLCameraConnectFlag_VirtualOnly .
- A mixed reality capture session when using MLCameraConnectFlag_MR. Captured raw video frames will be consumed directly as input to an encoder without copying. The user of this API is responsible for calling #MLMediaCodecReleaseSurface() on the Surface when done.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 9
MLMediaCodecDestroyInputSurface
MLResult MLMediaCodecDestroyInputSurface(
MLHandle handle,
MLHandle input_surface_handle
)
Release the Surface that was created by MLMediaCodecCreateInputSurface.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
MLHandle | input_surface_handle | MLHandle to the internal Surface object. |
Returns
MLResult | MLResult_InvalidParam | MLHandle is invalid. |
MLResult | MLResult_Ok | Surface object was successfully released. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_InvalidOperation | MLMediaCodec is not an encoder. |
MLResult | MLMediaGenericResult_NoInit | MLMediaCodec was not initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 9
MLMediaCodecSignalEndOfInputStream
MLResult MLMediaCodecSignalEndOfInputStream(
MLHandle handle
)
Signal end-of-stream on input to a surface.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec. |
Returns
MLResult | MLResult_InvalidOperation | MLMediaCodec is not an encoder or MLMediaCodec is not receving input from a surface. |
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | The operation was successful. |
MLResult | MLMediaGenericResult_NoInit | MLMediaCodec was not initialized. |
This may only be used with encoders receiving input from a surface created by MLMediaCodecCreateInputSurface().
Equivalent to submitting an empty buffer with MLMediaCodecBufferFlag_EOS set when queueing an input buffer.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 9
MLMediaCodecReleaseOutputBuffer
MLResult MLMediaCodecReleaseOutputBuffer(
MLHandle handle,
int64_t buffer_index,
bool render
)
Release buffer to codec or to render it on output surface.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec object. |
int64_t | buffer_index | Index of a client-owned output buffer previously returned from a call to MLMediaCodecDequeueOutputBuffer(). |
bool | render | If a valid surface was specified when configuring the codec, passing true renders this output buffer to the surface. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Output buffer was released successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
If codec is configured with an output surface, setting render to true
will send the buffer to that output surface. The surface will release the buffer back to the codec once it is no longer used/displayed.
Once an output buffer is released to codec, it MUST NOT be used until it is later retrieved by MLMediaCodecGetOutputBufferPointer() in response to a MLMediaCodecDequeueOutputBuffer() return value.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecReleaseOutputBufferAtTime
MLResult MLMediaCodecReleaseOutputBufferAtTime(
MLHandle handle,
int64_t buffer_index,
int64_t timestamp_ns
)
Update surface timestamp and returns it to the codec to render it on the output surface. If codec is not configured with output surface, this call simply returns the buffer to codec.
Parameters
MLHandle | handle | MLHandle to the MLMediaCodec object. |
int64_t | buffer_index | Index of a client-owned output buffer previously returned from a call to MLMediaCodecDequeueOutputBuffer(). |
int64_t | timestamp_ns | The timestamp in nanoseconds to associate with this buffer when it is sent to the Surface. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Output buffer was released successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The timestamp may have special meaning depending on the destination surface.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaCodecListCountCodecs
MLResult MLMediaCodecListCountCodecs(
uint64_t * out_codec_count
)
Obtain the number of available codecs.
Parameters
uint64_t * | out_codec_count | Number of available codecs. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecListIsSoftwareCodec
MLResult MLMediaCodecListIsSoftwareCodec(
const char * codec_name,
bool * out_val
)
Determine whether a codec is a software codec.
Parameters
const char * | codec_name | Name of the codec. |
bool * | out_val | Returns true if the codec is a software codec and false otherwise. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecListGetMatchingCodecs
MLResult MLMediaCodecListGetMatchingCodecs(
const char * mime,
bool is_encoder,
MLMediaCodecListCodecTypeFlag flag,
MLMediaCodecListQueryResults * out_matching_codecs
)
Obtain a list of matching codecs for a given codec mime.
Parameters
const char * | mime | Codec mime. |
bool | is_encoder | Set to true if querying for encoder and false otherwise. |
MLMediaCodecListCodecTypeFlag | flag | Whether querying for software-only or hardware-only, defined by MLMediaCodecListCodecTypeFlag. |
MLMediaCodecListQueryResults * | out_matching_codecs | List of codecs supporting the given mime. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The memory used to store the list is maintained by the library. User shall call MLMediaCodecListQueryResultsRelease() to release it.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecListGetCodecByType
MLResult MLMediaCodecListGetCodecByType(
const char * type,
bool is_encoder,
uint64_t start_index,
int64_t * out_index
)
Obtain the codec matching the given codec type from the codec list.
Parameters
const char * | type | Codec mime. |
bool | is_encoder | Set to true if querying for encoder and false otherwise. |
uint64_t | start_index | Index from which to search in the codec list. The number shall be between 0 and number of available codecs. |
int64_t * | out_index | Index of the matching codec or -2. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecListGetCodecByName
MLResult MLMediaCodecListGetCodecByName(
const char * name,
int64_t * out_index
)
Obtain the codec from the codec matching the given codec name from the codec list.
Parameters
const char * | name | Codec name. |
int64_t * | out_index | Index of the matching codec or -2. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecListIsEncoder
MLResult MLMediaCodecListIsEncoder(
uint64_t index,
bool * out_val
)
Confirm whether a component is an Encoder or Decoder.
Parameters
uint64_t | index | Index of the codec in the codec list. The number shall be between 0 and number of available codecs. |
bool * | out_val | Returns true if the codec is an encoder and false otherwise. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecListGetCodecName
MLResult MLMediaCodecListGetCodecName(
uint64_t index,
char * out_name
)
Obtain a codec name.
Parameters
uint64_t | index | Index of the codec in the codec list. The number shall be between 0 and number of available codecs. |
char * | out_name | Pointer to the user-maintained buffer for storing the output C-style name string. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
User shall allocate at least MAX_CODEC_NAME_LENGTH bytes of memory for storing the output name string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecListGetSupportedMimes
MLResult MLMediaCodecListGetSupportedMimes(
uint64_t index,
MLMediaCodecListQueryResults * out_supported_mimes
)
Obtain the list of mime types supported by a codec.
Parameters
uint64_t | index | Index of the codec in the codec list. The number shall be between 0 and number of available codecs. |
MLMediaCodecListQueryResults * | out_supported_mimes | List of supported mimes. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The memory used to store the list is maintained by the library. User shall call MLMediaCodecListQueryResultsRelease() to release it.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecListGetCapabilityFlag
MLResult MLMediaCodecListGetCapabilityFlag(
uint64_t index,
const char * mime,
MLMediaCodecListCapabilityFlag * out_capability_flag
)
Obtain the capability flag for a codec.
Parameters
uint64_t | index | Index of the codec in the codec list. The number shall be between 0 and number of available codecs. |
const char * | mime | Mime type of the codec being queried. |
MLMediaCodecListCapabilityFlag * | out_capability_flag | Codec capability flag defined by MLMediaCodecListCapabilityFlag. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecListGetSecureCodecName
MLResult MLMediaCodecListGetSecureCodecName(
const char * mime,
bool is_decoder,
char * out_name
)
Obtain the name of a secure codec for the given mime type.
Parameters
const char * | mime | Mime type of the codec. |
bool | is_decoder | Set to true if querying for decoder and false otherwise. |
char * | out_name | Pointer to the user-maintained buffer for storing the output C-style name string. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
User shall allocate at least MAX_CODEC_NAME_LENGTH bytes of memory for storing the output name string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecListQueryResultsRelease
MLResult MLMediaCodecListQueryResultsRelease(
MLMediaCodecListQueryResults * query_results
)
Release the query results.
Parameters
MLMediaCodecListQueryResults * | query_results | Query results such as the list of codecs acquired by MLMediaCodecListGetMatchingCodecs() or the list of supported mime types acquired by MLMediaCodecListGetSupportedMimes(). |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaCodecListGetSupportedProfileLevels
MLResult MLMediaCodecListGetSupportedProfileLevels(
uint64_t index,
const char * mime,
MLMediaCodecListProfileLevel ** out_profile_levels,
size_t * out_profile_levels_size
)
Obtain the supported profile levels for a codec.
Parameters
uint64_t | index | Index of the codec in the codec list. The number shall be between 0 and number of available codecs. |
const char * | mime | Mime type of the codec being queried. |
MLMediaCodecListProfileLevel ** | out_profile_levels | Codec supported profile levels defined by MLMediaCodecListProfileLevel. |
size_t * | out_profile_levels_size | Number of profile levels. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
User shall call MLMediaCodecListProfileLevelsRelease() to release it.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 6
MLMediaCodecListProfileLevelsRelease
MLResult MLMediaCodecListProfileLevelsRelease(
MLMediaCodecListProfileLevel * profile_levels
)
Release profile levels.
Parameters
MLMediaCodecListProfileLevel * | profile_levels | The return value of MLMediaCodecListGetSupportedProfileLevels(). |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 6
MLMediaCodecListGetSupportedColorFormats
MLResult MLMediaCodecListGetSupportedColorFormats(
uint64_t index,
const char * mime,
uint32_t ** out_color_formats,
size_t * out_color_formats_size
)
Obtain the supported color formats for a codec. All the supported color formats are defined by MLMediaCodecColorFormat.
Parameters
uint64_t | index | Index of the codec in the codec list. The number shall be between 0 and number of available codecs. |
const char * | mime | Mime type of the codec being queried. |
uint32_t ** | out_color_formats | Codec supported color formats of type MLMediaCodecColorFormat. |
size_t * | out_color_formats_size | Number of color formats. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
User shall call MLMediaCodecListColorFormatsRelease() to release it.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 6
MLMediaCodecListColorFormatsRelease
MLResult MLMediaCodecListColorFormatsRelease(
uint32_t * color_formats
)
Release color formats.
Parameters
uint32_t * | color_formats | The return value of MLMediaCodecListGetSupportedColorFormats(). |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 6
MLMediaCodecListGetSupportedBitrateModes
MLResult MLMediaCodecListGetSupportedBitrateModes(
uint64_t index,
const char * mime,
MLMediaCodecBitrateMode ** out_bitrate_modes,
size_t * out_bitrate_modes_size
)
Obtain the supported bitrate modes for a codec.
Parameters
uint64_t | index | Index of the codec in the codec list. The number shall be between 0 and number of available codecs. |
const char * | mime | Mime type of the codec being queried. |
MLMediaCodecBitrateMode ** | out_bitrate_modes | Codec supported Bitrate modes defined by MLMediaCodecBitrateMode. |
size_t * | out_bitrate_modes_size | Number of Bitrate modes. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
User shall call MLMediaCodecBitrateModesRelease() to release it.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 9
MLMediaCodecBitrateModesRelease
MLResult MLMediaCodecBitrateModesRelease(
MLMediaCodecBitrateMode * bitrate_modes
)
Release Bitrate modes.
Parameters
MLMediaCodecBitrateMode * | bitrate_modes | The return value of MLMediaCodecListGetSupportedBitrateModes(). |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 9
MLMediaCodecListIsAdaptivePlaybackSupported
MLResult MLMediaCodecListIsAdaptivePlaybackSupported(
uint64_t index,
const char * mime,
bool * out_supported
)
Check whether Adaptive playback is supported.
Parameters
uint64_t | index | Index of the codec in the codec list. The number shall be between 0 and number of available codecs. |
const char * | mime | Mime type of the codec being queried. |
bool * | out_supported | Returns true if supported, false otherwise. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
This function is used to query a video decoder to see whether it supports seamless resolution changes through Adaptive streaming. If the component is an audio decoder or encoder, it will always return false.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 9
MLMediaCodecListIsSecurePlaybackSupported
MLResult MLMediaCodecListIsSecurePlaybackSupported(
uint64_t index,
const char * mime,
bool * out_supported
)
Check whether Secure playback is supported.
Parameters
uint64_t | index | Index of the codec in the codec list. The number shall be between 0 and number of available codecs. |
const char * | mime | Mime type of the codec being queried. |
bool * | out_supported | Returns true if supported, false otherwise. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
If the component is an encoder, it will always return false.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 9
MLMediaCodecListIsIntraRefreshSupported
MLResult MLMediaCodecListIsIntraRefreshSupported(
uint64_t index,
const char * mime,
bool * out_supported
)
Check whether Intra Refresh is supported.
Parameters
uint64_t | index | Index of the codec in the codec list. The number shall be between 0 and number of available codecs. |
const char * | mime | Mime type of the codec being queried. |
bool * | out_supported | Returns true if supported, false otherwise. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
If the component is Decoder, it will always return false.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 9
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.
MLMediaDataSourceCreate
MLResult MLMediaDataSourceCreate(
MLMediaDataSourceReadAt read_at,
MLMediaDataSourceGetSize get_size,
MLMediaDataSourceClose close,
void * context,
MLHandle * out_handle
)
Create a new MediaDataSource object.
Parameters
MLMediaDataSourceReadAt | read_at | MLMediaDataSourceReadAt callback. |
MLMediaDataSourceGetSize | get_size | MLMediaDataSourceGetSize callback. |
MLMediaDataSourceClose | close | MLMediaDataSourceClose callback. |
void * | context | User data to be passed to callbacks. |
MLHandle * | out_handle | The MLHandle to the new source object created. Only valid if result is MLResult_Ok. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | if operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaDataSourceDestroy
MLResult MLMediaDataSourceDestroy(
MLHandle media_data_source
)
Destroy a #MediaDataSource object.
Parameters
MLHandle | media_data_source | MLHandle to the #MediaDataSource object to destroy. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | if operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
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.
MLMediaExtractorCreate
MLResult MLMediaExtractorCreate(
MLHandle * out_handle
)
Create a new MLMediaExtractor.
Parameters
MLHandle * | out_handle | A handle to the created MLMediaExtractor. If there is an error during creation, it will return ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_AllocFailed | If MediaExtractor handle cannot be allocated. |
MLResult | MLResult_InvalidParam | If out_handle is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorDestroy
MLResult MLMediaExtractorDestroy(
MLHandle handle
)
Destroy a MLMediaExtractor.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor object. |
Returns
MLResult | MLResult_InvalidParam | If handle is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSetDataSourceForPath
MLResult MLMediaExtractorSetDataSourceForPath(
MLHandle handle,
const char * path
)
Set a local file path as the data source.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
const char * | path | Content path of the file. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The path should be an absolute path and should reference a world-readable file.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSetDataSourceForURI
MLResult MLMediaExtractorSetDataSourceForURI(
MLHandle handle,
const char * uri
)
Set a URI string as the data source.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
const char * | uri | C-style string representing the URI complete string. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_PermissionDenied | Necessary permission is missing. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- android.permission.INTERNET (protection level: normal)
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSetDataSourceForURIWithHeaders
MLResult MLMediaExtractorSetDataSourceForURIWithHeaders(
MLHandle handle,
const char * uri,
const char ** headers,
size_t len
)
Set a URI string as the data source.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
const char * | uri | C-style string representing the complete URL. |
const char ** | headers | Array of char * headers to be sent. |
size_t | len | Number of headers passed-in. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_PermissionDenied | Necessary permission is missing. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- android.permission.INTERNET (protection level: normal)
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSetDataSourceForFD
MLResult MLMediaExtractorSetDataSourceForFD(
MLHandle handle,
int fd,
int64_t offset,
int64_t length
)
Set the data source as the file-descriptor to use.
Parameters
MLHandle | handle | MLHandle to the MediaExtractor. |
int | fd | File-descriptor for the file to extract from. |
int64_t | offset | Offset in bytes into the file where the data to be extracted starts. |
int64_t | length | Length in bytes of the data to be extracted. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSetMediaDataSource
MLResult MLMediaExtractorSetMediaDataSource(
MLHandle handle,
MLHandle media_data_source
)
Sets the data source as user defined media data source.
Parameters
MLHandle | handle | MLHandle to the MediaExtractor. |
MLHandle | media_data_source | MLHandle returned by MLMediaDataSourceCreate(). |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_NameNotFound | If media_data_source cannot be found. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetDRMInitData
MLResult MLMediaExtractorGetDRMInitData(
MLHandle handle,
MLUUID drm_uuid,
MLMediaExtractorDRMSchemeInitData * out_drm_init_data
)
Extract DRM initialization data for a given DRM Scheme if it exists.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
MLUUID | drm_uuid | UUID of the DRM scheme. |
MLMediaExtractorDRMSchemeInitData * | out_drm_init_data | DRM initialization data pointer. To release the DRM initialization data upon successful return, call MLMediaExtractorReleaseDRMInitData(). |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorReleaseDRMInitData
MLResult MLMediaExtractorReleaseDRMInitData(
MLHandle handle,
MLMediaExtractorDRMSchemeInitData * drm_init_data
)
Release DRM initialization data which was previously retrieved.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
MLMediaExtractorDRMSchemeInitData * | drm_init_data | DRM initialization data that needs to be released. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetTrackCount
MLResult MLMediaExtractorGetTrackCount(
MLHandle handle,
uint64_t * out_track_count
)
Count the number of tracks found in the data source.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
uint64_t * | out_track_count | Number of tracks found in data source. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetTrackFormat
MLResult MLMediaExtractorGetTrackFormat(
MLHandle handle,
size_t index,
MLHandle * out_track_handle
)
Get the track format at the specified index.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
size_t | index | Index of the track. |
MLHandle * | out_track_handle | MLMediaFormat handle that represents track format. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSelectTrack
MLResult MLMediaExtractorSelectTrack(
MLHandle handle,
size_t index
)
Select a track for the subsequent operations.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
size_t | index | Index of the track. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Subsequent calls to MLMediaExtractorReadSampleData(), MLMediaExtractorGetSampleTrackIndex() and getSampleTime() only retrieve information for the subset of tracks selected. Selecting the same track multiple times has no effect, the track is only selected once.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorUnselectTrack
MLResult MLMediaExtractorUnselectTrack(
MLHandle handle,
size_t index
)
Unselect a track for the subsequent operations.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
size_t | index | Index of the track. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Subsequent calls to MLMediaExtractorReadSampleData(), MLMediaExtractorGetSampleTrackIndex() and getSampleTime() only retrieve information for the subset of tracks selected.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSeekTo
MLResult MLMediaExtractorSeekTo(
MLHandle handle,
int64_t time_us,
MLMediaSeekMode mode
)
All selected tracks seek near the requested time according to the specified mode.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
int64_t | time_us | Seek time. |
MLMediaSeekMode | mode | Seek mode defined by MLMediaSeekMode. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorAdvance
MLResult MLMediaExtractorAdvance(
MLHandle handle
)
Advance to the next sample.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
Returns
MLResult | MLResult_InvalidParam | If handle is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_FailedTransaction | If Advance operation failed, no more sample data is available (end of stream). |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorReadSampleData
MLResult MLMediaExtractorReadSampleData(
MLHandle handle,
uint8_t * byte_buf,
size_t buf_size,
size_t offset,
int64_t * out_data_size
)
Retrieve the current encoded sample and store it in the byte buffer starting at the given offset.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
uint8_t * | byte_buf | Destination byte buffer. |
size_t | buf_size | Size of the destination buffer. |
size_t | offset | Offset within the buffer. |
int64_t * | out_data_size | Sample size or -1 if no more samples are available. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetSampleTrackIndex
MLResult MLMediaExtractorGetSampleTrackIndex(
MLHandle handle,
int64_t * out_track_index
)
Return the track index the current sample originates from.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
int64_t * | out_track_index | Track index or -1 if no more samples are available. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetSampleTime
MLResult MLMediaExtractorGetSampleTime(
MLHandle handle,
int64_t * out_sample_time
)
Return the current sample's presentation time in microseconds.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
int64_t * | out_sample_time | Sample time or -1 if no more samples are available. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetSampleFlags
MLResult MLMediaExtractorGetSampleFlags(
MLHandle handle,
int * out_sample_flags
)
Return the current sample's flags.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
int * | out_sample_flags | Sample flag defined by MLMediaExtractorSampleFlag, or -1 if on failure. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetSampleCryptoInfo
MLResult MLMediaExtractorGetSampleCryptoInfo(
MLHandle handle,
MLHandle * out_info_handle
)
Return the current sample's Crypto info if has encrypted sample.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
MLHandle * | out_info_handle | On success it returns handle to Crypto info of the sample. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorReleaseCryptoInfo
MLResult MLMediaExtractorReleaseCryptoInfo(
MLHandle handle,
MLHandle * inout_info_handle
)
Release the Crypto Info.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
MLHandle * | inout_info_handle | handle to Crypto info that needs to be released. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetCachedDuration
MLResult MLMediaExtractorGetCachedDuration(
MLHandle handle,
int64_t * out_cached_duration
)
Return an estimate of how much data is presently cached in memoryexpressed in microseconds.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
int64_t * | out_cached_duration | Cached amount or -1 if that information is unavailable or not applicable (no cache). |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorHasCacheReachedEOS
MLResult MLMediaExtractorHasCacheReachedEOS(
MLHandle handle
)
Return true
if we are caching data and the cache has reached the end of the data stream (for now, a future seek may of course restart the fetching of data).
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
This API only returns a meaningful result if getCachedDuration() indicates the presence of a cache, i.e. does NOT return -1.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetPSSHInfoCount
MLResult MLMediaExtractorGetPSSHInfoCount(
MLHandle handle,
size_t * out_index
)
Get the Number of PSSH info if present.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
size_t * | out_index | On successful return contains number of PSSH entries. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The PSSH(Protection System Specific Header) contains a UUID representing a DRM scheme along with opaque data blob used for creating crypto session, which in turn used to configure codec.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetPSSHInfo
MLResult MLMediaExtractorGetPSSHInfo(
MLHandle handle,
size_t index,
MLMediaExtractorPSSHEntry * out_pssh_entry
)
Get the PSSH info if present. The PSSH(Protection System Specific Header) contains a UUID representing a DRM scheme along with opaque data blob used for creating crypto session, which in turn used to configure codec.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
size_t | index | Index of the PSSH info data element being retrieved. |
MLMediaExtractorPSSHEntry * | out_pssh_entry | Pointer to the PSSH info data element being retrieved. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Upon successful return, if a MLMediaExtractorPSSHEntry is returned, same should be released by calling MLMediaExtractorReleasePSSHInfo().
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorReleasePSSHInfo
MLResult MLMediaExtractorReleasePSSHInfo(
MLHandle handle,
MLMediaExtractorPSSHEntry * pssh_entry
)
Clear the PSSH info data.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
MLMediaExtractorPSSHEntry * | pssh_entry | Pointer to the PSSH info data element that needs to be released. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Clears the entire cached PSSH info data in the library.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatCreateVideo
MLResult MLMediaFormatCreateVideo(
const char * mime_type,
int width,
int height,
MLHandle * out_handle
)
Create a video format object.
Parameters
const char * | mime_type | Mime type of the content. |
int | width | Width of the content in pixels. |
int | height | Height of the content in pixels. |
MLHandle * | out_handle | A handle to the created video format object. If there is an error during creation, it will return ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_AllocFailed | If handle cannot be allocated. |
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatCreateAudio
MLResult MLMediaFormatCreateAudio(
const char * mime_type,
int sample_rate,
int channel_count,
MLHandle * out_handle
)
Create a audio format object.
Parameters
const char * | mime_type | Mime type of the content. |
int | sample_rate | Sample rate of the content. |
int | channel_count | Number of audio channels. |
MLHandle * | out_handle | A handle to the created audio format object. If there is an error during creation, it will return ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_AllocFailed | If handle cannot be allocated. |
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatCreateSubtitle
MLResult MLMediaFormatCreateSubtitle(
const char * mime_type,
const char * language,
MLHandle * out_handle
)
Create a subtitle format object.
Parameters
const char * | mime_type | Mime type of the content. |
const char * | language | Language of the content, using either ISO 639-1 or 639-2/T codes. Specify null or "und" if language information is only included in the content (This will also work if there are multiple language tracks in the content). |
MLHandle * | out_handle | A handle to the created subtitle format object. If there is an error during creation, it will return ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_AllocFailed | If handle cannot be allocated. |
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatCreate
MLResult MLMediaFormatCreate(
MLHandle * out_handle
)
Create an empty format object.
Parameters
MLHandle * | out_handle | A handle to the created empty format object. If there is an error during creation, it will return ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_AllocFailed | If handle cannot be allocated. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 9
MLMediaFormatCreateCopy
MLResult MLMediaFormatCreateCopy(
MLHandle handle,
MLHandle * out_handle
)
Create a copy of the format handle provided.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLHandle * | out_handle | A handle to the created copy of the format object. If there is an error during creation, it will return ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_AllocFailed | If handle cannot be allocated. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
Required Permissions:
- None
This can be particularly useful to persist the media format handle/object that was received through the callbacks (as life cycle of those media format objects are with in the callback context only).
The API call to make a copy ensures that the copied object exists until released with MLMediaFormatDestroy call.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaFormatDestroy
MLResult MLMediaFormatDestroy(
MLHandle handle
)
Destroy a MLMediaFormat object.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
Returns
MLResult | MLResult_InvalidParam | If handle is invalid. |
MLResult | MLResult_Ok | If MLMediaCodec 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.
MLMediaFormatObjectToString
MLResult MLMediaFormatObjectToString(
MLHandle handle,
char * out_string
)
Obtain the human readable representation of the format.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
char * | out_string | Buffer to which stringify the media format. Shouldn't be NULL. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
User shall allocate at least MAX_FORMAT_STRING_SIZE bytes of memory for storing the output format string. The format string contains a list of key-value pairs, which can be extracted individually via the suitable "GetKeyValue" APIs.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatGetKeyValueInt32
MLResult MLMediaFormatGetKeyValueInt32(
MLHandle handle,
MLMediaFormatKey name,
int32_t * out_key
)
Obtain the value of an integer key.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatKey | name | C-string representation of the key. Must be one of the MLMediaFormatKey tags defined above. |
int32_t * | out_key | Value of the key. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_NameNotFound | If name is not one of the media format key name. |
Required Permissions:
- None
For example, use MLMediaFormat_Key_Frame_Rate key to get the framerate of a video track.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatGetKeyValueInt64
MLResult MLMediaFormatGetKeyValueInt64(
MLHandle handle,
MLMediaFormatKey name,
int64_t * out_key
)
Obtain the value of a long key.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatKey | name | C-string representation of the key. Must be one of the MLMediaFormatKey tags defined above. |
int64_t * | out_key | Value of the key. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_NameNotFound | If name is not one of the media format key name. |
Required Permissions:
- None
For example, use MLMediaFormat_Key_Duration key to get duration of a track.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatGetKeyValueFloat
MLResult MLMediaFormatGetKeyValueFloat(
MLHandle handle,
MLMediaFormatKey name,
float * out_key
)
Obtain the value of an float key.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatKey | name | C-string representation of the key. Must be one of the MLMediaFormatKey tags defined above. |
float * | out_key | Value of the key. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_NameNotFound | If name is not one of the media format key name. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatGetKeySize
MLResult MLMediaFormatGetKeySize(
MLHandle handle,
MLMediaFormatKey name,
size_t * out_size
)
Obtain the size of a key.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatKey | name | C-string representation of the key. Must be one of the MLMediaFormatKey tags defined above. |
size_t * | out_size | Size of the key. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_NameNotFound | If name is not one of the media format key name. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatGetKeyString
MLResult MLMediaFormatGetKeyString(
MLHandle handle,
MLMediaFormatKey name,
char * out_string
)
Obtain the value of a string key.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatKey | name | C-string representation of the key. Must be one of the MLMediaFormatKey tags defined above. |
char * | out_string | Pointer to the C-string representation of the string key. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_NameNotFound | If name is not one of the media format key name. |
Required Permissions:
- None
User shall allocate at least MAX_KEY_STRING_SIZE bytes of memory for storing the output key string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatGetKeyByteBuffer
MLResult MLMediaFormatGetKeyByteBuffer(
MLHandle handle,
MLMediaFormatKey name,
MLMediaFormatByteArray * out_buffer
)
Obtain the value of a ByteBuffer key.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatKey | name | C-string representation of the key. Must be one of the MLMediaFormatKey tags defined above. |
MLMediaFormatByteArray * | out_buffer | Pointer to byte buffer that needs to be allocated and copied to. To free/release, call MLMediaFormatKeyByteBufferRelease(). |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_NameNotFound | If name is not one of the media format key name. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatKeyByteBufferRelease
MLResult MLMediaFormatKeyByteBufferRelease(
MLHandle handle,
MLMediaFormatByteArray * buffer
)
Release the ByteBuffer acquired by MLMediaFormatGetKeyByteBuffer.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatByteArray * | buffer | Byte buffer that needs to be released. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatSetKeyInt32
MLResult MLMediaFormatSetKeyInt32(
MLHandle handle,
MLMediaFormatKey name,
int32_t key_value
)
Set the value of an integer key.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatKey | name | C-string representation of the key. Must be one of the MLMediaFormatKey tags defined above. |
int32_t | key_value | Key value. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatSetKeyInt64
MLResult MLMediaFormatSetKeyInt64(
MLHandle handle,
MLMediaFormatKey name,
int64_t key_value
)
Set the value of a long key.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatKey | name | C-string representation of the key. Must be one of the MLMediaFormatKey tags defined above. |
int64_t | key_value | Key value. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatSetKeyFloat
MLResult MLMediaFormatSetKeyFloat(
MLHandle handle,
MLMediaFormatKey name,
float key_value
)
Set the value of a float key.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatKey | name | C-string representation of the key. Must be one of the MLMediaFormatKey tags defined above. |
float | key_value | Key value. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatSetKeySize
MLResult MLMediaFormatSetKeySize(
MLHandle handle,
MLMediaFormatKey name,
size_t key_size
)
Set the size of a key.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatKey | name | C-string representation of the key. Must be one of the MLMediaFormatKey tags defined above. |
size_t | key_size | Key size. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatSetKeyString
MLResult MLMediaFormatSetKeyString(
MLHandle handle,
MLMediaFormatKey name,
const char * key_value
)
Set the value of a string key.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatKey | name | C-string representation of the key. Must be one of the MLMediaFormatKey tags defined above. |
const char * | key_value | C-string representation of key value. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatSetKeyByteBuffer
MLResult MLMediaFormatSetKeyByteBuffer(
MLHandle handle,
MLMediaFormatKey name,
const MLMediaFormatByteArray * buffer
)
Set the value of a ByteBuffer key.
Parameters
MLHandle | handle | MLHandle to the MLMediaFormat object. |
MLMediaFormatKey | name | C-string representation of the key. Must be one of the MLMediaFormatKey tags defined above. |
const MLMediaFormatByteArray * | buffer | Pointer to the data buffer for the corresponding key. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerEventCallbacksExInit
static inline void MLMediaPlayerEventCallbacksExInit(
MLMediaPlayerEventCallbacksEx * inout_callbacks
)
Initializes MediaPlayerEventCallbacks with default values.
Parameters
MLMediaPlayerEventCallbacksEx * | inout_callbacks | Media Player Callback structure defined by MLMediaPlayerEventCallbacksEx that needs to be initialized. |
MLMediaPlayerTrackInfoInit
static inline void MLMediaPlayerTrackInfoInit(
MLMediaPlayerTrackInfo * inout_track_info
)
Initializes Media Track Information with default values.
Parameters
MLMediaPlayerTrackInfo * | inout_track_info | Media track information defined by MLMediaPlayerTrackInfo that needs to be initialized. |
MLMediaPlayerTrackDRMSessionInfoInit
static inline void MLMediaPlayerTrackDRMSessionInfoInit(
MLMediaPlayerTrackDRMSessionInfo * inout_drm_session_info
)
Initializes Media Track DRM Session Information with defult values.
Parameters
MLMediaPlayerTrackDRMSessionInfo * | inout_drm_session_info | Media track DRM Session information defined by MLMediaPlayerTrackDRMSessionInfo that needs to be initialized. |
MLMediaPlayerCreate
MLResult MLMediaPlayerCreate(
MLHandle * out_handle
)
Create a new Media Player object.
Parameters
MLHandle * | out_handle | The MLHandle to the new Media Player object created. Only valid if result is MLResult_Ok. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully created MediaPlayer. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
This is a blocking sync method. As creating a MediaPlayer object might take some time, make sure to not call this API from your main UI thread.
MLMediaPlayerDestroy
MLResult MLMediaPlayerDestroy(
MLHandle media_player
)
Destroys a MediaPlayer object.
Parameters
MLHandle | media_player | MLHandle to the Media Player object to destroy. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully destroyed MediaPlayer. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
This is a blocking sync method. As destroying a MediaPlayer object might take some time, make sure to not call this API from your main UI thread.
MLMediaPlayerSetDataSourceForFD
MLResult MLMediaPlayerSetDataSourceForFD(
MLHandle media_player,
int32_t fd
)
Sets a file descriptor as the data source.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
int32_t | fd | The file descriptor for the file you want to play. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully set file descriptor. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
The file descriptor must be seekable. It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetOffsetDataSourceForFD
MLResult MLMediaPlayerSetOffsetDataSourceForFD(
MLHandle media_player,
int32_t fd,
int64_t offset,
int64_t length
)
Sets a file descriptor as the data source with offset.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
int32_t | fd | The file descriptor for the file you want to play. |
int64_t | offset | The offset (in bytes) of the source's start. |
int64_t | length | The number of bytes of media to load after offset. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully set file descriptor. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
The file descriptor must be seekable. It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns. This API is useful for specifying playable media located in resource files.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetDataSourceForPath
MLResult MLMediaPlayerSetDataSourceForPath(
MLHandle media_player,
const char * path
)
Sets a local file path as the data source.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
const char * | path | The linux-style path of the file. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully set local file path. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
The path should be an absolute path and should reference a world-readable file.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetDataSourceForURI
MLResult MLMediaPlayerSetDataSourceForURI(
MLHandle media_player,
const char * uri
)
Sets a URI string as the data source.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
const char * | uri | The C-style string representing the URI complete string. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully set URI string. |
MLResult | MLResult_PermissionDenied | Failed due to lack of permission. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- android.permission.INTERNET (protection level: normal)
Supported URI schemes are file
, http
, https
, and rtsp
. If looking to provide headers, use MLMediaPlayerSetRemoteDataSourceForURI().
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetRemoteDataSourceForURI
MLResult MLMediaPlayerSetRemoteDataSourceForURI(
MLHandle media_player,
const char * uri,
char ** headers,
size_t len
)
Sets a URI string as the remote data source.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
const char * | uri | The C-style string representing the complete URL. |
char ** | headers | Array of char * headers to be sent. |
size_t | len | Number of headers passed. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully set URI string. |
MLResult | MLResult_PermissionDenied | Failed due to lack of permission. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- android.permission.INTERNET (protection level: normal)
Supported URI schemes are file
, http
, https
, and rtsp
.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetMediaDataSource
MLResult MLMediaPlayerSetMediaDataSource(
MLHandle media_player,
MLHandle media_data_source
)
Sets the data source to use.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLHandle | media_data_source | MLHandle returned by MLMediaDataSourceCreate(). |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully set the data source to use. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NameNotFound | Failed because no valid source could be found. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetMediaStreamSource
MLResult MLMediaPlayerSetMediaStreamSource(
MLHandle media_player,
MLHandle media_stream_source
)
Sets the data source to use.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLHandle | media_stream_source | MLHandle returned by MLMediaStreamSourceCreate(). |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully set the data source to use. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NameNotFound | Failed because no valid source could be found. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerAddTimedTextSourceForURI
MLResult MLMediaPlayerAddTimedTextSourceForURI(
MLHandle media_player,
const char * uri,
const char * mime_type
)
Adds a TimedText source from a URI.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
const char * | uri | The C-style string representing the complete URI. |
const char * | mime_type | The MIME type of the file. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully added TimedText source from URI. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown failure. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerAddTimedTextSourceForFD
MLResult MLMediaPlayerAddTimedTextSourceForFD(
MLHandle media_player,
int32_t fd,
int64_t offset,
int64_t length,
const char * mime_type
)
Adds a TimedText source from a file descriptor.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
int32_t | fd | The file descriptor for the timed text source. |
int64_t | offset | The offset (in bytes) of the source's start. Must be >= 0. |
int64_t | length | The number of bytes of media to load after offset. Must be >= 0. |
const char * | mime_type | The MIME type of the file. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully added TimedText source from file descriptor. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown failure. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
The file descriptor must be seekable. It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetNextPlayer
MLResult MLMediaPlayerSetNextPlayer(
MLHandle media_player,
MLHandle next_media_player
)
Sets the 'next' Media Player to automatically 'start' when current Media Player playback completes.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLHandle | next_media_player | MLHandle of an already created Media Player instance. To 'remove' the next player, set next_media_player = 0. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully registered next Media Player. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NameNotFound | Failed source because no valid source could be found. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetTrackCount
MLResult MLMediaPlayerGetTrackCount(
MLHandle media_player,
uint32_t * out_track_count
)
Counts the number of tracks found in the data source.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
uint32_t * | out_track_count | The number of tracks found in the player source. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned the number of tracks. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetTrackType
MLResult MLMediaPlayerGetTrackType(
MLHandle media_player,
uint32_t track,
MLMediaPlayerTrackType * out_track_type
)
Gets the type of a track.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
uint32_t | track | The track number for which type is to be returned. Has to be < TrackCount. |
MLMediaPlayerTrackType * | out_track_type | The returned type for specified track number. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned type for passed track. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NameNotFound | Found track's type was unknown. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetTrackLanguage
MLResult MLMediaPlayerGetTrackLanguage(
MLHandle media_player,
uint32_t track,
char ** out_track_language
)
Gets the language of a track.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
uint32_t | track | The track number for which language is to be returned. Has to be < TrackCount. |
char ** | out_track_language | The returned language of the track. Caller has ownership of that param and has to free it when no longer needed. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned language for passed track. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetTrackMediaFormat
MLResult MLMediaPlayerGetTrackMediaFormat(
MLHandle media_player,
uint32_t track,
MLHandle * out_media_format
)
Gets the Media Format of a track.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
uint32_t | track | The track number for which Media Format is to be returned. Has to be < TrackCount. |
MLHandle * | out_media_format | MLHandle to MediaFormat of the track. Caller has ownership of this handle and should call MLMediaFormatDestroy to free it when no longer needed. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully retreived the media format of passed track. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerSelectTrack
MLResult MLMediaPlayerSelectTrack(
MLHandle media_player,
uint32_t track
)
Selects a track.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
uint32_t | track | Number of the track to select. Has to be < TrackCount. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully selected track. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerUnselectTrack
MLResult MLMediaPlayerUnselectTrack(
MLHandle media_player,
uint32_t track
)
Unselects a track.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
uint32_t | track | Number of the track to unselect. Has to be < TrackCount. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully unselected track. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerPrepare
MLResult MLMediaPlayerPrepare(
MLHandle media_player
)
Prepares the player for playback, synchronously.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully prepared the player. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. Can only be called after one of the setDataSource methods or in the 'stopped' state. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
MLResult | MLMediaResult_CannotConnect | Failed becaue MediaPlayer could not connect with the given URL. |
Required Permissions:
- None
After setting the data source and the #GraphicBufferProducer, you need to either call prepare() or prepareAsync(). For files, it is OK to call prepare(), which blocks until Media Player is ready for playback.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerPrepareAsync
MLResult MLMediaPlayerPrepareAsync(
MLHandle media_player
)
Prepares the player for playback, asynchronously.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully prepared the player asynchronously. For result, poll for MLMediaPlayerPollingStateFlag_HasBeenPrepared state or wait for 'on_prepared' callback if already set. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. Can only be called after one of the setDataSource methods or in the 'stopped' state. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
After setting the data's source and the #GraphicBufferProducer, you need to either call prepare() or prepareAsync(). For streams, you should call prepareAsync(), which returns immediately, rather than blocking until enough data has been buffered. Prepared state will then be obtained via the 'on_prepared' callback if already registered (see MLMediaPlayerSetEventCallbacksEx), or polled for via the MLMediaPlayerPollStates() call with the MLMediaPlayerPollingStateFlag_HasBeenPrepared flag set.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerStart
MLResult MLMediaPlayerStart(
MLHandle media_player
)
Starts or resumes playback.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully started/resumed playback. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. Can only be called in one of the following states: 'prepared', 'playback complete', 'paused', 'stopped'. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
If playback had previously been paused, playback will continue from where it was paused. If playback had been stopped, or never started before, playback will start at the beginning.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerStop
MLResult MLMediaPlayerStop(
MLHandle media_player
)
Stops playback after playback has been started or paused.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully stopped playback. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. Can only be called in one of the following states: 'playing', 'paused', 'stopped', 'prepared', 'playback complete'. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerPause
MLResult MLMediaPlayerPause(
MLHandle media_player
)
Pauses playback.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully paused playback. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. Can only be called in one of the following states: 'playing', 'paused', 'playback complete'. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Calling pause() is a NOOP if Media Player is in state #MEDIA_PLAYER_PAUSED or #MEDIA_PLAYER_PLAYBACK_COMPLETE.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerReset
MLResult MLMediaPlayerReset(
MLHandle media_player
)
Resets the Media Player to its uninitialized state.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully reset MediaPlayer. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. This method can be called anytime except when in 'preparing async'. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
After calling this method, you will have to initialize it again by setting the data source and calling prepare().
Deprecated since 1.4.0. Scheduled for removal.
This is a blocking sync method, make sure to not call this API from your main UI thread.
MLMediaPlayerSeekTo
MLResult MLMediaPlayerSeekTo(
MLHandle media_player,
int msec,
MLMediaSeekMode mode
)
Seeks to specified time position.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
int | msec | The offset in milliseconds from the start, to seek to. |
MLMediaSeekMode | mode | Seek mode defined by MLMediaSeekMode. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully launched seek operation asynchronously. For result, poll for MLMediaPlayerPollingStateFlag_HasSeekCompleted state or wait for the 'on_seek_complete' callback if already set. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. This method can only be called from the following states: 'started', 'prepared', 'paused' and 'playback complete'. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Note that SeekTo is an async. function and returns immediately. Successful seek result has to be obtained either via the 'on_seek_complete' if already registered (see MLMediaPlayerSetEventCallbacksEx) or by polling for the flag 'MLMediaPlayerPollingStateFlag_HasSeekCompleted' when calling MLMediaPlayerPollStates().
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetEventCallbacksEx
MLResult MLMediaPlayerSetEventCallbacksEx(
MLHandle media_player,
const MLMediaPlayerEventCallbacksEx * callbacks,
void * data
)
Sets callbacks to notify clients about player events.
Parameters
MLHandle | media_player | MLHandle to the MediaCodec. |
const MLMediaPlayerEventCallbacksEx * | 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 | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully set/unset the specified callbacks. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
Required Permissions:
- None
This structure must be initialized by calling MLMediaPlayerEventCallbacksExInit() before use.
Client needs to implement the callback functions declared in MLMediaPlayerEventCallbacksEx, but can set to NULL the ones he does not care about.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerGetVideoSize
MLResult MLMediaPlayerGetVideoSize(
MLHandle media_player,
int32_t * out_width,
int32_t * out_height
)
Returns the size of the video frame.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
int32_t * | out_width | The returned video width. |
int32_t * | out_height | The returned video height. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned video size. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetCurrentPosition
MLResult MLMediaPlayerGetCurrentPosition(
MLHandle media_player,
int32_t * out_msec
)
Returns current position of playback.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
int32_t * | out_msec | The returned position in milliseconds. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned current position. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetDuration
MLResult MLMediaPlayerGetDuration(
MLHandle media_player,
int32_t * out_msec
)
Returns media duration.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
int32_t * | out_msec | The returned duration in milliseconds. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned the media duration. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. This method can only be called from the following states: 'prepared', 'started', 'paused', 'stopped' and 'playback complete'. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetBufferingUpdate
MLResult MLMediaPlayerGetBufferingUpdate(
MLHandle media_player,
int32_t * out_percentage
)
Returns current buffering percentage.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
int32_t * | out_percentage | The returned buffering percentage in the range [0, 100]. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned current buffering percentage. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetInfo
MLResult MLMediaPlayerGetInfo(
MLHandle media_player,
int32_t * out_code,
int32_t * out_extra
)
Returns last info received by internal Media Player.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
int32_t * | out_code | The main info code. |
int32_t * | out_extra | The secondary code/data. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned the last MediaPlayer. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetError
MLResult MLMediaPlayerGetError(
MLHandle media_player,
MLResult * out_result
)
Returns last error received by internal Media Player.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLResult * | out_result | The result code. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned the last MediaPlayer error. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetTimedText
MLResult MLMediaPlayerGetTimedText(
MLHandle media_player,
const char ** out_text,
int32_t * out_start,
int32_t * out_end
)
Returns last timed text event information.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
const char ** | out_text | The text of the timed text event. |
int32_t * | out_start | The start time. |
int32_t * | out_end | The end time. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned the last timedtext entry. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetSubtitleEx
MLResult MLMediaPlayerGetSubtitleEx(
MLHandle media_player,
MLMediaPlayerSubtitleData ** out_subtitle_data
)
Returns last subtitle event information.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLMediaPlayerSubtitleData ** | out_subtitle_data | The returned MLMediaPlayerGetSubtitleExArgs pointer. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned the last subtitle entry. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerReleaseSubtitleEx
MLResult MLMediaPlayerReleaseSubtitleEx(
MLHandle media_player
)
Releases last subtitle event information.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully released the last subtitle entry. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerSetOnMediaSubtitleUpdateCallback
MLResult MLMediaPlayerSetOnMediaSubtitleUpdateCallback(
MLHandle media_player,
MLMediaPlayerOnMediaSubtitleUpdateCallback on_media_subtitle_callback,
void * data
)
Sets callback to get notified when a subtitle update is available along with its data.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLMediaPlayerOnMediaSubtitleUpdateCallback | on_media_subtitle_callback | Function pointer to be called. This can be 'NULL' to unset the callback. See MLMediaPlayerOnMediaSubtitleUpdateCallback() callback typedef declaration and comments for explanation on expected callback parameters. |
void * | data | Custom data to be returned when callback is fired. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully set callback. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
Required Permissions:
- None
Setting this callback disables use of the poll-based API to query for the MLMediaPlayerPollingStateFlag_HasSubtitleUpdated flag. MLMediaPlayerPollStates() will ignore checks for this bit.
This also makes MLMediaPlayerGetSubtitleEx() redundant as the subtitle data is provided with the callback.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 4
MLMediaPlayerGetMetadata
MLResult MLMediaPlayerGetMetadata(
MLHandle media_player,
int64_t * out_time,
int32_t * out_size,
uint8_t ** out_buffer
)
Returns last metadata event information.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
int64_t * | out_time | The returned event time. |
int32_t * | out_size | The returned event buffer size. |
uint8_t ** | out_buffer | The returned event buffer. This buffer is only valid until the next metadata event arrives, so make a copy if you need to use the buffer later. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned last metadata entry. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetVideoScalingMode
MLResult MLMediaPlayerSetVideoScalingMode(
MLHandle media_player,
MLMediaPlayerVideoScalingMode mode
)
Sets video scaling mode.
Parameters
MLHandle | media_player | MLHandle to the MediaPlayer instance. |
MLMediaPlayerVideoScalingMode | mode | The video scaling mode to set. For a list of valid values, see #media_video_scaling_mode_type declaration. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned current video scaling mode. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetLooping
MLResult MLMediaPlayerSetLooping(
MLHandle media_player,
bool loop
)
Sets the looping mode of the player.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
bool | loop | The looping mode. Set to true if player should loop to beginning of MediaPlayer when EOS reached. Set to false if MediaPlayer should simply stop playback at end of media. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned current looping mode. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetVolume
MLResult MLMediaPlayerSetVolume(
MLHandle media_player,
float volume
)
Sets the volume on this player.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
float | volume | The new volume in the [0.0, 1.0] range. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully set the volume. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetAudioHandle
MLResult MLMediaPlayerGetAudioHandle(
MLHandle media_player,
MLHandle * out_handle
)
Gets the handle of the audio stream.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLHandle * | out_handle | The MLHandle to the returned Audio handle. Only valid if result is MLResult_Ok. |
Returns
MLResult | MLResult_NotImplemented | If used in versions starting 1.2.0 or later. |
Required Permissions:
- None
Unsupported since 1.2.0. Scheduled for removal.
MLMediaPlayerPollStates
MLResult MLMediaPlayerPollStates(
MLHandle media_player,
uint16_t mask,
uint16_t * out_polled_states
)
Polls the desired states from internal Media Player.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
uint16_t | mask | Selection mask for picking which states to retrieve. |
uint16_t * | out_polled_states | Bitwise OR'ed integer of all the chosen states from bitwise 'mask' and in the range [0 = false : 1 = true]. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully polled and returned the selected states. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
Required Permissions:
- None
Desired states have to be selected by passing a bitwise OR'ed mask of MLMediaPlayerPollingStateFlags flags.
The "is_XXX" states can be polled multiples times and the return value will be the same if internal state hasn't changed since last call.
When polling the "has_XXX" states however, internal state is set to false, since they mean : has <state>
happened/changed since I last polled <state>
.
Two-step state polling : The following states, when returning '1', indicate there is some data ready to be retrieved, by calling a getter function, as explained below.
For '#MLMediaPlayerPollingState_HasSizeChanged', call MLMediaPlayerGetVideoSize() to get the new size.
For '#MLMediaPlayerPollingState_HasBufferingUpdated', call MLMediaPlayerGetBufferingUpdate() to get buffering progress value.
For '#MLMediaPlayerPollingState_HasReceivedInfo, call MLMediaPlayerGetError() to get last info code and data.
For '#MLMediaPlayerPollingState_HasReceivedError, call MLMediaPlayerGetError() to get last error code and data.
Note: This API can still be used even if an #OnBufferAvailable callback has been set using MLMediaPlayerSetOnBufferAvailableCallback() method.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetTrackDRMInfo
MLResult MLMediaPlayerGetTrackDRMInfo(
MLHandle media_player,
const MLMediaPlayerTrackInfo * track_info,
MLMediaPlayerTrackDRMInfo ** out_drm_info
)
Gets the DRM info of the selected media (either audio or video) track.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
const MLMediaPlayerTrackInfo * | track_info | Media track information defined by MLMediaPlayerTrackInfo. |
MLMediaPlayerTrackDRMInfo ** | out_drm_info | Pointer to the pointer to MLMediaPlayerTrackDRMInfo struct. The caller should not free the pointer returned. The memory will be released in the call to MLMediaPlayerReleaseDRM(). |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned the current DRM Info. |
MLResult | MLResult_Pending | Media Source is not prepared yet. Wait for on_prepared callback and call again. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
MLResult | MLMediaGenericResult_NotAvailable | DRM Information not available for the given track. |
Required Permissions:
- None
This function has to be called only after DataSource has been set and the MediaPlayer is completely prepared.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerPrepareTrackDRM
MLResult MLMediaPlayerPrepareTrackDRM(
MLHandle media_player,
const MLMediaPlayerTrackDRMSessionInfo * drm_session_info
)
Prepares DRM for the selected media (either audio or video) track.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
const MLMediaPlayerTrackDRMSessionInfo * | drm_session_info | DRM Session info for the Media track, as defined by MLMediaPlayerTrackDRMSessionInfo. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully prepared DRM. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 2
MLMediaPlayerReleaseDRM
MLResult MLMediaPlayerReleaseDRM(
MLHandle media_player
)
Releases DRM.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully released DRM. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetDefaultBufferingSettings
MLResult MLMediaPlayerGetDefaultBufferingSettings(
MLHandle media_player,
MLMediaPlayerBufferingSettings * out_buf_settings
)
Gets default Buffering settings.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLMediaPlayerBufferingSettings * | out_buf_settings | A pointer to MLMediaPlayerBufferingSettings. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned default Buffering settings. |
MLResult | MLResult_NotImplemented | Feature not implemented in the given model. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
\Attention The API is only implemented in ML1.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerGetBufferingSettings
MLResult MLMediaPlayerGetBufferingSettings(
MLHandle media_player,
MLMediaPlayerBufferingSettings * out_buf_settings
)
Gets current Buffering settings.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLMediaPlayerBufferingSettings * | out_buf_settings | A pointer to MLMediaPlayerBufferingSettings. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned current Buffering settings. |
MLResult | MLResult_NotImplemented | Feature not implemented in the given model. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
\Attention The API is only implemented in ML1.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetBufferingSettings
MLResult MLMediaPlayerSetBufferingSettings(
MLHandle media_player,
MLMediaPlayerBufferingSettings buf_settings
)
Sets buffering settings.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLMediaPlayerBufferingSettings | buf_settings | An MLMediaPlayerBufferingSettings struct. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully set buffering settings. |
MLResult | MLResult_NotImplemented | Feature not implemented in the given model. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
\Attention The API is only implemented in ML1.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaPlayerSetOnMediaTimedTextUpdateCallback
MLResult MLMediaPlayerSetOnMediaTimedTextUpdateCallback(
MLHandle media_player,
MLMediaPlayerOnMediaTimedTextUpdateCallback on_media_timed_text_callback,
void * data
)
Set callback to get invoked when a Timed Text update is available along with its data.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLMediaPlayerOnMediaTimedTextUpdateCallback | on_media_timed_text_callback | Function pointer to be called. This can be 'NULL' to unset the callback. |
void * | data | Custom data to be returned when callback is fired. |
Returns
MLResult | MLResult_Ok | Successfully set callback. |
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
Required Permissions:
- None
Setting this callback disables use of the poll-based API to query for the MLMediaPlayerPollingStateFlag_HasTimedTextUpdated flag. MLMediaPlayerPollStates() will ignore checks for this bit.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 4
MLMediaPlayerGetWebVTTData
MLResult MLMediaPlayerGetWebVTTData(
MLHandle media_player,
MLHandle timed_text,
MLWebVTTData ** out_webvtt_data
)
Gets WebVTT data represented by a timed text handle.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLHandle | timed_text | The Timed Text handle. |
MLWebVTTData ** | out_webvtt_data | The WebVTT data structure to be returned. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned WebVTT data. |
MLResult | MLMediaGenericResult_BadType | Failed because the timed_text handle was not in the WebVTT format. The timed text track's mime type must be "text/vtt". |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
The returned MLWebVTTData structure is valid only in the callback's context.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 4
MLMediaPlayerGetTTMLData
MLResult MLMediaPlayerGetTTMLData(
MLHandle media_player,
MLHandle timed_text,
MLTTMLData ** out_ttml_data
)
Gets TTML data represented by a timed text handle.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLHandle | timed_text | The Timed Text handle. |
MLTTMLData ** | out_ttml_data | The TTML data structure to be returned. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully returned TTML data. |
MLResult | MLMediaGenericResult_BadType | Failed because the timed_text handle was not in the TTML format. The timed text track's mime type must be "application/ttml+xml". |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
The returned MLTTMLData structure is valid only in the callback's context.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaPlayerResetAsync
MLResult MLMediaPlayerResetAsync(
MLHandle media_player
)
Resets the Media Player to its uninitialized state asynchronously.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully launched MediaPlayer reset operation asynchronously. For result, poll for MLMediaPlayerPollingStateFlag_HasResetCompleted or use the 'on_reset_complete' callback if already set. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. This method can be called anytime except when in 'preparing async'. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
This method is asynchronous and will return immediately. After invocation, you will have to initialize it again by setting the data source and calling prepare() or prepareAsync().
A successful reset result can be obtained either by registering the 'on_reset_complete' callback (see MLMediaPlayerSetEventCallbacksEx) or by polling for the 'MLMediaPlayerPollingStateFlag_HasResetCompleted' flag when calling MLMediaPlayerPollStates().
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaPlayerGetMetrics
MLResult MLMediaPlayerGetMetrics(
MLHandle media_player,
MLMediaPlayerMetrics * out_metrics
)
Retrieves metrics recorded on the MediaPlayer.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLMediaPlayerMetrics * | out_metrics | See MLMediaPlayerMetrics. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | Successfully received metrics. |
MLResult | MLResult_UnspecifiedFailure | Failed due to an unknown error. |
MLResult | MLMediaGenericResult_InvalidOperation | Failed because method was called in the wrong state. |
MLResult | MLMediaGenericResult_NoInit | Failed because MediaPlayer was not properly initialized. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 8
MLMediaPlayerSetSurface
MLResult MLMediaPlayerSetSurface(
MLHandle media_player,
MLHandle surface
)
Sets the Native surface to be used as the sink for displaying the video portion of the media.
Parameters
MLHandle | media_player | Handle to the MediaPlayer instance. |
MLHandle | surface | Handle to the MLNativeSurface object. |
Returns
MLResult | MLResult_InvalidParam | Passed media_player or the surface handle was not found. |
MLResult | MLResult_Ok | Successfully set output surface. |
MLResult | MLResult_UnspecifiedFailure | Internal error. |
MLResult | MLMediaGenericResult_InvalidOperation | Method was called from the wrong state. |
MLResult | MLMediaGenericResult_NoInit | MediaPlayer was not properly built or initialized. |
Required Permissions:
- None
The surface should be created by MLNativeSurfaceCreate(). When called, this method should be called after one of the MLMediaPlayerSetDataSource() API and before MLMediaPlayerPrepare() or MLMediaPlayerPrepareAsync() Not calling this method or calling this with surface as ML_INVALID_HANDLE will result in only the audio track being played.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLMediaStreamSourceCreate
MLResult MLMediaStreamSourceCreate(
MLMediaStreamSourceOnBufferAvailable on_buffer_available,
void * context,
MLHandle * out_handle
)
Create a new MediaStreamSource object.
Parameters
MLMediaStreamSourceOnBufferAvailable | on_buffer_available | MLMediaStreamSourceOnBufferAvailable callback. |
void * | context | User data to be passed to callbacks. |
MLHandle * | out_handle | The MLHandle to the new source object created. Only valid if result is MLResult_Ok. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaStreamSourceDestroy
MLResult MLMediaStreamSourceDestroy(
MLHandle media_stream_source
)
Destroy a MediaStreamSource object.
Parameters
MLHandle | media_stream_source | MLHandle to the MediaStreamSource object to destroy. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaStreamSourceGetBuffer
MLResult MLMediaStreamSourceGetBuffer(
MLHandle media_stream_source,
size_t * out_id,
uint8_t ** out_ptr,
size_t * out_size
)
Get a buffer where data can be written.
Parameters
MLHandle | media_stream_source | MLHandle as returned by MLMediaStreamSourceCreate(). |
size_t * | out_id | An opaque ID that should be passed to MLMediaStreamSourcePushBuffer(). |
uint8_t ** | out_ptr | The location where to write data. |
size_t * | out_size | Maximum bytes that can be written in out_ptr . |
Returns
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
If a buffer is available, true is returned and out_id
, out_ptr
and out_size
are set. Application can then write up to out_size
bytes into out_ptr
and push that data using MLMediaStreamSourcePushBuffer().
If no buffer is available, false is returned and application should wait for MLMediaStreamSourceOnBufferAvailable() to be called before retrying.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaStreamSourcePushBuffer
MLResult MLMediaStreamSourcePushBuffer(
MLHandle media_stream_source,
size_t id,
size_t size
)
Push a buffer.
Parameters
MLHandle | media_stream_source | MLHandle as returned by MLMediaStreamSourceCreate(). |
size_t | id | The ID of the buffer as given by MLMediaStreamSourceGetBuffer(). |
size_t | size | The number of bytes actually written in the buffer. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Queue a buffer acquired from MLMediaStreamSourceGetBuffer() once data has been written.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaStreamSourcePushEOS
MLResult MLMediaStreamSourcePushEOS(
MLHandle media_stream_source
)
Push End-Of-Stream event.
Parameters
MLHandle | media_stream_source | MLHandle as returned by MLMediaStreamSourceCreate(). |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | If operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Signal that the end of stream is reached and no more data will be pushed.
Deprecated since 1.4.0. Scheduled for removal.
MLNativeSurfaceConfigInit
static inline void MLNativeSurfaceConfigInit(
MLNativeSurfaceConfig * inout_config_values
)
Initializes MLNativeSurfaceConfig with default values.
Parameters
MLNativeSurfaceConfig * | inout_config_values | MLNativeSurfaceConfig structure defined by MLNativeSurfaceConfig that needs to be initialized. |
MLNativeSurfaceOnFrameAvailableCallbackInit
static inline void MLNativeSurfaceOnFrameAvailableCallbackInit(
MLNativeSurfaceOnFrameAvailableCallback * inout_callbacks
)
Initializes MLNativeSurfaceOnFrameAvailableCallback with default values.
Parameters
MLNativeSurfaceOnFrameAvailableCallback * | inout_callbacks | MLNativeSurfaceOnFrameAvailableCallback Callback structure defined by MLNativeSurfaceOnFrameAvailableCallback that needs to be initialized. |
Deprecated since 1.4.0. Scheduled for removal.
MLNativeSurfaceCreate
MLResult MLNativeSurfaceCreate(
const MLNativeSurfaceConfig * config_values,
MLHandle * out_handle
)
Create a new NativeSurface.
Parameters
const MLNativeSurfaceConfig * | config_values | Configuration values for creating the native surface, refer MLNativeSurfaceConfig for more details. |
MLHandle * | out_handle | Upon successful return will point to handle to the created NativeSurface. Or else, it will point to ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_AllocFailed | Failed to allocate memory for surface. |
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | NativeSurface object was created successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The NativeSurface created through this API should be released using MLNativeSurfaceRelease once done using it.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLNativeSurfaceRelease
MLResult MLNativeSurfaceRelease(
MLHandle handle
)
Release a NativeSurface.
Parameters
MLHandle | handle | MLHandle to the NativeSurface. |
Returns
MLResult | MLResult_InvalidParam | NativeSurface object is invalid. |
MLResult | MLResult_Ok | NativeSurface object was successfully released. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLNativeSurfaceGetNativeWindow
MLResult MLNativeSurfaceGetNativeWindow(
MLHandle handle,
MLHandle * out_native_window,
int32_t * out_format
)
Gets an implementation of NativeWindow that feeds graphic buffers into MLNativeSurface.
Parameters
MLHandle | handle | MLHandle to the MLNativeSurface instance. This handle can be: |
* Surface created on an Encoder using MLMediaCodecCreateInputSurface. * The output surface created using MLNativeSurfaceCreate. * The output surface created using MLNativeSurfaceTextureCreate. | | MLHandle |out_native_window|Native window as MLHandle on success. | | int32_t |out_format|Native window format on success and for valid pointer, which will be used as EGL_NATIVE_VISUAL_ID.|
Returns
MLResult | MLResult_InvalidParam | NativeSurface object is invalid or out_native_window is NULL. |
MLResult | MLResult_Ok | Native window is successfully retrieved. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
This function returns the platform-dependent native window typically used by Graphics API or HW decoders to render frames.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLNativeSurfaceReleaseNativeWindow
MLResult MLNativeSurfaceReleaseNativeWindow(
MLHandle handle,
MLHandle native_window
)
Releases NativeWindow previously acquired by MLNativeSurfaceGetNativeWindow.
Parameters
MLHandle | handle | MLHandle to the MLNativeSurface instance. |
MLHandle | native_window | Native window handle acquired through MLNativeSurfaceGetNativeWindow. |
Returns
MLResult | MLResult_InvalidParam | NativeSurface or NativeWindow object is invalid. |
MLResult | MLResult_Ok | Native window is successfully released. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLNativeSurfaceAcquireNextAvailableFrame
MLResult MLNativeSurfaceAcquireNextAvailableFrame(
MLHandle handle,
MLHandle * out_native_buffer
)
Consume next available buffer.
Parameters
MLHandle | handle | MLHandle to the MLNativeSurface instance. |
MLHandle * | out_native_buffer | A pointer to the acquired native buffer of the frame. When buffer is not required anymore, caller must call MLNativeSurfaceReleaseFrame() with this nativeBuffer handle to free up queuing space for incoming buffers. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Next available frame is acquired successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_NotEnoughData | Native buffer is not available yet to acquire. |
Required Permissions:
- None
Note: This function is non-blocking and should only be called from the rendering thread after #on_frame_available callback has been fired.
Note: The returned buffer's color format is multi-planar YUV420. Since our underlying hardware interops do not support multiplanar formats, advanced texture features like mipmaping, anisotropic filtering and MSAA will not work on those returned buffers. If such advanced texturing features are required, one has to acquire the YUV buffers as usual and render to an RGB texture and only then, will one be able to enable hardware optimization for such advanced texture features.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLNativeSurfaceAcquireHardwareBufferFromNativeBuffer
MLResult MLNativeSurfaceAcquireHardwareBufferFromNativeBuffer(
MLHandle handle,
MLHandle native_buffer,
struct AHardwareBuffer ** out_hardware_buffer,
uint32_t * out_width,
uint32_t * out_height
)
Acquire an AHardwareBuffer* from a native buffer handle.
Parameters
MLHandle | handle | MLHandle to the MLNativeSurface instance. Pass ML_INVALID_HANDLE when using with native buffers acquired without a MLNativeSurface, like in the case of ml_webview api. |
MLHandle | native_buffer | The native buffer handle acquired from a MLNativeSurfaceAcquireNextAvailableFrame call. |
struct AHardwareBuffer ** | out_hardware_buffer | The AHardwareBuffer pointer to the imported surface. |
uint32_t * | out_width | Width of the imported surface. |
uint32_t * | out_height | Height of the imported surface. |
Returns
MLResult | MLResult_InvalidParam | Import was not performed due to an invalid parameter. |
MLResult | MLResult_Ok | Surface was acquired successfully. |
MLResult | MLResult_UnspecifiedFailure | Import was not performed due to an unknown error. |
Required Permissions:
- None
The AHardwareBuffer* can be used with the Vulkan extension VK_ANDROID_external_memory_android_hardware_buffer to get the hardware buffer format properties, which can then be used to bind this hardware buffer to a VkImage. Caller is responsible for releasing the AHardwareBuffer by calling AHardwareBuffer_release() after its usage.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLNativeSurfaceReleaseFrame
MLResult MLNativeSurfaceReleaseFrame(
MLHandle handle,
MLHandle native_buffer
)
Release a native buffer previously acquired.
Parameters
MLHandle | handle | MLHandle to the MLNativeSurface instance. |
MLHandle | native_buffer | The native buffer for the frame to release. |
Returns
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | Frame was released 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
MLNativeSurfaceGetFrameTransformationMatrix
MLResult MLNativeSurfaceGetFrameTransformationMatrix(
MLHandle handle,
float out_mtx[16]
)
Retrieves the 4x4 texture coordinate transform matrix associated with the last acquired Frame.
Parameters
MLHandle | handle | MLHandle to the MLNativeSurface instance. |
float | out_mtx | A pointer to an array of 16 floats that will receive retrieved transformation matrix. |
Required Permissions:
- None
This transform matrix maps 2D homogeneous texture coordinates of the form (s, t, 0, 1) with s and t in the inclusive range [0, 1] to the texture coordinate that should be used to sample that location from the texture. Sampling the texture outside of the range of this transform is undefined.
This transform is necessary to compensate for transforms that the stream content producer may implicitly apply to the content. By forcing users of a GLConsumer to apply this transform we avoid performing an extra copy of the data that would be needed to hide the transform from the user.
The matrix is stored in column-major order.
Deprecated since 1.4.0. Scheduled for removal.
Return:
- MLResult_InvalidParam One of the parameters is invalid.
- MLResult_Ok Transformation matrix was returned.
API Level:
- 20
MLNativeSurfaceGetFrameTimestamp
MLResult MLNativeSurfaceGetFrameTimestamp(
MLHandle handle,
int64_t * out_timestamp_ns
)
Retrieves the timestamp associated with the last acquired frame. The timestamp is in nanoseconds, and is monotonically increasing from beginning of the playback. Its other semantics (zero point, etc) are codec-dependent and should be documented by the codec vendor.
Parameters
MLHandle | handle | MLHandle to the MLNativeSurface instance. |
int64_t * | out_timestamp_ns | A pointer to user variable for storing retrieved timestamp. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
Return:
- MLResult_InvalidParam One of the parameters is invalid.
- MLResult_Ok Timestamp was returned.
API Level:
- 20
MLNativeSurfaceGetFrameQueueBufferTimestamp
MLResult MLNativeSurfaceGetFrameQueueBufferTimestamp(
MLHandle handle,
int64_t * out_timestamp_ns
)
Retrieves the QueueBuffer timestamp associated with the last acquired Frame This timestamp is for profiling purposes only and corresponds to the time when this frame was queued by internal Codec's producer code. The timestamp is in nanoseconds, and is monotonically increasing from beginning of playback. Its other semantics (zero point, etc) are codec-dependent and should by documented by the codec vendor.
Parameters
MLHandle | handle | MLHandle to the MLNativeSurface instance. |
int64_t * | out_timestamp_ns | A pointer to user variable for storing retrieved timestamp. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
Return:
- MLResult_InvalidParam One of the parameters is invalid.
- MLResult_Ok Timestamp was returned.
API Level:
- 20
MLNativeSurfaceGetFrameNumber
MLResult MLNativeSurfaceGetFrameNumber(
MLHandle handle,
uint64_t * out_number
)
Retrieves the last acquired frame number. The frame number is an incrementing counter set to 0 at Codec configuration time.
Parameters
MLHandle | handle | MLHandle to the MLNativeSurface instance. |
uint64_t * | out_number | A pointer to user variable for storing retrieved frame number. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
Return:
- MLResult_InvalidParam One of the parameters is invalid.
- MLResult_Ok Frame number was returned.
API Level:
- 20
MLNativeSurfaceGetFrameCropRect
MLResult MLNativeSurfaceGetFrameCropRect(
MLHandle handle,
MLRecti * out_crop_rect
)
Retrieves the cropping rectangle of the current frame/buffer.
Parameters
MLHandle | handle | MLHandle to the MLNativeSurface instance. |
MLRecti * | out_crop_rect | A pointer to user variable for storing retrieved Crop. |
Required Permissions:
- None
The Frame crop is returned as {left, bottom, width, height}.
Deprecated since 1.4.0. Scheduled for removal.
Return:
- MLResult_InvalidParam One of the parameters is invalid.
- MLResult_Ok Frame Crop was returned.
API Level:
- 20
MLNativeSurfaceSetOnFrameAvailableCallback
MLResult MLNativeSurfaceSetOnFrameAvailableCallback(
MLHandle handle,
const MLNativeSurfaceOnFrameAvailableCallback * callback,
void * user_data
)
Set callback to notify client when a frame is available.
Parameters
MLHandle | handle | MLHandle to the NativeSurface. |
const MLNativeSurfaceOnFrameAvailableCallback * | callback | A MLNativeSurfaceOnFrameAvailableCallback function. |
void * | user_data | Pointer to user payload data. |
Returns
MLResult | MLResult_InvalidParam | MLNativeSurface object is invalid. |
MLResult | MLResult_Ok | Callback 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
MLNativeSurfaceTextureCreate
MLResult MLNativeSurfaceTextureCreate(
const MLNativeSurfaceConfig * config_values,
MLNativeSurfaceTextureBackend backend,
MLHandle * out_handle
)
Create a new NativeSurfaceTexture.
Parameters
const MLNativeSurfaceConfig * | config_values | Configuration values for creating the native surface, refer MLNativeSurfaceConfig for more details. |
MLNativeSurfaceTextureBackend | backend | The graphic backend to use. |
MLHandle * | out_handle | Upon successful return will point to handle to the created NativeSurfaceTexture. Or else, it will point to ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_AllocFailed | Failed to allocate memory for surface. |
MLResult | MLResult_InvalidParam | One of the parameters is invalid. |
MLResult | MLResult_Ok | NativeSurfaceTexture 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.
API Level:
- 20
MLNativeSurfaceTextureRelease
MLResult MLNativeSurfaceTextureRelease(
MLHandle handle
)
Release a NativeSurfaceTexture.
Parameters
MLHandle | handle | MLHandle to the NativeSurfaceTexture. |
Returns
MLResult | MLResult_InvalidParam | NativeSurfaceTexture object is invalid. |
MLResult | MLResult_Ok | NativeSurfaceTexture object was successfully released. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLNativeSurfaceTextureUpdateTexImage
MLResult MLNativeSurfaceTextureUpdateTexImage(
MLHandle handle
)
Update the texture image to the most recent frame from the image stream.
Parameters
MLHandle | handle | MLHandle to the NativeSurfaceTexture. |
Returns
MLResult | MLResult_InvalidParam | NativeSurfaceTexture object is invalid. |
MLResult | MLResult_Ok | the texture was updated successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
May only be called on the thread with the graphic context that contains the texture object.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLNativeSurfaceTextureAttachToGLContext
MLResult MLNativeSurfaceTextureAttachToGLContext(
MLHandle handle,
uint32_t texture_id
)
Attach the NativeSurfaceTexture to the graphic context that is current on the calling thread.
Parameters
MLHandle | handle | MLHandle to the NativeSurfaceTexture. |
uint32_t | texture_id | The graphic texture object id. |
Returns
MLResult | MLResult_InvalidParam | NativeSurfaceTexture object is invalid. |
MLResult | MLResult_Ok | the texture was detached 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
MLNativeSurfaceTextureDetachFromGLContext
MLResult MLNativeSurfaceTextureDetachFromGLContext(
MLHandle handle
)
Detach the NativeSurfaceTexture from the graphic context that owns the graphic texture object.
Parameters
MLHandle | handle | MLHandle to the NativeSurfaceTexture. |
Returns
MLResult | MLResult_InvalidParam | NativeSurfaceTexture object is invalid. |
MLResult | MLResult_Ok | the texture was detached successfully. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
If called on the thread with graphic context that contains the attached texture object, said texture will be deleted.
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLNativeSurfaceTextureGetTransformationMatrix
MLResult MLNativeSurfaceTextureGetTransformationMatrix(
MLHandle handle,
float out_matrix[16]
)
Retrieve the 4x4 texture coordinate transform matrix associated with the texture image set by the most recent call to MLNativeSurfaceTextureUpdateTexImage.
Parameters
MLHandle | handle | MLHandle to the NativeSurfaceTexture. |
float | out_matrix | A 4x4 matrix stored in column-major order as 16 consecutive values. |
Returns
MLResult | MLResult_InvalidParam | NativeSurfaceTexture object is invalid. |
MLResult | MLResult_Ok | Operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLNativeSurfaceTextureGetTimestamp
MLResult MLNativeSurfaceTextureGetTimestamp(
MLHandle handle,
int64_t * out_timestamp_ns
)
Retrieve the timestamp associated with the texture image set by the most recent call to MLNativeSurfaceTextureUpdateTexImage.
Parameters
MLHandle | handle | MLHandle to the NativeSurfaceTexture. |
int64_t * | out_timestamp_ns | The timestamp in nanoseconds. |
Returns
MLResult | MLResult_InvalidParam | NativeSurfaceTexture object is invalid. |
MLResult | MLResult_Ok | Operation was successful. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
API Level:
- 20
MLNativeSurfaceTextureSetOnFrameAvailableCallback
MLResult MLNativeSurfaceTextureSetOnFrameAvailableCallback(
MLHandle handle,
const MLNativeSurfaceOnFrameAvailableCallback * callback,
void * user_data
)
Set callback to notify client when a frame is available.
Parameters
MLHandle | handle | MLHandle to the NativeSurfaceTexture. |
const MLNativeSurfaceOnFrameAvailableCallback * | callback | A MLNativeSurfaceTextureOnFrameAvailableCallback function. |
void * | user_data | Pointer to user payload data. |
Returns
MLResult | MLResult_InvalidParam | NativeSurfaceTexture object is invalid. |
MLResult | MLResult_Ok | Callback 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
Attributes Documentation
MLMediaDRMProperty
const typedef char * MLMediaDRMProperty;
MLMediaFormatKey
const typedef char * MLMediaFormatKey;
MLAudioChannelOutMono
const int32_t MLAudioChannelOutMono = MLAudioChannelOutMask_FrontLeft;
Definition of some of the known Channel Layouts.
Channel Layout for Mono.
MLAudioChannelOutStereo
const int32_t MLAudioChannelOutStereo = (MLAudioChannelOutMask_FrontLeft | MLAudioChannelOutMask_FrontRight);
Channel Layout for Stereo.
MLAudioChannelOutQuad
const int32_t MLAudioChannelOutQuad = (MLAudioChannelOutMask_FrontLeft | MLAudioChannelOutMask_FrontRight |
MLAudioChannelOutMask_BackLeft | MLAudioChannelOutMask_BackRight);
Channel Layout for Quad.
MLAudioChannelOutSurround
const int32_t MLAudioChannelOutSurround = (MLAudioChannelOutMask_FrontLeft | MLAudioChannelOutMask_FrontRight |
MLAudioChannelOutMask_FrontCenter | MLAudioChannelOutMask_BackCenter);
Channel Layout for Surround.
MLAudioChannelOut5Point1
const int32_t MLAudioChannelOut5Point1 = (MLAudioChannelOutMask_FrontLeft | MLAudioChannelOutMask_FrontRight |
MLAudioChannelOutMask_FrontCenter | MLAudioChannelOutMask_LowFrequency |
MLAudioChannelOutMask_BackLeft | MLAudioChannelOutMask_BackRight);
Channel Layout for 5.1.
MLAudioChannelOut7Point1
const int32_t MLAudioChannelOut7Point1 = (MLAudioChannelOutMask_FrontLeft | MLAudioChannelOutMask_FrontRight |
MLAudioChannelOutMask_FrontCenter | MLAudioChannelOutMask_LowFrequency |
MLAudioChannelOutMask_BackLeft | MLAudioChannelOutMask_BackRight |
MLAudioChannelOutMask_FrontLeftOfCenter |
MLAudioChannelOutMask_FrontRightOfCenter);
Channel Layout for 7.1.
MLAudioChannelOut7Point1Surround
const int32_t MLAudioChannelOut7Point1Surround = (MLAudioChannelOutMask_FrontLeft | MLAudioChannelOutMask_FrontCenter |
MLAudioChannelOutMask_FrontRight |
MLAudioChannelOutMask_SideLeft | MLAudioChannelOutMask_SideRight |
MLAudioChannelOutMask_BackLeft | MLAudioChannelOutMask_BackRight |
MLAudioChannelOutMask_LowFrequency);
Channel Layout for 7.1 Surround.
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.
MLMediaFormat_Key_AAC_Encoded_Target_Level
MLMediaFormatKey MLMediaFormat_Key_AAC_Encoded_Target_Level;
The format of media data (video/audio) is specified as key/value pairs. Below is a list of keys used to set/obtain format values.
A key describing the target reference level that was assumed at the encoder for calculation of attenuation gains for clipping prevention.
If it is known, this information can be provided as an integer value between 0 and 127, which is calculated as -4 * Encoded Target Level in LKFS. If the Encoded Target Level is unknown, the value can be set to -1.
The default value is -1 (unknown).
The value is ignored when heavy compression is used (see {}). This key is only used during decoding.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_AAC_DRC_Boost_Factor
MLMediaFormatKey MLMediaFormat_Key_AAC_DRC_Boost_Factor;
A key describing the boost factor allowing to adapt the dynamics of the output to the actual listening requirements. This relies on DRC gain sequences that can be transmitted in the encoded bitstream to be able to reduce the dynamics of the output signal upon request. This factor enables the user to select how much of the gains are applied.
Positive gains (boost) and negative gains (attenuation, see {}) can be controlled separately for a better match to different use-cases. Typically, attenuation gains are sent for loud signal segments, and boost gains are sent for soft signal segments. If the output is listened to in a noisy environment, for example, the boost factor is used to enable the positive gains, i.e. to amplify soft signal segments beyond the noise floor. But for listening late at night, the attenuation factor is used to enable the negative gains, to prevent loud signal from surprising the listener. In applications which generally need a low dynamic range, both the boost factor and the attenuation factor are used to enable all DRC gains.
In order to prevent clipping, it is also recommended to apply the attenuation gains in case of a downmix and/or loudness normalization to high target reference levels.
Both the boost and the attenuation factor parameters are given as integer values between 0 and 127, representing the range of the factor of 0 (i.e. don't apply) to 1 (i.e. fully apply boost/attenuation gains respectively).
The default value is 127 (fully apply boost DRC gains).
This key is only used during decoding.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_AAC_DRC_Attenuation_Factor
MLMediaFormatKey MLMediaFormat_Key_AAC_DRC_Attenuation_Factor;
A key describing the attenuation factor allowing to adapt the dynamics of the output to the actual listening requirements.
See {} for a description of the role of this attenuation factor and the value range. The default value is 127 (fully apply attenuation DRC gains).
This key is only used during decoding.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_AAC_DRC_Heavy_Compression
MLMediaFormatKey MLMediaFormat_Key_AAC_DRC_Heavy_Compression;
A key describing the selection of the heavy compression profile for DRC.
Two separate DRC gain sequences can be transmitted in one bitstream: MPEG-4 DRC light compression, and DVB-specific heavy compression. When selecting the application of the heavy compression, one of the sequences is selected:
- 0 enables light compression,
- 1 enables heavy compression instead.
Note that only light compression offers the features of scaling of DRC gains (see {} and { #MLMediaFormat_Key_AAC_DRC_Attenuation_Factor} for the boost and attenuation factors, and frequency-selective (multiband) DRC. Light compression usually contains clipping prevention for stereo downmixing while heavy compression, if additionally provided in the bitstream, is usually stronger, and contains clipping prevention for stereo and mono downmixing. The default is 1 (heavy compression).
This key is only used during decoding.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_AAC_DRC_Target_Reference_Level
MLMediaFormatKey MLMediaFormat_Key_AAC_DRC_Target_Reference_Level;
A key describing a gain to be applied so that the output loudness matches the Target Reference Level. This is typically used to normalize loudness across program items.
The gain is derived as the difference between the Target Reference Level and the Program Reference Level. The latter can be given in the bitstream and indicates the actual loudness value of the program item.
The Target Reference Level controls loudness normalization for both MPEG-4 DRC and MPEG-D DRC.
The value is given as an integer value between 40 and 127, and is calculated as -4 * Target Reference Level in LKFS. Therefore, it represents the range of -10 to -31.75 LKFS.
The default value on mobile devices is 64 (-16 LKFS).
This key is only used during decoding.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_AAC_Max_Output_Channel_Count
MLMediaFormatKey MLMediaFormat_Key_AAC_Max_Output_Channel_Count;
A key describing the maximum number of channels that can be output by the AAC decoder.
By default, the decoder will output the same number of channels as present in the encoded stream, if supported. Set this value to limit the number of output channels, and use the downmix information in the stream, if available.
Values larger than the number of channels in the content to decode are ignored.
This key is only used during decoding.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_AAC_Profile
MLMediaFormatKey MLMediaFormat_Key_AAC_Profile;
A key describing the AAC profile to be used (AAC audio formats only).
Constants are declared in MLMediaCodecListGetSupportedProfileLevels.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_AAC_SBR_Mode
MLMediaFormatKey MLMediaFormat_Key_AAC_SBR_Mode;
A key describing the AAC SBR mode to be used (AAC audio formats only).
The associated value is an integer and can be set to following values:
- 0 - no SBR should be applied.
- 1 - single rate SBR.
- 2 - double rate SBR.
Note: If this key is not defined the default SRB mode for the desired AAC profile will be used.
This key is only used during encoding.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Bit_Rate
MLMediaFormatKey MLMediaFormat_Key_Bit_Rate;
A key describing the average bitrate in bits/sec.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Bit_Rate_Mode
MLMediaFormatKey MLMediaFormat_Key_Bit_Rate_Mode;
A key describing the desired bitrate mode to be used by an encoder.
Constants are declared in MLMediaCodecBitrateMode.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Capture_Rate
MLMediaFormatKey MLMediaFormat_Key_Capture_Rate;
A key describing the capture rate of a video format in frames/sec.
When capture rate is different than the frame rate, it means that the video is acquired at a different rate than the playback, which produces slow motion or timelapse effect during playback. Application can use the value of this key to tell the relative speed ratio between capture and playback rates when the video was recorded.
The associated value is an integer or a float.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Channel_Count
MLMediaFormatKey MLMediaFormat_Key_Channel_Count;
A key describing the number of channels in an audio format.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Channel_Mask
MLMediaFormatKey MLMediaFormat_Key_Channel_Mask;
A key describing the channel composition of audio content.
This mask is composed of bits drawn from channel mask definitions in android.media.AudioFormat.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Color_Format
MLMediaFormatKey MLMediaFormat_Key_Color_Format;
A key describing the color format of the content in a video format.
Constants are declared in MLMediaCodecBitrateMode.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Duration
MLMediaFormatKey MLMediaFormat_Key_Duration;
A key describing the duration (in microseconds) of the content.
The associated value is a long.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_FLAC_Compression_Level
MLMediaFormatKey MLMediaFormat_Key_FLAC_Compression_Level;
A key describing the FLAC compression level to be used (FLAC audio format only).
The associated value is an integer ranging from 0 (fastest, least compression) to 8 (slowest, most compression).
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Frame_Rate
MLMediaFormatKey MLMediaFormat_Key_Frame_Rate;
A key describing the frame rate of a video format in frames/sec.
The associated value is normally an integer when the value is used by the platform, but video codecs also accept float configuration values. Specifically, MLMediaExtractor::getTrackFormat provides an integer value corresponding to the frame rate information of the track if specified and non-zero. Otherwise, this key is not present. MLMediaCodec::configure accepts both float and integer values. This represents the desired operating frame rate if the {} is not present and { #MLMediaFormat_Key_Priority} is 0
(realtime). For video encoders this value corresponds to the intended frame rate, although encoders are expected to support variable frame rate based on MLMediaCodec.BufferInfo#presentationTimeUs buffer timestamp. This key is not used in the MLMediaCodec#getInputFormat input/ MLMediaCodec#getOutputFormat output formats, nor by MLMediaMuxer#addTrack.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Height
MLMediaFormatKey MLMediaFormat_Key_Height;
A key describing the height of the content in a video format.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_I_Frame_Interval
MLMediaFormatKey MLMediaFormat_Key_I_Frame_Interval;
A key describing the frequency of key frames expressed in seconds between key frames.
This key is used by video encoders. A negative value means no key frames are requested after the first frame. A zero value means a stream containing all key frames is requested.
Most video encoders will convert this value of the number of non-key-frames between key-frames, using the {frame rate} information; therefore, if the actual frame rate differs (e.g. input frames are dropped or the frame rate changes), the time interval between key frames will not be the configured value. The associated value is an integer (or float since android.os.Build.VERSION_CODES::N_MR1 ).
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Intra_Refresh_Period
MLMediaFormatKey MLMediaFormat_Key_Intra_Refresh_Period;
An optional key describing the period of intra refresh in frames.
This is an optional parameter that applies only to video encoders. If encoder supports it (MLMediaCodecListIsIntraRefreshSupported), the whole frame is completely refreshed after the specified period. Also for each frame, a fix subset of macroblocks must be intra coded which leads to a more constant bitrate than inserting a key frame. This key is recommended for video streaming applications as it provides low-delay and good error-resilience. This key is ignored if the video encoder does not support the intra refresh feature. Use the output format to verify that this feature was enabled.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Is_ADTS
MLMediaFormatKey MLMediaFormat_Key_Is_ADTS;
A key mapping to a value of 1 if the content is AAC audio and audio frames are prefixed with an ADTS header.
The associated value is an integer (0 or 1). This key is only supported when decoding content, it cannot be used to configure an encoder to emit ADTS output.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Is_Autoselect
MLMediaFormatKey MLMediaFormat_Key_Is_Autoselect;
A key for boolean AUTOSELECT behavior for the track. Tracks with AUTOSELECT=true are considered when automatically selecting a track without specific user choice, based on the current locale. This is currently only used for subtitle tracks, when the user selected 'Default' for the captioning locale. The associated value is an integer, where non-0 means TRUE. This is an optional field; if not specified, AUTOSELECT defaults to TRUE.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Is_Default
MLMediaFormatKey MLMediaFormat_Key_Is_Default;
A key for boolean DEFAULT behavior for the track. The track with DEFAULT=true is selected in the absence of a specific user choice.
This is currently used in two scenarios:
- For subtitle tracks, when the user selected 'Default' for the captioning locale.
- For a MIMETYPE_IMAGE_ANDROID_HEIC track, indicating the image is the primary item in the file.
The associated value is an integer, where non-0 means TRUE. This is an optional field; if not specified, DEFAULT is considered to be FALSE.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Is_Forced_Subtitle
MLMediaFormatKey MLMediaFormat_Key_Is_Forced_Subtitle;
A key for the FORCED field for subtitle tracks.
True if it is a forced subtitle track. Forced subtitle tracks are essential for the content and are shown even when the user turns off Captions. They are used for example to translate foreign/alien dialogs or signs. The associated value is an integer, where non-0 means TRUE. This is an optional field; if not specified, FORCED defaults to FALSE.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Language
MLMediaFormatKey MLMediaFormat_Key_Language;
A key describing the language of the content, using either ISO 639-1 or 639-2/T codes.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Max_Height
MLMediaFormatKey MLMediaFormat_Key_Max_Height;
A key describing the maximum expected height of the content in a video decoder format, in case there are resolution changes in the video content.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Max_Input_Size
MLMediaFormatKey MLMediaFormat_Key_Max_Input_Size;
Described by this MediaFormat.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Max_Width
MLMediaFormatKey MLMediaFormat_Key_Max_Width;
A key describing the maximum expected width of the content in a video decoder format, in case there are resolution changes in the video content.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Mime
MLMediaFormatKey MLMediaFormat_Key_Mime;
A key describing the mime type of the MediaFormat.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_PCM_Encoding
MLMediaFormatKey MLMediaFormat_Key_PCM_Encoding;
A key describing the raw audio sample encoding/format.
The associated value is an integer, using one of the AudioFormat.ENCODINGPCM values.
This is an optional key for audio decoders and encoders specifying the desired raw audio sample format during MLMediaCodec::configure MediaCodec.configure() call. Use MLMediaCodec::getInputFormat MediaCodec.getInput / MLMediaCodec::getOutputFormatOutputFormat() to confirm the actual format. For the PCM decoder this key specifies both input and output sample encodings.
This key is also used by MLMediaExtractor to specify the sample format of audio data, if it is specified.
If this key is missing, the raw audio sample format is signed 16-bit short.
The associated value is an integer with keys defined by MLMediaFormatAudioEncoding.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Push_Blank_Buffers_On_Stop
MLMediaFormatKey MLMediaFormat_Key_Push_Blank_Buffers_On_Stop;
If specified when configuring a video decoder rendering to a surface, causes the decoder to output "blank", i.e. black frames to the surface.
when stopped to clear out any previously displayed contents. The associated value is an integer of value 1.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Repeat_Previous_Frame_After
MLMediaFormatKey MLMediaFormat_Key_Repeat_Previous_Frame_After;
Applies only when configuring a video encoder in "surface-input" mode.
The associated value is a long and gives the time in microseconds after which the frame previously submitted to the encoder will be repeated (once) if no new frame became available since.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Sample_Rate
MLMediaFormatKey MLMediaFormat_Key_Sample_Rate;
A key describing the sample rate of an audio format.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Stride
MLMediaFormatKey MLMediaFormat_Key_Stride;
A key describing the stride of the video bytebuffer layout.
Stride (or row increment) is the difference between the index of a pixel and that of the pixel directly underneath. For YUV 420 formats, the stride corresponds to the Y plane; the stride of the U and V planes can be calculated based on the color format, though it is generally undefined and depends on the device and release. The associated value is an integer, representing the number of bytes.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Temporal_Layering
MLMediaFormatKey MLMediaFormat_Key_Temporal_Layering;
A key describing the temporal layering schema.
This is an optional parameter that applies only to video encoders. Use MediaCodec::getOutputFormat after MediaCodec::configure to query if the encoder supports the desired schema. Supported values are webrtc.vp8.N-layer
, android.generic.N
, android.generic.N+M
and none
, where N
denotes the total number of non-bidirectional layers (which must be at least 1) and M
denotes the total number of bidirectional layers (which must be non-negative).
android.generic.*
schemas have been added in android.os.Build.VERSION_CODES::N_MR1.
The encoder may support fewer temporal layers, in which case the output format will contain the configured schema. If the encoder does not support temporal layering, the output format will not have an entry with this key. The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Width
MLMediaFormatKey MLMediaFormat_Key_Width;
A key describing the width of the content in a video format.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Crop_Left
MLMediaFormatKey MLMediaFormat_Key_Crop_Left;
The left-coordinate (x) of the crop rectangle.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Crop_Right
MLMediaFormatKey MLMediaFormat_Key_Crop_Right;
The right-coordinate (x) MINUS 1 of the crop rectangle.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Crop_Bottom
MLMediaFormatKey MLMediaFormat_Key_Crop_Bottom;
The bottom-coordinate (y) MINUS 1 of the crop rectangle.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Crop_Top
MLMediaFormatKey MLMediaFormat_Key_Crop_Top;
The top-coordinate (y) of the crop rectangle.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Operating_Rate
MLMediaFormatKey MLMediaFormat_Key_Operating_Rate;
A key describing the desired operating frame rate for video or sample rate for audio that the codec will need to operate at.
The associated value is an integer or a float representing frames-per-second or samples-per-second.
This is used for cases like high-speed/slow-motion video capture, where the video encoder format contains the target playback rate (e.g. 30fps), but the component must be able to handle the high operating capture rate (e.g. 240fps).
This rate will be used by codec for resource planning and setting the operating points.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Latency
MLMediaFormatKey MLMediaFormat_Key_Latency;
An optional key describing the desired encoder latency in frames.
parameter that applies only to video encoders. If encoder supports it, it should ouput at least one output frame after being queued the specified number of frames. This key is ignored if the video encoder does not support the latency feature. Use the output format to verify that this feature was enabled and the actual value used by the encoder.
If the key is not specified, the default latency will be implementation specific. The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Parameter_Video_Bitrate
MLMediaFormatKey MLMediaFormat_Key_Parameter_Video_Bitrate;
A key describing the desired video bitrate.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Parameter_Request_Sync_Frame
MLMediaFormatKey MLMediaFormat_Key_Parameter_Request_Sync_Frame;
Request that the encoder produce a sync frame "soon".
Provide an Integer with the value 0.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Parameter_Set_Suspend
MLMediaFormatKey MLMediaFormat_Key_Parameter_Set_Suspend;
Temporarily suspend/resume encoding of input data.
While suspended input data is effectively discarded instead of being fed into the encoder. This parameter really only makes sense to use with an encoder in "surface-input" mode, as the client code has no control over the input-side of the encoder in that case.
The value is an Integer object containing the value 1 to suspend or the value 0 to resume.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Parameter_Set_Suspend_Time
MLMediaFormatKey MLMediaFormat_Key_Parameter_Set_Suspend_Time;
When PARAMETER_KEY_SUSPEND is present, the client can also optionally use this key to specify the timestamp (in micro-second) at which the suspend/resume operation takes effect.
Note that the specified timestamp must be greater than or equal to the timestamp of any previously queued suspend/resume operations.
The value is a long int, indicating the timestamp to suspend/resume.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Parameter_Drop_Before
MLMediaFormatKey MLMediaFormat_Key_Parameter_Drop_Before;
A key describing the desired before which frames are to be skipped.
The associated value is a long int, indicating the timestamp (in microseconds) to be applied.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Parameter_Drop_After
MLMediaFormatKey MLMediaFormat_Key_Parameter_Drop_After;
A key describing the desired after which frames are to be skipped.
The associated value is a long int, indicating the timestamp (in microseconds) to be applied.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Parameter_Offset_Time
MLMediaFormatKey MLMediaFormat_Key_Parameter_Offset_Time;
Specify an offset (in micro-second) to be added on top of the timestamps onward.
A typical use case is to apply adjustment to the timestamps after a period of pause by the user. This parameter can only be used on an encoder in "surface-input" mode.
The value is a long int, indicating the timestamp offset to be applied.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Priority
MLMediaFormatKey MLMediaFormat_Key_Priority;
A key describing the desired codec priority.
The associated value can be one of the MLMediaCodecPriority enumeration. This is a hint used at codec configuration and resource planning - to understand the realtime requirements of the application; however, due to the nature of media components, performance is not guaranteed.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Max_B_Frames
MLMediaFormatKey MLMediaFormat_Key_Max_B_Frames;
A key describing the maximum number of B frames between I or P frames, to be used by a video encoder.
The associated value is an integer. The default value is 0, which means that no B frames are allowed. Note that non-zero value does not guarantee B frames; it's up to the encoder to decide.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Intra_Refresh_Mode
MLMediaFormatKey MLMediaFormat_Key_Intra_Refresh_Mode;
An optional key describing the mode of intra refresh in frames. The associated value is an integer.
This is an optional parameter that applies only to video encoders. If encoder supports it (MLMediaCodecListIsIntraRefreshSupported), the whole frame is completely refreshed after the specified period. Also for each frame, a fixed subset of macroblocks must be intra-coded which leads to a more constant bitrate than inserting a key frame. This key is recommended for video streaming applications as it provides low-delay and good error-resilience. This key is ignored if the video encoder does not support the intra refresh feature. Use the output format to verify that this feature was enabled.
The possible values are defined in MLMediaCodecIntraRefreshMode.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Intra_Refresh_CIR_Num
MLMediaFormatKey MLMediaFormat_Key_Intra_Refresh_CIR_Num;
Number of consecutive macroblocks to be coded as intra when CIR is enabled.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Intra_Refresh_AIR_Num
MLMediaFormatKey MLMediaFormat_Key_Intra_Refresh_AIR_Num;
Number of intra macroblocks to refresh in a frame when AIR is enabled.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Intra_Refresh_AIR_Ref
MLMediaFormatKey MLMediaFormat_Key_Intra_Refresh_AIR_Ref;
Number of times a motion marked macroblock has to be intra coded.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Profile
MLMediaFormatKey MLMediaFormat_Key_Profile;
A key describing the desired profile to be used by an encoder.
The associated value is an integer.
The supported profiles can be queries through MLMediaCodecListGetSupportedProfileLevels. The values are defined in MLMediaCodecProfileType enumeration. This key is used as a further hint when specifying a desired profile, and is only supported for codecs that specify a level. This key is ignored if the profile is not specified.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Level
MLMediaFormatKey MLMediaFormat_Key_Level;
A key describing the desired level to be used by an encoder.
The associated value is an integer.
The supported profiles can be queries through MLMediaCodecListGetSupportedProfileLevels. The values are defined in MLMediaCodecLevelType enumeration. This key is used as a further hint when specifying a desired profile, and is only supported for codecs that specify a level. This key is ignored if the level is not specified.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Prepend_Header_To_Sync_Frames
MLMediaFormatKey MLMediaFormat_Key_Prepend_Header_To_Sync_Frames;
An optional key describing whether encoders prepend headers to sync frames (e.g. SPS and PPS to IDR frames for H.264).
This is an optional parameter that applies only to video encoders. A video encoder may not support this feature; the component will fail to configure in that case. For other components, this key is ignored. The value is an integer, with 1 indicating to prepend headers to every sync frame, or 0 otherwise. The default value is 0.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Color_Range
MLMediaFormatKey MLMediaFormat_Key_Color_Range;
An optional key describing the range of the component values of the video content.
The associated value is an integer: 0 if unspecified, or one of the COLORRANGE values.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Color_Standard
MLMediaFormatKey MLMediaFormat_Key_Color_Standard;
An optional key describing the color primaries, white point and luminance factors for video content.
The associated value is an integer: 0 if unspecified, or one of the COLORSTANDARD values.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Color_Transfer
MLMediaFormatKey MLMediaFormat_Key_Color_Transfer;
An optional key describing the opto-electronic transfer function used for the video content.
The associated value is an integer: 0 if unspecified, or one of the COLORTRANSFER values.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_HDR_Static_Info
MLMediaFormatKey MLMediaFormat_Key_HDR_Static_Info;
An optional key describing the static metadata of HDR (high-dynamic-range) video content.
The associated value is a ByteBuffer. This buffer contains the raw contents of the Static Metadata Descriptor (including the descriptor ID) of an HDMI Dynamic Range and Mastering InfoFrame as defined by CTA-861.3. This key must be provided to video decoders for HDR video content unless this information is contained in the bitstream and the video decoder supports an HDR-capable profile. This key must be provided to video encoders for HDR video content.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_CSD
MLMediaFormatKey MLMediaFormat_Key_CSD;
A key describing the codec specific data.
Codec-specific data in the format is automatically submitted to the codec upon start(); you MUST NOT submit this data explicitly.
The associated value is an MLMediaFormatByteArray.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_CSD0
MLMediaFormatKey MLMediaFormat_Key_CSD0;
A key describing the codec specific data buffer #0.
Codec-specific data in the format is automatically submitted to the codec upon start(); you MUST NOT submit this data explicitly.
The associated value is an MLMediaFormatByteArray.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_CSD1
MLMediaFormatKey MLMediaFormat_Key_CSD1;
A key describing the codec specific data buffer #1.
Codec-specific data in the format is automatically submitted to the codec upon start(); you MUST NOT submit this data explicitly.
The associated value is an MLMediaFormatByteArray.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_CSD2
MLMediaFormatKey MLMediaFormat_Key_CSD2;
A key describing the codec specific data buffer #2.
Codec-specific data in the format is automatically submitted to the codec upon start(); you MUST NOT submit this data explicitly.
The associated value is an MLMediaFormatByteArray.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_CSD_Avc
MLMediaFormatKey MLMediaFormat_Key_CSD_Avc;
A key describing the codec specific data buffer for AVC (h.264).
Codec-specific data in the format is automatically submitted to the codec upon start(); you MUST NOT submit this data explicitly.
The associated value is an MLMediaFormatByteArray.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_CSD_Hevc
MLMediaFormatKey MLMediaFormat_Key_CSD_Hevc;
A key describing the codec specific data buffer for HEVC (h.265).
Codec-specific data in the format is automatically submitted to the codec upon start(); you MUST NOT submit this data explicitly.
The associated value is an MLMediaFormatByteArray.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Album
MLMediaFormatKey MLMediaFormat_Key_Album;
A key describing metadata - album title of the media.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Albumart
MLMediaFormatKey MLMediaFormat_Key_Albumart;
A key describing metadata. The artwork for the album of the media's original source as a Bitmap.
The associated value is an MLMediaFormatByteArray.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Albumartist
MLMediaFormatKey MLMediaFormat_Key_Albumartist;
A key describing metadata. The artist for the album of the media's original source.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Artist
MLMediaFormatKey MLMediaFormat_Key_Artist;
A key describing metadata. The artist of the media.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Audio_Presentation_Info
MLMediaFormatKey MLMediaFormat_Key_Audio_Presentation_Info;
A key describing metadata. The media presentation info.
The associated value is an MLMediaFormatByteArray.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Audio_Presentation_Presentation_Id
MLMediaFormatKey MLMediaFormat_Key_Audio_Presentation_Presentation_Id;
A key describing metadata. The media presentation Id.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Audio_Presentation_Program_Id
MLMediaFormatKey MLMediaFormat_Key_Audio_Presentation_Program_Id;
A key describing metadata. The media program Id.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Audio_Session_Id
MLMediaFormatKey MLMediaFormat_Key_Audio_Session_Id;
A key describing the audio session ID of the AudioTrack associated to a tunneled video codec.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
See: MLMediaCodecBitrateMode::FEATURE_TunneledPlayback
MLMediaFormat_Key_Author
MLMediaFormatKey MLMediaFormat_Key_Author;
A key describing metadata. The author of the media.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Bits_Per_Sample
MLMediaFormatKey MLMediaFormat_Key_Bits_Per_Sample;
Key representing media number of bits per sample.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Cdtracknumber
MLMediaFormatKey MLMediaFormat_Key_Cdtracknumber;
A key describing metadata. The cd track number.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Compilation
MLMediaFormatKey MLMediaFormat_Key_Compilation;
A key describing metadata. The media compilation.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Complexity
MLMediaFormatKey MLMediaFormat_Key_Complexity;
A key describing the encoding complexity.
The associated value is an integer. These values are device and codec specific, but lower values generally result in faster and/or less power-hungry encoding.
Deprecated since 1.4.0. Scheduled for removal.
See: MediaCodecInfo.EncoderCapabilities::getComplexityRange()
MLMediaFormat_Key_Composer
MLMediaFormatKey MLMediaFormat_Key_Composer;
A key describing metadata - composer of the media.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Create_Input_Surface_Suspended
MLMediaFormatKey MLMediaFormat_Key_Create_Input_Surface_Suspended;
If specified when configuring a video encoder that's in "surface-input" mode, it will instruct the encoder to put the surface source in suspended state when it's connected.
No video frames will be accepted until a resume operation (see MediaCodec::PARAMETER_KEY_SUSPEND ), optionally with timestamp specified via MediaCodec::PARAMETER_KEY_SUSPEND_TIME , is received.
The value is an integer, with 1 indicating to create with the surface source suspended, or 0 otherwise. The default value is 0.
If this key is not set or set to 0, the surface source will accept buffers as soon as it's connected to the encoder (although they may not be encoded immediately). This key can be used when the client wants to prepare the encoder session in advance, but do not want to accept buffers immediately.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Crypto_Default_Iv_Size
MLMediaFormatKey MLMediaFormat_Key_Crypto_Default_Iv_Size;
The associated value is an integer.
MLMediaFormat_Key_Crypto_Encrypted_Byte_Block
MLMediaFormatKey MLMediaFormat_Key_Crypto_Encrypted_Byte_Block;
The associated value is an integer.
MLMediaFormat_Key_Crypto_Encrypted_Sizes
MLMediaFormatKey MLMediaFormat_Key_Crypto_Encrypted_Sizes;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_Crypto_Iv
MLMediaFormatKey MLMediaFormat_Key_Crypto_Iv;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_Crypto_Key
MLMediaFormatKey MLMediaFormat_Key_Crypto_Key;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_Crypto_Mode
MLMediaFormatKey MLMediaFormat_Key_Crypto_Mode;
The associated value is an integer.
MLMediaFormat_Key_Crypto_Plain_Sizes
MLMediaFormatKey MLMediaFormat_Key_Crypto_Plain_Sizes;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_Crypto_Skip_Byte_Block
MLMediaFormatKey MLMediaFormat_Key_Crypto_Skip_Byte_Block;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_D263
MLMediaFormatKey MLMediaFormat_Key_D263;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_Date
MLMediaFormatKey MLMediaFormat_Key_Date;
A key describing metadata - The date the media was created or published. The format is unspecified but RFC 3339 is recommended.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Discnumber
MLMediaFormatKey MLMediaFormat_Key_Discnumber;
A key describing metadata. The disc number for the media's original source.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Display_Crop
MLMediaFormatKey MLMediaFormat_Key_Display_Crop;
A key describing display crop rectangle.
The associated value is a string of format "Rect %s(%d, %d, %d, %d)" where the value meaning is: "Rect name(left, top, right, bottom)".
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Display_Height
MLMediaFormatKey MLMediaFormat_Key_Display_Height;
The associated value is an integer.
MLMediaFormat_Key_Display_Width
MLMediaFormatKey MLMediaFormat_Key_Display_Width;
The associated value is an integer.
MLMediaFormat_Key_Encoder_Delay
MLMediaFormatKey MLMediaFormat_Key_Encoder_Delay;
A key describing the number of frames to trim from the start of the decoded audio stream.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Encoder_Padding
MLMediaFormatKey MLMediaFormat_Key_Encoder_Padding;
A key describing the number of frames to trim from the end of the decoded audio stream.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Esds
MLMediaFormatKey MLMediaFormat_Key_Esds;
A key describing the electrostatic discharge and soldering (ESDS).
The associated value is an MLMediaFormatByteArray.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Exif_Offset
MLMediaFormatKey MLMediaFormat_Key_Exif_Offset;
The associated value is a long integer.
MLMediaFormat_Key_Exif_Size
MLMediaFormatKey MLMediaFormat_Key_Exif_Size;
The associated value is a long integer.
MLMediaFormat_Key_Frame_Count
MLMediaFormatKey MLMediaFormat_Key_Frame_Count;
The associated value is an integer.
MLMediaFormat_Key_Genre
MLMediaFormatKey MLMediaFormat_Key_Genre;
A key describing metadata. The media genre.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Grid_Columns
MLMediaFormatKey MLMediaFormat_Key_Grid_Columns;
A key describing the number of grid columns in the content in a MIMETYPE_IMAGE_ANDROID_HEIC track.
The associated value is an integer.
Refer to MIMETYPE_IMAGE_ANDROID_HEIC on decoding instructions of such tracks.
Deprecated since 1.4.0. Scheduled for removal.
See:
MLMediaFormat_Key_Grid_Rows
MLMediaFormatKey MLMediaFormat_Key_Grid_Rows;
A key describing the number of grid rows in the content in a MIMETYPE_IMAGE_ANDROID_HEIC track.
The associated value is an integer.
Refer to MIMETYPE_IMAGE_ANDROID_HEIC on decoding instructions of such tracks.
Deprecated since 1.4.0. Scheduled for removal.
See:
MLMediaFormat_Key_Haptic_Channel_Count
MLMediaFormatKey MLMediaFormat_Key_Haptic_Channel_Count;
A key describing the number of haptic channels in an audio format.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Hdr10_Plus_Info
MLMediaFormatKey MLMediaFormat_Key_Hdr10_Plus_Info;
An optional key describing the HDR10+ metadata of the video content.
The associated value is a ByteBuffer containing HDR10+ metadata conforming to the user_data_registered_itu_t_t35() syntax of SEI message for ST 2094-40. This key will be present on:
- The formats of output buffers of a decoder configured for HDR10+ profiles (such as MLMediaCodecListGetSupportedProfileLevels::VP9Profile2HDR10Plus, MLMediaCodecListGetSupportedProfileLevels::VP9Profile3HDR10Plus or MLMediaCodecListGetSupportedProfileLevels::HEVCProfileMain10HDR10Plus), or
- The formats of output buffers of an encoder configured for an HDR10+ profiles that uses out-of-band metadata (such as MLMediaCodecListGetSupportedProfileLevels::VP9Profile2HDR10Plus or MLMediaCodecListGetSupportedProfileLevels::VP9Profile3HDR10Plus).
Deprecated since 1.4.0. Scheduled for removal.
See: MediaCodec::PARAMETER_KEY_HDR10_PLUS_INFO.
MLMediaFormat_Key_Icc_Profile
MLMediaFormatKey MLMediaFormat_Key_Icc_Profile;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_Is_Sync_Frame
MLMediaFormatKey MLMediaFormat_Key_Is_Sync_Frame;
The associated value is an integer.
MLMediaFormat_Key_Location
MLMediaFormatKey MLMediaFormat_Key_Location;
A key describing metadata. The media location.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Loop
MLMediaFormatKey MLMediaFormat_Key_Loop;
A key describing metadata. The media loop.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Lyricist
MLMediaFormatKey MLMediaFormat_Key_Lyricist;
A key describing metadata. The media lyricist.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Manufacturer
MLMediaFormatKey MLMediaFormat_Key_Manufacturer;
A key describing metadata. The media manufacturer.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Max_Bit_Rate
MLMediaFormatKey MLMediaFormat_Key_Max_Bit_Rate;
A key describing the max bitrate in bits/sec.
This is usually over a one-second sliding window (e.g. over any window of one second). The associated value is an integer. \hide
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Max_Fps_To_Encoder
MLMediaFormatKey MLMediaFormat_Key_Max_Fps_To_Encoder;
Instruct the video encoder in "surface-input" mode to drop excessive frames from the source, so that the input frame rate to the encoder does not exceed the specified fps.
The associated value is a float, representing the max frame rate to feed the encoder at.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Max_Pts_Gap_To_Encoder
MLMediaFormatKey MLMediaFormat_Key_Max_Pts_Gap_To_Encoder;
Instruct the video encoder in "surface-input" mode to limit the gap of timestamp between any two adjacent frames fed to the encoder to the specified amount (in micro-second).
The associated value is a long int. When positive, it represents the max timestamp gap between two adjacent frames fed to the encoder. When negative, the absolute value represents a fixed timestamp gap between any two adjacent frames fed to the encoder. Note that this will also apply even when the original timestamp goes backward in time. Under normal conditions, such frames would be dropped and not sent to the encoder.
The output timestamp will be restored to the original timestamp and will not be affected.
This is used in some special scenarios where input frames arrive sparingly but it's undesirable to allocate more bits to any single frame, or when it's important to ensure all frames are captured (rather than captured in the correct order).
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Mpeg_User_Data
MLMediaFormatKey MLMediaFormat_Key_Mpeg_User_Data;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_Mpeg2_Stream_Header
MLMediaFormatKey MLMediaFormat_Key_Mpeg2_Stream_Header;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_PCM_Big_Endian
MLMediaFormatKey MLMediaFormat_Key_PCM_Big_Endian;
The associated value is an integer.
MLMediaFormat_Key_Pssh
MLMediaFormatKey MLMediaFormat_Key_Pssh;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_Rotation
MLMediaFormatKey MLMediaFormat_Key_Rotation;
A key describing the desired clockwise rotation on an output surface.
This key is only used when the codec is configured using an output surface. The associated value is an integer, representing degrees. Supported values are 0, 90, 180 or 270. This is an optional field; if not specified, rotation defaults to 0.
Deprecated since 1.4.0. Scheduled for removal.
See: MLMediaCodecBitrateMode::profileLevels
MLMediaFormat_Key_Sar_Height
MLMediaFormatKey MLMediaFormat_Key_Sar_Height;
The associated value is an integer.
MLMediaFormat_Key_Sar_Width
MLMediaFormatKey MLMediaFormat_Key_Sar_Width;
The associated value is an integer.
MLMediaFormat_Key_Sei
MLMediaFormatKey MLMediaFormat_Key_Sei;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_Slice_Height
MLMediaFormatKey MLMediaFormat_Key_Slice_Height;
A key describing the plane height of a multi-planar (YUV) video bytebuffer layout.
Slice height (or plane height/vertical stride) is the number of rows that must be skipped to get from the top of the Y plane to the top of the U plane in the bytebuffer. In essence the offset of the U plane is sliceHeight * stride. The height of the U/V planes can be calculated based on the color format, though it is generally undefined and depends on the device and release. The associated value is an integer, representing the number of rows.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Target_Time
MLMediaFormatKey MLMediaFormat_Key_Target_Time;
The associated value is a long integer.
MLMediaFormat_Key_Temporal_Layer_Count
MLMediaFormatKey MLMediaFormat_Key_Temporal_Layer_Count;
The associated value is an integer.
MLMediaFormat_Key_Temporal_Layer_Id
MLMediaFormatKey MLMediaFormat_Key_Temporal_Layer_Id;
The associated value is an integer.
MLMediaFormat_Key_Text_Format_Data
MLMediaFormatKey MLMediaFormat_Key_Text_Format_Data;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_Thumbnail_CSD_Hevc
MLMediaFormatKey MLMediaFormat_Key_Thumbnail_CSD_Hevc;
The associated value is an MLMediaFormatByteArray.
MLMediaFormat_Key_Thumbnail_Height
MLMediaFormatKey MLMediaFormat_Key_Thumbnail_Height;
The associated value is an integer.
MLMediaFormat_Key_Thumbnail_Time
MLMediaFormatKey MLMediaFormat_Key_Thumbnail_Time;
The associated value is a long integer.
MLMediaFormat_Key_Thumbnail_Width
MLMediaFormatKey MLMediaFormat_Key_Thumbnail_Width;
The associated value is an integer.
MLMediaFormat_Key_Tile_Height
MLMediaFormatKey MLMediaFormat_Key_Tile_Height;
A key describing the height (in pixels) of each tile of the content in a MIMETYPE_IMAGE_ANDROID_HEIC track. The associated value is an integer.
Refer to MIMETYPE_IMAGE_ANDROID_HEIC on decoding instructions of such tracks.
Deprecated since 1.4.0. Scheduled for removal.
See:
MLMediaFormat_Key_Tile_Width
MLMediaFormatKey MLMediaFormat_Key_Tile_Width;
A key describing the width (in pixels) of each tile of the content in a MIMETYPE_IMAGE_ANDROID_HEIC track. The associated value is an integer.
Refer to MIMETYPE_IMAGE_ANDROID_HEIC on decoding instructions of such tracks.
Deprecated since 1.4.0. Scheduled for removal.
See:
MLMediaFormat_Key_Time_Us
MLMediaFormatKey MLMediaFormat_Key_Time_Us;
The associated value is a long integer.
MLMediaFormat_Key_Title
MLMediaFormatKey MLMediaFormat_Key_Title;
A key describing metadata. The title of the media.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Track_Id
MLMediaFormatKey MLMediaFormat_Key_Track_Id;
A key describing a unique ID for the content of a media track.
This key is used by MLMediaExtractor. Some extractors provide multiple encodings of the same track (e.g. float audio tracks for FLAC and WAV may be expressed as two tracks via MediaExtractor: a normal PCM track for backward compatibility, and a float PCM track for added fidelity. Similarly, Dolby Vision extractor may provide a baseline SDR version of a DV track.) This key can be used to identify which MediaExtractor tracks refer to the same underlying content.
The associated value is an integer.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Track_Index
MLMediaFormatKey MLMediaFormat_Key_Track_Index;
The associated value is an integer.
MLMediaFormat_Key_Valid_Samples
MLMediaFormatKey MLMediaFormat_Key_Valid_Samples;
The associated value is an integer.
MLMediaFormat_Key_Year
MLMediaFormatKey MLMediaFormat_Key_Year;
A key describing metadata. The year the media was created or published as a long.
The associated value is a string.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_AAC_DRC_Effect_Type
MLMediaFormatKey MLMediaFormat_Key_AAC_DRC_Effect_Type;
A key describing for selecting the DRC effect type for MPEG-D DRC.
The supported values are defined in ISO/IEC 23003-4:2015 and are described as follows: | Value | Effect | | -------- | -------- | | -1 | Off | | 0 | None | | 1 | Late night | | 2 | Noisy environment | | 3 | Limited playback range | | 4 | Low playback level | | 5 | Dialog enhancement | | 6 | General compression |
The value -1 (Off) disables DRC processing, while loudness normalization may still be active and dependent on KEY_AAC_DRC_TARGET_REFERENCE_LEVEL.
The value 0 (None) automatically enables DRC processing if necessary to prevent signal clipping
The value 6 (General compression) can be used for enabling MPEG-D DRC without particular DRC effect type request.
The default DRC effect type is 3 ("Limited playback range") on mobile devices.
This key is only used during decoding.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Quality
MLMediaFormatKey MLMediaFormat_Key_Quality;
A key describing the desired encoding quality.
The associated value is an integer. This key is only supported for encoders that are configured in constant-quality mode. These values are device and codec specific, but lower values generally result in more efficient (smaller-sized) encoding.
Deprecated since 1.4.0. Scheduled for removal.
See: MediaCodecInfo.EncoderCapabilities::getQualityRange()
MLMediaFormat_Key_Output_Reorder_Depth
MLMediaFormatKey MLMediaFormat_Key_Output_Reorder_Depth;
An optional key describing the maximum number of non-display-order coded frames.
This is an optional parameter that applies only to video encoders. Application should check the value for this key in the output format to see if codec will produce non-display-order coded frames. If encoder supports it, the output frames' order will be different from the display order and each frame's display order could be retrieved from MLMediaCodec.BufferInfo::presentationTimeUs . Before API level 27, application may receive non-display-order coded frames even though the application did not request it. Note: Application should not rearrange the frames to display order before feeding them to MLMediaMuxer::writeSampleData .
The default value is 0.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Is_Timed_Text
MLMediaFormatKey MLMediaFormat_Key_Is_Timed_Text;
The associated value is an integer. The value should be 0 or 1.
MLMediaFormat_Key_Ca_System_Id
MLMediaFormatKey MLMediaFormat_Key_Ca_System_Id;
A key describing the system id of the conditional access system used to scramble a media track.
This key is set by MLMediaExtractor if the track is scrambled with a conditional access system, regardless of the presence of a valid MediaCas object.
The associated value is an integer. \hide
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Ca_Session_Id
MLMediaFormatKey MLMediaFormat_Key_Ca_Session_Id;
A key describing the MediaCas.Session object associated with a media track.
This key is set by MLMediaExtractor if the track is scrambled with a conditional access system, after it receives a valid MediaCas} object.
The associated value is a ByteBuffer. \hide
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormat_Key_Ca_Private_Data
MLMediaFormatKey MLMediaFormat_Key_Ca_Private_Data;
A key describing the private data in the CA_descriptor associated with a media track.
This key is set by MLMediaExtractor if the track is scrambled with a conditional access system, before it receives a valid MediaCas object.
The associated value is a ByteBuffer. \hide
Deprecated since 1.4.0. Scheduled for removal.
MLMediaFormatKey_Feature
MLMediaFormatKey MLMediaFormat_Key_Feature_;
A key prefix used together with a MLMediaCodecBitrateMode feature name describing a required or optional feature for a codec capabilities query.
The associated value is an integer, where non-0 value means the feature is requested to be present, while 0 value means the feature is requested to be not present.
Deprecated since 1.4.0. Scheduled for removal.
See:
- MLMediaCodecList::findDecoderForFormat
- MLMediaCodecList::findEncoderForFormat
- MLMediaCodecBitrateMode::isFormatSupported \hide
MLTTMLDimen_Unset
static const float MLTTMLDimen_Unset = -3.402823466e+38F;
An unset position, width or size which is negative of maximum finite value of float (-FLT_MAX).
API Level:
- 20
size
size_t size;
Image size in bytes.
data
uint8_t * data;
Byte data of the image.
start_time_ms
int64_t start_time_ms;
Track cue start time in milliseconds.
end_time_ms
int64_t end_time_ms;
Track cue end time in milliseconds.
text
char * text;
The cue text encoded as UTF-8. Or null if this is an image cue.
text_alignment
MLTTMLLayoutAlignment text_alignment;
Type | Description |
---|---|
MLTTMLLayoutAlignment | Cue text alignment within the cue box. |
The alignment of the cue text within the cue box.
bitmap
MLTTMLImage bitmap;
Type | Description |
---|---|
MLTTMLImage | Byte data for TTML image cues. |
The cue image if this is an image cue, an empty image otherwise.
line
float line;
The position of the line_anchor of the cue box within the viewport in the direction orthogonal to the writing direction, or MLTTMLDimen_Unset.
When set, the interpretation of the value depends on the value of line_type. For horizontal text and line_type equal to MLTTMLLineType_Fraction, this is the fractional vertical position relative to the top of the viewport.
line_type
MLTTMLLineType line_type;
The cue line type.
Type | Description |
---|---|
MLTTMLLineType | Cue line type. |
MLTTMLLineType_Fraction indicates that line is a fractional position within the viewport.
MLTTMLLineType_Number indicates that line is a line number, where the size of each line is taken to be the size of the first line of the cue. When line is greater than or equal to 0 lines count from the start of the viewport, with 0 indicating zero offset from the start edge. When line is negative lines count from the end of the viewport, with -1 indicating zero offset from the end edge. For horizontal text the line spacing is the height of the first line of the cue, and the start and end of the viewport are the top and bottom respectively.
Note that it's particularly important to consider the effect of line_anchor when using MLTTMLLineType_Number.
(line == 0 && line_anchor == MLTTMLAnchorType_Start)
Positions a (potentially multi-line) cue at the very top of the viewport.
(line == -1 && line_anchor == MLTTMLAnchorType_EndD)
Positions a (potentially multi-line) cue at the very bottom of the viewport.
(line == 0 && line_anchor == MLTTMLAnchorType_End)
and ```cpp
(line == -1 && line_anchor == MLTTMLAnchorType_Start)
Position cues entirely outside of the viewport.
```cpp
(line == 1 && line_anchor == MLTTMLAnchorType_End)
Positions a cue so that only the last line is visible at the top of the viewport.
(line == -2 && line_anchor == MLTTMLAnchorType_Start)
Position a cue so that only its first line is visible at the bottom of the viewport.
line_anchor
MLTTMLAnchorType line_anchor;
Type | Description |
---|---|
MLTTMLAnchorType | Cue anchor type. |
The cue box anchor in the direction of line.
position
float position;
The fractional position of the position_anchor of the cue box within the viewport in the direction orthogonal to line, or MLTTMLDimen_Unset.
For horizontal text, this is the horizontal position relative to the left of the viewport. Note that positioning is relative to the left of the viewport even in the case of right-to-left text.
position_anchor
MLTTMLAnchorType position_anchor;
Type | Description |
---|---|
MLTTMLAnchorType | Cue anchor type. |
The cue box anchor in the direction of position.
size
float size;
The cue box size in the writing direction, as a fraction of the viewport size or MLTTMLDimen_Unset.
bitmap_height
float bitmap_height;
The cue bitmap height as a fraction of the viewport size or MLTTMLDimen_Unset if the bitmap should be displayed at its natural height given the bitmap dimensions and the specified size.
window_color_set
bool window_color_set;
Specifies whether or not the window_color property is set.
window_color
uint32_t window_color;
The cue window fill color in ARGB format.
text_size_type
MLTTMLTextSizeType text_size_type;
Type | Description |
---|---|
MLTTMLTextSizeType | Cue text size type. |
The cue default text size type, or MLTTMLTextSizeType_Unset if this cue has no default text size.
text_size
float text_size;
The cue default text size, or MLTTMLDimen_Unset if this cue has no default.
start_time_ms
int64_t start_time_ms;
Track cue start time in milliseconds.
end_time_ms
int64_t end_time_ms;
Track cue end time in milliseconds.
body
char * body;
WebVTT file body encoded as UTF-8.
id
char * id;
A sequence of characters unique amongst all the WebVTT cue identifiers.
snap_to_lines
bool snap_to_lines;
A boolean indicating whether the line is an integer number of lines.
orientation
MLWebVTTOrientation orientation;
Type | Description |
---|---|
MLWebVTTOrientation | Cue orientation setting. |
Orientation of the cue.
direction
MLWebVTTDirection direction;
Type | Description |
---|---|
MLWebVTTDirection | Cue direction setting. |
The writing direction.
relative_line_position
float relative_line_position;
Relative cue line position.
line_number
int32_t line_number;
WebVTT cue line number.
text_position
float text_position;
The indent of the cue box in the direction defined by the writing direction.
size
float size;
WebVTT cue size.
align
MLWebVTTAlign align;
Type | Description |
---|---|
MLWebVTTAlign | Cue aligment setting. |
WebVTT cue text alignment.
Macros Documentation
MAX_CODEC_NAME_SIZE
#define MAX_CODEC_NAME_SIZE 64
MAX_CODEC_NAME_LENGTH
#define MAX_CODEC_NAME_LENGTH 64
MAX_FORMAT_STRING_SIZE
#define MAX_FORMAT_STRING_SIZE 512
MAX_KEY_STRING_SIZE
#define MAX_KEY_STRING_SIZE 64