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) |
uint32 mxfEmbeddedTxBufferAlloc | ( | HMXF_DEVICE | device, |
uint64 | index, | ||
uint64 | size, | ||
HMXF_BUFFER * | buffer, | ||
uint64 * | 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.
[in] | device | device handle |
[in] | index | queue index |
[in] | size | queue size in bytes |
[out] | buffer | returned buffer handle |
[out] | allocated | returned allocated size. Optional, pass NULL to if not needed. |
uint32 mxfEmbeddedTxBufferGet | ( | HMXF_DEVICE | device, |
uint64 | index, | ||
HMXF_BUFFER * | buffer | ||
) |
Returns the buffer handle referenced by the device handle and queue index pair.
[in] | device | device handle |
[in] | index | queue index |
[out] | buffer | returned buffer handle |
uint32 mxfEmbeddedTxBufferFree | ( | HMXF_BUFFER | buffer | ) |
Deallocates the memory previously allocated by mxfEmbeddedTxBufferAlloc().
[in] | buffer | buffer handle. |
uint32 mxfEmbeddedTxBufferStatusGet | ( | HMXF_BUFFER | buffer, |
uint64 * | msgCount, | ||
uint64 * | pendingBytes, | ||
uint64 * | freeBytes | ||
) |
Returns the status of the MX-Embedded TX buffer. command IDs.
[in] | buffer | buffer handle |
[out] | msgCount | number of messages in the queue |
[out] | pendingBytes | number of used bytes |
[out] | freeBytes | number of free bytes available |
uint32 mxfEmbeddedTxBufferInfoGet | ( | HMXF_BUFFER | buffer, |
HMXF_DEVICE * | device, | ||
uint64 * | index | ||
) |
Returns the device handle and queue index pair from a MX-Embedded TX buffer handle.
[in] | buffer | buffer handle |
[out] | device | pointer to device handle. Pass NULL to ignore this parameter. |
[out] | index | pointer to queue index. Pass NULL to ignore this parameter. |
uint32 mxfEmbeddedTxBufferClear | ( | HMXF_BUFFER | buffer | ) |
Clears the messages present in the MX-Embedded TX buffer.
[in] | buffer | buffer handle |
uint32 mxfEmbeddedTxBufferWrite | ( | HMXF_BUFFER | buffer, |
uint64 | count, | ||
MXF_EMBEDDED_DATAREC * | 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.
[in] | buffer | buffer handle |
[in] | count | number of record(s) to write |
[in] | rec | array 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. |
uint32 mxfEmbeddedTxBufferWriteAsync | ( | HMXF_BUFFER | buffer, |
uint64 | count, | ||
MXF_EMBEDDED_DATAREC * | hostBuffer, | ||
MXF_ASYNCHRONOUS_CALLBACK | writeCompletion, | ||
void * | 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.
[in] | buffer | buffer handle |
[in] | count | number of record(s) to write |
[in] | hostBuffer | array 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] | writeCompletion | callback function to be called when write process has been completed. Callback function is defined as follow: [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] | context | pointer to a value that will be passed to the callback handler (optional). |
uint32 mxfEmbeddedTxBufferAsyncEventInit | ( | HMXF_BUFFER | buffer, |
uint64 | almostEmpty, | ||
void * | 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.
[in] | buffer | Tx embedded buffer handle |
[in] | almostEmpty | almost empty threshold value |
[in] | context | handler callback context |
[in] | callback | Tx embedded buffer callback handler |
The callback handler function is defined as follow:
[in] buffer: buffer handle [in] context: context pointer
uint32 mxfEmbeddedTxBufferAsyncEventTerminate | ( | HMXF_BUFFER | buffer | ) |
Clears the async event handler for a Tx embedded buffer.
[in] | buffer | Tx embedded buffer handle |