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 0B06648117 for ; Mon, 11 Dec 2023 01:59:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3EA2268D287; Mon, 11 Dec 2023 03:59:18 +0200 (EET) Received: from nihil.gay (nihil.gay [157.90.242.5]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 78AEA68D283 for ; Mon, 11 Dec 2023 03:59:12 +0200 (EET) Received: from localhost.localdomain (host-79-54-140-248.retail.telecomitalia.it [79.54.140.248]) (Authenticated sender: lena@nihil.gay) by nihil.gay (Postfix) with ESMTPSA id EA9F69D31F; Mon, 11 Dec 2023 01:59:11 +0000 (UTC) To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Dec 2023 02:52:01 +0100 Message-ID: <20231211015651.114219-2-lena@nihil.gay> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Subject: Re: [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 , Andreas Rheinhardt Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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".