Windows: README update; use d3d11 as default videosink

This commit is contained in:
F. Duncanh
2025-05-07 13:09:46 -04:00
parent 7fc5f4d9b9
commit 3bb34553c0
4 changed files with 176 additions and 105 deletions

View File

@@ -852,22 +852,38 @@ href="https://www.msys2.org">https://www.msys2.org/</a>. Accept the
default installation location <code>C:\mysys64</code>.</p></li>
<li><p><a href="https://packages.msys2.org/package/">MSYS2 packages</a>
are installed with a variant of the “pacman” package manager used by
Arch Linux. Open a “MSYS2 MINGW64” terminal from the MSYS2 tab in the
Windows Start menu, and update the new MSYS2 installation with “pacman
-Syu”. Then install the <strong>MinGW-64</strong> compiler and
<strong>cmake</strong></p>
<pre><code>pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc</code></pre>
<p>The compiler with all required dependencies will be installed in the
msys64 directory, with default path <code>C:/msys64/mingw64</code>. Here
we will simply build UxPlay from the command line in the MSYS2
environment (this uses “<code>ninja</code>” in place of
<code>make</code>” for the build system).</p></li>
Arch Linux. Open a “MSYS2” terminal from the MSYS2 tab in the Windows
Start menu, and update the new MSYS2 installation with “pacman
-Syu”.</p>
<ul>
<li>_NEW: MSYS2 now recommends using the newer UCRT64 terminal
environment (which uses the newer Microsoft UCRT “Universal C RunTime
Library, included as part of the Windows OS since Windows 10) rather
than the MINGW64 terminal environment (which uses the older Microsoft
MSVCRT C library, which has “legacy” status, but is available on all
Windows systems). If you wish to use the legacy MSVCRT library, to
support older Windows versions, modify the instructions below as
follows:</li>
</ul>
<ol type="1">
<li>change the MSYS2 terminal type from UCRT64 to MINGW64; (2) modify
mingw-w64-ucrt-x86_64-* package names to mingw-w64-x86_64-*, (just omit
“-ucrt”);</li>
<li>replace <code>ucrt64</code> by <code>mingw64</code> in directory
names._</li>
</ol>
<p>Open a new MSYS2 UCRT64 terminal, and install the gcc compiler and
cmake:</p>
<p><code>pacman -S mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-gcc</code></p>
<p>We will simply build UxPlay from the command line in the MSYS2
environment (using “<code>ninja</code>” in place of “<code>make</code>
for the build system).</p></li>
<li><p>Download the latest UxPlay from github <strong>(to use
<code>git</code>, install it with <code>pacman -S git</code>, then
<code>git clone https://github.com/FDH2/UxPlay</code>”)</strong>, then
install UxPlay dependencies (openssl is already installed with
MSYS2):</p>
<p><code>pacman -S mingw-w64-x86_64-libplist mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base</code></p>
<pre><code>`pacman -S mingw-w64-ucrt-x86_64-libplist mingw-w64-ucrt-x86_64-gstreamer mingw-w64-ucrt-x86_64-gst-plugins-base`</code></pre>
<p>If you are trying a different Windows build system, MSVC versions of
GStreamer for Windows are available from the <a
href="https://gstreamer.freedesktop.org/download/">official GStreamer
@@ -884,19 +900,23 @@ build UxPlay with</p>
<li><p>Assuming no error in either of these, you will have built the
uxplay executable <strong>uxplay.exe</strong> in the current (“build”)
directory. The “sudo make install” and “sudo make uninstall” features
offered in the other builds are not available on Windows; instead, the
MSYS2 environment has <code>/mingw64/...</code> available, and you can
install the uxplay.exe executable in <code>C:/msys64/mingw64/bin</code>
(plus manpage and documentation in
<code>C:/msys64/mingw64/share/...</code>) with</p>
<p><code>cmake --install . --prefix /mingw64</code></p>
offered in the other builds are not available on Windows; instead, you
can install the uxplay.exe executable in
<code>C:/msys64/ucrt64/bin</code> (plus manpage and documentation in
<code>C:/msys64/ucrt64/share/...</code>) with</p>
<p><code>cmake --install . --prefix $HOME/../../ucrt64</code></p>
<p>You can later uninstall uxplay by returning to the build directory
and running</p>
<p><code>ninja uninstall</code></p>
<p>(This assumes that certain files in the build directory were not
deleted since building UxPlay).</p>
<p>To be able to view the manpage, you need to install the manpage
viewer with “<code>pacman -S man</code>”.</p></li>
</ol>
<p>To run <strong>uxplay.exe</strong> you need to install some gstreamer
plugin packages with
<code>pacman -S mingw-w64-x86_64-gst-&lt;plugin&gt;</code>, where the
required ones have <code>&lt;plugin&gt;</code> given by</p>
<code>pacman -S mingw-w64-ucrt-x86_64-gst-&lt;plugin&gt;</code>, where
the required ones have <code>&lt;plugin&gt;</code> given by</p>
<ol type="1">
<li><strong>libav</strong></li>
<li><strong>plugins-good</strong></li>
@@ -913,9 +933,9 @@ Settings-&gt;Update and Security-&gt;Windows Security-&gt;Firewall &amp;
network protection -&gt; allow an app through firewall</strong>. If your
virus protection flags uxplay.exe as “suspicious” (but without a true
malware signature) you may need to give it an exception.</p>
<p>Now test by running “<code>uxplay</code>” (in a MSYS2 terminal
window). If you need to specify the audiosink, there are two main
choices on Windows: the older DirectSound plugin
<p>Now test by running “<code>uxplay</code>” (in a MSYS2 UCRT64 terminal
window. If you need to specify the audiosink, there are two main choices
on Windows: the older DirectSound plugin
<code>-as directsoundsink</code>”, and the more modern Windows Audio
Session API (wasapi) plugin “<code>-as wasapisink</code>”, which
supports <a
@@ -931,25 +951,24 @@ If “<code>device</code>” is not specified, the default audio device is
used.</p>
<p>If you wish to specify the videosink using the
<code>-vs &lt;videosink&gt;</code> option, some choices for
<code>&lt;videosink&gt;</code> are <code>d3d11videosink</code>,
<code>d3dvideosink</code>, <code>glimagesink</code>,
<code>gtksink</code>.</p>
<code>&lt;videosink&gt;</code> are <code>d3d12videosink</code>,
<code>d3d11videosink</code>, <code>d3dvideosink</code>,
<code>glimagesink</code>, <code>gtksink</code>,
<code>autovideosink</code>. If you do not specify the videosink, the
d3d11videosink will be used (users have reported segfaults of the newer
d3d12 videodecoder on certain older Nvidia cards when the image
resolution changes: d3d11 will used by default until this is fixed).</p>
<ul>
<li>With Direct3D 11.0 or greater, you can either always be in
fullscreen mode using option
<code>-vs "d3d11videosink fullscreen-toggle-mode=property fullscreen=true"</code>,
or get the ability to toggle into and out of fullscreen mode using the
Alt-Enter key combination with option
<code>-vs "d3d11videosink fullscreen-toggle-mode=alt-enter"</code>. For
convenience, these options will be added if just
<code>-vs d3d11videosink</code> with or without the fullscreen option
“-fs” is used. <em>(Windows users may wish to add
<code>vs d3d11videosink</code>” (no initial “<code>-</code>”) to the
UxPlay startup options file; see “man uxplay” or “uxplay -h”.)</em></li>
<li>With Direct3D 11.0 or greater, various options can be set using
e.g. <code>-vs "d3d11videosink &lt;options&gt;"</code> (see the
gstreamer videosink documentation for these videosinks). For
convenience, if no <code>&lt;options&gt;</code> are set, the option to
toggle in and out of fullscreen mode with the Alt-Enter key combination
is added.</li>
</ul>
<p>The executable uxplay.exe can also be run without the MSYS2
environment, in the Windows Terminal, with
<code>C:\msys64\mingw64\bin\uxplay</code>.</p>
<code>C:\msys64\ucrt64\bin\uxplay</code>.</p>
<h1 id="usage">Usage</h1>
<p>Options:</p>
<ul>

View File

@@ -846,16 +846,25 @@ downloads, "UxPlay" for "git clone" downloads) and build/install with
3. [MSYS2 packages](https://packages.msys2.org/package/) are installed
with a variant of the "pacman" package manager used by Arch Linux.
Open a "MSYS2 MINGW64" terminal from the MSYS2 tab in the Windows
Open a "MSYS2" terminal from the MSYS2 tab in the Windows
Start menu, and update the new MSYS2 installation with "pacman
-Syu". Then install the **MinGW-64** compiler and **cmake**
-Syu".
pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc
* _NEW: MSYS2 now recommends using the newer UCRT64 terminal environment (which uses the newer Microsoft
UCRT "Universal C RunTime Library", included as part of the Windows OS since Windows 10)
rather than the MINGW64 terminal environment
(which uses the older Microsoft MSVCRT C library, which has "legacy" status, but is available on all Windows systems).
If you wish to use the legacy MSVCRT library, to support older Windows versions, modify the instructions below as follows:
(1) change the MSYS2 terminal type from UCRT64 to MINGW64; (2) modify mingw-w64-ucrt-x86_64-* package names to mingw-w64-x86_64-*, (just omit "-ucrt");
(3) replace `ucrt64` by ``mingw64`` in directory names._
The compiler with all required dependencies will be installed in the
msys64 directory, with default path `C:/msys64/mingw64`. Here we
will simply build UxPlay from the command line in the MSYS2
environment (this uses "`ninja`" in place of "`make`" for the build
Open a new MSYS2 UCRT64 terminal, and install the gcc compiler and cmake:
`pacman -S mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-gcc`
We will simply build UxPlay from the command line in the MSYS2
environment (using "`ninja`" in place of "`make`" for the build
system).
4. Download the latest UxPlay from github **(to use `git`, install it
@@ -863,7 +872,7 @@ downloads, "UxPlay" for "git clone" downloads) and build/install with
"`git clone https://github.com/FDH2/UxPlay`")**, then install UxPlay
dependencies (openssl is already installed with MSYS2):
`pacman -S mingw-w64-x86_64-libplist mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base`
`pacman -S mingw-w64-ucrt-x86_64-libplist mingw-w64-ucrt-x86_64-gstreamer mingw-w64-ucrt-x86_64-gst-plugins-base`
If you are trying a different Windows build system, MSVC versions of
GStreamer for Windows are available from the [official GStreamer
@@ -883,18 +892,23 @@ downloads, "UxPlay" for "git clone" downloads) and build/install with
6. Assuming no error in either of these, you will have built the uxplay
executable **uxplay.exe** in the current ("build") directory. The
"sudo make install" and "sudo make uninstall" features offered in
the other builds are not available on Windows; instead, the MSYS2
environment has `/mingw64/...` available, and you can install the
uxplay.exe executable in `C:/msys64/mingw64/bin` (plus manpage and
documentation in `C:/msys64/mingw64/share/...`) with
the other builds are not available on Windows; instead, you can install the
uxplay.exe executable in `C:/msys64/ucrt64/bin` (plus manpage and
documentation in `C:/msys64/ucrt64/share/...`) with
`cmake --install . --prefix /mingw64`
`cmake --install . --prefix $HOME/../../ucrt64`
You can later uninstall uxplay by returning to the build directory and running
`ninja uninstall`
(This assumes that certain files in the build directory were not deleted since building UxPlay).
To be able to view the manpage, you need to install the manpage
viewer with "`pacman -S man`".
To run **uxplay.exe** you need to install some gstreamer plugin packages
with `pacman -S mingw-w64-x86_64-gst-<plugin>`, where the required ones
with `pacman -S mingw-w64-ucrt-x86_64-gst-<plugin>`, where the required ones
have `<plugin>` given by
1. **libav**
@@ -913,7 +927,7 @@ app through firewall**. If your virus protection flags uxplay.exe as
"suspicious" (but without a true malware signature) you may need to give
it an exception.
Now test by running "`uxplay`" (in a MSYS2 terminal window). If you need
Now test by running "`uxplay`" (in a MSYS2 UCRT64 terminal window. If you need
to specify the audiosink, there are two main choices on Windows: the
older DirectSound plugin "`-as directsoundsink`", and the more modern
Windows Audio Session API (wasapi) plugin "`-as wasapisink`", which
@@ -929,23 +943,20 @@ like `\{0.0.0.00000000\}.\{98e35b2b-8eba-412e-b840-fd2c2492cf44\}`. If
"`device`" is not specified, the default audio device is used.
If you wish to specify the videosink using the `-vs <videosink>` option,
some choices for `<videosink>` are `d3d11videosink`, `d3dvideosink`,
`glimagesink`, `gtksink`.
some choices for `<videosink>` are `d3d12videosink`, ``d3d11videosink``, ```d3dvideosink```,
`glimagesink`, ``gtksink``, ```autovideosink```. If you do not specify the videosink,
the d3d11videosink will be used (users have reported segfaults of the newer d3d12 videodecoder
on certain older Nvidia cards when the image resolution changes:
d3d11 will used by default until this is fixed).
- With Direct3D 11.0 or greater, you can either always be in
fullscreen mode using option
`-vs "d3d11videosink fullscreen-toggle-mode=property fullscreen=true"`,
or get the ability to toggle into and out of fullscreen mode using
the Alt-Enter key combination with option
`-vs "d3d11videosink fullscreen-toggle-mode=alt-enter"`. For
convenience, these options will be added if just
`-vs d3d11videosink` with or without the fullscreen option "-fs" is
used. *(Windows users may wish to add "`vs d3d11videosink`" (no
initial "`-`") to the UxPlay startup options file; see "man uxplay"
or "uxplay -h".)*
- With Direct3D 11.0 or greater, various options can be set
using e.g. `-vs "d3d11videosink <options>"` (see the gstreamer videosink
documentation for these videosinks).
For convenience, if no `<options>` are set, the option to
toggle in and out of fullscreen mode with the Alt-Enter key combination is added.
The executable uxplay.exe can also be run without the MSYS2 environment,
in the Windows Terminal, with `C:\msys64\mingw64\bin\uxplay`.
in the Windows Terminal, with `C:\msys64\ucrt64\bin\uxplay`.
# Usage

View File

@@ -856,16 +856,30 @@ downloads, "UxPlay" for "git clone" downloads) and build/install with
3. [MSYS2 packages](https://packages.msys2.org/package/) are installed
with a variant of the "pacman" package manager used by Arch Linux.
Open a "MSYS2 MINGW64" terminal from the MSYS2 tab in the Windows
Start menu, and update the new MSYS2 installation with "pacman
-Syu". Then install the **MinGW-64** compiler and **cmake**
Open a "MSYS2" terminal from the MSYS2 tab in the Windows Start
menu, and update the new MSYS2 installation with "pacman -Syu".
pacman -S mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc
- \_NEW: MSYS2 now recommends using the newer UCRT64 terminal
environment (which uses the newer Microsoft UCRT "Universal C
RunTime Library", included as part of the Windows OS since
Windows 10) rather than the MINGW64 terminal environment (which
uses the older Microsoft MSVCRT C library, which has "legacy"
status, but is available on all Windows systems). If you wish to
use the legacy MSVCRT library, to support older Windows
versions, modify the instructions below as follows:
The compiler with all required dependencies will be installed in the
msys64 directory, with default path `C:/msys64/mingw64`. Here we
will simply build UxPlay from the command line in the MSYS2
environment (this uses "`ninja`" in place of "`make`" for the build
(1) change the MSYS2 terminal type from UCRT64 to MINGW64; (2)
modify mingw-w64-ucrt-x86_64-\* package names to
mingw-w64-x86_64-\*, (just omit "-ucrt");
(2) replace `ucrt64` by `mingw64` in directory names.\_
Open a new MSYS2 UCRT64 terminal, and install the gcc compiler and
cmake:
`pacman -S mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-gcc`
We will simply build UxPlay from the command line in the MSYS2
environment (using "`ninja`" in place of "`make`" for the build
system).
4. Download the latest UxPlay from github **(to use `git`, install it
@@ -873,7 +887,7 @@ downloads, "UxPlay" for "git clone" downloads) and build/install with
"`git clone https://github.com/FDH2/UxPlay`")**, then install UxPlay
dependencies (openssl is already installed with MSYS2):
`pacman -S mingw-w64-x86_64-libplist mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base`
`pacman -S mingw-w64-ucrt-x86_64-libplist mingw-w64-ucrt-x86_64-gstreamer mingw-w64-ucrt-x86_64-gst-plugins-base`
If you are trying a different Windows build system, MSVC versions of
GStreamer for Windows are available from the [official GStreamer
@@ -893,19 +907,26 @@ downloads, "UxPlay" for "git clone" downloads) and build/install with
6. Assuming no error in either of these, you will have built the uxplay
executable **uxplay.exe** in the current ("build") directory. The
"sudo make install" and "sudo make uninstall" features offered in
the other builds are not available on Windows; instead, the MSYS2
environment has `/mingw64/...` available, and you can install the
uxplay.exe executable in `C:/msys64/mingw64/bin` (plus manpage and
documentation in `C:/msys64/mingw64/share/...`) with
the other builds are not available on Windows; instead, you can
install the uxplay.exe executable in `C:/msys64/ucrt64/bin` (plus
manpage and documentation in `C:/msys64/ucrt64/share/...`) with
`cmake --install . --prefix /mingw64`
`cmake --install . --prefix $HOME/../../ucrt64`
You can later uninstall uxplay by returning to the build directory
and running
`ninja uninstall`
(This assumes that certain files in the build directory were not
deleted since building UxPlay).
To be able to view the manpage, you need to install the manpage
viewer with "`pacman -S man`".
To run **uxplay.exe** you need to install some gstreamer plugin packages
with `pacman -S mingw-w64-x86_64-gst-<plugin>`, where the required ones
have `<plugin>` given by
with `pacman -S mingw-w64-ucrt-x86_64-gst-<plugin>`, where the required
ones have `<plugin>` given by
1. **libav**
2. **plugins-good**
@@ -923,11 +944,11 @@ app through firewall**. If your virus protection flags uxplay.exe as
"suspicious" (but without a true malware signature) you may need to give
it an exception.
Now test by running "`uxplay`" (in a MSYS2 terminal window). If you need
to specify the audiosink, there are two main choices on Windows: the
older DirectSound plugin "`-as directsoundsink`", and the more modern
Windows Audio Session API (wasapi) plugin "`-as wasapisink`", which
supports [additional
Now test by running "`uxplay`" (in a MSYS2 UCRT64 terminal window. If
you need to specify the audiosink, there are two main choices on
Windows: the older DirectSound plugin "`-as directsoundsink`", and the
more modern Windows Audio Session API (wasapi) plugin
"`-as wasapisink`", which supports [additional
options](https://gstreamer.freedesktop.org/documentation/wasapi/wasapisink.html)
such as
@@ -939,23 +960,21 @@ like `\{0.0.0.00000000\}.\{98e35b2b-8eba-412e-b840-fd2c2492cf44\}`. If
"`device`" is not specified, the default audio device is used.
If you wish to specify the videosink using the `-vs <videosink>` option,
some choices for `<videosink>` are `d3d11videosink`, `d3dvideosink`,
`glimagesink`, `gtksink`.
some choices for `<videosink>` are `d3d12videosink`, `d3d11videosink`,
`d3dvideosink`, `glimagesink`, `gtksink`, `autovideosink`. If you do not
specify the videosink, the d3d11videosink will be used (users have
reported segfaults of the newer d3d12 videodecoder on certain older
Nvidia cards when the image resolution changes: d3d11 will used by
default until this is fixed).
- With Direct3D 11.0 or greater, you can either always be in
fullscreen mode using option
`-vs "d3d11videosink fullscreen-toggle-mode=property fullscreen=true"`,
or get the ability to toggle into and out of fullscreen mode using
the Alt-Enter key combination with option
`-vs "d3d11videosink fullscreen-toggle-mode=alt-enter"`. For
convenience, these options will be added if just
`-vs d3d11videosink` with or without the fullscreen option "-fs" is
used. *(Windows users may wish to add "`vs d3d11videosink`" (no
initial "`-`") to the UxPlay startup options file; see "man uxplay"
or "uxplay -h".)*
- With Direct3D 11.0 or greater, various options can be set using
e.g. `-vs "d3d11videosink <options>"` (see the gstreamer videosink
documentation for these videosinks). For convenience, if no
`<options>` are set, the option to toggle in and out of fullscreen
mode with the Alt-Enter key combination is added.
The executable uxplay.exe can also be run without the MSYS2 environment,
in the Windows Terminal, with `C:\msys64\mingw64\bin\uxplay`.
in the Windows Terminal, with `C:\msys64\ucrt64\bin\uxplay`.
# Usage

View File

@@ -2356,6 +2356,20 @@ int main (int argc, char *argv[]) {
new_window_closing_behavior = false;
#endif
#ifdef _WIN32
/* because of issues in videosink dvd312videosink (segfault when resolution changes
with certain Nvdia graphics cards) make the default videosink d3d11videosink, and
use its decoder */
if (videosink == "autovideosink") {
videosink.erase();
videosink.append("d3d11videosink");
}
if (videosink == "d3d11videosink") {
video_decoder.erase();
video_decoder.append("d3d11h264dec");
}
#endif
if (videosink == "0") {
use_video = false;
videosink.erase();
@@ -2375,12 +2389,20 @@ int main (int argc, char *argv[]) {
if (videosink == "d3d11videosink" && videosink_options.empty() && use_video) {
if (fullscreen) {
videosink_options.append(" fullscreen-toggle-mode=GST_D3D11_WINDOW_FULLSCREEN_TOGGLE_MODE_PROPERTY fullscreen=true ");
videosink_options.append(" fullscreen-toggle-mode=GST_D3D11_WINDOW_FULLSCREEN_TOGGLE_MODE_PROPERTY fullscreen=TRUE");
} else {
videosink_options.append(" fullscreen-toggle-mode=GST_D3D11_WINDOW_FULLSCREEN_TOGGLE_MODE_ALT_ENTER ");
LOGI("Use Alt-Enter key combination to toggle into/out of full-screen mode");
}
}
if (videosink == "d3d12videosink" && videosink_options.empty() && use_video) {
if (fullscreen) {
videosink_options.append("fullscreen=TRUE");
} else {
videosink_options.append(" fullscreen-on-alt-enter=TRUE ");
LOGI("Use Alt-Enter key combination to toggle into/out of full-screen mode");
}
LOGI("d3d11videosink is being used with option fullscreen-toggle-mode=alt-enter\n"
"Use Alt-Enter key combination to toggle into/out of full-screen mode");
}
if (bt709_fix && use_video) {