srt 1.5.0
authorEunhye Choi <eunhae1.choi@samsung.com>
Wed, 3 Aug 2022 05:57:35 +0000 (14:57 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Thu, 4 Aug 2022 09:43:56 +0000 (18:43 +0900)
- srt v1.5.0 code upload

Change-Id: I26f9c714d701d39b42ad403faca72aac3df5fe14

.clang-format [new file with mode: 0644]
.gitignore [new file with mode: 0644]
CMakeLists.txt
packaging/baselibs.conf [new file with mode: 0644]
packaging/srt.manifest [new file with mode: 0644]
packaging/srt.spec [new file with mode: 0644]

diff --git a/.clang-format b/.clang-format
new file mode 100644 (file)
index 0000000..387de5c
--- /dev/null
@@ -0,0 +1,90 @@
+Language:      Cpp
+BasedOnStyle:  LLVM
+AccessModifierOffset: -4
+# AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: true
+AlignConsecutiveDeclarations: true
+# AlignEscapedNewlinesLeft: false
+AlignOperands:   true
+AlignTrailingComments: true
+# AllowAllArgumentsOnNextLine: true    # Requires clang-format v9 and higher
+# AllowAllConstructorInitializersOnNextLine: false
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+# AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: Inline
+# AllowShortIfStatementsOnASingleLine: false
+# AllowShortLoopsOnASingleLine: false
+# AlwaysBreakAfterDefinitionReturnType: None
+# AlwaysBreakAfterReturnType: None
+# AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: true
+BinPackArguments: false
+BinPackParameters: false
+# BraceWrapping:   
+#   AfterClass:      false
+#   AfterControlStatement: false
+#   AfterEnum:       false
+#   AfterFunction:   false
+#   AfterNamespace:  false
+#   AfterObjCDeclaration: false
+#   AfterStruct:     false
+#   AfterUnion:      false
+#   BeforeCatch:     false
+#   BeforeElse:      false
+#   IndentBraces:    false
+# BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Allman
+# BreakInheritanceList: BeforeComma
+# BreakBeforeTernaryOperators: true
+BreakConstructorInitializers: BeforeComma
+# BreakAfterJavaFieldAnnotations: false
+# BreakStringLiterals: true
+ColumnLimit:     120
+# CommentPragmas:  '^ IWYU pragma:'
+# ConstructorInitializerAllOnOneLineOrOnePerLine: false
+# ConstructorInitializerIndentWidth: 4
+# ContinuationIndentWidth: 4
+# Cpp11BracedListStyle: true
+# DerivePointerAlignment: false
+# DisableFormat:   false
+# ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: true
+# ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
+# IncludeIsMainRegex: '$'
+# IndentCaseLabels: false
+IndentWidth:     4
+# IndentWrappedFunctionNames: false
+# JavaScriptQuotes: Leave
+# JavaScriptWrapImports: true
+# KeepEmptyLinesAtTheStartOfBlocks: true
+# MacroBlockBegin: ''
+# MacroBlockEnd:   ''
+# MaxEmptyLinesToKeep: 1
+# NamespaceIndentation: None
+# ObjCBlockIndentWidth: 2
+# ObjCSpaceAfterProperty: false
+# ObjCSpaceBeforeProtocolList: true
+# PenaltyBreakBeforeFirstCallParameter: 19
+# PenaltyBreakComment: 300
+# PenaltyBreakFirstLessLess: 120
+# PenaltyBreakString: 1000
+# PenaltyExcessCharacter: 1000000
+# PenaltyReturnTypeOnItsOwnLine: 60
+PointerAlignment: Left
+# ReflowComments:  true
+SortIncludes:    false
+# SpaceAfterCStyleCast: false
+# SpaceAfterTemplateKeyword: true
+# SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+# SpaceInEmptyParentheses: false
+# SpacesBeforeTrailingComments: 1
+# SpacesInAngles:  false
+# SpacesInContainerLiterals: true
+# SpacesInCStyleCastParentheses: false
+# SpacesInParentheses: false
+# SpacesInSquareBrackets: false
+Standard: Cpp03
+TabWidth:        4
+UseTab:          Never
diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..699d0e1
--- /dev/null
@@ -0,0 +1,45 @@
+# Prerequisites
+*.d
+
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+*.smod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+# Ignore any folder starting from underscore
+_*/
+
+# Ignode Visual Studio Code temp folder
+.vs/
+.vscode/
+
+# Ignore vcpkg submodule
+vcpkg/
+
+# LSP
+compile_commands.json
index 9931589..a4af656 100644 (file)
@@ -128,7 +128,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "^GNU$" AND CMAKE_CXX_COMPILER_VERSION VERSION
 else()
        option(ENABLE_CXX11 "Should the c++11 parts (srt-live-transmit) be enabled" ON)
 endif()
-option(ENABLE_APPS "Should the Support Applications be Built?" ON)
+option(ENABLE_APPS "Should the Support Applications be Built?" OFF)
 option(ENABLE_BONDING "Should the bonding functionality be enabled?" OFF)
 option(ENABLE_TESTING "Should the Developer Test Applications be Built?" OFF)
 option(ENABLE_PROFILE "Should instrument the code for profiling. Ignored for non-GNU compiler." $ENV{HAI_BUILD_PROFILE})
@@ -222,7 +222,7 @@ if (NOT DEFINED WITH_COMPILER_TYPE)
        # This is for a case when you provided the prefix, but you didn't
        # provide compiler type. This option is in this form predicted to work
        # only on POSIX systems. Just typical compilers for Linux and Mac are
-       # included. 
+       # included.
        if (DARWIN)
                set (WITH_COMPILER_TYPE clang)
        elseif (POSIX) # Posix, but not DARWIN
@@ -341,7 +341,7 @@ if (ENABLE_ENCRYPTION)
                endforeach()
        else() # openssl
                add_definitions(-DUSE_OPENSSL=1)
-               set (SSL_REQUIRED_MODULES "openssl libcrypto")
+               set (SSL_REQUIRED_MODULES "openssl1.1 libcrypto1.1")
                # Try using pkg-config method first if enabled,
                # fall back to find_package method otherwise
                if (USE_OPENSSL_PC)
@@ -407,7 +407,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Intel|Clang|AppleClang")
        elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang|AppleClang")
                message(STATUS "NOTE: CLANG ${CMAKE_CXX_COMPILER_VERSION} detected, unsure if >=C++11 is default, forcing C++11 on applications")
                set (FORCE_CXX_STANDARD 1)
-       else() 
+       else()
                message(STATUS "NOTE: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} - assuming default C++11.")
        endif()
 else()
@@ -1078,8 +1078,8 @@ endif()
 join_arguments(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE})
 
 # haisrt.pc left temporarily for backward compatibility. To be removed in future!
