Skip to main content
Version: 20 Mar 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:

  • This callback is for informational purposes only: to get precise render timing samples, and can be significantly delayed and batched. Some frames may have been rendered even if there was no callback generated.
  • This callback doesn't set the codec to operate in asynchrous mode.
  • Since audio codec doesn't use Surface, this callback as no effect when audio codec is instantiated.
Deprecated

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.
  • MLMediaFormat_Key_Operating_Rate: Describes the rate at which a codec is expected to operate. For video, this is the operating frame rate; for audio, this is the sample rate. Associated value is a float value representing either the frames-per-second or the samples-per-second for video or audio, respectively. Applicable to any codec. Note: This key is ignored if it fails to apply. Note: This key can also be set as part of the MLMediaFormat provided at configure-time.
  • MLMediaFormat_Key_Intra_Refresh_Period: Describes the period of intra refresh in frames. Associated value is a int32_t value representing the period in frames after which the whole frame is completely refreshed. Applicable to any video encoder. Note: This key is ignored if not supported by the codec or it fails to apply. Note: This key can also be set as part of the MLMediaFormat provided at configure-time.
  • MLMediaFormat_Key_Latency: Describes the latency, in frames, a video encoder should have queued up before outputting at least one output frame. Associated value is an int32_t value representing the latency, in number of frames. Applicable to any video encoder. Note: This key is ignored if not supported by the codec or it fails to apply. Note: This key can also be set as part of the MLMediaFormat provided at configure-time.
Deprecated

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. * MLMediaDRMProperty_Version. * MLMediaDRMProperty_Description. * MLMediaDRMProperty_Algorithms. | | char ** |out_property_value|The property value upon successful return. Ownership is passed, call free(*out_property_value) to free it.|

Returns

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)
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaExtractorSetDataSourceForFD

MLResult MLMediaExtractorSetDataSourceForFD(
MLHandle handle,
int fd,
int64_t offset,
int64_t length
)

Set the data source as the file-descriptor to use.

Parameters

MLHandlehandleMLHandle to the MediaExtractor.
intfdFile-descriptor for the file to extract from.
int64_toffsetOffset in bytes into the file where the data to be extracted starts.
int64_tlengthLength in bytes of the data to be extracted.

Returns

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

Required Permissions:

  • None

It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaExtractorSetMediaDataSource

MLResult MLMediaExtractorSetMediaDataSource(
MLHandle handle,
MLHandle media_data_source
)

Sets the data source as user defined media data source.

Parameters

MLHandlehandleMLHandle to the MediaExtractor.
MLHandlemedia_data_sourceMLHandle returned by MLMediaDataSourceCreate().

Returns

MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_NameNotFoundIf media_data_source cannot be found.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaExtractorGetDRMInitData

MLResult MLMediaExtractorGetDRMInitData(
MLHandle handle,
MLUUID drm_uuid,
MLMediaExtractorDRMSchemeInitData * out_drm_init_data
)

Extract DRM initialization data for a given DRM Scheme if it exists.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor.
MLUUIDdrm_uuidUUID of the DRM scheme.
MLMediaExtractorDRMSchemeInitData *out_drm_init_dataDRM initialization data pointer. To release the DRM initialization data upon successful return, call MLMediaExtractorReleaseDRMInitData().

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaExtractorReleaseDRMInitData

MLResult MLMediaExtractorReleaseDRMInitData(
MLHandle handle,
MLMediaExtractorDRMSchemeInitData * drm_init_data
)

Release DRM initialization data which was previously retrieved.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor.
MLMediaExtractorDRMSchemeInitData *drm_init_dataDRM initialization data that needs to be released.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaExtractorGetTrackCount

MLResult MLMediaExtractorGetTrackCount(
MLHandle handle,
uint64_t * out_track_count
)

Count the number of tracks found in the data source.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor.
uint64_t *out_track_countNumber of tracks found in data source.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaExtractorGetTrackFormat

MLResult MLMediaExtractorGetTrackFormat(
MLHandle handle,
size_t index,
MLHandle * out_track_handle
)

Get the track format at the specified index.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor.
size_tindexIndex of the track.
MLHandle *out_track_handleMLMediaFormat handle that represents track format.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaExtractorSelectTrack

MLResult MLMediaExtractorSelectTrack(
MLHandle handle,
size_t index
)

Select a track for the subsequent operations.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor.
size_tindexIndex of the track.

Returns

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

Required Permissions:

  • None

Subsequent calls to MLMediaExtractorReadSampleData(), MLMediaExtractorGetSampleTrackIndex() and getSampleTime() only retrieve information for the subset of tracks selected. Selecting the same track multiple times has no effect, the track is only selected once.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaExtractorUnselectTrack

MLResult MLMediaExtractorUnselectTrack(
MLHandle handle,
size_t index
)

Unselect a track for the subsequent operations.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor.
size_tindexIndex of the track.

Returns

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

Required Permissions:

  • None

Subsequent calls to MLMediaExtractorReadSampleData(), MLMediaExtractorGetSampleTrackIndex() and getSampleTime() only retrieve information for the subset of tracks selected.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaExtractorSeekTo

MLResult MLMediaExtractorSeekTo(
MLHandle handle,
int64_t time_us,
MLMediaSeekMode mode
)

All selected tracks seek near the requested time according to the specified mode.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor.
int64_ttime_usSeek time.
MLMediaSeekModemodeSeek mode defined by MLMediaSeekMode.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaExtractorAdvance

MLResult MLMediaExtractorAdvance(
MLHandle handle
)

Advance to the next sample.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor instance.

Returns

MLResultMLResult_InvalidParamIf handle is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_FailedTransactionIf Advance operation failed, no more sample data is available (end of stream).

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaExtractorReadSampleData

MLResult MLMediaExtractorReadSampleData(
MLHandle handle,
uint8_t * byte_buf,
size_t buf_size,
size_t offset,
int64_t * out_data_size
)

Retrieve the current encoded sample and store it in the byte buffer starting at the given offset.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor.
uint8_t *byte_bufDestination byte buffer.
size_tbuf_sizeSize of the destination buffer.
size_toffsetOffset within the buffer.
int64_t *out_data_sizeSample size or -1 if no more samples are available.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaExtractorGetSampleTrackIndex

MLResult MLMediaExtractorGetSampleTrackIndex(
MLHandle handle,
int64_t * out_track_index
)

Return the track index the current sample originates from.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor.
int64_t *out_track_indexTrack index or -1 if no more samples are available.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaExtractorGetSampleTime

MLResult MLMediaExtractorGetSampleTime(
MLHandle handle,
int64_t * out_sample_time
)

Return the current sample's presentation time in microseconds.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor instance.
int64_t *out_sample_timeSample time or -1 if no more samples are available.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaExtractorGetSampleFlags

MLResult MLMediaExtractorGetSampleFlags(
MLHandle handle,
int * out_sample_flags
)

Return the current sample's flags.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor instance.
int *out_sample_flagsSample flag defined by MLMediaExtractorSampleFlag, or -1 if on failure.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaExtractorGetSampleCryptoInfo

MLResult MLMediaExtractorGetSampleCryptoInfo(
MLHandle handle,
MLHandle * out_info_handle
)

Return the current sample's Crypto info if has encrypted sample.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor instance.
MLHandle *out_info_handleOn success it returns handle to Crypto info of the sample.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaExtractorReleaseCryptoInfo

MLResult MLMediaExtractorReleaseCryptoInfo(
MLHandle handle,
MLHandle * inout_info_handle
)

Release the Crypto Info.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor instance.
MLHandle *inout_info_handlehandle to Crypto info that needs to be released.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaExtractorGetCachedDuration

MLResult MLMediaExtractorGetCachedDuration(
MLHandle handle,
int64_t * out_cached_duration
)

Return an estimate of how much data is presently cached in memoryexpressed in microseconds.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor.
int64_t *out_cached_durationCached amount or -1 if that information is unavailable or not applicable (no cache).

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaExtractorHasCacheReachedEOS

MLResult MLMediaExtractorHasCacheReachedEOS(
MLHandle handle
)

Return true if we are caching data and the cache has reached the end of the data stream (for now, a future seek may of course restart the fetching of data).

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor instance.

Returns

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

Required Permissions:

  • None

This API only returns a meaningful result if getCachedDuration() indicates the presence of a cache, i.e. does NOT return -1.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaExtractorGetPSSHInfoCount

MLResult MLMediaExtractorGetPSSHInfoCount(
MLHandle handle,
size_t * out_index
)

Get the Number of PSSH info if present.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor instance.
size_t *out_indexOn successful return contains number of PSSH entries.

Returns

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

Required Permissions:

  • None

The PSSH(Protection System Specific Header) contains a UUID representing a DRM scheme along with opaque data blob used for creating crypto session, which in turn used to configure codec.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaExtractorGetPSSHInfo

MLResult MLMediaExtractorGetPSSHInfo(
MLHandle handle,
size_t index,
MLMediaExtractorPSSHEntry * out_pssh_entry
)

Get the PSSH info if present. The PSSH(Protection System Specific Header) contains a UUID representing a DRM scheme along with opaque data blob used for creating crypto session, which in turn used to configure codec.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor instance.
size_tindexIndex of the PSSH info data element being retrieved.
MLMediaExtractorPSSHEntry *out_pssh_entryPointer to the PSSH info data element being retrieved.

Returns

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

Required Permissions:

  • None

Upon successful return, if a MLMediaExtractorPSSHEntry is returned, same should be released by calling MLMediaExtractorReleasePSSHInfo().

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaExtractorReleasePSSHInfo

MLResult MLMediaExtractorReleasePSSHInfo(
MLHandle handle,
MLMediaExtractorPSSHEntry * pssh_entry
)

Clear the PSSH info data.

Parameters

MLHandlehandleMLHandle to the MLMediaExtractor instance.
MLMediaExtractorPSSHEntry *pssh_entryPointer to the PSSH info data element that needs to be released.

Returns

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

Required Permissions:

  • None

Clears the entire cached PSSH info data in the library.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormatCreateVideo

MLResult MLMediaFormatCreateVideo(
const char * mime_type,
int width,
int height,
MLHandle * out_handle
)

Create a video format object.

Parameters

const char *mime_typeMime type of the content.
intwidthWidth of the content in pixels.
intheightHeight of the content in pixels.
MLHandle *out_handleA handle to the created video format object. If there is an error during creation, it will return ML_INVALID_HANDLE.

Returns

MLResultMLResult_AllocFailedIf handle cannot be allocated.
MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormatCreateAudio

MLResult MLMediaFormatCreateAudio(
const char * mime_type,
int sample_rate,
int channel_count,
MLHandle * out_handle
)

Create a audio format object.

Parameters

const char *mime_typeMime type of the content.
intsample_rateSample rate of the content.
intchannel_countNumber of audio channels.
MLHandle *out_handleA handle to the created audio format object. If there is an error during creation, it will return ML_INVALID_HANDLE.

Returns

MLResultMLResult_AllocFailedIf handle cannot be allocated.
MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaFormatCreateSubtitle

MLResult MLMediaFormatCreateSubtitle(
const char * mime_type,
const char * language,
MLHandle * out_handle
)

Create a subtitle format object.

Parameters

const char *mime_typeMime type of the content.
const char *languageLanguage of the content, using either ISO 639-1 or 639-2/T codes. Specify null or "und" if language information is only included in the content (This will also work if there are multiple language tracks in the content).
MLHandle *out_handleA handle to the created subtitle format object. If there is an error during creation, it will return ML_INVALID_HANDLE.

Returns

MLResultMLResult_AllocFailedIf handle cannot be allocated.
MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaFormatCreate

MLResult MLMediaFormatCreate(
MLHandle * out_handle
)

Create an empty format object.

Parameters

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

Returns

MLResultMLResult_AllocFailedIf handle cannot be allocated.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_InvalidParamIf one of parameters is invalid.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 9

MLMediaFormatCreateCopy

MLResult MLMediaFormatCreateCopy(
MLHandle handle,
MLHandle * out_handle
)

Create a copy of the format handle provided.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLHandle *out_handleA handle to the created copy of the format object. If there is an error during creation, it will return ML_INVALID_HANDLE.

Returns

MLResultMLResult_AllocFailedIf handle cannot be allocated.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_InvalidParamIf one of parameters is invalid.

Required Permissions:

  • None

This can be particularly useful to persist the media format handle/object that was received through the callbacks (as life cycle of those media format objects are with in the callback context only).

The API call to make a copy ensures that the copied object exists until released with MLMediaFormatDestroy call.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLMediaFormatDestroy

MLResult MLMediaFormatDestroy(
MLHandle handle
)

Destroy a MLMediaFormat object.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.

Returns

MLResultMLResult_InvalidParamIf handle is invalid.
MLResultMLResult_OkIf MLMediaCodec object was successfully destroyed.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormatObjectToString

MLResult MLMediaFormatObjectToString(
MLHandle handle,
char * out_string
)

Obtain the human readable representation of the format.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
char *out_stringBuffer to which stringify the media format. Shouldn't be NULL.

Returns

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

Required Permissions:

  • None

User shall allocate at least MAX_FORMAT_STRING_SIZE bytes of memory for storing the output format string. The format string contains a list of key-value pairs, which can be extracted individually via the suitable "GetKeyValue" APIs.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormatGetKeyValueInt32

MLResult MLMediaFormatGetKeyValueInt32(
MLHandle handle,
MLMediaFormatKey name,
int32_t * out_key
)

Obtain the value of an integer key.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatKeynameC-string representation of the key. Must be one of the MLMediaFormatKey tags defined above.
int32_t *out_keyValue of the key.

Returns

MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_NameNotFoundIf name is not one of the media format key name.

Required Permissions:

  • None

For example, use MLMediaFormat_Key_Frame_Rate key to get the framerate of a video track.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormatGetKeyValueInt64

MLResult MLMediaFormatGetKeyValueInt64(
MLHandle handle,
MLMediaFormatKey name,
int64_t * out_key
)

Obtain the value of a long key.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatKeynameC-string representation of the key. Must be one of the MLMediaFormatKey tags defined above.
int64_t *out_keyValue of the key.

Returns

MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_NameNotFoundIf name is not one of the media format key name.

Required Permissions:

  • None

For example, use MLMediaFormat_Key_Duration key to get duration of a track.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormatGetKeyValueFloat

MLResult MLMediaFormatGetKeyValueFloat(
MLHandle handle,
MLMediaFormatKey name,
float * out_key
)

Obtain the value of an float key.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatKeynameC-string representation of the key. Must be one of the MLMediaFormatKey tags defined above.
float *out_keyValue of the key.

