Skip to content

Commit

Permalink
Merge pull request #275 from nyanmisaka/next-5.1
Browse files Browse the repository at this point in the history
[5.1] Sync intel D3D11VA textures before mapping to OpenCL
  • Loading branch information
nyanmisaka authored Aug 29, 2023
2 parents 2d97234 + a5009ce commit c0dbc74
Show file tree
Hide file tree
Showing 34 changed files with 382 additions and 59 deletions.
2 changes: 1 addition & 1 deletion build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# We just wrap `build` so this is really it
name: "jellyfin-ffmpeg"
version: "5.1.3-4"
version: "5.1.3-5"
packages:
- buster-amd64
- buster-armhf
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/20-libxml2.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/GNOME/libxml2.git"
SCRIPT_COMMIT="58de9d31da4d0e8cb6bcf7f5e99714f9df2c4411"
SCRIPT_COMMIT="d39f78069dff496ec865c73aa44d7110e429bce9"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/20-zlib.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/madler/zlib.git"
SCRIPT_COMMIT="04f42ceca40f73e2978b50e93806c2a18c1281fc"
SCRIPT_COMMIT="79a0e447a0dfa32979420cb21cfb96d684b2c9d5"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/25-fftw3f.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/FFTW/fftw3.git"
SCRIPT_COMMIT="69f6c1a6ebd7ac5af33e7074134fb79fbc729c3d"
SCRIPT_COMMIT="38ea230e25e69e7a3f35b957b815bac4f9aa22b0"

