Skip to content

Commit

Permalink
[ffmpeg] srt support (#26679)
Browse files Browse the repository at this point in the history
  • Loading branch information
fran6co committed Oct 9, 2022
1 parent 11967e7 commit a29baaf
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 8 deletions.
6 changes: 6 additions & 0 deletions ports/ffmpeg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,12 @@ else()
set(OPTIONS "${OPTIONS} --disable-zlib")
endif()

if ("srt" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libsrt")
else()
set(OPTIONS "${OPTIONS} --disable-libsrt")
endif()

if (VCPKG_TARGET_IS_OSX)
set(OPTIONS "${OPTIONS} --disable-vdpau") # disable vdpau in OSX
endif()
Expand Down
15 changes: 15 additions & 0 deletions ports/ffmpeg/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@
],
"platform": "!uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"srt"
],
"platform": "!uwp"
},
{
"name": "ffmpeg",
"default-features": false,
Expand Down Expand Up @@ -548,6 +556,13 @@
"speex"
]
},
"srt": {
"description": "Haivision SRT protocol",
"supports": "!uwp",
"dependencies": [
"libsrt"
]
},
"ssh": {
"description": "SFTP protocol via libssh",
"dependencies": [
Expand Down
26 changes: 26 additions & 0 deletions ports/libsrt/fix-static.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9931589..e5a588e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -931,20 +931,7 @@ endif()

if (srt_libspec_static)
add_library(${TARGET_srt}_static STATIC ${OBJECT_LIB_SUPPORT} ${VIRTUAL_srt})
-
- # For Windows, leave the name to be "srt_static.lib".
- # Windows generates two different library files:
- # - a usual static library for static linkage
- # - a shared library exposer, which allows pre-resolution and later dynamic
- # linkage when running the executable
- # Both having unfortunately the same names created by MSVC compiler.
- # It's not the case of Cygwin/MINGW - they are named there libsrt.a and libsrt.dll.a
- if (MICROSOFT)
- # Keep _static suffix. By unknown reason, the name must still be set explicitly.
- set_property(TARGET ${TARGET_srt}_static PROPERTY OUTPUT_NAME ${TARGET_srt}_static)
- else()
- set_property(TARGET ${TARGET_srt}_static PROPERTY OUTPUT_NAME ${TARGET_srt})
- endif()
+ set_property(TARGET ${TARGET_srt}_static PROPERTY OUTPUT_NAME ${TARGET_srt})

list (APPEND INSTALL_TARGETS ${TARGET_srt}_static)
if (ENABLE_ENCRYPTION)
4 changes: 3 additions & 1 deletion ports/libsrt/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ vcpkg_from_github(
REF v1.5.0
SHA512 68ab5fe316cfbbbba31b5b2354f657e23c90e14674f8dac01df2bf98c4776a7fafcd690a4dfad3a340e6be577a22360ca04ef2397c8a0dd507adebdd54dc22fb
HEAD_REF master
PATCHES fix-dependency-install.patch
PATCHES
fix-dependency-install.patch
fix-static.patch
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" KEYSTONE_BUILD_STATIC)
Expand Down
2 changes: 1 addition & 1 deletion ports/openssl/install-pc-files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ install_pc_file(libcrypto [[
Name: OpenSSL-libcrypto
Description: OpenSSL cryptography library
Libs: -L"${libdir}" -llibcrypto
Libs.private: -lcrypt32 -lws2_32
Libs.private: -lcrypt32 -lws2_32 -ladvapi32 -luser32
Cflags: -I"${includedir}"
]])

Expand Down
2 changes: 1 addition & 1 deletion ports/openssl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openssl",
"version": "3.0.5",
"port-version": 4,
"port-version": 5,
"description": "OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.",
"homepage": "https://www.openssl.org",
"license": "Apache-2.0",
Expand Down
5 changes: 3 additions & 2 deletions scripts/test_ports/vcpkg-ci-ffmpeg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vcpkg-ci-ffmpeg",
"version-string": "1",
"port-version": 1,
"port-version": 2,
"description": "Port to force features of certain ports within CI",
"homepage": "https://github.com/microsoft/vcpkg",
"dependencies": [
Expand Down Expand Up @@ -64,7 +64,8 @@
"fribidi",
"modplug",
"opencl",
"openh264"
"openh264",
"srt"
],
"platform": "!uwp"
},
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5434,7 +5434,7 @@
},
"openssl": {
"baseline": "3.0.5",
"port-version": 4
"port-version": 5
},
"openssl-unix": {
"baseline": "1.1.1h",
Expand Down
2 changes: 1 addition & 1 deletion versions/f-/ffmpeg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": [
{
"git-tree": "81adf5d3e80f0e54a7e968950860fed901186e85",
"git-tree": "42edfcee5ee9a8884b7c1733c6b560092cad9576",
"version": "4.4.1",
"port-version": 19
},
Expand Down
2 changes: 1 addition & 1 deletion versions/l-/libsrt.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": [
{
"git-tree": "00e56b5f80be0e6a959bf121d906edb2255c7764",
"git-tree": "08022cd3b0ae3348a7af42013e5245fb5929d037",
"version": "1.5.0",
"port-version": 2
},
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/openssl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "067a790dfd1559e77d5a199ccbe982322882d667",
"version": "3.0.5",
"port-version": 5
},
{
"git-tree": "557ff31f9a64f01cd0d98dd44793ce3c7fd32893",
"version": "3.0.5",
Expand Down

0 comments on commit a29baaf

Please sign in to comment.