Returns

MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_NameNotFoundIf name is not one of the media format key name.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormatGetKeySize

MLResult MLMediaFormatGetKeySize(
MLHandle handle,
MLMediaFormatKey name,
size_t * out_size
)

Obtain the size of a key.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatKeynameC-string representation of the key. Must be one of the MLMediaFormatKey tags defined above.
size_t *out_sizeSize of the key.

Returns

MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_NameNotFoundIf name is not one of the media format key name.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormatGetKeyString

MLResult MLMediaFormatGetKeyString(
MLHandle handle,
MLMediaFormatKey name,
char * out_string
)

Obtain the value of a string key.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatKeynameC-string representation of the key. Must be one of the MLMediaFormatKey tags defined above.
char *out_stringPointer to the C-string representation of the string key.

Returns

MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_NameNotFoundIf name is not one of the media format key name.

Required Permissions:

  • None

User shall allocate at least MAX_KEY_STRING_SIZE bytes of memory for storing the output key string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormatGetKeyByteBuffer

MLResult MLMediaFormatGetKeyByteBuffer(
MLHandle handle,
MLMediaFormatKey name,
MLMediaFormatByteArray * out_buffer
)

Obtain the value of a ByteBuffer key.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatKeynameC-string representation of the key. Must be one of the MLMediaFormatKey tags defined above.
MLMediaFormatByteArray *out_bufferPointer to byte buffer that needs to be allocated and copied to. To free/release, call MLMediaFormatKeyByteBufferRelease().

Returns

MLResultMLResult_InvalidParamIf one of parameters is invalid.
MLResultMLResult_OkIf operation succeeded.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_NameNotFoundIf name is not one of the media format key name.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormatKeyByteBufferRelease

MLResult MLMediaFormatKeyByteBufferRelease(
MLHandle handle,
MLMediaFormatByteArray * buffer
)

Release the ByteBuffer acquired by MLMediaFormatGetKeyByteBuffer.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatByteArray *bufferByte buffer that needs to be released.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaFormatSetKeyInt32

MLResult MLMediaFormatSetKeyInt32(
MLHandle handle,
MLMediaFormatKey name,
int32_t key_value
)

Set the value of an integer key.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatKeynameC-string representation of the key. Must be one of the MLMediaFormatKey tags defined above.
int32_tkey_valueKey value.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaFormatSetKeyInt64

MLResult MLMediaFormatSetKeyInt64(
MLHandle handle,
MLMediaFormatKey name,
int64_t key_value
)

Set the value of a long key.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatKeynameC-string representation of the key. Must be one of the MLMediaFormatKey tags defined above.
int64_tkey_valueKey value.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaFormatSetKeyFloat

MLResult MLMediaFormatSetKeyFloat(
MLHandle handle,
MLMediaFormatKey name,
float key_value
)

Set the value of a float key.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatKeynameC-string representation of the key. Must be one of the MLMediaFormatKey tags defined above.
floatkey_valueKey value.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaFormatSetKeySize

MLResult MLMediaFormatSetKeySize(
MLHandle handle,
MLMediaFormatKey name,
size_t key_size
)

Set the size of a key.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatKeynameC-string representation of the key. Must be one of the MLMediaFormatKey tags defined above.
size_tkey_sizeKey size.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaFormatSetKeyString

MLResult MLMediaFormatSetKeyString(
MLHandle handle,
MLMediaFormatKey name,
const char * key_value
)

Set the value of a string key.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatKeynameC-string representation of the key. Must be one of the MLMediaFormatKey tags defined above.
const char *key_valueC-string representation of key value.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaFormatSetKeyByteBuffer

MLResult MLMediaFormatSetKeyByteBuffer(
MLHandle handle,
MLMediaFormatKey name,
const MLMediaFormatByteArray * buffer
)

Set the value of a ByteBuffer key.

Parameters

MLHandlehandleMLHandle to the MLMediaFormat object.
MLMediaFormatKeynameC-string representation of the key. Must be one of the MLMediaFormatKey tags defined above.
const MLMediaFormatByteArray *bufferPointer to the data buffer for the corresponding key.

Returns

MLResultMLResult_InvalidParamIf one of parameters 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.


MLMediaPlayerEventCallbacksExInit

static inline void MLMediaPlayerEventCallbacksExInit(
MLMediaPlayerEventCallbacksEx * inout_callbacks
)

Initializes MediaPlayerEventCallbacks with default values.

Parameters

MLMediaPlayerEventCallbacksEx *inout_callbacksMedia Player Callback structure defined by MLMediaPlayerEventCallbacksEx that needs to be initialized.

MLMediaPlayerTrackInfoInit

static inline void MLMediaPlayerTrackInfoInit(
MLMediaPlayerTrackInfo * inout_track_info
)

Initializes Media Track Information with default values.

Parameters

MLMediaPlayerTrackInfo *inout_track_infoMedia track information defined by MLMediaPlayerTrackInfo that needs to be initialized.

MLMediaPlayerTrackDRMSessionInfoInit

static inline void MLMediaPlayerTrackDRMSessionInfoInit(
MLMediaPlayerTrackDRMSessionInfo * inout_drm_session_info
)

Initializes Media Track DRM Session Information with defult values.

Parameters

MLMediaPlayerTrackDRMSessionInfo *inout_drm_session_infoMedia track DRM Session information defined by MLMediaPlayerTrackDRMSessionInfo that needs to be initialized.

MLMediaPlayerCreate

MLResult MLMediaPlayerCreate(
MLHandle * out_handle
)

Create a new Media Player object.

Parameters

MLHandle *out_handleThe MLHandle to the new Media Player object created. Only valid if result is MLResult_Ok.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully created MediaPlayer.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

note

This is a blocking sync method. As creating a MediaPlayer object might take some time, make sure to not call this API from your main UI thread.


MLMediaPlayerDestroy

MLResult MLMediaPlayerDestroy(
MLHandle media_player
)

Destroys a MediaPlayer object.

Parameters

MLHandlemedia_playerMLHandle to the Media Player object to destroy.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully destroyed MediaPlayer.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

note

This is a blocking sync method. As destroying a MediaPlayer object might take some time, make sure to not call this API from your main UI thread.


MLMediaPlayerSetDataSourceForFD

MLResult MLMediaPlayerSetDataSourceForFD(
MLHandle media_player,
int32_t fd
)

Sets a file descriptor as the data source.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
int32_tfdThe file descriptor for the file you want to play.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully set file descriptor.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

The file descriptor must be seekable. It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerSetOffsetDataSourceForFD

MLResult MLMediaPlayerSetOffsetDataSourceForFD(
MLHandle media_player,
int32_t fd,
int64_t offset,
int64_t length
)

Sets a file descriptor as the data source with offset.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
int32_tfdThe file descriptor for the file you want to play.
int64_toffsetThe offset (in bytes) of the source's start.
int64_tlengthThe number of bytes of media to load after offset.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully set file descriptor.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

The file descriptor must be seekable. It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns. This API is useful for specifying playable media located in resource files.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerSetDataSourceForPath

MLResult MLMediaPlayerSetDataSourceForPath(
MLHandle media_player,
const char * path
)

Sets a local file path as the data source.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
const char *pathThe linux-style path of the file.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully set local file path.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

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.


MLMediaPlayerSetDataSourceForURI

MLResult MLMediaPlayerSetDataSourceForURI(
MLHandle media_player,
const char * uri
)

Sets a URI string as the data source.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
const char *uriThe C-style string representing the URI complete string.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully set URI string.
MLResultMLResult_PermissionDeniedFailed due to lack of permission.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

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

Supported URI schemes are file, http, https, and rtsp. If looking to provide headers, use MLMediaPlayerSetRemoteDataSourceForURI().

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerSetRemoteDataSourceForURI

MLResult MLMediaPlayerSetRemoteDataSourceForURI(
MLHandle media_player,
const char * uri,
char ** headers,
size_t len
)

Sets a URI string as the remote data source.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
const char *uriThe C-style string representing the complete URL.
char **headersArray of char * headers to be sent.
size_tlenNumber of headers passed.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully set URI string.
MLResultMLResult_PermissionDeniedFailed due to lack of permission.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

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

Supported URI schemes are file, http, https, and rtsp.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerSetMediaDataSource

MLResult MLMediaPlayerSetMediaDataSource(
MLHandle media_player,
MLHandle media_data_source
)

Sets the data source to use.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLHandlemedia_data_sourceMLHandle returned by MLMediaDataSourceCreate().

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully set the data source to use.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NameNotFoundFailed because no valid source could be found.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerSetMediaStreamSource

MLResult MLMediaPlayerSetMediaStreamSource(
MLHandle media_player,
MLHandle media_stream_source
)

Sets the data source to use.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLHandlemedia_stream_sourceMLHandle returned by MLMediaStreamSourceCreate().

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully set the data source to use.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NameNotFoundFailed because no valid source could be found.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerAddTimedTextSourceForURI

MLResult MLMediaPlayerAddTimedTextSourceForURI(
MLHandle media_player,
const char * uri,
const char * mime_type
)

Adds a TimedText source from a URI.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
const char *uriThe C-style string representing the complete URI.
const char *mime_typeThe MIME type of the file.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully added TimedText source from URI.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown failure.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerAddTimedTextSourceForFD

MLResult MLMediaPlayerAddTimedTextSourceForFD(
MLHandle media_player,
int32_t fd,
int64_t offset,
int64_t length,
const char * mime_type
)

Adds a TimedText source from a file descriptor.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
int32_tfdThe file descriptor for the timed text source.
int64_toffsetThe offset (in bytes) of the source's start. Must be >= 0.
int64_tlengthThe number of bytes of media to load after offset. Must be >= 0.
const char *mime_typeThe MIME type of the file.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully added TimedText source from file descriptor.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown failure.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

The file descriptor must be seekable. It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerSetNextPlayer

MLResult MLMediaPlayerSetNextPlayer(
MLHandle media_player,
MLHandle next_media_player
)

Sets the 'next' Media Player to automatically 'start' when current Media Player playback completes.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLHandlenext_media_playerMLHandle of an already created Media Player instance. To 'remove' the next player, set next_media_player = 0.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully registered next Media Player.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NameNotFoundFailed source because no valid source could be found.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetTrackCount

MLResult MLMediaPlayerGetTrackCount(
MLHandle media_player,
uint32_t * out_track_count
)

Counts the number of tracks found in the data source.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
uint32_t *out_track_countThe number of tracks found in the player source.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned the number of tracks.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetTrackType

MLResult MLMediaPlayerGetTrackType(
MLHandle media_player,
uint32_t track,
MLMediaPlayerTrackType * out_track_type
)

Gets the type of a track.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
uint32_ttrackThe track number for which type is to be returned. Has to be < TrackCount.
MLMediaPlayerTrackType *out_track_typeThe returned type for specified track number.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned type for passed track.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NameNotFoundFound track's type was unknown.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetTrackLanguage

MLResult MLMediaPlayerGetTrackLanguage(
MLHandle media_player,
uint32_t track,
char ** out_track_language
)

Gets the language of a track.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
uint32_ttrackThe track number for which language is to be returned. Has to be < TrackCount.
char **out_track_languageThe returned language of the track. Caller has ownership of that param and has to free it when no longer needed.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned language for passed track.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetTrackMediaFormat

MLResult MLMediaPlayerGetTrackMediaFormat(
MLHandle media_player,
uint32_t track,
MLHandle * out_media_format
)

Gets the Media Format of a track.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
uint32_ttrackThe track number for which Media Format is to be returned. Has to be < TrackCount.
MLHandle *out_media_formatMLHandle to MediaFormat of the track. Caller has ownership of this handle and should call MLMediaFormatDestroy to free it when no longer needed.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully retreived the media format of passed track.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerSelectTrack

MLResult MLMediaPlayerSelectTrack(
MLHandle media_player,
uint32_t track
)

Selects a track.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
uint32_ttrackNumber of the track to select. Has to be < TrackCount.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully selected track.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerUnselectTrack

MLResult MLMediaPlayerUnselectTrack(
MLHandle media_player,
uint32_t track
)

Unselects a track.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
uint32_ttrackNumber of the track to unselect. Has to be < TrackCount.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully unselected track.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerPrepare

MLResult MLMediaPlayerPrepare(
MLHandle media_player
)

Prepares the player for playback, synchronously.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully prepared the player.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. Can only be called after one of the setDataSource methods or in the 'stopped' state.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.
MLResultMLMediaResult_CannotConnectFailed becaue MediaPlayer could not connect with the given URL.

Required Permissions:

  • None

After setting the data source and the #GraphicBufferProducer, you need to either call prepare() or prepareAsync(). For files, it is OK to call prepare(), which blocks until Media Player is ready for playback.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerPrepareAsync

MLResult MLMediaPlayerPrepareAsync(
MLHandle media_player
)

Prepares the player for playback, asynchronously.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully prepared the player asynchronously. For result, poll for MLMediaPlayerPollingStateFlag_HasBeenPrepared state or wait for 'on_prepared' callback if already set.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. Can only be called after one of the setDataSource methods or in the 'stopped' state.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

After setting the data's source and the #GraphicBufferProducer, you need to either call prepare() or prepareAsync(). For streams, you should call prepareAsync(), which returns immediately, rather than blocking until enough data has been buffered. Prepared state will then be obtained via the 'on_prepared' callback if already registered (see MLMediaPlayerSetEventCallbacksEx), or polled for via the MLMediaPlayerPollStates() call with the MLMediaPlayerPollingStateFlag_HasBeenPrepared flag set.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerStart

MLResult MLMediaPlayerStart(
MLHandle media_player
)

Starts or resumes playback.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully started/resumed playback.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. Can only be called in one of the following states: 'prepared', 'playback complete', 'paused', 'stopped'.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

If playback had previously been paused, playback will continue from where it was paused. If playback had been stopped, or never started before, playback will start at the beginning.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerStop

MLResult MLMediaPlayerStop(
MLHandle media_player
)

Stops playback after playback has been started or paused.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully stopped playback.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. Can only be called in one of the following states: 'playing', 'paused', 'stopped', 'prepared', 'playback complete'.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerPause

MLResult MLMediaPlayerPause(
MLHandle media_player
)

Pauses playback.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully paused playback.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. Can only be called in one of the following states: 'playing', 'paused', 'playback complete'.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

Calling pause() is a NOOP if Media Player is in state #MEDIA_PLAYER_PAUSED or #MEDIA_PLAYER_PLAYBACK_COMPLETE.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerReset

