- more fixes for Windows build
This commit is contained in:
parent
15457fef21
commit
9d31979db3
|
|
@ -1,5 +1,53 @@
|
|||
project(rtphone)
|
||||
|
||||
macro(configure_msvc_runtime)
|
||||
if(MSVC)
|
||||
# Default to statically-linked runtime.
|
||||
if("${MSVC_RUNTIME}" STREQUAL "")
|
||||
set(MSVC_RUNTIME "static")
|
||||
endif()
|
||||
# Set compiler options.
|
||||
set(variables
|
||||
CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_MINSIZEREL
|
||||
CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_CXX_FLAGS_DEBUG
|
||||
CMAKE_CXX_FLAGS_MINSIZEREL
|
||||
CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
)
|
||||
if(${MSVC_RUNTIME} STREQUAL "static")
|
||||
message(STATUS
|
||||
"rtphone: MSVC -> forcing use of statically-linked runtime."
|
||||
)
|
||||
foreach(variable ${variables})
|
||||
if(${variable} MATCHES "/MD")
|
||||
string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}")
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
message(STATUS
|
||||
"rtphone: MSVC -> forcing use of dynamically-linked runtime."
|
||||
)
|
||||
foreach(variable ${variables})
|
||||
if(${variable} MATCHES "/MT")
|
||||
string(REGEX REPLACE "/MT" "/MD" ${variable} "${${variable}}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
foreach(variable ${variables})
|
||||
string(REGEX REPLACE "/Z[iI7]" ""
|
||||
${variable}
|
||||
"${${variable}}")
|
||||
|
||||
set(${variable} "${${variable}} /Zi /Oy-")
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
# Rely on C++ 11
|
||||
set (CMAKE_CXX_STANDARD 11)
|
||||
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
|
@ -74,3 +122,5 @@ target_include_directories(rtphone
|
|||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/engine>
|
||||
PRIVATE ../../libs/speex/include ../../libs ../)
|
||||
|
||||
configure_msvc_runtime()
|
||||
|
|
|
|||
|
|
@ -533,7 +533,8 @@ void AgentImpl::processGetMediaStats(Json::Value& request, Json::Value& answer)
|
|||
if (!aquaReference.empty())
|
||||
{
|
||||
Audio::WavFileReader reader;
|
||||
reader.open(aquaReference);
|
||||
reader.open(StringHelper::makeTstring(aquaReference));
|
||||
|
||||
if (reader.isOpened())
|
||||
{
|
||||
char buffer[1024];
|
||||
|
|
@ -548,11 +549,10 @@ void AgentImpl::processGetMediaStats(Json::Value& request, Json::Value& answer)
|
|||
}
|
||||
}
|
||||
MT::PSevanaAqua sa = mAquaMap[sessionIter->first];
|
||||
MT::SevanaAqua::AudioBuffer test, reference;
|
||||
MT::SevanaAqua::AudioBuffer test(mAquaIncoming.data(), mAquaIncoming.size()),
|
||||
reference;
|
||||
test.mRate = AUDIO_SAMPLERATE; reference.mRate = AUDIO_SAMPLERATE;
|
||||
test.mChannels = AUDIO_CHANNELS; reference.mChannels = AUDIO_CHANNELS;
|
||||
test.mData = mAquaIncoming.mutableData(); reference.mData = referenceAudio.mutableData();
|
||||
test.mSize = mAquaIncoming.size(); reference.mSize = referenceAudio.size();
|
||||
|
||||
MT::SevanaAqua::CompareResult r = sa->compare(reference, test);
|
||||
answer["aqua_mos"] = r.mMos;
|
||||
|
|
|
|||
Loading…
Reference in New Issue