We are developing an application on DM648 that captures video, encode it and then finally send it through the net. We want to decouple all these activities using a task, so 3 task will be running in the end. So far we are focusing on the data transfer from the task that encode data. After having read all documentation we had at hand, we reckon that the best method would be using SIO through DPI device using the issue/reclaim model. I would like to know if you agree with this approach or you would use a different one.
Right now we have a statically created pair of SIO devices, one output SIO where the encoding task issues data, and another input SIO where the network task reclaims data. We suppose these two SIO have been connected internally somewhere, but we are not very sure, since we have not access to the SIO source code and we haven't see any example showing the usage we intend.
Our problem currently is that there are some inconsistencies when data is returned by SIO_reclaim, as specified in the DSPBIOS API reference should return the number of MADUs, but in our case the function returns a pointer to one of the element in the queues of the device. This fact is making us to reconsider the approach, but before we make any change, we'd like to hear opinions and comments.
A nearly, but not exactly valid C code illustrating our case would be:
SIO_Handle outStr=&SIO0,inStr=&SIO1; void task1() { uint8 *encodedBuf; int encodedSize,status; do { getEncodedbuf(&encodedBuf, &encodedSize); status=SIO_issue(outStr,encodedBuf,encodedSize,NULL); }while(!error); } void task2() { uint8 *data; int dataSize,arg; do{ dataSize=SIO_reclaim(inStr,&data,&arg); sendData(data,dataSize); }while(!error); }
Thanks in advance.
Raúl