[FFmpeg-devel] [PATCH v3] avdevice/xcbgrab: Add select_region option

Omar Emara mail at omaremara.dev
Sat Jul 4 22:20:21 EEST 2020


> Probably a good idea to check the success of this function (and log error).
> Otherwise, xcb_wait_for_event() will just block and you can't send an interrupt
> with ctrl-c because of xcb_grab_server() below.

Can you elaborate? I am not entirely familiar with how logging works.
Should I pass AVFormatContext to the select_region function, call av_log with
AV_LOG_ERROR, and return the zero initialized rectangle?

> > +    xcb_grab_server(connection);
>
> Is there any way to do this without blocking requests from other x11 clients?
> Maybe by drawing your own window?

It should be possible using the X Shapes extension similar to how we do the
show_region option. However, Rubber Banding is more portable and more
efficient, the only downside of grabbing the server would be missing redraws
and WM operations, which are not really important when you are selecting a
region. This is also how we implemented ImageMagick's import command.
So in my opinion, this is the right approach. What do you think?


More information about the ffmpeg-devel mailing list