Skip to content

Commit 895dafd

Browse files
committed
Sync ffmpeg with changes from upstream
1 parent 1ec0ed6 commit 895dafd

5 files changed

Lines changed: 69 additions & 4 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
2+
index 6317ab7d0e..f1f70e9b96 100644
3+
--- a/libavutil/hwcontext_vulkan.c
4+
+++ b/libavutil/hwcontext_vulkan.c
5+
@@ -453,7 +453,7 @@ static const VulkanOptExtension optional_device_exts[] = {
6+
{ VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_AV1 },
7+
};
8+
9+
-static VkBool32 VKAPI_CALL vk_dbg_callback(VkDebugUtilsMessageSeverityFlagBitsEXT severity,
10+
+static VKAPI_ATTR VkBool32 VKAPI_CALL vk_dbg_callback(VkDebugUtilsMessageSeverityFlagBitsEXT severity,
11+
VkDebugUtilsMessageTypeFlagsEXT messageType,
12+
const VkDebugUtilsMessengerCallbackDataEXT *data,
13+
void *priv)

ports/ffmpeg/build.sh.in

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ else
8585
OPTIONS_x86_64="${OPTIONS_x86}"
8686
fi
8787

88+
case "@VCPKG_CMAKE_SYSTEM_NAME@" in
89+
FreeBSD|OpenBSD)
90+
MAKE_BINARY="gmake"
91+
;;
92+
*)
93+
MAKE_BINARY="make"
94+
;;
95+
esac
96+
8897
build_ffmpeg() {
8998
# extract build architecture
9099
BUILD_ARCH=$1
@@ -102,11 +111,11 @@ build_ffmpeg() {
102111

103112
echo "=== BUILDING ==="
104113

105-
make -j${JOBS} V=1
114+
$MAKE_BINARY -j${JOBS} V=1
106115

107116
echo "=== INSTALLING ==="
108117

109-
make install
118+
$MAKE_BINARY install
110119
}
111120

112121
cd "$PATH_TO_BUILD_DIR"
@@ -115,7 +124,7 @@ if [ $OSX_ARCH_COUNT -gt 0 ]; then
115124
for ARCH in $OSX_ARCHS; do
116125
echo "=== CLEANING FOR $ARCH ==="
117126

118-
make clean && make distclean
127+
$MAKE_BINARY clean && $MAKE_BINARY distclean
119128

120129
build_ffmpeg $ARCH --extra-cflags=-arch --extra-cflags=$ARCH --extra-ldflags=-arch --extra-ldflags=$ARCH
121130

ports/ffmpeg/portfile.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ vcpkg_from_github(
1717
0040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch # Do not remove this patch. It is required by chromium
1818
0041-add-const-for-opengl-definition.patch
1919
0043-fix-miss-head.patch
20+
0044-fix-vulkan-debug-callback-abi.patch
2021
)
2122

2223
if(SOURCE_PATH MATCHES " ")
@@ -526,6 +527,12 @@ else()
526527
set(WITH_VPX OFF)
527528
endif()
528529

530+
if("vulkan" IN_LIST FEATURES)
531+
set(OPTIONS "${OPTIONS} --enable-vulkan")
532+
else()
533+
set(OPTIONS "${OPTIONS} --disable-vulkan")
534+
endif()
535+
529536
if("webp" IN_LIST FEATURES)
530537
set(OPTIONS "${OPTIONS} --enable-libwebp")
531538
set(WITH_WEBP ON)
@@ -580,6 +587,14 @@ else()
580587
set(WITH_MFX OFF)
581588
endif()
582589

590+
if ("vaapi" IN_LIST FEATURES)
591+
set(OPTIONS "${OPTIONS} --enable-vaapi")
592+
set(WITH_VAAPI ON)
593+
else()
594+
set(OPTIONS "${OPTIONS} --disable-vaapi")
595+
set(WITH_VAAPI OFF)
596+
endif()
597+
583598
# Disable codecs and devices unused by CorsixTH
584599
set (OPTIONS "${OPTIONS} --disable-encoders")
585600
set (OPTIONS "${OPTIONS} --disable-decoders --enable-decoder=smacker --enable-decoder=smackaud")

ports/ffmpeg/vcpkg-cmake-wrapper.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,16 @@ if(@WITH_OPENCL@)
289289
endif()
290290
endif()
291291

292+
if(@WITH_VAAPI@)
293+
find_package(PkgConfig )
294+
pkg_check_modules(libva IMPORTED_TARGET libva)
295+
pkg_check_modules(libva-drm IMPORTED_TARGET libva-drm)
296+
list(APPEND FFMPEG_LIBRARIES PkgConfig::libva PkgConfig::libva-drm)
297+
if(vcpkg_no_avcodec_target AND TARGET FFmpeg::avcodec)
298+
target_link_libraries(FFmpeg::avcodec INTERFACE PkgConfig::libva PkgConfig::libva-drm)
299+
endif()
300+
endif()
301+
292302
endif(NOT z_vcpkg_using_vcpkg_find_ffmpeg)
293303
unset(z_vcpkg_using_vcpkg_find_ffmpeg)
294304

ports/ffmpeg/vcpkg.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ffmpeg",
33
"version": "7.1.1",
4-
"port-version": 2,
4+
"port-version": 3,
55
"description": [
66
"A library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.",
77
"FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."
@@ -62,6 +62,7 @@
6262
"theora",
6363
"vorbis",
6464
"vpx",
65+
"vulkan",
6566
"webp",
6667
"xml2",
6768
"zlib"
@@ -647,6 +648,17 @@
647648
"libtheora"
648649
]
649650
},
651+
"vaapi": {
652+
"description": "VAAPI video decoding/encoding acceleration",
653+
"supports": "linux",
654+
"dependencies": [
655+
{
656+
"name": "libva",
657+
"default-features": false,
658+
"platform": "linux"
659+
}
660+
]
661+
},
650662
"version3": {
651663
"description": "Upgrade (L)GPL to version 3"
652664
},
@@ -669,6 +681,12 @@
669681
"libvpx"
670682
]
671683
},
684+
"vulkan": {
685+
"description": "H.264, HEVC and AV1 de/encoding via Vulkan",
686+
"dependencies": [
687+
"vulkan-headers"
688+
]
689+
},
672690
"webp": {
673691
"description": "WebP encoding via libwebp",
674692
"dependencies": [

0 commit comments

Comments
 (0)