MX Foundation 4

Functions

uint32 mxfEmbeddedTxBufferAlloc (HMXF_DEVICE device, uint64 index, uint64 size, HMXF_BUFFER *buffer, uint64 *allocated)
 
uint32 mxfEmbeddedTxBufferGet (HMXF_DEVICE device, uint64 index, HMXF_BUFFER *buffer)
 
uint32 mxfEmbeddedTxBufferFree (HMXF_BUFFER buffer)
 
uint32 mxfEmbeddedTxBufferStatusGet (HMXF_BUFFER buffer, uint64 *msgCount, uint64 *pendingBytes, uint64 *freeBytes)
 
uint32 mxfEmbeddedTxBufferInfoGet (HMXF_BUFFER buffer, HMXF_DEVICE *device, uint64 *index)
 
uint32 mxfEmbeddedTxBufferClear (HMXF_BUFFER buffer)
 
uint32 mxfEmbeddedTxBufferWrite (HMXF_BUFFER buffer, uint64 count, MXF_EMBEDDED_DATAREC *rec)
 
uint32 mxfEmbeddedTxBufferWriteAsync (HMXF_BUFFER buffer, uint64 count, MXF_EMBEDDED_DATAREC *hostBuffer, MXF_ASYNCHRONOUS_CALLBACK writeCompletion, void *context)
 
uint32 mxfEmbeddedTxBufferAsyncEventInit (HMXF_BUFFER buffer, uint64 almostEmpty, void *context, MXF_ASYNCEVENT_BUFFER_HANDLER callback)
 
uint32 mxfEmbeddedTxBufferAsyncEventTerminate (HMXF_BUFFER buffer)
 

Detailed Description

Function Documentation

uint32 mxfEmbeddedTxBufferAlloc ( HMXF_DEVICE  device,
uint64  index,
uint64  size,
HMXF_BUFFER *  buffer,
uint64 *  allocated 
)
C#
public static extern UInt32 mxfEmbeddedTxBufferAlloc(UInt64 device, UInt64 index, UInt64 size, out UInt64 buffer, out UInt64 allocated);

public static extern UInt32 mxfEmbeddedTxBufferAlloc(UInt64 device, UInt64 index, UInt64 size, out UInt64 buffer, IntPtr allocated);

Allocates a transmit buffer area for MX-Embedded queue transmission (to the embedded code). The allocated size can be greater than the asked size (rounding is done for internal buffer alignment). allocated parameter can return the actual allocated size.

The number of MX-Embedded TX queues must be reserved on the device before the initialization by using the mxfSystemInitAttributeUint64CallbackHandler() and KMXF_DEVICE_EMBEDDED_TX_QUEUE_NUM attribute.

Parameters
[in]devicedevice handle
[in]indexqueue index
[in]sizequeue size in bytes
[out]bufferreturned buffer handle
[out]allocatedreturned allocated size. Optional, pass NULL to if not needed.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxBufferFree()
mxfEmbeddedTxBufferGet()
mxfEmbeddedTxBufferStatusGet()
mxfEmbeddedRxBufferAlloc()
uint32 mxfEmbeddedTxBufferGet ( HMXF_DEVICE  device,
uint64  index,
HMXF_BUFFER *  buffer 
)
C#
public static extern UInt32 mxfEmbeddedTxBufferGet(UInt64 device, UInt64 index, out UInt64 buffer);

Returns the buffer handle referenced by the device handle and queue index pair.

Parameters
[in]devicedevice handle
[in]indexqueue index
[out]bufferreturned buffer handle
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxBufferAlloc()
mxfEmbeddedTxBufferStatusGet()
uint32 mxfEmbeddedTxBufferFree ( HMXF_BUFFER  buffer)
C#
public static extern UInt32 mxfEmbeddedTxBufferFree(UInt64 buffer);

Deallocates the memory previously allocated by mxfEmbeddedTxBufferAlloc().

Parameters
[in]bufferbuffer handle.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxBufferAlloc()
uint32 mxfEmbeddedTxBufferStatusGet ( HMXF_BUFFER  buffer,
uint64 *  msgCount,
uint64 *  pendingBytes,
uint64 *  freeBytes 
)
C#
public static extern UInt32 mxfEmbeddedTxBufferStatusGet(UInt64 buffer, out UInt64 msgCount, out UInt64 pendingBytes, out UInt64 freeBytes);

Returns the status of the MX-Embedded TX buffer. command IDs.

Parameters
[in]bufferbuffer handle
[out]msgCountnumber of messages in the queue
[out]pendingBytesnumber of used bytes
[out]freeBytesnumber of free bytes available
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxBufferAlloc()
uint32 mxfEmbeddedTxBufferInfoGet ( HMXF_BUFFER  buffer,
HMXF_DEVICE *  device,
uint64 *  index 
)
C#
public static extern UInt32 mxfEmbeddedTxBufferInfoGet(UInt64 buffer, out UInt64 device, out UInt64 index);

Returns the device handle and queue index pair from a MX-Embedded TX buffer handle.

Parameters
[in]bufferbuffer handle
[out]devicepointer to device handle. Pass NULL to ignore this parameter.
[out]indexpointer to queue index. Pass NULL to ignore this parameter.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxBufferAlloc()
mxfEmbeddedTxBufferGet()
uint32 mxfEmbeddedTxBufferClear ( HMXF_BUFFER  buffer)
C#
public static extern UInt32 mxfEmbeddedTxBufferClear(UInt64 buffer);

