summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBananahemic <bananahemic@users.noreply.github.com>2018-12-12 21:19:57 -0800
committerBananahemic <bananahemic@users.noreply.github.com>2018-12-12 21:19:57 -0800
commit8c7b55242eeb5c91a2ee19d11ac34249901124c3 (patch)
tree0882c5890ccce4352ba216868a76af89f2c9a932
parentd2bc6ceb3e6faa6c7c0dd05c0af8087b27c450cb (diff)
Switched to SRT 1.3.1
-rw-r--r--recipes/srt.recipe7
-rw-r--r--recipes/srt/0001-Build-Fix-MingW-build.patch312
2 files changed, 3 insertions, 316 deletions
diff --git a/recipes/srt.recipe b/recipes/srt.recipe
index 7816fe40..037e2376 100644
--- a/recipes/srt.recipe
+++ b/recipes/srt.recipe
@@ -5,9 +5,9 @@ from cerbero.tools.libtool import LibtoolLibrary
class Recipe(recipe.Recipe):
name = 'srt'
- version = '1.3.0'
+ version = '1.3.1'
url = 'https://github.com/Haivision/srt/archive/v%(version)s.tar.gz'
- tarball_checksum = '645c13a9a5c5b59315f82245737289e071a5441ee40de6e2e45af61e305e1f2c'
+ tarball_checksum = 'f202801d9e53cd8854fccc1ca010272076c32c318396c8f61fb9a61807c3dbea'
licenses = [License.MPLv2]
stype = SourceType.TARBALL
btype = BuildType.CMAKE
@@ -16,8 +16,7 @@ class Recipe(recipe.Recipe):
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',
+ patches = ['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',
diff --git a/recipes/srt/0001-Build-Fix-MingW-build.patch b/recipes/srt/0001-Build-Fix-MingW-build.patch
deleted file mode 100644
index 86fa5af1..00000000
--- a/recipes/srt/0001-Build-Fix-MingW-build.patch
+++ /dev/null
@@ -1,312 +0,0 @@
-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
-