ffbuild_enabled() {
# Dependency of GPL-Only librubberband
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/25-freetype.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://gitlab.freedesktop.org/freetype/freetype.git"
SCRIPT_COMMIT="95a872085e5a79cf710acf6389dbd55b6e728aac"
SCRIPT_COMMIT="d42679b93d5e77fe769591cd1d04522225940556"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/35-fontconfig.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://gitlab.freedesktop.org/fontconfig/fontconfig.git"
SCRIPT_COMMIT="2fb3419a92156569bc1ec707401258c922cd0d99"
SCRIPT_COMMIT="e0eb855462791cbe217adc368d156733b2b2c13a"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/45-harfbuzz.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/harfbuzz/harfbuzz.git"
SCRIPT_COMMIT="1d665c2b521512cdd56964138fc601debd1f1177"
SCRIPT_COMMIT="f380a32825a1b2c51bbe21dc7acb9b3cc0921f69"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/45-x11/10-xcbproto.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://gitlab.freedesktop.org/xorg/proto/xcbproto.git"
SCRIPT_COMMIT="b016df100111b56d7c1a2c63ea6791b2287a83e4"
SCRIPT_COMMIT="98eeebfc2d7db5377b85437418fb942ea30ffc0d"

ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/45-x11/20-libxau.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://gitlab.freedesktop.org/xorg/lib/libxau.git"
SCRIPT_COMMIT="68e74d37b99f56bbd1a5f2fb8cb4ad6116f27bd3"
SCRIPT_COMMIT="aec9d7266777e0b9243ef0f112fe0e07256bd446"

ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/45-x11/30-libxcb.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://gitlab.freedesktop.org/xorg/lib/libxcb.git"
SCRIPT_COMMIT="038636786ad1914f3daf3503ae9611f40dffbb8f"
SCRIPT_COMMIT="453115f7eeb694de9f41ea842a29bbb31b90c8dd"

ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/45-x11/40-libx11.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://gitlab.freedesktop.org/xorg/lib/libx11.git"
SCRIPT_COMMIT="b2c3fb7b4dd4c4c7b9d28c7af7776cccc8e0a98b"
SCRIPT_COMMIT="44f908d9283710ffc75b22d2ae7a8948119b3e61"

ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/45-x11/50-libxi.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://gitlab.freedesktop.org/xorg/lib/libxi.git"
SCRIPT_COMMIT="3a7503ec7703f10de17c622ea22b7bff736cea74"
SCRIPT_COMMIT="09f3eb570fe79bfc0c430b6059d7b4acaf371c24"

ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-amf.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git"
SCRIPT_COMMIT="68f2396f1a55a5b12767f5433411bb4093ea65ed"
SCRIPT_COMMIT="2f326350e849894a929296854f5290e66197c97c"

ffbuild_enabled() {
[[ $TARGET == *arm64 ]] && return -1
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-dav1d.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://code.videolan.org/videolan/dav1d.git"
SCRIPT_COMMIT="e58afe4dd9057591882a01c31382c203e8a61c92"
SCRIPT_COMMIT="97becd73726c3d4c4bb8793d2215f846da8795af"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-libass.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/libass/libass.git"
SCRIPT_COMMIT="91422bdb9497e8484b3248f5ae7eb50d41e2555d"
SCRIPT_COMMIT="5c15c883a4783641f7e71a6a1f440209965eb64f"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-libvpx.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://chromium.googlesource.com/webm/libvpx"
SCRIPT_COMMIT="5556ebd894a9a9b07908c3c7fd0a7a87732a7635"
SCRIPT_COMMIT="e052ada7801c458f9fc0c2818f1be814f86e94a4"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-libwebp.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://chromium.googlesource.com/webm/libwebp"
SCRIPT_COMMIT="dd7364c3cefe0f5c0b3c18c3b1887d353f90fc1f"
SCRIPT_COMMIT="943b932a7ec6ac71737e1ea0af907c5439ca6ef0"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-openmpt.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://source.openmpt.org/svn/openmpt/trunk/OpenMPT"
SCRIPT_REV="19561"
SCRIPT_REV="19588"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-srt.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/Haivision/srt.git"
SCRIPT_COMMIT="88ca9ccca4984dbf61a5e1a06ac551b4dead5304"
SCRIPT_COMMIT="51e3d0d50ba281ce985a1712785b5cb34f447b92"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-svtav1.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://gitlab.com/AOMediaCodec/SVT-AV1.git"
SCRIPT_COMMIT="903ff3add82744d586295c37ec1241dc51dab16e"
SCRIPT_COMMIT="6d5f2b4e1f04db677cdd4ab2b0d6831ab06a849c"

ffbuild_enabled() {
[[ $TARGET == win32 ]] && return -1
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-vaapi/40-libdrm.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://gitlab.freedesktop.org/mesa/drm.git"
SCRIPT_COMMIT="c6013245ce9ce287bb86d327f9b6420a320a08e6"
SCRIPT_COMMIT="7bdb135f0c8e6ae2c0ed6d4bd6a8423eb1df5c26"

ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-vaapi/50-libva.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/intel/libva.git"
SCRIPT_COMMIT="7d6c7d482b9d2330b1f3a8bac13a6a3205f33382"
SCRIPT_COMMIT="b4870fdfe2d41b579036dae280dfc7a5e732127f"

ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-vulkan/45-vulkan.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/KhronosGroup/Vulkan-Headers.git"
SCRIPT_COMMIT="v1.3.260"
SCRIPT_COMMIT="v1.3.261"
SCRIPT_TAGFILTER="v?.*.*"

ffbuild_enabled() {
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-vulkan/50-shaderc.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/google/shaderc.git"
SCRIPT_COMMIT="4d98dac61ee4857ea0691a2b9a48aee44eb409db"
SCRIPT_COMMIT="5b892551dd02bbf8704adbc3fcde2fd645f333b2"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-vulkan/55-spirv-cross.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/KhronosGroup/SPIRV-Cross.git"
SCRIPT_COMMIT="bccaa94db814af33d8ef05c153e7c34d8bd4d685"
SCRIPT_COMMIT="acf51c1b9f9f872b741ab369cb047898c9cc300b"

ffbuild_enabled() {
return 0
Expand Down
2 changes: 1 addition & 1 deletion builder/scripts.d/50-x265.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://bitbucket.org/multicoreware/x265_git.git"
SCRIPT_COMMIT="8f18e3ad32684eee95e885e718655f93951128c3"
SCRIPT_COMMIT="59ff5e7b4840b3aac91fbc514a4c86a8722ce5e1"

ffbuild_enabled() {
[[ $VARIANT == lgpl* ]] && return -1
Expand Down
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
jellyfin-ffmpeg (5.1.3-5) unstable; urgency=medium

* Sync intel D3D11VA textures before mapping to OpenCL
* Backport upstream QSV fixes
* Update dependencies

-- nyanmisaka <nst799610810@gmail.com> Sat, 26 Aug 2023 01:30:16 +0800

jellyfin-ffmpeg (5.1.3-4) unstable; urgency=medium

* Add VUI info to the seq header of HEVC VA-API encoder
Expand Down
33 changes: 21 additions & 12 deletions debian/patches/0022-add-code-polishing-to-qsv-filters.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1391,15 +1391,24 @@ Index: jellyfin-ffmpeg/libavfilter/vf_vpp_qsv.c
static int config_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
@@ -335,7 +382,6 @@ static int config_output(AVFilterLink *o
@@ -330,12 +377,14 @@ static int config_output(AVFilterLink *o
outlink->w = vpp->out_width;
outlink->h = vpp->out_height;
outlink->frame_rate = vpp->framerate;
- outlink->time_base = inlink->time_base;
+ if (vpp->framerate.num == 0 || vpp->framerate.den == 0)
+ outlink->time_base = inlink->time_base;
+ else
+ outlink->time_base = av_inv_q(vpp->framerate);

param.filter_frame = NULL;
param.num_ext_buf = 0;
param.ext_buf = ext_buf;
- param.async_depth = vpp->async_depth;

if (get_mfx_version(ctx, &mfx_version) != MFX_ERR_NONE) {
av_log(ctx, AV_LOG_ERROR, "Failed to query mfx version.\n");
@@ -365,53 +411,46 @@ static int config_output(AVFilterLink *o
@@ -365,53 +414,46 @@ static int config_output(AVFilterLink *o
param.crop = &crop;
}

Expand Down Expand Up @@ -1480,7 +1489,7 @@ Index: jellyfin-ffmpeg/libavfilter/vf_vpp_qsv.c
}

if (vpp->transpose >= 0) {
@@ -458,18 +497,14 @@ static int config_output(AVFilterLink *o
@@ -458,18 +500,14 @@ static int config_output(AVFilterLink *o

if (vpp->rotate) {
if (QSV_RUNTIME_VERSION_ATLEAST(mfx_version, 1, 17)) {
Expand All @@ -1501,7 +1510,7 @@ Index: jellyfin-ffmpeg/libavfilter/vf_vpp_qsv.c
} else {
av_log(ctx, AV_LOG_WARNING, "The QSV VPP rotate option is "
"not supported with this MSDK version.\n");
@@ -479,12 +514,8 @@ static int config_output(AVFilterLink *o
@@ -479,12 +517,8 @@ static int config_output(AVFilterLink *o

if (vpp->hflip) {
if (QSV_RUNTIME_VERSION_ATLEAST(mfx_version, 1, 19)) {
Expand All @@ -1516,7 +1525,7 @@ Index: jellyfin-ffmpeg/libavfilter/vf_vpp_qsv.c
} else {
av_log(ctx, AV_LOG_WARNING, "The QSV VPP hflip option is "
"not supported with this MSDK version.\n");
@@ -494,22 +525,38 @@ static int config_output(AVFilterLink *o
@@ -494,22 +528,38 @@ static int config_output(AVFilterLink *o

if (inlink->w != outlink->w || inlink->h != outlink->h) {
if (QSV_RUNTIME_VERSION_ATLEAST(mfx_version, 1, 19)) {
Expand Down Expand Up @@ -1562,7 +1571,7 @@ Index: jellyfin-ffmpeg/libavfilter/vf_vpp_qsv.c
av_log(ctx, AV_LOG_VERBOSE, "qsv vpp pass through mode.\n");
if (inlink->hw_frames_ctx)
outlink->hw_frames_ctx = av_buffer_ref(inlink->hw_frames_ctx);
@@ -522,29 +569,27 @@ static int activate(AVFilterContext *ctx
@@ -522,29 +572,27 @@ static int activate(AVFilterContext *ctx
{
AVFilterLink *inlink = ctx->inputs[0];
AVFilterLink *outlink = ctx->outputs[0];
Expand Down Expand Up @@ -1597,7 +1606,7 @@ Index: jellyfin-ffmpeg/libavfilter/vf_vpp_qsv.c
ret = ff_qsvvpp_filter_frame(qsv, inlink, in);
av_frame_free(&in);
if (ret == AVERROR(EAGAIN))
@@ -552,7 +597,7 @@ static int activate(AVFilterContext *ctx
@@ -552,7 +600,7 @@ static int activate(AVFilterContext *ctx
else if (ret < 0)
return ret;

Expand All @@ -1606,15 +1615,15 @@ Index: jellyfin-ffmpeg/libavfilter/vf_vpp_qsv.c
goto eof;

if (qsv->got_frame) {
@@ -561,6 +606,7 @@ static int activate(AVFilterContext *ctx
@@ -561,6 +609,7 @@ static int activate(AVFilterContext *ctx
}
}
} else {
+ /* No MFX session is created in pass-through mode */
if (in) {
if (in->pts != AV_NOPTS_VALUE)
in->pts = av_rescale_q(in->pts, inlink->time_base, outlink->time_base);
@@ -569,7 +615,7 @@ static int activate(AVFilterContext *ctx
@@ -569,7 +618,7 @@ static int activate(AVFilterContext *ctx
if (ret < 0)
return ret;

Expand All @@ -1623,7 +1632,7 @@ Index: jellyfin-ffmpeg/libavfilter/vf_vpp_qsv.c
goto eof;

return 0;
@@ -577,7 +623,7 @@ static int activate(AVFilterContext *ctx
@@ -577,7 +626,7 @@ static int activate(AVFilterContext *ctx
}

not_ready:
Expand All @@ -1632,7 +1641,7 @@ Index: jellyfin-ffmpeg/libavfilter/vf_vpp_qsv.c
goto eof;

FF_FILTER_FORWARD_WANTED(outlink, inlink);
@@ -585,11 +631,101 @@ not_ready:
@@ -585,11 +634,101 @@ not_ready:
return FFERROR_NOT_READY;

eof:
Expand Down Expand Up @@ -1735,7 +1744,7 @@ Index: jellyfin-ffmpeg/libavfilter/vf_vpp_qsv.c
{
int ret;
static const enum AVPixelFormat in_pix_fmts[] = {
@@ -615,46 +751,79 @@ static int query_formats(AVFilterContext
@@ -615,46 +754,79 @@ static int query_formats(AVFilterContext
&ctx->outputs[0]->incfg.formats);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,3 @@ Index: jellyfin-ffmpeg/libavutil/hwcontext_d3d11va.h
} AVD3D11VADeviceContext;

/**
Index: jellyfin-ffmpeg/libavutil/hwcontext_opencl.c
===================================================================
--- jellyfin-ffmpeg.orig/libavutil/hwcontext_opencl.c
+++ jellyfin-ffmpeg/libavutil/hwcontext_opencl.c
@@ -1380,7 +1380,7 @@ static int opencl_device_derive(AVHWDevi
CL_CONTEXT_D3D11_DEVICE_KHR,
(intptr_t)src_hwctx->device,
CL_CONTEXT_INTEROP_USER_SYNC,
- CL_TRUE,
+ (src_hwctx->device_desc.VendorId != 0x8086 || src_hwctx->is_uma),
0,
};
OpenCLDeviceSelector selector = {
9 changes: 9 additions & 0 deletions debian/patches/0052-backport-upstream-qsvenc-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ Index: jellyfin-ffmpeg/libavcodec/qsvenc.c
}

if ((avctx->codec_id == AV_CODEC_ID_H264 ||
@@ -1864,7 +1990,7 @@ int ff_qsv_encode(AVCodecContext *avctx,
pict_type = AV_PICTURE_TYPE_P;
else if (qpkt.bs->FrameType & MFX_FRAMETYPE_B || qpkt.bs->FrameType & MFX_FRAMETYPE_xB)
pict_type = AV_PICTURE_TYPE_B;
- else if (qpkt.bs->FrameType == MFX_FRAMETYPE_UNKNOWN) {
+ else if (qpkt.bs->FrameType == MFX_FRAMETYPE_UNKNOWN && qpkt.bs->DataLength) {
pict_type = AV_PICTURE_TYPE_NONE;
av_log(avctx, AV_LOG_WARNING, "Unknown FrameType, set pict_type to AV_PICTURE_TYPE_NONE.\n");
} else {
Index: jellyfin-ffmpeg/libavutil/hwcontext_qsv.c
===================================================================
--- jellyfin-ffmpeg.orig/libavutil/hwcontext_qsv.c
Expand Down
Loading

0 comments on commit c0dbc74

Please sign in to comment.