Clears the messages present in the MX-Embedded TX buffer.

Parameters
[in]bufferbuffer handle
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxBufferAlloc()
mxfEmbeddedTxBufferWrite()
mxfEmbeddedTxBufferRead()
uint32 mxfEmbeddedTxBufferWrite ( HMXF_BUFFER  buffer,
uint64  count,
MXF_EMBEDDED_DATAREC rec 
)
C#
public static extern UInt32 mxfEmbeddedTxBufferWrite(UInt64 buffer, UInt64 count, IntPtr rec);

Writes an array of records in the MX-Embedded TX buffer. MX-Embedded TX queues are used to transfer data from the host to the embedded. This function will write data in the MX-Embedded TX queue so the MX-Embedded application can read it with mxfEmbeddedTxBufferRead().

The data in the buffer is copied using 32-bit access. To avoid any endianness mapping issues, it is recommended to use only 32-bit data format for this buffer.

Parameters
[in]bufferbuffer handle
[in]countnumber of record(s) to write
[in]recarray of MXF_EMBEDDED_DATAREC records. The records are packed in the buffer. mxfNextRecordPtrGet() function must be used to navigate from one record to the other in the buffer.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxBufferAlloc()
mxfEmbeddedTxBufferStatusGet()
mxfEmbeddedTxBufferClear()
mxfEmbeddedTxBufferRead()
mxfNextRecordPtrGet()
mxfEmbeddedTxBufferWriteAsync()
uint32 mxfEmbeddedTxBufferWriteAsync ( HMXF_BUFFER  buffer,
uint64  count,
MXF_EMBEDDED_DATAREC hostBuffer,
MXF_ASYNCHRONOUS_CALLBACK  writeCompletion,
void *  context 
)
C#
public static extern UInt32 mxfEmbeddedTxBufferWriteAsync(UInt64 buffer, UInt64 count, IntPtr hostBuffer, MXF_ASYNCHRONOUS_CALLBACK writeCompletion, IntPtr context);

Writes asynchronously an array of records in the MX-Embedded TX buffer. MX-Embedded TX queues are used to transfer data from the host to the embedded. This function will write data in the MX-Embedded TX queue so the MX-Embedded application can read it with mxfEmbeddedTxBufferRead().

The function will return immediately after it has been registered to be executed by another thread. A callback function will be called when the asynchronous function has finished.

A maximum of 1000 asynchronous function calls can be queued.

The data in the buffer is copied using 32-bit access. To avoid any endianness mapping issues, it is recommended to use only 32-bit data format for this buffer.

Parameters
[in]bufferbuffer handle
[in]countnumber of record(s) to write
[in]hostBufferarray of MXF_EMBEDDED_DATAREC records. The records are packed in the buffer. mxfNextRecordPtrGet() function must be used to navigate from one record to the other in the buffer.
[in]writeCompletioncallback function to be called when write process has been completed. Callback function is defined as follow:
1 typedef void (*MXF_ASYNCHRONOUS_CALLBACK)(HMXF_BUFFER bufferHandle, uint32 result, void* context, uint64* output);
[in] bufferHandle: buffer handle.
[in] result: return code of the function.
[in] context: pointer to a value that has been passed for the callback.
[in] output: array of additional information. output[0] contains the number of records to write.
[in]contextpointer to a value that will be passed to the callback handler (optional).
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxBufferWrite()
uint32 mxfEmbeddedTxBufferAsyncEventInit ( HMXF_BUFFER  buffer,
uint64  almostEmpty,
void *  context,
MXF_ASYNCEVENT_BUFFER_HANDLER  callback 
)
C#
public static extern UInt32 mxfEmbeddedTxBufferAsyncEventInit(UInt64 buffer, UInt64 almostEmpty, IntPtr context, MXF_ASYNCEVENT_BUFFER_HANDLER callback);

Sets an async event handler for a Tx embedded buffer. When the almost empty threshold will be reached, the callback will be called once and will be called again only when the almost empty threshold will be reached again.

Parameters
[in]bufferTx embedded buffer handle
[in]almostEmptyalmost empty threshold value
[in]contexthandler callback context
[in]callbackTx embedded buffer callback handler

The callback handler function is defined as follow:

1 typedef uint32 (*MXF_ASYNCEVENT_BUFFER_HANDLER)(HMXF_BUFFER buffer, void* context);

[in] buffer: buffer handle [in] context: context pointer

Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.3.1 and later.
See also
mxfEmbeddedTxBufferAsyncEventTerminate()
mxfAsyncEventConditionsSet()
uint32 mxfEmbeddedTxBufferAsyncEventTerminate ( HMXF_BUFFER  buffer)
C#
public static extern UInt32 mxfEmbeddedTxBufferAsyncEventTerminate(UInt64 buffer);

Clears the async event handler for a Tx embedded buffer.

Parameters
[in]bufferTx embedded buffer handle
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.3.1 and later.
See also
mxfEmbeddedTxBufferAsyncEventInit()
mxfAsyncEventConditionsSet()
Updated 10/23/2023