From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 8790645A50 for ; Sun, 10 Dec 2023 22:10:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3E1C468D10C; Mon, 11 Dec 2023 00:10:49 +0200 (EET) Received: from nihil.gay (nihil.gay [157.90.242.5]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5773A68D087 for ; Mon, 11 Dec 2023 00:10:42 +0200 (EET) Received: from [10.0.0.2] (host-79-54-140-248.retail.telecomitalia.it [79.54.140.248]) (Authenticated sender: lena@nihil.gay) by nihil.gay (Postfix) with ESMTPSA id CC1449C91B for ; Sun, 10 Dec 2023 22:10:41 +0000 (UTC) Message-ID: <719e708c-25a8-422d-8392-6a837b138fe3@nihil.gay> Date: Sun, 10 Dec 2023 23:10:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org Content-Language: en-US Subject: [FFmpeg-devel] [PATCH] gdigrab: Allow capturing a window by its handle X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Lena via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: Lena Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: x11grab can capture windows by their ID, but gdigrab can only capture windows by their names, internally calling FindWindowW to lookup its handle. This patch simply allows the user to specify a window handle directly. Signed-off-by: Lena --- libavdevice/gdigrab.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavdevice/gdigrab.c b/libavdevice/gdigrab.c index c069232472..05d3c0c929 100644 --- a/libavdevice/gdigrab.c +++ b/libavdevice/gdigrab.c @@ -273,9 +273,13 @@ gdigrab_read_header(AVFormatContext *s1) } } else if (!strcmp(filename, "desktop")) { hwnd = NULL; + } else if (!strncmp(filename, "hwnd=", 5)) { + name = filename + 5; + + hwnd = strtol(name, NULL, 0); } else { av_log(s1, AV_LOG_ERROR, - "Please use \"desktop\" or \"title=\" to specify your target.\n"); + "Please use \"desktop\", \"title=\" or \"hwnd=\" to specify your target.\n"); ret = AVERROR(EIO); goto error; } -- 2.43.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".