libs/srt: add new package v1.5.3

This adds the Secure Reliable Transport (SRT) package.

SRT is used as a popular transfer protocol for video & audio
and can be used within gstreamer as both a sink or source.

It also supports stream encryptino by simply
setting a password on both ends of the link.

More details can be found here:
https://www.haivision.com/products/srt-secure-reliable-transport/

It is being actively developed on github:
https://github.com/Haivision/srt

Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
pull/25157/head
Koen Vandeputte 2024-10-02 16:22:17 +02:00 committed by Rosen Penev
parent 0fd7e2c2d0
commit 963c528214
2 changed files with 112 additions and 0 deletions

33
libs/srt/Config.in 100644
View File

@ -0,0 +1,33 @@
if PACKAGE_srt
comment "Encryption support"
choice
prompt "Selected Encryption library"
default SRT_OPENSSL
config SRT_OPENSSL
bool "OpenSSL"
config SRT_MBEDTLS
bool "mbed TLS"
config SRT_GNUTLS
bool "GNUTLS"
config SRT_NOENCRYPTION
bool "No encryption support"
endchoice
comment "Options"
config SRT_MONOTONIC_CLOCK
bool "Monotonic clock"
default y
config SRT_BONDING
bool "Bonding"
default n
endif

79
libs/srt/Makefile 100644
View File

@ -0,0 +1,79 @@
#
# Copyright (C) 2024 Koen Vandeputte <koen.vandeputte@citymesh.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=srt
PKG_VERSION:=1.5.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/haivision/srt/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=befaeb16f628c46387b898df02bc6fba84868e86a6f6d8294755375b9932d777
PKG_MAINTAINER:=Koen Vandeputte <koen.vandeputte@citymesh.com>
PKG_LICENSE:=MPL-2.0
PKG_LICENSE_FILES:=LICENSE
CMAKE_INSTALL:=1
PKG_CONFIG_DEPENDS:= \
\
CONFIG_SRT_OPENSSL \
CONFIG_SRT_MBEDTLS \
CONFIG_SRT_GNUTLS \
CONFIG_SRT_NOENCRYPTION \
\
CONFIG_SRT_MONOTONIC_CLOCK \
CONFIG_SRT_BONDING
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/srt
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:= +libstdcpp +libatomic
DEPENDS += +SRT_OPENSSL:libopenssl +SRT_MBEDTLS:libmbedtls +SRT_GNUTLS:libgnutls
TITLE:=secure reliable transport
URL:=https://github.com/Haivision/srt
MENU:=1
endef
define Package/srt/description
This package provides the Secure Reliable Transport library which
is mostly used by the gstreamer srt sink plugin
endef
define Package/srt/config
source "$(SOURCE)/Config.in"
endef
TARGET_LDFLAGS += -Wl,--gc-sections
CMAKE_OPTIONS += \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DENABLE_APPS=OFF \
-DENABLE_PKTINFO=OFF \
-DENABLE_SHARED=ON \
-DENABLE_STATIC=OFF \
-DENABLE_TESTING=OFF \
-DENABLE_UNITTESTS=OFF \
-DUSE_BUSY_WAITING=OFF \
-DENABLE_BONDING=$(if $(CONFIG_SRT_BONDING),ON,OFF) \
-DENABLE_MONOTONIC_CLOCK=$(if $(CONFIG_SRT_MONOTONIC_CLOCK),ON,OFF) \
-DENABLE_ENCRYPTION=$(if $(CONFIG_SRT_OPENSSL)$(CONFIG_SRT_MBEDTLS)$(CONFIG_SRT_GNUTLS),ON,OFF) \
$(if $(CONFIG_SRT_OPENSSL),-DUSE_ENCLIB=openssl-evp) \
$(if $(CONFIG_SRT_MBEDTLS),-DUSE_ENCLIB=mbedtls) \
$(if $(CONFIG_SRT_GNUTLS),-DUSE_ENCLIB=gnutls)
define Package/srt/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsrt.so.* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,srt))