Skip to content

Commit

Permalink
Merge branch 'master' into plex-htpc-hdr-patches
Browse files Browse the repository at this point in the history
  • Loading branch information
mitzsch committed Mar 9, 2024
2 parents 384fd3d + a56d8ff commit 611ebe4
Show file tree
Hide file tree
Showing 59 changed files with 882 additions and 1,109 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
env:
WINEDEBUG: '+loaddll'

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: mpv-${{ matrix.target }}
path: mpv-git-*.zip
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ jobs:
- uses: actions/checkout@v4
- name: Docs
run: |
sudo apt-get install python3-docutils
rst2man --strip-elements-with-class=contents --halt=2 ./DOCS/man/mpv.rst mpv.1
sudo apt-get install python3-docutils rst2pdf
./TOOLS/docutils-wrapper.py rst2man --strip-elements-with-class=contents --halt=2 ./DOCS/man/mpv.rst mpv.1
./TOOLS/docutils-wrapper.py rst2html --halt=2 ./DOCS/man/mpv.rst mpv.html
./TOOLS/docutils-wrapper.py rst2pdf -c -b 1 --repeat-table-rows ./DOCS/man/mpv.rst -o mpv.pdf
3 changes: 3 additions & 0 deletions DOCS/interface-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Interface changes

--- mpv 0.38.0 ---
- add `begin-vo-dragging` command
- add `--deinterlace-field-parity` option
- add `--volume-gain`, `--volume-gain-min`, and `--volume-gain-max` options
- add `current-gpu-context` property
- add `--secondary-sub-ass-override` option
Expand Down Expand Up @@ -60,6 +61,8 @@ Interface changes
- remove `--alpha` and reintroduce `--background` option for better control
over blending alpha components into specific background types
- add `--border-background` option
- add `video-target-params` property
- add `hdr10plus` sub-parameter to `format` video filter
--- mpv 0.37.0 ---
- `--save-position-on-quit` and its associated commands now store state files
in %LOCALAPPDATA% instead of %APPDATA% directory by default on Windows.
Expand Down
43 changes: 37 additions & 6 deletions DOCS/man/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,9 @@ Remember to quote string arguments in input.conf (see `Flat command syntax`_).
restarted if for example the new playlist entry is the same as the previous
one.

