<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1484741426272_19431">Hello. I want to grab frames from a v4l2 device in an event-driven main loop().</div><div id="yui_3_16_0_ym19_1_1484741426272_19431"><br></div><div id="yui_3_16_0_ym19_1_1484741426272_19432">1) Is there a select()-like function in the libav library that gives me notification when a frame has been read, and waits otherwise?</div><div id="yui_3_16_0_ym19_1_1484741426272_19433">2) Alternatively, is there a way to obtain the file descriptor of the opened device (I open it with avformat_open_input() ), so I can put it in the standard select() function?</div><div id="yui_3_16_0_ym19_1_1484741426272_19434">3) If 2 is true, is it safe to access this fd from the main loop() or it can be shared between internal threads?</div><div id="yui_3_16_0_ym19_1_1484741426272_19435"><br id="yui_3_16_0_ym19_1_1484741426272_19436"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1484741426272_19437">Thanks</div></div></body></html>