MLResult MLMediaPlayerReset(
MLHandle media_player
)

Resets the Media Player to its uninitialized state.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully reset MediaPlayer.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. This method can be called anytime except when in 'preparing async'.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

After calling this method, you will have to initialize it again by setting the data source and calling prepare().

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

note

This is a blocking sync method, make sure to not call this API from your main UI thread.


MLMediaPlayerSeekTo

MLResult MLMediaPlayerSeekTo(
MLHandle media_player,
int msec,
MLMediaSeekMode mode
)

Seeks to specified time position.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
intmsecThe offset in milliseconds from the start, to seek to.
MLMediaSeekModemodeSeek mode defined by MLMediaSeekMode.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully launched seek operation asynchronously. For result, poll for MLMediaPlayerPollingStateFlag_HasSeekCompleted state or wait for the 'on_seek_complete' callback if already set.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. This method can only be called from the following states: 'started', 'prepared', 'paused' and 'playback complete'.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

Note that SeekTo is an async. function and returns immediately. Successful seek result has to be obtained either via the 'on_seek_complete' if already registered (see MLMediaPlayerSetEventCallbacksEx) or by polling for the flag 'MLMediaPlayerPollingStateFlag_HasSeekCompleted' when calling MLMediaPlayerPollStates().

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerSetEventCallbacksEx

MLResult MLMediaPlayerSetEventCallbacksEx(
MLHandle media_player,
const MLMediaPlayerEventCallbacksEx * callbacks,
void * data
)

Sets callbacks to notify clients about player events.

Parameters

MLHandlemedia_playerMLHandle to the MediaCodec.
const MLMediaPlayerEventCallbacksEx *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_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully set/unset the specified callbacks.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.

Required Permissions:

  • None

This structure must be initialized by calling MLMediaPlayerEventCallbacksExInit() before use.

Client needs to implement the callback functions declared in MLMediaPlayerEventCallbacksEx, but can set to NULL the ones he does not care about.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerGetVideoSize

MLResult MLMediaPlayerGetVideoSize(
MLHandle media_player,
int32_t * out_width,
int32_t * out_height
)

Returns the size of the video frame.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
int32_t *out_widthThe returned video width.
int32_t *out_heightThe returned video height.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned video size.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetCurrentPosition

MLResult MLMediaPlayerGetCurrentPosition(
MLHandle media_player,
int32_t * out_msec
)

Returns current position of playback.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
int32_t *out_msecThe returned position in milliseconds.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned current position.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetDuration

MLResult MLMediaPlayerGetDuration(
MLHandle media_player,
int32_t * out_msec
)

Returns media duration.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
int32_t *out_msecThe returned duration in milliseconds.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned the media duration.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. This method can only be called from the following states: 'prepared', 'started', 'paused', 'stopped' and 'playback complete'.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetBufferingUpdate

MLResult MLMediaPlayerGetBufferingUpdate(
MLHandle media_player,
int32_t * out_percentage
)

Returns current buffering percentage.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
int32_t *out_percentageThe returned buffering percentage in the range [0, 100].

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned current buffering percentage.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetInfo

MLResult MLMediaPlayerGetInfo(
MLHandle media_player,
int32_t * out_code,
int32_t * out_extra
)

Returns last info received by internal Media Player.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
int32_t *out_codeThe main info code.
int32_t *out_extraThe secondary code/data.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned the last MediaPlayer.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetError

MLResult MLMediaPlayerGetError(
MLHandle media_player,
MLResult * out_result
)

Returns last error received by internal Media Player.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLResult *out_resultThe result code.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned the last MediaPlayer error.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetTimedText

MLResult MLMediaPlayerGetTimedText(
MLHandle media_player,
const char ** out_text,
int32_t * out_start,
int32_t * out_end
)

Returns last timed text event information.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
const char **out_textThe text of the timed text event.
int32_t *out_startThe start time.
int32_t *out_endThe end time.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned the last timedtext entry.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetSubtitleEx

MLResult MLMediaPlayerGetSubtitleEx(
MLHandle media_player,
MLMediaPlayerSubtitleData ** out_subtitle_data
)

Returns last subtitle event information.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLMediaPlayerSubtitleData **out_subtitle_dataThe returned MLMediaPlayerGetSubtitleExArgs pointer.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned the last subtitle entry.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerReleaseSubtitleEx

MLResult MLMediaPlayerReleaseSubtitleEx(
MLHandle media_player
)

Releases last subtitle event information.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully released the last subtitle entry.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerSetOnMediaSubtitleUpdateCallback

MLResult MLMediaPlayerSetOnMediaSubtitleUpdateCallback(
MLHandle media_player,
MLMediaPlayerOnMediaSubtitleUpdateCallback on_media_subtitle_callback,
void * data
)

Sets callback to get notified when a subtitle update is available along with its data.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLMediaPlayerOnMediaSubtitleUpdateCallbackon_media_subtitle_callbackFunction pointer to be called. This can be 'NULL' to unset the callback. See MLMediaPlayerOnMediaSubtitleUpdateCallback() callback typedef declaration and comments for explanation on expected callback parameters.
void *dataCustom data to be returned when callback is fired.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully set callback.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.

Required Permissions:

  • None

Setting this callback disables use of the poll-based API to query for the MLMediaPlayerPollingStateFlag_HasSubtitleUpdated flag. MLMediaPlayerPollStates() will ignore checks for this bit.

This also makes MLMediaPlayerGetSubtitleEx() redundant as the subtitle data is provided with the callback.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 4

MLMediaPlayerGetMetadata

MLResult MLMediaPlayerGetMetadata(
MLHandle media_player,
int64_t * out_time,
int32_t * out_size,
uint8_t ** out_buffer
)

Returns last metadata event information.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
int64_t *out_timeThe returned event time.
int32_t *out_sizeThe returned event buffer size.
uint8_t **out_bufferThe returned event buffer. This buffer is only valid until the next metadata event arrives, so make a copy if you need to use the buffer later.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned last metadata entry.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerSetVideoScalingMode

MLResult MLMediaPlayerSetVideoScalingMode(
MLHandle media_player,
MLMediaPlayerVideoScalingMode mode
)

Sets video scaling mode.

Parameters

MLHandlemedia_playerMLHandle to the MediaPlayer instance.
MLMediaPlayerVideoScalingModemodeThe video scaling mode to set. For a list of valid values, see #media_video_scaling_mode_type declaration.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned current video scaling mode.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. SetDataSource must be called immediately after creation, or after a media player reset.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerSetLooping

MLResult MLMediaPlayerSetLooping(
MLHandle media_player,
bool loop
)

Sets the looping mode of the player.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
boolloopThe looping mode. Set to true if player should loop to beginning of MediaPlayer when EOS reached. Set to false if MediaPlayer should simply stop playback at end of media.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned current looping mode.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerSetVolume

MLResult MLMediaPlayerSetVolume(
MLHandle media_player,
float volume
)

Sets the volume on this player.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
floatvolumeThe new volume in the [0.0, 1.0] range.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully set the volume.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetAudioHandle

MLResult MLMediaPlayerGetAudioHandle(
MLHandle media_player,
MLHandle * out_handle
)

Gets the handle of the audio stream.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLHandle *out_handleThe MLHandle to the returned Audio handle. Only valid if result is MLResult_Ok.

Returns

MLResultMLResult_NotImplementedIf used in versions starting 1.2.0 or later.

Required Permissions:

  • None
Deprecated

Unsupported since 1.2.0. Scheduled for removal.


MLMediaPlayerPollStates

MLResult MLMediaPlayerPollStates(
MLHandle media_player,
uint16_t mask,
uint16_t * out_polled_states
)

Polls the desired states from internal Media Player.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
uint16_tmaskSelection mask for picking which states to retrieve.
uint16_t *out_polled_statesBitwise OR'ed integer of all the chosen states from bitwise 'mask' and in the range [0 = false : 1 = true].

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully polled and returned the selected states.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.

Required Permissions:

  • None

Desired states have to be selected by passing a bitwise OR'ed mask of MLMediaPlayerPollingStateFlags flags.

The "is_XXX" states can be polled multiples times and the return value will be the same if internal state hasn't changed since last call.

When polling the "has_XXX" states however, internal state is set to false, since they mean : has <state> happened/changed since I last polled <state>.

Two-step state polling : The following states, when returning '1', indicate there is some data ready to be retrieved, by calling a getter function, as explained below.

For '#MLMediaPlayerPollingState_HasSizeChanged', call MLMediaPlayerGetVideoSize() to get the new size.

For '#MLMediaPlayerPollingState_HasBufferingUpdated', call MLMediaPlayerGetBufferingUpdate() to get buffering progress value.

For '#MLMediaPlayerPollingState_HasReceivedInfo, call MLMediaPlayerGetError() to get last info code and data.

For '#MLMediaPlayerPollingState_HasReceivedError, call MLMediaPlayerGetError() to get last error code and data.

Note: This API can still be used even if an #OnBufferAvailable callback has been set using MLMediaPlayerSetOnBufferAvailableCallback() method.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetTrackDRMInfo

MLResult MLMediaPlayerGetTrackDRMInfo(
MLHandle media_player,
const MLMediaPlayerTrackInfo * track_info,
MLMediaPlayerTrackDRMInfo ** out_drm_info
)

Gets the DRM info of the selected media (either audio or video) track.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
const MLMediaPlayerTrackInfo *track_infoMedia track information defined by MLMediaPlayerTrackInfo.
MLMediaPlayerTrackDRMInfo **out_drm_infoPointer to the pointer to MLMediaPlayerTrackDRMInfo struct. The caller should not free the pointer returned. The memory will be released in the call to MLMediaPlayerReleaseDRM().

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned the current DRM Info.
MLResultMLResult_PendingMedia Source is not prepared yet. Wait for on_prepared callback and call again.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.
MLResultMLMediaGenericResult_NotAvailableDRM Information not available for the given track.

Required Permissions:

  • None

This function has to be called only after DataSource has been set and the MediaPlayer is completely prepared.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerPrepareTrackDRM

MLResult MLMediaPlayerPrepareTrackDRM(
MLHandle media_player,
const MLMediaPlayerTrackDRMSessionInfo * drm_session_info
)

Prepares DRM for the selected media (either audio or video) track.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
const MLMediaPlayerTrackDRMSessionInfo *drm_session_infoDRM Session info for the Media track, as defined by MLMediaPlayerTrackDRMSessionInfo.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully prepared DRM.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 2

MLMediaPlayerReleaseDRM

MLResult MLMediaPlayerReleaseDRM(
MLHandle media_player
)

Releases DRM.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully released DRM.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetDefaultBufferingSettings

MLResult MLMediaPlayerGetDefaultBufferingSettings(
MLHandle media_player,
MLMediaPlayerBufferingSettings * out_buf_settings
)

Gets default Buffering settings.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLMediaPlayerBufferingSettings *out_buf_settingsA pointer to MLMediaPlayerBufferingSettings.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned default Buffering settings.
MLResultMLResult_NotImplementedFeature not implemented in the given model.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

\Attention The API is only implemented in ML1.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerGetBufferingSettings

MLResult MLMediaPlayerGetBufferingSettings(
MLHandle media_player,
MLMediaPlayerBufferingSettings * out_buf_settings
)

Gets current Buffering settings.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLMediaPlayerBufferingSettings *out_buf_settingsA pointer to MLMediaPlayerBufferingSettings.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned current Buffering settings.
MLResultMLResult_NotImplementedFeature not implemented in the given model.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

\Attention The API is only implemented in ML1.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerSetBufferingSettings

MLResult MLMediaPlayerSetBufferingSettings(
MLHandle media_player,
MLMediaPlayerBufferingSettings buf_settings
)

Sets buffering settings.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLMediaPlayerBufferingSettingsbuf_settingsAn MLMediaPlayerBufferingSettings struct.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully set buffering settings.
MLResultMLResult_NotImplementedFeature not implemented in the given model.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

\Attention The API is only implemented in ML1.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaPlayerSetOnMediaTimedTextUpdateCallback

MLResult MLMediaPlayerSetOnMediaTimedTextUpdateCallback(
MLHandle media_player,
MLMediaPlayerOnMediaTimedTextUpdateCallback on_media_timed_text_callback,
void * data
)

Set callback to get invoked when a Timed Text update is available along with its data.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLMediaPlayerOnMediaTimedTextUpdateCallbackon_media_timed_text_callbackFunction pointer to be called. This can be 'NULL' to unset the callback.
void *dataCustom data to be returned when callback is fired.

Returns

MLResultMLResult_OkSuccessfully set callback.
MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.

Required Permissions:

  • None

Setting this callback disables use of the poll-based API to query for the MLMediaPlayerPollingStateFlag_HasTimedTextUpdated flag. MLMediaPlayerPollStates() will ignore checks for this bit.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 4

MLMediaPlayerGetWebVTTData

MLResult MLMediaPlayerGetWebVTTData(
MLHandle media_player,
MLHandle timed_text,
MLWebVTTData ** out_webvtt_data
)

Gets WebVTT data represented by a timed text handle.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLHandletimed_textThe Timed Text handle.
MLWebVTTData **out_webvtt_dataThe WebVTT data structure to be returned.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned WebVTT data.
MLResultMLMediaGenericResult_BadTypeFailed because the timed_text handle was not in the WebVTT format. The timed text track's mime type must be "text/vtt".
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

The returned MLWebVTTData structure is valid only in the callback's context.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 4

MLMediaPlayerGetTTMLData

MLResult MLMediaPlayerGetTTMLData(
MLHandle media_player,
MLHandle timed_text,
MLTTMLData ** out_ttml_data
)

Gets TTML data represented by a timed text handle.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLHandletimed_textThe Timed Text handle.
MLTTMLData **out_ttml_dataThe TTML data structure to be returned.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully returned TTML data.
MLResultMLMediaGenericResult_BadTypeFailed because the timed_text handle was not in the TTML format. The timed text track's mime type must be "application/ttml+xml".
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

The returned MLTTMLData structure is valid only in the callback's context.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLMediaPlayerResetAsync

MLResult MLMediaPlayerResetAsync(
MLHandle media_player
)

Resets the Media Player to its uninitialized state asynchronously.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully launched MediaPlayer reset operation asynchronously. For result, poll for MLMediaPlayerPollingStateFlag_HasResetCompleted or use the 'on_reset_complete' callback if already set.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state. This method can be called anytime except when in 'preparing async'.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None

