Using DVSDK 4, DM368, H264
I've got my H264 streaming encoder working, but having trouble with the decoder. As a test I have my decoder capture the incoming RTP packets, strip the RTP header, reconstruct the NALU from RTP format back to the encoded stream format, then write to a file. The file plays with the dvsdk decode sample app and VideoLan client.
When I try to pass the same buffer to Vdec2_process is when the problems start. I'm using code that came from the DVSDK sample app. The first problem I have is that I run out of display buffers. Each time I call Vdec2_process I give it a new picture buffer from a fifo that the display thread uses to send buffers back to the decode thread. That fifo is loaded with display buffers on init.
When I make the call to handleCodecBufs it appears that no buffers are being sent to the display thread. I'm assuming that the decode may not be able to decode the data and therefore no picture.
My first question is....
if the Vdec2_process can't decode the data to create a display buffer, then how do I get the buffer back? My decode thread needs to be aware that the display buffer I took from the fifo can be reused. There seems to be no provision in the code for this situation.
Next question is....
Why do we give the decoder the buftab with Vdec2_setBufTab? If I'm giving it display buffers then why does it need the BufTab?
As a test I return the display buffer to the fifo after calling Vdec2_process. I know that's going to confuse things if a buffer does get sent to the display thread, but I was able to get continuous operation without stalling for a display buffer. I was able to get some decoded picture output although it was horribly trashed. You could almost get a clear frame on occasion. I also got an overwheming number of the following error messages...
VICP Error: VICP_wait() ioctl failed: -1
I'm not sure why my application is having so much trouble getting a decoded picture when the same data is played ok by the sample decode app and VLC. But if I can get a better understanding of the buffer handling it will help.
John A