Skip to main content
Version: 21 Aug 2024

ml_media_extractor.h

Classes

Name
structMLMediaExtractorDRMSchemeInitData

Types

Name
typedef MLPSSHEntryMLMediaExtractorPSSHEntry
typedef struct MLMediaExtractorDRMSchemeInitDataMLMediaExtractorDRMSchemeInitData

Enums

Name
enumMLMediaExtractorSampleFlag
{
MLMediaExtractorSampleFlag_Sync = 1,
MLMediaExtractorSampleFlag_Encrypted = 2,
MLMediaExtractorSampleFlag_Ensure32Bits = 0x7FFFFFFF
}
enumMLMediaExtractorSeekPosition
{
MLMediaExtractorSeekPosition_Previous_Sync,
MLMediaExtractorSeekPosition_Next_Sync,
MLMediaExtractorSeekPosition_Closest_Sync,
MLMediaExtractorSeekPosition_Ensure32Bits = 0x7FFFFFFF
}

Functions

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

Enums Documentation

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.


Types Documentation

MLMediaExtractorPSSHEntry

typedef MLPSSHEntry MLMediaExtractorPSSHEntry;

More Info


MLMediaExtractorDRMSchemeInitData

typedef struct MLMediaExtractorDRMSchemeInitData MLMediaExtractorDRMSchemeInitData;

DRM Scheme initialization data.

More Info


Functions Documentation

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.


Source code

// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) 2017 Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement,
// located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying
// this distribution may also be found in the top-level NOTICE file
// appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%

#pragma once

#include "ml_api.h"
#include "ml_types.h"
#include "ml_media_common.h"
#include "ml_media_data_source.h"
#include "ml_media_error.h"
#include "ml_media_types.h"

ML_EXTERN_C_BEGIN

typedef enum MLMediaExtractorSampleFlag {
MLMediaExtractorSampleFlag_Sync = 1,
MLMediaExtractorSampleFlag_Encrypted = 2,
MLMediaExtractorSampleFlag_Ensure32Bits = 0x7FFFFFFF
} MLMediaExtractorSampleFlag;

typedef enum MLMediaExtractorSeekPosition {
MLMediaExtractorSeekPosition_Previous_Sync,
MLMediaExtractorSeekPosition_Next_Sync,
MLMediaExtractorSeekPosition_Closest_Sync,
MLMediaExtractorSeekPosition_Ensure32Bits = 0x7FFFFFFF
} MLMediaExtractorSeekPosition;

typedef MLPSSHEntry MLMediaExtractorPSSHEntry;

typedef ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.") struct MLMediaExtractorDRMSchemeInitData {
char *mime_type;
size_t size;
uint8_t *data;
} MLMediaExtractorDRMSchemeInitData;

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorCreate(MLHandle *out_handle);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorDestroy(MLHandle handle);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorSetDataSourceForPath(MLHandle handle, const char *path);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorSetDataSourceForURI(MLHandle handle, const char *uri);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorSetDataSourceForURIWithHeaders(MLHandle handle, const char *uri, const char **headers, size_t len);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorSetDataSourceForFD(MLHandle handle, int fd, int64_t offset, int64_t length);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorSetMediaDataSource(MLHandle handle, MLHandle media_data_source);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorGetDRMInitData(MLHandle handle, MLUUID drm_uuid, MLMediaExtractorDRMSchemeInitData *out_drm_init_data);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorReleaseDRMInitData(MLHandle handle, MLMediaExtractorDRMSchemeInitData *drm_init_data);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorGetTrackCount(MLHandle handle, uint64_t *out_track_count);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorGetTrackFormat(MLHandle handle, size_t index, MLHandle *out_track_handle);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorSelectTrack(MLHandle handle, size_t index);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorUnselectTrack(MLHandle handle, size_t index);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorSeekTo(MLHandle handle, int64_t time_us, MLMediaSeekMode mode);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorAdvance(MLHandle handle);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorReadSampleData(MLHandle handle, uint8_t *byte_buf, size_t buf_size, size_t offset, int64_t *out_data_size);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorGetSampleTrackIndex(MLHandle handle, int64_t *out_track_index);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorGetSampleTime(MLHandle handle, int64_t *out_sample_time);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorGetSampleFlags(MLHandle handle, int *out_sample_flags);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorGetSampleCryptoInfo(MLHandle handle, MLHandle *out_info_handle);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorReleaseCryptoInfo(MLHandle handle, MLHandle *inout_info_handle);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorGetCachedDuration(MLHandle handle, int64_t *out_cached_duration);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorHasCacheReachedEOS(MLHandle handle);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorGetPSSHInfoCount(MLHandle handle, size_t *out_index);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorGetPSSHInfo(MLHandle handle, size_t index, MLMediaExtractorPSSHEntry *out_pssh_entry);

ML_DEPRECATED_MSG("Use standard Android SDK and NDK APIs.")
ML_API MLResult ML_CALL MLMediaExtractorReleasePSSHInfo(MLHandle handle, MLMediaExtractorPSSHEntry *pssh_entry);

ML_EXTERN_C_END