summaryrefslogtreecommitdiff
path: root/multimedia/handbrake/files
diff options
context:
space:
mode:
Diffstat (limited to 'multimedia/handbrake/files')
-rw-r--r--multimedia/handbrake/files/patch-contrib_ffmpeg_module.defs18
-rw-r--r--multimedia/handbrake/files/patch-libhb_enc__qsv.c67
-rw-r--r--multimedia/handbrake/files/patch-libhb_handbrake_qsv__common.h19
-rw-r--r--multimedia/handbrake/files/patch-libhb_qsv__common.c91
-rw-r--r--multimedia/handbrake/files/patch-make_include_contrib.defs11
5 files changed, 76 insertions, 130 deletions
diff --git a/multimedia/handbrake/files/patch-contrib_ffmpeg_module.defs b/multimedia/handbrake/files/patch-contrib_ffmpeg_module.defs
index 178198ba7762..1ab6fbcaafbd 100644
--- a/multimedia/handbrake/files/patch-contrib_ffmpeg_module.defs
+++ b/multimedia/handbrake/files/patch-contrib_ffmpeg_module.defs
@@ -1,20 +1,10 @@
-Disable vulkan support.
-Handbrake doesn't require Vulkan but if it is installed in build environment
-(for other ports like QT5), It fails to build Handbrake, because following
-definitions has been removed since vulkan-headers-1.3.238.
-
-* VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME
-* VK_EXT_VIDEO_DECODE_H265_EXTENSION_NAME
-
---- contrib/ffmpeg/module.defs.orig 2024-12-01 15:28:40 UTC
+--- contrib/ffmpeg/module.defs.orig 2025-08-08 16:41:24 UTC
+++ contrib/ffmpeg/module.defs
-@@ -34,8 +34,10 @@ FFMPEG.CONFIGURE.extra = \
- --enable-filters \
+@@ -35,6 +35,7 @@ FFMPEG.CONFIGURE.extra = \
--disable-hwaccels \
--disable-vdpau \
-+ --disable-vulkan \
--disable-postproc \
++ --disable-vulkan \
--disable-encoders \
-+ --disable-xlib \
--enable-libmp3lame \
- --enable-encoder=ac3 \
+ --enable-encoder=aac \
diff --git a/multimedia/handbrake/files/patch-libhb_enc__qsv.c b/multimedia/handbrake/files/patch-libhb_enc__qsv.c
deleted file mode 100644
index 51f61011c734..000000000000
--- a/multimedia/handbrake/files/patch-libhb_enc__qsv.c
+++ /dev/null
@@ -1,67 +0,0 @@
---- libhb/enc_qsv.c.orig 2024-12-01 15:28:40 UTC
-+++ libhb/enc_qsv.c
-@@ -174,7 +174,9 @@ static int log_encoder_params(const hb_work_private_t
- {
- const mfxExtCodingOption *option1 = NULL;
- const mfxExtCodingOption2 *option2 = NULL;
-+#if (MFX_VERSION >= 2012)
- const mfxExtAV1ScreenContentTools *extScreenContentCoding = NULL;
-+#endif
- const mfxExtHyperModeParam *extHyperModeOption = NULL;
-
- for (int i = 0; i < videoParam->NumExtParam; i++)
-@@ -188,10 +190,12 @@ static int log_encoder_params(const hb_work_private_t
- {
- option2 = (mfxExtCodingOption2*)videoParam->ExtParam[i];
- }
-+#if (MFX_VERSION >= 2012)
- else if (option->Header.BufferId == MFX_EXTBUFF_AV1_SCREEN_CONTENT_TOOLS)
- {
- extScreenContentCoding = (mfxExtAV1ScreenContentTools*)videoParam->ExtParam[i];
- }
-+#endif
- else if (option->Header.BufferId == MFX_EXTBUFF_HYPER_MODE_PARAM)
- {
- extHyperModeOption = (mfxExtHyperModeParam*)videoParam->ExtParam[i];
-@@ -221,13 +225,14 @@ static int log_encoder_params(const hb_work_private_t
- hb_log("encqsvInit: GopRefDist %"PRIu16" GopPicSize %"PRIu16" NumRefFrame %"PRIu16" IdrInterval %"PRIu16"",
- videoParam->mfx.GopRefDist, videoParam->mfx.GopPicSize, videoParam->mfx.NumRefFrame, videoParam->mfx.IdrInterval);
-
-+#if (MFX_VERSION >= 2012)
- if (extScreenContentCoding && ((extScreenContentCoding->IntraBlockCopy == MFX_CODINGOPTION_ON) || (extScreenContentCoding->Palette == MFX_CODINGOPTION_ON)))
- {
- hb_log("encqsvInit: ScreenContentCoding is enabled IBC %s, Palette %s",
- (extScreenContentCoding->IntraBlockCopy == MFX_CODINGOPTION_ON) ? "on" : "off",
- (extScreenContentCoding->Palette == MFX_CODINGOPTION_ON) ? "on" : "off");
- }
--
-+#endif
- if (pv->qsv_info->capabilities & HB_QSV_CAP_B_REF_PYRAMID)
- {
- hb_log("encqsvInit: BFramesMax %d BRefType %s",
-@@ -1670,7 +1675,9 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job)
- mfxSession session = (mfxSession)0;
- mfxExtCodingOption option1_buf, *option1 = &option1_buf;
- mfxExtCodingOption2 option2_buf, *option2 = &option2_buf;
-+#if (MFX_VERSION >= 2012)
- mfxExtAV1ScreenContentTools screencont_coding_buf, *screencont_coding = &screencont_coding_buf;
-+#endif
- mfxExtCodingOptionSPSPPS sps_pps_buf, *sps_pps = &sps_pps_buf;
- mfxExtAV1BitstreamParam av1_bitstream_buf, *av1_bitstream = &av1_bitstream_buf;
- mfxExtChromaLocInfo chroma_loc_info_buf, *chroma_loc_info = &chroma_loc_info_buf;
-@@ -1795,6 +1802,7 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job)
- {
- videoParam.ExtParam[videoParam.NumExtParam++] = (mfxExtBuffer*)hyper_encode;
- }
-+#if (MFX_VERSION >= 2012)
- memset(screencont_coding, 0, sizeof(mfxExtAV1ScreenContentTools));
- screencont_coding->Header.BufferId = MFX_EXTBUFF_AV1_SCREEN_CONTENT_TOOLS;
- screencont_coding->Header.BufferSz = sizeof(mfxExtAV1ScreenContentTools);
-@@ -1802,6 +1810,7 @@ int encqsvInit(hb_work_object_t *w, hb_job_t *job)
- {
- videoParam.ExtParam[videoParam.NumExtParam++] = (mfxExtBuffer*)screencont_coding;
- }
-+#endif
- /* Query actual encoding parameters after MFXVideoENCODE_Init, some of them could be overridden */
- sts = MFXVideoENCODE_GetVideoParam(session, &videoParam);
- if (sts != MFX_ERR_NONE)
diff --git a/multimedia/handbrake/files/patch-libhb_handbrake_qsv__common.h b/multimedia/handbrake/files/patch-libhb_handbrake_qsv__common.h
index 87c487304cad..d96a628ca015 100644
--- a/multimedia/handbrake/files/patch-libhb_handbrake_qsv__common.h
+++ b/multimedia/handbrake/files/patch-libhb_handbrake_qsv__common.h
@@ -1,12 +1,17 @@
---- libhb/handbrake/qsv_common.h.orig 2024-12-01 15:28:40 UTC
+--- libhb/handbrake/qsv_common.h.orig 2025-08-08 16:41:24 UTC
+++ libhb/handbrake/qsv_common.h
-@@ -171,7 +171,9 @@ typedef struct
+@@ -260,8 +260,13 @@ typedef struct
+ {
mfxExtCodingOption2 codingOption2;
- mfxExtVideoSignalInfo videoSignalInfo;
- mfxExtHyperModeParam hyperEncodeParam;
+ hb_triplet_t* hyperEncodeParam;
+#if (MFX_VERSION >= 2012)
mfxExtAV1ScreenContentTools av1ScreenContentToolsParam;
+-
+#endif
- mfxExtChromaLocInfo chromaLocInfo;
- mfxExtMasteringDisplayColourVolume masteringDisplayColourVolume;
- mfxExtContentLightLevelInfo contentLightLevelInfo;
++ mfxExtChromaLocInfo chromaLocInfo;
++ mfxExtMasteringDisplayColourVolume masteringDisplayColourVolume;
++ mfxExtContentLightLevelInfo contentLightLevelInfo;
++ mfxExtAV1BitstreamParam av1BitstreamParam;
+ struct
+ {
+ int b_pyramid;
diff --git a/multimedia/handbrake/files/patch-libhb_qsv__common.c b/multimedia/handbrake/files/patch-libhb_qsv__common.c
index 78580b06be46..b0b892e337e7 100644
--- a/multimedia/handbrake/files/patch-libhb_qsv__common.c
+++ b/multimedia/handbrake/files/patch-libhb_qsv__common.c
@@ -1,6 +1,6 @@
---- libhb/qsv_common.c.orig 2024-12-01 15:28:40 UTC
+--- libhb/qsv_common.c.orig 2025-08-08 16:41:24 UTC
+++ libhb/qsv_common.c
-@@ -463,6 +463,7 @@ int qsv_map_mfx_platform_codename(int mfx_platform_cod
+@@ -390,6 +390,7 @@ int qsv_map_mfx_platform_codename(int mfx_platform_cod
case MFX_PLATFORM_DG2:
case MFX_PLATFORM_ALDERLAKE_N:
case MFX_PLATFORM_KEEMBAY:
@@ -8,7 +8,7 @@
case MFX_PLATFORM_METEORLAKE:
case MFX_PLATFORM_BATTLEMAGE:
case MFX_PLATFORM_ARROWLAKE:
-@@ -471,6 +472,7 @@ int qsv_map_mfx_platform_codename(int mfx_platform_cod
+@@ -398,6 +399,7 @@ int qsv_map_mfx_platform_codename(int mfx_platform_cod
case MFX_PLATFORM_LUNARLAKE:
platform = HB_CPU_PLATFORM_INTEL_LNL;
break;
@@ -16,35 +16,34 @@
default:
platform = HB_CPU_PLATFORM_UNSPECIFIED;
}
-@@ -984,7 +986,7 @@ static void init_ext_av1bitstream_option(mfxExtAV1Bits
- extAV1BitstreamParam->Header.BufferSz = sizeof(mfxExtAV1BitstreamParam);
- extAV1BitstreamParam->WriteIVFHeaders = MFX_CODINGOPTION_OFF;
+@@ -928,6 +930,7 @@ static void init_ext_coding_option2(mfxExtCodingOption
+ extCodingOption2->NumMbPerSlice = 2040; // 1920x1088/4
}
--
+
+#if (MFX_VERSION >= 2012)
- static void init_ext_av1screencontent_tools(mfxExtAV1ScreenContentTools *extScreenContentTools)
+ static void init_ext_av1bitstream_option(mfxExtAV1BitstreamParam *extAV1BitstreamParam)
{
- if (extScreenContentTools == NULL)
-@@ -998,7 +1000,7 @@ static void init_ext_av1screencontent_tools(mfxExtAV1S
+ if (extAV1BitstreamParam == NULL)
+@@ -954,6 +957,7 @@ static void init_ext_av1screencontent_tools(mfxExtAV1S
extScreenContentTools->IntraBlockCopy = MFX_CODINGOPTION_OFF;
extScreenContentTools->Palette = MFX_CODINGOPTION_OFF;
}
--
+#endif
+
static int query_capabilities(mfxSession session, int index, mfxVersion version, hb_qsv_info_t *info, int lowpower)
{
- /*
-@@ -1026,7 +1028,9 @@ static int query_capabilities(mfxSession session, int
+@@ -981,8 +985,10 @@ static int query_capabilities(mfxSession session, int
+ mfxExtChromaLocInfo extChromaLocInfo;
mfxExtMasteringDisplayColourVolume extMasteringDisplayColourVolume;
mfxExtContentLightLevelInfo extContentLightLevelInfo;
- mfxExtAV1BitstreamParam extAV1BitstreamParam;
+#if (MFX_VERSION >= 2012)
+ mfxExtAV1BitstreamParam extAV1BitstreamParam;
mfxExtAV1ScreenContentTools extAV1ScreenContentToolsParam;
+#endif
mfxExtHyperModeParam extHyperEncodeParam;
/* Reset capabilities before querying */
-@@ -1460,6 +1464,7 @@ static int query_capabilities(mfxSession session, int
+@@ -1416,6 +1422,7 @@ static int query_capabilities(mfxSession session, int
info->capabilities |= HB_QSV_CAP_HYPERENCODE;
}
}
@@ -52,7 +51,7 @@
if ((lowpower == MFX_CODINGOPTION_ON) && (info->codec_id == MFX_CODEC_AV1))
{
init_video_param(&videoParam);
-@@ -1494,6 +1499,7 @@ static int query_capabilities(mfxSession session, int
+@@ -1450,6 +1457,7 @@ static int query_capabilities(mfxSession session, int
info->capabilities |= HB_QSV_CAP_AV1_SCREENCONTENT;
}
}
@@ -60,7 +59,7 @@
}
return 0;
-@@ -1935,10 +1941,12 @@ static void log_encoder_capabilities(const int log_lev
+@@ -1891,10 +1899,12 @@ static void log_encoder_capabilities(const int log_lev
strcat(buffer, "+nmpslice");
}
}
@@ -73,15 +72,31 @@
if (caps & HB_QSV_CAP_HYPERENCODE)
{
strcat(buffer, " hyperencode");
-@@ -3011,6 +3019,7 @@ int hb_qsv_param_parse(hb_qsv_param_t *param, hb_qsv_i
- param->hyperEncodeParam.Mode = mode->value;
+@@ -2686,6 +2696,7 @@ int hb_qsv_select_ffmpeg_options(qsv_data_t * qsv_data
+ hb_log("encavcodec: using Low Power mode");
+ }
+
++#if (MFX_VERSION >= 2012)
+ if((qsv_data->qsv_info->capabilities & HB_QSV_CAP_AV1_SCREENCONTENT) &&
+ qsv_data->param.av1ScreenContentToolsParam.IntraBlockCopy)
+ {
+@@ -2705,6 +2716,7 @@ int hb_qsv_select_ffmpeg_options(qsv_data_t * qsv_data
+ hb_log("encavcodec: ScreenContentCoding is enabled Palette %s",
+ qsv_data->param.av1ScreenContentToolsParam.Palette ? "on" : "off");
+ }
++#endif
+
+ // Transcoding Info
+ MFX_STRUCT_TO_AV_OPTS(BRCParamMultiplier)
+@@ -3318,6 +3330,7 @@ int hb_qsv_param_parse(AVDictionary** av_opts, hb_qsv_
+ param->hyperEncodeParam = mode;
}
}
+#if (MFX_VERSION >= 2012)
else if (!strcasecmp(key, "palette"))
{
if (info->capabilities & HB_QSV_CAP_AV1_SCREENCONTENT)
-@@ -3041,6 +3050,7 @@ int hb_qsv_param_parse(hb_qsv_param_t *param, hb_qsv_i
+@@ -3348,6 +3361,7 @@ int hb_qsv_param_parse(AVDictionary** av_opts, hb_qsv_
return HB_QSV_PARAM_UNSUPPORTED;
}
}
@@ -89,32 +104,24 @@
else if (!strcasecmp(key, "async-depth"))
{
int async_depth = hb_qsv_atoi(value, &error);
-@@ -3527,13 +3537,14 @@ int hb_qsv_param_default(hb_qsv_param_t *param, mfxVid
- param->av1BitstreamParam.Header.BufferId = MFX_EXTBUFF_AV1_BITSTREAM_PARAM;
- param->av1BitstreamParam.Header.BufferSz = sizeof(mfxExtAV1BitstreamParam);
- param->av1BitstreamParam.WriteIVFHeaders = MFX_CODINGOPTION_OFF;
+@@ -3617,6 +3631,12 @@ int hb_qsv_param_default(hb_qsv_param_t *param, hb_qsv
+ // introduced in API 2.5
+ param->hyperEncodeParam = hb_triplet4key(hb_qsv_hyper_encode_modes, "off");
+
++ memset(&param->av1BitstreamParam, 0, sizeof(mfxExtAV1BitstreamParam));
++ param->av1BitstreamParam.Header.BufferId = MFX_EXTBUFF_AV1_BITSTREAM_PARAM;
++ param->av1BitstreamParam.Header.BufferSz = sizeof(mfxExtAV1BitstreamParam);
++ param->av1BitstreamParam.WriteIVFHeaders = MFX_CODINGOPTION_OFF;
++
+#if (MFX_VERSION >= 2012)
// introduced in API 2.11
memset(&param->av1ScreenContentToolsParam, 0, sizeof(mfxExtAV1ScreenContentTools));
param->av1ScreenContentToolsParam.Header.BufferId = MFX_EXTBUFF_AV1_SCREEN_CONTENT_TOOLS;
- param->av1ScreenContentToolsParam.Header.BufferSz = sizeof(mfxExtAV1ScreenContentTools);
- param->av1ScreenContentToolsParam.IntraBlockCopy = MFX_CODINGOPTION_OFF;
- param->av1ScreenContentToolsParam.Palette = MFX_CODINGOPTION_OFF;
--
-+#endif
- // GOP & rate control
- param->gop.b_pyramid = 1; // enabled by default (if supported)
- param->gop.gop_pic_size = -1; // set automatically
-@@ -3607,10 +3618,12 @@ int hb_qsv_param_default(hb_qsv_param_t *param, mfxVid
- {
- param->videoParam->ExtParam[param->videoParam->NumExtParam++] = (mfxExtBuffer*)&param->av1BitstreamParam;
- }
-+#if (MFX_VERSION >= 2012)
- if (info->capabilities & HB_QSV_CAP_AV1_SCREENCONTENT)
- {
- param->videoParam->ExtParam[param->videoParam->NumExtParam++] = (mfxExtBuffer*)&param->av1ScreenContentToolsParam;
- }
+@@ -3639,6 +3659,7 @@ int hb_qsv_param_default(hb_qsv_param_t *param, hb_qsv
+ param->rc.vbv_buffer_init = .0; // set automatically
+
+ param->low_power = 0;
+#endif
+
#if defined(_WIN32) || defined(__MINGW32__)
if (info->capabilities & HB_QSV_CAP_LOWPOWER_ENCODE)
- {
diff --git a/multimedia/handbrake/files/patch-make_include_contrib.defs b/multimedia/handbrake/files/patch-make_include_contrib.defs
new file mode 100644
index 000000000000..058246d98b42
--- /dev/null
+++ b/multimedia/handbrake/files/patch-make_include_contrib.defs
@@ -0,0 +1,11 @@
+--- make/include/contrib.defs.orig 2025-08-23 10:38:18 UTC
++++ make/include/contrib.defs
+@@ -60,7 +60,7 @@ define import.CONTRIB.defs
+ $(1).EXTRACT.target = $$($(1).build/).stamp.$$($(1).name).extract
+ define $(1).EXTRACT
+ $$(RM.exe) -fr $$($(1).EXTRACT.dir/)
+- $$(TAR.exe) xfC $$($(1).FETCH.distfile) $$($(1).build/)
++ $$(TAR.exe) xfC $$($(1).FETCH.distfile) $$($(1).build/) --no-xattrs
+ $$(TOUCH.exe) $$@
+ endef
+