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 4E8DC48626 for ; Tue, 12 Dec 2023 00:47:24 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 371C568D1FB; Tue, 12 Dec 2023 02:47:22 +0200 (EET) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3B56D68D0EC for ; Tue, 12 Dec 2023 02:47:16 +0200 (EET) Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40c1e3ea2f2so52945785e9.2 for ; Mon, 11 Dec 2023 16:47:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702342035; x=1702946835; darn=ffmpeg.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=kq1vuoW6/P8qYOMtf82VoEAgJKoGUaA7pv9K57cF5EI=; b=cQ8eUqFTzh9oWZ/xoWLMs+j4QmnQe0So0taX2XqYIzPiVx0Fdw6MhftJZcGpcYgUit O0ikPw3LoDA6+COF4Eh8gA3utzlNg+U5R5hPgJkRk6c0+Uik8rgMMcAO8ZVg+94XbppF o7nvr5ycQq56wEDLVSFt8URh4woGueIOJfu1m+rcjPTjClTo4vekQj+O/swpels7eHwM kLIX8ROIxvvr20vSi4JqSmdRrIwbTi+g791sz0AlzJTYIEY29haRdCQ/HcnqN3j2eUp4 4hB/uNaf1SvTFlgI4SOunSJmNSqo4ztzial4B8a47oxYg4/kjReqN00dO5FZikC4IWKe U/FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702342035; x=1702946835; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kq1vuoW6/P8qYOMtf82VoEAgJKoGUaA7pv9K57cF5EI=; b=t1/QPskxwV3Aa7vjElawt/c/FKnyVDnZ+a6pazVhs6sDJ5WbY0kHZVJSrZDyQUPNLk THymTme9jSA7UvGf5FBlWX0NN4wg65nvrfbQauMeeuAVlg0u+q9w0o9Ws6c2nFSlNL+3 v8RK9k1heGa7R03jNeFCqtBKwzdGxRwhDaNN9Yv6ITY17vrsoKBn2b+5/W1ZK3yPK2Ow 5EsLJ5Q9Gk775Ni0+JdMLa3NxaFm/+7qcHFw3bVez2T1GWGCCD1cUlNxy2zSo2LOojtR j4CGdFzbfpVLz8wRkKHECMC7xp4AgDeX2usTPDgZ+MB6inB8ecnaJa85ifeN0YsFqqI5 beHQ== X-Gm-Message-State: AOJu0Yws2xHGPSPvlIhYh5aCVzFwGNNPdB76G9FcbgL5QekgURkkB+Ch mH+7ld/YKj++o9zodICqidttftKAvXw= X-Google-Smtp-Source: AGHT+IEuNBli99ATv6jrcnSiSAOKXzwNmcfdT7YpNnh3TOn6eh/7OsbSwgbM1NE4/x9GK1vIVYEfUQ== X-Received: by 2002:a05:600c:1d10:b0:40c:50c:9f3f with SMTP id l16-20020a05600c1d1000b0040c050c9f3fmr3180222wms.95.1702342035196; Mon, 11 Dec 2023 16:47:15 -0800 (PST) Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it. [84.220.189.10]) by smtp.gmail.com with ESMTPSA id v6-20020a05600c444600b0040c46ba7b66sm5678359wmn.48.2023.12.11.16.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 16:47:14 -0800 (PST) Received: by mariano (Postfix, from userid 1000) id C64FBBFCDA; Tue, 12 Dec 2023 01:47:13 +0100 (CET) Date: Tue, 12 Dec 2023 01:47:13 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches , Lena , Andreas Rheinhardt References: <20231211015651.114219-2-lena@nihil.gay> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231211015651.114219-2-lena@nihil.gay> User-Agent: Mutt/2.1.4 (2021-12-11) 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: , 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: On date Monday 2023-12-11 02:52:01 +0100, ffmpeg-devel Mailing List wrote: > 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(-) Missing doc/indevs.texi updates. > 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); This should fail in case the parsing failed, for this you can check the second argument (see examples in the code). _______________________________________________ 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".