NativeBindings
See ml_media_format.h for additional comments.
Inherits from: 
MagicLeapNativeBindings
Public Methods
MLResult.Code MLMediaFormatCreate
Create an empty format object.
public MLResult.Code MLMediaFormatCreate(
    out ulong outHandle
)
Parameters
| Type | Name | Description | 
|---|---|---|
| out ulong | outHandle | 
MLResult.Code MLMediaFormatCreateAudio
Create a audio format object.
public MLResult.Code MLMediaFormatCreateAudio(
    string MimeType,
    int SampleRate,
    int ChannelCount,
    out ulong outHandle
)
Parameters
| Type | Name | Description | 
|---|---|---|
| string | MimeType | |
| int | SampleRate | |
| int | ChannelCount | |
| out ulong | outHandle | 
MLResult.Code MLMediaFormatCreateCopy
Create a copy of the format handle provided.
public MLResult.Code MLMediaFormatCreateCopy(
    ulong handle,
    out ulong outHandle
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| out ulong | outHandle | 
MLResult.Code MLMediaFormatCreateSubtitle
Create a subtitle format object.
public MLResult.Code MLMediaFormatCreateSubtitle(
    string MimeType,
    string Language,
    out ulong outHandle
)
Parameters
| Type | Name | Description | 
|---|---|---|
| string | MimeType | |
| string | Language | |
| out ulong | outHandle | 
MLResult.Code MLMediaFormatCreateVideo
Create a video format object.
public MLResult.Code MLMediaFormatCreateVideo(
    string mimeType,
    int Width,
    int Height,
    out ulong outHandle
)
Parameters
| Type | Name | Description | 
|---|---|---|
| string | mimeType | |
| int | Width | |
| int | Height | |
| out ulong | outHandle | 
MLResult.Code MLMediaFormatDestroy
Destroy a format object.
public MLResult.Code MLMediaFormatDestroy(
    ulong handle
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | 
MLResult.Code MLMediaFormatGetKeyByteBuffer
Obtain the value of a ByteBuffer key.
public MLResult.Code MLMediaFormatGetKeyByteBuffer(
    ulong handle,
    string name,
    out MLMediaFormatByteArray OutBuffer
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| string | name | |
| out MLMediaFormatByteArray | OutBuffer | 
MLResult.Code MLMediaFormatGetKeySize
Obtain the size of a key.
public MLResult.Code MLMediaFormatGetKeySize(
    ulong handle,
    string name,
    out ulong outSize
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| string | name | |
| out ulong | outSize | 
MLResult.Code MLMediaFormatGetKeyString
Obtain the value of a string key. User shall allocate at least #MAX_KEY_STRING_SIZE bytes of memory for storing the output key string.
public MLResult.Code MLMediaFormatGetKeyString(
    ulong handle,
    string name,
    IntPtr outString
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| string | name | |
| IntPtr | outString | 
MLResult.Code MLMediaFormatGetKeyValueFloat
Obtain the value of an float key.
public MLResult.Code MLMediaFormatGetKeyValueFloat(
    ulong handle,
    string name,
    out float outKey
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| string | name | |
| out float | outKey | 
MLResult.Code MLMediaFormatGetKeyValueInt32
Obtain the value of an integer key. For example, use #MLMediaFormat_Key_Frame_Rate key to get the framerate of a video track.
public MLResult.Code MLMediaFormatGetKeyValueInt32(
    ulong handle,
    string name,
    out int outKey
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| string | name | |
| out int | outKey | 
MLResult.Code MLMediaFormatGetKeyValueInt64
Obtain the value of an long key. For example, use MLMediaFormat_Key_Duration key to get duration of a track.
public MLResult.Code MLMediaFormatGetKeyValueInt64(
    ulong handle,
    string name,
    out long outKey
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| string | name | |
| out long | outKey | 
MLResult.Code MLMediaFormatKeyByteBufferRelease
Release the ByteBuffer acquired by MLMediaFormatGetKeyByteBuffer.
public MLResult.Code MLMediaFormatKeyByteBufferRelease(
    ulong handle,
    ref MLMediaFormatByteArray buffer
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| ref MLMediaFormatByteArray | buffer | 
MLResult.Code MLMediaFormatObjectToString
Obtain the human readable representation of the format. 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.
public MLResult.Code MLMediaFormatObjectToString(
    ulong handle,
    IntPtr outString
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| IntPtr | outString | 
MLResult.Code MLMediaFormatSetKeyByteBuffer
Set the value of a ByteBuffer key.
public MLResult.Code MLMediaFormatSetKeyByteBuffer(
    ulong handle,
    string name,
    ref MLMediaFormatByteArray Buffer
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| string | name | |
| ref MLMediaFormatByteArray | Buffer | 
MLResult.Code MLMediaFormatSetKeyFloat
Set the value of a float key.
public MLResult.Code MLMediaFormatSetKeyFloat(
    ulong handle,
    string name,
    float keyValue
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| string | name | |
| float | keyValue | 
MLResult.Code MLMediaFormatSetKeyInt32
Set the value of an integer key.
public MLResult.Code MLMediaFormatSetKeyInt32(
    ulong handle,
    string name,
    int keyValue
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| string | name | |
| int | keyValue | 
MLResult.Code MLMediaFormatSetKeyInt64
Set the value of a long key.
public MLResult.Code MLMediaFormatSetKeyInt64(
    ulong handle,
    string name,
    long keyValue
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| string | name | |
| long | keyValue | 
MLResult.Code MLMediaFormatSetKeySize
Set the size of a key.
public MLResult.Code MLMediaFormatSetKeySize(
    ulong handle,
    string name,
    ulong keySize
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| string | name | |
| ulong | keySize | 
MLResult.Code MLMediaFormatSetKeyString
Set the value of a string key.
public MLResult.Code MLMediaFormatSetKeyString(
    ulong handle,
    string name,
    string KeyValue
)
Parameters
| Type | Name | Description | 
|---|---|---|
| ulong | handle | |
| string | name | |
| string | KeyValue | 
Public Attributes
MAX_FORMAT_STRING_SIZE
Internal max size of format string.
public static int MAX_FORMAT_STRING_SIZE = 512;
MAX_KEY_STRING_SIZE
Internal max size of key string.
public static int MAX_KEY_STRING_SIZE = 64;