ml_media_extractor.h
Classes
Name | |
---|---|
struct | MLMediaExtractorDRMSchemeInitData |
Types
Name | |
---|---|
typedef MLPSSHEntry | MLMediaExtractorPSSHEntry |
typedef struct MLMediaExtractorDRMSchemeInitData | MLMediaExtractorDRMSchemeInitData |
Enums
Functions
Name | |
---|---|
MLResult | MLMediaExtractorCreate(MLHandle * out_handle) Create a new MLMediaExtractor. |
MLResult | MLMediaExtractorDestroy(MLHandle handle) Destroy a MLMediaExtractor. |
MLResult | MLMediaExtractorSetDataSourceForPath(MLHandle handle, const char * path) Set a local file path as the data source. |
MLResult | MLMediaExtractorSetDataSourceForURI(MLHandle handle, const char * uri) Set a URI string as the data source. |
MLResult | MLMediaExtractorSetDataSourceForURIWithHeaders(MLHandle handle, const char * uri, const char ** headers, size_t len) Set a URI string as the data source. |
MLResult | MLMediaExtractorSetDataSourceForFD(MLHandle handle, int fd, int64_t offset, int64_t length) Set the data source as the file-descriptor to use. |
MLResult | MLMediaExtractorSetMediaDataSource(MLHandle handle, MLHandle media_data_source) Sets the data source as user defined media data source. |
MLResult | MLMediaExtractorGetDRMInitData(MLHandle handle, MLUUID drm_uuid, MLMediaExtractorDRMSchemeInitData * out_drm_init_data) Extract DRM initialization data for a given DRM Scheme if it exists. |
MLResult | MLMediaExtractorReleaseDRMInitData(MLHandle handle, MLMediaExtractorDRMSchemeInitData * drm_init_data) Release DRM initialization data which was previously retrieved. |
MLResult | MLMediaExtractorGetTrackCount(MLHandle handle, uint64_t * out_track_count) Count the number of tracks found in the data source. |
MLResult | MLMediaExtractorGetTrackFormat(MLHandle handle, size_t index, MLHandle * out_track_handle) Get the track format at the specified index. |
MLResult | MLMediaExtractorSelectTrack(MLHandle handle, size_t index) Select a track for the subsequent operations. |
MLResult | MLMediaExtractorUnselectTrack(MLHandle handle, size_t index) Unselect a track for the subsequent operations. |
MLResult | MLMediaExtractorSeekTo(MLHandle handle, int64_t time_us, MLMediaSeekMode mode) All selected tracks seek near the requested time according to the specified mode. |
MLResult | MLMediaExtractorAdvance(MLHandle handle) Advance to the next sample. |
MLResult | MLMediaExtractorReadSampleData(MLHandle handle, uint8_t byte_buf, size_t buf_size, size_t offset, int64_t out_data_size) Retrieve the current encoded sample and store it in the byte buffer starting at the given offset. |
MLResult | MLMediaExtractorGetSampleTrackIndex(MLHandle handle, int64_t * out_track_index) Return the track index the current sample originates from. |
MLResult | MLMediaExtractorGetSampleTime(MLHandle handle, int64_t * out_sample_time) Return the current sample's presentation time in microseconds. |
MLResult | MLMediaExtractorGetSampleFlags(MLHandle handle, int * out_sample_flags) Return the current sample's flags. |
MLResult | MLMediaExtractorGetSampleCryptoInfo(MLHandle handle, MLHandle * out_info_handle) Return the current sample's Crypto info if has encrypted sample. |
MLResult | MLMediaExtractorReleaseCryptoInfo(MLHandle handle, MLHandle * inout_info_handle) Release the Crypto Info. |
MLResult | MLMediaExtractorGetCachedDuration(MLHandle handle, int64_t * out_cached_duration) Return an estimate of how much data is presently cached in memoryexpressed in microseconds. |
MLResult | MLMediaExtractorHasCacheReachedEOS(MLHandle handle) Return true if we are caching data and the cache has reached the end of the data stream (for now, a future seek may of course restart the fetching of data). |
MLResult | MLMediaExtractorGetPSSHInfoCount(MLHandle handle, size_t * out_index) Get the Number of PSSH info if present. |
MLResult | MLMediaExtractorGetPSSHInfo(MLHandle handle, size_t index, MLMediaExtractorPSSHEntry * out_pssh_entry) Get the PSSH info if present. The PSSH(Protection System Specific Header) contains a UUID representing a DRM scheme along with opaque data blob used for creating crypto session, which in turn used to configure codec. |
MLResult | MLMediaExtractorReleasePSSHInfo(MLHandle handle, MLMediaExtractorPSSHEntry * pssh_entry) Clear the PSSH info data. |
Enums Documentation
MLMediaExtractorSampleFlag
Enumerator | Value | Description |
---|---|---|
MLMediaExtractorSampleFlag_Sync | 1 | |
MLMediaExtractorSampleFlag_Encrypted | 2 | |
MLMediaExtractorSampleFlag_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Sample flag output from MLMediaExtractorGetSampleFlags.
MLMediaExtractorSeekPosition
Enumerator | Value | Description |
---|---|---|
MLMediaExtractorSeekPosition_Previous_Sync | ||
MLMediaExtractorSeekPosition_Next_Sync | ||
MLMediaExtractorSeekPosition_Closest_Sync | ||
MLMediaExtractorSeekPosition_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Seek mode used by MLMediaExtractorSeekTo.
Types Documentation
MLMediaExtractorPSSHEntry
typedef MLPSSHEntry MLMediaExtractorPSSHEntry;
MLMediaExtractorDRMSchemeInitData
typedef struct MLMediaExtractorDRMSchemeInitData MLMediaExtractorDRMSchemeInitData;
DRM Scheme initialization data.
Functions Documentation
MLMediaExtractorCreate
MLResult MLMediaExtractorCreate(
MLHandle * out_handle
)
Create a new MLMediaExtractor.
Parameters
MLHandle * | out_handle | A handle to the created MLMediaExtractor. If there is an error during creation, it will return ML_INVALID_HANDLE. |
Returns
MLResult | MLResult_AllocFailed | If MediaExtractor handle cannot be allocated. |
MLResult | MLResult_InvalidParam | If out_handle is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorDestroy
MLResult MLMediaExtractorDestroy(
MLHandle handle
)
Destroy a MLMediaExtractor.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor object. |
Returns
MLResult | MLResult_InvalidParam | If handle is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSetDataSourceForPath
MLResult MLMediaExtractorSetDataSourceForPath(
MLHandle handle,
const char * path
)
Set a local file path as the data source.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
const char * | path | Content path of the file. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The path should be an absolute path and should reference a world-readable file.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSetDataSourceForURI
MLResult MLMediaExtractorSetDataSourceForURI(
MLHandle handle,
const char * uri
)
Set a URI string as the data source.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
const char * | uri | C-style string representing the URI complete string. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_PermissionDenied | Necessary permission is missing. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- android.permission.INTERNET (protection level: normal)
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSetDataSourceForURIWithHeaders
MLResult MLMediaExtractorSetDataSourceForURIWithHeaders(
MLHandle handle,
const char * uri,
const char ** headers,
size_t len
)
Set a URI string as the data source.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
const char * | uri | C-style string representing the complete URL. |
const char ** | headers | Array of char * headers to be sent. |
size_t | len | Number of headers passed-in. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_PermissionDenied | Necessary permission is missing. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- android.permission.INTERNET (protection level: normal)
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSetDataSourceForFD
MLResult MLMediaExtractorSetDataSourceForFD(
MLHandle handle,
int fd,
int64_t offset,
int64_t length
)
Set the data source as the file-descriptor to use.
Parameters
MLHandle | handle | MLHandle to the MediaExtractor. |
int | fd | File-descriptor for the file to extract from. |
int64_t | offset | Offset in bytes into the file where the data to be extracted starts. |
int64_t | length | Length in bytes of the data to be extracted. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
It is the caller's responsibility to close the file descriptor. It is safe to do so as soon as this call returns.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSetMediaDataSource
MLResult MLMediaExtractorSetMediaDataSource(
MLHandle handle,
MLHandle media_data_source
)
Sets the data source as user defined media data source.
Parameters
MLHandle | handle | MLHandle to the MediaExtractor. |
MLHandle | media_data_source | MLHandle returned by MLMediaDataSourceCreate(). |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_NameNotFound | If media_data_source cannot be found. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetDRMInitData
MLResult MLMediaExtractorGetDRMInitData(
MLHandle handle,
MLUUID drm_uuid,
MLMediaExtractorDRMSchemeInitData * out_drm_init_data
)
Extract DRM initialization data for a given DRM Scheme if it exists.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
MLUUID | drm_uuid | UUID of the DRM scheme. |
MLMediaExtractorDRMSchemeInitData * | out_drm_init_data | DRM initialization data pointer. To release the DRM initialization data upon successful return, call MLMediaExtractorReleaseDRMInitData(). |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorReleaseDRMInitData
MLResult MLMediaExtractorReleaseDRMInitData(
MLHandle handle,
MLMediaExtractorDRMSchemeInitData * drm_init_data
)
Release DRM initialization data which was previously retrieved.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
MLMediaExtractorDRMSchemeInitData * | drm_init_data | DRM initialization data that needs to be released. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetTrackCount
MLResult MLMediaExtractorGetTrackCount(
MLHandle handle,
uint64_t * out_track_count
)
Count the number of tracks found in the data source.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
uint64_t * | out_track_count | Number of tracks found in data source. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetTrackFormat
MLResult MLMediaExtractorGetTrackFormat(
MLHandle handle,
size_t index,
MLHandle * out_track_handle
)
Get the track format at the specified index.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
size_t | index | Index of the track. |
MLHandle * | out_track_handle | MLMediaFormat handle that represents track format. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSelectTrack
MLResult MLMediaExtractorSelectTrack(
MLHandle handle,
size_t index
)
Select a track for the subsequent operations.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
size_t | index | Index of the track. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Subsequent calls to MLMediaExtractorReadSampleData(), MLMediaExtractorGetSampleTrackIndex() and getSampleTime() only retrieve information for the subset of tracks selected. Selecting the same track multiple times has no effect, the track is only selected once.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorUnselectTrack
MLResult MLMediaExtractorUnselectTrack(
MLHandle handle,
size_t index
)
Unselect a track for the subsequent operations.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
size_t | index | Index of the track. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Subsequent calls to MLMediaExtractorReadSampleData(), MLMediaExtractorGetSampleTrackIndex() and getSampleTime() only retrieve information for the subset of tracks selected.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorSeekTo
MLResult MLMediaExtractorSeekTo(
MLHandle handle,
int64_t time_us,
MLMediaSeekMode mode
)
All selected tracks seek near the requested time according to the specified mode.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
int64_t | time_us | Seek time. |
MLMediaSeekMode | mode | Seek mode defined by MLMediaSeekMode. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorAdvance
MLResult MLMediaExtractorAdvance(
MLHandle handle
)
Advance to the next sample.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
Returns
MLResult | MLResult_InvalidParam | If handle is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
MLResult | MLMediaGenericResult_FailedTransaction | If Advance operation failed, no more sample data is available (end of stream). |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorReadSampleData
MLResult MLMediaExtractorReadSampleData(
MLHandle handle,
uint8_t * byte_buf,
size_t buf_size,
size_t offset,
int64_t * out_data_size
)
Retrieve the current encoded sample and store it in the byte buffer starting at the given offset.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
uint8_t * | byte_buf | Destination byte buffer. |
size_t | buf_size | Size of the destination buffer. |
size_t | offset | Offset within the buffer. |
int64_t * | out_data_size | Sample size or -1 if no more samples are available. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetSampleTrackIndex
MLResult MLMediaExtractorGetSampleTrackIndex(
MLHandle handle,
int64_t * out_track_index
)
Return the track index the current sample originates from.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
int64_t * | out_track_index | Track index or -1 if no more samples are available. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetSampleTime
MLResult MLMediaExtractorGetSampleTime(
MLHandle handle,
int64_t * out_sample_time
)
Return the current sample's presentation time in microseconds.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
int64_t * | out_sample_time | Sample time or -1 if no more samples are available. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetSampleFlags
MLResult MLMediaExtractorGetSampleFlags(
MLHandle handle,
int * out_sample_flags
)
Return the current sample's flags.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
int * | out_sample_flags | Sample flag defined by MLMediaExtractorSampleFlag, or -1 if on failure. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetSampleCryptoInfo
MLResult MLMediaExtractorGetSampleCryptoInfo(
MLHandle handle,
MLHandle * out_info_handle
)
Return the current sample's Crypto info if has encrypted sample.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
MLHandle * | out_info_handle | On success it returns handle to Crypto info of the sample. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorReleaseCryptoInfo
MLResult MLMediaExtractorReleaseCryptoInfo(
MLHandle handle,
MLHandle * inout_info_handle
)
Release the Crypto Info.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
MLHandle * | inout_info_handle | handle to Crypto info that needs to be released. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetCachedDuration
MLResult MLMediaExtractorGetCachedDuration(
MLHandle handle,
int64_t * out_cached_duration
)
Return an estimate of how much data is presently cached in memoryexpressed in microseconds.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor. |
int64_t * | out_cached_duration | Cached amount or -1 if that information is unavailable or not applicable (no cache). |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorHasCacheReachedEOS
MLResult MLMediaExtractorHasCacheReachedEOS(
MLHandle handle
)
Return true
if we are caching data and the cache has reached the end of the data stream (for now, a future seek may of course restart the fetching of data).
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
This API only returns a meaningful result if getCachedDuration() indicates the presence of a cache, i.e. does NOT return -1.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetPSSHInfoCount
MLResult MLMediaExtractorGetPSSHInfoCount(
MLHandle handle,
size_t * out_index
)
Get the Number of PSSH info if present.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
size_t * | out_index | On successful return contains number of PSSH entries. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
The PSSH(Protection System Specific Header) contains a UUID representing a DRM scheme along with opaque data blob used for creating crypto session, which in turn used to configure codec.
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorGetPSSHInfo
MLResult MLMediaExtractorGetPSSHInfo(
MLHandle handle,
size_t index,
MLMediaExtractorPSSHEntry * out_pssh_entry
)
Get the PSSH info if present. The PSSH(Protection System Specific Header) contains a UUID representing a DRM scheme along with opaque data blob used for creating crypto session, which in turn used to configure codec.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
size_t | index | Index of the PSSH info data element being retrieved. |
MLMediaExtractorPSSHEntry * | out_pssh_entry | Pointer to the PSSH info data element being retrieved. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Upon successful return, if a MLMediaExtractorPSSHEntry is returned, same should be released by calling MLMediaExtractorReleasePSSHInfo().
Deprecated since 1.4.0. Scheduled for removal.
MLMediaExtractorReleasePSSHInfo
MLResult MLMediaExtractorReleasePSSHInfo(
MLHandle handle,
MLMediaExtractorPSSHEntry * pssh_entry
)
Clear the PSSH info data.
Parameters
MLHandle | handle | MLHandle to the MLMediaExtractor instance. |
MLMediaExtractorPSSHEntry * | pssh_entry | Pointer to the PSSH info data element that needs to be released. |
Returns
MLResult | MLResult_InvalidParam | If one of parameters is invalid. |
MLResult | MLResult_Ok | If operation succeeded. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
Clears the entire cached PSSH info data in the library.
Deprecated since 1.4.0. Scheduled for removal.
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