[FFmpeg-devel] [PATCH] avdevice/gdigrab: client_only option to discard decorations such as titlebar or borders

Moritz Barsnick barsnick at gmx.net
Wed Jun 24 12:29:55 EEST 2020


On Fri, Jun 19, 2020 at 10:33:00 +0200, Sergio Acereda wrote:

> +static int
> +calc_titlebar_height(HWND hwnd) {

Nit: the opening bracket of a function belongs in the next line.

>         GetClientRect(hwnd, &virtual_rect);
> +        if (gdigrab->client_only) {
> +            int cxborder = GetSystemMetrics(SM_CXBORDER);
> +            int cyborder = GetSystemMetrics(SM_CYBORDER);
> +            int titlebar_height = calc_titlebar_height(hwnd);
> +            virtual_rect.left   += cxborder;
> +            virtual_rect.right  += -cxborder;
> +            virtual_rect.top    += cxborder + titlebar_height;
> +            virtual_rect.bottom += -cyborder;
> +        }

Does this actually work correctly? Just wondering, as I read this:
https://stackoverflow.com/a/11707312/3974309
I can't test, sorry.

> +    { "client_only", "client only", OFFSET(client_only), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },

Please also update the documentation (doc/indevs.texi).

Thanks,
Moritz


More information about the ffmpeg-devel mailing list