This method is asynchronous and will return immediately. After invocation, you will have to initialize it again by setting the data source and calling prepare() or prepareAsync().

A successful reset result can be obtained either by registering the 'on_reset_complete' callback (see MLMediaPlayerSetEventCallbacksEx) or by polling for the 'MLMediaPlayerPollingStateFlag_HasResetCompleted' flag when calling MLMediaPlayerPollStates().

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLMediaPlayerGetMetrics

MLResult MLMediaPlayerGetMetrics(
MLHandle media_player,
MLMediaPlayerMetrics * out_metrics
)

Retrieves metrics recorded on the MediaPlayer.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLMediaPlayerMetrics *out_metricsSee MLMediaPlayerMetrics.

Returns

MLResultMLResult_InvalidParamFailed due to an invalid parameter.
MLResultMLResult_OkSuccessfully received metrics.
MLResultMLResult_UnspecifiedFailureFailed due to an unknown error.
MLResultMLMediaGenericResult_InvalidOperationFailed because method was called in the wrong state.
MLResultMLMediaGenericResult_NoInitFailed because MediaPlayer was not properly initialized.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

MLMediaPlayerSetSurface

MLResult MLMediaPlayerSetSurface(
MLHandle media_player,
MLHandle surface
)

Sets the Native surface to be used as the sink for displaying the video portion of the media.

Parameters

MLHandlemedia_playerHandle to the MediaPlayer instance.
MLHandlesurfaceHandle to the MLNativeSurface object.

Returns

MLResultMLResult_InvalidParamPassed media_player or the surface handle was not found.
MLResultMLResult_OkSuccessfully set output surface.
MLResultMLResult_UnspecifiedFailureInternal error.
MLResultMLMediaGenericResult_InvalidOperationMethod was called from the wrong state.
MLResultMLMediaGenericResult_NoInitMediaPlayer was not properly built or initialized.

Required Permissions:

  • None

The surface should be created by MLNativeSurfaceCreate(). When called, this method should be called after one of the MLMediaPlayerSetDataSource() API and before MLMediaPlayerPrepare() or MLMediaPlayerPrepareAsync() Not calling this method or calling this with surface as ML_INVALID_HANDLE will result in only the audio track being played.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLMediaStreamSourceCreate

MLResult MLMediaStreamSourceCreate(
MLMediaStreamSourceOnBufferAvailable on_buffer_available,
void * context,
MLHandle * out_handle
)

Create a new MediaStreamSource object.

Parameters

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


MLMediaStreamSourceDestroy

MLResult MLMediaStreamSourceDestroy(
MLHandle media_stream_source
)

Destroy a MediaStreamSource object.

Parameters

MLHandlemedia_stream_sourceMLHandle to the MediaStreamSource 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.


MLMediaStreamSourceGetBuffer

MLResult MLMediaStreamSourceGetBuffer(
MLHandle media_stream_source,
size_t * out_id,
uint8_t ** out_ptr,
size_t * out_size
)

Get a buffer where data can be written.

Parameters

MLHandlemedia_stream_sourceMLHandle as returned by MLMediaStreamSourceCreate().
size_t *out_idAn opaque ID that should be passed to MLMediaStreamSourcePushBuffer().
uint8_t **out_ptrThe location where to write data.
size_t *out_sizeMaximum bytes that can be written in out_ptr.

Returns

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

Required Permissions:

  • None

If a buffer is available, true is returned and out_id, out_ptr and out_size are set. Application can then write up to out_size bytes into out_ptr and push that data using MLMediaStreamSourcePushBuffer().

If no buffer is available, false is returned and application should wait for MLMediaStreamSourceOnBufferAvailable() to be called before retrying.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaStreamSourcePushBuffer

MLResult MLMediaStreamSourcePushBuffer(
MLHandle media_stream_source,
size_t id,
size_t size
)

Push a buffer.

Parameters

MLHandlemedia_stream_sourceMLHandle as returned by MLMediaStreamSourceCreate().
size_tidThe ID of the buffer as given by MLMediaStreamSourceGetBuffer().
size_tsizeThe number of bytes actually written in the buffer.

Returns

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

Required Permissions:

  • None

Queue a buffer acquired from MLMediaStreamSourceGetBuffer() once data has been written.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaStreamSourcePushEOS

MLResult MLMediaStreamSourcePushEOS(
MLHandle media_stream_source
)

Push End-Of-Stream event.

Parameters

MLHandlemedia_stream_sourceMLHandle as returned by MLMediaStreamSourceCreate().

Returns

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

Required Permissions:

  • None

Signal that the end of stream is reached and no more data will be pushed.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLNativeSurfaceConfigInit

static inline void MLNativeSurfaceConfigInit(
MLNativeSurfaceConfig * inout_config_values
)

Initializes MLNativeSurfaceConfig with default values.

Parameters

MLNativeSurfaceConfig *inout_config_valuesMLNativeSurfaceConfig structure defined by MLNativeSurfaceConfig that needs to be initialized.

MLNativeSurfaceOnFrameAvailableCallbackInit

static inline void MLNativeSurfaceOnFrameAvailableCallbackInit(
MLNativeSurfaceOnFrameAvailableCallback * inout_callbacks
)

Initializes MLNativeSurfaceOnFrameAvailableCallback with default values.

Parameters

MLNativeSurfaceOnFrameAvailableCallback *inout_callbacksMLNativeSurfaceOnFrameAvailableCallback Callback structure defined by MLNativeSurfaceOnFrameAvailableCallback that needs to be initialized.
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLNativeSurfaceCreate

MLResult MLNativeSurfaceCreate(
const MLNativeSurfaceConfig * config_values,
MLHandle * out_handle
)

Create a new NativeSurface.

Parameters

const MLNativeSurfaceConfig *config_valuesConfiguration values for creating the native surface, refer MLNativeSurfaceConfig for more details.
MLHandle *out_handleUpon successful return will point to handle to the created NativeSurface. Or else, it will point to ML_INVALID_HANDLE.

Returns

MLResultMLResult_AllocFailedFailed to allocate memory for surface.
MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkNativeSurface object was created successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

The NativeSurface created through this API should be released using MLNativeSurfaceRelease once done using it.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLNativeSurfaceRelease

MLResult MLNativeSurfaceRelease(
MLHandle handle
)

Release a NativeSurface.

Parameters

MLHandlehandleMLHandle to the NativeSurface.

Returns

MLResultMLResult_InvalidParamNativeSurface object is invalid.
MLResultMLResult_OkNativeSurface object was successfully released.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLNativeSurfaceGetNativeWindow

MLResult MLNativeSurfaceGetNativeWindow(
MLHandle handle,
MLHandle * out_native_window,
int32_t * out_format
)

Gets an implementation of NativeWindow that feeds graphic buffers into MLNativeSurface.

Parameters

MLHandlehandleMLHandle to the MLNativeSurface instance. This handle can be:

* Surface created on an Encoder using MLMediaCodecCreateInputSurface. * The output surface created using MLNativeSurfaceCreate. * The output surface created using MLNativeSurfaceTextureCreate. | | MLHandle |out_native_window|Native window as MLHandle on success. | | int32_t |out_format|Native window format on success and for valid pointer, which will be used as EGL_NATIVE_VISUAL_ID.|

Returns

MLResultMLResult_InvalidParamNativeSurface object is invalid or out_native_window is NULL.
MLResultMLResult_OkNative window is successfully retrieved.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

This function returns the platform-dependent native window typically used by Graphics API or HW decoders to render frames.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLNativeSurfaceReleaseNativeWindow

MLResult MLNativeSurfaceReleaseNativeWindow(
MLHandle handle,
MLHandle native_window
)

Releases NativeWindow previously acquired by MLNativeSurfaceGetNativeWindow.

Parameters

MLHandlehandleMLHandle to the MLNativeSurface instance.
MLHandlenative_windowNative window handle acquired through MLNativeSurfaceGetNativeWindow.

Returns

MLResultMLResult_InvalidParamNativeSurface or NativeWindow object is invalid.
MLResultMLResult_OkNative window is successfully released.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLNativeSurfaceAcquireNextAvailableFrame

MLResult MLNativeSurfaceAcquireNextAvailableFrame(
MLHandle handle,
MLHandle * out_native_buffer
)

Consume next available buffer.

Parameters

MLHandlehandleMLHandle to the MLNativeSurface instance.
MLHandle *out_native_bufferA pointer to the acquired native buffer of the frame. When buffer is not required anymore, caller must call MLNativeSurfaceReleaseFrame() with this nativeBuffer handle to free up queuing space for incoming buffers.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkNext available frame is acquired successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.
MLResultMLMediaGenericResult_NotEnoughDataNative buffer is not available yet to acquire.

Required Permissions:

  • None

Note: This function is non-blocking and should only be called from the rendering thread after #on_frame_available callback has been fired.

Note: The returned buffer's color format is multi-planar YUV420. Since our underlying hardware interops do not support multiplanar formats, advanced texture features like mipmaping, anisotropic filtering and MSAA will not work on those returned buffers. If such advanced texturing features are required, one has to acquire the YUV buffers as usual and render to an RGB texture and only then, will one be able to enable hardware optimization for such advanced texture features.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLNativeSurfaceAcquireHardwareBufferFromNativeBuffer

MLResult MLNativeSurfaceAcquireHardwareBufferFromNativeBuffer(
MLHandle handle,
MLHandle native_buffer,
struct AHardwareBuffer ** out_hardware_buffer,
uint32_t * out_width,
uint32_t * out_height
)

Acquire an AHardwareBuffer* from a native buffer handle.

Parameters

MLHandlehandleMLHandle to the MLNativeSurface instance. Pass ML_INVALID_HANDLE when using with native buffers acquired without a MLNativeSurface, like in the case of ml_webview api.
MLHandlenative_bufferThe native buffer handle acquired from a MLNativeSurfaceAcquireNextAvailableFrame call.
struct AHardwareBuffer **out_hardware_bufferThe AHardwareBuffer pointer to the imported surface.
uint32_t *out_widthWidth of the imported surface.
uint32_t *out_heightHeight of the imported surface.

Returns

MLResultMLResult_InvalidParamImport was not performed due to an invalid parameter.
MLResultMLResult_OkSurface was acquired successfully.
MLResultMLResult_UnspecifiedFailureImport was not performed due to an unknown error.

Required Permissions:

  • None

The AHardwareBuffer* can be used with the Vulkan extension VK_ANDROID_external_memory_android_hardware_buffer to get the hardware buffer format properties, which can then be used to bind this hardware buffer to a VkImage. Caller is responsible for releasing the AHardwareBuffer by calling AHardwareBuffer_release() after its usage.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLNativeSurfaceReleaseFrame

MLResult MLNativeSurfaceReleaseFrame(
MLHandle handle,
MLHandle native_buffer
)

Release a native buffer previously acquired.

Parameters

MLHandlehandleMLHandle to the MLNativeSurface instance.
MLHandlenative_bufferThe native buffer for the frame to release.

Returns

MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkFrame 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:

  • 20

MLNativeSurfaceGetFrameTransformationMatrix

MLResult MLNativeSurfaceGetFrameTransformationMatrix(
MLHandle handle,
float out_mtx[16]
)

Retrieves the 4x4 texture coordinate transform matrix associated with the last acquired Frame.

Parameters

MLHandlehandleMLHandle to the MLNativeSurface instance.
floatout_mtxA pointer to an array of 16 floats that will receive retrieved transformation matrix.

Required Permissions:

  • None

This transform matrix maps 2D homogeneous texture coordinates of the form (s, t, 0, 1) with s and t in the inclusive range [0, 1] to the texture coordinate that should be used to sample that location from the texture. Sampling the texture outside of the range of this transform is undefined.

This transform is necessary to compensate for transforms that the stream content producer may implicitly apply to the content. By forcing users of a GLConsumer to apply this transform we avoid performing an extra copy of the data that would be needed to hide the transform from the user.

The matrix is stored in column-major order.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

Return:

  • MLResult_InvalidParam One of the parameters is invalid.
  • MLResult_Ok Transformation matrix was returned.

API Level:

  • 20

MLNativeSurfaceGetFrameTimestamp

MLResult MLNativeSurfaceGetFrameTimestamp(
MLHandle handle,
int64_t * out_timestamp_ns
)

Retrieves the timestamp associated with the last acquired frame. The timestamp is in nanoseconds, and is monotonically increasing from beginning of the playback. Its other semantics (zero point, etc) are codec-dependent and should be documented by the codec vendor.

Parameters

MLHandlehandleMLHandle to the MLNativeSurface instance.
int64_t *out_timestamp_nsA pointer to user variable for storing retrieved timestamp.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

Return:

  • MLResult_InvalidParam One of the parameters is invalid.
  • MLResult_Ok Timestamp was returned.

API Level:

  • 20

MLNativeSurfaceGetFrameQueueBufferTimestamp

MLResult MLNativeSurfaceGetFrameQueueBufferTimestamp(
MLHandle handle,
int64_t * out_timestamp_ns
)

Retrieves the QueueBuffer timestamp associated with the last acquired Frame This timestamp is for profiling purposes only and corresponds to the time when this frame was queued by internal Codec's producer code. The timestamp is in nanoseconds, and is monotonically increasing from beginning of playback. Its other semantics (zero point, etc) are codec-dependent and should by documented by the codec vendor.

Parameters

MLHandlehandleMLHandle to the MLNativeSurface instance.
int64_t *out_timestamp_nsA pointer to user variable for storing retrieved timestamp.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

Return:

  • MLResult_InvalidParam One of the parameters is invalid.
  • MLResult_Ok Timestamp was returned.

API Level:

  • 20

MLNativeSurfaceGetFrameNumber

MLResult MLNativeSurfaceGetFrameNumber(
MLHandle handle,
uint64_t * out_number
)

Retrieves the last acquired frame number. The frame number is an incrementing counter set to 0 at Codec configuration time.

Parameters

MLHandlehandleMLHandle to the MLNativeSurface instance.
uint64_t *out_numberA pointer to user variable for storing retrieved frame number.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

Return:

  • MLResult_InvalidParam One of the parameters is invalid.
  • MLResult_Ok Frame number was returned.

API Level:

  • 20

MLNativeSurfaceGetFrameCropRect

MLResult MLNativeSurfaceGetFrameCropRect(
MLHandle handle,
MLRecti * out_crop_rect
)

Retrieves the cropping rectangle of the current frame/buffer.

Parameters

MLHandlehandleMLHandle to the MLNativeSurface instance.
MLRecti *out_crop_rectA pointer to user variable for storing retrieved Crop.

