Transmission with relative record timing means the records are scheduled one after another based on the delta time tag set.
The option MXF_TXAPERIODIC_FLAG_USE_RECORD_RELATIVE_TIME
is used to perform this function.
For instance, for an array of n records to transmit, the records transmit timing is as follows:
Time record 1 = record 1 time tag (offset from current time)
Time record 2 = Time record 1 + (record 2 time tag - record 1 time tag)
Time record 3 = Time record 2 + (record 3 time tag - record 2 time tag)
......
Time record n = Time record n-1 + (record n time tag - record n-1 time tag)
Each time tag becomes relative to the previous record sent.
csdb_aperiodic.c
#define BUFFER_SIZE 4096 // 4KB
#define MAX_TX_RECORDS_TO_TRANSMIT 8
#define BLOCKCOUNT 6
HMXF_SERVER server;
HMXF_DEVICE device;
HMXF_CHANNEL txChannel;
HMXF_BUFFER txBuffer=0;
HMXF_CSDB_DATAREC *recCsdb=NULL;
HMXF_CSDB_DATAREC *rec;
uint32 record;
uint64 delay100ms = 100000;
uint32 rc;
uint64 currentTime;
...
if (!rc)
if (!rc)
if (!rc)
{
if (!recCsdb)
rc = MAXT_ERROR_MEM;
}
rec = recCsdb;
for (record=0, currentTime=100000; record<MAX_TX_RECORDS_TO_TRANSMIT; record++)
{
if(record == 0)
{
rec->timeTag = currentTime+((record+1)*10000LL);
rec->control = 0;
rec->repeatCount = 1;
rec->reserved = 0;
for(dataIdx=0; dataIdx<BLOCKCOUNT; dataIdx++)
rec->data[dataIdx] = 0xA5;
}
else
{
rec->timeTag = currentTime+((record+1)*10000LL);
rec->control = 0;
rec->repeatCount = 1;
rec->reserved = 0;
rec->data[0] = 8;
rec->data[1] = 1;
for(dataIdx=2; dataIdx<BLOCKCOUNT; dataIdx++)
rec->data[dataIdx] = (uint8)(3*record);
}
}
if (!rc)
rc =
mxfCSDBTxAperiodicWrite(txBuffer, MXF_TXAPERIODIC_FLAG_USE_RECORD_RELATIVE_TIME, 0, MAX_TX_RECORDS_TO_TRANSMIT, recCsdb);
if (recCsdb)
free(recCsdb);
...