From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avdevice: add dxgigrab
Date: Thu, 9 Feb 2023 23:00:03 +0100
Message-ID: <20230209220003.GW1949656@pb2> (raw)
In-Reply-To: <78ebed94-3730-7054-677b-40c99f7b8615@rothenpieler.org>
[-- Attachment #1.1: Type: text/plain, Size: 7154 bytes --]
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 <aline.gondimsantos@savoirfairelinux.com>
> >
> > 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 <aline.gondimsantos@savoirfairelinux.com>
> > ---
> > 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 <winrt/Windows.UI.Composition.h>
> > +#include <windows.ui.composition.interop.h>
> > +#include <d2d1_1.h>
>
> 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 ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wno-pointer-sign’ is valid for C/ObjC but not for C++
cc1plus: warning: ‘-Werror=’ argument ‘-Werror=implicit-function-declaration’ is not valid for C++
cc1plus: warning: ‘-Werror=’ argument ‘-Werror=missing-prototypes’ is not valid for C++
cc1plus: warning: command line option ‘-std=c11’ 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 directory
#include <windows.h>
^~~~~~~~~~~
compilation terminated.
ffbuild/common.mak:84: recipe for target 'libavdevice/dxgigrab.o' failed
make: *** [libavdevice/dxgigrab.o] Error 1
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
There will always be a question for which you do not know the correct answer.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
prev parent reply other threads:[~2023-02-09 22:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-09 14:22 aline.gondimsantos
2023-02-09 15:58 ` Timo Rothenpieler
2023-02-09 16:10 ` Nicolas George
2023-02-09 16:38 ` Timo Rothenpieler
2023-02-09 19:01 ` Aline Gondim Santos Gondim Santos
2023-02-09 22:00 ` Michael Niedermayer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230209220003.GW1949656@pb2 \
--to=michael@niedermayer.cc \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git