Required Permissions:

  • None

The Frame crop is returned as {left, bottom, width, height}.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

Return:

  • MLResult_InvalidParam One of the parameters is invalid.
  • MLResult_Ok Frame Crop was returned.

API Level:

  • 20

MLNativeSurfaceSetOnFrameAvailableCallback

MLResult MLNativeSurfaceSetOnFrameAvailableCallback(
MLHandle handle,
const MLNativeSurfaceOnFrameAvailableCallback * callback,
void * user_data
)

Set callback to notify client when a frame is available.

Parameters

MLHandlehandleMLHandle to the NativeSurface.
const MLNativeSurfaceOnFrameAvailableCallback *callbackA MLNativeSurfaceOnFrameAvailableCallback function.
void *user_dataPointer to user payload data.

Returns

MLResultMLResult_InvalidParamMLNativeSurface object is invalid.
MLResultMLResult_OkCallback 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

MLNativeSurfaceTextureCreate

MLResult MLNativeSurfaceTextureCreate(
const MLNativeSurfaceConfig * config_values,
MLNativeSurfaceTextureBackend backend,
MLHandle * out_handle
)

Create a new NativeSurfaceTexture.

Parameters

const MLNativeSurfaceConfig *config_valuesConfiguration values for creating the native surface, refer MLNativeSurfaceConfig for more details.
MLNativeSurfaceTextureBackendbackendThe graphic backend to use.
MLHandle *out_handleUpon successful return will point to handle to the created NativeSurfaceTexture. Or else, it will point to ML_INVALID_HANDLE.

Returns

MLResultMLResult_AllocFailedFailed to allocate memory for surface.
MLResultMLResult_InvalidParamOne of the parameters is invalid.
MLResultMLResult_OkNativeSurfaceTexture 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:

  • 20

MLNativeSurfaceTextureRelease

MLResult MLNativeSurfaceTextureRelease(
MLHandle handle
)

Release a NativeSurfaceTexture.

Parameters

MLHandlehandleMLHandle to the NativeSurfaceTexture.

Returns

MLResultMLResult_InvalidParamNativeSurfaceTexture object is invalid.
MLResultMLResult_OkNativeSurfaceTexture object was successfully released.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLNativeSurfaceTextureUpdateTexImage

MLResult MLNativeSurfaceTextureUpdateTexImage(
MLHandle handle
)

Update the texture image to the most recent frame from the image stream.

Parameters

MLHandlehandleMLHandle to the NativeSurfaceTexture.

Returns

MLResultMLResult_InvalidParamNativeSurfaceTexture object is invalid.
MLResultMLResult_Okthe texture was updated successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

May only be called on the thread with the graphic context that contains the texture object.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLNativeSurfaceTextureAttachToGLContext

MLResult MLNativeSurfaceTextureAttachToGLContext(
MLHandle handle,
uint32_t texture_id
)

Attach the NativeSurfaceTexture to the graphic context that is current on the calling thread.

Parameters

MLHandlehandleMLHandle to the NativeSurfaceTexture.
uint32_ttexture_idThe graphic texture object id.

Returns

MLResultMLResult_InvalidParamNativeSurfaceTexture object is invalid.
MLResultMLResult_Okthe texture was detached successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLNativeSurfaceTextureDetachFromGLContext

MLResult MLNativeSurfaceTextureDetachFromGLContext(
MLHandle handle
)

Detach the NativeSurfaceTexture from the graphic context that owns the graphic texture object.

Parameters

MLHandlehandleMLHandle to the NativeSurfaceTexture.

Returns

MLResultMLResult_InvalidParamNativeSurfaceTexture object is invalid.
MLResultMLResult_Okthe texture was detached successfully.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None

If called on the thread with graphic context that contains the attached texture object, said texture will be deleted.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLNativeSurfaceTextureGetTransformationMatrix

MLResult MLNativeSurfaceTextureGetTransformationMatrix(
MLHandle handle,
float out_matrix[16]
)

Retrieve the 4x4 texture coordinate transform matrix associated with the texture image set by the most recent call to MLNativeSurfaceTextureUpdateTexImage.

Parameters

MLHandlehandleMLHandle to the NativeSurfaceTexture.
floatout_matrixA 4x4 matrix stored in column-major order as 16 consecutive values.

Returns

MLResultMLResult_InvalidParamNativeSurfaceTexture object is invalid.
MLResultMLResult_OkOperation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLNativeSurfaceTextureGetTimestamp

MLResult MLNativeSurfaceTextureGetTimestamp(
MLHandle handle,
int64_t * out_timestamp_ns
)

Retrieve the timestamp associated with the texture image set by the most recent call to MLNativeSurfaceTextureUpdateTexImage.

Parameters

MLHandlehandleMLHandle to the NativeSurfaceTexture.
int64_t *out_timestamp_nsThe timestamp in nanoseconds.

Returns

MLResultMLResult_InvalidParamNativeSurfaceTexture object is invalid.
MLResultMLResult_OkOperation was successful.
MLResultMLResult_UnspecifiedFailureThe operation failed with an unspecified error.

Required Permissions:

  • None
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

MLNativeSurfaceTextureSetOnFrameAvailableCallback

MLResult MLNativeSurfaceTextureSetOnFrameAvailableCallback(
MLHandle handle,
const MLNativeSurfaceOnFrameAvailableCallback * callback,
void * user_data
)

Set callback to notify client when a frame is available.

Parameters

MLHandlehandleMLHandle to the NativeSurfaceTexture.
const MLNativeSurfaceOnFrameAvailableCallback *callbackA MLNativeSurfaceTextureOnFrameAvailableCallback function.
void *user_dataPointer to user payload data.

Returns

MLResultMLResult_InvalidParamNativeSurfaceTexture object is invalid.
MLResultMLResult_OkCallback 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

Attributes Documentation

MLMediaDRMProperty

const typedef char * MLMediaDRMProperty;

MLMediaFormatKey

const typedef char * MLMediaFormatKey;

MLAudioChannelOutMono

const int32_t MLAudioChannelOutMono = MLAudioChannelOutMask_FrontLeft;

Definition of some of the known Channel Layouts.

Channel Layout for Mono.


MLAudioChannelOutStereo

const int32_t MLAudioChannelOutStereo = (MLAudioChannelOutMask_FrontLeft | MLAudioChannelOutMask_FrontRight);

Channel Layout for Stereo.


MLAudioChannelOutQuad

const int32_t MLAudioChannelOutQuad = (MLAudioChannelOutMask_FrontLeft | MLAudioChannelOutMask_FrontRight |
MLAudioChannelOutMask_BackLeft | MLAudioChannelOutMask_BackRight);

Channel Layout for Quad.


MLAudioChannelOutSurround

const int32_t MLAudioChannelOutSurround = (MLAudioChannelOutMask_FrontLeft | MLAudioChannelOutMask_FrontRight |
MLAudioChannelOutMask_FrontCenter | MLAudioChannelOutMask_BackCenter);

Channel Layout for Surround.


MLAudioChannelOut5Point1

const int32_t MLAudioChannelOut5Point1 = (MLAudioChannelOutMask_FrontLeft | MLAudioChannelOutMask_FrontRight |
MLAudioChannelOutMask_FrontCenter | MLAudioChannelOutMask_LowFrequency |
MLAudioChannelOutMask_BackLeft | MLAudioChannelOutMask_BackRight);

Channel Layout for 5.1.


MLAudioChannelOut7Point1

const int32_t MLAudioChannelOut7Point1 = (MLAudioChannelOutMask_FrontLeft | MLAudioChannelOutMask_FrontRight |
MLAudioChannelOutMask_FrontCenter | MLAudioChannelOutMask_LowFrequency |
MLAudioChannelOutMask_BackLeft | MLAudioChannelOutMask_BackRight |
MLAudioChannelOutMask_FrontLeftOfCenter |
MLAudioChannelOutMask_FrontRightOfCenter);

Channel Layout for 7.1.


MLAudioChannelOut7Point1Surround

const int32_t MLAudioChannelOut7Point1Surround = (MLAudioChannelOutMask_FrontLeft | MLAudioChannelOutMask_FrontCenter |
MLAudioChannelOutMask_FrontRight |
MLAudioChannelOutMask_SideLeft | MLAudioChannelOutMask_SideRight |
MLAudioChannelOutMask_BackLeft | MLAudioChannelOutMask_BackRight |
MLAudioChannelOutMask_LowFrequency);

Channel Layout for 7.1 Surround.


MLMediaDRMProperty_Vendor

MLMediaDRMProperty MLMediaDRMProperty_Vendor;

String property name: identifies the maker of the DRM engine plugin.


MLMediaDRMProperty_Version

MLMediaDRMProperty MLMediaDRMProperty_Version;

String property name: identifies the version of the DRM engine plugin.


MLMediaDRMProperty_Description

MLMediaDRMProperty MLMediaDRMProperty_Description;

String property name: describes the DRM engine plugin.


MLMediaDRMProperty_Algorithms

MLMediaDRMProperty MLMediaDRMProperty_Algorithms;

String property name: a comma-separated list of cipher and mac algorithms supported by #CryptoSession. The list may be empty if the DRM engine plugin does not support #CryptoSession operations.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaDRMProperty_DeviceUniqueID

MLMediaDRMProperty MLMediaDRMProperty_DeviceUniqueID;

Byte array property name: the device unique identifier is established during device provisioning and provides a means of uniquely identifying each device.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_AAC_Encoded_Target_Level

MLMediaFormatKey MLMediaFormat_Key_AAC_Encoded_Target_Level;

The format of media data (video/audio) is specified as key/value pairs. Below is a list of keys used to set/obtain format values.

A key describing the target reference level that was assumed at the encoder for calculation of attenuation gains for clipping prevention.

If it is known, this information can be provided as an integer value between 0 and 127, which is calculated as -4 * Encoded Target Level in LKFS. If the Encoded Target Level is unknown, the value can be set to -1.

The default value is -1 (unknown).

The value is ignored when heavy compression is used (see {}). This key is only used during decoding.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_AAC_DRC_Boost_Factor

MLMediaFormatKey MLMediaFormat_Key_AAC_DRC_Boost_Factor;

A key describing the boost factor allowing to adapt the dynamics of the output to the actual listening requirements. This relies on DRC gain sequences that can be transmitted in the encoded bitstream to be able to reduce the dynamics of the output signal upon request. This factor enables the user to select how much of the gains are applied.

Positive gains (boost) and negative gains (attenuation, see {}) can be controlled separately for a better match to different use-cases. Typically, attenuation gains are sent for loud signal segments, and boost gains are sent for soft signal segments. If the output is listened to in a noisy environment, for example, the boost factor is used to enable the positive gains, i.e. to amplify soft signal segments beyond the noise floor. But for listening late at night, the attenuation factor is used to enable the negative gains, to prevent loud signal from surprising the listener. In applications which generally need a low dynamic range, both the boost factor and the attenuation factor are used to enable all DRC gains.

In order to prevent clipping, it is also recommended to apply the attenuation gains in case of a downmix and/or loudness normalization to high target reference levels.

