#217 Improvements to V4L2

Unstable_(example)
closed-accepted
nobody
PTLib (107)
5
2012-11-15
2012-10-22
Anonymous
No

Hi Robert,

I wrote some additional improvements for the V4L2 plugin. First, it fixes an issue, when the camera is opened the first time and DQBUF blocks for about 3 seconds. It uses select() to trigger the camera if there are new images in the Q.

Second, it fixes the issue with the stopMutex by Alexander Sbitnev. If the mutex is only used in Stop(), another thread may access GetFrameDataNoDelay while the cam was closed before for instance to change the resolution. So, the mutex must be kept alive as long as the other thread try to set up the cam and re-opens the device for reading. Additionally, it will speed up the hole cam process a lot.

Third, I added the TRY_FMT function before actually setting the format in SetFrameSize. As this may cause the cam to close and reopen, TRY_FMT tries to check the capabilities first and if it is not possible, it will work anyway.

Discussion

  • Patch applied to Eridano (PTLib 2.12, OPAL 3.12) and trunk, thank you very much!

     
    • status: open --> closed-accepted
     
  • Patch applied to Eridano (PTLib 2.12, OPAL 3.12) and trunk, thank you very much!