Skip to main content
Version: 17 Jan 2024

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
structMLCea608CaptionStyleColor
Cea608 caption style and color.
structMLCea608CaptionPAC
Cea608 caption preamble address code.
structMLCea608CaptionLineEx
Cea608 caption line structure.
structMLCea608CaptionSegmentEx
Cea608 caption segment structure.
structMLCea708CaptionColor
Cea708 Caption Color.
structMLCea708CaptionPenAttr
Cea708 Caption Pen Attributes.
structMLCea708CaptionPenColor
Cea708 Caption Pen Color.
structMLCea708CaptionPenLocation
Cea708 Caption Pen Location.
structMLCea708CaptionWindowAttr
Cea708 Caption Window Attributes.
structMLCea708CaptionWindow
Cea708 Caption Window.
structMLCea708CaptionEvent
Cea708 Caption Event.
structMLMediaCodecBufferInfo
structMLMediaCodecInputBufferInfo
MediaCodec Input buffer information.
structMLMediaCodecOutputBufferInfo
MediaCodec Output buffer information.
structMLMediaCodecOutputFormatInfo
MediaCodec Output Format information.
structMLMediaCodecErrorInfo
MediaCodec Output Format information.
structMLMediaCodecCallbacksEx
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.
structMLMediaCodecFrameRenderedInfo
MediaCodec Output Frame Rendered information.
structMLMediaCodecOutputFrameListener
Callbacks for notifying when an output frame is available for consumption or has been rendered on the output surface.
structMLMediaCodecCryptoPattern
Metadata describing an encryption pattern for the protected bytes in a subsample.
structMLMediaCodecCryptoInfo
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".
structMLMediaCodecListQueryResults
structMLMediaCodecListProfileLevel
Used to store the list of codec profile levels.
structMLMediaDRMByteArray
structMLMediaDRMByteArrayList
structMLMediaDRMKeyValue
structMLMediaDRMKeyValueArray
structMLMediaDRMKeyRequestInputParam
structMLMediaDRMRequestMessage
Data type that encapsulates either of the following along with an URL:
structMLMediaDRMCryptoInputParam
structMLMediaDRMHMACInputParam
structMLMediaDRMRSAInputParam
structMLMediaDRMEventInfo
MediaDRM event info associated with a session.
structMLMediaDRMExpirationUpdateInfo
MediaDRM expiration update info associated with a session.
structMLMediaDRMKeyStatus
MediaDRM key status.
structMLMediaDRMKeyStatusInfo
MediaDRM session keys status change info.
structMLMediaDRMEventCallbacks
Callbacks for notifying client about MLMediaDRM events.
structMLMediaExtractorDRMSchemeInitData
structMLMediaFormatByteArray
structMLMediaPlayerTrackDRMInfo
MediaPlayer DRM Info for a Media Track .
structMLMediaPlayerSubtitleData
structMLMediaPlayerBufferingSettings
structMLMediaPlayerOnBufferingUpdateInfo
MediaPlayer Buffering update callback Info.
structMLMediaPlayerOnCompletionInfo
MediaPlayer Playback completion callback Info.
structMLMediaPlayerOnErrorInfo
MediaPlayer Error callback Info.
structMLMediaPlayerOnInfoInfo
MediaPlayer Information callback Info.
structMLMediaPlayerOnPreparedInfo
MediaPlayer Playback prepared callback Info.
structMLMediaPlayerOnSeekCompleteInfo
MediaPlayer Playback seek completion callback Info.
structMLMediaPlayerOnVideoSizeChangedInfo
MediaPlayer Video Size Changed callback Info.
structMLMediaPlayerOnTrackDRMInfo
MediaPlayer Track DRM Info callback Info.
structMLMediaPlayerOnResetCompleteInfo
MediaPlayer reset completion callback Info.
structMLMediaPlayerOnFramePackingInfo
MediaPlayer frame packing callback Info.
structMLMediaPlayerEventCallbacksEx
Callbacks for notifying client about Media Player error events.
structMLMediaPlayerTrackInfo
MediaPlayer Track Information.
structMLMediaPlayerTrackDRMSessionInfo
DRM Session information for a MediaPlayer Track.
structMLMediaPlayerMetrics
MediaPlayer metrics data.
structMLTTMLImage
Byte data for TTML image cues.
structMLTTMLData
TTML data structure.
structMLPSSHEntry
PSSH entry.
structMLWebVTTData
WebVTT data structure.
structMLNativeSurfaceFrameAvailableInfo
NativeSurface/NativeSurfaceTexture Output Frame Availability information.
structMLNativeSurfaceConfig
Configuration values for creating the Native Surface.
structMLNativeSurfaceOnFrameAvailableCallback
Callbacks for notifying when an output frame is available for consumption.

Types

Name
typedef struct MLCea608CaptionStyleColorMLCea608CaptionStyleColor
Cea608 caption style and color.
typedef struct MLCea608CaptionPACMLCea608CaptionPAC
Cea608 caption preamble address code.
typedef struct MLCea608CaptionLineExMLCea608CaptionLineEx
Cea608 caption line structure.
typedef struct MLCea608CaptionSegmentExMLCea608CaptionSegmentEx
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 MLCea708CaptionColorMLCea708CaptionColor
Cea708 Caption Color.
typedef struct MLCea708CaptionPenAttrMLCea708CaptionPenAttr
Cea708 Caption Pen Attributes.
typedef struct MLCea708CaptionPenColorMLCea708CaptionPenColor
Cea708 Caption Pen Color.
typedef struct MLCea708CaptionPenLocationMLCea708CaptionPenLocation
Cea708 Caption Pen Location.
typedef struct MLCea708CaptionWindowAttrMLCea708CaptionWindowAttr
Cea708 Caption Window Attributes.
typedef struct MLCea708CaptionWindowMLCea708CaptionWindow
Cea708 Caption Window.
typedef struct MLCea708CaptionEventMLCea708CaptionEvent
Cea708 Caption Event.
typedef void()(MLHandle cc_handle, const MLCea708CaptionEvent event, void *data)MLMediaCea708ParserEmitEventCallback
Callback signature called when Cea708 parser emits event.
typedef struct MLMediaCodecBufferInfoMLMediaCodecBufferInfo
typedef struct MLMediaCodecInputBufferInfoMLMediaCodecInputBufferInfo
MediaCodec Input buffer information.
typedef struct MLMediaCodecOutputBufferInfoMLMediaCodecOutputBufferInfo
MediaCodec Output buffer information.
typedef struct MLMediaCodecOutputFormatInfoMLMediaCodecOutputFormatInfo
MediaCodec Output Format information.
typedef struct MLMediaCodecErrorInfoMLMediaCodecErrorInfo
MediaCodec Output Format information.
typedef struct MLMediaCodecCallbacksExMLMediaCodecCallbacksEx
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 MLMediaCodecFrameRenderedInfoMLMediaCodecFrameRenderedInfo
MediaCodec Output Frame Rendered information.
typedef struct MLMediaCodecOutputFrameListenerMLMediaCodecOutputFrameListener
Callbacks for notifying when an output frame is available for consumption or has been rendered on the output surface.
typedef struct MLMediaCodecCryptoPatternMLMediaCodecCryptoPattern
Metadata describing an encryption pattern for the protected bytes in a subsample.
typedef struct MLMediaCodecCryptoInfoMLMediaCodecCryptoInfo
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 MLMediaCodecListQueryResultsMLMediaCodecListQueryResults
typedef struct MLMediaCodecListProfileLevelMLMediaCodecListProfileLevel
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 MLMediaDRMByteArrayMLMediaDRMByteArray
typedef struct MLMediaDRMByteArrayListMLMediaDRMByteArrayList
typedef struct MLMediaDRMKeyValueMLMediaDRMKeyValue
typedef struct MLMediaDRMKeyValueArrayMLMediaDRMKeyValueArray
typedef struct MLMediaDRMKeyRequestInputParamMLMediaDRMKeyRequestInputParam
typedef struct MLMediaDRMRequestMessageMLMediaDRMRequestMessage
Data type that encapsulates either of the following along with an URL:
typedef struct MLMediaDRMCryptoInputParamMLMediaDRMCryptoInputParam
typedef struct MLMediaDRMHMACInputParamMLMediaDRMHMACInputParam
typedef struct MLMediaDRMRSAInputParamMLMediaDRMRSAInputParam
typedef struct MLMediaDRMEventInfoMLMediaDRMEventInfo
MediaDRM event info associated with a session.
typedef struct MLMediaDRMExpirationUpdateInfoMLMediaDRMExpirationUpdateInfo
MediaDRM expiration update info associated with a session.
typedef struct MLMediaDRMKeyStatusMLMediaDRMKeyStatus
MediaDRM key status.
typedef struct MLMediaDRMKeyStatusInfoMLMediaDRMKeyStatusInfo
MediaDRM session keys status change info.
typedef struct MLMediaDRMEventCallbacksMLMediaDRMEventCallbacks
Callbacks for notifying client about MLMediaDRM events.
typedef MLPSSHEntryMLMediaExtractorPSSHEntry
typedef struct MLMediaExtractorDRMSchemeInitDataMLMediaExtractorDRMSchemeInitData
typedef struct MLMediaFormatByteArrayMLMediaFormatByteArray
typedef MLPSSHEntryMLMediaPlayerPSSHEntry
typedef struct MLMediaPlayerTrackDRMInfoMLMediaPlayerTrackDRMInfo
MediaPlayer DRM Info for a Media Track .
typedef struct MLMediaPlayerSubtitleDataMLMediaPlayerSubtitleData
typedef struct MLMediaPlayerBufferingSettingsMLMediaPlayerBufferingSettings
typedef struct MLMediaPlayerOnBufferingUpdateInfoMLMediaPlayerOnBufferingUpdateInfo
MediaPlayer Buffering update callback Info.
typedef struct MLMediaPlayerOnCompletionInfoMLMediaPlayerOnCompletionInfo
MediaPlayer Playback completion callback Info.
typedef struct MLMediaPlayerOnErrorInfoMLMediaPlayerOnErrorInfo
MediaPlayer Error callback Info.
typedef struct MLMediaPlayerOnInfoInfoMLMediaPlayerOnInfoInfo
MediaPlayer Information callback Info.
typedef struct MLMediaPlayerOnPreparedInfoMLMediaPlayerOnPreparedInfo
MediaPlayer Playback prepared callback Info.
typedef struct MLMediaPlayerOnSeekCompleteInfoMLMediaPlayerOnSeekCompleteInfo
MediaPlayer Playback seek completion callback Info.
typedef struct MLMediaPlayerOnVideoSizeChangedInfoMLMediaPlayerOnVideoSizeChangedInfo
MediaPlayer Video Size Changed callback Info.
typedef struct MLMediaPlayerOnTrackDRMInfoMLMediaPlayerOnTrackDRMInfo
MediaPlayer Track DRM Info callback Info.
typedef struct MLMediaPlayerOnResetCompleteInfoMLMediaPlayerOnResetCompleteInfo
MediaPlayer reset completion callback Info.
typedef struct MLMediaPlayerOnFramePackingInfoMLMediaPlayerOnFramePackingInfo
MediaPlayer frame packing callback Info.
typedef struct MLMediaPlayerEventCallbacksExMLMediaPlayerEventCallbacksEx
Callbacks for notifying client about Media Player error events.
typedef struct MLMediaPlayerTrackInfoMLMediaPlayerTrackInfo
MediaPlayer Track Information.
typedef struct MLMediaPlayerTrackDRMSessionInfoMLMediaPlayerTrackDRMSessionInfo
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 MLMediaPlayerMetricsMLMediaPlayerMetrics
MediaPlayer metrics data.
typedef void()(MLHandle media_stream_source, void context)MLMediaStreamSourceOnBufferAvailable
Called when buffers becomes available.
typedef struct MLTTMLImageMLTTMLImage
Byte data for TTML image cues.
typedef struct MLTTMLDataMLTTMLData
TTML data structure.
typedef struct MLPSSHEntryMLPSSHEntry
PSSH entry.
typedef struct MLWebVTTDataMLWebVTTData
WebVTT data structure.
typedef struct MLNativeSurfaceFrameAvailableInfoMLNativeSurfaceFrameAvailableInfo
NativeSurface/NativeSurfaceTexture Output Frame Availability information.
typedef struct MLNativeSurfaceConfigMLNativeSurfaceConfig
Configuration values for creating the Native Surface.
typedef struct MLNativeSurfaceOnFrameAvailableCallbackMLNativeSurfaceOnFrameAvailableCallback
Callbacks for notifying when an output frame is available for consumption.

Enums