-configure_file(scripts/srt.pc.in haisrt.pc @ONLY)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/haisrt.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+configure_file(scripts/srt.pc.in haisrt.pc @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/haisrt.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
 configure_file(scripts/srt.pc.in srt.pc @ONLY)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/srt.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
 
@@ -1339,9 +1339,6 @@ if (ENABLE_UNITTESTS AND ENABLE_CXX11)
 endif()
 
 
-install(PROGRAMS scripts/srt-ffplay DESTINATION ${CMAKE_INSTALL_BINDIR})
-
-
 if (DEFINED SRT_EXTRA_APPS_INC)
        include(${SRT_EXTRA_APPS_INC}.cmake)
        # No extra variables expected. Just use the variables
diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf
new file mode 100644 (file)
index 0000000..81f4e44
--- /dev/null
@@ -0,0 +1,5 @@
+srt
+  obsoletes "srt-<targettype>"
+srt-devel
+ requires -srt-<targettype>
+ requires "srt-<targettype> = <version>"
diff --git a/packaging/srt.manifest b/packaging/srt.manifest
new file mode 100644 (file)
index 0000000..017d22d
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
diff --git a/packaging/srt.spec b/packaging/srt.spec
new file mode 100644 (file)
index 0000000..d5f5bbb
--- /dev/null
@@ -0,0 +1,68 @@
+Name:           srt
+Version:        1.5.0
+Release:        0
+License:        MPL-2.0
+Summary:        SRT (Secure Reliable Transport) library
+Url:            https://github.com/Haivision/srt
+Group:          Multimedia/Libraries
+Source0:        %{name}-%{version}.tar.bz2
+Source99:       baselibs.conf
+Source1001:     srt.manifest
+BuildRequires:  cmake
+BuildRequires:  pkgconfig(openssl1.1)
+BuildRequires:  pkgconfig(tcl)
+BuildRequires:  pkgconfig(dlog)
+
+%description
+SRT allows users to deliver high-quality,
+low-latency video streams across the public internet.
+
+%package devel
+Summary:    SRT (Secure Reliable Transport) library
+Group:      Multimedia/Libraries
+Requires:       %{name} = %{version}
+
+%description devel
+SRT allows users to deliver high-quality,
+low-latency video streams across the public internet.
+
+%prep
+%setup -q -n %{name}-%{version}
+
+cp %{SOURCE1001} .
+
+export CFLAGS+=" -Wall -g -fPIC"
+export LDFLAGS+=" -pthread "
+
+chmod +x ./configure
+%configure \
+  --disable-static \
+  --prefix=/usr/ \
+  --with-pic
+
+%build
+export CFLAGS="$CFLAGS -DCMAKE_BUILD_TYPE=Debug"
+make
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+%clean
+rm -rf %{buildroot}
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%manifest %{name}.manifest
+%license LICENSE
+%defattr(-,root,root,-)
+%{_libdir}/*.so.*
+
+%files devel
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{_libdir}/*.so
+%{_includedir}/srt/*.h
+%{_libdir}/pkgconfig/*.pc