From 61be61b7e3fdd1197c2aaf029480ee8b1a8e585a Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Tue, 8 Jun 2021 19:30:02 +0300 Subject: [PATCH] - missed changes --- src/CMakeLists.txt | 15 +++++++++++---- src/engine/agent/Agent_Impl.cpp | 2 +- src/engine/helper/HL_Rtp.cpp | 5 +++++ src/engine/helper/HL_Rtp.h | 2 ++ src/engine/helper/HL_String.cpp | 2 +- src/engine/media/CMakeLists.txt | 3 ++- src/engine/media/MT_CodecList.cpp | 2 +- src/libs/ice/ICEAddress.cpp | 2 +- src/libs/ice/ICELog.cpp | 3 +++ src/libs/ice/ICELog.h | 2 ++ 10 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a5f41f86..848cb1d4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -60,7 +60,8 @@ set (rtphone_engine engine) set (USE_AMR_CODEC OFF CACHE BOOL "Use AMR codec. Requires libraries.") set (USE_EVS_CODEC OFF CACHE BOOL "Use EVS codec." ) set (USE_OPUS_CODEC OFF CACHE BOOL "Use Opus codec." ) -set (USE_SEVANA_LIB OFF CACHE BOOL "Build with Sevana libraries" ) +set (USE_PVQA_LIB OFF CACHE BOOL "Build with Sevana PVQA library" ) +set (USE_AQUA_LIB OFF CACHE BOOL "Build with Sevana AQuA library" ) # PIC code by default set (CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -85,9 +86,15 @@ if (CMAKE_SYSTEM MATCHES "Darwin*") add_definitions (-DTARGET_OSX) endif() -if (USE_SEVANA_LIB) - message("Use Sevana libraries") - add_definitions( -DUSE_AQUA_LIBRARY -DUSE_PVQA_LIBRARY) +if (USE_AQUA_LIB) + message("Use AQuA library") + add_definitions( -DUSE_AQUA_LIBRARY ) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/pvqa/include) +endif() + +if (USE_PVQA_LIBRARY) + message("Use PVQA libraries") + add_definitions( -DUSE_PVQA_LIBRARY ) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/pvqa/include) endif() diff --git a/src/engine/agent/Agent_Impl.cpp b/src/engine/agent/Agent_Impl.cpp index 3bd8091b..277a1e02 100644 --- a/src/engine/agent/Agent_Impl.cpp +++ b/src/engine/agent/Agent_Impl.cpp @@ -951,4 +951,4 @@ void AgentImpl::closeAqua(int sessionId) mAquaMap.erase(aquaIter); } } -#endif \ No newline at end of file +#endif diff --git a/src/engine/helper/HL_Rtp.cpp b/src/engine/helper/HL_Rtp.cpp index c4af449e..b7594daf 100644 --- a/src/engine/helper/HL_Rtp.cpp +++ b/src/engine/helper/HL_Rtp.cpp @@ -245,3 +245,8 @@ std::string MediaStreamId::getFinishDescription() const return oss.str(); } +std::ostream& operator << (std::ostream& output, const MediaStreamId& id) +{ + return (output << id.toString()); +} + diff --git a/src/engine/helper/HL_Rtp.h b/src/engine/helper/HL_Rtp.h index 0e34b42c..9d6c81d9 100644 --- a/src/engine/helper/HL_Rtp.h +++ b/src/engine/helper/HL_Rtp.h @@ -87,4 +87,6 @@ struct MediaStreamId std::string getFinishDescription() const; }; +std::ostream& operator << (std::ostream& output, const MediaStreamId& id); + #endif diff --git a/src/engine/helper/HL_String.cpp b/src/engine/helper/HL_String.cpp index 6f43f663..dd0f0472 100644 --- a/src/engine/helper/HL_String.cpp +++ b/src/engine/helper/HL_String.cpp @@ -119,7 +119,7 @@ std::string StringHelper::toHex(unsigned int value) std::string StringHelper::toHex(const void *ptr) { std::ostringstream oss; - oss << std::hex << ptr; + oss << std::fixed << std::setw(8) << std::setfill('0') << std::hex << ptr; return oss.str(); } diff --git a/src/engine/media/CMakeLists.txt b/src/engine/media/CMakeLists.txt index f16aa9d1..9626dcf0 100644 --- a/src/engine/media/CMakeLists.txt +++ b/src/engine/media/CMakeLists.txt @@ -11,7 +11,8 @@ set (CMAKE_POSITION_INDEPENDENT_CODE ON) set (USE_AMR_CODEC OFF CACHE BOOL "Use AMR codec. Requires libraries.") set (USE_EVS_CODEC OFF CACHE BOOL "Use EVS codec." ) set (USE_OPUS_CODEC OFF CACHE BOOL "Use Opus codec." ) -set (USE_SEVANA_LIB OFF CACHE BOOL "Build with Sevana libraries" ) +set (USE_PVQA_LIB OFF CACHE BOOL "Build with Sevana PVQA library" ) +set (USE_AQUA_LIB OFF CACHE BOOL "Build with Sevana AQuA library" ) set (SOURCES MT_Statistics.cpp diff --git a/src/engine/media/MT_CodecList.cpp b/src/engine/media/MT_CodecList.cpp index 8f6d9d5c..1475d59c 100644 --- a/src/engine/media/MT_CodecList.cpp +++ b/src/engine/media/MT_CodecList.cpp @@ -96,7 +96,7 @@ CodecList::CodecList(const Settings& settings) :mSettings(settings) { //mFactoryList.push_back(new OpusCodec::OpusFactory(16000, 1)); -#if !defined(TARGET_ANDROID) && defined(USE_OPUS_CODEC) +#if defined(USE_OPUS_CODEC) if (settings.mOpusSpec.empty()) { mFactoryList.push_back(new OpusCodec::OpusFactory(48000, 2, MT_OPUS_CODEC_PT)); diff --git a/src/libs/ice/ICEAddress.cpp b/src/libs/ice/ICEAddress.cpp index 56cb3b6a..01c6ff39 100644 --- a/src/libs/ice/ICEAddress.cpp +++ b/src/libs/ice/ICEAddress.cpp @@ -426,7 +426,7 @@ std::string NetworkAddress::ip() const { assert(mInitialized == true); - char resultbuf[128], ip6[128]; resultbuf[0] = 0; + char resultbuf[131], ip6[128]; resultbuf[0] = 0; #ifdef TARGET_WIN DWORD resultsize = sizeof(resultbuf); diff --git a/src/libs/ice/ICELog.cpp b/src/libs/ice/ICELog.cpp index 34dc5114..0e8a36a8 100644 --- a/src/libs/ice/ICELog.cpp +++ b/src/libs/ice/ICELog.cpp @@ -41,6 +41,9 @@ LogLevel LogLevelHelper::parse(const std::string& t) else if (t == "special") return LL_SPECIAL; + else + if (t == "media") + return LL_MEDIA; throw std::runtime_error("Bad log param string value."); } diff --git a/src/libs/ice/ICELog.h b/src/libs/ice/ICELog.h index 15d90bb8..6e120fa4 100644 --- a/src/libs/ice/ICELog.h +++ b/src/libs/ice/ICELog.h @@ -164,12 +164,14 @@ extern Logger GLogger; #define ICELogError(args_) ICELog(LL_ERROR, LOG_SUBSYSTEM, args_) #define ICELogSpecial(args_) ICELog(LL_SPECIAL, LOG_SUBSYSTEM, args_) +/* #define ICELogCritical2(args_) ICELog(LogLevel_Critical, LogSubsystem.c_str(), args_) #define ICELogInfo2(args_) ICELog(LogLevel_Info, LogSubsystem.c_str(), args_) #define ICELogDebug2(args_) ICELog(LogLevel_Debug, LogSubsystem.c_str(), args_) #define ICELogMedia2(args_) ICELog(LogLevel_Media, LogSubsystem.c_str(), args_) #define ICELogError2(args_) ICELog(LogLevel_Error, LogSubsystem.c_str(), args_) #define ICELogSpecial2(args_) ICELog(LogLevel_Special, LogSubsystem.c_str(), args_) +*/ #define DEFINE_LOGGING(subsystem) \ static std::string LogSubsystem = subsystem; \