Commit de3d6289 authored by Ghislain MARY's avatar Ghislain MARY

Fix build for Windows Universal.

parent 863cab2d
......@@ -111,15 +111,15 @@ bc_apply_compile_flags(SOURCE_FILES_OBJC STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_library(mediastreamer2_tester_static STATIC ${SOURCE_FILES_C})
target_include_directories(mediastreamer2_tester_static PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(mediastreamer2_tester_static ${MS2_LIBS_FOR_TESTER} ${BCTOOLBOX_TESTER_LIBRARIES})
target_include_directories(mediastreamer2_tester_static PUBLIC ${BCTOOLBOX_INCLUDE_DIRS} ${ORTP_INCLUDE_DIRS})
target_link_libraries(mediastreamer2_tester_static ${MS2_LIBS_FOR_TESTER} ${BCTOOLBOX_LIBRARIES} ${ORTP_LIBRARIES})
set(RUNTIME_COMPONENT_SOURCES
mediastreamer2_tester_windows.cpp
mediastreamer2_tester_windows.h
)
add_library(mediastreamer2_tester_runtime MODULE ${RUNTIME_COMPONENT_SOURCES})
target_include_directories(mediastreamer2_tester_runtime PRIVATE "../../../mswinrtvid") # HACK!!
target_include_directories(mediastreamer2_tester_runtime PRIVATE "../../mswinrtvid") # HACK!!
target_link_libraries(mediastreamer2_tester_runtime mediastreamer2_tester_static)
set_target_properties(mediastreamer2_tester_runtime PROPERTIES VS_WINRT_COMPONENT TRUE)
set_target_properties(mediastreamer2_tester_runtime PROPERTIES LIBRARY_OUTPUT_NAME "BelledonneCommunications.Mediastreamer2.Tester")
......
#include <string>
#include <collection.h>
#include <bctoolbox/logging.h>
#include "mediastreamer2_tester_windows.h"
#include "mswinrtvid.h"
......@@ -53,7 +55,7 @@ static void nativeOutputTraceHandler(int lev, const char *fmt, va_list args)
OutputDebugStringW(L"\n");
}
static void ms2NativeOutputTraceHandler(const char *domain, OrtpLogLevel lev, const char *fmt, va_list args)
static void ms2NativeOutputTraceHandler(void *info, const char *domain, BctbxLogLevel lev, const char *fmt, va_list args)
{
nativeOutputTraceHandler((int)lev, fmt, args);
}
......@@ -109,6 +111,7 @@ bool NativeTester::run(Platform::String^ suiteName, Platform::String^ caseName,
std::wstring wscasename = caseName->Data();
char csuitename[MAX_SUITE_NAME_SIZE] = { 0 };
char ccasename[MAX_SUITE_NAME_SIZE] = { 0 };
bctbx_log_handler_t *log_handler = bctbx_create_log_handler(ms2NativeOutputTraceHandler, NULL, NULL);
wcstombs(csuitename, wssuitename.c_str(), sizeof(csuitename));
wcstombs(ccasename, wscasename.c_str(), sizeof(ccasename));
......@@ -118,7 +121,7 @@ bool NativeTester::run(Platform::String^ suiteName, Platform::String^ caseName,
else {
ortp_set_log_level_mask(NULL, ORTP_ERROR | ORTP_FATAL);
}
ortp_set_log_handler(ms2NativeOutputTraceHandler);
bctbx_add_log_handler(log_handler);
return bc_tester_run_tests(wssuitename == all ? 0 : csuitename, wscasename == all ? 0 : ccasename, NULL) != 0;
}
......@@ -308,7 +311,8 @@ void NativeTester::initMS2()
if (_factory == nullptr) {
ortp_init();
ortp_set_log_level_mask(NULL, ORTP_MESSAGE | ORTP_WARNING | ORTP_ERROR | ORTP_FATAL);
ortp_set_log_handler(ms2NativeOutputTraceHandler);
bctbx_log_handler_t *log_handler = bctbx_create_log_handler(ms2NativeOutputTraceHandler, NULL, NULL);
bctbx_add_log_handler(log_handler);
_factory = ms_factory_new_with_voip();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment