Skip to content

Commit 7591629

Browse files
committed
buildable rtmfp...
1 parent d400264 commit 7591629

File tree

3 files changed

+181
-1
lines changed

3 files changed

+181
-1
lines changed

cross_compile_ffmpeg.sh

+18
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,23 @@ build_gmp() {
832832
cd ..
833833
}
834834

835+
build_librtmfp() {
836+
build_openssl-1.1.0
837+
build_openssl-1.0.2 # pre req?
838+
do_git_checkout https://github.com/MonaSolutions/librtmfp.git
839+
cd librtmfp_git/include/Base
840+
do_git_checkout https://github.com/meganz/mingw-std-threads.git mingw-std-threads # our g++ apparently doesn't have std::mutex baked in...weird...
841+
cd ../../..
842+
cd librtmfp_git
843+
#export CPPFLAGS='-Iinclude -Llib' only if building with it ja ja
844+
#export LIBS='-mwindows -lWs2_32 -liphlpapi -lz'
845+
apply_patch file://$patch_dir/rtmfp.static.cross.patch -p1 # works e48efb4f
846+
do_make "$make_prefix_options GPP=${cross_prefix}g++"
847+
cd ..
848+
echo "success rtmfp"
849+
exit 1
850+
}
851+
835852
build_libnettle() {
836853
download_and_unpack_file https://ftp.gnu.org/gnu/nettle/nettle-3.4.tar.gz
837854
cd nettle-3.4
@@ -1979,6 +1996,7 @@ build_ffmpeg_dependencies() {
19791996
build_libxml2 # Uses zlib, liblzma, iconv and dlfcn.
19801997
build_fontconfig # Needs freetype and libxml >= 2.6. Uses iconv and dlfcn.
19811998
build_gmp # For rtmp support configure FFmpeg with '--enable-gmp'. Uses dlfcn.
1999+
build_librtmfp
19822000
build_libnettle # Needs gmp >= 3.0. Uses dlfcn.
19832001
build_gnutls # Needs nettle >= 3.1, hogweed (nettle) >= 3.1. Uses zlib and dlfcn.
19842002
#if [[ "$non_free" = "y" ]]; then

patches/mingw-w64-build-r22.local

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ gcc='gcc'
7575
gcc_host=''
7676

7777
## Versions
78-
mingw_w64_release_ver='5.0.4'
78+
mingw_w64_release_ver='6.0.0'
7979
gcc_release_ver='7.1.0'
8080
gcc_old_release_ver='4.9.3'
8181
mpfr_release_ver='3.1.5'

patches/rtmfp.static.cross.patch

+162
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
diff --git a/Makefile b/Makefile
2+
index d617cfc..0f395c9 100644
3+
--- a/Makefile
4+
+++ b/Makefile
5+
@@ -23,14 +23,15 @@ OS := $(shell uname -s)
6+
7+
# Variables with default values
8+
GPP?=g++
9+
+AR?=ar
10+
11+
# Variables extendable
12+
-CFLAGS+=-std=c++11 -Wall -Wno-reorder -Wno-terminate -Wno-unknown-pragmas -Wno-unknown-warning-option
13+
+CFLAGS+=-std=c++11 -Wall -Wno-reorder -Wno-terminate -Wno-unknown-pragmas
14+
ifeq ($(OS),FreeBSD)
15+
CFLAGS+=-D_GLIBCXX_USE_C99
16+
endif
17+
override INCLUDES+=-I./include/
18+
-LIBS+=-Wl,-Bdynamic -lcrypto -lssl -lpthread
19+
+LIBS+=-Wl,-Bdynamic -lcrypto -lssl -lpthread -lz
20+
21+
INCDIR=/usr/include/librtmfp/
22+
23+
@@ -42,6 +43,11 @@ else
24+
LIBNAME=librtmfp.so
25+
SHARED=-shared
26+
endif
27+
+
28+
+# mingw cross static
29+
+LIBNAME=librtmfp.a
30+
+SHARED=
31+
+
32+
LIB=lib/$(LIBNAME)
33+
34+
# Variables fixed
35+
@@ -55,8 +61,9 @@ release:
36+
mkdir -p tmp/Release/Base
37+
mkdir -p lib
38+
@$(MAKE) -k $(OBJECT)
39+
- @echo creating dynamic lib $(LIB)
40+
- @$(GPP) $(CFLAGS) $(LIBDIRS) -fPIC $(SHARED) -o $(LIB) $(OBJECT) $(LIBS)
41+
+ @echo creating static lib $(LIB)
42+
+ @$(AR) crf $(LIB) $(OBJECT)
43+
+ @echo was $(GPP) $(CFLAGS) $(LIBDIRS) -fPIC $(SHARED) -o $(LIB) $(OBJECT) $(LIBS)
44+
45+
debug:
46+
mkdir -p tmp/Debug/Base
47+
@@ -90,4 +97,4 @@ $(OBJECTD): tmp/Debug/%.o: sources/%.cpp
48+
clean:
49+
@echo cleaning project librtmfp
50+
@rm -f $(OBJECT) $(LIB)
51+
- @rm -f $(OBJECTD) $(LIB)
52+
\ No newline at end of file
53+
+ @rm -f $(OBJECTD) $(LIB)
54+
diff --git a/include/Base/Date.h b/include/Base/Date.h
55+
index 209d3ce..ab2431a 100644
56+
--- a/include/Base/Date.h
57+
+++ b/include/Base/Date.h
58+
@@ -19,6 +19,7 @@ details (or else see http://mozilla.org/MPL/2.0/).
59+
#include "Base/Mona.h"
60+
#include "Base/Time.h"
61+
#include "Base/Timezone.h"
62+
+#define __STDC_FORMAT_MACROS
63+
#include "inttypes.h"
64+
65+
namespace Base {
66+
diff --git a/include/Base/Mona.h b/include/Base/Mona.h
67+
index d212a25..177184c 100644
68+
--- a/include/Base/Mona.h
69+
+++ b/include/Base/Mona.h
70+
@@ -26,7 +26,11 @@ details (or else see http://mozilla.org/MPL/2.0/).
71+
#include <memory>
72+
#include <functional>
73+
#include <cmath> // C++ version of math.h to solve abs ambiguity over linux
74+
-
75+
+#include <mutex>
76+
+#include "winsock2.h"
77+
+#include "windows.h"
78+
+#include "Base/mingw-std-threads/mingw.mutex.h"
79+
+#include "Base/mingw-std-threads/mingw.condition_variable.h"
80+
81+
///// Usefull macros and patchs //////
82+
83+
@@ -43,12 +47,13 @@ details (or else see http://mozilla.org/MPL/2.0/).
84+
#define LINE_STRING STRINGIZE(__LINE__)
85+
86+
#if defined(_WIN32)
87+
-#define _WINSOCKAPI_ // stops windows.h including winsock.h
88+
-#define NOMINMAX
89+
+//#define _WINSOCKAPI_ // stops windows.h including winsock.h
90+
+//#define NOMINMAX
91+
+#include "winsock2.h"
92+
#include "windows.h"
93+
#define sprintf sprintf_s
94+
#define snprintf sprintf_s
95+
-#define PATH_MAX 4096 // to match Linux!
96+
+// #define PATH_MAX 4096 // to match Linux!
97+
#define __BIG_ENDIAN__ 0 // windows is always little endian!
98+
#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__TOS_MACOS__) || defined(__NetBSD__) || defined(__OpenBSD__)
99+
#define _BSD 1 // Detect BSD system
100+
diff --git a/include/Base/Path.h b/include/Base/Path.h
101+
index 5a5291e..d562bda 100644
102+
--- a/include/Base/Path.h
103+
+++ b/include/Base/Path.h
104+
@@ -19,6 +19,7 @@ details (or else see http://mozilla.org/MPL/2.0/).
105+
#include "Base/Mona.h"
106+
#include "Base/FileSystem.h"
107+
#include <mutex>
108+
+#include "Base/mingw-std-threads/mingw.mutex.h"
109+
110+
namespace Base {
111+
112+
diff --git a/include/Base/Thread.h b/include/Base/Thread.h
113+
index 5324da6..cfaef48 100644
114+
--- a/include/Base/Thread.h
115+
+++ b/include/Base/Thread.h
116+
@@ -19,6 +19,7 @@ details (or else see http://mozilla.org/MPL/2.0/).
117+
#include "Base/Exceptions.h"
118+
#include "Base/Signal.h"
119+
#include <thread>
120+
+#include "Base/mingw-std-threads/mingw.mutex.h"
121+
122+
namespace Base {
123+
124+
diff --git a/include/librtmfp.h b/include/librtmfp.h
125+
index 50ff248..9a5e512 100644
126+
--- a/include/librtmfp.h
127+
+++ b/include/librtmfp.h
128+
@@ -18,7 +18,7 @@ GNU Lesser General Public License for more details.
129+
You should have received a copy of the GNU Lesser General Public License
130+
along with Librtmfp. If not, see <http://www.gnu.org/licenses/>.
131+
*/
132+
-
133+
+#define LIBRTMFP_STATIC 1
134+
#if defined(_WIN32) && !defined(LIBRTMFP_STATIC)
135+
// Windows DLL declaration
136+
#if defined(LIBRTMFP_EXPORT)
137+
diff --git a/sources/Base/IOSocket.cpp b/sources/Base/IOSocket.cpp
138+
index 8d904c3..60a7048 100644
139+
--- a/sources/Base/IOSocket.cpp
140+
+++ b/sources/Base/IOSocket.cpp
141+
@@ -535,7 +535,7 @@ bool IOSocket::run(Exception& ex, const volatile bool& requestStop) {
142+
shared<Socket> pSocket;
143+
{
144+
lock_guard<mutex> lock(_mutexSockets);
145+
- auto& it = _sockets.find(msg.wParam);
146+
+ const auto& it = _sockets.find(msg.wParam);
147+
if (it != _sockets.end())
148+
pSocket = it->second.lock();
149+
}
150+
diff --git a/sources/Base/Timezone.cpp b/sources/Base/Timezone.cpp
151+
index 5313a37..f181e2a 100644
152+
--- a/sources/Base/Timezone.cpp
153+
+++ b/sources/Base/Timezone.cpp
154+
@@ -494,7 +494,7 @@ Timezone::Timezone() : _offset(0),_dstOffset(3600000) {
155+
});
156+
157+
158+
- auto& it = WindowToTZID.find(_name);
159+
+ const auto& it = WindowToTZID.find(_name);
160+
if (it != WindowToTZID.end())
161+
_name.assign(it->second);
162+
} else

0 commit comments

Comments
 (0)