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 2925D41000 for ; Thu, 9 Feb 2023 22:00:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0278968BE8D; Fri, 10 Feb 2023 00:00:12 +0200 (EET) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3C17168BBF0 for ; Fri, 10 Feb 2023 00:00:05 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 80B681BF205 for ; Thu, 9 Feb 2023 22:00:04 +0000 (UTC) Date: Thu, 9 Feb 2023 23:00:03 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230209220003.GW1949656@pb2> References: <20230209142255.38657-1-aline.gondimsantos@savoirfairelinux.com> <78ebed94-3730-7054-677b-40c99f7b8615@rothenpieler.org> MIME-Version: 1.0 In-Reply-To: <78ebed94-3730-7054-677b-40c99f7b8615@rothenpieler.org> 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-Type: multipart/mixed; boundary="===============3055529168159668498==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3055529168159668498== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pFUYyEv/SkCmkazq" Content-Disposition: inline --pFUYyEv/SkCmkazq Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 09, 2023 at 04:58:46PM +0100, Timo Rothenpieler wrote: > On 09.02.2023 15:22, aline.gondimsantos@savoirfairelinux.com wrote: > > From: Aline Gondim Santos > >=20 > > 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. >=20 > 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 captur= e, > which ended up being a vsrc filter for that reason. >=20 > > 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 +++++++++++ >=20 > The name of these files seem way too generic to just sit there like this = in > the top level. >=20 > > 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 > >=20 > > diff --git a/configure b/configure > > index 12184c7f26..c9cbee0c09 100755 > > --- a/configure > > +++ b/configure > > @@ -3529,6 +3529,7 @@ fbdev_outdev_deps=3D"linux_fb_h" > > gdigrab_indev_deps=3D"CreateDIBSection" > > gdigrab_indev_extralibs=3D"-lgdi32" > > gdigrab_indev_select=3D"bmp_decoder" > > +dxgigrab_indev_extralibs=3D"-ldxgi -ld3d11" > > iec61883_indev_deps=3D"libiec61883" > > iec61883_indev_select=3D"dv_demuxer" > > jack_indev_deps=3D"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) +=3D fbdev_d= ec.o \ > > OBJS-$(CONFIG_FBDEV_OUTDEV) +=3D fbdev_enc.o \ > > fbdev_common.o > > OBJS-$(CONFIG_GDIGRAB_INDEV) +=3D gdigrab.o > > +OBJS-$(CONFIG_DXGIGRAB_INDEV) +=3D windows_capture.o dxgigr= ab.o dxgigrab_c.o > > OBJS-$(CONFIG_IEC61883_INDEV) +=3D iec61883.o > > OBJS-$(CONFIG_JACK_INDEV) +=3D jack.o timefilter.o > > OBJS-$(CONFIG_KMSGRAB_INDEV) +=3D kmsgrab.o > > @@ -72,5 +73,8 @@ SKIPHEADERS-$(CONFIG_V4L2_INDEV) +=3D v4l2-co= mmon.h > > SKIPHEADERS-$(CONFIG_V4L2_OUTDEV) +=3D v4l2-common.h > > SKIPHEADERS-$(CONFIG_ALSA) +=3D alsa.h > > SKIPHEADERS-$(CONFIG_SNDIO) +=3D sndio.h > > +SKIPHEADERS-$(CONFIG_DXGIGRAB_INDEV) +=3D dxgigrab.h \ > > + windows_capture.h \ > > + dxgigrab_c.h > > TESTPROGS-$(CONFIG_JACK_INDEV) +=3D 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 >=20 > 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? not just cross compile, this patch breaks normal build on linux make CXX libavdevice/dxgigrab.o cc1plus: warning: command line option =E2=80=98-Wdeclaration-after-statemen= t=E2=80=99 is valid for C/ObjC but not for C++ cc1plus: warning: command line option =E2=80=98-Wmissing-prototypes=E2=80= =99 is valid for C/ObjC but not for C++ cc1plus: warning: command line option =E2=80=98-Wstrict-prototypes=E2=80=99= is valid for C/ObjC but not for C++ cc1plus: warning: command line option =E2=80=98-Wno-pointer-sign=E2=80=99 i= s valid for C/ObjC but not for C++ cc1plus: warning: =E2=80=98-Werror=3D=E2=80=99 argument =E2=80=98-Werror=3D= implicit-function-declaration=E2=80=99 is not valid for C++ cc1plus: warning: =E2=80=98-Werror=3D=E2=80=99 argument =E2=80=98-Werror=3D= missing-prototypes=E2=80=99 is not valid for C++ cc1plus: warning: command line option =E2=80=98-std=3Dc11=E2=80=99 is valid= for C/ObjC but not for C++ In file included from libavdevice/dxgigrab.h:37:0, from libavdevice/dxgigrab.cpp:29: libavdevice/dxgigrab_c.h:43:10: fatal error: windows.h: No such file or dir= ectory #include ^~~~~~~~~~~ compilation terminated. ffbuild/common.mak:84: recipe for target 'libavdevice/dxgigrab.o' failed make: *** [libavdevice/dxgigrab.o] Error 1 [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answe= r. --pFUYyEv/SkCmkazq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCY+Vs3AAKCRBhHseHBAsP q06PAJwMW7JJkONlJl4his1yygSAWRcJ+QCgmTPw+L4Ikj/lfAAlumRtF+jmvPU= =af+U -----END PGP SIGNATURE----- --pFUYyEv/SkCmkazq-- --===============3055529168159668498== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============3055529168159668498==--