diff options
author | Bananahemic <bananahemic@users.noreply.github.com> | 2018-11-21 12:28:02 -0800 |
---|---|---|
committer | Bananahemic <bananahemic@users.noreply.github.com> | 2018-11-21 12:28:02 -0800 |
commit | d2bc6ceb3e6faa6c7c0dd05c0af8087b27c450cb (patch) | |
tree | c4262a60e0b43fe9c770095f9d6c008cfa430a2e | |
parent | b7933b0f65bc208a27001526f401a5fc6f3a77bd (diff) |
Backported SRT 1.3.0
19 files changed, 668 insertions, 464 deletions
diff --git a/packages/gstreamer-1.0-net.package b/packages/gstreamer-1.0-net.package index 11537b64..bd51bd79 100644 --- a/packages/gstreamer-1.0-net.package +++ b/packages/gstreamer-1.0-net.package @@ -11,7 +11,7 @@ class Package(custom.GStreamer, package.Package): deps = ['gstreamer-1.0-core', 'base-crypto'] files = ['libsoup:libs', 'libsrtp:libs', 'libnice:libs', 'libnice:plugins_net', - 'openssl:libs', + 'openssl:libs', 'srt:libs', 'gst-plugins-base-1.0:plugins_net', 'gst-plugins-good-1.0:plugins_net', 'gst-plugins-ugly-1.0:plugins_net', 'gst-plugins-bad-1.0:plugins_net', 'gst-rtsp-server-1.0:libs:typelibs:plugins_net'] diff --git a/recipes/gst-plugins-bad-1.0.recipe b/recipes/gst-plugins-bad-1.0.recipe index 69554081..9b628b6e 100644 --- a/recipes/gst-plugins-bad-1.0.recipe +++ b/recipes/gst-plugins-bad-1.0.recipe @@ -17,20 +17,20 @@ class Recipe(custom.GStreamer): --disable-pvr --disable-sdl --disable-sndfile \ --disable-teletextdec --disable-timidity \ --disable-vdpau --disable-voamrwbenc --disable-wildmidi \ - --disable-xvid --disable-zbar --disable-sdi --disable-srt' + --disable-xvid --disable-zbar --disable-sdi' # Explicitly enable plugins configure_options += ' --enable-bz2 --enable-assrender \ --enable-faad --enable-kate --enable-openh264 --enable-opus \ --enable-hls --enable-rtmp --enable-srtp --enable-dts \ --enable-libmms --enable-resindvd --enable-soundtouch \ --enable-voaacenc --enable-rsvg --enable-openjpeg --enable-spandsp \ - --enable-decklink --enable-webrtc --enable-dtls' + --enable-decklink --enable-webrtc --enable-dtls --enable-srt' remotes = {'origin': 'https://anongit.freedesktop.org/git/gstreamer/gst-plugins-bad'} deps = ['gstreamer-1.0', 'gst-plugins-base-1.0', 'bzip2', 'libass', 'faad2', 'libkate', 'zlib', 'openh264', 'opus', 'nettle', 'librtmp', 'libsrtp', 'libdca', 'libmms', 'libdvdnav', 'libnice', 'soundtouch', 'vo-aacenc', 'librsvg', 'openjpeg', 'openssl', - 'spandsp', 'webrtc-audio-processing', 'sbc', 'ladspa'] + 'spandsp', 'webrtc-audio-processing', 'sbc', 'ladspa', 'srt'] use_system_libs = True files_lang = ['gst-plugins-bad-1.0'] @@ -237,6 +237,7 @@ class Recipe(custom.GStreamer): 'lib/gstreamer-1.0/libgstsdpelem%(mext)s', 'lib/gstreamer-1.0/libgstsrtp%(mext)s', 'lib/gstreamer-1.0/libgstwebrtc%(mext)s', + 'lib/gstreamer-1.0/libgstsrt%(mext)s', ] files_plugins_net_devel = [ @@ -244,6 +245,7 @@ class Recipe(custom.GStreamer): 'lib/gstreamer-1.0/libgstsdpelem.a', 'lib/gstreamer-1.0/libgstsdpelem.la', 'lib/gstreamer-1.0/libgstsrtp.a', 'lib/gstreamer-1.0/libgstsrtp.la', 'lib/gstreamer-1.0/libgstwebrtc.a', 'lib/gstreamer-1.0/libgstwebrtc.la', + 'lib/gstreamer-1.0/libgstsrt.a', 'lib/gstreamer-1.0/libgstsrt.la', ] files_plugins_net_restricted = [ diff --git a/recipes/srt.recipe b/recipes/srt.recipe index b6d02b6b..7816fe40 100644 --- a/recipes/srt.recipe +++ b/recipes/srt.recipe @@ -5,36 +5,31 @@ from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'srt' - version = '1.2.2' + version = '1.3.0' url = 'https://github.com/Haivision/srt/archive/v%(version)s.tar.gz' - licenses = [License.LGPLv2_1] + tarball_checksum = '645c13a9a5c5b59315f82245737289e071a5441ee40de6e2e45af61e305e1f2c' + licenses = [License.MPLv2] stype = SourceType.TARBALL btype = BuildType.CMAKE configure_options = '-DUSE_GNUTLS=ON -DENABLE_CXX11=OFF' deps = ['gnutls'] - patches = ['srt/0001-channel.cpp-add-mswsock.h-for-Win32.patch', - 'srt/0002-common-srt_compat.h-add-time.h-to-suppress-compilati.patch', - 'srt/0003-srtcore-api.h-change-inet_ntop-to-getnameinfo.patch', - 'srt/0004-build-support-cross-compiling-by-mingw.patch', - 'srt/0006-Clean-.pc-to-provide-the-dependecies.patch', - 'srt/0007-srt_compat.h-Enable-localtime_s-only-if-MSC_VER-1500.patch', - 'srt/0008-build-Fix-for-MinGW-support.patch', - 'srt/0009-Fix-include-path-for-wintime.h.patch', - 'srt/0010-Include-syslog.h-on-Android.patch', - 'srt/0011-Fix-includes-for-iOS.patch'] files_libs = ['libsrt'] files_devel = ['include/srt', 'lib/pkgconfig/srt.pc'] + patches = ['srt/0001-Build-Fix-MingW-build.patch', + 'srt/0002-srt-Fix-MingW-build.patch', + 'srt/0003-platform_sys-Only-include-inttypes.h-with-MSFT-compi.patch', + 'srt/0004-MingW-needs-the-explicit-exports-too.patch', + 'srt/0005-Windows-Only-define-SRT_API-in-one-place.patch', + 'srt/0001-Allow-building-using-gnustl.patch'] def prepare(self): - if self.config.target_platform in [Platform.ANDROID, Platform.IOS]: - self.configure_options += ' -DENABLE_SHARED=OFF ' if self.config.target_platform == Platform.ANDROID: - self.append_env['CXXFLAGS'] = " -frtti -fexceptions `pkg-config --cflags gnustl`" + self.append_env['CXXFLAGS'] = " -frtti -fexceptions" self.deps += ['gnustl'] - self.configure_options += " -DPTHREAD_INCLUDE_DIR=/ignoreme -DPTHREAD_LIBRARY=pthread " + self.configure_options += ' -DUSE_GNUSTL=ON' def post_install(self): - libtool_la = LibtoolLibrary('srt', 1, 2, 2, self.config.libdir, + libtool_la = LibtoolLibrary('srt', 1, 3, 0, self.config.libdir, self.config.target_platform) libtool_la.save() diff --git a/recipes/srt/0001-Allow-building-using-gnustl.patch b/recipes/srt/0001-Allow-building-using-gnustl.patch new file mode 100644 index 00000000..70d83d8f --- /dev/null +++ b/recipes/srt/0001-Allow-building-using-gnustl.patch @@ -0,0 +1,72 @@ +From cd531977c4d20950c22410ebcf1338dd5d0f19e6 Mon Sep 17 00:00:00 2001 +From: Matthew Waters <matthew@centricular.com> +Date: Sun, 28 Oct 2018 02:10:42 +1100 +Subject: [PATCH] Allow building using gnustl + +--- + CMakeLists.txt | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6014376..478a763 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -86,6 +86,7 @@ option(ENABLE_GETNAMEINFO "In-logs sockaddr-to-string should do rev-dns" OFF) + option(USE_GNUTLS "Should use gnutls instead of openssl" OFF) + option(ENABLE_C_DEPS "Extra library dependencies in srt.pc for C language" OFF) + option(USE_STATIC_LIBSTDCXX "Should use static rather than shared libstdc++" OFF) ++option(USE_GNUSTL "Get c++ library/headers from the gnustl.pc" OFF) + + set(TARGET_srt "srt" CACHE STRING "The name for the haisrt library") + +@@ -203,6 +204,12 @@ endif() + + message (STATUS "SSL libraries: ${SSL_LIBRARIES}") + ++if ( USE_GNUSTL ) ++ pkg_check_modules (GNUSTL REQUIRED gnustl) ++ link_directories(${GNUSTL_LIBRARY_DIRS}) ++ include_directories(${GNUSTL_INCLUDE_DIRS}) ++endif() ++ + # Detect if the compiler is GNU compatable for flags + set(HAVE_COMPILER_GNU_COMPAT 0) + foreach (gnid GNU Intel Clang AppleClang) +@@ -440,7 +447,7 @@ if (srt_libspec_shared) + set_property(TARGET ${TARGET_srt}_shared PROPERTY OUTPUT_NAME ${TARGET_srt}) + set_target_properties (${TARGET_srt}_shared PROPERTIES VERSION ${SRT_VERSION} SOVERSION ${SRT_VERSION_MAJOR}) + list (APPEND INSTALL_TARGETS ${TARGET_srt}_shared) +- target_link_libraries(${TARGET_srt}_shared PRIVATE ${SSL_LIBRARIES}) ++ target_link_libraries(${TARGET_srt}_shared PRIVATE ${SSL_LIBRARIES} ${GNUSTL_LIBRARIES} ${GNUSTL_LDFLAGS}) + if (MICROSOFT) + target_link_libraries(${TARGET_srt}_shared PRIVATE ws2_32.lib) + elseif (MINGW) +@@ -466,7 +473,7 @@ if (srt_libspec_static) + endif() + + list (APPEND INSTALL_TARGETS ${TARGET_srt}_static) +- target_link_libraries(${TARGET_srt}_static PRIVATE ${SSL_LIBRARIES}) ++ target_link_libraries(${TARGET_srt}_static PRIVATE ${SSL_LIBRARIES} ${GNUSTL_LIBRARIES} ${GNUSTL_LDFLAGS}) + if (MICROSOFT) + target_link_libraries(${TARGET_srt}_static PRIVATE ws2_32.lib) + elseif (MINGW) +@@ -488,7 +495,7 @@ endif() + + target_include_directories(haicrypt_virtual PRIVATE ${SSL_INCLUDE_DIRS}) + +-set (SRT_LIBS_PRIVATE ${SSL_LIBRARIES}) ++set (SRT_LIBS_PRIVATE ${SSL_LIBRARIES} ${GNUSTL_LIBRARIES} ${GNUSTL_LDFLAGS}) + + if (MICROSOFT) + set (SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ws2_32.lib) +@@ -647,6 +654,7 @@ macro(srt_make_application name) + set_target_properties(${name} PROPERTIES COMPILE_FLAGS "${CFLAGS_CXX_STANDARD} ${EXTRA_stransmit}" ${FORCE_RPATH}) + + target_link_libraries(${name} ${srt_link_library}) ++ target_link_libraries(${name} PRIVATE ${GNUSTL_LIBRARIES} ${GNUSTL_LDFLAGS}) + endmacro() + + macro(srt_add_application name sources) +-- +2.19.0 + diff --git a/recipes/srt/0001-Build-Fix-MingW-build.patch b/recipes/srt/0001-Build-Fix-MingW-build.patch new file mode 100644 index 00000000..86fa5af1 --- /dev/null +++ b/recipes/srt/0001-Build-Fix-MingW-build.patch @@ -0,0 +1,312 @@ +From 22b752bd1f16dc0dcc146109561fada732dc4496 Mon Sep 17 00:00:00 2001 +From: Jose Santiago <jsantiago@haivision.com> +Date: Tue, 10 Apr 2018 14:15:31 -0500 +Subject: [PATCH 1/5] Build: Fix MingW build + +Patch taken from upstraem +--- + CMakeLists.txt | 6 +++-- + common/filelist_win32.maf | 1 - + common/win/wintime.h | 36 +++++++++++++++++----------- + common/win_time.cpp | 49 +++------------------------------------ + srtcore/api.cpp | 4 ++++ + srtcore/channel.cpp | 2 +- + srtcore/core.cpp | 8 +++---- + srtcore/platform_sys.h | 1 - + srtcore/srt_compat.h | 24 ++++++++++++++++++- + 9 files changed, 62 insertions(+), 69 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e913122..3b5cfde 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -455,8 +455,8 @@ if (srt_libspec_static) + # - 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 - they are named there libsrt.a and libsrt.dll.a +- if (WIN32 AND NOT CYGWIN) ++ # 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() +@@ -520,9 +520,11 @@ if (ENABLE_SHARED) + target_compile_definitions(haicrypt_virtual PRIVATE -DHAICRYPT_EXPORTS) + endif() + ++if (srt_libspec_shared) + if (MICROSOFT) + target_link_libraries(${TARGET_srt}_shared PUBLIC Ws2_32.lib) + endif() ++endif() + + # Cygwin installs the *.dll libraries in bin directory and uses PATH. + +diff --git a/common/filelist_win32.maf b/common/filelist_win32.maf +index 190801c..e6864de 100644 +--- a/common/filelist_win32.maf ++++ b/common/filelist_win32.maf +@@ -1,6 +1,5 @@ + + PUBLIC HEADERS +-win/wintime.h + win/syslog_defs.h + # + # These are included by platform_sys.h header contained in ../srtcore/filelist.maf +diff --git a/common/win/wintime.h b/common/win/wintime.h +index cf8d347..d763eaa 100644 +--- a/common/win/wintime.h ++++ b/common/win/wintime.h +@@ -9,18 +9,13 @@ + extern "C" { + #endif + +-#ifndef CLOCK_REALTIME +-#define CLOCK_REALTIME 1 +-#endif +- +-int clock_gettime(int X, struct timespec *ts); +- +-#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) +- #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 ++#if !defined(_MSC_VER) ++ #define SRTCOMPAT_WINTIME_STATIC_INLINE_DECL static inline + #else +- #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL ++ // NOTE: MVC Does not like static inline for C functions in some versions. ++ // so just use static for MVC. ++ #define SRTCOMPAT_WINTIME_STATIC_INLINE_DECL static + #endif +- + + #ifndef _TIMEZONE_DEFINED /* also in sys/time.h */ + #define _TIMEZONE_DEFINED +@@ -31,11 +26,26 @@ struct timezone + }; + #endif + +-void timeradd(struct timeval *a, struct timeval *b, struct timeval *result); +-int gettimeofday(struct timeval* tp, struct timezone* tz); ++void SRTCompat_timeradd( ++ struct timeval *a, struct timeval *b, struct timeval *result); ++SRTCOMPAT_WINTIME_STATIC_INLINE_DECL void timeradd( ++ struct timeval *a, struct timeval *b, struct timeval *result) ++{ ++ SRTCompat_timeradd(a, b, result); ++} ++ ++int SRTCompat_gettimeofday( ++ struct timeval* tp, struct timezone* tz); ++SRTCOMPAT_WINTIME_STATIC_INLINE_DECL int gettimeofday( ++ struct timeval* tp, struct timezone* tz) ++{ ++ return SRTCompat_gettimeofday(tp, tz); ++} ++ ++#undef SRTCOMPAT_WINTIME_STATIC_INLINE_DECL + + #ifdef __cplusplus + } + #endif + +-#endif ++#endif // INC__WIN_WINTIME +diff --git a/common/win_time.cpp b/common/win_time.cpp +index ae0eaa4..83ea7b0 100644 +--- a/common/win_time.cpp ++++ b/common/win_time.cpp +@@ -13,52 +13,10 @@ written by + Haivision Systems Inc. + *****************************************************************************/ + +-#include <win/wintime.h> ++#include "win/wintime.h" + #include <sys/timeb.h> + +-#if 0 +-// Temporarily blocked. Needs to be fixed. +-// Currently unused, but may be useful in future. +-int clock_gettime(int X, struct timespec *ts) +-{ +- LARGE_INTEGER t; +- FILETIME f; +- double microseconds; +- static LARGE_INTEGER offset; +- static double frequencyToMicroseconds; +- static int initialized = 0; +- static BOOL usePerformanceCounter = 0; +- +- if (!initialized) { +- LARGE_INTEGER performanceFrequency; +- initialized = 1; +- usePerformanceCounter = QueryPerformanceFrequency(&performanceFrequency); +- if (usePerformanceCounter) { +- QueryPerformanceCounter(&offset); +- frequencyToMicroseconds = (double)performanceFrequency.QuadPart / 1000000.; +- } else { +- offset = getFILETIMEoffset(); +- frequencyToMicroseconds = 10.; +- } +- } +- if (usePerformanceCounter) QueryPerformanceCounter(&t); +- else { +- GetSystemTimeAsFileTime(&f); +- t.QuadPart = f.dwHighDateTime; +- t.QuadPart <<= 32; +- t.QuadPart |= f.dwLowDateTime; +- } +- +- t.QuadPart -= offset.QuadPart; +- microseconds = (double)t.QuadPart / frequencyToMicroseconds; +- t.QuadPart = microseconds; +- tv->tv_sec = t.QuadPart / 1000000; +- tv->tv_usec = t.QuadPart % 1000000; +- return (0); +-} +-#endif +- +-void timeradd(struct timeval *a, struct timeval *b, struct timeval *result) ++void SRTCompat_timeradd(struct timeval *a, struct timeval *b, struct timeval *result) + { + result->tv_sec = a->tv_sec + b->tv_sec; + result->tv_usec = a->tv_usec + b->tv_usec; +@@ -69,7 +27,7 @@ void timeradd(struct timeval *a, struct timeval *b, struct timeval *result) + } + } + +-int gettimeofday(struct timeval* tp, struct timezone* tz) ++int SRTCompat_gettimeofday(struct timeval* tp, struct timezone* tz) + { + static LARGE_INTEGER tickFrequency, epochOffset; + +@@ -105,4 +63,3 @@ int gettimeofday(struct timeval* tp, struct timezone* tz) + } + return 0; + } +- +diff --git a/srtcore/api.cpp b/srtcore/api.cpp +index 61f8359..2d4dcdc 100644 +--- a/srtcore/api.cpp ++++ b/srtcore/api.cpp +@@ -63,6 +63,10 @@ modified by + #include "threadname.h" + #include "srt.h" + ++#ifdef WIN32 ++ #include <win/wintime.h> ++#endif ++ + using namespace std; + + extern logging::LogConfig srt_logger_config; +diff --git a/srtcore/channel.cpp b/srtcore/channel.cpp +index ae47523..ab61d1e 100644 +--- a/srtcore/channel.cpp ++++ b/srtcore/channel.cpp +@@ -493,6 +493,7 @@ EReadStatus CChannel::recvfrom(sockaddr* addr, CPacket& packet) const + DWORD flag = 0; + int addrsize = m_iSockAddrSize; + ++ int msg_flags = 0; + int sockerror = ::WSARecvFrom(m_iSocket, (LPWSABUF)packet.m_PacketVector, 2, &size, &flag, addr, &addrsize, NULL, NULL); + int res; + if (sockerror == 0) +@@ -533,7 +534,6 @@ EReadStatus CChannel::recvfrom(sockaddr* addr, CPacket& packet) const + } + + // Not sure if this problem has ever occurred on Windows, just a sanity check. +- int msg_flags = 0; + if (flag & MSG_PARTIAL) + msg_flags = 1; + #endif +diff --git a/srtcore/core.cpp b/srtcore/core.cpp +index ee86495..07166c3 100644 +--- a/srtcore/core.cpp ++++ b/srtcore/core.cpp +@@ -1911,11 +1911,11 @@ int CUDT::processSrtMsg_HSREQ(const uint32_t* srtdata, size_t len, uint32_t ts, + if (len < SRT_CMD_HSREQ_MINSZ) + { + /* Packet smaller than minimum compatible packet size */ +- LOGF(mglog.Error, "HSREQ/rcv: cmd=%d(HSREQ) len=%zu invalid", SRT_CMD_HSREQ, len); ++ LOGF(mglog.Error, "HSREQ/rcv: cmd=%d(HSREQ) len=%" PRIzu " invalid", SRT_CMD_HSREQ, len); + return SRT_CMD_NONE; + } + +- LOGF(mglog.Note, "HSREQ/rcv: cmd=%d(HSREQ) len=%zu vers=0x%x opts=0x%x delay=%d", ++ LOGF(mglog.Note, "HSREQ/rcv: cmd=%d(HSREQ) len=%" PRIzu " vers=0x%x opts=0x%x delay=%d", + SRT_CMD_HSREQ, len, srtdata[SRT_HS_VERSION], srtdata[SRT_HS_FLAGS], + SRT_HS_LATENCY_RCV::unwrap(srtdata[SRT_HS_LATENCY])); + +@@ -2089,7 +2089,7 @@ int CUDT::processSrtMsg_HSRSP(const uint32_t* srtdata, size_t len, uint32_t ts, + if (len < SRT_CMD_HSRSP_MINSZ) + { + /* Packet smaller than minimum compatible packet size */ +- LOGF(mglog.Error, "HSRSP/rcv: cmd=%d(HSRSP) len=%zu invalid", SRT_CMD_HSRSP, len); ++ LOGF(mglog.Error, "HSRSP/rcv: cmd=%d(HSRSP) len=%" PRIzu " invalid", SRT_CMD_HSRSP, len); + return SRT_CMD_NONE; + } + +@@ -7410,7 +7410,7 @@ int CUDT::processData(CUnit* unit) + } + else + { +- HLOGF(mglog.Debug, "STILL %zu FRESH LOSS RECORDS, FIRST: %d-%d (%d) TTL: %d", m_FreshLoss.size(), ++ HLOGF(mglog.Debug, "STILL %" PRIzu " FRESH LOSS RECORDS, FIRST: %d-%d (%d) TTL: %d", m_FreshLoss.size(), + i->seq[0], i->seq[1], 1+CSeqNo::seqcmp(i->seq[1], i->seq[0]), + i->ttl); + } +diff --git a/srtcore/platform_sys.h b/srtcore/platform_sys.h +index e962227..33c4d9b 100644 +--- a/srtcore/platform_sys.h ++++ b/srtcore/platform_sys.h +@@ -17,7 +17,6 @@ + #include <windows.h> + #include <inttypes.h> + #include <stdint.h> +- #include "win/wintime.h" + #if defined(_MSC_VER) + #pragma warning(disable:4251) + #endif +diff --git a/srtcore/srt_compat.h b/srtcore/srt_compat.h +index a0ce20a..702324e 100644 +--- a/srtcore/srt_compat.h ++++ b/srtcore/srt_compat.h +@@ -38,11 +38,33 @@ written by + #define SRT_API __attribute__ ((visibility("default"))) + #endif + ++#ifdef WIN32 ++ // https://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx ++ // printf() Format for ssize_t ++ #if !defined(PRIzd) ++ #define PRIzd "Id" ++ #endif ++ // printf() Format for size_t ++ #if !defined(PRIzu) ++ #define PRIzu "Iu" ++ #endif ++#else ++ // http://www.gnu.org/software/libc/manual/html_node/Integer-Conversions.html ++ // printf() Format for ssize_t ++ #if !defined(PRIzd) ++ #define PRIzd "zd" ++ #endif ++ // printf() Format for size_t ++ #if !defined(PRIzu) ++ #define PRIzu "zu" ++ #endif ++#endif ++ ++ + #ifdef __cplusplus + extern "C" { + #endif + +- + /* Ensures that we store the error in the buffer and return the bufer. */ + SRT_API const char * SysStrError(int errnum, char * buf, size_t buflen); + +-- +2.17.0 + diff --git a/recipes/srt/0001-channel.cpp-add-mswsock.h-for-Win32.patch b/recipes/srt/0001-channel.cpp-add-mswsock.h-for-Win32.patch deleted file mode 100644 index 48938950..00000000 --- a/recipes/srt/0001-channel.cpp-add-mswsock.h-for-Win32.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a3f76dccdef8b2968a1c9d6961585ae9162e9eb3 Mon Sep 17 00:00:00 2001 -From: Justin Kim <justin.kim@collabora.com> -Date: Thu, 23 Nov 2017 20:03:57 +0900 -Subject: [PATCH 1/9] channel.cpp: add mswsock.h for Win32 - -For cross-compiling, 'mswsock.h' is required to use -MSG_TRUNC flag. - -Signed-off-by: Justin Kim <justin.kim@collabora.com> ---- - srtcore/channel.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/srtcore/channel.cpp b/srtcore/channel.cpp -index a15179b..07b0b96 100644 ---- a/srtcore/channel.cpp -+++ b/srtcore/channel.cpp -@@ -75,6 +75,7 @@ modified by - #else - #include <winsock2.h> - #include <ws2tcpip.h> -+ #include <mswsock.h> - #endif - - #include <iostream> --- -2.15.1 - diff --git a/recipes/srt/0002-common-srt_compat.h-add-time.h-to-suppress-compilati.patch b/recipes/srt/0002-common-srt_compat.h-add-time.h-to-suppress-compilati.patch deleted file mode 100644 index 1fa34551..00000000 --- a/recipes/srt/0002-common-srt_compat.h-add-time.h-to-suppress-compilati.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 19d8194d2eb1d26b70451482937e12920fd0d25f Mon Sep 17 00:00:00 2001 -From: Justin Kim <justin.kim@collabora.com> -Date: Tue, 28 Nov 2017 21:02:18 +0900 -Subject: [PATCH 2/9] common/srt_compat.h: add time.h to suppress compilation - warnings - -`time.h` provides `localtime_s()`. - -Signed-off-by: Justin Kim <justin.kim@collabora.com> ---- - common/srt_compat.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/common/srt_compat.h b/common/srt_compat.h -index 15128f2..d73e193 100644 ---- a/common/srt_compat.h -+++ b/common/srt_compat.h -@@ -26,6 +26,7 @@ written by - #define HAISRT_COMPAT_H__ - - #include <stddef.h> -+#include <time.h> - - #ifdef __cplusplus - extern "C" { --- -2.15.1 - diff --git a/recipes/srt/0002-srt-Fix-MingW-build.patch b/recipes/srt/0002-srt-Fix-MingW-build.patch new file mode 100644 index 00000000..81d45839 --- /dev/null +++ b/recipes/srt/0002-srt-Fix-MingW-build.patch @@ -0,0 +1,117 @@ +From 765ceaa719afa93cad006ad7f569658ffbce12b2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> +Date: Mon, 30 Apr 2018 11:45:25 -0400 +Subject: [PATCH 2/5] srt: Fix MingW build + +--- + CMakeLists.txt | 6 +++++- + srtcore/api.h | 6 +++++- + srtcore/srt.h | 8 ++++++++ + srtcore/srt_compat.h | 4 +++- + 4 files changed, 21 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3b5cfde..6014376 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -320,7 +320,7 @@ if (${ENABLE_PROFILE} AND HAVE_COMPILER_GNU_COMPAT) + endif() + + if (MINGW) +- set (PTHREAD_LIBRARY -lpthreadGC2) ++ #set (PTHREAD_LIBRARY -lpthreadGC2) + # XXX CONSIDER THIS. It came from a merged previous master version + # and was under an if(NOT MINGW)...elseif(THREADS_FOUND) condition. + # Might be that the current form still suffices; resolve this and remove comment. +@@ -443,6 +443,8 @@ if (srt_libspec_shared) + target_link_libraries(${TARGET_srt}_shared PRIVATE ${SSL_LIBRARIES}) + if (MICROSOFT) + target_link_libraries(${TARGET_srt}_shared PRIVATE ws2_32.lib) ++ elseif (MINGW) ++ target_link_libraries(${TARGET_srt}_shared PRIVATE wsock32.lib ws2_32.lib) + endif() + endif() + +@@ -467,6 +469,8 @@ if (srt_libspec_static) + target_link_libraries(${TARGET_srt}_static PRIVATE ${SSL_LIBRARIES}) + if (MICROSOFT) + target_link_libraries(${TARGET_srt}_static PRIVATE ws2_32.lib) ++ elseif (MINGW) ++ target_link_libraries(${TARGET_srt}_static PRIVATE wsock32.lib ws2_32.lib) + endif() + endif() + +diff --git a/srtcore/api.h b/srtcore/api.h +index 61a1465..820ac4d 100644 +--- a/srtcore/api.h ++++ b/srtcore/api.h +@@ -271,13 +271,16 @@ inline std::string SockaddrToString(const sockaddr* sadr) + std::ostringstream output; + char hostbuf[1024]; + +-#if ENABLE_GETNAMEINFO ++#if ENABLE_GETNAMEINFO || defined(WIN32) + if (!getnameinfo(sadr, sizeof(*sadr), hostbuf, 1024, NULL, 0, NI_NAMEREQD)) + { + output << hostbuf; + } ++#ifndef WIN32 + else + #endif ++#endif ++#ifndef WIN32 + { + if (inet_ntop(sadr->sa_family, addr, hostbuf, 1024) == NULL) + { +@@ -285,6 +288,7 @@ inline std::string SockaddrToString(const sockaddr* sadr) + } + output << hostbuf; + } ++#endif + + output << ":" << ntohs(((sockaddr_in*)sadr)->sin_port); // TRICK: sin_port and sin6_port have the same offset and size + return output.str(); +diff --git a/srtcore/srt.h b/srtcore/srt.h +index 08249d6..a34136e 100644 +--- a/srtcore/srt.h ++++ b/srtcore/srt.h +@@ -36,6 +36,14 @@ written by + + + #ifdef WIN32 ++ ++/* Obsolete way to define MINGW */ ++#ifndef __MINGW__ ++#if defined(__MINGW32__) || defined(__MINGW64__) ++#define __MINGW__ 1 ++#endif ++#endif ++ + #ifndef __MINGW__ + // Explicitly define 32-bit and 64-bit numbers + typedef __int32 int32_t; +diff --git a/srtcore/srt_compat.h b/srtcore/srt_compat.h +index 702324e..6def89d 100644 +--- a/srtcore/srt_compat.h ++++ b/srtcore/srt_compat.h +@@ -20,6 +20,8 @@ written by + #include <stddef.h> + #include <time.h> + ++#include "srt.h" ++ + #ifdef WIN32 + #ifndef __MINGW__ + #ifdef SRT_DYNAMIC +@@ -86,7 +88,7 @@ inline struct tm SysLocalTime(time_t tt) + { + struct tm tms; + memset(&tms, 0, sizeof tms); +-#ifdef WIN32 ++#if defined(WIN32) && !defined(__MINGW__) + errno_t rr = localtime_s(&tms, &tt); + if (rr == 0) + return tms; +-- +2.17.0 + diff --git a/recipes/srt/0003-platform_sys-Only-include-inttypes.h-with-MSFT-compi.patch b/recipes/srt/0003-platform_sys-Only-include-inttypes.h-with-MSFT-compi.patch new file mode 100644 index 00000000..411b7949 --- /dev/null +++ b/recipes/srt/0003-platform_sys-Only-include-inttypes.h-with-MSFT-compi.patch @@ -0,0 +1,27 @@ +From e132d1d403695e7ad89cb4a7d0d9a25e5504df6f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> +Date: Mon, 30 Apr 2018 15:57:59 -0400 +Subject: [PATCH 3/5] platform_sys: Only include inttypes.h with MSFT compilers + +--- + srtcore/platform_sys.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/srtcore/platform_sys.h b/srtcore/platform_sys.h +index 33c4d9b..ce546d2 100644 +--- a/srtcore/platform_sys.h ++++ b/srtcore/platform_sys.h +@@ -15,9 +15,9 @@ + #include <ws2tcpip.h> + #include <ws2ipdef.h> + #include <windows.h> +- #include <inttypes.h> + #include <stdint.h> + #if defined(_MSC_VER) ++ #include <inttypes.h> + #pragma warning(disable:4251) + #endif + #else +-- +2.17.0 + diff --git a/recipes/srt/0003-srtcore-api.h-change-inet_ntop-to-getnameinfo.patch b/recipes/srt/0003-srtcore-api.h-change-inet_ntop-to-getnameinfo.patch deleted file mode 100644 index bc02e41c..00000000 --- a/recipes/srt/0003-srtcore-api.h-change-inet_ntop-to-getnameinfo.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 9f9ac2b05be359e68b849d9e2948b0a0ac82b35d Mon Sep 17 00:00:00 2001 -From: Justin Kim <justin.kim@collabora.com> -Date: Fri, 24 Nov 2017 11:09:36 +0900 -Subject: [PATCH 3/9] srtcore/api.h: change inet_ntop to getnameinfo - -Missing a header `arpa/inet.h` causes compilation warings. -However, rather than the header for `inet_ntop` function, it would -be better to use a protocol-independent address to name translator. - -Signed-off-by: Justin Kim <justin.kim@collabora.com> ---- - srtcore/api.h | 2 +- - srtcore/platform_sys.h | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/srtcore/api.h b/srtcore/api.h -index cd62531..7045da4 100644 ---- a/srtcore/api.h -+++ b/srtcore/api.h -@@ -282,7 +282,7 @@ inline std::string SockaddrToString(const sockaddr* sadr) - - std::ostringstream output; - char hostbuf[1024]; -- if (inet_ntop(sadr->sa_family, addr, hostbuf, 1024)) -+ if (!getnameinfo(sadr, sizeof(*sadr), hostbuf, 1024, NULL, 0, NI_NAMEREQD)) - { - output << hostbuf; - } -diff --git a/srtcore/platform_sys.h b/srtcore/platform_sys.h -index 5a1d65c..5ffa374 100644 ---- a/srtcore/platform_sys.h -+++ b/srtcore/platform_sys.h -@@ -16,6 +16,7 @@ - #include <sys/types.h> - #include <sys/socket.h> - #include <sys/time.h> -+#include <netdb.h> - #include <netinet/in.h> - #include <arpa/inet.h> - #include <unistd.h> --- -2.15.1 - diff --git a/recipes/srt/0004-MingW-needs-the-explicit-exports-too.patch b/recipes/srt/0004-MingW-needs-the-explicit-exports-too.patch new file mode 100644 index 00000000..4e53f835 --- /dev/null +++ b/recipes/srt/0004-MingW-needs-the-explicit-exports-too.patch @@ -0,0 +1,34 @@ +From e8d991de8f8208df1aca804cc14c6ac5efca3ac6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> +Date: Tue, 1 May 2018 09:39:59 -0400 +Subject: [PATCH 4/5] MingW needs the explicit exports too + +--- + srtcore/srt.h | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/srtcore/srt.h b/srtcore/srt.h +index a34136e..1abfe29 100644 +--- a/srtcore/srt.h ++++ b/srtcore/srt.h +@@ -44,7 +44,6 @@ written by + #endif + #endif + +- #ifndef __MINGW__ + // Explicitly define 32-bit and 64-bit numbers + typedef __int32 int32_t; + typedef __int64 int64_t; +@@ -65,9 +64,6 @@ written by + #else + #define SRT_API + #endif +- #else +- #define SRT_API +- #endif + #else + #define SRT_API __attribute__ ((visibility("default"))) + #endif +-- +2.17.0 + diff --git a/recipes/srt/0004-build-support-cross-compiling-by-mingw.patch b/recipes/srt/0004-build-support-cross-compiling-by-mingw.patch deleted file mode 100644 index c7672229..00000000 --- a/recipes/srt/0004-build-support-cross-compiling-by-mingw.patch +++ /dev/null @@ -1,95 +0,0 @@ -From fed2532bb53dd0b915223d1af4cd17cc02e9edf2 Mon Sep 17 00:00:00 2001 -From: Justin Kim <justin.kim@collabora.com> -Date: Thu, 23 Nov 2017 20:43:46 +0900 -Subject: [PATCH 4/9] build: support cross-compiling by mingw - -This patch is to support building with `mingw-w64` on linux. - -Signed-off-by: Justin Kim <justin.kim@collabora.com> ---- - CMakeLists.txt | 26 +++++++++++++++++++++----- - 1 file changed, 21 insertions(+), 5 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8e02b58..1db73d4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -89,7 +89,14 @@ set_if(LINUX ${CMAKE_SYSTEM_NAME} MATCHES "Linux") - - # find OpenSSL - if ( USE_GNUTLS ) -- pkg_check_modules (SSL REQUIRED gnutls nettle) -+ set (SSL_REQUIRED_MODULES "gnutls nettle") -+ if (WIN32) -+ if (MINGW) -+ set (SSL_REQUIRED_MODULES "${SSL_REQUIRED_MODULES} zlib") -+ endif() -+ endif() -+ -+ pkg_check_modules (SSL REQUIRED ${SSL_REQUIRED_MODULES}) - - add_definitions( - -DUSE_GNUTLS=1 -@@ -211,6 +218,7 @@ if (${ENABLE_PROFILE} AND HAVE_COMPILER_GNU_COMPAT) - endif() - - -+if (NOT MINGW) - # find pthread - find_path(PTHREAD_INCLUDE_DIR pthread.h HINTS C:/pthread-win32/include) - if (PTHREAD_INCLUDE_DIR) -@@ -226,6 +234,10 @@ else() - message(FATAL_ERROR "Failed to find pthread library. Specify PTHREAD_LIBRARY.") - endif() - -+else() -+set (PTHREAD_LIBRARY -lpthreadGC2) -+endif() # if (NOT MINGW) -+ - # This is required in some projects that add some other sources - # to the SRT library to be compiled together (aka "virtual library"). - if (DEFINED SRT_EXTRA_LIB_INC) -@@ -359,7 +371,8 @@ target_include_directories(${TARGET_haicrypt} - set_target_properties (${TARGET_haicrypt} PROPERTIES VERSION ${SRT_VERSION} SOVERSION ${SRT_VERSION_MAJOR}) - target_link_libraries(${TARGET_haicrypt} PRIVATE ${SSL_LIBRARIES}) - set (SRT_LIBS_PRIVATE ${SSL_LIBRARIES}) --if (WIN32) -+ -+if ( WIN32 AND (NOT MINGW AND NOT CYGWIN) ) - target_link_libraries(${TARGET_haicrypt} PRIVATE ws2_32.lib) - set (SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ws2_32.lib) - endif() -@@ -385,10 +398,8 @@ if (ENABLE_SHARED) - target_compile_definitions(${TARGET_srt} PUBLIC -DUDT_DYNAMIC) - endif() - --if ( WIN32 ) -- if (NOT CYGWIN) -+if ( WIN32 AND (NOT MINGW AND NOT CYGWIN) ) - target_link_libraries(${TARGET_srt} PUBLIC Ws2_32.lib) -- endif() - endif() - - install(TARGETS ${TARGET_srt} -@@ -452,6 +463,9 @@ endif() - - if ( ENABLE_CXX11 ) - -+# FIXME: with MINGW, it fails to build stransmit -+# https://github.com/Haivision/srt/issues/177 -+if ( NOT MINGW ) - add_executable(stransmit - ${CMAKE_SOURCE_DIR}/apps/stransmit.cpp - ${CMAKE_SOURCE_DIR}/common/uriparser.cpp -@@ -468,6 +482,8 @@ if ( ENABLE_CXX11 ) - install(TARGETS stransmit RUNTIME DESTINATION bin) - install(PROGRAMS scripts/sfplay DESTINATION bin) - -+endif() # if ( NOT MINGW ) -+ - endif() - - if (DEFINED SRT_EXTRA_APPS_INC) --- -2.15.1 - diff --git a/recipes/srt/0005-Windows-Only-define-SRT_API-in-one-place.patch b/recipes/srt/0005-Windows-Only-define-SRT_API-in-one-place.patch new file mode 100644 index 00000000..0dc63b61 --- /dev/null +++ b/recipes/srt/0005-Windows-Only-define-SRT_API-in-one-place.patch @@ -0,0 +1,88 @@ +From 88efee58c3378b32d4ec54e18fb32a7c3541b4e7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> +Date: Wed, 2 May 2018 14:13:40 -0400 +Subject: [PATCH 5/5] Windows: Only define SRT_API in one place + +--- + srtcore/srt.h | 26 +++++++++++++------------- + srtcore/srt_compat.h | 18 ------------------ + 2 files changed, 13 insertions(+), 31 deletions(-) + +diff --git a/srtcore/srt.h b/srtcore/srt.h +index 1abfe29..a80db75 100644 +--- a/srtcore/srt.h ++++ b/srtcore/srt.h +@@ -37,12 +37,12 @@ written by + + #ifdef WIN32 + +-/* Obsolete way to define MINGW */ +-#ifndef __MINGW__ +-#if defined(__MINGW32__) || defined(__MINGW64__) +-#define __MINGW__ 1 +-#endif +-#endif ++ /* Obsolete way to define MINGW */ ++ #ifndef __MINGW__ ++ #if defined(__MINGW32__) || defined(__MINGW64__) ++ #define __MINGW__ 1 ++ #endif ++ #endif + + // Explicitly define 32-bit and 64-bit numbers + typedef __int32 int32_t; +@@ -55,15 +55,15 @@ written by + typedef __int64 uint64_t; + #endif + +- #ifdef SRT_DYNAMIC +- #ifdef SRT_EXPORTS +- #define SRT_API __declspec(dllexport) ++ #ifdef SRT_DYNAMIC ++ #ifdef SRT_EXPORTS ++ #define SRT_API __declspec(dllexport) ++ #elif !defined(__MINGW__) ++ #define SRT_API __declspec(dllimport) ++ #endif + #else +- #define SRT_API __declspec(dllimport) ++ #define SRT_API + #endif +- #else +- #define SRT_API +- #endif + #else + #define SRT_API __attribute__ ((visibility("default"))) + #endif +diff --git a/srtcore/srt_compat.h b/srtcore/srt_compat.h +index 6def89d..4d70616 100644 +--- a/srtcore/srt_compat.h ++++ b/srtcore/srt_compat.h +@@ -22,24 +22,6 @@ written by + + #include "srt.h" + +-#ifdef WIN32 +- #ifndef __MINGW__ +- #ifdef SRT_DYNAMIC +- #ifdef SRT_EXPORTS +- #define SRT_API __declspec(dllexport) +- #else +- #define SRT_API __declspec(dllimport) +- #endif +- #else +- #define SRT_API +- #endif +- #else +- #define SRT_API +- #endif +-#else +- #define SRT_API __attribute__ ((visibility("default"))) +-#endif +- + #ifdef WIN32 + // https://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx + // printf() Format for ssize_t +-- +2.17.0 + diff --git a/recipes/srt/0006-Clean-.pc-to-provide-the-dependecies.patch b/recipes/srt/0006-Clean-.pc-to-provide-the-dependecies.patch deleted file mode 100644 index ec4f24e5..00000000 --- a/recipes/srt/0006-Clean-.pc-to-provide-the-dependecies.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 02a6fcd2668a0f19ebeb77b02a0f5e9befda317c Mon Sep 17 00:00:00 2001 -From: Justin Kim <justin.kim@collabora.com> -Date: Fri, 8 Dec 2017 18:32:55 +0900 -Subject: [PATCH 6/9] Clean .pc to provide the dependecies - -SRT will provide the dependencies by `Requires:` field. - -Signed-off-by: Justin Kim <justin.kim@collabora.com> ---- - CMakeLists.txt | 5 ++--- - scripts/haisrt.pc.in | 2 +- - 2 files changed, 3 insertions(+), 4 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1db73d4..3bf4fe9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -106,6 +106,7 @@ if ( USE_GNUTLS ) - ${SSL_LIBRARY_DIRS} - ) - else() -+ set (SSL_REQUIRED_MODULES "openssl libcrypto zlib") - find_package(OpenSSL REQUIRED) - set (SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) - set (SSL_LIBRARIES ${OPENSSL_LIBRARIES}) -@@ -115,7 +116,6 @@ else() - -DHAICRYPT_USE_OPENSSL_AES - ) - endif() -- - message (STATUS "SSL libraries: ${SSL_LIBRARIES}") - - # Detect if the compiler is GNU compatable for flags -@@ -369,8 +369,7 @@ target_include_directories(${TARGET_haicrypt} - ) - - set_target_properties (${TARGET_haicrypt} PROPERTIES VERSION ${SRT_VERSION} SOVERSION ${SRT_VERSION_MAJOR}) --target_link_libraries(${TARGET_haicrypt} PRIVATE ${SSL_LIBRARIES}) --set (SRT_LIBS_PRIVATE ${SSL_LIBRARIES}) -+target_link_libraries(${TARGET_haicrypt} PRIVATE ${SRT_LIBS_PRIVATE} ${SSL_LIBRARIES}) - - if ( WIN32 AND (NOT MINGW AND NOT CYGWIN) ) - target_link_libraries(${TARGET_haicrypt} PRIVATE ws2_32.lib) -diff --git a/scripts/haisrt.pc.in b/scripts/haisrt.pc.in -index 3b1c49f..beb103b 100644 ---- a/scripts/haisrt.pc.in -+++ b/scripts/haisrt.pc.in -@@ -9,4 +9,4 @@ Version: @SRT_VERSION@ - Libs: -L${libdir} -l@TARGET_srt@ @IFNEEDED_LINK_HAICRYPT@ @IFNEEDED_SRTBASE@ @IFNEEDED_SRT_LDFLAGS@ - Libs.private: @SRT_LIBS_PRIVATE@ - Cflags: -I${includedir} -- -+Requires.private: @SSL_REQUIRED_MODULES@ --- -2.15.1 - diff --git a/recipes/srt/0007-srt_compat.h-Enable-localtime_s-only-if-MSC_VER-1500.patch b/recipes/srt/0007-srt_compat.h-Enable-localtime_s-only-if-MSC_VER-1500.patch deleted file mode 100644 index 47161dcd..00000000 --- a/recipes/srt/0007-srt_compat.h-Enable-localtime_s-only-if-MSC_VER-1500.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 32917c2f3c942b7ac25bc461f5984441bcb1fd21 Mon Sep 17 00:00:00 2001 -From: Justin Kim <justin.kim@collabora.com> -Date: Tue, 2 Jan 2018 16:20:44 +0900 -Subject: [PATCH 7/9] srt_compat.h: Enable localtime_s only if MSC_VER >= 1500 - -Signed-off-by: Justin Kim <justin.kim@collabora.com> ---- - common/srt_compat.h | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/common/srt_compat.h b/common/srt_compat.h -index d73e193..bddf5f8 100644 ---- a/common/srt_compat.h -+++ b/common/srt_compat.h -@@ -177,10 +177,16 @@ inline struct tm LocalTime(time_t tt) - { - struct tm tm; - #ifdef WIN32 -+#if defined(_MSC_VER) && (_MSC_VER>=1500) - errno_t rr = localtime_s(&tm, &tt); - if (rr) - return tm; -+ - #else -+ tm = *localtime(&tt); -+#endif // _MSC_VER -+ -+#else // WIN32 - tm = *localtime_r(&tt, &tm); - #endif - --- -2.15.1 - diff --git a/recipes/srt/0008-build-Fix-for-MinGW-support.patch b/recipes/srt/0008-build-Fix-for-MinGW-support.patch deleted file mode 100644 index 18af290c..00000000 --- a/recipes/srt/0008-build-Fix-for-MinGW-support.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 420f86d670c845924a8dafe88595abafd7bf67c2 Mon Sep 17 00:00:00 2001 -From: Justin Kim <justin.kim@collabora.com> -Date: Tue, 2 Jan 2018 18:22:00 +0900 -Subject: [PATCH 8/9] build: Fix for MinGW support - -Signed-off-by: Justin Kim <justin.kim@collabora.com> ---- - CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3bf4fe9..7c95096 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -235,7 +235,7 @@ else() - endif() - - else() --set (PTHREAD_LIBRARY -lpthreadGC2) -+find_library(PTHREAD_LIBRARY NAMES pthread pthreadGC2 pthreadGC) - endif() # if (NOT MINGW) - - # This is required in some projects that add some other sources -@@ -371,7 +371,7 @@ target_include_directories(${TARGET_haicrypt} - set_target_properties (${TARGET_haicrypt} PROPERTIES VERSION ${SRT_VERSION} SOVERSION ${SRT_VERSION_MAJOR}) - target_link_libraries(${TARGET_haicrypt} PRIVATE ${SRT_LIBS_PRIVATE} ${SSL_LIBRARIES}) - --if ( WIN32 AND (NOT MINGW AND NOT CYGWIN) ) -+if ( WIN32 AND NOT CYGWIN ) - target_link_libraries(${TARGET_haicrypt} PRIVATE ws2_32.lib) - set (SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ws2_32.lib) - endif() --- -2.15.1 - diff --git a/recipes/srt/0009-Fix-include-path-for-wintime.h.patch b/recipes/srt/0009-Fix-include-path-for-wintime.h.patch deleted file mode 100644 index c8fb7903..00000000 --- a/recipes/srt/0009-Fix-include-path-for-wintime.h.patch +++ /dev/null @@ -1,64 +0,0 @@ -From f9497cbb465453d5c8f895f7b70c19f7b0d0d23c Mon Sep 17 00:00:00 2001 -From: Justin Kim <justin.kim@collabora.com> -Date: Tue, 2 Jan 2018 20:17:46 +0900 -Subject: [PATCH 9/9] Fix #include path for wintime.h - -`wintime.h` is installed `${includedir}/srt/win` -so `platform_sys.h` shouldn't use an absolute path -for this header. - -Signed-off-by: Justin Kim <justin.kim@collabora.com> ---- - common/win/wintime.h | 3 +-- - scripts/haisrt.pc.in | 2 +- - srtcore/platform_sys.h | 2 +- - 3 files changed, 3 insertions(+), 4 deletions(-) - -diff --git a/common/win/wintime.h b/common/win/wintime.h -index af810b6..cc37b52 100644 ---- a/common/win/wintime.h -+++ b/common/win/wintime.h -@@ -4,7 +4,6 @@ - #include <winsock2.h> - #include <windows.h> - #include <time.h> --#include "haicrypt.h" - - #ifdef __cplusplus - extern "C" { -@@ -34,7 +33,7 @@ struct timezone - - void timeradd(struct timeval *a, struct timeval *b, struct timeval *result); - --HAICRYPT_API int gettimeofday(struct timeval* tp, struct timezone* tz); -+int gettimeofday(struct timeval* tp, struct timezone* tz); - - #ifdef __cplusplus - } -diff --git a/scripts/haisrt.pc.in b/scripts/haisrt.pc.in -index beb103b..9009f9b 100644 ---- a/scripts/haisrt.pc.in -+++ b/scripts/haisrt.pc.in -@@ -8,5 +8,5 @@ Description: SRT library set - Version: @SRT_VERSION@ - Libs: -L${libdir} -l@TARGET_srt@ @IFNEEDED_LINK_HAICRYPT@ @IFNEEDED_SRTBASE@ @IFNEEDED_SRT_LDFLAGS@ - Libs.private: @SRT_LIBS_PRIVATE@ --Cflags: -I${includedir} -+Cflags: -I${includedir} -I${includedir}/srt - Requires.private: @SSL_REQUIRED_MODULES@ -diff --git a/srtcore/platform_sys.h b/srtcore/platform_sys.h -index 5ffa374..f2cb09b 100644 ---- a/srtcore/platform_sys.h -+++ b/srtcore/platform_sys.h -@@ -8,7 +8,7 @@ - #include <windows.h> - #include <inttypes.h> - #include <stdint.h> -- #include <win/wintime.h> -+ #include "win/wintime.h" - #if defined(_MSC_VER) - #pragma warning(disable:4251) - #endif --- -2.15.1 - diff --git a/recipes/srt/0010-Include-syslog.h-on-Android.patch b/recipes/srt/0010-Include-syslog.h-on-Android.patch deleted file mode 100644 index 80166c70..00000000 --- a/recipes/srt/0010-Include-syslog.h-on-Android.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 1a822272c17f1ecaf081c2b900c4b4dde73f1823 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com> -Date: Mon, 8 Jan 2018 16:00:31 -0500 -Subject: [PATCH] Include syslog.h on Android - ---- - srtcore/logging_api.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/srtcore/logging_api.h b/srtcore/logging_api.h -index 8fa63b1..592d312 100644 ---- a/srtcore/logging_api.h -+++ b/srtcore/logging_api.h -@@ -37,8 +37,12 @@ written by - #ifdef WIN32 - #include "win/syslog_defs.h" - #else -+#ifdef ANDROID -+#include <syslog.h> -+#else - #include <sys/syslog.h> - #endif -+#endif - - // Syslog is included so that it provides log level names. - // Haivision log standard requires the same names plus extra one: --- -2.14.3 - diff --git a/recipes/srt/0011-Fix-includes-for-iOS.patch b/recipes/srt/0011-Fix-includes-for-iOS.patch deleted file mode 100644 index 94fa7fb7..00000000 --- a/recipes/srt/0011-Fix-includes-for-iOS.patch +++ /dev/null @@ -1,31 +0,0 @@ -From cdadec9c1be10c37119816e3dcdc8702a2d9ccfa Mon Sep 17 00:00:00 2001 -From: Olivier Crete <olivier.crete@collabora.com> -Date: Mon, 8 Jan 2018 16:57:20 -0500 -Subject: [PATCH] Fix includes for iOS - ---- - common/srt_compat.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/common/srt_compat.c b/common/srt_compat.c -index b03083c..d926d33 100644 ---- a/common/srt_compat.c -+++ b/common/srt_compat.c -@@ -42,7 +42,14 @@ written by - - #include <assert.h> - #include <sys/time.h> -+#ifdef __APPLE__ -+#include "TargetConditionals.h" -+#endif -+#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV -+#include <MobileCoreServices/MobileCoreServices.h> -+#else - #include <CoreServices/CoreServices.h> -+#endif - #include <pthread.h> - #include <mach/mach.h> - #include <mach/clock.h> --- -2.14.3 (Apple Git-98) - |