Name
enumMLAudioChannelOutMask
{
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
}
Audio channel output mask.
enumMLCea608CaptionDimension
{
MLCea608_CCMaxRows = 15,
MLCea608_CCMaxCols = 32,
MLCea608_CCMaxRowsPlus2 = 17,
MLCea608_CCMaxColsPlus2 = 34,
MLCea608_CCMaxRowsCols_Ensure32Bits = 0x7FFFFFFF
}
Cea608 Caption Dimension constants.
enumMLCea608CaptionColor
{
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
}
Cea608 caption color code.
enumMLCea608CaptionStyle
{
MLCea608CaptionStyle_Italics = 0x00000001,
MLCea608CaptionStyle_Underline = 0x00000002,
MLCea608CaptionStyle_Ensure32Bits = 0x7FFFFFFF
}
Cea608 caption style code.
enumAnonymous Enum 16
{
MLCea608_TS = 0x00A0
}
enumAnonymous Enum 17
{
MLCea708CaptionWindows_Max = 8
}
Cea708 Caption maximum windows constant.
enumAnonymous Enum 18
{
MLCea708CaptionEmitCommandBuffer_MaxSize = 20
}
Maximum size for Cea708 Caption Emit command buffers.
enumMLCea708CaptionEmitCommand
{
MLCea708CaptionEmitCommand_Buffer = 1,
MLCea708CaptionEmitCommand_Control = 2,
MLCea708CaptionEmitCommand_CWX = 3,
MLCea708CaptionEmitCommand_CLW = 4,
MLCea708CaptionEmitCommand_DSW = 5,
MLCea708CaptionEmitCommand_HDW = 6,
MLCea708CaptionEmitCommand_TGW = 7,
MLCea708CaptionEmitCommand_DLW = 8,
MLCea708CaptionEmitCommand_DLY = 9,
MLCea708CaptionEmitCommand_DLC = 10,
MLCea708CaptionEmitCommand_RST = 11,
MLCea708CaptionEmitCommand_SPA = 12,
MLCea708CaptionEmitCommand_SPC = 13,
MLCea708CaptionEmitCommand_SPL = 14,
MLCea708CaptionEmitCommand_SWA = 15,
MLCea708CaptionEmitCommand_DFX = 16,
MLCea708CaptionEmitCommand_Ensure32Bits = 0x7FFFFFFF
}
Cea708 Caption Emit Commands constants.
enumMLCea708CaptionEmitCommandControl
{
MLCea708CaptionEmitCommandControl_ETX = 0x03,
MLCea708CaptionEmitCommandControl_BS = 0x08,
MLCea708CaptionEmitCommandControl_FF = 0x0c,
MLCea708CaptionEmitCommandControl_HCR = 0x0e,
MLCea708CaptionEmitCommandControl_Ensure32Bits = 0x7FFFFFFF
}
Cea708 Caption Emit Command Control constants.
enumMLCea708CaptionColorOpacity
{
MLCea708CaptionColorOpacity_SOLID = 0,
MLCea708CaptionColorOpacity_FLASH = 1,
MLCea708CaptionColorOpacity_TRANSLUCENT = 2,
MLCea708CaptionColorOpacity_TRANSPARENT = 3,
MLCea708CaptionColorOpacity_Ensure32Bits = 0x7FFFFFFF
}
Cea708 Caption Color Opacity constants.
enumMLCea708CaptionPenSize
{
MLCea708CaptionPenSize_SMALL = 0,
MLCea708CaptionPenSize_STANDARD = 1,
MLCea708CaptionPenSize_LARGE = 2,
MLCea708CaptionPenSize_Ensure32Bits = 0x7FFFFFFF
}
Cea708 Caption Pen Size constants.
enumMLCea708CaptionPenOffset
{
MLCea708CaptionPenOffset_SUBSCRIPT = 0,
MLCea708CaptionPenOffset_NORMAL = 1,
MLCea708CaptionPenOffset_SUPERSCRIPT = 2,
MLCea708CaptionPenOffset_Ensure32Bits = 0x7FFFFFFF
}
Cea708 Caption Pen Offset constants.
enumMLMediaCodecCreation
{
MLMediaCodecCreation_ByName,
MLMediaCodecCreation_ByType,
MLMediaCodecCreation_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaCodecType
{
MLMediaCodecType_Encoder,
MLMediaCodecType_Decoder,
MLMediaCodecType_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaCodecBufferFlag
{
MLMediaCodecBufferFlag_KeyFrame = 1,
MLMediaCodecBufferFlag_CodecConfig = 2,
MLMediaCodecBufferFlag_EOS = 4,
MLMediaCodecBufferFlag_PartialFrame = 8,
MLMediaCodecBufferFlag_MuxerData = 16,
MLMediaCodecBufferFlag_Ensure32Bits = 0x7FFFFFFF
}
Indicate the type of data when queuing the input buffer via MLMediaCodecQueueInputBuffer() or MLMediaCodecQueueSecureInputBuffer().
enumMLMediaCodecOutputBufferStatus
{
MLMediaCodec_OutputBuffersChanged = -1014,
MLMediaCodec_FormatChanged = -1012,
MLMediaCodec_TryAgainLater = -11,
MLMediaCodecOutputBufferStatus_Ensure32Bits = 0x7FFFFFFF
}
Other than the normal buffer index, the output of MLMediaCodecDequeueOutputBuffer() can take on one of these statuses.
enumMLMediaCodecCryptoMode
{
MLMediaCodecCryptoMode_Clear,
MLMediaCodecCryptoMode_CTR,
MLMediaCodecCryptoMode_CBC,
MLMediaCodecCryptoMode_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaCodecListCodecTypeFlag
{
MLMediaCodecListCodecTypeFlag_Software = 1 << 0,
MLMediaCodecListCodecTypeFlag_Hardware = 1 << 1,
MLMediaCodecListCodecTypeFlag_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaCodecListCapabilityFlag
{
MLMediaCodecListCapabilityFlag_AdaptivePlayback = 1 << 0,
MLMediaCodecListCapabilityFlag_SecurePlayback = 1 << 1,
MLMediaCodecListCapabilityFlag_TunneledPlayback = 1 << 2,
MLMediaCodecListCapabilityFlag_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaCodecColorFormat
{
MLMediaCodecColorFormat_Unused = 0,
MLMediaCodecColorFormat_Monochrome = 1,
MLMediaCodecColorFormat_8BitRGB332 = 2,
MLMediaCodecColorFormat_12BitRGB444 = 3,
MLMediaCodecColorFormat_16BitARGB4444 = 4,
MLMediaCodecColorFormat_16BitARGB1555 = 5,
MLMediaCodecColorFormat_16BitRGB565 = 6,
MLMediaCodecColorFormat_16BitBGR565 = 7,
MLMediaCodecColorFormat_18BitRGB666 = 8,
MLMediaCodecColorFormat_18BitARGB1665 = 9,
MLMediaCodecColorFormat_19BitARGB1666 = 10,
MLMediaCodecColorFormat_24BitRGB888 = 11,
MLMediaCodecColorFormat_24BitBGR888 = 12,
MLMediaCodecColorFormat_24BitARGB1887 = 13,
MLMediaCodecColorFormat_25BitARGB1888 = 14,
MLMediaCodecColorFormat_32BitBGRA8888 = 15,
MLMediaCodecColorFormat_32BitARGB8888 = 16,
MLMediaCodecColorFormat_YUV411Planar = 17,
MLMediaCodecColorFormat_YUV411PackedPlanar = 18,
MLMediaCodecColorFormat_YUV420Planar = 19,
MLMediaCodecColorFormat_YUV420PackedPlanar = 20,
MLMediaCodecColorFormat_YUV420SemiPlanar = 21,
MLMediaCodecColorFormat_YUV422Planar = 22,
MLMediaCodecColorFormat_YUV422PackedPlanar = 23,
MLMediaCodecColorFormat_YUV422SemiPlanar = 24,
MLMediaCodecColorFormat_YCbYCr = 25,
MLMediaCodecColorFormat_YCrYCb = 26,
MLMediaCodecColorFormat_CbYCrY = 27,
MLMediaCodecColorFormat_CrYCbY = 28,
MLMediaCodecColorFormat_YUV444Interleaved = 29,
MLMediaCodecColorFormat_RawBayer8Bit = 30,
MLMediaCodecColorFormat_RawBayer10Bit = 31,
MLMediaCodecColorFormat_RawBayer8Bitcompressed = 32,
MLMediaCodecColorFormat_L2 = 33,
MLMediaCodecColorFormat_L4 = 34,
MLMediaCodecColorFormat_L8 = 35,
MLMediaCodecColorFormat_L16 = 36,
MLMediaCodecColorFormat_L24 = 37,
MLMediaCodecColorFormat_L32 = 38,
MLMediaCodecColorFormat_YUV420PackedSemiPlanar,
MLMediaCodecColorFormat_YUV422PackedSemiPlanar,
MLMediaCodecColorFormat_18BitBGR666,
MLMediaCodecColorFormat_24BitARGB6666,
MLMediaCodecColorFormat_24BitABGR6666,
MLMediaCodecColorFormat_KhronosExtensions = 0x6F000000,
MLMediaCodecColorFormat_VendorStartUnused = 0x7F000000,
MLMediaCodecColorFormat_AndroidOpaque = 0x7F000789,
MLMediaCodecColorFormat_32BitRGBA8888 = 0x7F00A000,
MLMediaCodecColorFormat_YUV420Flexible = 0x7F420888,
MLMediaCodecColorFormat_YUV420Planar16 = 0x7F42016B,
MLMediaCodecColorFormat_YUV444Y410 = 0x7F444AAA,
MLMediaCodecColorFormat_TIYUV420PackedSemiPlanar = 0x7F000100,
MLMediaCodecColorFormat_QCOMYVU420SemiPlanar = 0x7FA30C00,
MLMediaCodecColorFormat_QCOMYUV420PackedSemiPlanar64x32Tile2m8ka = 0x7FA30C03,
MLMediaCodecColorFormat_QCOMYUV420PackedSemiPlanar32m = 0x7FA30C04,
MLMediaCodecColorFormat_SECNV12Tiled = 0x7FC00002,
MLMediaCodecColorFormat_Ensure32Bits = 0x7FFFFFFF
}
Enumeration defining possible uncompressed image/video formats.
enumMLMediaCodecPriority
{
MLMediaCodecPriority_RealTime = 0,
MLMediaCodecPriority_NonRealTime = 1,
MLMediaCodecPriority_Ensure32Bits = 0x7FFFFFFF
}
Enumeration defining the Codec priority.
enumMLMediaCodecIntraRefreshMode
{
MLMediaCodecIntraRefreshMode_Cyclic = 0,
MLMediaCodecIntraRefreshMode_Adaptive = 1,
MLMediaCodecIntraRefreshMode_Both = 2,
MLMediaCodecIntraRefreshMode_Ensure32Bits = 0x7FFFFFFF
}
Enumeration of possible methods to use for Intra Refresh.
enumMLMediaCodecBitrateMode
{
MLMediaCodecBitrateMode_CQ = 0,
MLMediaCodecBitrateMode_VBR = 1,
MLMediaCodecBitrateMode_CBR = 2,
MLMediaCodecBitrateMode_Ensure32Bits = 0x7FFFFFFF
}
Enumeration defining Codec Bitrate modes.
enumMLMediaCodecProfileType
{
MLMediaCodecProfileType_H263Baseline = 0x01,
MLMediaCodecProfileType_H263H320Coding = 0x02,
MLMediaCodecProfileType_H263BackwardCompatible = 0x04,
MLMediaCodecProfileType_H263ISWV2 = 0x08,
MLMediaCodecProfileType_H263ISWV3 = 0x10,
MLMediaCodecProfileType_H263HighCompression = 0x20,
MLMediaCodecProfileType_H263Internet = 0x40,
MLMediaCodecProfileType_H263Interlace = 0x80,
MLMediaCodecProfileType_H263HighLatency = 0x100,
MLMediaCodecProfileType_MPEG2Simple = 0,
MLMediaCodecProfileType_MPEG2Main = 1,
MLMediaCodecProfileType_MPEG2422 = 2,
MLMediaCodecProfileType_MPEG2SNR = 3,
MLMediaCodecProfileType_MPEG2Spatial = 4,
MLMediaCodecProfileType_MPEG2High = 5,
MLMediaCodecProfileType_MPEG4Simple = 0x01,
MLMediaCodecProfileType_MPEG4SimpleScalable = 0x02,
MLMediaCodecProfileType_MPEG4Core = 0x04,
MLMediaCodecProfileType_MPEG4Main = 0x08,
MLMediaCodecProfileType_MPEG4Nbit = 0x10,
MLMediaCodecProfileType_MPEG4ScalableTexture = 0x20,
MLMediaCodecProfileType_MPEG4SimpleFace = 0x40,
MLMediaCodecProfileType_MPEG4SimpleFBA = 0x80,
MLMediaCodecProfileType_MPEG4BasicAnimated = 0x100,
MLMediaCodecProfileType_MPEG4Hybrid = 0x200,
MLMediaCodecProfileType_MPEG4AdvancedRealTime = 0x400,
MLMediaCodecProfileType_MPEG4CoreScalable = 0x800,
MLMediaCodecProfileType_MPEG4AdvancedCoding = 0x1000,
MLMediaCodecProfileType_MPEG4AdvancedCore = 0x2000,
MLMediaCodecProfileType_MPEG4AdvancedScalable = 0x4000,
MLMediaCodecProfileType_MPEG4AdvancedSimple = 0x8000,
MLMediaCodecProfileType_AVCBaseline = 0x01,
MLMediaCodecProfileType_AVCMain = 0x02,
MLMediaCodecProfileType_AVCExtended = 0x04,
MLMediaCodecProfileType_AVCHigh = 0x08,
MLMediaCodecProfileType_AVCHigh10 = 0x10,
MLMediaCodecProfileType_AVCHigh422 = 0x20,
MLMediaCodecProfileType_AVCHigh444 = 0x40,
MLMediaCodecProfileType_VP8Main = 0x01,
MLMediaCodecProfileType_VP90 = 0x01,
MLMediaCodecProfileType_VP91 = 0x02,
MLMediaCodecProfileType_VP92 = 0x04,
MLMediaCodecProfileType_VP93 = 0x08,
MLMediaCodecProfileType_VP92HDR = 0x1000,
MLMediaCodecProfileType_VP93HDR = 0x2000,
MLMediaCodecProfileType_VP92HDR10Plus = 0x4000,
MLMediaCodecProfileType_VP93HDR10Plus = 0x8000,
MLMediaCodecProfileType_HEVCMain = 0x01,
MLMediaCodecProfileType_HEVCMain10 = 0x02,
MLMediaCodecProfileType_HEVCMainStill = 0x04,
MLMediaCodecProfileType_HEVCMain10HDR10 = 0x1000,
MLMediaCodecProfileType_HEVCMain10HDR10Plus = 0x2000,
MLMediaCodecProfileType_AACObjectNull = 0,
MLMediaCodecProfileType_AACObjectMain = 1,
MLMediaCodecProfileType_AACObjectLC = 2,
MLMediaCodecProfileType_AACObjectSS = 3,
MLMediaCodecProfileType_AACObjectLTP = 4,
MLMediaCodecProfileType_AACObjectHE = 5,
MLMediaCodecProfileType_AACObjectScalable = 6,
MLMediaCodecProfileType_AACObjectERLC = 17,
MLMediaCodecProfileType_AACObjectLD = 23,
MLMediaCodecProfileType_AACObjectHE_PS = 29,
MLMediaCodecProfileType_WMAProfileUnused = 0,
MLMediaCodecProfileType_WMAProfileL1 = 1,
MLMediaCodecProfileType_WMAProfileL2 = 2,
MLMediaCodecProfileType_WMAProfileL3 = 3,
MLMediaCodecProfileType_Ensure32Bits = 0x7FFFFFFF
}
Enumeration defining Codec profile types.
enumMLMediaCodecLevelType
{
MLMediaCodecLevelType_H263Level10 = 0x01,
MLMediaCodecLevelType_H263Level20 = 0x02,
MLMediaCodecLevelType_H263Level30 = 0x04,
MLMediaCodecLevelType_H263Level40 = 0x08,
MLMediaCodecLevelType_H263Level45 = 0x10,
MLMediaCodecLevelType_H263Level50 = 0x20,
MLMediaCodecLevelType_H263Level60 = 0x40,
MLMediaCodecLevelType_H263Level70 = 0x80,
MLMediaCodecLevelType_MPEG2LevelLL = 0,
MLMediaCodecLevelType_MPEG2LevelML = 1,
MLMediaCodecLevelType_MPEG2LevelH14 = 2,
MLMediaCodecLevelType_MPEG2LevelHL = 3,
MLMediaCodecLevelType_MPEG4Level0 = 0x01,
MLMediaCodecLevelType_MPEG4Level0b = 0x02,
MLMediaCodecLevelType_MPEG4Level1 = 0x04,
MLMediaCodecLevelType_MPEG4Level2 = 0x08,
MLMediaCodecLevelType_MPEG4Level3 = 0x10,
MLMediaCodecLevelType_MPEG4Level4 = 0x20,
MLMediaCodecLevelType_MPEG4Level4a = 0x40,
MLMediaCodecLevelType_MPEG4Level5 = 0x80,
MLMediaCodecLevelType_AVCLevel1 = 0x01,
MLMediaCodecLevelType_AVCLevel1b = 0x02,
MLMediaCodecLevelType_AVCLevel11 = 0x04,
MLMediaCodecLevelType_AVCLevel12 = 0x08,
MLMediaCodecLevelType_AVCLevel13 = 0x10,
MLMediaCodecLevelType_AVCLevel2 = 0x20,
MLMediaCodecLevelType_AVCLevel21 = 0x40,
MLMediaCodecLevelType_AVCLevel22 = 0x80,
MLMediaCodecLevelType_AVCLevel3 = 0x100,
MLMediaCodecLevelType_AVCLevel31 = 0x200,
MLMediaCodecLevelType_AVCLevel32 = 0x400,
MLMediaCodecLevelType_AVCLevel4 = 0x800,
MLMediaCodecLevelType_AVCLevel41 = 0x1000,
MLMediaCodecLevelType_AVCLevel42 = 0x2000,
MLMediaCodecLevelType_AVCLevel5 = 0x4000,
MLMediaCodecLevelType_AVCLevel51 = 0x8000,
MLMediaCodecLevelType_VP8LevelVersion0 = 0x01,
MLMediaCodecLevelType_VP8LevelVersion1 = 0x02,
MLMediaCodecLevelType_VP8LevelVersion2 = 0x04,
MLMediaCodecLevelType_VP8LevelVersion3 = 0x08,
MLMediaCodecLevelType_VP9Level1 = 0x1,
MLMediaCodecLevelType_VP9Level11 = 0x2,
MLMediaCodecLevelType_VP9Level2 = 0x4,
MLMediaCodecLevelType_VP9Level21 = 0x8,
MLMediaCodecLevelType_VP9Level3 = 0x10,
MLMediaCodecLevelType_VP9Level31 = 0x20,
MLMediaCodecLevelType_VP9Level4 = 0x40,
MLMediaCodecLevelType_VP9Level41 = 0x80,
MLMediaCodecLevelType_VP9Level5 = 0x100,
MLMediaCodecLevelType_VP9Level51 = 0x200,
MLMediaCodecLevelType_VP9Level52 = 0x400,
MLMediaCodecLevelType_VP9Level6 = 0x800,
MLMediaCodecLevelType_VP9Level61 = 0x1000,
MLMediaCodecLevelType_VP9Level62 = 0x2000,
MLMediaCodecLevelType_HEVCMainTierLevel1 = 0x1,
MLMediaCodecLevelType_HEVCHighTierLevel1 = 0x2,
MLMediaCodecLevelType_HEVCMainTierLevel2 = 0x4,
MLMediaCodecLevelType_HEVCHighTierLevel2 = 0x8,
MLMediaCodecLevelType_HEVCMainTierLevel21 = 0x10,
MLMediaCodecLevelType_HEVCHighTierLevel21 = 0x20,
MLMediaCodecLevelType_HEVCMainTierLevel3 = 0x40,
MLMediaCodecLevelType_HEVCHighTierLevel3 = 0x80,
MLMediaCodecLevelType_HEVCMainTierLevel31 = 0x100,
MLMediaCodecLevelType_HEVCHighTierLevel31 = 0x200,
MLMediaCodecLevelType_HEVCMainTierLevel4 = 0x400,
MLMediaCodecLevelType_HEVCHighTierLevel4 = 0x800,
MLMediaCodecLevelType_HEVCMainTierLevel41 = 0x1000,
MLMediaCodecLevelType_HEVCHighTierLevel41 = 0x2000,
MLMediaCodecLevelType_HEVCMainTierLevel5 = 0x4000,
MLMediaCodecLevelType_HEVCHighTierLevel5 = 0x8000,
MLMediaCodecLevelType_HEVCMainTierLevel51 = 0x10000,
MLMediaCodecLevelType_HEVCHighTierLevel51 = 0x20000,
MLMediaCodecLevelType_HEVCMainTierLevel52 = 0x40000,
MLMediaCodecLevelType_HEVCHighTierLevel52 = 0x80000,
MLMediaCodecLevelType_HEVCMainTierLevel6 = 0x100000,
MLMediaCodecLevelType_HEVCHighTierLevel6 = 0x200000,
MLMediaCodecLevelType_HEVCMainTierLevel61 = 0x400000,
MLMediaCodecLevelType_HEVCHighTierLevel61 = 0x800000,
MLMediaCodecLevelType_HEVCMainTierLevel62 = 0x1000000,
MLMediaCodecLevelType_HEVCHighTierLevel62 = 0x2000000,
MLMediaCodecLevelType_Ensure32Bits = 0x7FFFFFFF
}
Enumeration defining Codec Level types.
enumMLMediaSeekMode
{
MLMediaSeekMode_Previous_Sync,
MLMediaSeekMode_Next_Sync,
MLMediaSeekMode_Closest_Sync,
MLMediaSeekMode_Closest,
MLMediaSeekMode_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaDRMKeyType
{
MLMediaDRMKeyType_Streaming = 1,
MLMediaDRMKeyType_Offline = 2,
MLMediaDRMKeyType_Release = 3,
MLMediaDRMKeyType_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaDRMEventType
{
MLMediaDRMEventType_ProvisionRequired = 1,
MLMediaDRMEventType_KeyRequired = 2,
MLMediaDRMEventType_KeyExpired = 3,
MLMediaDRMEventType_VendorDefined = 4,
MLMediaDRMEventType_SessionReclaimed = 5,
MLMediaDRMEventType_ExpirationUpdate = 6,
MLMediaDRMEventType_KeysChange = 7,
MLMediaDRMEventType_Ensure32Bits = 0x7FFFFFFF
}
Request event types.
enumMLMediaDRMKeyStatusCode
{
MLMediaDRMKeyStatusCode_KeyStatusUsable = 0,
MLMediaDRMKeyStatusCode_KeyStatusExpired = 1,
MLMediaDRMKeyStatusCode_KeyStatusOutputNotAllowed = 2,
MLMediaDRMKeyStatusCode_KeyStatusPending = 3,
MLMediaDRMKeyStatusCode_KeyStatusInternalError = 4,
MLMediaDRMKeyStatusCode_Ensure32Bits = 0x7FFFFFFF
}
Status code associated with a DRM session key.
enumMLMediaExtractorSampleFlag
{
MLMediaExtractorSampleFlag_Sync = 1,
MLMediaExtractorSampleFlag_Encrypted = 2,
MLMediaExtractorSampleFlag_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaExtractorSeekPosition
{
MLMediaExtractorSeekPosition_Previous_Sync,
MLMediaExtractorSeekPosition_Next_Sync,
MLMediaExtractorSeekPosition_Closest_Sync,
MLMediaExtractorSeekPosition_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaFormatAudioEncoding
{
MLMediaFormatAudioEncoding_PCM16Bits = 2,
MLMediaFormatAudioEncoding_PCM8Bits = 3,
MLMediaFormatAudioEncoding_PCMFloat = 4,
MLMediaFormatAudioEncoding_PCM32Bits = 201,
MLMediaFormatAudioEncoding_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaPlayerVideoScalingMode
{
MLMediaPlayerVideoScalingMode_ScaleToFit = 1,
MLMediaPlayerVideoScalingMode_ScaleToFitWithCropping = 2,
MLMediaPlayerVideoScalingMode_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaPlayerPollingStateFlags
{
MLMediaPlayerPollingStateFlag_IsPlaying = 1 << 0,
MLMediaPlayerPollingStateFlag_IsLooping = 1 << 1,
MLMediaPlayerPollingStateFlag_HasBeenPrepared = 1 << 2,
MLMediaPlayerPollingStateFlag_HasPlaybackCompleted = 1 << 3,
MLMediaPlayerPollingStateFlag_HasSeekCompleted = 1 << 4,
MLMediaPlayerPollingStateFlag_HasSizeChanged = 1 << 5,
MLMediaPlayerPollingStateFlag_HasBufferingUpdated = 1 << 6,
MLMediaPlayerPollingStateFlag_HasReceivedInfo = 1 << 7,
MLMediaPlayerPollingStateFlag_HasReceivedError = 1 << 8,
MLMediaPlayerPollingStateFlag_HasTimedTextUpdated = 1 << 9,
MLMediaPlayerPollingStateFlag_HasSubtitleUpdated = 1 << 10,
MLMediaPlayerPollingStateFlag_HasMetadataUpdated = 1 << 11,
MLMediaPlayerPollingStateFlag_HasDrmInfoUpdated = 1 << 12,
MLMediaPlayerPollingStateFlag_HasResetCompleted = 1 << 13,
MLMediaPlayerPollingStateFlag_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaPlayerInfo
{
MLMediaPlayerInfo_Unknown = 1,
MLMediaPlayerInfo_StartedAsNext = 2,
MLMediaPlayerInfo_RenderingStart = 3,
MLMediaPlayerInfo_Looping = 4,
MLMediaPlayerInfo_Started = 5,
MLMediaPlayerInfo_Paused = 6,
MLMediaPlayerInfo_Stopped = 7,
MLMediaPlayerInfo_StartedBySharedPlayer = 8,
MLMediaPlayerInfo_PausedBySharedPlayer = 9,
MLMediaPlayerInfo_SeekBySharedPlayer = 10,
MLMediaPlayerInfo_StoppedBySharedPlayer = 11,
MLMediaPlayerInfo_SyncStart = 12,
MLMediaPlayerInfo_SyncComplete = 13,
MLMediaPlayerInfo_VideoTrackLagging = 700,
MLMediaPlayerInfo_BufferingStart = 701,
MLMediaPlayerInfo_BufferingEnd = 702,
MLMediaPlayerInfo_NetworkBandwidth = 703,
MLMediaPlayerInfo_BehindLiveWindow = 704,
MLMediaPlayerInfo_PowerStatePause = 705,
MLMediaPlayerInfo_PowerStateResume = 706,
MLMediaPlayerInfo_BufferedDuration = 707,
MLMediaPlayerInfo_BadInterleaving = 800,
MLMediaPlayerInfo_NotSeekable = 801,
MLMediaPlayerInfo_MetadataUpdate = 802,
MLMediaPlayerInfo_PlayAudioError = 804,
MLMediaPlayerInfo_PlayVideoError = 805,
MLMediaPlayerInfo_TimedTextError = 900,
MLMediaPlayerInfo_Ensure32Bits = 0x7FFFFFFF
}
Info and warning codes for the media player framework.
enumMLMediaPlayerTrackType
{
MLMediaPlayerTrackType_Unknown = 0,
MLMediaPlayerTrackType_Video = 1,
MLMediaPlayerTrackType_Audio = 2,
MLMediaPlayerTrackType_TimedText = 3,
MLMediaPlayerTrackType_Subtitle = 4,
MLMediaPlayerTrackType_Metadata = 5,
MLMediaPlayerTrackType_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaPlayerBufferingMode
{
MLMediaPlayerBufferingMode_None = 0,
MLMediaPlayerBufferingMode_TimeOnly = 1,
MLMediaPlayerBufferingMode_SizeOnly = 2,
MLMediaPlayerBufferingMode_TimeThenSize = 3,
MLMediaPlayerBufferingMode_Count = 4,
MLMediaPlayerBufferingMode_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaFramePackingMode
{
MLMediaFramePackingMode_None = 0,
MLMediaFramePackingMode_Checkboard,
MLMediaFramePackingMode_ColumnInterleaved,
MLMediaFramePackingMode_RowInterleaved,
MLMediaFramePackingMode_SideBySideQuincunx,
MLMediaFramePackingMode_SideBySide,
MLMediaFramePackingMode_TopBottom,
MLMediaFramePackingMode_MultiviewFrameByFrame,
MLMediaFramePackingMode_FrameByFrame,
MLMediaFramePackingMode_Anaglyph
}
Frame Packing Arrangement for stereoscopic videos.
enumMLMediaFramePackingFlags
{
MLMediaFramePackingFlags_None = 0,
MLMediaFramePackingFlags_RightViewFirst = 1 << 0,
MLMediaFramePackingFlags_LeftFlipped = 1 << 1,
MLMediaFramePackingFlags_RightFlipped = 1 << 2,
MLMediaFramePackingFlags_Anaglyph_RedCyan = 1 << 3,
MLMediaFramePackingFlags_Anaglyph_GreenMagenta = 1 << 4
}
Frame Packing Arrangement flags for stereoscopic videos.
enumMLTTMLLayoutAlignment
{
MLTTMLLayoutAlignment_Unspecified = 0x7FFFFFFF,
MLTTMLLayoutAlignment_Normal = 0,
MLTTMLLayoutAlignment_Center = 1,
MLTTMLLayoutAlignment_Opposite = 2,
MLTTMLLayoutAlignment_Ensure32Bits = 0x7FFFFFFF
}
Cue text alignment within the cue box.
enumMLTTMLLineType
{
MLTTMLLineType_Unset = 0x7FFFFFFF,
MLTTMLLineType_Fraction = 0,
MLTTMLLineType_Number = 1,
MLTTMLLineType_Ensure32Bits = 0x7FFFFFFF
}
Cue line type.
enumMLTTMLAnchorType
{
MLTTMLAnchorType_Unset = 0x7FFFFFFF,
MLTTMLAnchorType_Start = 0,
MLTTMLAnchorType_Middle = 1,
MLTTMLAnchorType_End = 2,
MLTTMLAnchorType_Ensure32Bits = 0x7FFFFFFF
}
Cue anchor type.
enumMLTTMLTextSizeType
{
MLTTMLTextSizeType_Unset = 0x7FFFFFFF,
MLTTMLTextSizeType_Fractional = 0,
MLTTMLTextSizeType_Fractional_Ignore_Padding = 1,
MLTTMLTextSizeType_Absolute = 2,
MLTTMLTextSizeType_Ensure32Bits = 0x7FFFFFFF
}
Cue text size type.
enumMLWebVTTOrientation
{
MLWebVTTOrientation_Horizontal = 0,
MLWebVTTOrientation_Vertical = 1,
MLWebVTTOrientation_Ensure32Bits = 0x7FFFFFFF
}
Cue orientation setting.
enumMLWebVTTDirection
{
MLWebVTTDirection_Default = 0,
MLWebVTTDirection_LeftToRight = 1,
MLWebVTTDirection_RightToLeft = 2,
MLWebVTTDirection_Ensure32Bits = 0x7FFFFFFF
}
Cue direction setting.
enumMLWebVTTAlign
{
MLWebVTTAlign_Start = 0,
MLWebVTTAlign_Middle = 1,
MLWebVTTAlign_End = 2,
MLWebVTTAlign_Left = 3,
MLWebVTTAlign_Right = 4,
MLWebVTTAlign_Ensure32Bits = 0x7FFFFFFF
}
Cue aligment setting.
enumMLNativeSurfaceAcquiredBufferCount
{
MLNativeSurfaceAcquiredBufferCount_Min = 1,
MLNativeSurfaceAcquiredBufferCount_Max = 16,
MLNativeSurfaceAcquiredBufferCount_Ensure32Bits = 0x7FFFFFFF
}
Number of acquired buffers to be requested in functions MLNativeSurfaceCreate and MLNativeSurfaceTextureCreate.
enumMLNativeSurfacePixelFormat
{
MLNativeSurfacePixelFormat_Custom = -4,
MLNativeSurfacePixelFormat_Translucent = -3,
MLNativeSurfacePixelFormat_Transparent = -2,
MLNativeSurfacePixelFormat_Opaque = -1,
MLNativeSurfacePixelFormat_None = 0,
MLNativeSurfacePixelFormat_Rgba8888 = 1,
MLNativeSurfacePixelFormat_Rgbx8888 = 2,
MLNativeSurfacePixelFormat_Rgb888 = 3,
MLNativeSurfacePixelFormat_Rgb565 = 4,
MLNativeSurfacePixelFormat_Bgra8888 = 5,
MLNativeSurfacePixelFormat_RgbaFp16 = 22,
MLNativeSurfacePixelFormat_Rgba1010102 = 43,
MLNativeSurfacePixelFormat_Ensure32Bits = 0x7FFFFFFF
}
Pixel format to use when creating the native surface. Used in functions MLNativeSurfaceCreate and MLNativeSurfaceTextureCreate.
enumMLNativeSurfaceTextureBackend
{
MLNativeSurfaceTextureBackend_OpenGL = 0,
MLNativeSurfaceTextureBackend_Ensure32Bits = 0x7FFFFFFF
}

Functions

Name
MLResultMLMediaCCParserCreate(MLHandle * out_handle)
Create internal closed caption parser object.
MLResultMLMediaCCParserGetDisplayableEx(MLHandle cc_handle, const uint8_t * subtitle_data, int32_t subtitle_data_size, const MLCea608CaptionSegmentEx ** out_cc_seg)
Return closed caption for display.
MLResultMLMediaCCParserDestroy(MLHandle cc_handle)
Release internal CC parser object.
MLResultMLMediaCCParserSetDisplayChangedCallback(MLHandle cc_handle, MLMediaCCParserDisplayChangedCallback on_display_changed_callback, void * data)
Set callback to get notified when a caption displayable has changed.
MLResultMLMediaCCParserParse(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.
MLResultMLMediaCea708ParserCreate(MLHandle * out_handle)
Create Cea708 parser object.
MLResultMLMediaCea708ParserParse(MLHandle cc_handle, const uint8_t * subtitle_data, uint32_t subtitle_data_size)
Provide Cea708 parser with subtitle raw data for parsing.
MLResultMLMediaCea708ParserDestroy(MLHandle cc_handle)
Release Cea708 parser object.
MLResultMLMediaCea708ParserSetEmitEventCallback(MLHandle cc_handle, MLMediaCea708ParserEmitEventCallback on_emit_event_callback, void * data)
Set callback to get notified when a caption event has generated.
voidMLMediaCodecCallbacksExInit(MLMediaCodecCallbacksEx * inout_callbacks)
Initializes MLMediaCodecCallbacksEx with default values.
voidMLMediaCodecOutputFrameListenerInit(MLMediaCodecOutputFrameListener * inout_callbacks)
Initializes MLMediaCodecOutputFrameListener with default values.
voidMLMediaCodecCryptoInfoInit(MLMediaCodecCryptoInfo * inout_crypto_info)
Initializes MLMediaCodecCryptoInfo with default values.
MLResultMLMediaCodecCreateCryptoInfo(const MLMediaCodecCryptoInfo crypto_info, MLHandle out_crypto_info_handle)
Create a Crypto Info object.
MLResultMLMediaCodecReleaseCryptoInfo(MLHandle crypto_info_handle)
Release the Crypto Info created by MLMediaCodecCreateCryptoInfo.
MLResultMLMediaCodecCreateCodec(MLMediaCodecCreation method, MLMediaCodecType type, const char name_str, MLHandle out_handle)
Create a new MLMediaCodec.
MLResultMLMediaCodecDestroy(MLHandle handle)
Destroy a MLMediaCodec.
MLResultMLMediaCodecSetCallbacksEx(MLHandle handle, MLMediaCodecCallbacksEx callbacks, void user_data)
Set callbacks to notify client codec events. Client needs to implement the callback functions.
MLResultMLMediaCodecSetOutputFrameListener(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.
MLResultMLMediaCodecGetName(MLHandle handle, char * out_name)
Obtain the name of the created codec.
MLResultMLMediaCodecConfigure(MLHandle handle, MLHandle format_handle, MLHandle surface_handle, MLHandle crypto_handle)
Configure the MLMediaCodec.
MLResultMLMediaCodecStart(MLHandle handle)
Start the codec.
MLResultMLMediaCodecStop(MLHandle handle)
Stop the codec.
MLResultMLMediaCodecReset(MLHandle handle)
Reset the codec.
MLResultMLMediaCodecFlush(MLHandle handle)
Flush the both the input and output ports of the codec.
MLResultMLMediaCodecSetParameters(MLHandle handle, MLHandle format_handle)
Communicate additional parameter changes to a codec.
MLResultMLMediaCodecGetInputBufferPointer(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.
MLResultMLMediaCodecGetOutputBufferPointer(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.
MLResultMLMediaCodecQueueInputBuffer(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.
MLResultMLMediaCodecQueueSecureInputBuffer(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.
MLResultMLMediaCodecDequeueInputBuffer(MLHandle handle, int64_t timeout_us, int64_t * out_buffer_index)
Dequeue an input buffer from buffer queue.
MLResultMLMediaCodecDequeueOutputBuffer(MLHandle handle, MLMediaCodecBufferInfo out_buffer_info, int64_t timeout_us, int64_t out_buffer_index)
Dequeue an output buffer from buffer queue.
MLResultMLMediaCodecGetInputFormat(MLHandle handle, MLHandle * out_format_handle)
Obtain input format supported by the codec.
MLResultMLMediaCodecGetOutputFormat(MLHandle handle, MLHandle * out_format_handle)
Return output format supported by the codec, or the format to which the configuration has changed.
MLResultMLMediaCodecCreateInputSurface(MLHandle handle, MLHandle * out_input_surface_handle)
Create an input surface for a hardware encoder.
MLResultMLMediaCodecDestroyInputSurface(MLHandle handle, MLHandle input_surface_handle)
Release the Surface that was created by MLMediaCodecCreateInputSurface.
MLResultMLMediaCodecSignalEndOfInputStream(MLHandle handle)
Signal end-of-stream on input to a surface.
MLResultMLMediaCodecReleaseOutputBuffer(MLHandle handle, int64_t buffer_index, bool render)
Release buffer to codec or to render it on output surface.
MLResultMLMediaCodecReleaseOutputBufferAtTime(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.
MLResultMLMediaCodecListCountCodecs(uint64_t * out_codec_count)
Obtain the number of available codecs.
MLResultMLMediaCodecListIsSoftwareCodec(const char codec_name, bool out_val)
Determine whether a codec is a software codec.
MLResultMLMediaCodecListGetMatchingCodecs(const char mime, bool is_encoder, MLMediaCodecListCodecTypeFlag flag, MLMediaCodecListQueryResults out_matching_codecs)
Obtain a list of matching codecs for a given codec mime.
MLResultMLMediaCodecListGetCodecByType(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.
MLResultMLMediaCodecListGetCodecByName(const char name, int64_t out_index)
Obtain the codec from the codec matching the given codec name from the codec list.
MLResultMLMediaCodecListIsEncoder(uint64_t index, bool * out_val)
Confirm whether a component is an Encoder or Decoder.
MLResultMLMediaCodecListGetCodecName(uint64_t index, char * out_name)
Obtain a codec name.
MLResultMLMediaCodecListGetSupportedMimes(uint64_t index, MLMediaCodecListQueryResults * out_supported_mimes)
Obtain the list of mime types supported by a codec.
MLResultMLMediaCodecListGetCapabilityFlag(uint64_t index, const char mime, MLMediaCodecListCapabilityFlag out_capability_flag)
Obtain the capability flag for a codec.
MLResultMLMediaCodecListGetSecureCodecName(const char mime, bool is_decoder, char out_name)
Obtain the name of a secure codec for the given mime type.
MLResultMLMediaCodecListQueryResultsRelease(MLMediaCodecListQueryResults * query_results)
Release the query results.
MLResultMLMediaCodecListGetSupportedProfileLevels(uint64_t index, const char mime, MLMediaCodecListProfileLevel ** out_profile_levels, size_t out_profile_levels_size)
Obtain the supported profile levels for a codec.
MLResultMLMediaCodecListProfileLevelsRelease(MLMediaCodecListProfileLevel * profile_levels)
Release profile levels.
MLResultMLMediaCodecListGetSupportedColorFormats(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.
MLResultMLMediaCodecListColorFormatsRelease(uint32_t * color_formats)
Release color formats.
MLResultMLMediaCodecListGetSupportedBitrateModes(uint64_t index, const char mime, MLMediaCodecBitrateMode ** out_bitrate_modes, size_t out_bitrate_modes_size)
Obtain the supported bitrate modes for a codec.
MLResultMLMediaCodecBitrateModesRelease(MLMediaCodecBitrateMode * bitrate_modes)
Release Bitrate modes.
MLResultMLMediaCodecListIsAdaptivePlaybackSupported(uint64_t index, const char mime, bool out_supported)
Check whether Adaptive playback is supported.
MLResultMLMediaCodecListIsSecurePlaybackSupported(uint64_t index, const char mime, bool out_supported)
Check whether Secure playback is supported.
MLResultMLMediaCodecListIsIntraRefreshSupported(uint64_t index, const char mime, bool out_supported)
Check whether Intra Refresh is supported.
MLResultMLMediaCryptoCreate(MLUUID uuid, const MLMediaDRMByteArray data, MLHandle out_handle)
Create a MLMediaCrypto instance from a UUID.
MLResultMLMediaCryptoRelease(MLHandle media_crypto)
Release the MLMediaCrypto instance.
MLResultMLMediaCryptoIsCryptoSchemeSupported(MLUUID uuid, bool * out_supported)
Query if the given scheme identified by its UUID is supported on this device.
MLResultMLMediaCryptoRequiresSecureDecoderComponent(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.
MLResultMLMediaCryptoSetMediaDRMSession(MLHandle media_crypto, const MLMediaDRMByteArray * session_id)
Associate a #MediaDRM session with this MLMediaCrypto instance.
MLResultMLMediaDataSourceCreate(MLMediaDataSourceReadAt read_at, MLMediaDataSourceGetSize get_size, MLMediaDataSourceClose close, void context, MLHandle out_handle)
Create a new MediaDataSource object.
MLResultMLMediaDataSourceDestroy(MLHandle media_data_source)
Destroy a #MediaDataSource object.
voidMLMediaDRMEventCallbacksInit(MLMediaDRMEventCallbacks * inout_callbacks)
Initializes MLMediaDRMEventCallbacks with default values.
MLResultMLMediaDRMByteArrayAllocate(size_t size, MLMediaDRMByteArray * out_array)
Allocate byte array buffer.
MLResultMLMediaDRMByteArrayAllocAndCopy(const uint8_t copy_from, size_t size, MLMediaDRMByteArray out_array)
Allocate and Copy to byte array buffer.
MLResultMLMediaDRMKeyValueArrayAllocate(size_t size, MLMediaDRMKeyValueArray * out_array)
Allocate array of key/value pairs.
MLResultMLMediaDRMCreate(MLUUID uuid, MLHandle * out_handle)
Create a MLMediaDRM instance from a UUID.
MLResultMLMediaDRMRelease(MLHandle media_drm)
Release the MLMediaDRM instance.
MLResultMLMediaDRMByteArrayRelease(MLMediaDRMByteArray * array)
Release byte array buffer.
MLResultMLMediaDRMByteArrayListRelease(MLMediaDRMByteArrayList * array)
Release list of byte array buffer.
MLResultMLMediaDRMKeyValueArrayRelease(MLMediaDRMKeyValueArray * array)
Release key/value pair array.
MLResultMLMediaDRMRequestMessageRelease(MLMediaDRMRequestMessage * request)
Release Request Message.
MLResultMLMediaDRMKeyValueArrayAdd(const MLMediaDRMKeyValue pair, MLMediaDRMKeyValueArray out_array)
Add a key/value pair to the array of key/value pairs.
MLResultMLMediaDRMIsCryptoSchemeSupported(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.
MLResultMLMediaDRMSetOnEventListenerEx(MLHandle media_drm, MLMediaDRMEventCallbacks callbacks, void data)
Register a callback to be invoked when DRM events or updates or status change occurs.
MLResultMLMediaDRMOpenSession(MLHandle media_drm, MLMediaDRMByteArray * out_session_id)
Opens a new session. A session ID is returned.
MLResultMLMediaDRMCloseSession(MLHandle media_drm, MLMediaDRMByteArray * session_id)
Closes a session on the MLMediaDRM object that was previously opened with openSession().
MLResultMLMediaDRMGetKeyRequest(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.
MLResultMLMediaDRMProvideKeyResponse(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().
MLResultMLMediaDRMRestoreKeys(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().
MLResultMLMediaDRMRemoveKeys(MLHandle media_drm, MLMediaDRMByteArray * key_set_id)
Remove the current keys from a session.
MLResultMLMediaDRMQueryKeyStatus(MLHandle media_drm, const MLMediaDRMByteArray session_id, MLMediaDRMKeyValueArray out_info_map)
Request an informative description of the key status for the session.
MLResultMLMediaDRMGetProvisionRequest(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.
MLResultMLMediaDRMProvideProvisionResponse(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.
MLResultMLMediaDRMGetSecureStops(MLHandle media_drm, MLMediaDRMByteArrayList * out_secure_stops)
Access all secure stops.
MLResultMLMediaDRMGetSecureStop(MLHandle media_drm, const MLMediaDRMByteArray ss_id, MLMediaDRMByteArray out_secure_stop)
Access secure stop by secure stop ID.
MLResultMLMediaDRMReleaseSecureStops(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.
MLResultMLMediaDRMReleaseAllSecureStops(MLHandle media_drm)
Remove all the SecureStops.
MLResultMLMediaDRMGetPropertyString(MLHandle media_drm, MLMediaDRMProperty property_name, char ** out_property_value)
Read a DRM engine plugin String property value, given the property name.
MLResultMLMediaDRMGetPropertyByteArray(MLHandle media_drm, MLMediaDRMProperty property_name, MLMediaDRMByteArray * out_property_value)
Read a DRM engine plugin byte array property value, given the property name.
MLResultMLMediaDRMSetPropertyString(MLHandle media_drm, MLMediaDRMProperty property_name, const char * property_value)
Set a DRM engine plugin String property value.
MLResultMLMediaDRMSetPropertyByteArray(MLHandle media_drm, MLMediaDRMProperty property_name, const MLMediaDRMByteArray * property_value)
Set a DRM engine plugin byte array property value.
MLResultMLMediaDRMEncrypt(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.
MLResultMLMediaDRMDecrypt(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.
MLResultMLMediaDRMSign(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.
MLResultMLMediaDRMVerify(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.
MLResultMLMediaDRMSignRSA(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.
MLResultMLMediaExtractorCreate(MLHandle * out_handle)
Create a new MLMediaExtractor.
MLResultMLMediaExtractorDestroy(MLHandle handle)
Destroy a MLMediaExtractor.
MLResultMLMediaExtractorSetDataSourceForPath(MLHandle handle, const char * path)
Set a local file path as the data source.
MLResultMLMediaExtractorSetDataSourceForURI(MLHandle handle, const char * uri)
Set a URI string as the data source.
MLResultMLMediaExtractorSetDataSourceForURIWithHeaders(MLHandle handle, const char * uri, const char ** headers, size_t len)
Set a URI string as the data source.
MLResultMLMediaExtractorSetDataSourceForFD(MLHandle handle, int fd, int64_t offset, int64_t length)
Set the data source as the file-descriptor to use.
MLResultMLMediaExtractorSetMediaDataSource(MLHandle handle, MLHandle media_data_source)
Sets the data source as user defined media data source.
MLResultMLMediaExtractorGetDRMInitData(MLHandle handle, MLUUID drm_uuid, MLMediaExtractorDRMSchemeInitData * out_drm_init_data)
Extract DRM initialization data for a given DRM Scheme if it exists.
MLResultMLMediaExtractorReleaseDRMInitData(MLHandle handle, MLMediaExtractorDRMSchemeInitData * drm_init_data)
Release DRM initialization data which was previously retrieved.
MLResultMLMediaExtractorGetTrackCount(MLHandle handle, uint64_t * out_track_count)
Count the number of tracks found in the data source.
MLResultMLMediaExtractorGetTrackFormat(MLHandle handle, size_t index, MLHandle * out_track_handle)
Get the track format at the specified index.
MLResultMLMediaExtractorSelectTrack(MLHandle handle, size_t index)
Select a track for the subsequent operations.
MLResultMLMediaExtractorUnselectTrack(MLHandle handle, size_t index)
Unselect a track for the subsequent operations.
MLResultMLMediaExtractorSeekTo(MLHandle handle, int64_t time_us, MLMediaSeekMode mode)
All selected tracks seek near the requested time according to the specified mode.
MLResultMLMediaExtractorAdvance(MLHandle handle)
Advance to the next sample.
MLResultMLMediaExtractorReadSampleData(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.
MLResultMLMediaExtractorGetSampleTrackIndex(MLHandle handle, int64_t * out_track_index)
Return the track index the current sample originates from.
MLResultMLMediaExtractorGetSampleTime(MLHandle handle, int64_t * out_sample_time)
Return the current sample's presentation time in microseconds.
MLResultMLMediaExtractorGetSampleFlags(MLHandle handle, int * out_sample_flags)
Return the current sample's flags.
MLResultMLMediaExtractorGetSampleCryptoInfo(MLHandle handle, MLHandle * out_info_handle)
Return the current sample's Crypto info if has encrypted sample.
MLResultMLMediaExtractorReleaseCryptoInfo(MLHandle handle, MLHandle * inout_info_handle)
Release the Crypto Info.
MLResultMLMediaExtractorGetCachedDuration(MLHandle handle, int64_t * out_cached_duration)
Return an estimate of how much data is presently cached in memoryexpressed in microseconds.
MLResultMLMediaExtractorHasCacheReachedEOS(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).
MLResultMLMediaExtractorGetPSSHInfoCount(MLHandle handle, size_t * out_index)
Get the Number of PSSH info if present.
MLResultMLMediaExtractorGetPSSHInfo(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.
MLResultMLMediaExtractorReleasePSSHInfo(MLHandle handle, MLMediaExtractorPSSHEntry * pssh_entry)
Clear the PSSH info data.
MLResultMLMediaFormatCreateVideo(const char mime_type, int width, int height, MLHandle out_handle)
Create a video format object.
MLResultMLMediaFormatCreateAudio(const char mime_type, int sample_rate, int channel_count, MLHandle out_handle)
Create a audio format object.
MLResultMLMediaFormatCreateSubtitle(const char mime_type, const char language, MLHandle * out_handle)
Create a subtitle format object.
MLResultMLMediaFormatCreate(MLHandle * out_handle)
Create an empty format object.
MLResultMLMediaFormatCreateCopy(MLHandle handle, MLHandle * out_handle)
Create a copy of the format handle provided.
MLResultMLMediaFormatDestroy(MLHandle handle)
Destroy a MLMediaFormat object.
MLResultMLMediaFormatObjectToString(MLHandle handle, char * out_string)
Obtain the human readable representation of the format.
MLResultMLMediaFormatGetKeyValueInt32(MLHandle handle, MLMediaFormatKey name, int32_t * out_key)
Obtain the value of an integer key.
MLResultMLMediaFormatGetKeyValueInt64(MLHandle handle, MLMediaFormatKey name, int64_t * out_key)
Obtain the value of a long key.
MLResultMLMediaFormatGetKeyValueFloat(MLHandle handle, MLMediaFormatKey name, float * out_key)
Obtain the value of an float key.
MLResultMLMediaFormatGetKeySize(MLHandle handle, MLMediaFormatKey name, size_t * out_size)
Obtain the size of a key.
MLResultMLMediaFormatGetKeyString(MLHandle handle, MLMediaFormatKey name, char * out_string)
Obtain the value of a string key.
MLResultMLMediaFormatGetKeyByteBuffer(MLHandle handle, MLMediaFormatKey name, MLMediaFormatByteArray * out_buffer)
Obtain the value of a ByteBuffer key.
MLResultMLMediaFormatKeyByteBufferRelease(MLHandle handle, MLMediaFormatByteArray * buffer)
Release the ByteBuffer acquired by MLMediaFormatGetKeyByteBuffer.
MLResultMLMediaFormatSetKeyInt32(MLHandle handle, MLMediaFormatKey name, int32_t key_value)
Set the value of an integer key.
MLResultMLMediaFormatSetKeyInt64(MLHandle handle, MLMediaFormatKey name, int64_t key_value)
Set the value of a long key.
MLResultMLMediaFormatSetKeyFloat(MLHandle handle, MLMediaFormatKey name, float key_value)
Set the value of a float key.
MLResultMLMediaFormatSetKeySize(MLHandle handle, MLMediaFormatKey name, size_t key_size)
Set the size of a key.
MLResultMLMediaFormatSetKeyString(MLHandle handle, MLMediaFormatKey name, const char * key_value)
Set the value of a string key.
MLResultMLMediaFormatSetKeyByteBuffer(MLHandle handle, MLMediaFormatKey name, const MLMediaFormatByteArray * buffer)
Set the value of a ByteBuffer key.
voidMLMediaPlayerEventCallbacksExInit(MLMediaPlayerEventCallbacksEx * inout_callbacks)
Initializes MediaPlayerEventCallbacks with default values.
voidMLMediaPlayerTrackInfoInit(MLMediaPlayerTrackInfo * inout_track_info)
Initializes Media Track Information with default values.
voidMLMediaPlayerTrackDRMSessionInfoInit(MLMediaPlayerTrackDRMSessionInfo * inout_drm_session_info)
Initializes Media Track DRM Session Information with defult values.
MLResultMLMediaPlayerCreate(MLHandle * out_handle)
Create a new Media Player object.
MLResultMLMediaPlayerDestroy(MLHandle media_player)
Destroys a MediaPlayer object.
MLResultMLMediaPlayerSetDataSourceForFD(MLHandle media_player, int32_t fd)
Sets a file descriptor as the data source.
MLResultMLMediaPlayerSetOffsetDataSourceForFD(MLHandle media_player, int32_t fd, int64_t offset, int64_t length)
Sets a file descriptor as the data source with offset.
MLResultMLMediaPlayerSetDataSourceForPath(MLHandle media_player, const char * path)
Sets a local file path as the data source.
MLResultMLMediaPlayerSetDataSourceForURI(MLHandle media_player, const char * uri)
Sets a URI string as the data source.
MLResultMLMediaPlayerSetRemoteDataSourceForURI(MLHandle media_player, const char * uri, char ** headers, size_t len)
Sets a URI string as the remote data source.
MLResultMLMediaPlayerSetMediaDataSource(MLHandle media_player, MLHandle media_data_source)
Sets the data source to use.
MLResultMLMediaPlayerSetMediaStreamSource(MLHandle media_player, MLHandle media_stream_source)
Sets the data source to use.
MLResultMLMediaPlayerAddTimedTextSourceForURI(MLHandle media_player, const char uri, const char mime_type)
Adds a TimedText source from a URI.
MLResultMLMediaPlayerAddTimedTextSourceForFD(MLHandle media_player, int32_t fd, int64_t offset, int64_t length, const char * mime_type)
Adds a TimedText source from a file descriptor.
MLResultMLMediaPlayerSetNextPlayer(MLHandle media_player, MLHandle next_media_player)
Sets the 'next' Media Player to automatically 'start' when current Media Player playback completes.
MLResultMLMediaPlayerGetTrackCount(MLHandle media_player, uint32_t * out_track_count)
Counts the number of tracks found in the data source.
MLResultMLMediaPlayerGetTrackType(MLHandle media_player, uint32_t track, MLMediaPlayerTrackType * out_track_type)
Gets the type of a track.
MLResultMLMediaPlayerGetTrackLanguage(MLHandle media_player, uint32_t track, char ** out_track_language)
Gets the language of a track.
MLResultMLMediaPlayerGetTrackMediaFormat(MLHandle media_player, uint32_t track, MLHandle * out_media_format)
Gets the Media Format of a track.
MLResultMLMediaPlayerSelectTrack(MLHandle media_player, uint32_t track)
Selects a track.
MLResultMLMediaPlayerUnselectTrack(MLHandle media_player, uint32_t track)
Unselects a track.
MLResultMLMediaPlayerPrepare(MLHandle media_player)
Prepares the player for playback, synchronously.
MLResultMLMediaPlayerPrepareAsync(MLHandle media_player)
Prepares the player for playback, asynchronously.
MLResultMLMediaPlayerStart(MLHandle media_player)
Starts or resumes playback.
MLResultMLMediaPlayerStop(MLHandle media_player)
Stops playback after playback has been started or paused.
MLResultMLMediaPlayerPause(MLHandle media_player)
Pauses playback.
MLResultMLMediaPlayerReset(MLHandle media_player)
Resets the Media Player to its uninitialized state.
MLResultMLMediaPlayerSeekTo(MLHandle media_player, int msec, MLMediaSeekMode mode)
Seeks to specified time position.
MLResultMLMediaPlayerSetEventCallbacksEx(MLHandle media_player, const MLMediaPlayerEventCallbacksEx callbacks, void data)
Sets callbacks to notify clients about player events.
MLResultMLMediaPlayerGetVideoSize(MLHandle media_player, int32_t out_width, int32_t out_height)
Returns the size of the video frame.
MLResultMLMediaPlayerGetCurrentPosition(MLHandle media_player, int32_t * out_msec)
Returns current position of playback.
MLResultMLMediaPlayerGetDuration(MLHandle media_player, int32_t * out_msec)
Returns media duration.
MLResultMLMediaPlayerGetBufferingUpdate(MLHandle media_player, int32_t * out_percentage)
Returns current buffering percentage.
MLResultMLMediaPlayerGetInfo(MLHandle media_player, int32_t out_code, int32_t out_extra)
Returns last info received by internal Media Player.
MLResultMLMediaPlayerGetError(MLHandle media_player, MLResult * out_result)
Returns last error received by internal Media Player.
MLResultMLMediaPlayerGetTimedText(MLHandle media_player, const char * out_text, int32_t out_start, int32_t * out_end)
Returns last timed text event information.
MLResultMLMediaPlayerGetSubtitleEx(MLHandle media_player, MLMediaPlayerSubtitleData ** out_subtitle_data)
Returns last subtitle event information.
MLResultMLMediaPlayerReleaseSubtitleEx(MLHandle media_player)
Releases last subtitle event information.
MLResultMLMediaPlayerSetOnMediaSubtitleUpdateCallback(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.
MLResultMLMediaPlayerGetMetadata(MLHandle media_player, int64_t out_time, int32_t out_size, uint8_t ** out_buffer)
Returns last metadata event information.
MLResultMLMediaPlayerSetVideoScalingMode(MLHandle media_player, MLMediaPlayerVideoScalingMode mode)
Sets video scaling mode.
MLResultMLMediaPlayerSetLooping(MLHandle media_player, bool loop)
Sets the looping mode of the player.
MLResultMLMediaPlayerSetVolume(MLHandle media_player, float volume)
Sets the volume on this player.
MLResultMLMediaPlayerGetAudioHandle(MLHandle media_player, MLHandle * out_handle)
Gets the handle of the audio stream.
MLResultMLMediaPlayerPollStates(MLHandle media_player, uint16_t mask, uint16_t * out_polled_states)
Polls the desired states from internal Media Player.
MLResultMLMediaPlayerGetTrackDRMInfo(MLHandle media_player, const MLMediaPlayerTrackInfo * track_info, MLMediaPlayerTrackDRMInfo ** out_drm_info)
Gets the DRM info of the selected media (either audio or video) track.
MLResultMLMediaPlayerPrepareTrackDRM(MLHandle media_player, const MLMediaPlayerTrackDRMSessionInfo * drm_session_info)
Prepares DRM for the selected media (either audio or video) track.
MLResultMLMediaPlayerReleaseDRM(MLHandle media_player)
Releases DRM.
MLResultMLMediaPlayerGetDefaultBufferingSettings(MLHandle media_player, MLMediaPlayerBufferingSettings * out_buf_settings)
Gets default Buffering settings.
MLResultMLMediaPlayerGetBufferingSettings(MLHandle media_player, MLMediaPlayerBufferingSettings * out_buf_settings)
Gets current Buffering settings.
MLResultMLMediaPlayerSetBufferingSettings(MLHandle media_player, MLMediaPlayerBufferingSettings buf_settings)
Sets buffering settings.
MLResultMLMediaPlayerSetOnMediaTimedTextUpdateCallback(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.
MLResultMLMediaPlayerGetWebVTTData(MLHandle media_player, MLHandle timed_text, MLWebVTTData ** out_webvtt_data)
Gets WebVTT data represented by a timed text handle.
MLResultMLMediaPlayerGetTTMLData(MLHandle media_player, MLHandle timed_text, MLTTMLData ** out_ttml_data)
Gets TTML data represented by a timed text handle.
MLResultMLMediaPlayerResetAsync(MLHandle media_player)
Resets the Media Player to its uninitialized state asynchronously.
MLResultMLMediaPlayerGetMetrics(MLHandle media_player, MLMediaPlayerMetrics * out_metrics)
Retrieves metrics recorded on the MediaPlayer.
MLResultMLMediaPlayerSetSurface(MLHandle media_player, MLHandle surface)
Sets the Native surface to be used as the sink for displaying the video portion of the media.
MLResultMLMediaStreamSourceCreate(MLMediaStreamSourceOnBufferAvailable on_buffer_available, void context, MLHandle out_handle)
Create a new MediaStreamSource object.
MLResultMLMediaStreamSourceDestroy(MLHandle media_stream_source)
Destroy a MediaStreamSource object.
MLResultMLMediaStreamSourceGetBuffer(MLHandle media_stream_source, size_t out_id, uint8_t ** out_ptr, size_t out_size)
Get a buffer where data can be written.
MLResultMLMediaStreamSourcePushBuffer(MLHandle media_stream_source, size_t id, size_t size)
Push a buffer.
MLResultMLMediaStreamSourcePushEOS(MLHandle media_stream_source)
Push End-Of-Stream event.
voidMLNativeSurfaceConfigInit(MLNativeSurfaceConfig * inout_config_values)
Initializes MLNativeSurfaceConfig with default values.
voidMLNativeSurfaceOnFrameAvailableCallbackInit(MLNativeSurfaceOnFrameAvailableCallback * inout_callbacks)
Initializes MLNativeSurfaceOnFrameAvailableCallback with default values.
MLResultMLNativeSurfaceCreate(const MLNativeSurfaceConfig config_values, MLHandle out_handle)
Create a new NativeSurface.
MLResultMLNativeSurfaceRelease(MLHandle handle)
Release a NativeSurface.
MLResultMLNativeSurfaceGetNativeWindow(MLHandle handle, MLHandle out_native_window, int32_t out_format)
Gets an implementation of NativeWindow that feeds graphic buffers into MLNativeSurface.
MLResultMLNativeSurfaceReleaseNativeWindow(MLHandle handle, MLHandle native_window)
Releases NativeWindow previously acquired by MLNativeSurfaceGetNativeWindow.
MLResultMLNativeSurfaceAcquireNextAvailableFrame(MLHandle handle, MLHandle * out_native_buffer)
Consume next available buffer.
MLResultMLNativeSurfaceAcquireHardwareBufferFromNativeBuffer(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.
MLResultMLNativeSurfaceReleaseFrame(MLHandle handle, MLHandle native_buffer)
Release a native buffer previously acquired.
MLResultMLNativeSurfaceGetFrameTransformationMatrix(MLHandle handle, float out_mtx[16])
Retrieves the 4x4 texture coordinate transform matrix associated with the last acquired Frame.
MLResultMLNativeSurfaceGetFrameTimestamp(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.
MLResultMLNativeSurfaceGetFrameQueueBufferTimestamp(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.
MLResultMLNativeSurfaceGetFrameNumber(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.
MLResultMLNativeSurfaceGetFrameCropRect(MLHandle handle, MLRecti * out_crop_rect)
Retrieves the cropping rectangle of the current frame/buffer.
MLResultMLNativeSurfaceSetOnFrameAvailableCallback(MLHandle handle, const MLNativeSurfaceOnFrameAvailableCallback callback, void user_data)
Set callback to notify client when a frame is available.
MLResultMLNativeSurfaceTextureCreate(const MLNativeSurfaceConfig config_values, MLNativeSurfaceTextureBackend backend, MLHandle out_handle)
Create a new NativeSurfaceTexture.
MLResultMLNativeSurfaceTextureRelease(MLHandle handle)
Release a NativeSurfaceTexture.
MLResultMLNativeSurfaceTextureUpdateTexImage(MLHandle handle)
Update the texture image to the most recent frame from the image stream.
MLResultMLNativeSurfaceTextureAttachToGLContext(MLHandle handle, uint32_t texture_id)
Attach the NativeSurfaceTexture to the graphic context that is current on the calling thread.
MLResultMLNativeSurfaceTextureDetachFromGLContext(MLHandle handle)
Detach the NativeSurfaceTexture from the graphic context that owns the graphic texture object.
MLResultMLNativeSurfaceTextureGetTransformationMatrix(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.
MLResultMLNativeSurfaceTextureGetTimestamp(MLHandle handle, int64_t * out_timestamp_ns)
Retrieve the timestamp associated with the texture image set by the most recent call to MLNativeSurfaceTextureUpdateTexImage.
MLResultMLNativeSurfaceTextureSetOnFrameAvailableCallback(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_tMLAudioChannelOutMono
const int32_tMLAudioChannelOutStereo
const int32_tMLAudioChannelOutQuad
const int32_tMLAudioChannelOutSurround
const int32_tMLAudioChannelOut5Point1
const int32_tMLAudioChannelOut7Point1
const int32_tMLAudioChannelOut7Point1Surround
MLMediaDRMPropertyMLMediaDRMProperty_Vendor
MLMediaDRMPropertyMLMediaDRMProperty_Version
MLMediaDRMPropertyMLMediaDRMProperty_Description
MLMediaDRMPropertyMLMediaDRMProperty_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.
MLMediaDRMPropertyMLMediaDRMProperty_DeviceUniqueID
Byte array property name: the device unique identifier is established during device provisioning and provides a means of uniquely identifying each device.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_Key_AAC_DRC_Attenuation_Factor
A key describing the attenuation factor allowing to adapt the dynamics of the output to the actual listening requirements.
MLMediaFormatKeyMLMediaFormat_Key_AAC_DRC_Heavy_Compression
A key describing the selection of the heavy compression profile for DRC.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_Key_AAC_Max_Output_Channel_Count
A key describing the maximum number of channels that can be output by the AAC decoder.
MLMediaFormatKeyMLMediaFormat_Key_AAC_Profile
A key describing the AAC profile to be used (AAC audio formats only).
MLMediaFormatKeyMLMediaFormat_Key_AAC_SBR_Mode
A key describing the AAC SBR mode to be used (AAC audio formats only).
MLMediaFormatKeyMLMediaFormat_Key_Bit_Rate
A key describing the average bitrate in bits/sec.
MLMediaFormatKeyMLMediaFormat_Key_Bit_Rate_Mode
A key describing the desired bitrate mode to be used by an encoder.
MLMediaFormatKeyMLMediaFormat_Key_Capture_Rate
A key describing the capture rate of a video format in frames/sec.
MLMediaFormatKeyMLMediaFormat_Key_Channel_Count
A key describing the number of channels in an audio format.
MLMediaFormatKeyMLMediaFormat_Key_Channel_Mask
A key describing the channel composition of audio content.
MLMediaFormatKeyMLMediaFormat_Key_Color_Format
A key describing the color format of the content in a video format.
MLMediaFormatKeyMLMediaFormat_Key_Duration
A key describing the duration (in microseconds) of the content.
MLMediaFormatKeyMLMediaFormat_Key_FLAC_Compression_Level
A key describing the FLAC compression level to be used (FLAC audio format only).
MLMediaFormatKeyMLMediaFormat_Key_Frame_Rate
A key describing the frame rate of a video format in frames/sec.
MLMediaFormatKeyMLMediaFormat_Key_Height
A key describing the height of the content in a video format.
MLMediaFormatKeyMLMediaFormat_Key_I_Frame_Interval
A key describing the frequency of key frames expressed in seconds between key frames.
MLMediaFormatKeyMLMediaFormat_Key_Intra_Refresh_Period
An optional key describing the period of intra refresh in frames.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_Key_Is_Forced_Subtitle
A key for the FORCED field for subtitle tracks.
MLMediaFormatKeyMLMediaFormat_Key_Language
A key describing the language of the content, using either ISO 639-1 or 639-2/T codes.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_Key_Max_Input_Size
Described by this MediaFormat.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_Key_Mime
A key describing the mime type of the MediaFormat.
MLMediaFormatKeyMLMediaFormat_Key_PCM_Encoding
A key describing the raw audio sample encoding/format.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_Key_Repeat_Previous_Frame_After
Applies only when configuring a video encoder in "surface-input" mode.
MLMediaFormatKeyMLMediaFormat_Key_Sample_Rate
A key describing the sample rate of an audio format.
MLMediaFormatKeyMLMediaFormat_Key_Stride
A key describing the stride of the video bytebuffer layout.
MLMediaFormatKeyMLMediaFormat_Key_Temporal_Layering
A key describing the temporal layering schema.
MLMediaFormatKeyMLMediaFormat_Key_Width
A key describing the width of the content in a video format.
MLMediaFormatKeyMLMediaFormat_Key_Crop_Left
The left-coordinate (x) of the crop rectangle.
MLMediaFormatKeyMLMediaFormat_Key_Crop_Right
The right-coordinate (x) MINUS 1 of the crop rectangle.
MLMediaFormatKeyMLMediaFormat_Key_Crop_Bottom
The bottom-coordinate (y) MINUS 1 of the crop rectangle.
MLMediaFormatKeyMLMediaFormat_Key_Crop_Top
The top-coordinate (y) of the crop rectangle.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_Key_Latency
An optional key describing the desired encoder latency in frames.
MLMediaFormatKeyMLMediaFormat_Key_Parameter_Video_Bitrate
A key describing the desired video bitrate.
MLMediaFormatKeyMLMediaFormat_Key_Parameter_Request_Sync_Frame
Request that the encoder produce a sync frame "soon".
MLMediaFormatKeyMLMediaFormat_Key_Parameter_Set_Suspend
Temporarily suspend/resume encoding of input data.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_Key_Parameter_Drop_Before
A key describing the desired before which frames are to be skipped.
MLMediaFormatKeyMLMediaFormat_Key_Parameter_Drop_After
A key describing the desired after which frames are to be skipped.
MLMediaFormatKeyMLMediaFormat_Key_Parameter_Offset_Time
Specify an offset (in micro-second) to be added on top of the timestamps onward.
MLMediaFormatKeyMLMediaFormat_Key_Priority
A key describing the desired codec priority.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_Key_Intra_Refresh_Mode
An optional key describing the mode of intra refresh in frames. The associated value is an integer.
MLMediaFormatKeyMLMediaFormat_Key_Intra_Refresh_CIR_Num
Number of consecutive macroblocks to be coded as intra when CIR is enabled.
MLMediaFormatKeyMLMediaFormat_Key_Intra_Refresh_AIR_Num
Number of intra macroblocks to refresh in a frame when AIR is enabled.
MLMediaFormatKeyMLMediaFormat_Key_Intra_Refresh_AIR_Ref
Number of times a motion marked macroblock has to be intra coded.
MLMediaFormatKeyMLMediaFormat_Key_Profile
A key describing the desired profile to be used by an encoder.
MLMediaFormatKeyMLMediaFormat_Key_Level
A key describing the desired level to be used by an encoder.
MLMediaFormatKeyMLMediaFormat_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).
MLMediaFormatKeyMLMediaFormat_Key_Color_Range
An optional key describing the range of the component values of the video content.
MLMediaFormatKeyMLMediaFormat_Key_Color_Standard
An optional key describing the color primaries, white point and luminance factors for video content.
MLMediaFormatKeyMLMediaFormat_Key_Color_Transfer
An optional key describing the opto-electronic transfer function used for the video content.
MLMediaFormatKeyMLMediaFormat_Key_HDR_Static_Info
An optional key describing the static metadata of HDR (high-dynamic-range) video content.
MLMediaFormatKeyMLMediaFormat_Key_CSD
A key describing the codec specific data.
MLMediaFormatKeyMLMediaFormat_Key_CSD0
A key describing the codec specific data buffer #0.
MLMediaFormatKeyMLMediaFormat_Key_CSD1
A key describing the codec specific data buffer #1.
MLMediaFormatKeyMLMediaFormat_Key_CSD2
A key describing the codec specific data buffer #2.
MLMediaFormatKeyMLMediaFormat_Key_CSD_Avc
A key describing the codec specific data buffer for AVC (h.264).
MLMediaFormatKeyMLMediaFormat_Key_CSD_Hevc
A key describing the codec specific data buffer for HEVC (h.265).
MLMediaFormatKeyMLMediaFormat_Key_Album
A key describing metadata - album title of the media.
MLMediaFormatKeyMLMediaFormat_Key_Albumart
A key describing metadata. The artwork for the album of the media's original source as a Bitmap.
MLMediaFormatKeyMLMediaFormat_Key_Albumartist
A key describing metadata. The artist for the album of the media's original source.
MLMediaFormatKeyMLMediaFormat_Key_Artist
A key describing metadata. The artist of the media.
MLMediaFormatKeyMLMediaFormat_Key_Audio_Presentation_Info
A key describing metadata. The media presentation info.
MLMediaFormatKeyMLMediaFormat_Key_Audio_Presentation_Presentation_Id
A key describing metadata. The media presentation Id.
MLMediaFormatKeyMLMediaFormat_Key_Audio_Presentation_Program_Id
A key describing metadata. The media program Id.
MLMediaFormatKeyMLMediaFormat_Key_Audio_Session_Id
A key describing the audio session ID of the AudioTrack associated to a tunneled video codec.
MLMediaFormatKeyMLMediaFormat_Key_Author
A key describing metadata. The author of the media.
MLMediaFormatKeyMLMediaFormat_Key_Bits_Per_Sample
Key representing media number of bits per sample.
MLMediaFormatKeyMLMediaFormat_Key_Cdtracknumber
A key describing metadata. The cd track number.
MLMediaFormatKeyMLMediaFormat_Key_Compilation
A key describing metadata. The media compilation.
MLMediaFormatKeyMLMediaFormat_Key_Complexity
A key describing the encoding complexity.
MLMediaFormatKeyMLMediaFormat_Key_Composer
A key describing metadata - composer of the media.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_Key_Crypto_Default_Iv_Size
MLMediaFormatKeyMLMediaFormat_Key_Crypto_Encrypted_Byte_Block
MLMediaFormatKeyMLMediaFormat_Key_Crypto_Encrypted_Sizes
MLMediaFormatKeyMLMediaFormat_Key_Crypto_Iv
MLMediaFormatKeyMLMediaFormat_Key_Crypto_Key
MLMediaFormatKeyMLMediaFormat_Key_Crypto_Mode
MLMediaFormatKeyMLMediaFormat_Key_Crypto_Plain_Sizes
MLMediaFormatKeyMLMediaFormat_Key_Crypto_Skip_Byte_Block
MLMediaFormatKeyMLMediaFormat_Key_D263
MLMediaFormatKeyMLMediaFormat_Key_Date
A key describing metadata - The date the media was created or published. The format is unspecified but RFC 3339 is recommended.
MLMediaFormatKeyMLMediaFormat_Key_Discnumber
A key describing metadata. The disc number for the media's original source.
MLMediaFormatKeyMLMediaFormat_Key_Display_Crop
A key describing display crop rectangle.
MLMediaFormatKeyMLMediaFormat_Key_Display_Height
MLMediaFormatKeyMLMediaFormat_Key_Display_Width
MLMediaFormatKeyMLMediaFormat_Key_Encoder_Delay
A key describing the number of frames to trim from the start of the decoded audio stream.
MLMediaFormatKeyMLMediaFormat_Key_Encoder_Padding
A key describing the number of frames to trim from the end of the decoded audio stream.
MLMediaFormatKeyMLMediaFormat_Key_Esds
A key describing the electrostatic discharge and soldering (ESDS).
MLMediaFormatKeyMLMediaFormat_Key_Exif_Offset
MLMediaFormatKeyMLMediaFormat_Key_Exif_Size
MLMediaFormatKeyMLMediaFormat_Key_Frame_Count
MLMediaFormatKeyMLMediaFormat_Key_Genre
A key describing metadata. The media genre.
MLMediaFormatKeyMLMediaFormat_Key_Grid_Columns
A key describing the number of grid columns in the content in a MIMETYPE_IMAGE_ANDROID_HEIC track.
MLMediaFormatKeyMLMediaFormat_Key_Grid_Rows
A key describing the number of grid rows in the content in a MIMETYPE_IMAGE_ANDROID_HEIC track.
MLMediaFormatKeyMLMediaFormat_Key_Haptic_Channel_Count
A key describing the number of haptic channels in an audio format.
MLMediaFormatKeyMLMediaFormat_Key_Hdr10_Plus_Info
An optional key describing the HDR10+ metadata of the video content.
MLMediaFormatKeyMLMediaFormat_Key_Icc_Profile
MLMediaFormatKeyMLMediaFormat_Key_Is_Sync_Frame
MLMediaFormatKeyMLMediaFormat_Key_Location
A key describing metadata. The media location.
MLMediaFormatKeyMLMediaFormat_Key_Loop
A key describing metadata. The media loop.
MLMediaFormatKeyMLMediaFormat_Key_Lyricist
A key describing metadata. The media lyricist.
MLMediaFormatKeyMLMediaFormat_Key_Manufacturer
A key describing metadata. The media manufacturer.
MLMediaFormatKeyMLMediaFormat_Key_Max_Bit_Rate
A key describing the max bitrate in bits/sec.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_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).
MLMediaFormatKeyMLMediaFormat_Key_Mpeg_User_Data
MLMediaFormatKeyMLMediaFormat_Key_Mpeg2_Stream_Header
MLMediaFormatKeyMLMediaFormat_Key_PCM_Big_Endian
MLMediaFormatKeyMLMediaFormat_Key_Pssh
MLMediaFormatKeyMLMediaFormat_Key_Rotation
A key describing the desired clockwise rotation on an output surface.
MLMediaFormatKeyMLMediaFormat_Key_Sar_Height
MLMediaFormatKeyMLMediaFormat_Key_Sar_Width
MLMediaFormatKeyMLMediaFormat_Key_Sei
MLMediaFormatKeyMLMediaFormat_Key_Slice_Height
A key describing the plane height of a multi-planar (YUV) video bytebuffer layout.
MLMediaFormatKeyMLMediaFormat_Key_Target_Time
MLMediaFormatKeyMLMediaFormat_Key_Temporal_Layer_Count
MLMediaFormatKeyMLMediaFormat_Key_Temporal_Layer_Id
MLMediaFormatKeyMLMediaFormat_Key_Text_Format_Data
MLMediaFormatKeyMLMediaFormat_Key_Thumbnail_CSD_Hevc
MLMediaFormatKeyMLMediaFormat_Key_Thumbnail_Height
MLMediaFormatKeyMLMediaFormat_Key_Thumbnail_Time
MLMediaFormatKeyMLMediaFormat_Key_Thumbnail_Width
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_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.
MLMediaFormatKeyMLMediaFormat_Key_Time_Us
MLMediaFormatKeyMLMediaFormat_Key_Title
A key describing metadata. The title of the media.
MLMediaFormatKeyMLMediaFormat_Key_Track_Id
A key describing a unique ID for the content of a media track.
MLMediaFormatKeyMLMediaFormat_Key_Track_Index
MLMediaFormatKeyMLMediaFormat_Key_Valid_Samples
MLMediaFormatKeyMLMediaFormat_Key_Year
A key describing metadata. The year the media was created or published as a long.
MLMediaFormatKeyMLMediaFormat_Key_AAC_DRC_Effect_Type
A key describing for selecting the DRC effect type for MPEG-D DRC.
MLMediaFormatKeyMLMediaFormat_Key_Quality
A key describing the desired encoding quality.
MLMediaFormatKeyMLMediaFormat_Key_Output_Reorder_Depth
An optional key describing the maximum number of non-display-order coded frames.
MLMediaFormatKeyMLMediaFormat_Key_Is_Timed_Text
MLMediaFormatKeyMLMediaFormat_Key_Ca_System_Id
A key describing the system id of the conditional access system used to scramble a media track.
MLMediaFormatKeyMLMediaFormat_Key_Ca_Session_Id
A key describing the MediaCas.Session object associated with a media track.
MLMediaFormatKeyMLMediaFormat_Key_Ca_Private_Data
A key describing the private data in the CA_descriptor associated with a media track.
MLMediaFormatKeyMLMediaFormatKey_Feature
A key prefix used together with a MLMediaCodecBitrateMode feature name describing a required or optional feature for a codec capabilities query.
const floatMLTTMLDimen_Unset
An unset position, width or size which is negative of maximum finite value of float (-FLT_MAX).
size_tsize
uint8_t *data
int64_tstart_time_ms
int64_tend_time_ms
char *text
MLTTMLLayoutAlignmenttext_alignment
MLTTMLImagebitmap
floatline
The position of the line_anchor of the cue box within the viewport in the direction orthogonal to the writing direction, or MLTTMLDimen_Unset.
MLTTMLLineTypeline_type
The cue line type.
MLTTMLAnchorTypeline_anchor
floatposition
The fractional position of the position_anchor of the cue box within the viewport in the direction orthogonal to line, or MLTTMLDimen_Unset.
MLTTMLAnchorTypeposition_anchor
floatsize
floatbitmap_height
boolwindow_color_set
uint32_twindow_color
MLTTMLTextSizeTypetext_size_type
floattext_size
int64_tstart_time_ms
int64_tend_time_ms
char *body
char *id
boolsnap_to_lines
MLWebVTTOrientationorientation
MLWebVTTDirectiondirection
floatrelative_line_position
int32_tline_number
floattext_position
floatsize
MLWebVTTAlignalign

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.

Warning

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

EnumeratorValueDescription
MLAudioChannelOutMask_FrontLeft0x1
MLAudioChannelOutMask_FrontRight0x2
MLAudioChannelOutMask_FrontCenter0x4
MLAudioChannelOutMask_LowFrequency0x8
MLAudioChannelOutMask_BackLeft0x10
MLAudioChannelOutMask_BackRight0x20
MLAudioChannelOutMask_FrontLeftOfCenter0x40
MLAudioChannelOutMask_FrontRightOfCenter0x80
MLAudioChannelOutMask_BackCenter0x100
MLAudioChannelOutMask_SideLeft0x200
MLAudioChannelOutMask_SideRight0x400
MLAudioChannelOutMask_TopCenter0x800
MLAudioChannelOutMask_TopFrontLeft0x1000
MLAudioChannelOutMask_TopFrontCenter0x2000
MLAudioChannelOutMask_TopFrontRight0x4000
MLAudioChannelOutMask_TopBackLeft0x8000
MLAudioChannelOutMask_TopBackCenter0x10000
MLAudioChannelOutMask_TopBackRight0x20000
MLAudioChannelOutMask_Ensure32Bits0x7FFFFFFFEnsure 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:


MLCea608CaptionDimension

EnumeratorValueDescription
MLCea608_CCMaxRows15
MLCea608_CCMaxCols32
MLCea608_CCMaxRowsPlus217
MLCea608_CCMaxColsPlus234
MLCea608_CCMaxRowsCols_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cea608 Caption Dimension constants.

API Level:

  • 2

MLCea608CaptionColor

EnumeratorValueDescription
MLCea608CaptionColor_White0
MLCea608CaptionColor_Green1
MLCea608CaptionColor_Blue2
MLCea608CaptionColor_Cyan3
MLCea608CaptionColor_Red4
MLCea608CaptionColor_Yellow5
MLCea608CaptionColor_Magenta6
MLCea608CaptionColor_Invalide7
MLCea608CaptionColor_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cea608 caption color code.

API Level:

  • 2

MLCea608CaptionStyle

EnumeratorValueDescription
MLCea608CaptionStyle_Italics0x00000001
MLCea608CaptionStyle_Underline0x00000002
MLCea608CaptionStyle_Ensure32Bits0x7FFFFFFF

Cea608 caption style code.

API Level:

  • 2

Anonymous Enum 16

EnumeratorValueDescription
MLCea608_TS0x00A0NO-BREAK SPACE.

Anonymous Enum 17

EnumeratorValueDescription
MLCea708CaptionWindows_Max8

Cea708 Caption maximum windows constant.

API Level:

  • 8

Anonymous Enum 18

EnumeratorValueDescription
MLCea708CaptionEmitCommandBuffer_MaxSize20

Maximum size for Cea708 Caption Emit command buffers.

API Level:

  • 8

MLCea708CaptionEmitCommand

EnumeratorValueDescription
MLCea708CaptionEmitCommand_Buffer1Buffer.
MLCea708CaptionEmitCommand_Control2Control.
MLCea708CaptionEmitCommand_CWX3SetCurrentWindow 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_CLW4ClearWindows clears all the windows specified in the 8 bit window bitmap.
MLCea708CaptionEmitCommand_DSW5DisplayWindows displays all the windows specified in the 8 bit window bitmap.
MLCea708CaptionEmitCommand_HDW6HideWindows hides all the windows specified in the 8 bit window bitmap.
MLCea708CaptionEmitCommand_TGW7ToggleWindows hides all displayed windows, and displays all hidden windows specified in the 8 bit window bitmap.
MLCea708CaptionEmitCommand_DLW8DeleteWindows 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_DLY9Delay suspends all processing of the current service, except for DelayCancel and Reset scanning.
MLCea708CaptionEmitCommand_DLC10DelayCancel terminates any active delay and resumes normal command processing. DelayCancel should be scanned for during a Delay.
MLCea708CaptionEmitCommand_RST11Reset deletes all windows, cancels any active delay, and clears the buffer before the Reset command. Reset should be scanned for during a Delay.
MLCea708CaptionEmitCommand_SPA12The SetPenAttributes command specifies how certain attributes of subsequent characters are to be rendered in the current window, until the next SetPenAttributes command.
MLCea708CaptionEmitCommand_SPC13SetPenColor sets the foreground, background, and edge color for the subsequent characters.
MLCea708CaptionEmitCommand_SPL14SetPenLocation sets the location of for the next bit of appended text in the current window. It has two parameters, row and column.
MLCea708CaptionEmitCommand_SWA15SetWindowAttributes Sets the window attributes of the current window.
MLCea708CaptionEmitCommand_DFX16DefineWindow0-7 creates one of the eight windows used by a caption decoder.
MLCea708CaptionEmitCommand_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cea708 Caption Emit Commands constants.

API Level:

  • 8

MLCea708CaptionEmitCommandControl

EnumeratorValueDescription
MLCea708CaptionEmitCommandControl_ETX0x03End of Text.
MLCea708CaptionEmitCommandControl_BS0x08
MLCea708CaptionEmitCommandControl_FF0x0c
MLCea708CaptionEmitCommandControl_HCR0x0e
MLCea708CaptionEmitCommandControl_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cea708 Caption Emit Command Control constants.

API Level:

  • 8

MLCea708CaptionColorOpacity

EnumeratorValueDescription
MLCea708CaptionColorOpacity_SOLID0
MLCea708CaptionColorOpacity_FLASH1
MLCea708CaptionColorOpacity_TRANSLUCENT2
MLCea708CaptionColorOpacity_TRANSPARENT3
MLCea708CaptionColorOpacity_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cea708 Caption Color Opacity constants.

API Level:

  • 8

MLCea708CaptionPenSize

EnumeratorValueDescription
MLCea708CaptionPenSize_SMALL0
MLCea708CaptionPenSize_STANDARD1
MLCea708CaptionPenSize_LARGE2
MLCea708CaptionPenSize_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cea708 Caption Pen Size constants.

API Level:

  • 8

MLCea708CaptionPenOffset

EnumeratorValueDescription
MLCea708CaptionPenOffset_SUBSCRIPT0
MLCea708CaptionPenOffset_NORMAL1
MLCea708CaptionPenOffset_SUPERSCRIPT2
MLCea708CaptionPenOffset_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cea708 Caption Pen Offset constants.

API Level:

  • 8

MLMediaCodecCreation

EnumeratorValueDescription
MLMediaCodecCreation_ByNameCreate by name.
MLMediaCodecCreation_ByTypeCreate by type.
MLMediaCodecCreation_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Media codec creation method.


MLMediaCodecType

EnumeratorValueDescription
MLMediaCodecType_EncoderEncoder.
MLMediaCodecType_DecoderDecoder.
MLMediaCodecType_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Media codec type.


MLMediaCodecBufferFlag

EnumeratorValueDescription
MLMediaCodecBufferFlag_KeyFrame1The (encoded) buffer contains the data for a key frame.
MLMediaCodecBufferFlag_CodecConfig2Buffer contains codec initialization OR codec specific data instead of media data.
MLMediaCodecBufferFlag_EOS4Signals the end of stream, i.e. no buffers will be available after this.
MLMediaCodecBufferFlag_PartialFrame8Buffer 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_MuxerData16Buffer contains muxer data - Supported only for Exif data block.
MLMediaCodecBufferFlag_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Indicate the type of data when queuing the input buffer via MLMediaCodecQueueInputBuffer() or MLMediaCodecQueueSecureInputBuffer().

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaCodecOutputBufferStatus

EnumeratorValueDescription
MLMediaCodec_OutputBuffersChanged-1014Output buffer changed.
MLMediaCodec_FormatChanged-1012Format changed.
MLMediaCodec_TryAgainLater-11Try again later.
MLMediaCodecOutputBufferStatus_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Other than the normal buffer index, the output of MLMediaCodecDequeueOutputBuffer() can take on one of these statuses.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaCodecCryptoMode

EnumeratorValueDescription
MLMediaCodecCryptoMode_ClearClear samples.
MLMediaCodecCryptoMode_CTRSample encrypted with AES CTR mode.
MLMediaCodecCryptoMode_CBCSample encrypted with AES CBC mode.
MLMediaCodecCryptoMode_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Crypto mode using which media samples are encrypted.


MLMediaCodecListCodecTypeFlag

EnumeratorValueDescription
MLMediaCodecListCodecTypeFlag_Software1 << 0Software.
MLMediaCodecListCodecTypeFlag_Hardware1 << 1Hardware.
MLMediaCodecListCodecTypeFlag_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 Bits.

Bit mask for specifying the type of codec being queried using MLMediaCodecListGetMatchingCodecs().


MLMediaCodecListCapabilityFlag

EnumeratorValueDescription
MLMediaCodecListCapabilityFlag_AdaptivePlayback1 << 0Adaptive playback.
MLMediaCodecListCapabilityFlag_SecurePlayback1 << 1Secure playback.
MLMediaCodecListCapabilityFlag_TunneledPlayback1 << 2Tunneled playback.
MLMediaCodecListCapabilityFlag_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 Bits.

Bit mask for checking the capability of a codec after queried via MLMediaCodecListGetCapabilityFlag.


MLMediaCodecColorFormat

EnumeratorValueDescription
MLMediaCodecColorFormat_Unused0Unused: Placeholder value when format is N/A.
MLMediaCodecColorFormat_Monochrome1Monochrome: black and white.
MLMediaCodecColorFormat_8BitRGB33228BitRGB332: Red 7:5, Green 4:2, Blue 1:0.
MLMediaCodecColorFormat_12BitRGB444312BitRGB444: Red 11:8, Green 7:4, Blue 3:0.
MLMediaCodecColorFormat_16BitARGB4444416BitARGB4444: Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0.
MLMediaCodecColorFormat_16BitARGB1555516BitARGB1555: Alpha 15, Red 14:10, Green 9:5, Blue 4:0.
MLMediaCodecColorFormat_16BitRGB565616BitRGB565: Red 15:11, Green 10:5, Blue 4:0.
MLMediaCodecColorFormat_16BitBGR565716BitBGR565: Blue 15:11, Green 10:5, Red 4:0.
MLMediaCodecColorFormat_18BitRGB666818BitRGB666: Red 17:12, Green 11:6, Blue 5:0.
MLMediaCodecColorFormat_18BitARGB1665918BitARGB1665: Alpha 17, Red 16:11, Green 10:5, Blue 4:0.
MLMediaCodecColorFormat_19BitARGB16661019BitARGB1666: Alpha 18, Red 17:12, Green 11:6, Blue 5:0.
MLMediaCodecColorFormat_24BitRGB8881124BitRGB888: Red 24:16, Green 15:8, Blue 7:0.
MLMediaCodecColorFormat_24BitBGR8881224BitBGR888: Blue 24:16, Green 15:8, Red 7:0.
MLMediaCodecColorFormat_24BitARGB18871324BitARGB1887: Alpha 23, Red 22:15, Green 14:7, Blue 6:0.
MLMediaCodecColorFormat_25BitARGB18881425BitARGB1888: Alpha 24, Red 23:16, Green 15:8, Blue 7:0.
MLMediaCodecColorFormat_32BitBGRA88881532BitBGRA8888: Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0.
MLMediaCodecColorFormat_32BitARGB88881632BitARGB8888: Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0.
MLMediaCodecColorFormat_YUV411Planar17YUV411Planar: U,Y are subsampled by a factor of 4 horizontally.
MLMediaCodecColorFormat_YUV411PackedPlanar18YUV411PackedPlanar: packed per payload in planar slices.
MLMediaCodecColorFormat_YUV420Planar19YUV420Planar: Three arrays Y,U,V.
MLMediaCodecColorFormat_YUV420PackedPlanar20YUV420PackedPlanar: packed per payload in planar slices.
MLMediaCodecColorFormat_YUV420SemiPlanar21YUV420SemiPlanar: Two arrays, one is all Y, the other is U and V.
MLMediaCodecColorFormat_YUV422Planar22YUV422Planar: Three arrays Y,U,V.
MLMediaCodecColorFormat_YUV422PackedPlanar23YUV422PackedPlanar: packed per payload in planar slices.
MLMediaCodecColorFormat_YUV422SemiPlanar24YUV422SemiPlanar: Two arrays, one is all Y, the other is U and V.
MLMediaCodecColorFormat_YCbYCr25YCbYCr: Organized as 16Bit YUYV (i.e. YCbYCr).
MLMediaCodecColorFormat_YCrYCb26YCrYCb: Organized as 16Bit YVYU (i.e. YCrYCb).
MLMediaCodecColorFormat_CbYCrY27CbYCrY: Organized as 16Bit UYVY (i.e. CbYCrY).
MLMediaCodecColorFormat_CrYCbY28CrYCbY: Organized as 16Bit VYUY (i.e. CrYCbY).
MLMediaCodecColorFormat_YUV444Interleaved29YUV444Interleaved: Each pixel contains equal parts YUV.
MLMediaCodecColorFormat_RawBayer8Bit30RawBayer8Bit: SMIA camera output format.
MLMediaCodecColorFormat_RawBayer10Bit31RawBayer10Bit: SMIA camera output format.
MLMediaCodecColorFormat_RawBayer8Bitcompressed32RawBayer8Bitcompressed: SMIA camera output format.
MLMediaCodecColorFormat_L233Deprecated. Use MLMediaCodecColorFormat_L8.
MLMediaCodecColorFormat_L434Deprecated. Use MLMediaCodecColorFormat_L8.
MLMediaCodecColorFormat_L8358 Bits per pixel Y color format.
MLMediaCodecColorFormat_L163616 Bits per pixel, little-endian Y color format.
MLMediaCodecColorFormat_L2437Deprecated. Use MLMediaCodecColorFormat_L16.
MLMediaCodecColorFormat_L3238Deprecated. Use MLMediaCodecColorFormat_L16.
MLMediaCodecColorFormat_YUV420PackedSemiPlanarYUV420PackedSemiPlanar.
MLMediaCodecColorFormat_YUV422PackedSemiPlanarYUV422PackedSemiPlanar.
MLMediaCodecColorFormat_18BitBGR66618BitBGR666.
MLMediaCodecColorFormat_24BitARGB666624BitARGB6666.
MLMediaCodecColorFormat_24BitABGR666624BitABGR6666.
MLMediaCodecColorFormat_KhronosExtensions0x6F000000Reserved region for introducing Khronos Standard Extensions.
MLMediaCodecColorFormat_VendorStartUnused0x7F000000Reserved region for introducing Vendor Extensions.
MLMediaCodecColorFormat_AndroidOpaque0x7F000789Reserved android opaque color format. Tells the encoder that the actual color format will be relayed by the Graphics memory allocator Buffers.
MLMediaCodecColorFormat_32BitRGBA88880x7F00A00032BitRGBA8888.
MLMediaCodecColorFormat_YUV420Flexible0x7F420888Flexible 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_YUV420Planar160x7F42016B10-bit or 12-bit YUV format, LSB-justified (0's on higher bits).
MLMediaCodecColorFormat_YUV444Y4100x7F444AAAPacked 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_TIYUV420PackedSemiPlanar0x7F000100TI's YUV420PackedSemiPlanar.
MLMediaCodecColorFormat_QCOMYVU420SemiPlanar0x7FA30C00QCOM's YVU420SemiPlanar.
MLMediaCodecColorFormat_QCOMYUV420PackedSemiPlanar64x32Tile2m8ka0x7FA30C03QCOM's YUV420PackedSemiPlanar64x32Tile2m8ka.
MLMediaCodecColorFormat_QCOMYUV420PackedSemiPlanar32m0x7FA30C04QCOM's YUV420PackedSemiPlanar32m.
MLMediaCodecColorFormat_SECNV12Tiled0x7FC00002SEC's NV12Tiled.
MLMediaCodecColorFormat_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 Bits.

Enumeration defining possible uncompressed image/video formats.

API Level:

  • 9

MLMediaCodecPriority

EnumeratorValueDescription
MLMediaCodecPriority_RealTime0Realtime 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_NonRealTime1Non-realtime priority (best effort).
MLMediaCodecPriority_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 Bits.

Enumeration defining the Codec priority.

API Level:

  • 9

MLMediaCodecIntraRefreshMode

EnumeratorValueDescription
MLMediaCodecIntraRefreshMode_Cyclic0Cyclic.
MLMediaCodecIntraRefreshMode_Adaptive1Adaptive.
MLMediaCodecIntraRefreshMode_Both2Both.
MLMediaCodecIntraRefreshMode_Ensure32Bits0x7FFFFFFF

Enumeration of possible methods to use for Intra Refresh.

API Level:

  • 9

MLMediaCodecBitrateMode

EnumeratorValueDescription
MLMediaCodecBitrateMode_CQ0Constant quality mode.
MLMediaCodecBitrateMode_VBR1Variable bitrate mode.
MLMediaCodecBitrateMode_CBR2Constant bitrate mode.
MLMediaCodecBitrateMode_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 Bits.

Enumeration defining Codec Bitrate modes.

API Level:

  • 9

MLMediaCodecProfileType

EnumeratorValueDescription
MLMediaCodecProfileType_H263Baseline0x01H263 Baseline Profile: H.263 (V1), no optional modes.
MLMediaCodecProfileType_H263H320Coding0x02H263 H.320 Coding Efficiency Backward Compatibility Profile: H.263+ (V2), includes annexes I, J, L.4 and T.
MLMediaCodecProfileType_H263BackwardCompatible0x04H263 Backward Compatibility Profile: H.263 (V1), includes annex F.
MLMediaCodecProfileType_H263ISWV20x08H263 Interactive Streaming Wireless Profile: H.263+ (V2), includes annexes I, J, K and T.
MLMediaCodecProfileType_H263ISWV30x10H263 Interactive Streaming Wireless Profile: H.263++ (V3), includes profile 3 and annexes V and W.6.3.8.
MLMediaCodecProfileType_H263HighCompression0x20H263 Conversational High Compression Profile: H.263++ (V3), includes profiles 1 & 2 and annexes D and U.
MLMediaCodecProfileType_H263Internet0x40H263 Conversational Internet Profile: H.263++ (V3), includes profile 5 and annex K.
MLMediaCodecProfileType_H263Interlace0x80H263 Conversational Interlace Profile: H.263++ (V3), includes profile 5 and annex W.6.3.11.
MLMediaCodecProfileType_H263HighLatency0x100H263 High Latency Profile: H.263++ (V3), includes profile 6 and annexes O.1 and P.5.
MLMediaCodecProfileType_MPEG2Simple0MPEG-2 Simple Profile.
MLMediaCodecProfileType_MPEG2Main1MPEG-2 Main Profile.
MLMediaCodecProfileType_MPEG24222MPEG-2 4:2:2 Profile.
MLMediaCodecProfileType_MPEG2SNR3MPEG-2 SNR Profile.
MLMediaCodecProfileType_MPEG2Spatial4MPEG-2 Spatial Profile.
MLMediaCodecProfileType_MPEG2High5MPEG-2 High Profile.
MLMediaCodecProfileType_MPEG4Simple0x01MPEG-4 Simple Profile, Levels 1-3.
MLMediaCodecProfileType_MPEG4SimpleScalable0x02MPEG-4 Simple Scalable Profile, Levels 1-2.
MLMediaCodecProfileType_MPEG4Core0x04MPEG-4 Core Profile, Levels 1-2.
MLMediaCodecProfileType_MPEG4Main0x08MPEG-4 Main Profile, Levels 2-4.
MLMediaCodecProfileType_MPEG4Nbit0x10MPEG-4 N-bit Profile, Level 2.
MLMediaCodecProfileType_MPEG4ScalableTexture0x20MPEG-4 Scalable Texture Profile, Level 1.
MLMediaCodecProfileType_MPEG4SimpleFace0x40MPEG-4 Simple Face Animation Profile, Levels 1-2.
MLMediaCodecProfileType_MPEG4SimpleFBA0x80MPEG-4 Simple Face and Body Animation (FBA) Profile, Levels 1-2.
MLMediaCodecProfileType_MPEG4BasicAnimated0x100MPEG-4 Basic Animated Texture Profile, Levels 1-2.
MLMediaCodecProfileType_MPEG4Hybrid0x200MPEG-4 Hybrid Profile, Levels 1-2.
MLMediaCodecProfileType_MPEG4AdvancedRealTime0x400MPEG-4 Advanced Real Time Simple Profiles, Levels 1-4.
MLMediaCodecProfileType_MPEG4CoreScalable0x800MPEG-4 Core Scalable Profile, Levels 1-3.
MLMediaCodecProfileType_MPEG4AdvancedCoding0x1000MPEG-4 Advanced Coding Efficiency Profile, Levels 1-4.
MLMediaCodecProfileType_MPEG4AdvancedCore0x2000MPEG-4 Advanced Core Profile, Levels 1-2.
MLMediaCodecProfileType_MPEG4AdvancedScalable0x4000MPEG-4 Advanced Scalable Texture, Levels 2-3.
MLMediaCodecProfileType_MPEG4AdvancedSimple0x8000MPEG-4 Advanced Simple.
MLMediaCodecProfileType_AVCBaseline0x01AVC Baseline profile.
MLMediaCodecProfileType_AVCMain0x02AVC Main profile.
MLMediaCodecProfileType_AVCExtended0x04AVC Extended profile.
MLMediaCodecProfileType_AVCHigh0x08AVC High profile.
MLMediaCodecProfileType_AVCHigh100x10AVC High 10 profile.
MLMediaCodecProfileType_AVCHigh4220x20AVC High 4:2:2 profile.
MLMediaCodecProfileType_AVCHigh4440x40AVC High 4:4:4 profile.
MLMediaCodecProfileType_VP8Main0x01VP8 Main profile.
MLMediaCodecProfileType_VP900x01VP9 Profile 0 4:2:0 8-bit.
MLMediaCodecProfileType_VP910x02VP9 Profile 1 4:2:2 8-bit.
MLMediaCodecProfileType_VP920x04VP9 Profile 2 4:2:0 10-bit.
MLMediaCodecProfileType_VP930x08VP9 Profile 3 4:2:2 10-bit.
MLMediaCodecProfileType_VP92HDR0x1000VP9 Profile 2 4:2:0 10-bit HDR.
MLMediaCodecProfileType_VP93HDR0x2000VP9 Profile 3 4:2:2 10-bit HDR.
MLMediaCodecProfileType_VP92HDR10Plus0x4000VP9 Profile 2 4:2:0 10-bit HDR10Plus.
MLMediaCodecProfileType_VP93HDR10Plus0x8000VP9 Profile 3 4:2:2 10-bit HDR10Plus.
MLMediaCodecProfileType_HEVCMain0x01HEVC Main profile.
MLMediaCodecProfileType_HEVCMain100x02HEVC Main 1.0 profile.
MLMediaCodecProfileType_HEVCMainStill0x04HEVC Main Still profile.
MLMediaCodecProfileType_HEVCMain10HDR100x1000HEVC Main HDR profile.
MLMediaCodecProfileType_HEVCMain10HDR10Plus0x2000HEVC Main HDR+ profile.
MLMediaCodecProfileType_AACObjectNull0AAC Null, not used.
MLMediaCodecProfileType_AACObjectMain1AAC Main object.
MLMediaCodecProfileType_AACObjectLC2AAC Low Complexity object (AAC profile).
MLMediaCodecProfileType_AACObjectSS3AAC Scalable Sample Rate object.
MLMediaCodecProfileType_AACObjectLTP4AAC Long Term Prediction object.
MLMediaCodecProfileType_AACObjectHE5AAC High Efficiency (object type SBR, HE-AAC profile).
MLMediaCodecProfileType_AACObjectScalable6AAC Scalable object.
MLMediaCodecProfileType_AACObjectERLC17ER AAC Low Complexity object (Error Resilient AAC-LC).
MLMediaCodecProfileType_AACObjectLD23AAC Low Delay object (Error Resilient).
MLMediaCodecProfileType_AACObjectHE_PS29AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS).
MLMediaCodecProfileType_WMAProfileUnused0WMA profile unused or unknown .
MLMediaCodecProfileType_WMAProfileL11WMA version 9 profile L1.
MLMediaCodecProfileType_WMAProfileL22WMA version 9 profile L2.
MLMediaCodecProfileType_WMAProfileL33WMA version 9 profile L3.
MLMediaCodecProfileType_Ensure32Bits0x7FFFFFFFEnsure 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.

note

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

EnumeratorValueDescription
MLMediaCodecLevelType_H263Level100x01H263 Level 1.0.
MLMediaCodecLevelType_H263Level200x02H263 Level 2.0.
MLMediaCodecLevelType_H263Level300x04H263 Level 3.0.
MLMediaCodecLevelType_H263Level400x08H263 Level 4.0.
MLMediaCodecLevelType_H263Level450x10H263 Level 4.5.
MLMediaCodecLevelType_H263Level500x20H263 Level 5.0.
MLMediaCodecLevelType_H263Level600x40H263 Level 6.0.
MLMediaCodecLevelType_H263Level700x80H263 Level 7.0.
MLMediaCodecLevelType_MPEG2LevelLL0MPEG-2 Low Level.
MLMediaCodecLevelType_MPEG2LevelML1MPEG-2 Main Level.
MLMediaCodecLevelType_MPEG2LevelH142MPEG-2 High 1440.
MLMediaCodecLevelType_MPEG2LevelHL3MPEG-2 High Level.
MLMediaCodecLevelType_MPEG4Level00x01MPEG-4 Level 0.
MLMediaCodecLevelType_MPEG4Level0b0x02MPEG-4 Level 0b.
MLMediaCodecLevelType_MPEG4Level10x04MPEG-4 Level 1.
MLMediaCodecLevelType_MPEG4Level20x08MPEG-4 Level 2.
MLMediaCodecLevelType_MPEG4Level30x10MPEG-4 Level 3.
MLMediaCodecLevelType_MPEG4Level40x20MPEG-4 Level 4.
MLMediaCodecLevelType_MPEG4Level4a0x40MPEG-4 Level 4a.
MLMediaCodecLevelType_MPEG4Level50x80MPEG-4 Level 5.
MLMediaCodecLevelType_AVCLevel10x01AVC Level 1.
MLMediaCodecLevelType_AVCLevel1b0x02AVC Level 1.b.
MLMediaCodecLevelType_AVCLevel110x04AVC Level 1.1.
MLMediaCodecLevelType_AVCLevel120x08AVC Level 1.2.
MLMediaCodecLevelType_AVCLevel130x10AVC Level 1.3.
MLMediaCodecLevelType_AVCLevel20x20AVC Level 2.
MLMediaCodecLevelType_AVCLevel210x40AVC Level 2.1.
MLMediaCodecLevelType_AVCLevel220x80AVC Level 2.2.
MLMediaCodecLevelType_AVCLevel30x100AVC Level 3.
MLMediaCodecLevelType_AVCLevel310x200AVC Level 3.1.
MLMediaCodecLevelType_AVCLevel320x400AVC Level 3.2.
MLMediaCodecLevelType_AVCLevel40x800AVC Level 4.
MLMediaCodecLevelType_AVCLevel410x1000AVC Level 4.1.
MLMediaCodecLevelType_AVCLevel420x2000AVC Level 4.2.
MLMediaCodecLevelType_AVCLevel50x4000AVC Level 5.
MLMediaCodecLevelType_AVCLevel510x8000AVC Level 5.1.
MLMediaCodecLevelType_VP8LevelVersion00x01VP8 Level version 0.
MLMediaCodecLevelType_VP8LevelVersion10x02VP8 Level version 1.
MLMediaCodecLevelType_VP8LevelVersion20x04VP8 Level version 2.
MLMediaCodecLevelType_VP8LevelVersion30x08VP8 Level version 3.
MLMediaCodecLevelType_VP9Level10x1VP9 Level 5.1.
MLMediaCodecLevelType_VP9Level110x2VP9 Level 1.1.
MLMediaCodecLevelType_VP9Level20x4VP9 Level 2.
MLMediaCodecLevelType_VP9Level210x8VP9 Level 2.1.
MLMediaCodecLevelType_VP9Level30x10VP9 Level 3.
MLMediaCodecLevelType_VP9Level310x20VP9 Level 3.1.
MLMediaCodecLevelType_VP9Level40x40VP9 Level 4.
MLMediaCodecLevelType_VP9Level410x80VP9 Level 4.1.
MLMediaCodecLevelType_VP9Level50x100VP9 Level 5.
MLMediaCodecLevelType_VP9Level510x200VP9 Level 5.1.
MLMediaCodecLevelType_VP9Level520x400VP9 Level 5.2.
MLMediaCodecLevelType_VP9Level60x800VP9 Level 6.
MLMediaCodecLevelType_VP9Level610x1000VP9 Level 6.1.
MLMediaCodecLevelType_VP9Level620x2000VP9 Level 6.2.
MLMediaCodecLevelType_HEVCMainTierLevel10x1HEVC Main Level 1.
MLMediaCodecLevelType_HEVCHighTierLevel10x2HEVC High Level 1.
MLMediaCodecLevelType_HEVCMainTierLevel20x4HEVC Main Level 2.
MLMediaCodecLevelType_HEVCHighTierLevel20x8HEVC High Level 2.
MLMediaCodecLevelType_HEVCMainTierLevel210x10HEVC Main Level 2.1.
MLMediaCodecLevelType_HEVCHighTierLevel210x20HEVC High Level 2.1.
MLMediaCodecLevelType_HEVCMainTierLevel30x40HEVC Main Level 3.
MLMediaCodecLevelType_HEVCHighTierLevel30x80HEVC High Level 3.
MLMediaCodecLevelType_HEVCMainTierLevel310x100HEVC Main Level 3.1.
MLMediaCodecLevelType_HEVCHighTierLevel310x200HEVC High Level 3.1.
MLMediaCodecLevelType_HEVCMainTierLevel40x400HEVC Main Level 4.
MLMediaCodecLevelType_HEVCHighTierLevel40x800HEVC High Level 4.
MLMediaCodecLevelType_HEVCMainTierLevel410x1000HEVC Main Level 4.1.
MLMediaCodecLevelType_HEVCHighTierLevel410x2000HEVC High Level 4.1.
MLMediaCodecLevelType_HEVCMainTierLevel50x4000HEVC Main Level 5.
MLMediaCodecLevelType_HEVCHighTierLevel50x8000HEVC High Level 5.
MLMediaCodecLevelType_HEVCMainTierLevel510x10000HEVC Main Level 5.1.
MLMediaCodecLevelType_HEVCHighTierLevel510x20000HEVC High Level 5.1.
MLMediaCodecLevelType_HEVCMainTierLevel520x40000HEVC Main Level 5.2.
MLMediaCodecLevelType_HEVCHighTierLevel520x80000HEVC High Level 5.2.
MLMediaCodecLevelType_HEVCMainTierLevel60x100000HEVC Main Level 6.
MLMediaCodecLevelType_HEVCHighTierLevel60x200000HEVC High Level 6.
MLMediaCodecLevelType_HEVCMainTierLevel610x400000HEVC Main Level 6.1.
MLMediaCodecLevelType_HEVCHighTierLevel610x800000HEVC High Level 6.1.
MLMediaCodecLevelType_HEVCMainTierLevel620x1000000HEVC Main Level 6.2.
MLMediaCodecLevelType_HEVCHighTierLevel620x2000000HEVC High Level 6.2.
MLMediaCodecLevelType_Ensure32Bits0x7FFFFFFFEnsure 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.

note

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

EnumeratorValueDescription
MLMediaSeekMode_Previous_SyncSeek to the previous key frame.
MLMediaSeekMode_Next_SyncSeek to the next key frame.
MLMediaSeekMode_Closest_SyncSeek to the closest key frame.
MLMediaSeekMode_ClosestSeek to the closest frame, more accurate but slower.
MLMediaSeekMode_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Mode indicating where exactly to seek to.


MLMediaDRMKeyType

EnumeratorValueDescription
MLMediaDRMKeyType_Streaming1This 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_Offline2This 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_Release3This key request type specifies that previously saved offline keys should be released.
MLMediaDRMKeyType_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Request types.


MLMediaDRMEventType

EnumeratorValueDescription
MLMediaDRMEventType_ProvisionRequired1This event type indicates that the app needs to request a certificate from the provisioning server. The request message data is obtained using MLMediaDRMGetProvisionRequest().
MLMediaDRMEventType_KeyRequired2This event type indicates that the app needs to request keys from a license server. The request message data is obtained using MLMediaDRMGetKeyRequest().
MLMediaDRMEventType_KeyExpired3This event type indicates that the licensed usage duration for keys in a session has expired. The keys are no longer valid.
MLMediaDRMEventType_VendorDefined4This event may indicate some specific vendor-defined condition, see your DRM provider documentation for details.
MLMediaDRMEventType_SessionReclaimed5This event indicates that a session opened by the app has been reclaimed by the resource manager.
MLMediaDRMEventType_ExpirationUpdate6This 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_KeysChange7This 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_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Request event types.

API Level:

  • 7

MLMediaDRMKeyStatusCode

EnumeratorValueDescription
MLMediaDRMKeyStatusCode_KeyStatusUsable0The key is currently usable to decrypt media data.
MLMediaDRMKeyStatusCode_KeyStatusExpired1The key is no longer usable to decrypt media data because its expiration time has passed.
MLMediaDRMKeyStatusCode_KeyStatusOutputNotAllowed2The key is not currently usable to decrypt media data because its output requirements cannot currently be met.
MLMediaDRMKeyStatusCode_KeyStatusPending3The 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_KeyStatusInternalError4The 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_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Status code associated with a DRM session key.

API Level:

  • 20

MLMediaExtractorSampleFlag

EnumeratorValueDescription
MLMediaExtractorSampleFlag_Sync1
MLMediaExtractorSampleFlag_Encrypted2
MLMediaExtractorSampleFlag_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Sample flag output from MLMediaExtractorGetSampleFlags.


MLMediaExtractorSeekPosition

EnumeratorValueDescription
MLMediaExtractorSeekPosition_Previous_Sync
MLMediaExtractorSeekPosition_Next_Sync
MLMediaExtractorSeekPosition_Closest_Sync
MLMediaExtractorSeekPosition_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Seek mode used by MLMediaExtractorSeekTo.


MLMediaFormatAudioEncoding

EnumeratorValueDescription
MLMediaFormatAudioEncoding_PCM16Bits2Audio data format: PCM 16 bits per sample.
MLMediaFormatAudioEncoding_PCM8Bits3Audio data format: PCM 8 bits per sample.
MLMediaFormatAudioEncoding_PCMFloat4Audio data format: single-precision floating-point per sample.
MLMediaFormatAudioEncoding_PCM32Bits201Audio data format: PCM 32 bits per sample.
MLMediaFormatAudioEncoding_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

MLMediaPlayerVideoScalingMode

EnumeratorValueDescription
MLMediaPlayerVideoScalingMode_ScaleToFit1
MLMediaPlayerVideoScalingMode_ScaleToFitWithCropping2
MLMediaPlayerVideoScalingMode_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Codes for setting video scaling mode.


MLMediaPlayerPollingStateFlags

EnumeratorValueDescription
MLMediaPlayerPollingStateFlag_IsPlaying1 << 0Playing.
MLMediaPlayerPollingStateFlag_IsLooping1 << 1Looping.
MLMediaPlayerPollingStateFlag_HasBeenPrepared1 << 2Prepared.
MLMediaPlayerPollingStateFlag_HasPlaybackCompleted1 << 3Playback completed.
MLMediaPlayerPollingStateFlag_HasSeekCompleted1 << 4Seek completed.
MLMediaPlayerPollingStateFlag_HasSizeChanged1 << 5Size changed.
MLMediaPlayerPollingStateFlag_HasBufferingUpdated1 << 6Buffering updated.
MLMediaPlayerPollingStateFlag_HasReceivedInfo1 << 7Received info.
MLMediaPlayerPollingStateFlag_HasReceivedError1 << 8Received error.
MLMediaPlayerPollingStateFlag_HasTimedTextUpdated1 << 9Timed text updated.
MLMediaPlayerPollingStateFlag_HasSubtitleUpdated1 << 10Subtitle updated.
MLMediaPlayerPollingStateFlag_HasMetadataUpdated1 << 11Metadata updated.
MLMediaPlayerPollingStateFlag_HasDrmInfoUpdated1 << 12DRM info updated.
MLMediaPlayerPollingStateFlag_HasResetCompleted1 << 13Async Reset completed.
MLMediaPlayerPollingStateFlag_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

The state to be polled.


MLMediaPlayerInfo

EnumeratorValueDescription
MLMediaPlayerInfo_Unknown1Unknown.
MLMediaPlayerInfo_StartedAsNext2The player was started because it was used as the next player.
MLMediaPlayerInfo_RenderingStart3The player just pushed the very first video frame for rendering.
MLMediaPlayerInfo_Looping4The player just reached EOS and started from beginning (loop).
MLMediaPlayerInfo_Started5The player acknowledgement that it has started playing.
MLMediaPlayerInfo_Paused6The player acknowledgement that it has paused.
MLMediaPlayerInfo_Stopped7The player acknowledgement that it has stopped playing.
MLMediaPlayerInfo_StartedBySharedPlayer8The player acknowledgement that it has started playing as result of shared player's request.
MLMediaPlayerInfo_PausedBySharedPlayer9The player acknowledgement that it has paused playing as result of shared player's request.
MLMediaPlayerInfo_SeekBySharedPlayer10The player acknowledgement that it is seeking as result of shared player's request.
MLMediaPlayerInfo_StoppedBySharedPlayer11The player acknowledgement that it has stopped playing as result of shared player's request.
MLMediaPlayerInfo_SyncStart12The player has started sync'ing with other shared players.
MLMediaPlayerInfo_SyncComplete13The player has completed sync'ing with other shared players.
MLMediaPlayerInfo_VideoTrackLagging700The video is too complex for the decoder, it can't decode frames fast enough.
MLMediaPlayerInfo_BufferingStart701Media player is temporarily pausing playback.
MLMediaPlayerInfo_BufferingEnd702Media player is resuming playback after filling buffers.
MLMediaPlayerInfo_NetworkBandwidth703Network bandwidth info.
MLMediaPlayerInfo_BehindLiveWindow704Dash Live stream is Behind Live Window.
MLMediaPlayerInfo_PowerStatePause705Playback Paused because of Power State Transition.
MLMediaPlayerInfo_PowerStateResume706Playback Resumed because of Power State Transition.
MLMediaPlayerInfo_BufferedDuration707Duration in milliseconds of buffered content.
MLMediaPlayerInfo_BadInterleaving800Bad interleaving means that a media has been improperly interleaved.
MLMediaPlayerInfo_NotSeekable801The media is not seekable (e.g live stream).
MLMediaPlayerInfo_MetadataUpdate802New media metadata is available.
MLMediaPlayerInfo_PlayAudioError804Audio can not be played.
MLMediaPlayerInfo_PlayVideoError805Video can not be played.
MLMediaPlayerInfo_TimedTextError900Media timed text error.
MLMediaPlayerInfo_Ensure32Bits0x7FFFFFFFEnsure 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

EnumeratorValueDescription
MLMediaPlayerTrackType_Unknown0Unknown.
MLMediaPlayerTrackType_Video1Video.
MLMediaPlayerTrackType_Audio2Audio.
MLMediaPlayerTrackType_TimedText3Timed text.
MLMediaPlayerTrackType_Subtitle4Subtitle.
MLMediaPlayerTrackType_Metadata5Metadata.
MLMediaPlayerTrackType_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

MediaTrack types returned by MLMediaPlayerGetTrackType().


MLMediaPlayerBufferingMode

EnumeratorValueDescription
MLMediaPlayerBufferingMode_None0Do not support buffering.
MLMediaPlayerBufferingMode_TimeOnly1Support only time based buffering.
MLMediaPlayerBufferingMode_SizeOnly2Support only size based buffering.
MLMediaPlayerBufferingMode_TimeThenSize3Support 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_Count4Number of modes.
MLMediaPlayerBufferingMode_Ensure32Bits0x7FFFFFFFEnsure enum size is 32 bits.

Indicate the mode of buffering settings.


MLMediaFramePackingMode

EnumeratorValueDescription
MLMediaFramePackingMode_None0Not a stereoscopic video.
MLMediaFramePackingMode_CheckboardCheckboard.
MLMediaFramePackingMode_ColumnInterleavedColumn interleaved.
MLMediaFramePackingMode_RowInterleavedRow interleaved.
MLMediaFramePackingMode_SideBySideQuincunxSide by side quincunx.
MLMediaFramePackingMode_SideBySideSide by side.
MLMediaFramePackingMode_TopBottomTop bottom.
MLMediaFramePackingMode_MultiviewFrameByFrameMultiview frame by frame.
MLMediaFramePackingMode_FrameByFrameFrame by frame.
MLMediaFramePackingMode_AnaglyphAnaglyph.

Frame Packing Arrangement for stereoscopic videos.

API Level:

  • 8

MLMediaFramePackingFlags

EnumeratorValueDescription
MLMediaFramePackingFlags_None0No flags.
MLMediaFramePackingFlags_RightViewFirst1 << 0Right view first.
MLMediaFramePackingFlags_LeftFlipped1 << 1Left view flipped.
MLMediaFramePackingFlags_RightFlipped1 << 2Right view flipped.
MLMediaFramePackingFlags_Anaglyph_RedCyan1 << 3Anaglyph red/cyan.
MLMediaFramePackingFlags_Anaglyph_GreenMagenta1 << 4Anaglyph green/magenta.

Frame Packing Arrangement flags for stereoscopic videos.

API Level:

  • 8

MLTTMLLayoutAlignment

EnumeratorValueDescription
MLTTMLLayoutAlignment_Unspecified0x7FFFFFFFAn unspecified alignment value.
MLTTMLLayoutAlignment_Normal0Normal alignment relative to text direction.
MLTTMLLayoutAlignment_Center1Centered alignment.
MLTTMLLayoutAlignment_Opposite2Opposite alignment relative to text direction.
MLTTMLLayoutAlignment_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cue text alignment within the cue box.

API Level:

  • 20

MLTTMLLineType

EnumeratorValueDescription
MLTTMLLineType_Unset0x7FFFFFFFAn unset line type value.
MLTTMLLineType_Fraction0Line position is fractional position within the viewport.
MLTTMLLineType_Number1Line position is number of lines, interpretation also depends on the line anchor type.
MLTTMLLineType_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cue line type.

API Level:

  • 20

MLTTMLAnchorType

EnumeratorValueDescription
MLTTMLAnchorType_Unset0x7FFFFFFFAn unset anchor type value.
MLTTMLAnchorType_Start0Anchors the left (for horizontal positions) or top (for vertical positions) edge of the cue box.
MLTTMLAnchorType_Middle1Anchors the middle of the cue box.
MLTTMLAnchorType_End2Anchors the right (for horizontal positions) or bottom (for vertical positions) edge of the cue box.
MLTTMLAnchorType_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cue anchor type.

API Level:

  • 20

MLTTMLTextSizeType

EnumeratorValueDescription
MLTTMLTextSizeType_Unset0x7FFFFFFFAn unset text size type value.
MLTTMLTextSizeType_Fractional0Text size is measured as a fraction of the viewport size minus the view padding.
MLTTMLTextSizeType_Fractional_Ignore_Padding1Text size is measured as a fraction of the viewport size, ignoring the view padding.
MLTTMLTextSizeType_Absolute2Text size is measured in number of pixels.
MLTTMLTextSizeType_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cue text size type.

API Level:

  • 20

MLWebVTTOrientation

EnumeratorValueDescription
MLWebVTTOrientation_Horizontal0
MLWebVTTOrientation_Vertical1
MLWebVTTOrientation_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cue orientation setting.

API Level:

  • 4

MLWebVTTDirection

EnumeratorValueDescription
MLWebVTTDirection_Default0
MLWebVTTDirection_LeftToRight1
MLWebVTTDirection_RightToLeft2
MLWebVTTDirection_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cue direction setting.

API Level:

  • 4

MLWebVTTAlign

EnumeratorValueDescription
MLWebVTTAlign_Start0
MLWebVTTAlign_Middle1
MLWebVTTAlign_End2
MLWebVTTAlign_Left3
MLWebVTTAlign_Right4
MLWebVTTAlign_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Cue aligment setting.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 4

MLNativeSurfaceAcquiredBufferCount

EnumeratorValueDescription
MLNativeSurfaceAcquiredBufferCount_Min1Min number of buffer count.
MLNativeSurfaceAcquiredBufferCount_Max16Max number of buffer count.
MLNativeSurfaceAcquiredBufferCount_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Number of acquired buffers to be requested in functions MLNativeSurfaceCreate and MLNativeSurfaceTextureCreate.


MLNativeSurfacePixelFormat

EnumeratorValueDescription
MLNativeSurfacePixelFormat_Custom-4Custom format.
MLNativeSurfacePixelFormat_Translucent-3Translucent format.
MLNativeSurfacePixelFormat_Transparent-2Transparent format.
MLNativeSurfacePixelFormat_Opaque-1Opaque format.
MLNativeSurfacePixelFormat_None0None.
MLNativeSurfacePixelFormat_Rgba88881Below enums should match android_pixel_format_t in graphics-base-v1.0.h header.4x8-bit RGBA format.
MLNativeSurfacePixelFormat_Rgbx888824x8-bit RGBX format.
MLNativeSurfacePixelFormat_Rgb88833x8-bit RGB format.
MLNativeSurfacePixelFormat_Rgb565416-bit RGB format.
MLNativeSurfacePixelFormat_Bgra888854x8-bit BGRA format.
MLNativeSurfacePixelFormat_RgbaFp162264-bit RGBA format.
MLNativeSurfacePixelFormat_Rgba10101024332-bit RGBA format.
MLNativeSurfacePixelFormat_Ensure32Bits0x7FFFFFFFEnsure enum is represented as 32 bits.

Pixel format to use when creating the native surface. Used in functions MLNativeSurfaceCreate and MLNativeSurfaceTextureCreate.


MLNativeSurfaceTextureBackend

EnumeratorValueDescription
MLNativeSurfaceTextureBackend_OpenGL0OpenGL texture.
MLNativeSurfaceTextureBackend_Ensure32Bits0x7FFFFFFFEnsure 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.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLCea608CaptionPAC

typedef struct MLCea608CaptionPAC MLCea608CaptionPAC;

Cea608 caption preamble address code.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLCea608CaptionLineEx

typedef struct MLCea608CaptionLineEx MLCea608CaptionLineEx;

Cea608 caption line structure.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLCea608CaptionSegmentEx

typedef struct MLCea608CaptionSegmentEx MLCea608CaptionSegmentEx;

Cea608 caption segment structure.

More Info

Deprecated

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_handleMLHandle is a CC Parser instance for which callback was called.
cc_segMLCea608CaptionSegmentEx conveys caption displayble to be rendered.
dataCustom data to be returned when callback is fired.

API Level:

  • 8

MLCea708CaptionColor

typedef struct MLCea708CaptionColor MLCea708CaptionColor;

Cea708 Caption Color.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLCea708CaptionPenAttr

typedef struct MLCea708CaptionPenAttr MLCea708CaptionPenAttr;

Cea708 Caption Pen Attributes.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLCea708CaptionPenColor

typedef struct MLCea708CaptionPenColor MLCea708CaptionPenColor;

Cea708 Caption Pen Color.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLCea708CaptionPenLocation

typedef struct MLCea708CaptionPenLocation MLCea708CaptionPenLocation;

Cea708 Caption Pen Location.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLCea708CaptionWindowAttr

typedef struct MLCea708CaptionWindowAttr MLCea708CaptionWindowAttr;

Cea708 Caption Window Attributes.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLCea708CaptionWindow

typedef struct MLCea708CaptionWindow MLCea708CaptionWindow;

Cea708 Caption Window.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLCea708CaptionEvent

typedef struct MLCea708CaptionEvent MLCea708CaptionEvent;

Cea708 Caption Event.

More Info

Deprecated

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_handleMLHandle is a Cea708 Parser instance for which callback was called.
eventMLCea708CaptionEvent conveys caption event to listener.
dataCustom data to be returned when callback is fired.

API Level:

  • 8

MLMediaCodecBufferInfo

typedef struct MLMediaCodecBufferInfo MLMediaCodecBufferInfo;

Media codec buffer info.

More Info


MLMediaCodecInputBufferInfo

typedef struct MLMediaCodecInputBufferInfo MLMediaCodecInputBufferInfo;

MediaCodec Input buffer information.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLMediaCodecOutputBufferInfo

typedef struct MLMediaCodecOutputBufferInfo MLMediaCodecOutputBufferInfo;

MediaCodec Output buffer information.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLMediaCodecOutputFormatInfo

typedef struct MLMediaCodecOutputFormatInfo MLMediaCodecOutputFormatInfo;

MediaCodec Output Format information.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLMediaCodecErrorInfo

typedef struct MLMediaCodecErrorInfo MLMediaCodecErrorInfo;

MediaCodec Output Format information.

More Info

Deprecated

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.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLMediaCodecFrameRenderedInfo

typedef struct MLMediaCodecFrameRenderedInfo MLMediaCodecFrameRenderedInfo;

MediaCodec Output Frame Rendered information.

More Info

Deprecated

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.

More Info

Deprecated

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.

More Info

Deprecated

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".

More Info

Deprecated

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.

More Info


MLMediaCodecListProfileLevel

typedef struct MLMediaCodecListProfileLevel MLMediaCodecListProfileLevel;

Used to store the list of codec profile levels.

More Info

Deprecated

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_sourceMLHandle as returned by MLMediaDataSourceCreate().
positionThe position in the data source to read from.
sizeThe number of bytes to read.
bufferThe buffer to read the data into.
contextUser 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_sourceMLHandle as returned by MLMediaDataSourceCreate().
contextUser 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_sourceMLHandle as returned by MLMediaDataSourceCreate().
contextUser data as passed to MLMediaDataSourceCreate().

MLMediaDRMByteArray

typedef struct MLMediaDRMByteArray MLMediaDRMByteArray;

Data type containing byte array buffer and the size.

More Info


MLMediaDRMByteArrayList

typedef struct MLMediaDRMByteArrayList MLMediaDRMByteArrayList;

Data type containing list of byte array buffers and the size.

More Info


MLMediaDRMKeyValue

typedef struct MLMediaDRMKeyValue MLMediaDRMKeyValue;

Data type containing key/value pair.

More Info


MLMediaDRMKeyValueArray

typedef struct MLMediaDRMKeyValueArray MLMediaDRMKeyValueArray;

Data type containing array of key/value pair.

More Info


MLMediaDRMKeyRequestInputParam

typedef struct MLMediaDRMKeyRequestInputParam MLMediaDRMKeyRequestInputParam;

Data type that encapsulates Key Request input arguments.

More Info


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.

More Info

Deprecated

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.

More Info


MLMediaDRMHMACInputParam

typedef struct MLMediaDRMHMACInputParam MLMediaDRMHMACInputParam;

Data type that encapsulates algorithm, key_set_id for HMAC based Sign/Verify.

More Info


MLMediaDRMRSAInputParam

typedef struct MLMediaDRMRSAInputParam MLMediaDRMRSAInputParam;

Data type that encapsulates algorithm, wrapped_key for RSA operation.

More Info


MLMediaDRMEventInfo

typedef struct MLMediaDRMEventInfo MLMediaDRMEventInfo;

MediaDRM event info associated with a session.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLMediaDRMExpirationUpdateInfo

typedef struct MLMediaDRMExpirationUpdateInfo MLMediaDRMExpirationUpdateInfo;

MediaDRM expiration update info associated with a session.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLMediaDRMKeyStatus

typedef struct MLMediaDRMKeyStatus MLMediaDRMKeyStatus;

MediaDRM key status.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLMediaDRMKeyStatusInfo

typedef struct MLMediaDRMKeyStatusInfo MLMediaDRMKeyStatusInfo;

MediaDRM session keys status change info.

More Info

Deprecated

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.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLMediaExtractorPSSHEntry

typedef MLPSSHEntry MLMediaExtractorPSSHEntry;

More Info


MLMediaExtractorDRMSchemeInitData

typedef struct MLMediaExtractorDRMSchemeInitData MLMediaExtractorDRMSchemeInitData;

DRM Scheme initialization data.

More Info


MLMediaFormatByteArray

typedef struct MLMediaFormatByteArray MLMediaFormatByteArray;

Data type containing byte array buffer and the size.

More Info


MLMediaPlayerPSSHEntry

typedef MLPSSHEntry MLMediaPlayerPSSHEntry;

More Info


MLMediaPlayerTrackDRMInfo

typedef struct MLMediaPlayerTrackDRMInfo MLMediaPlayerTrackDRMInfo;

MediaPlayer DRM Info for a Media Track .

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerSubtitleData

typedef struct MLMediaPlayerSubtitleData MLMediaPlayerSubtitleData;

MediaPlayer subtitle data.

More Info


MLMediaPlayerBufferingSettings

typedef struct MLMediaPlayerBufferingSettings MLMediaPlayerBufferingSettings;

Indicate the buffering settings.

More Info


MLMediaPlayerOnBufferingUpdateInfo

typedef struct MLMediaPlayerOnBufferingUpdateInfo MLMediaPlayerOnBufferingUpdateInfo;

MediaPlayer Buffering update callback Info.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerOnCompletionInfo

typedef struct MLMediaPlayerOnCompletionInfo MLMediaPlayerOnCompletionInfo;

MediaPlayer Playback completion callback Info.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerOnErrorInfo

typedef struct MLMediaPlayerOnErrorInfo MLMediaPlayerOnErrorInfo;

MediaPlayer Error callback Info.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerOnInfoInfo

typedef struct MLMediaPlayerOnInfoInfo MLMediaPlayerOnInfoInfo;

MediaPlayer Information callback Info.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerOnPreparedInfo

typedef struct MLMediaPlayerOnPreparedInfo MLMediaPlayerOnPreparedInfo;

MediaPlayer Playback prepared callback Info.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerOnSeekCompleteInfo

typedef struct MLMediaPlayerOnSeekCompleteInfo MLMediaPlayerOnSeekCompleteInfo;

MediaPlayer Playback seek completion callback Info.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerOnVideoSizeChangedInfo

typedef struct MLMediaPlayerOnVideoSizeChangedInfo MLMediaPlayerOnVideoSizeChangedInfo;

MediaPlayer Video Size Changed callback Info.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerOnTrackDRMInfo

typedef struct MLMediaPlayerOnTrackDRMInfo MLMediaPlayerOnTrackDRMInfo;

MediaPlayer Track DRM Info callback Info.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerOnResetCompleteInfo

typedef struct MLMediaPlayerOnResetCompleteInfo MLMediaPlayerOnResetCompleteInfo;

MediaPlayer reset completion callback Info.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLMediaPlayerOnFramePackingInfo

typedef struct MLMediaPlayerOnFramePackingInfo MLMediaPlayerOnFramePackingInfo;

MediaPlayer frame packing callback Info.

More Info

Deprecated

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().

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLMediaPlayerTrackInfo

typedef struct MLMediaPlayerTrackInfo MLMediaPlayerTrackInfo;

MediaPlayer Track Information.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerTrackDRMSessionInfo

typedef struct MLMediaPlayerTrackDRMSessionInfo MLMediaPlayerTrackDRMSessionInfo;

DRM Session information for a MediaPlayer Track.

More Info

Deprecated

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

dataCustom data to be returned when callback is fired.
media_playerMLHandle is a Media Player instance for which callback was called.
subtitle_dataMLMediaPlayerSubtitleData 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_playerMLHandle is a Media Player instance for which callback was called.
timed_textMLHandle is the handle for timed_text data.
dataCustom data to be delivered when callback is invoked.

Required Permissions:

  • None

API Level:

  • 4

MLMediaPlayerMetrics

typedef struct MLMediaPlayerMetrics MLMediaPlayerMetrics;

MediaPlayer metrics data.

More Info

Deprecated

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_sourceMLHandle as returned by MLMediaStreamSourceCreate().
contextUser 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.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLTTMLData

typedef struct MLTTMLData MLTTMLData;

TTML data structure.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLPSSHEntry

typedef struct MLPSSHEntry MLPSSHEntry;

PSSH entry.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLWebVTTData

typedef struct MLWebVTTData MLWebVTTData;

WebVTT data structure.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 4

MLNativeSurfaceFrameAvailableInfo

typedef struct MLNativeSurfaceFrameAvailableInfo MLNativeSurfaceFrameAvailableInfo;

NativeSurface/NativeSurfaceTexture Output Frame Availability information.

More Info

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLNativeSurfaceConfig

typedef struct MLNativeSurfaceConfig MLNativeSurfaceConfig;

Configuration values for creating the Native Surface.

More Info

Deprecated

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.

More Info

Deprecated

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_handleA 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

MLResultMLResult_OkInternal closed caption parser object was created successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlecc_handleA handle to a CC parser.
const uint8_t *subtitle_dataSubtitle data of MLMediaPlayerSubtitleData structure returned from MLMediaPlayerGetSubtitleEx function.
int32_tsubtitle_data_sizeSubtitle data size of MLMediaPlayerSubtitleData structure returned from MLMediaPlayerGetSubtitleEx function.
const MLCea608CaptionSegmentEx **out_cc_segThe returned MLCea608CaptionSegmentEx pointer for CC display. NOTE that user doesn't own this memory.

Returns

MLResultMLResult_InvalidParamone of the arguements is incorrect.
MLResultMLResult_OkCC is ready to display and content is stored in out_ccSeg.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_NoInitCC parser was not properly built or initialized.
MLResultMLMediaGenericResult_NotEnoughDatamore data is required and no displayable CC for now.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLMediaCCParserDestroy

MLResult MLMediaCCParserDestroy(
MLHandle cc_handle
)

Release internal CC parser object.

Parameters

MLHandlecc_handleA handle to a CC parser.

Returns

MLResultMLResult_Okinternal CC parser object was released successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlecc_handleA handle to a CC parser.
MLMediaCCParserDisplayChangedCallbackon_display_changed_callbackFunction 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 *dataCustom data to be returned when callback is fired.

Returns

MLResultMLResult_InvalidParamPassed cc_handle handle was not found.
MLResultMLResult_OkCallback was successfully set.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlecc_handleA handle to a Cea608 parser.
const uint8_t *subtitle_dataSubtitle data of MLMediaPlayerSubtitleData.
uint32_tsubtitle_data_sizeSubtitle data size of MLMediaPlayerSubtitleData.

Returns

MLResultMLResult_InvalidParamthe input parameter(s) is(are) wrong.
MLResultMLResult_Okthe operation was successful.
MLResultMLMediaGenericResult_NoInitCea708 parser was not properly built or initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLMediaCea708ParserCreate

MLResult MLMediaCea708ParserCreate(
MLHandle * out_handle
)

Create Cea708 parser object.

Parameters

MLHandle *out_handleA 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

MLResultMLResult_AllocFailedThe operation failed with memory allocation error.
MLResultMLResult_InvalidParamout_handle is null.
MLResultMLResult_OkInternal Cea708 parser object was created successfully.

Required Permissions:

  • None
Deprecated

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

MLHandlecc_handleA handle to a Cea708 parser.
const uint8_t *subtitle_dataSubtitle data of MLMediaPlayerSubtitleData.
uint32_tsubtitle_data_sizeSubtitle data size of MLMediaPlayerSubtitleData.

Returns

MLResultMLResult_InvalidParamthe input parameter(s) is(are) wrong.
MLResultMLResult_Okthe operation was successful.
MLResultMLMediaGenericResult_NoInitCea708 parser was not properly built or initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLMediaCea708ParserDestroy

MLResult MLMediaCea708ParserDestroy(
MLHandle cc_handle
)

Release Cea708 parser object.

Parameters

MLHandlecc_handleA handle to a Cea708 parser.

Returns

MLResultMLResult_InvalidParamcc_handle is wrong or not found.
MLResultMLResult_Okinternal Cea708 parser object was released successfully.

Required Permissions:

  • None
Deprecated

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

MLHandlecc_handleA handle to a Cea708 parser.
MLMediaCea708ParserEmitEventCallbackon_emit_event_callbackFunction 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 *dataCustom data to be returned when callback is fired.

Returns

MLResultMLResult_InvalidParamPassed cc_handle handle was not found.
MLResultMLResult_OkCallback was successfully set.

Required Permissions:

  • None
Deprecated

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_callbacksMediaCodec Callback structure defined by MLMediaCodecCallbacksEx that needs to be initialized.
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaCodecOutputFrameListenerInit

static inline void MLMediaCodecOutputFrameListenerInit(
MLMediaCodecOutputFrameListener * inout_callbacks
)

Initializes MLMediaCodecOutputFrameListener with default values.

Parameters

MLMediaCodecOutputFrameListener *inout_callbacksMediaCodec Callback structure defined by MLMediaCodecOutputFrameListener that needs to be initialized.
Deprecated

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_infoCryptoInfo structure defined by MLMediaCodecCryptoInfo that needs to be initialized.
Deprecated

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_infoInput Structure that encapsulates sample crypto info.
MLHandle *out_crypto_info_handleUpon successful return will point to handle to the created Crypto info. Or else, it will point to ML_INVALID_HANDLE.

Returns

MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.

Required Permissions:

  • None

The CryptoInfo object should be released by calling MLMediaCodecReleaseCryptoInfo.

Deprecated

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

MLHandlecrypto_info_handleHandle to Crypto info that needs to be released.

Returns

MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.

Required Permissions:

  • None
Deprecated

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

MLMediaCodecCreationmethodOne of the creation methods defined by MLMediaCodecCreation.
MLMediaCodecTypetypeOne of the codec types defined by MLMediaCodecType.
const char *name_strIf 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_handleUpon successful return will point to handle to the created MLMediaCodec. Or else, it will point to ML_INVALID_HANDLE.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkMLMediaCodec object was created successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaCodecDestroy

MLResult MLMediaCodecDestroy(
MLHandle handle
)

Destroy a MLMediaCodec.

Parameters

MLHandlehandleMLHandle to the MLMediaCodec.

Returns

MLResultMLResult_InvalidParamMLMediaCodec object is invalid.
MLResultMLResult_OkMLMediaCodec object was successfully destroyed.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlehandleMLHandle to the MLMediaCodec.
MLMediaCodecCallbacksEx *callbacksSet of codec callbacks. Can be set to NULL to unset all the callback altogether.
void *user_dataPointer to user payload data.

Returns

MLResultMLResult_InvalidParamMLMediaCodec object is invalid.
MLResultMLResult_Okcallback was set successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlehandleMLHandle to the MLMediaCodec.
MLMediaCodecOutputFrameListener *callbacksSet of codec callbacks. Can be set to NULL to unset all the callback altogether.
void *user_dataPointer to user payload data.

Returns

MLResultMLResult_InvalidParamMLMediaCodec object is invalid.
MLResultMLResult_Okcallback was set successfully.
MLResultMLResult_UnspecifiedFailureThe 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:

*llback 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

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

MLHandlehandleMLHandle to the MLMediaCodec.
char *out_namePointer to the user-maintained buffer for storing the output C-style name string.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkMLMediaCodec name was retrieved successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlehandleMLHandle to the MLMediaCodec.
MLHandleformat_handleMLHandle to the #MediaFormat object.
MLHandlesurface_handleMLHandle to the Surface object.
MLHandlecrypto_handleMLHandle to the #MediaCrypto object. Pass 0 for clear content.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkMLMediaCodec was configured successfully.
MLResultMLResult_UnspecifiedFailureThe 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:

  1. 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
  2. For the last case, user will have to explictly consume the output of the decoder by calling MLMediaCodecGetOutputBufferPointer.
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 6

MLMediaCodecStart

MLResult MLMediaCodecStart(
MLHandle handle
)

Start the codec.

Parameters

MLHandlehandleMLHandle to the MLMediaCodec.

Returns

MLResultMLResult_InvalidParamMLMediaCodec object is invalid.
MLResultMLResult_OkMLMediaCodec was started successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

Shall be called upon successful configuration.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaCodecStop

MLResult MLMediaCodecStop(
MLHandle handle
)

Stop the codec.

Parameters

MLHandlehandleMLHandle to the MLMediaCodec.

Returns

MLResultMLResult_InvalidParamMLMediaCodec object is invalid.
MLResultMLResult_OkMLMediaCodec was stopped successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

Codec is stopped and not destroyed, therefore can be started again.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaCodecReset

MLResult MLMediaCodecReset(
MLHandle handle
)

Reset the codec.

Parameters

MLHandlehandleMLHandle to the MLMediaCodec.

Returns

MLResultMLResult_InvalidParamMLMediaCodec object is invalid.
MLResultMLResult_OkMLMediaCodec was stopped successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlehandleMLHandle to the MLMediaCodec.

Returns

MLResultMLResult_InvalidParamMLMediaCodec object is invalid.
MLResultMLResult_OkMLMediaCodec was flushed successfully.
MLResultMLResult_UnspecifiedFailureThe 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

Deprecated since 1.4.0. Scheduled for removal.


MLMediaCodecSetParameters

MLResult MLMediaCodecSetParameters(
MLHandle handle,
MLHandle format_handle
)

Communicate additional parameter changes to a codec.

Parameters

MLHandlehandleMLHandle to the MLMediaCodec.
MLHandleformat_handleMLHandle to the MLMediaFormat containing the parameters to set.

Returns

MLResultMLResult_InvalidParamAt least one of the input parameters or one of the format parameter values is invalid.
MLResultMLResult_OkThe operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_InvalidOperationAt least one format parameter is not applicable.
MLResultMLMediaGenericResult_NoInitMLMediaCodec 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. *ediaFormat_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

Deprecated since 1.4.0. Scheduled for removal.

note

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

MLHandlehandleMLHandle to the MLMediaCodec.
int64_tbuffer_indexThe index of a client-owned input buffer previously returned from a call to MLMediaCodecDequeueInputBuffer().
uint8_t **out_buffer_ptrPointer to returned input buffer.
size_t *out_buffer_sizeSize of returned input buffer.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkInput buffer pointer is retrieved successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_InvalidOperationBuffer 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

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

MLHandlehandleMLHandle to the MLMediaCodec.
int64_tbuffer_indexThe index of a client-owned output buffer previously returned from a call to MLMediaCodecDequeueOutputBuffer().
const uint8_t **out_buffer_ptrPointer to returned output buffer.
size_t *out_buffer_sizeSize of returned output buffer.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkOutput buffer pointer is retrieved successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_InvalidOperationBuffer 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

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

MLHandlehandleMLHandle to the MLMediaCodec.
int64_tbuffer_indexIndex of a client-owned input buffer previously returned in a call to MLMediaCodecDequeueInputBuffer().
int64_toffsetByte offset into the input buffer at which the data starts.
size_tsizeNumber of bytes of valid input data.
uint64_ttime_usPresentation timestamp in microseconds for this buffer. This is normally the media time at which this buffer should be presented (rendered).
intflagsA bitmask of flags defined by MLMediaCodecBufferFlag. While not prohibited, most codecs do not use the MLMediaCodecBufferFlag_KeyFrame flag for input buffers.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIntput buffer is queued successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlehandleMLHandle to the MLMediaCodec.
int64_tbuffer_indexIndex of a client-owned input buffer previously returned in a call to MLMediaCodecDequeueInputBuffer().
int64_toffsetByte offset into the input buffer at which the data starts.
MLHandlecrypto_info_handleMetadata required to facilitate decryption, the object can be reused immediately after this call returns.
uint64_ttime_usPresentation timestamp in microseconds for this buffer. This is normally the media time at which this buffer should be presented (rendered).
intflagsA bitmask of flags defined by MLMediaCodecBufferFlag. While not prohibited, most codecs do not use the MLMediaCodecBufferFlag_KeyFrame flag for input buffers.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkSecure Intput buffer is queued successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlehandleMLHandle to the MLMediaCodec.
int64_ttimeout_usTimeout in microseconds. Negative timeout indicates "infinite".
int64_t *out_buffer_indexIndex of an Input buffer from buffer queue, or MLMediaCodec_TryAgainLater status.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIntput buffer is dequeued successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_InvalidOperationif 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

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

MLHandlehandleMLHandle to the MLMediaCodec.
MLMediaCodecBufferInfo *out_buffer_infoWill be filled with buffer meta data.
int64_ttimeout_usTimeout in microseconds. Negative timeout indicates "infinite".
int64_t *out_buffer_indexIndex of an output buffer from buffer queue, or one of the statuses defined by MLMediaCodecOutputBufferStatus.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkOutput buffer is dequeued successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_InvalidOperationif 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

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

MLHandlehandleMLHandle to the MLMediaCodec.
MLHandle *out_format_handleInput format supported by the codec.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkInput Media format is retrieved successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlehandleMLHandle to the MLMediaCodec.
MLHandle *out_format_handleOutput format supported by the codec, or the format to which the configuration has changed.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkOutput Media format is retrieved successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlehandleMLHandle to the MLMediaCodec.
MLHandle *out_input_surface_handleMLHandle to created input native surface. Valid only if result is MLResult_Ok.

Returns

MLResultMLResult_AllocFailedThe operation failed to allocate the surface.
MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkInput input surface was created successfully.
MLResultMLMediaGenericResult_AlreadyExistsAn input surface has already been created for the given handle.
MLResultMLMediaGenericResult_InvalidOperationMLMediaCodec is not an encoder.
MLResultMLMediaGenericResult_NoInitMLMediaCodec was not initialized.
MLResultMLMediaGenericResult_UnspecifiedFailureInput 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:

Deprecated

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

MLHandlehandleMLHandle to the MLMediaCodec.
MLHandleinput_surface_handleMLHandle to the internal Surface object.

Returns

MLResultMLResult_InvalidParamMLHandle is invalid.
MLResultMLResult_OkSurface object was successfully released.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_InvalidOperationMLMediaCodec is not an encoder.
MLResultMLMediaGenericResult_NoInitMLMediaCodec was not initialized.

Required Permissions:

  • None
Deprecated

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

MLHandlehandleMLHandle to the MLMediaCodec.

Returns

MLResultMLResult_InvalidOperationMLMediaCodec is not an encoder or MLMediaCodec is not receving input from a surface.
MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkThe operation was successful.
MLResultMLMediaGenericResult_NoInitMLMediaCodec 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

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

MLHandlehandleMLHandle to the MLMediaCodec object.
int64_tbuffer_indexIndex of a client-owned output buffer previously returned from a call to MLMediaCodecDequeueOutputBuffer().
boolrenderIf a valid surface was specified when configuring the codec, passing true renders this output buffer to the surface.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkOutput buffer was released successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlehandleMLHandle to the MLMediaCodec object.
int64_tbuffer_indexIndex of a client-owned output buffer previously returned from a call to MLMediaCodecDequeueOutputBuffer().
int64_ttimestamp_nsThe timestamp in nanoseconds to associate with this buffer when it is sent to the Surface.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkOutput buffer was released successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

The timestamp may have special meaning depending on the destination surface.

Deprecated

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_countNumber of available codecs.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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_nameName of the codec.
bool *out_valReturns true if the codec is a software codec and false otherwise.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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 *mimeCodec mime.
boolis_encoderSet to true if querying for encoder and false otherwise.
MLMediaCodecListCodecTypeFlagflagWhether querying for software-only or hardware-only, defined by MLMediaCodecListCodecTypeFlag.
MLMediaCodecListQueryResults *out_matching_codecsList of codecs supporting the given mime.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe 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

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 *typeCodec mime.
boolis_encoderSet to true if querying for encoder and false otherwise.
uint64_tstart_indexIndex from which to search in the codec list. The number shall be between 0 and number of available codecs.
int64_t *out_indexIndex of the matching codec or -2.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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 *nameCodec name.
int64_t *out_indexIndex of the matching codec or -2.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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_tindexIndex of the codec in the codec list. The number shall be between 0 and number of available codecs.
bool *out_valReturns true if the codec is an encoder and false otherwise.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaCodecListGetCodecName

MLResult MLMediaCodecListGetCodecName(
uint64_t index,
char * out_name
)

Obtain a codec name.

Parameters

uint64_tindexIndex of the codec in the codec list. The number shall be between 0 and number of available codecs.
char *out_namePointer to the user-maintained buffer for storing the output C-style name string.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe 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

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_tindexIndex of the codec in the codec list. The number shall be between 0 and number of available codecs.
MLMediaCodecListQueryResults *out_supported_mimesList of supported mimes.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe 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

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_tindexIndex of the codec in the codec list. The number shall be between 0 and number of available codecs.
const char *mimeMime type of the codec being queried.
MLMediaCodecListCapabilityFlag *out_capability_flagCodec capability flag defined by MLMediaCodecListCapabilityFlag.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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 *mimeMime type of the codec.
boolis_decoderSet to true if querying for decoder and false otherwise.
char *out_namePointer to the user-maintained buffer for storing the output C-style name string.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe 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

Deprecated since 1.4.0. Scheduled for removal.


MLMediaCodecListQueryResultsRelease

MLResult MLMediaCodecListQueryResultsRelease(
MLMediaCodecListQueryResults * query_results
)

Release the query results.

Parameters

MLMediaCodecListQueryResults *query_resultsQuery results such as the list of codecs acquired by MLMediaCodecListGetMatchingCodecs() or the list of supported mime types acquired by MLMediaCodecListGetSupportedMimes().

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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_tindexIndex of the codec in the codec list. The number shall be between 0 and number of available codecs.
const char *mimeMime type of the codec being queried.
MLMediaCodecListProfileLevel **out_profile_levelsCodec supported profile levels defined by MLMediaCodecListProfileLevel.
size_t *out_profile_levels_sizeNumber of profile levels.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

User shall call MLMediaCodecListProfileLevelsRelease() to release it.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 6

MLMediaCodecListProfileLevelsRelease

MLResult MLMediaCodecListProfileLevelsRelease(
MLMediaCodecListProfileLevel * profile_levels
)

Release profile levels.

Parameters

MLMediaCodecListProfileLevel *profile_levelsThe return value of MLMediaCodecListGetSupportedProfileLevels().

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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_tindexIndex of the codec in the codec list. The number shall be between 0 and number of available codecs.
const char *mimeMime type of the codec being queried.
uint32_t **out_color_formatsCodec supported color formats of type MLMediaCodecColorFormat.
size_t *out_color_formats_sizeNumber of color formats.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

User shall call MLMediaCodecListColorFormatsRelease() to release it.

Deprecated

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_formatsThe return value of MLMediaCodecListGetSupportedColorFormats().

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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_tindexIndex of the codec in the codec list. The number shall be between 0 and number of available codecs.
const char *mimeMime type of the codec being queried.
MLMediaCodecBitrateMode **out_bitrate_modesCodec supported Bitrate modes defined by MLMediaCodecBitrateMode.
size_t *out_bitrate_modes_sizeNumber of Bitrate modes.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

User shall call MLMediaCodecBitrateModesRelease() to release it.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 9

MLMediaCodecBitrateModesRelease

MLResult MLMediaCodecBitrateModesRelease(
MLMediaCodecBitrateMode * bitrate_modes
)

Release Bitrate modes.

Parameters

MLMediaCodecBitrateMode *bitrate_modesThe return value of MLMediaCodecListGetSupportedBitrateModes().

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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_tindexIndex of the codec in the codec list. The number shall be between 0 and number of available codecs.
const char *mimeMime type of the codec being queried.
bool *out_supportedReturns true if supported, false otherwise.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe 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

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_tindexIndex of the codec in the codec list. The number shall be between 0 and number of available codecs.
const char *mimeMime type of the codec being queried.
bool *out_supportedReturns true if supported, false otherwise.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

If the component is an encoder, it will always return false.

Deprecated

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_tindexIndex of the codec in the codec list. The number shall be between 0 and number of available codecs.
const char *mimeMime type of the codec being queried.
bool *out_supportedReturns true if supported, false otherwise.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkIf operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

If the component is Decoder, it will always return false.

Deprecated

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

MLUUIDuuidThe universal unique ID of the crypto scheme. uuid must be 16 bytes.
const MLMediaDRMByteArray *dataOpaque initialization data specific to the crypto scheme, This value must never be NULL.
MLHandle *out_handleUpon successful return will point to handle to the created MLMediaCrypto. Or else, it will point to ML_INVALID_HANDLE.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkMLMediaCrypto object was created successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaCryptoRelease

MLResult MLMediaCryptoRelease(
MLHandle media_crypto
)

Release the MLMediaCrypto instance.

Parameters

MLHandlemedia_cryptoMLHandle to the MLMediaCrypto.

Returns

MLResultMLResult_InvalidParamMLMediaCrypto object is invalid.
MLResultMLResult_OkMLMediaCrypto object was successfully destroyed.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLUUIDuuidIdentifies the universal unique ID of the crypto scheme. uuid must be 16 bytes.
bool *out_supportedOn successful return contains true or false based on whether the given crypto scheme is supported or not.

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkThe query has run successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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_typeThe MIME type of the media container, e.g. "video/mp4".
bool *out_requiredOn successful return contains true or false based on whether the given mime type requires a secure decoder.

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkThe query has run successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_cryptoMLHandle to the MLMediaCrypto.
const MLMediaDRMByteArray *session_idSession ID for the DRM session.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkMedia DRM session was set successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLMediaDataSourceReadAtread_atMLMediaDataSourceReadAt callback.
MLMediaDataSourceGetSizeget_sizeMLMediaDataSourceGetSize callback.
MLMediaDataSourceClosecloseMLMediaDataSourceClose callback.
void *contextUser data to be passed to callbacks.
MLHandle *out_handleThe MLHandle to the new source object created. Only valid if result is MLResult_Ok.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_Okif operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaDataSourceDestroy

MLResult MLMediaDataSourceDestroy(
MLHandle media_data_source
)

Destroy a #MediaDataSource object.

Parameters

MLHandlemedia_data_sourceMLHandle to the #MediaDataSource object to destroy.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_Okif operation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaDRMEventCallbacksInit

static inline void MLMediaDRMEventCallbacksInit(
MLMediaDRMEventCallbacks * inout_callbacks
)

Initializes MLMediaDRMEventCallbacks with default values.

Parameters

MLMediaDRMEventCallbacks *inout_callbacksMediaDRM Callback structure defined by MLMediaDRMEventCallbacks that needs to be initialized.
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaDRMByteArrayAllocate

MLResult MLMediaDRMByteArrayAllocate(
size_t size,
MLMediaDRMByteArray * out_array
)

Allocate byte array buffer.

Parameters

size_tsizeMaximum size of the desirable byte array to be allocated.
MLMediaDRMByteArray *out_arrayPointer to byte array buffer that needs to be allocated. To free/release, call MLMediaDRMByteArrayRelease().

Returns

MLResultMLResult_AllocFailedFailed because of allocation failure.
MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkByte Array is allocated successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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_fromBuffer from which copy into byte array.
size_tsizeNumber of bytes to be copied.
MLMediaDRMByteArray *out_arrayPointer to byte array buffer that needs to be allocated and copied to. To free/release, call MLMediaDRMByteArrayRelease().

Returns

MLResultMLResult_AllocFailedFailed because of allocation failure.
MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkByte Array is allocated and copied successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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_tsizeMaximum size of the desirable array of key/value pair to be allocated.
MLMediaDRMKeyValueArray *out_arrayPointer to array of key/value pair that needs to be allocated. To free/release, call MLMediaDRMKeyValueArrayRelease().

Returns

MLResultMLResult_AllocFailedFailed because of allocation failure.
MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkKey/value pair array is allocated successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaDRMCreate

MLResult MLMediaDRMCreate(
MLUUID uuid,
MLHandle * out_handle
)

Create a MLMediaDRM instance from a UUID.

Parameters

MLUUIDuuidThe universal unique ID of the crypto scheme. uuid must be 16 bytes.
MLHandle *out_handleUpon successful return will point to handle to the created MLMediaDRM. Or else, it will point to ML_INVALID_HANDLE.

Returns

MLResultMLResult_AllocFailedMLMediaDRM object creation failed with resource allocation failure.
MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkMLMediaDRM object was created successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaDRMRelease

MLResult MLMediaDRMRelease(
MLHandle media_drm
)

Release the MLMediaDRM instance.

Parameters

MLHandlemedia_drmHandle to the MLMediaDRM.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkMLMediaDRM object was released successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaDRMByteArrayRelease

MLResult MLMediaDRMByteArrayRelease(
MLMediaDRMByteArray * array
)

Release byte array buffer.

Parameters

MLMediaDRMByteArray *arrayByte array buffer that needs to be released.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkByte Array was released successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaDRMByteArrayListRelease

MLResult MLMediaDRMByteArrayListRelease(
MLMediaDRMByteArrayList * array
)

Release list of byte array buffer.

Parameters

MLMediaDRMByteArrayList *arrayList of byte array buffer that needs to be released.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkByte Array List was released successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaDRMKeyValueArrayRelease

MLResult MLMediaDRMKeyValueArrayRelease(
MLMediaDRMKeyValueArray * array
)

Release key/value pair array.

Parameters

MLMediaDRMKeyValueArray *arrayKey/value pair array that needs to be released.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkKey/value pair array was released successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaDRMRequestMessageRelease

MLResult MLMediaDRMRequestMessageRelease(
MLMediaDRMRequestMessage * request
)

Release Request Message.

Parameters

MLMediaDRMRequestMessage *requestPointer to Request Message that needs to be released.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkDRM Request Message was released successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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 *pairThe source key/value pair that needs to be added.
MLMediaDRMKeyValueArray *out_arrayPointer to array of key/value pair to which the pair needs to be added to.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_Okkey/value pair is added successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLUUIDuuidIdentifies the universal unique ID of the crypto scheme. UUID must be 16 bytes.
const char *mime_typeThe 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_supportedOn successful return contains true or false based on whether the given crypto scheme is supported or not.

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkThe query has run successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
MLMediaDRMEventCallbacks *callbacksSet of event callbacks. Can be set to NULL to unset the callbacks altogether.
void *dataCustom data to be returned when any callback is fired.

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkEvent listener was set successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
MLMediaDRMByteArray *out_session_idID of the session created/opened. This byte array will be released when MLMediaDRMCloseSession() is called.

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM session was opened successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
MLMediaDRMByteArray *session_idThe session ID for the DRM session, which will be released on return.

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM session was closed successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const MLMediaDRMByteArray *session_idThe session ID for the DRM session.
const MLMediaDRMKeyRequestInputParam *key_request_paramPlaceholder for needed arguments for generating a key request message.
MLMediaDRMRequestMessage *out_key_requestUpon successful return, contains key request message. To free/release this, call MLMediaDRMRequestMessageRelease().

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM Key Request message is constructed successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const MLMediaDRMByteArray *session_idThe session ID for the DRM session.
const MLMediaDRMByteArray *responseThe opaque response from the server.
MLMediaDRMByteArray *out_key_set_idUpon successful return, contains the key identifier. To free/release this buffer, call MLMediaDRMByteArrayRelease().

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM Key Response message was consumed successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const MLMediaDRMByteArray *session_idThe session ID for the DRM session.
const MLMediaDRMByteArray *key_set_idThe saved key set to restore.

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM Keys are restored successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
MLMediaDRMByteArray *key_set_idThe keys to remove, which will be released on success.

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM Keys are removed successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const MLMediaDRMByteArray *session_idThe session ID for the DRM session.
MLMediaDRMKeyValueArray *out_info_mapThe Key-Value pair place-holder for the key status. To release/free this call MLMediaDRMKeyValueArrayRelease().

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkQuery for MLMediaDRM Key status completed successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const char *cert_typeThe device certificate type, which can be "none" or "X.509".
MLMediaDRMRequestMessage *out_provision_requestUpon successful return, contains provision request message. To free/release this, call MLMediaDRMRequestMessageRelease().

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkDevice Provision Request message is constructed successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const MLMediaDRMByteArray *responseThe opaque provisioning response byte array to provide to the DRM engine plugin.
MLMediaDRMByteArray *out_certificateThe device certificate upon sucessful return. To release/free this call MLMediaDRMByteArrayRelease().
MLMediaDRMByteArray *out_wrapped_keyThe wrapped device key upon sucessful return. To release/free this call MLMediaDRMByteArrayRelease().

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkDevice Provision Response message is consumed successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaDRMGetSecureStops

MLResult MLMediaDRMGetSecureStops(
MLHandle media_drm,
MLMediaDRMByteArrayList * out_secure_stops
)

Access all secure stops.

Parameters

MLHandlemedia_drmHandle to the MLMediaDRM.
MLMediaDRMByteArrayList *out_secure_stopsList of all the secure stops upon successful return. To free/release call MLMediaDRMByteArrayListRelease().

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM Secure stops are retrieved successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const MLMediaDRMByteArray *ss_idThe ID for the DRM securestop session.
MLMediaDRMByteArray *out_secure_stopThe secure stop upon successful return. To free/release call MLMediaDRMByteArrayRelease().

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM Secure stop is retrieved successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const MLMediaDRMByteArray *secure_stopThe server response indicating which secure stops to release.

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM Secure stops are released successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaDRMReleaseAllSecureStops

MLResult MLMediaDRMReleaseAllSecureStops(
MLHandle media_drm
)

Remove all the SecureStops.

Parameters

MLHandlemedia_drmHandle to the MLMediaDRM.

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkAll secure stops for the MLMediaDRM are released successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
MLMediaDRMPropertyproperty_nameThe property to query. Standard property names are:
  • MLMediaDRMProperty_Vendor. *ediaDRMProperty_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

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM property is retrieved successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
MLMediaDRMPropertyproperty_nameThe 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

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM property is retrieved successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
MLMediaDRMPropertyproperty_nameThe 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

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM property is set successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
MLMediaDRMPropertyproperty_nameThe property to query. Standard property names are:

* MLMediaDRMProperty_DeviceUniqueID. | | const MLMediaDRMByteArray * |property_value|The value of the corresponding property.|

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM property is set successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const MLMediaDRMByteArray *session_idThe session ID for the DRM session.
const MLMediaDRMCryptoInputParam *crypto_key_paramPointer to the structure that contains needed crypto arguments for encryption operation.
const MLMediaDRMByteArray *inputThe data that needs to be encrypted.
MLMediaDRMByteArray *out_outputThe encrypted input upon successful return. To free/release this buffer, call MLMediaDRMByteArrayRelease().

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM encryption operation has been completed successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const MLMediaDRMByteArray *session_idThe session ID for the DRM session.
const MLMediaDRMCryptoInputParam *crypto_key_paramPointer to the structure that contains needed crypto arguments for decryption operation.
const MLMediaDRMByteArray *inputThe data that needs to be decrypted.
MLMediaDRMByteArray *out_outputThe decrypted input upon successful return. To free/release this buffer, call MLMediaDRMByteArrayRelease().

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM decryption operation has been completed successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const MLMediaDRMByteArray *session_idThe session ID for the DRM session.
const MLMediaDRMHMACInputParam *hmac_key_paramPointer to the structure that contains needed crypto arguments for HMAC operation.
const MLMediaDRMByteArray *messageThe data that needs to be signed.
MLMediaDRMByteArray *out_signatureThe signature of the input message upon success. To free/release this buffer, call MLMediaDRMByteArrayRelease().

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM HMAC Sign operation has been completed successfully.
MLResultMLResult_UnspecifiedFailureThe 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

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const MLMediaDRMByteArray *session_idThe session ID for the DRM session.
const MLMediaDRMHMACInputParam *hmac_key_paramPointer to the structure that contains needed crypto arguments for HMAC operation.
const MLMediaDRMByteArray *messageThe data for which signature needs to be verified.
const MLMediaDRMByteArray *signatureThe signature of the input message.
bool *out_matchPointer to bool, which would return "true" if the signature matches, "false" otherwise.

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM HMAC Verify operation has been completed successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

The key must have been loaded into the session using MLMediaDRMProvideKeyResponse().

Deprecated

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

MLHandlemedia_drmHandle to the MLMediaDRM.
const MLMediaDRMByteArray *session_idThe session ID for the DRM session.
const MLMediaDRMRSAInputParam *rsa_key_paramPointer to the structure that contains needed key arguments for this RSA operation.
const MLMediaDRMByteArray *messageThe data that needs to be signed.
MLMediaDRMByteArray *out_signatureThe signature of the input message upon success. To free/release this buffer, call MLMediaDRMByteArrayRelease().

Returns

MLResultMLResult_InvalidParamParameter is invalid.
MLResultMLResult_OkMLMediaDRM RSA Sign operation has been completed successfully.
MLResultMLResult_PermissionDeniedNecessary permission is missing.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaExtractorCreate

MLResult MLMediaExtractorCreate(
MLHandle * out_handle
)

Create a new MLMediaExtractor.

Parameters

MLHandle *out_handleA handle to the created MLMediaExtractor. If there is an error during creation, it will return ML_INVALID_HANDLE.

Returns

MLResultMLResult_AllocFailedIf MediaExtractor handle cannot be allocated.
MLResultMLResult_InvalidParamIf out_handle is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaExtractorDestroy

MLResult MLMediaExtractorDestroy(
MLHandle handle
)

Destroy a MLMediaExtractor.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor object.

Returns

MLResultMLResult_InvalidParamIf handle is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

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

MLHandlehandleMLHandle to the MLMediaExtractor.
const char *pathContent path of the file.

Returns

MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

The path should be an absolute path and should reference a world-readable file.

Deprecated

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

MLHandlehandleMLHandle to the MLMediaExtractor.
const char *uriC-style string representing the URI complete string.

Returns

MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_PermissionDeniedNecessary permission is missing.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • android.permission.INTERNET (protection level: normal)
Deprecated

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

MLHandlehandleMLHandle to the MLMediaExtractor.
const char *uriC-style string representing the complete URL.
const char **headersArray of char * headers to be sent.
size_tlenNumber of headers passed-in.

Returns

MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_PermissionDeniedNecessary permission is missing.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • android.permission.INTERNET (protection level: normal)