|
@@ -11,20 +11,19 @@ package("jrtplib")
|
|
|
|
|
|
|
|
add_includedirs("include", "include/jrtplib3")
|
|
add_includedirs("include", "include/jrtplib3")
|
|
|
|
|
|
|
|
- if is_plat ("linux") then
|
|
|
|
|
|
|
+ if is_plat("bsd", "linux") then
|
|
|
add_syslinks("pthread")
|
|
add_syslinks("pthread")
|
|
|
- elseif is_plat("windows") then
|
|
|
|
|
|
|
+ elseif is_plat("windows", "mingw") then
|
|
|
add_syslinks("ws2_32", "advapi32")
|
|
add_syslinks("ws2_32", "advapi32")
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- on_install("windows", "linux", "macosx", function (package)
|
|
|
|
|
|
|
+ on_install(function (package)
|
|
|
io.replace("src/CMakeLists.txt", [[option(JRTPLIB_WARNINGSASERRORS "Enable -Wall -Wextra -Werror" ON)]], [[option(JRTPLIB_WARNINGSASERRORS "Enable -Wall -Wextra -Werror" OFF)]], {plain=true})
|
|
io.replace("src/CMakeLists.txt", [[option(JRTPLIB_WARNINGSASERRORS "Enable -Wall -Wextra -Werror" ON)]], [[option(JRTPLIB_WARNINGSASERRORS "Enable -Wall -Wextra -Werror" OFF)]], {plain=true})
|
|
|
io.replace("src/CMakeLists.txt", [[NOT MSVC OR JRTPLIB_COMPILE_STATIC]], [[JRTPLIB_COMPILE_STATIC]], {plain=true})
|
|
io.replace("src/CMakeLists.txt", [[NOT MSVC OR JRTPLIB_COMPILE_STATIC]], [[JRTPLIB_COMPILE_STATIC]], {plain=true})
|
|
|
io.replace("src/CMakeLists.txt", [[NOT MSVC OR NOT JRTPLIB_COMPILE_STATIC]], [[NOT JRTPLIB_COMPILE_STATIC]], {plain=true})
|
|
io.replace("src/CMakeLists.txt", [[NOT MSVC OR NOT JRTPLIB_COMPILE_STATIC]], [[NOT JRTPLIB_COMPILE_STATIC]], {plain=true})
|
|
|
- local configs = {"-DJRTPLIB_COMPILE_TESTS=NO", "-DJRTPLIB_COMPILE_EXAMPLES=NO"}
|
|
|
|
|
|
|
+ local configs = {"-DCMAKE_POLICY_DEFAULT_CMP0057=NEW", "-DJRTPLIB_COMPILE_TESTS=NO", "-DJRTPLIB_COMPILE_EXAMPLES=NO"}
|
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
|
|
|
table.insert(configs, "-DJRTPLIB_COMPILE_STATIC=" .. (package:config("shared") and "OFF" or "ON"))
|
|
table.insert(configs, "-DJRTPLIB_COMPILE_STATIC=" .. (package:config("shared") and "OFF" or "ON"))
|
|
|
-
|
|
|
|
|
import("package.tools.cmake").install(package, configs)
|
|
import("package.tools.cmake").install(package, configs)
|
|
|
end)
|
|
end)
|
|
|
|
|
|
|
@@ -36,18 +35,14 @@ package("jrtplib")
|
|
|
#include "rtpipv4address.h"
|
|
#include "rtpipv4address.h"
|
|
|
#include "rtptimeutilities.h"
|
|
#include "rtptimeutilities.h"
|
|
|
#include "rtppacket.h"
|
|
#include "rtppacket.h"
|
|
|
-
|
|
|
|
|
using namespace jrtplib;
|
|
using namespace jrtplib;
|
|
|
-
|
|
|
|
|
void test() {
|
|
void test() {
|
|
|
RTPSession session;
|
|
RTPSession session;
|
|
|
-
|
|
|
|
|
RTPSessionParams sessionparams;
|
|
RTPSessionParams sessionparams;
|
|
|
sessionparams.SetOwnTimestampUnit(1.0/8000.0);
|
|
sessionparams.SetOwnTimestampUnit(1.0/8000.0);
|
|
|
-
|
|
|
|
|
RTPUDPv4TransmissionParams transparams;
|
|
RTPUDPv4TransmissionParams transparams;
|
|
|
transparams.SetPortbase(8000);
|
|
transparams.SetPortbase(8000);
|
|
|
int status = session.Create(sessionparams,&transparams);
|
|
int status = session.Create(sessionparams,&transparams);
|
|
|
}
|
|
}
|
|
|
]]}, {configs = {languages = "c++11"}}))
|
|
]]}, {configs = {languages = "c++11"}}))
|
|
|
- end)
|
|
|
|
|
|
|
+ end)
|