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 94ACC45168 for ; Thu, 9 Feb 2023 15:58:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B3B9D68BE51; Thu, 9 Feb 2023 17:58:53 +0200 (EET) Received: from btbn.de (btbn.de [136.243.74.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C7A1F68BDC9 for ; Thu, 9 Feb 2023 17:58:47 +0200 (EET) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id CBA2535A762 for ; Thu, 9 Feb 2023 16:58:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1675958326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FS+VSSxCg0anZTH+UbuTocoM/rvUzbUZjG6E5UY2HuI=; b=aRNxU2qOVDiBk3TeKU5qrXREhxxqDAvL5yB3FWbESr3mkUX6chXXX6knAl8cGS1yIL8w4f 4PLg+ysFxSr91YiulJho3/oYQZ4LI63/OTEOuwSO69ag8i1YuxmE8KBwcPbdPgbZRC3RXa PXErOA29fL8F6rtUnT2jMC1Xt8OEDViKq4sFl+PHFrLOjRSA1FUGafqA9A4mBxQ35xMJW8 bXsbo+MN7YZOF3wd2piypsc/4HlP9DsdSCTlsjfIMfX5DyWKBqThMaMwyCFyfPG1jacewm IErd4g4HTLYFr1aQeyUNQwbU1oKBfxFd6+DNHwUhEa9pykqkiMT3zEd8wR27Bg== Message-ID: <78ebed94-3730-7054-677b-40c99f7b8615@rothenpieler.org> Date: Thu, 9 Feb 2023 16:58:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 To: ffmpeg-devel@ffmpeg.org References: <20230209142255.38657-1-aline.gondimsantos@savoirfairelinux.com> Content-Language: en-US From: Timo Rothenpieler In-Reply-To: <20230209142255.38657-1-aline.gondimsantos@savoirfairelinux.com> Subject: Re: [FFmpeg-devel] [PATCH] avdevice: add dxgigrab 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 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: On 09.02.2023 15:22, aline.gondimsantos@savoirfairelinux.com wrote: > From: Aline Gondim Santos > > A dxgi grab device may be either a display or a window. > Differently from the existing gdigrab, this new device does > not make the mouse to flick and also allows proper grabbing of > accelerated windows, such as chrome or visual studio code. How do you get access to the d3d hwdevice, given this lives in lavd, which has no provisions for that? This looks much more like it'd fit in with the desktop duplication capture, which ended up being a vsrc filter for that reason. > Signed-off-by: Aline Gondim Santos > --- > configure | 1 + > libavdevice/Makefile | 4 + > libavdevice/alldevices.c | 1 + > libavdevice/d3dHelpers.h | 59 ++++++++ > libavdevice/direct3d11.interop.h | 51 +++++++ > libavdevice/dxgigrab.cpp | 225 +++++++++++++++++++++++++++++++ > libavdevice/dxgigrab.h | 83 ++++++++++++ > libavdevice/dxgigrab_c.c | 59 ++++++++ > libavdevice/dxgigrab_c.h | 98 ++++++++++++++ > libavdevice/windows_capture.cpp | 184 +++++++++++++++++++++++++ > libavdevice/windows_capture.h | 82 +++++++++++ The name of these files seem way too generic to just sit there like this in the top level. > 11 files changed, 847 insertions(+) > create mode 100644 libavdevice/d3dHelpers.h > create mode 100644 libavdevice/direct3d11.interop.h > create mode 100644 libavdevice/dxgigrab.cpp > create mode 100644 libavdevice/dxgigrab.h > create mode 100644 libavdevice/dxgigrab_c.c > create mode 100644 libavdevice/dxgigrab_c.h > create mode 100644 libavdevice/windows_capture.cpp > create mode 100644 libavdevice/windows_capture.h > > diff --git a/configure b/configure > index 12184c7f26..c9cbee0c09 100755 > --- a/configure > +++ b/configure > @@ -3529,6 +3529,7 @@ fbdev_outdev_deps="linux_fb_h" > gdigrab_indev_deps="CreateDIBSection" > gdigrab_indev_extralibs="-lgdi32" > gdigrab_indev_select="bmp_decoder" > +dxgigrab_indev_extralibs="-ldxgi -ld3d11" > iec61883_indev_deps="libiec61883" > iec61883_indev_select="dv_demuxer" > jack_indev_deps="libjack" > diff --git a/libavdevice/Makefile b/libavdevice/Makefile > index 8a62822b69..6740012000 100644 > --- a/libavdevice/Makefile > +++ b/libavdevice/Makefile > @@ -30,6 +30,7 @@ OBJS-$(CONFIG_FBDEV_INDEV) += fbdev_dec.o \ > OBJS-$(CONFIG_FBDEV_OUTDEV) += fbdev_enc.o \ > fbdev_common.o > OBJS-$(CONFIG_GDIGRAB_INDEV) += gdigrab.o > +OBJS-$(CONFIG_DXGIGRAB_INDEV) += windows_capture.o dxgigrab.o dxgigrab_c.o > OBJS-$(CONFIG_IEC61883_INDEV) += iec61883.o > OBJS-$(CONFIG_JACK_INDEV) += jack.o timefilter.o > OBJS-$(CONFIG_KMSGRAB_INDEV) += kmsgrab.o > @@ -72,5 +73,8 @@ SKIPHEADERS-$(CONFIG_V4L2_INDEV) += v4l2-common.h > SKIPHEADERS-$(CONFIG_V4L2_OUTDEV) += v4l2-common.h > SKIPHEADERS-$(CONFIG_ALSA) += alsa.h > SKIPHEADERS-$(CONFIG_SNDIO) += sndio.h > +SKIPHEADERS-$(CONFIG_DXGIGRAB_INDEV) += dxgigrab.h \ > + windows_capture.h \ > + dxgigrab_c.h > > TESTPROGS-$(CONFIG_JACK_INDEV) += timefilter > diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c > index 22323a0a44..fb0a37513b 100644 > --- a/libavdevice/alldevices.c > +++ b/libavdevice/alldevices.c > @@ -35,6 +35,7 @@ extern const AVInputFormat ff_dshow_demuxer; > extern const AVInputFormat ff_fbdev_demuxer; > extern const AVOutputFormat ff_fbdev_muxer; > extern const AVInputFormat ff_gdigrab_demuxer; > +extern const AVInputFormat ff_dxgigrab_demuxer; > extern const AVInputFormat ff_iec61883_demuxer; > extern const AVInputFormat ff_jack_demuxer; > extern const AVInputFormat ff_kmsgrab_demuxer; > diff --git a/libavdevice/d3dHelpers.h b/libavdevice/d3dHelpers.h > new file mode 100644 > index 0000000000..d8d2c003ec > --- /dev/null > +++ b/libavdevice/d3dHelpers.h > @@ -0,0 +1,59 @@ > +/* > + * This file is part of FFmpeg. > + * > + * FFmpeg is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public License > + * as published by the Free Software Foundation; either version 2.1 > + * of the License, or (at your option) any later version. > + * > + * FFmpeg is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with FFmpeg; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA > + */ > + > +#pragma once > + > +#include > +#include > +#include Are these headers parts of any normal windows SDK? I don't see them in anything mingw has. Does this break cross compiling from Linux, or with anything that's not MSVC? And given it's winrt... does this work on normal Desktop Windows? _______________________________________________ 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".