(Linux on 6467T, DVSDK 3.10)
I wanted to decouple the stages in the example encoder application, to reduce dead time in ARM code.
As an initial step, I created a Fifo and used Fifo_put() to put the capture buffer from Capture_get() into the fifo.
I then immediately performed a Fifo_get() with a different destination buffer handle to use the buffer in the Ccv stage.
This all seems to work OK.
Next step was to move the Capture_get() and Fifo_put() into a separate thread of equal priority.
This new thread seems to work OK until it runs out of capture buffers (2!) .
However the main encoder loop with Fifo_get() just hangs on the Fifo_get as if there is nothing there - which is true initially but of course the thread should wake up once the Fifo is non-empty.
I have even tried putting a sched_yield() or usleep(1000) after the Fifo_put() in case there is some thread issue, but to no avail.
Is there any reason the Fifo_get() thread might not wake up again ?
I have experimented sucessfully with an alternative using a semaphore between the threads and using the same buffer handle - this seems to work OK, the capture thread gets the captured buffer, signals the other thread which wakes up and processes it, signals it is done with the buffer which is then captured again.
However this is limited in application, Fifo should be the way to go !
PS the forum was not accepting posts yesterday !