Both the boost and the attenuation factor parameters are given as integer values between 0 and 127, representing the range of the factor of 0 (i.e. don't apply) to 1 (i.e. fully apply boost/attenuation gains respectively).

The default value is 127 (fully apply boost DRC gains).

This key is only used during decoding.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_AAC_DRC_Attenuation_Factor

MLMediaFormatKey MLMediaFormat_Key_AAC_DRC_Attenuation_Factor;

A key describing the attenuation factor allowing to adapt the dynamics of the output to the actual listening requirements.

See {} for a description of the role of this attenuation factor and the value range. The default value is 127 (fully apply attenuation DRC gains).

This key is only used during decoding.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_AAC_DRC_Heavy_Compression

MLMediaFormatKey MLMediaFormat_Key_AAC_DRC_Heavy_Compression;

A key describing the selection of the heavy compression profile for DRC.

Two separate DRC gain sequences can be transmitted in one bitstream: MPEG-4 DRC light compression, and DVB-specific heavy compression. When selecting the application of the heavy compression, one of the sequences is selected:

  • 0 enables light compression,
  • 1 enables heavy compression instead.

Note that only light compression offers the features of scaling of DRC gains (see {} and { #MLMediaFormat_Key_AAC_DRC_Attenuation_Factor} for the boost and attenuation factors, and frequency-selective (multiband) DRC. Light compression usually contains clipping prevention for stereo downmixing while heavy compression, if additionally provided in the bitstream, is usually stronger, and contains clipping prevention for stereo and mono downmixing. The default is 1 (heavy compression).

This key is only used during decoding.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_AAC_DRC_Target_Reference_Level

MLMediaFormatKey MLMediaFormat_Key_AAC_DRC_Target_Reference_Level;

A key describing a gain to be applied so that the output loudness matches the Target Reference Level. This is typically used to normalize loudness across program items.

The gain is derived as the difference between the Target Reference Level and the Program Reference Level. The latter can be given in the bitstream and indicates the actual loudness value of the program item.

The Target Reference Level controls loudness normalization for both MPEG-4 DRC and MPEG-D DRC.

The value is given as an integer value between 40 and 127, and is calculated as -4 * Target Reference Level in LKFS. Therefore, it represents the range of -10 to -31.75 LKFS.

The default value on mobile devices is 64 (-16 LKFS).

This key is only used during decoding.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_AAC_Max_Output_Channel_Count

MLMediaFormatKey MLMediaFormat_Key_AAC_Max_Output_Channel_Count;

A key describing the maximum number of channels that can be output by the AAC decoder.

By default, the decoder will output the same number of channels as present in the encoded stream, if supported. Set this value to limit the number of output channels, and use the downmix information in the stream, if available.

Values larger than the number of channels in the content to decode are ignored.

This key is only used during decoding.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_AAC_Profile

MLMediaFormatKey MLMediaFormat_Key_AAC_Profile;

A key describing the AAC profile to be used (AAC audio formats only).

Constants are declared in MLMediaCodecListGetSupportedProfileLevels.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_AAC_SBR_Mode

MLMediaFormatKey MLMediaFormat_Key_AAC_SBR_Mode;

A key describing the AAC SBR mode to be used (AAC audio formats only).

The associated value is an integer and can be set to following values:

  • 0 - no SBR should be applied.
  • 1 - single rate SBR.
  • 2 - double rate SBR.

Note: If this key is not defined the default SRB mode for the desired AAC profile will be used.

This key is only used during encoding.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Bit_Rate

MLMediaFormatKey MLMediaFormat_Key_Bit_Rate;

A key describing the average bitrate in bits/sec.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Bit_Rate_Mode

MLMediaFormatKey MLMediaFormat_Key_Bit_Rate_Mode;

A key describing the desired bitrate mode to be used by an encoder.

Constants are declared in MLMediaCodecBitrateMode.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Capture_Rate

MLMediaFormatKey MLMediaFormat_Key_Capture_Rate;

A key describing the capture rate of a video format in frames/sec.

When capture rate is different than the frame rate, it means that the video is acquired at a different rate than the playback, which produces slow motion or timelapse effect during playback. Application can use the value of this key to tell the relative speed ratio between capture and playback rates when the video was recorded.

The associated value is an integer or a float.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Channel_Count

MLMediaFormatKey MLMediaFormat_Key_Channel_Count;

A key describing the number of channels in an audio format.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Channel_Mask

MLMediaFormatKey MLMediaFormat_Key_Channel_Mask;

A key describing the channel composition of audio content.

This mask is composed of bits drawn from channel mask definitions in android.media.AudioFormat.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Color_Format

MLMediaFormatKey MLMediaFormat_Key_Color_Format;

A key describing the color format of the content in a video format.

Constants are declared in MLMediaCodecBitrateMode.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Duration

MLMediaFormatKey MLMediaFormat_Key_Duration;

A key describing the duration (in microseconds) of the content.

The associated value is a long.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_FLAC_Compression_Level

MLMediaFormatKey MLMediaFormat_Key_FLAC_Compression_Level;

A key describing the FLAC compression level to be used (FLAC audio format only).

The associated value is an integer ranging from 0 (fastest, least compression) to 8 (slowest, most compression).

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Frame_Rate

MLMediaFormatKey MLMediaFormat_Key_Frame_Rate;

A key describing the frame rate of a video format in frames/sec.

The associated value is normally an integer when the value is used by the platform, but video codecs also accept float configuration values. Specifically, MLMediaExtractor::getTrackFormat provides an integer value corresponding to the frame rate information of the track if specified and non-zero. Otherwise, this key is not present. MLMediaCodec::configure accepts both float and integer values. This represents the desired operating frame rate if the {} is not present and { #MLMediaFormat_Key_Priority} is 0 (realtime). For video encoders this value corresponds to the intended frame rate, although encoders are expected to support variable frame rate based on MLMediaCodec.BufferInfo#presentationTimeUs buffer timestamp. This key is not used in the MLMediaCodec#getInputFormat input/ MLMediaCodec#getOutputFormat output formats, nor by MLMediaMuxer#addTrack.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Height

MLMediaFormatKey MLMediaFormat_Key_Height;

A key describing the height of the content in a video format.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_I_Frame_Interval

MLMediaFormatKey MLMediaFormat_Key_I_Frame_Interval;

A key describing the frequency of key frames expressed in seconds between key frames.

This key is used by video encoders. A negative value means no key frames are requested after the first frame. A zero value means a stream containing all key frames is requested.

Most video encoders will convert this value of the number of non-key-frames between key-frames, using the {frame rate} information; therefore, if the actual frame rate differs (e.g. input frames are dropped or the frame rate changes), the time interval between key frames will not be the configured value. The associated value is an integer (or float since android.os.Build.VERSION_CODES::N_MR1 ).

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Intra_Refresh_Period

MLMediaFormatKey MLMediaFormat_Key_Intra_Refresh_Period;

An optional key describing the period of intra refresh in frames.

This is an optional parameter that applies only to video encoders. If encoder supports it (MLMediaCodecListIsIntraRefreshSupported), the whole frame is completely refreshed after the specified period. Also for each frame, a fix subset of macroblocks must be intra coded which leads to a more constant bitrate than inserting a key frame. This key is recommended for video streaming applications as it provides low-delay and good error-resilience. This key is ignored if the video encoder does not support the intra refresh feature. Use the output format to verify that this feature was enabled.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Is_ADTS

MLMediaFormatKey MLMediaFormat_Key_Is_ADTS;

A key mapping to a value of 1 if the content is AAC audio and audio frames are prefixed with an ADTS header.

The associated value is an integer (0 or 1). This key is only supported when decoding content, it cannot be used to configure an encoder to emit ADTS output.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Is_Autoselect

MLMediaFormatKey MLMediaFormat_Key_Is_Autoselect;

A key for boolean AUTOSELECT behavior for the track. Tracks with AUTOSELECT=true are considered when automatically selecting a track without specific user choice, based on the current locale. This is currently only used for subtitle tracks, when the user selected 'Default' for the captioning locale. The associated value is an integer, where non-0 means TRUE. This is an optional field; if not specified, AUTOSELECT defaults to TRUE.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Is_Default

MLMediaFormatKey MLMediaFormat_Key_Is_Default;

A key for boolean DEFAULT behavior for the track. The track with DEFAULT=true is selected in the absence of a specific user choice.

This is currently used in two scenarios:

  1. For subtitle tracks, when the user selected 'Default' for the captioning locale.
  2. For a MIMETYPE_IMAGE_ANDROID_HEIC track, indicating the image is the primary item in the file.

The associated value is an integer, where non-0 means TRUE. This is an optional field; if not specified, DEFAULT is considered to be FALSE.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Is_Forced_Subtitle

MLMediaFormatKey MLMediaFormat_Key_Is_Forced_Subtitle;

A key for the FORCED field for subtitle tracks.

True if it is a forced subtitle track. Forced subtitle tracks are essential for the content and are shown even when the user turns off Captions. They are used for example to translate foreign/alien dialogs or signs. The associated value is an integer, where non-0 means TRUE. This is an optional field; if not specified, FORCED defaults to FALSE.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Language

MLMediaFormatKey MLMediaFormat_Key_Language;

A key describing the language of the content, using either ISO 639-1 or 639-2/T codes.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Max_Height

MLMediaFormatKey MLMediaFormat_Key_Max_Height;

A key describing the maximum expected height of the content in a video decoder format, in case there are resolution changes in the video content.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Max_Input_Size

MLMediaFormatKey MLMediaFormat_Key_Max_Input_Size;

Described by this MediaFormat.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Max_Width

MLMediaFormatKey MLMediaFormat_Key_Max_Width;

A key describing the maximum expected width of the content in a video decoder format, in case there are resolution changes in the video content.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Mime

MLMediaFormatKey MLMediaFormat_Key_Mime;

A key describing the mime type of the MediaFormat.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_PCM_Encoding

MLMediaFormatKey MLMediaFormat_Key_PCM_Encoding;

A key describing the raw audio sample encoding/format.

The associated value is an integer, using one of the AudioFormat.ENCODINGPCM values.

This is an optional key for audio decoders and encoders specifying the desired raw audio sample format during MLMediaCodec::configure MediaCodec.configure() call. Use MLMediaCodec::getInputFormat MediaCodec.getInput / MLMediaCodec::getOutputFormatOutputFormat() to confirm the actual format. For the PCM decoder this key specifies both input and output sample encodings.

This key is also used by MLMediaExtractor to specify the sample format of audio data, if it is specified.

If this key is missing, the raw audio sample format is signed 16-bit short.

The associated value is an integer with keys defined by MLMediaFormatAudioEncoding.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Push_Blank_Buffers_On_Stop

MLMediaFormatKey MLMediaFormat_Key_Push_Blank_Buffers_On_Stop;

If specified when configuring a video decoder rendering to a surface, causes the decoder to output "blank", i.e. black frames to the surface.

when stopped to clear out any previously displayed contents. The associated value is an integer of value 1.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Repeat_Previous_Frame_After

MLMediaFormatKey MLMediaFormat_Key_Repeat_Previous_Frame_After;

Applies only when configuring a video encoder in "surface-input" mode.

The associated value is a long and gives the time in microseconds after which the frame previously submitted to the encoder will be repeated (once) if no new frame became available since.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Sample_Rate

MLMediaFormatKey MLMediaFormat_Key_Sample_Rate;

A key describing the sample rate of an audio format.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Stride

MLMediaFormatKey MLMediaFormat_Key_Stride;

A key describing the stride of the video bytebuffer layout.

Stride (or row increment) is the difference between the index of a pixel and that of the pixel directly underneath. For YUV 420 formats, the stride corresponds to the Y plane; the stride of the U and V planes can be calculated based on the color format, though it is generally undefined and depends on the device and release. The associated value is an integer, representing the number of bytes.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Temporal_Layering

MLMediaFormatKey MLMediaFormat_Key_Temporal_Layering;

A key describing the temporal layering schema.

This is an optional parameter that applies only to video encoders. Use MediaCodec::getOutputFormat after MediaCodec::configure to query if the encoder supports the desired schema. Supported values are webrtc.vp8.N-layer, android.generic.N, android.generic.N+M and none, where N denotes the total number of non-bidirectional layers (which must be at least 1) and M denotes the total number of bidirectional layers (which must be non-negative).

android.generic.* schemas have been added in android.os.Build.VERSION_CODES::N_MR1.

The encoder may support fewer temporal layers, in which case the output format will contain the configured schema. If the encoder does not support temporal layering, the output format will not have an entry with this key. The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Width

MLMediaFormatKey MLMediaFormat_Key_Width;

A key describing the width of the content in a video format.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Crop_Left

MLMediaFormatKey MLMediaFormat_Key_Crop_Left;

The left-coordinate (x) of the crop rectangle.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Crop_Right

MLMediaFormatKey MLMediaFormat_Key_Crop_Right;

The right-coordinate (x) MINUS 1 of the crop rectangle.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Crop_Bottom

MLMediaFormatKey MLMediaFormat_Key_Crop_Bottom;

The bottom-coordinate (y) MINUS 1 of the crop rectangle.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Crop_Top

MLMediaFormatKey MLMediaFormat_Key_Crop_Top;

The top-coordinate (y) of the crop rectangle.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Operating_Rate

MLMediaFormatKey MLMediaFormat_Key_Operating_Rate;

A key describing the desired operating frame rate for video or sample rate for audio that the codec will need to operate at.

The associated value is an integer or a float representing frames-per-second or samples-per-second.

This is used for cases like high-speed/slow-motion video capture, where the video encoder format contains the target playback rate (e.g. 30fps), but the component must be able to handle the high operating capture rate (e.g. 240fps).

This rate will be used by codec for resource planning and setting the operating points.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Latency

MLMediaFormatKey MLMediaFormat_Key_Latency;

An optional key describing the desired encoder latency in frames.

parameter that applies only to video encoders. If encoder supports it, it should ouput at least one output frame after being queued the specified number of frames. This key is ignored if the video encoder does not support the latency feature. Use the output format to verify that this feature was enabled and the actual value used by the encoder.

If the key is not specified, the default latency will be implementation specific. The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Parameter_Video_Bitrate

MLMediaFormatKey MLMediaFormat_Key_Parameter_Video_Bitrate;

A key describing the desired video bitrate.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Parameter_Request_Sync_Frame

MLMediaFormatKey MLMediaFormat_Key_Parameter_Request_Sync_Frame;

Request that the encoder produce a sync frame "soon".

Provide an Integer with the value 0.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Parameter_Set_Suspend

MLMediaFormatKey MLMediaFormat_Key_Parameter_Set_Suspend;

Temporarily suspend/resume encoding of input data.

While suspended input data is effectively discarded instead of being fed into the encoder. This parameter really only makes sense to use with an encoder in "surface-input" mode, as the client code has no control over the input-side of the encoder in that case.

The value is an Integer object containing the value 1 to suspend or the value 0 to resume.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Parameter_Set_Suspend_Time

MLMediaFormatKey MLMediaFormat_Key_Parameter_Set_Suspend_Time;

When PARAMETER_KEY_SUSPEND is present, the client can also optionally use this key to specify the timestamp (in micro-second) at which the suspend/resume operation takes effect.

Note that the specified timestamp must be greater than or equal to the timestamp of any previously queued suspend/resume operations.

The value is a long int, indicating the timestamp to suspend/resume.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Parameter_Drop_Before

MLMediaFormatKey MLMediaFormat_Key_Parameter_Drop_Before;

A key describing the desired before which frames are to be skipped.

The associated value is a long int, indicating the timestamp (in microseconds) to be applied.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Parameter_Drop_After

MLMediaFormatKey MLMediaFormat_Key_Parameter_Drop_After;

A key describing the desired after which frames are to be skipped.

The associated value is a long int, indicating the timestamp (in microseconds) to be applied.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Parameter_Offset_Time

MLMediaFormatKey MLMediaFormat_Key_Parameter_Offset_Time;

Specify an offset (in micro-second) to be added on top of the timestamps onward.

A typical use case is to apply adjustment to the timestamps after a period of pause by the user. This parameter can only be used on an encoder in "surface-input" mode.

The value is a long int, indicating the timestamp offset to be applied.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Priority

MLMediaFormatKey MLMediaFormat_Key_Priority;

A key describing the desired codec priority.

The associated value can be one of the MLMediaCodecPriority enumeration. This is a hint used at codec configuration and resource planning - to understand the realtime requirements of the application; however, due to the nature of media components, performance is not guaranteed.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Max_B_Frames

MLMediaFormatKey MLMediaFormat_Key_Max_B_Frames;

A key describing the maximum number of B frames between I or P frames, to be used by a video encoder.

The associated value is an integer. The default value is 0, which means that no B frames are allowed. Note that non-zero value does not guarantee B frames; it's up to the encoder to decide.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Intra_Refresh_Mode

MLMediaFormatKey MLMediaFormat_Key_Intra_Refresh_Mode;

An optional key describing the mode of intra refresh in frames. The associated value is an integer.

This is an optional parameter that applies only to video encoders. If encoder supports it (MLMediaCodecListIsIntraRefreshSupported), the whole frame is completely refreshed after the specified period. Also for each frame, a fixed subset of macroblocks must be intra-coded which leads to a more constant bitrate than inserting a key frame. This key is recommended for video streaming applications as it provides low-delay and good error-resilience. This key is ignored if the video encoder does not support the intra refresh feature. Use the output format to verify that this feature was enabled.

The possible values are defined in MLMediaCodecIntraRefreshMode.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Intra_Refresh_CIR_Num

MLMediaFormatKey MLMediaFormat_Key_Intra_Refresh_CIR_Num;

Number of consecutive macroblocks to be coded as intra when CIR is enabled.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Intra_Refresh_AIR_Num

MLMediaFormatKey MLMediaFormat_Key_Intra_Refresh_AIR_Num;

Number of intra macroblocks to refresh in a frame when AIR is enabled.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Intra_Refresh_AIR_Ref

MLMediaFormatKey MLMediaFormat_Key_Intra_Refresh_AIR_Ref;

Number of times a motion marked macroblock has to be intra coded.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Profile

MLMediaFormatKey MLMediaFormat_Key_Profile;

A key describing the desired profile to be used by an encoder.

The associated value is an integer.

The supported profiles can be queries through MLMediaCodecListGetSupportedProfileLevels. The values are defined in MLMediaCodecProfileType enumeration. This key is used as a further hint when specifying a desired profile, and is only supported for codecs that specify a level. This key is ignored if the profile is not specified.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Level

MLMediaFormatKey MLMediaFormat_Key_Level;

A key describing the desired level to be used by an encoder.

The associated value is an integer.

The supported profiles can be queries through MLMediaCodecListGetSupportedProfileLevels. The values are defined in MLMediaCodecLevelType enumeration. This key is used as a further hint when specifying a desired profile, and is only supported for codecs that specify a level. This key is ignored if the level is not specified.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Prepend_Header_To_Sync_Frames

MLMediaFormatKey MLMediaFormat_Key_Prepend_Header_To_Sync_Frames;

An optional key describing whether encoders prepend headers to sync frames (e.g. SPS and PPS to IDR frames for H.264).

This is an optional parameter that applies only to video encoders. A video encoder may not support this feature; the component will fail to configure in that case. For other components, this key is ignored. The value is an integer, with 1 indicating to prepend headers to every sync frame, or 0 otherwise. The default value is 0.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Color_Range

MLMediaFormatKey MLMediaFormat_Key_Color_Range;

An optional key describing the range of the component values of the video content.

The associated value is an integer: 0 if unspecified, or one of the COLORRANGE values.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Color_Standard

MLMediaFormatKey MLMediaFormat_Key_Color_Standard;

An optional key describing the color primaries, white point and luminance factors for video content.

The associated value is an integer: 0 if unspecified, or one of the COLORSTANDARD values.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Color_Transfer

MLMediaFormatKey MLMediaFormat_Key_Color_Transfer;

An optional key describing the opto-electronic transfer function used for the video content.

The associated value is an integer: 0 if unspecified, or one of the COLORTRANSFER values.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_HDR_Static_Info

MLMediaFormatKey MLMediaFormat_Key_HDR_Static_Info;

An optional key describing the static metadata of HDR (high-dynamic-range) video content.

The associated value is a ByteBuffer. This buffer contains the raw contents of the Static Metadata Descriptor (including the descriptor ID) of an HDMI Dynamic Range and Mastering InfoFrame as defined by CTA-861.3. This key must be provided to video decoders for HDR video content unless this information is contained in the bitstream and the video decoder supports an HDR-capable profile. This key must be provided to video encoders for HDR video content.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_CSD

MLMediaFormatKey MLMediaFormat_Key_CSD;

A key describing the codec specific data.

Codec-specific data in the format is automatically submitted to the codec upon start(); you MUST NOT submit this data explicitly.

The associated value is an MLMediaFormatByteArray.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_CSD0

MLMediaFormatKey MLMediaFormat_Key_CSD0;

A key describing the codec specific data buffer #0.

Codec-specific data in the format is automatically submitted to the codec upon start(); you MUST NOT submit this data explicitly.

The associated value is an MLMediaFormatByteArray.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_CSD1

MLMediaFormatKey MLMediaFormat_Key_CSD1;

A key describing the codec specific data buffer #1.

Codec-specific data in the format is automatically submitted to the codec upon start(); you MUST NOT submit this data explicitly.

The associated value is an MLMediaFormatByteArray.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_CSD2

MLMediaFormatKey MLMediaFormat_Key_CSD2;

A key describing the codec specific data buffer #2.

Codec-specific data in the format is automatically submitted to the codec upon start(); you MUST NOT submit this data explicitly.

The associated value is an MLMediaFormatByteArray.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_CSD_Avc

MLMediaFormatKey MLMediaFormat_Key_CSD_Avc;

A key describing the codec specific data buffer for AVC (h.264).

Codec-specific data in the format is automatically submitted to the codec upon start(); you MUST NOT submit this data explicitly.

The associated value is an MLMediaFormatByteArray.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_CSD_Hevc

MLMediaFormatKey MLMediaFormat_Key_CSD_Hevc;

A key describing the codec specific data buffer for HEVC (h.265).

Codec-specific data in the format is automatically submitted to the codec upon start(); you MUST NOT submit this data explicitly.

The associated value is an MLMediaFormatByteArray.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Album

MLMediaFormatKey MLMediaFormat_Key_Album;

A key describing metadata - album title of the media.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Albumart

MLMediaFormatKey MLMediaFormat_Key_Albumart;

A key describing metadata. The artwork for the album of the media's original source as a Bitmap.

The associated value is an MLMediaFormatByteArray.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Albumartist

MLMediaFormatKey MLMediaFormat_Key_Albumartist;

A key describing metadata. The artist for the album of the media's original source.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Artist

MLMediaFormatKey MLMediaFormat_Key_Artist;

A key describing metadata. The artist of the media.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Audio_Presentation_Info

MLMediaFormatKey MLMediaFormat_Key_Audio_Presentation_Info;

A key describing metadata. The media presentation info.

The associated value is an MLMediaFormatByteArray.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Audio_Presentation_Presentation_Id

MLMediaFormatKey MLMediaFormat_Key_Audio_Presentation_Presentation_Id;

A key describing metadata. The media presentation Id.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Audio_Presentation_Program_Id

MLMediaFormatKey MLMediaFormat_Key_Audio_Presentation_Program_Id;

A key describing metadata. The media program Id.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Audio_Session_Id

MLMediaFormatKey MLMediaFormat_Key_Audio_Session_Id;

A key describing the audio session ID of the AudioTrack associated to a tunneled video codec.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

See: MLMediaCodecBitrateMode::FEATURE_TunneledPlayback


MLMediaFormat_Key_Author

MLMediaFormatKey MLMediaFormat_Key_Author;

A key describing metadata. The author of the media.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Bits_Per_Sample

MLMediaFormatKey MLMediaFormat_Key_Bits_Per_Sample;

Key representing media number of bits per sample.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Cdtracknumber

MLMediaFormatKey MLMediaFormat_Key_Cdtracknumber;

A key describing metadata. The cd track number.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Compilation

MLMediaFormatKey MLMediaFormat_Key_Compilation;

A key describing metadata. The media compilation.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Complexity

MLMediaFormatKey MLMediaFormat_Key_Complexity;

A key describing the encoding complexity.

The associated value is an integer. These values are device and codec specific, but lower values generally result in faster and/or less power-hungry encoding.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

See: MediaCodecInfo.EncoderCapabilities::getComplexityRange()


MLMediaFormat_Key_Composer

MLMediaFormatKey MLMediaFormat_Key_Composer;

A key describing metadata - composer of the media.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Create_Input_Surface_Suspended

MLMediaFormatKey MLMediaFormat_Key_Create_Input_Surface_Suspended;

If specified when configuring a video encoder that's in "surface-input" mode, it will instruct the encoder to put the surface source in suspended state when it's connected.

No video frames will be accepted until a resume operation (see MediaCodec::PARAMETER_KEY_SUSPEND ), optionally with timestamp specified via MediaCodec::PARAMETER_KEY_SUSPEND_TIME , is received.

The value is an integer, with 1 indicating to create with the surface source suspended, or 0 otherwise. The default value is 0.

If this key is not set or set to 0, the surface source will accept buffers as soon as it's connected to the encoder (although they may not be encoded immediately). This key can be used when the client wants to prepare the encoder session in advance, but do not want to accept buffers immediately.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Crypto_Default_Iv_Size

MLMediaFormatKey MLMediaFormat_Key_Crypto_Default_Iv_Size;

The associated value is an integer.


MLMediaFormat_Key_Crypto_Encrypted_Byte_Block

MLMediaFormatKey MLMediaFormat_Key_Crypto_Encrypted_Byte_Block;

The associated value is an integer.


MLMediaFormat_Key_Crypto_Encrypted_Sizes

MLMediaFormatKey MLMediaFormat_Key_Crypto_Encrypted_Sizes;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_Crypto_Iv

MLMediaFormatKey MLMediaFormat_Key_Crypto_Iv;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_Crypto_Key

MLMediaFormatKey MLMediaFormat_Key_Crypto_Key;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_Crypto_Mode

MLMediaFormatKey MLMediaFormat_Key_Crypto_Mode;

The associated value is an integer.


MLMediaFormat_Key_Crypto_Plain_Sizes

MLMediaFormatKey MLMediaFormat_Key_Crypto_Plain_Sizes;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_Crypto_Skip_Byte_Block

MLMediaFormatKey MLMediaFormat_Key_Crypto_Skip_Byte_Block;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_D263

MLMediaFormatKey MLMediaFormat_Key_D263;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_Date

MLMediaFormatKey MLMediaFormat_Key_Date;

A key describing metadata - The date the media was created or published. The format is unspecified but RFC 3339 is recommended.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Discnumber

MLMediaFormatKey MLMediaFormat_Key_Discnumber;

A key describing metadata. The disc number for the media's original source.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Display_Crop

MLMediaFormatKey MLMediaFormat_Key_Display_Crop;

A key describing display crop rectangle.

The associated value is a string of format "Rect %s(%d, %d, %d, %d)" where the value meaning is: "Rect name(left, top, right, bottom)".

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Display_Height

MLMediaFormatKey MLMediaFormat_Key_Display_Height;

The associated value is an integer.


MLMediaFormat_Key_Display_Width

MLMediaFormatKey MLMediaFormat_Key_Display_Width;

The associated value is an integer.


MLMediaFormat_Key_Encoder_Delay

MLMediaFormatKey MLMediaFormat_Key_Encoder_Delay;

A key describing the number of frames to trim from the start of the decoded audio stream.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Encoder_Padding

MLMediaFormatKey MLMediaFormat_Key_Encoder_Padding;

A key describing the number of frames to trim from the end of the decoded audio stream.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Esds

MLMediaFormatKey MLMediaFormat_Key_Esds;

A key describing the electrostatic discharge and soldering (ESDS).

The associated value is an MLMediaFormatByteArray.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Exif_Offset

MLMediaFormatKey MLMediaFormat_Key_Exif_Offset;

The associated value is a long integer.


MLMediaFormat_Key_Exif_Size

MLMediaFormatKey MLMediaFormat_Key_Exif_Size;

The associated value is a long integer.


MLMediaFormat_Key_Frame_Count

MLMediaFormatKey MLMediaFormat_Key_Frame_Count;

The associated value is an integer.


MLMediaFormat_Key_Genre

MLMediaFormatKey MLMediaFormat_Key_Genre;

A key describing metadata. The media genre.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Grid_Columns

MLMediaFormatKey MLMediaFormat_Key_Grid_Columns;

A key describing the number of grid columns in the content in a MIMETYPE_IMAGE_ANDROID_HEIC track.

The associated value is an integer.

Refer to MIMETYPE_IMAGE_ANDROID_HEIC on decoding instructions of such tracks.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

See:


MLMediaFormat_Key_Grid_Rows

MLMediaFormatKey MLMediaFormat_Key_Grid_Rows;

A key describing the number of grid rows in the content in a MIMETYPE_IMAGE_ANDROID_HEIC track.

The associated value is an integer.

Refer to MIMETYPE_IMAGE_ANDROID_HEIC on decoding instructions of such tracks.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

See:


MLMediaFormat_Key_Haptic_Channel_Count

MLMediaFormatKey MLMediaFormat_Key_Haptic_Channel_Count;

A key describing the number of haptic channels in an audio format.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Hdr10_Plus_Info

MLMediaFormatKey MLMediaFormat_Key_Hdr10_Plus_Info;

An optional key describing the HDR10+ metadata of the video content.

The associated value is a ByteBuffer containing HDR10+ metadata conforming to the user_data_registered_itu_t_t35() syntax of SEI message for ST 2094-40. This key will be present on:

  • The formats of output buffers of a decoder configured for HDR10+ profiles (such as MLMediaCodecListGetSupportedProfileLevels::VP9Profile2HDR10Plus, MLMediaCodecListGetSupportedProfileLevels::VP9Profile3HDR10Plus or MLMediaCodecListGetSupportedProfileLevels::HEVCProfileMain10HDR10Plus), or
  • The formats of output buffers of an encoder configured for an HDR10+ profiles that uses out-of-band metadata (such as MLMediaCodecListGetSupportedProfileLevels::VP9Profile2HDR10Plus or MLMediaCodecListGetSupportedProfileLevels::VP9Profile3HDR10Plus).
Deprecated

Deprecated since 1.4.0. Scheduled for removal.

See: MediaCodec::PARAMETER_KEY_HDR10_PLUS_INFO.


MLMediaFormat_Key_Icc_Profile

MLMediaFormatKey MLMediaFormat_Key_Icc_Profile;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_Is_Sync_Frame

MLMediaFormatKey MLMediaFormat_Key_Is_Sync_Frame;

The associated value is an integer.


MLMediaFormat_Key_Location

MLMediaFormatKey MLMediaFormat_Key_Location;

A key describing metadata. The media location.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Loop

MLMediaFormatKey MLMediaFormat_Key_Loop;

A key describing metadata. The media loop.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Lyricist

MLMediaFormatKey MLMediaFormat_Key_Lyricist;

A key describing metadata. The media lyricist.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Manufacturer

MLMediaFormatKey MLMediaFormat_Key_Manufacturer;

A key describing metadata. The media manufacturer.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Max_Bit_Rate

MLMediaFormatKey MLMediaFormat_Key_Max_Bit_Rate;

A key describing the max bitrate in bits/sec.

This is usually over a one-second sliding window (e.g. over any window of one second). The associated value is an integer. \hide

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Max_Fps_To_Encoder

MLMediaFormatKey MLMediaFormat_Key_Max_Fps_To_Encoder;

Instruct the video encoder in "surface-input" mode to drop excessive frames from the source, so that the input frame rate to the encoder does not exceed the specified fps.

The associated value is a float, representing the max frame rate to feed the encoder at.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Max_Pts_Gap_To_Encoder

MLMediaFormatKey MLMediaFormat_Key_Max_Pts_Gap_To_Encoder;

Instruct the video encoder in "surface-input" mode to limit the gap of timestamp between any two adjacent frames fed to the encoder to the specified amount (in micro-second).

The associated value is a long int. When positive, it represents the max timestamp gap between two adjacent frames fed to the encoder. When negative, the absolute value represents a fixed timestamp gap between any two adjacent frames fed to the encoder. Note that this will also apply even when the original timestamp goes backward in time. Under normal conditions, such frames would be dropped and not sent to the encoder.

The output timestamp will be restored to the original timestamp and will not be affected.

This is used in some special scenarios where input frames arrive sparingly but it's undesirable to allocate more bits to any single frame, or when it's important to ensure all frames are captured (rather than captured in the correct order).

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Mpeg_User_Data

MLMediaFormatKey MLMediaFormat_Key_Mpeg_User_Data;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_Mpeg2_Stream_Header

MLMediaFormatKey MLMediaFormat_Key_Mpeg2_Stream_Header;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_PCM_Big_Endian

MLMediaFormatKey MLMediaFormat_Key_PCM_Big_Endian;

The associated value is an integer.


MLMediaFormat_Key_Pssh

MLMediaFormatKey MLMediaFormat_Key_Pssh;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_Rotation

MLMediaFormatKey MLMediaFormat_Key_Rotation;

A key describing the desired clockwise rotation on an output surface.

This key is only used when the codec is configured using an output surface. The associated value is an integer, representing degrees. Supported values are 0, 90, 180 or 270. This is an optional field; if not specified, rotation defaults to 0.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

See: MLMediaCodecBitrateMode::profileLevels


MLMediaFormat_Key_Sar_Height

MLMediaFormatKey MLMediaFormat_Key_Sar_Height;

The associated value is an integer.


MLMediaFormat_Key_Sar_Width

MLMediaFormatKey MLMediaFormat_Key_Sar_Width;

The associated value is an integer.


MLMediaFormat_Key_Sei

MLMediaFormatKey MLMediaFormat_Key_Sei;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_Slice_Height

MLMediaFormatKey MLMediaFormat_Key_Slice_Height;

A key describing the plane height of a multi-planar (YUV) video bytebuffer layout.

Slice height (or plane height/vertical stride) is the number of rows that must be skipped to get from the top of the Y plane to the top of the U plane in the bytebuffer. In essence the offset of the U plane is sliceHeight * stride. The height of the U/V planes can be calculated based on the color format, though it is generally undefined and depends on the device and release. The associated value is an integer, representing the number of rows.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Target_Time

MLMediaFormatKey MLMediaFormat_Key_Target_Time;

The associated value is a long integer.


MLMediaFormat_Key_Temporal_Layer_Count

MLMediaFormatKey MLMediaFormat_Key_Temporal_Layer_Count;

The associated value is an integer.


MLMediaFormat_Key_Temporal_Layer_Id

MLMediaFormatKey MLMediaFormat_Key_Temporal_Layer_Id;

The associated value is an integer.


MLMediaFormat_Key_Text_Format_Data

MLMediaFormatKey MLMediaFormat_Key_Text_Format_Data;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_Thumbnail_CSD_Hevc

MLMediaFormatKey MLMediaFormat_Key_Thumbnail_CSD_Hevc;

The associated value is an MLMediaFormatByteArray.


MLMediaFormat_Key_Thumbnail_Height

MLMediaFormatKey MLMediaFormat_Key_Thumbnail_Height;

The associated value is an integer.


MLMediaFormat_Key_Thumbnail_Time

MLMediaFormatKey MLMediaFormat_Key_Thumbnail_Time;

The associated value is a long integer.


MLMediaFormat_Key_Thumbnail_Width

MLMediaFormatKey MLMediaFormat_Key_Thumbnail_Width;

The associated value is an integer.


MLMediaFormat_Key_Tile_Height

MLMediaFormatKey MLMediaFormat_Key_Tile_Height;

A key describing the height (in pixels) of each tile of the content in a MIMETYPE_IMAGE_ANDROID_HEIC track. The associated value is an integer.

Refer to MIMETYPE_IMAGE_ANDROID_HEIC on decoding instructions of such tracks.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

See:


MLMediaFormat_Key_Tile_Width

MLMediaFormatKey MLMediaFormat_Key_Tile_Width;

A key describing the width (in pixels) of each tile of the content in a MIMETYPE_IMAGE_ANDROID_HEIC track. The associated value is an integer.

Refer to MIMETYPE_IMAGE_ANDROID_HEIC on decoding instructions of such tracks.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

See:


MLMediaFormat_Key_Time_Us

MLMediaFormatKey MLMediaFormat_Key_Time_Us;

The associated value is a long integer.


MLMediaFormat_Key_Title

MLMediaFormatKey MLMediaFormat_Key_Title;

A key describing metadata. The title of the media.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Track_Id

MLMediaFormatKey MLMediaFormat_Key_Track_Id;

A key describing a unique ID for the content of a media track.

This key is used by MLMediaExtractor. Some extractors provide multiple encodings of the same track (e.g. float audio tracks for FLAC and WAV may be expressed as two tracks via MediaExtractor: a normal PCM track for backward compatibility, and a float PCM track for added fidelity. Similarly, Dolby Vision extractor may provide a baseline SDR version of a DV track.) This key can be used to identify which MediaExtractor tracks refer to the same underlying content.

The associated value is an integer.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Track_Index

MLMediaFormatKey MLMediaFormat_Key_Track_Index;

The associated value is an integer.


MLMediaFormat_Key_Valid_Samples

MLMediaFormatKey MLMediaFormat_Key_Valid_Samples;

The associated value is an integer.


MLMediaFormat_Key_Year

MLMediaFormatKey MLMediaFormat_Key_Year;

A key describing metadata. The year the media was created or published as a long.

The associated value is a string.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_AAC_DRC_Effect_Type

MLMediaFormatKey MLMediaFormat_Key_AAC_DRC_Effect_Type;

A key describing for selecting the DRC effect type for MPEG-D DRC.

The supported values are defined in ISO/IEC 23003-4:2015 and are described as follows: | Value | Effect | | -------- | -------- | | -1 | Off | | 0 | None | | 1 | Late night | | 2 | Noisy environment | | 3 | Limited playback range | | 4 | Low playback level | | 5 | Dialog enhancement | | 6 | General compression |

The value -1 (Off) disables DRC processing, while loudness normalization may still be active and dependent on KEY_AAC_DRC_TARGET_REFERENCE_LEVEL.

The value 0 (None) automatically enables DRC processing if necessary to prevent signal clipping

The value 6 (General compression) can be used for enabling MPEG-D DRC without particular DRC effect type request.

The default DRC effect type is 3 ("Limited playback range") on mobile devices.

This key is only used during decoding.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Quality

MLMediaFormatKey MLMediaFormat_Key_Quality;

A key describing the desired encoding quality.

The associated value is an integer. This key is only supported for encoders that are configured in constant-quality mode. These values are device and codec specific, but lower values generally result in more efficient (smaller-sized) encoding.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

See: MediaCodecInfo.EncoderCapabilities::getQualityRange()


MLMediaFormat_Key_Output_Reorder_Depth

MLMediaFormatKey MLMediaFormat_Key_Output_Reorder_Depth;

An optional key describing the maximum number of non-display-order coded frames.

This is an optional parameter that applies only to video encoders. Application should check the value for this key in the output format to see if codec will produce non-display-order coded frames. If encoder supports it, the output frames' order will be different from the display order and each frame's display order could be retrieved from MLMediaCodec.BufferInfo::presentationTimeUs . Before API level 27, application may receive non-display-order coded frames even though the application did not request it. Note: Application should not rearrange the frames to display order before feeding them to MLMediaMuxer::writeSampleData .

The default value is 0.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Is_Timed_Text

MLMediaFormatKey MLMediaFormat_Key_Is_Timed_Text;

The associated value is an integer. The value should be 0 or 1.


MLMediaFormat_Key_Ca_System_Id

MLMediaFormatKey MLMediaFormat_Key_Ca_System_Id;

A key describing the system id of the conditional access system used to scramble a media track.

This key is set by MLMediaExtractor if the track is scrambled with a conditional access system, regardless of the presence of a valid MediaCas object.

The associated value is an integer. \hide

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Ca_Session_Id

MLMediaFormatKey MLMediaFormat_Key_Ca_Session_Id;

A key describing the MediaCas.Session object associated with a media track.

This key is set by MLMediaExtractor if the track is scrambled with a conditional access system, after it receives a valid MediaCas} object.

The associated value is a ByteBuffer. \hide

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormat_Key_Ca_Private_Data

MLMediaFormatKey MLMediaFormat_Key_Ca_Private_Data;

A key describing the private data in the CA_descriptor associated with a media track.

This key is set by MLMediaExtractor if the track is scrambled with a conditional access system, before it receives a valid MediaCas object.

The associated value is a ByteBuffer. \hide

Deprecated

Deprecated since 1.4.0. Scheduled for removal.


MLMediaFormatKey_Feature

MLMediaFormatKey MLMediaFormat_Key_Feature_;

A key prefix used together with a MLMediaCodecBitrateMode feature name describing a required or optional feature for a codec capabilities query.

The associated value is an integer, where non-0 value means the feature is requested to be present, while 0 value means the feature is requested to be not present.

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

See:

  • MLMediaCodecList::findDecoderForFormat
  • MLMediaCodecList::findEncoderForFormat
  • MLMediaCodecBitrateMode::isFormatSupported \hide

MLTTMLDimen_Unset

static const float MLTTMLDimen_Unset = -3.402823466e+38F;

An unset position, width or size which is negative of maximum finite value of float (-FLT_MAX).

API Level:

  • 20

size

size_t size;

Image size in bytes.


data

uint8_t * data;

Byte data of the image.


start_time_ms

int64_t start_time_ms;

Track cue start time in milliseconds.


end_time_ms

int64_t end_time_ms;

Track cue end time in milliseconds.


text

char * text;

The cue text encoded as UTF-8. Or null if this is an image cue.


text_alignment

MLTTMLLayoutAlignment text_alignment;
TypeDescription
MLTTMLLayoutAlignmentCue text alignment within the cue box.

The alignment of the cue text within the cue box.


bitmap

MLTTMLImage bitmap;
TypeDescription
MLTTMLImageByte data for TTML image cues.

The cue image if this is an image cue, an empty image otherwise.


line

float line;

The position of the line_anchor of the cue box within the viewport in the direction orthogonal to the writing direction, or MLTTMLDimen_Unset.

When set, the interpretation of the value depends on the value of line_type. For horizontal text and line_type equal to MLTTMLLineType_Fraction, this is the fractional vertical position relative to the top of the viewport.


line_type

MLTTMLLineType line_type;

The cue line type.

TypeDescription
MLTTMLLineTypeCue line type.

MLTTMLLineType_Fraction indicates that line is a fractional position within the viewport.

MLTTMLLineType_Number indicates that line is a line number, where the size of each line is taken to be the size of the first line of the cue. When line is greater than or equal to 0 lines count from the start of the viewport, with 0 indicating zero offset from the start edge. When line is negative lines count from the end of the viewport, with -1 indicating zero offset from the end edge. For horizontal text the line spacing is the height of the first line of the cue, and the start and end of the viewport are the top and bottom respectively.

Note that it's particularly important to consider the effect of line_anchor when using MLTTMLLineType_Number.


(line == 0 && line_anchor == MLTTMLAnchorType_Start)

Positions a (potentially multi-line) cue at the very top of the viewport.


(line == -1 && line_anchor == MLTTMLAnchorType_EndD)

Positions a (potentially multi-line) cue at the very bottom of the viewport.


(line == 0 && line_anchor == MLTTMLAnchorType_End)

and ```cpp

(line == -1 && line_anchor == MLTTMLAnchorType_Start)


Position cues entirely outside of the viewport.

```cpp

(line == 1 && line_anchor == MLTTMLAnchorType_End)

Positions a cue so that only the last line is visible at the top of the viewport.


(line == -2 && line_anchor == MLTTMLAnchorType_Start)

Position a cue so that only its first line is visible at the bottom of the viewport.


line_anchor

MLTTMLAnchorType line_anchor;
TypeDescription
MLTTMLAnchorTypeCue anchor type.

The cue box anchor in the direction of line.


position

float position;

The fractional position of the position_anchor of the cue box within the viewport in the direction orthogonal to line, or MLTTMLDimen_Unset.

For horizontal text, this is the horizontal position relative to the left of the viewport. Note that positioning is relative to the left of the viewport even in the case of right-to-left text.


position_anchor

MLTTMLAnchorType position_anchor;
TypeDescription
MLTTMLAnchorTypeCue anchor type.

The cue box anchor in the direction of position.


size

float size;

The cue box size in the writing direction, as a fraction of the viewport size or MLTTMLDimen_Unset.


bitmap_height

float bitmap_height;

The cue bitmap height as a fraction of the viewport size or MLTTMLDimen_Unset if the bitmap should be displayed at its natural height given the bitmap dimensions and the specified size.


window_color_set

bool window_color_set;

Specifies whether or not the window_color property is set.


window_color

uint32_t window_color;

The cue window fill color in ARGB format.


text_size_type

MLTTMLTextSizeType text_size_type;
TypeDescription
MLTTMLTextSizeTypeCue text size type.

The cue default text size type, or MLTTMLTextSizeType_Unset if this cue has no default text size.


text_size

float text_size;

The cue default text size, or MLTTMLDimen_Unset if this cue has no default.


start_time_ms

int64_t start_time_ms;

Track cue start time in milliseconds.


end_time_ms

int64_t end_time_ms;

Track cue end time in milliseconds.


body

char * body;

WebVTT file body encoded as UTF-8.


id

char * id;

A sequence of characters unique amongst all the WebVTT cue identifiers.


snap_to_lines

bool snap_to_lines;

A boolean indicating whether the line is an integer number of lines.


orientation

MLWebVTTOrientation orientation;
TypeDescription
MLWebVTTOrientationCue orientation setting.

Orientation of the cue.


direction

MLWebVTTDirection direction;
TypeDescription
MLWebVTTDirectionCue direction setting.

The writing direction.


relative_line_position

float relative_line_position;

Relative cue line position.


line_number

int32_t line_number;

WebVTT cue line number.


text_position

float text_position;

The indent of the cue box in the direction defined by the writing direction.


size

float size;

WebVTT cue size.


align

MLWebVTTAlign align;
TypeDescription
MLWebVTTAlignCue aligment setting.

WebVTT cue text alignment.


Macros Documentation

MAX_CODEC_NAME_SIZE

#define MAX_CODEC_NAME_SIZE 64

MAX_CODEC_NAME_LENGTH

#define MAX_CODEC_NAME_LENGTH 64

MAX_FORMAT_STRING_SIZE

#define MAX_FORMAT_STRING_SIZE 512

MAX_KEY_STRING_SIZE

#define MAX_KEY_STRING_SIZE 64