0

I just started looking into V4L2 and all the samples I can find use loops to poll images from the camera. Is there a way to register a callback instead of looping? I can't figure out when to poll images and it does not seem like a good idea to just poll all the time, or is it?

This is the sample I am currently looking at> https://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html Is some part of the mainloop blocking and waits for the next frame?

BT9
  • 87
  • 1
  • 11

1 Answers1

0

Well, since nobody seemed to know a possibility to do this, I implemented it myself. The frame polling is indeed blocking and waits for the next frame, so it is enough to start a thread that polls the frame and calls the callback method once a new frame is retrieved.

BT9
  • 87
  • 1
  • 11