``loadfile <url> [<flags> [<options>]]``
``loadfile <url> [<flags> [<index> [<options>]]]``
Load the given file or URL and play it. Technically, this is just a playlist
manipulation command (which either replaces the playlist or appends an entry
manipulation command (which either replaces the playlist or adds an entry
to it). Actual file loading happens independently. For example, a
``loadfile`` command that replaces the current file with a new one returns
before the current file is stopped, and the new file even begins loading.
Expand All @@ -475,15 +475,28 @@ Remember to quote string arguments in input.conf (see `Flat command syntax`_).
Insert the file next, and if nothing is currently playing, start playback.
(Always starts with the added file, even if the playlist was not empty
before running this command.)

The third argument is a list of options and values which should be set
<insert-at>
Insert the file into the playlist, at the index given in the third
argument.
<insert-at-play>
Insert the file at the index given in the third argument, and if nothing
is currently playing, start playback. (Always starts with the added
file, even if the playlist was not empty before running this command.)

The third argument is an insertion index, used only by the ``insert-at`` and
``insert-at-play`` actions. When used with those actions, the new item will
be inserted at the index position in the playlist, or appended to the end if
index is less than 0 or greater than the size of the playlist. This argument
will be ignored for all other actions.

The fourth argument is a list of options and values which should be set
while the file is playing. It is of the form ``opt1=value1,opt2=value2,..``.
When using the client API, this can be a ``MPV_FORMAT_NODE_MAP`` (or a Lua
table), however the values themselves must be strings currently. These
options are set during playback, and restored to the previous value at end
of playback (see `Per-File Options`_).

``loadlist <url> [<flags>]``
``loadlist <url> [<flags> [<index>]]``
Load the given playlist file or URL (like ``--playlist``).

Second argument:
Expand All @@ -503,6 +516,19 @@ Remember to quote string arguments in input.conf (see `Flat command syntax`_).
Insert the new playlist, and if nothing is currently playing, start
playback. (Always starts with the new playlist, even if the internal
playlist was not empty before running this command.)
<insert-at>
Insert the new playlist at the index given in the third argument.
<insert-at-play>
Insert the new playlist at the index given in the third argument, and if
nothing is currently playing, start playback. (Always starts with the
new playlist, even if the internal playlist was not empty before running
this command.)

The third argument is an insertion index, used only by the ``insert-at`` and
``insert-at-play`` actions. When used with those actions, the new playlist
will be inserted at the index position in the internal playlist, or appended
to the end if index is less than 0 or greater than the size of the internal
playlist. This argument will be ignored for all other actions.

``playlist-clear``
Clear the playlist, except the currently played file.
Expand Down Expand Up @@ -2621,6 +2647,11 @@ Property list

Has the same sub-properties as ``video-params``.

``video-target-params``
Same as ``video-params``, but with the target properties that VO outputs to.

Has the same sub-properties as ``video-params``.

``video-frame-info``
Approximate information of the current frame. Note that if any of these
are used on OSD, the information might be off by a few frames due to OSD
Expand Down Expand Up @@ -3718,4 +3749,4 @@ Sometimes, the difference in amount of information carried by raw and formatted
property values can be rather big. In some cases, raw values have more
information, like higher precision than seconds with ``time-pos``. Sometimes
it is the other way around, e.g. ``aid`` shows track title and language in the
formatted case, but only the track number if it is raw.
formatted case, but only the track number if it is raw.
11 changes: 11 additions & 0 deletions DOCS/man/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1676,6 +1676,17 @@ Video
inserted deinterlacing filters, and that this will make video look worse if
it's not actually interlaced.

``--deinterlace-field-parity=<tff|bff|auto>``
Specify the field parity/order when deinterlacing(default: auto)
Each frame of an interlaced video is divided into two fields, which are
then separately transmitted. Top field represents even lines while bottom
field represents odd lines. When deinterlacing the deinterlacer needs to
know the correct temporal order of the fields else the video will appear
jittery.

``auto`` will automatically try to detect the field order of the video,
``tff`` forces top field first while ``bff`` forces bottom field first.

``--frames=<number>``
Play/convert only first ``<number>`` video frames, then quit.

Expand Down
15 changes: 11 additions & 4 deletions DOCS/man/vf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,13 @@ Available mpv-only filters are:
Available color spaces are:

:auto: automatic selection (default)
:bt.601: ITU-R BT.601 (SD)
:bt.709: ITU-R BT.709 (HD)
:bt.2020-ncl: ITU-R BT.2020 non-constant luminance system
:bt.2020-cl: ITU-R BT.2020 constant luminance system
:bt.601: ITU-R Rec. BT.601 (SD)
:bt.709: ITU-R Rec. BT.709 (HD)
:bt.2020-ncl: ITU-R Rec. BT.2020 (non-constant luminance)
:bt.2020-cl: ITU-R Rec. BT.2020 (constant luminance)
:bt.2100-pq: ITU-R Rec. BT.2100 ICtCp PQ variant
:bt.2100-hlg: ITU-R Rec. BT.2100 ICtCp HLG variant
:dolbyvision: Dolby Vision
:smpte-240m: SMPTE-240M

``<colorlevels>``
Expand Down Expand Up @@ -313,6 +316,10 @@ Available mpv-only filters are:
Whether or not to include Dolby Vision metadata (default: yes). If
disabled, any Dolby Vision metadata will be stripped from frames.

``<hdr10plus=yes|no>``
Whether or not to include HDR10+ metadata (default: yes). If
disabled, any HDR10+ metadata will be stripped from frames.

``<film-grain=yes|no>``
Whether or not to include film grain metadata (default: yes). If
disabled, any film grain metadata will be stripped from frames.
Expand Down
8 changes: 7 additions & 1 deletion TOOLS/osxbundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ def apply_plist_template(plist_file, version):
print(line.rstrip().replace('${VERSION}', version))

def sign_bundle(binary_name):
sh('codesign --force --deep -s - ' + bundle_path(binary_name))
sign_directories = ['Contents/Frameworks', 'Contents/MacOS']
for dir in sign_directories:
resolved_dir = os.path.join(bundle_path(binary_name), dir)
for root, _dirs, files in os.walk(resolved_dir):
for f in files:
sh('codesign --force -s - ' + os.path.join(root, f))
sh('codesign --force -s - ' + bundle_path(binary_name))

def bundle_version(src_path):
version = 'UNKNOWN'
Expand Down
2 changes: 2 additions & 0 deletions TOOLS/osxbundle/mpv.app/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@
<string>${VERSION}</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>LSEnvironment</key>
<dict>
<key>MallocNanoZone</key>
Expand Down
2 changes: 1 addition & 1 deletion audio/decode/ad_spdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,4 +439,4 @@ static struct mp_decoder *create(struct mp_filter *parent,

const struct mp_decoder_fns ad_spdif = {
.create = create,
};
};
30 changes: 24 additions & 6 deletions ci/build-mingw64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ _iconv () {
_iconv_mark=lib/libiconv.dll.a

_zlib () {
local ver=1.3
local ver=1.3.1
gettar "https://zlib.net/fossils/zlib-${ver}.tar.gz"
pushd zlib-${ver}
make -fwin32/Makefile.gcc clean
Expand All @@ -121,6 +121,16 @@ _zlib () {
}
_zlib_mark=lib/libz.dll.a

_dav1d () {
[ -d dav1d ] || $gitclone https://code.videolan.org/videolan/dav1d.git
builddir dav1d
meson setup .. --cross-file "$prefix_dir/crossfile" \
-Denable_{tools,tests}=false
makeplusinstall
popd
}
_dav1d_mark=lib/libdav1d.dll.a

_ffmpeg () {
[ -d ffmpeg ] || $gitclone https://github.com/FFmpeg/FFmpeg.git ffmpeg
builddir ffmpeg
Expand All @@ -129,7 +139,7 @@ _ffmpeg () {
--enable-cross-compile --cross-prefix=$TARGET- --arch=${TARGET%%-*}
--cc="$CC" --cxx="$CXX" $commonflags
--disable-{doc,programs,muxers,encoders}
--enable-encoder=mjpeg,png
--enable-encoder=mjpeg,png --enable-libdav1d
)
pkg-config vulkan && args+=(--enable-vulkan --enable-libshaderc)
../configure "${args[@]}"
Expand Down Expand Up @@ -161,6 +171,14 @@ _spirv_cross () {
}
_spirv_cross_mark=lib/libspirv-cross-c-shared.dll.a

_nv_headers () {
[ -d nv-codec-headers ] || $gitclone https://github.com/FFmpeg/nv-codec-headers
pushd nv-codec-headers
makeplusinstall
popd
}
_nv_headers_mark=include/ffnvcodec/dynlink_loader.h

_vulkan_headers () {
[ -d Vulkan-Headers ] || $gitclone https://github.com/KhronosGroup/Vulkan-Headers
builddir Vulkan-Headers
Expand Down Expand Up @@ -191,7 +209,7 @@ _libplacebo () {
_libplacebo_mark=lib/libplacebo.dll.a

_freetype () {
local ver=2.13.1
local ver=2.13.2
gettar "https://mirror.netcologne.de/savannah/freetype/freetype-${ver}.tar.xz"
builddir freetype-${ver}
meson setup .. --cross-file "$prefix_dir/crossfile"
Expand All @@ -212,7 +230,7 @@ _fribidi () {
_fribidi_mark=lib/libfribidi.dll.a

_harfbuzz () {
local ver=8.1.1
local ver=8.3.0
gettar "https://github.com/harfbuzz/harfbuzz/releases/download/${ver}/harfbuzz-${ver}.tar.xz"
builddir harfbuzz-${ver}
meson setup .. --cross-file "$prefix_dir/crossfile" \
Expand Down Expand Up @@ -246,7 +264,7 @@ _luajit () {
}
_luajit_mark=lib/libluajit-5.1.a

for x in iconv zlib shaderc spirv-cross; do
for x in iconv zlib shaderc spirv-cross nv-headers dav1d; do
build_if_missing $x
done
if [[ "$TARGET" != "i686-"* ]]; then
Expand Down Expand Up @@ -291,7 +309,7 @@ if [ "$2" = pack ]; then
dlls=(
libgcc_*.dll lib{ssp,stdc++,winpthread}-[0-9]*.dll # compiler runtime
av*.dll sw*.dll lib{ass,freetype,fribidi,harfbuzz,iconv,placebo}-[0-9]*.dll
lib{shaderc_shared,spirv-cross-c-shared}.dll zlib1.dll
lib{shaderc_shared,spirv-cross-c-shared,dav1d}.dll zlib1.dll
# note: vulkan-1.dll is not here since drivers provide it
)
mv -v "${dlls[@]}" ..
Expand Down
31 changes: 25 additions & 6 deletions filters/f_auto_filters.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "common/msg.h"
#include "options/m_config.h"
#include "options/options.h"
#include "video/filter/refqueue.h"
#include "video/mp_image.h"
#include "video/mp_image_pool.h"

Expand Down Expand Up @@ -73,25 +74,42 @@ static void deint_process(struct mp_filter *f)
return;
}

char *field_parity;
switch (opts->field_parity) {
case MP_FIELD_PARITY_TFF:
field_parity = "tff";
break;
case MP_FIELD_PARITY_BFF:
field_parity = "bff";
break;
default:
field_parity = "auto";
}

bool has_filter = true;
if (img->imgfmt == IMGFMT_VDPAU) {
char *args[] = {"deint", "yes", NULL};
char *args[] = {"deint", "yes",
"parity", field_parity, NULL};
p->sub.filter =
mp_create_user_filter(f, MP_OUTPUT_CHAIN_VIDEO, "vdpaupp", args);
} else if (img->imgfmt == IMGFMT_D3D11) {
char *args[] = {"parity", field_parity, NULL};
p->sub.filter =
mp_create_user_filter(f, MP_OUTPUT_CHAIN_VIDEO, "d3d11vpp", NULL);
mp_create_user_filter(f, MP_OUTPUT_CHAIN_VIDEO, "d3d11vpp", args);
} else if (img->imgfmt == IMGFMT_CUDA) {
char *args[] = {"mode", "send_field", NULL};
char *args[] = {"mode", "send_field",
"parity", field_parity, NULL};
p->sub.filter =
mp_create_user_filter(f, MP_OUTPUT_CHAIN_VIDEO, "bwdif_cuda", args);
} else if (img->imgfmt == IMGFMT_VULKAN) {
char *args[] = {"mode", "send_field", NULL};
char *args[] = {"mode", "send_field",
"parity", field_parity, NULL};
p->sub.filter =
mp_create_user_filter(f, MP_OUTPUT_CHAIN_VIDEO, "bwdif_vulkan", args);
} else if (img->imgfmt == IMGFMT_VAAPI) {
char *args[] = {"deint", "motion-adaptive",
"interlaced-only", "yes", NULL};
"interlaced-only", "yes",
"parity", field_parity, NULL};
p->sub.filter =
mp_create_user_filter(f, MP_OUTPUT_CHAIN_VIDEO, "vavpp", args);
} else {
Expand Down Expand Up @@ -120,7 +138,8 @@ static void deint_process(struct mp_filter *f)
}
}

char *args[] = {"mode", "send_field", NULL};
char *args[] = {"mode", "send_field",
"parity", field_parity, NULL};
filters[1] =
mp_create_user_filter(subf, MP_OUTPUT_CHAIN_VIDEO, "bwdif", args);

Expand Down
2 changes: 1 addition & 1 deletion filters/f_autoconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static bool build_image_converter(struct mp_autoconvert *c, struct mp_log *log,
*/
if (samefmt && samesubffmt) {
if (p->imgparams_set) {
if (!mp_image_params_equal(&p->imgparams, &img->params))
if (!mp_image_params_static_equal(&p->imgparams, &img->params))
break;
}
return true;
Expand Down
Loading

0 comments on commit 611ebe4

Please sign in to comment.