This commit is contained in:
Dmytro Bogovych 2019-10-11 20:31:45 +03:00
parent 94d7471aec
commit 3102efaf4f
5 changed files with 774 additions and 773 deletions

View File

@ -60,21 +60,21 @@ set (rtphone_engine engine)
set (USE_AMR_CODEC OFF CACHE BOOL "Use AMR codec. Requires libraries.") set (USE_AMR_CODEC OFF CACHE BOOL "Use AMR codec. Requires libraries.")
set (USE_EVS_CODEC OFF CACHE BOOL "Use EVS codec.") set (USE_EVS_CODEC OFF CACHE BOOL "Use EVS codec.")
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set (CMAKE_POSITION_INDEPENDENT_CODE ON)
set (OPENSSL_INCLUDE ${LIB_PLATFORM}/openssl/1.0/include) set (OPENSSL_INCLUDE ${LIB_PLATFORM}/openssl/1.0/include)
message ("Using OpenSSL include files from ${OPENSSL_INCLUDE}") message ("Using OpenSSL include files from ${OPENSSL_INCLUDE}")
if (CMAKE_SYSTEM MATCHES "Windows*") if (CMAKE_SYSTEM MATCHES "Windows*")
add_definitions(-DTARGET_WIN) add_definitions (-DTARGET_WIN -D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS -D_UNICODE -D_CRT_SECURE_NO_WARNINGS)
endif() endif()
if (CMAKE_SYSTEM MATCHES "Linux*") if (CMAKE_SYSTEM MATCHES "Linux*")
add_definitions(-DTARGET_LINUX) add_definitions (-DTARGET_LINUX)
endif() endif()
if (CMAKE_SYSTEM MATCHES "Darwin*") if (CMAKE_SYSTEM MATCHES "Darwin*")
add_definitions(-DTARGET_OSX) add_definitions (-DTARGET_OSX)
endif() endif()
set (RTPHONE_SOURCES set (RTPHONE_SOURCES
@ -133,7 +133,7 @@ set (RTPHONE_HEADERS
${rtphone_engine}/endpoint/EP_Session.h ${rtphone_engine}/endpoint/EP_Session.h
) )
add_library(rtphone STATIC ${RTPHONE_SOURCES} ${RTPHONE_HEADERS}) add_library (rtphone STATIC ${RTPHONE_SOURCES} ${RTPHONE_HEADERS})
add_subdirectory(${rtphone_libs}/resiprocate) add_subdirectory(${rtphone_libs}/resiprocate)
add_subdirectory(${rtphone_libs}/ice) add_subdirectory(${rtphone_libs}/ice)
@ -150,7 +150,7 @@ add_subdirectory(${rtphone_engine}/helper)
add_subdirectory(${rtphone_engine}/audio) add_subdirectory(${rtphone_engine}/audio)
add_subdirectory(${rtphone_engine}/media) add_subdirectory(${rtphone_engine}/media)
set(LIBS ice_stack jrtplib g729_codec gsm_codec set (LIBS ice_stack jrtplib g729_codec gsm_codec
gsmhr_codec g722_codec srtp resiprocate helper_lib audio_lib webrtc speexdsp gsmhr_codec g722_codec srtp resiprocate helper_lib audio_lib webrtc speexdsp
uuid) uuid)
@ -161,7 +161,7 @@ else ()
endif () endif ()
if (USE_AMR_CODEC) if (USE_AMR_CODEC)
set(LIBS ${LIBS} opencore-amrnb opencore-amrwb) set (LIBS ${LIBS} opencore-amrnb opencore-amrwb)
endif (USE_AMR_CODEC) endif (USE_AMR_CODEC)
target_link_libraries(rtphone target_link_libraries(rtphone

File diff suppressed because it is too large Load Diff

View File

@ -31,9 +31,9 @@
namespace Audio namespace Audio
{ {
class VistaEnumerator: public Enumerator class VistaEnumerator: public Enumerator
{ {
public: public:
VistaEnumerator(); VistaEnumerator();
~VistaEnumerator(); ~VistaEnumerator();
@ -45,7 +45,7 @@ namespace Audio
int idAt(int index); int idAt(int index);
int indexOfDefaultDevice(); int indexOfDefaultDevice();
protected: protected:
IMMDeviceCollection* mCollection; IMMDeviceCollection* mCollection;
IMMDevice* mDefaultDevice; IMMDevice* mDefaultDevice;
IMMDeviceEnumerator* mEnumerator; IMMDeviceEnumerator* mEnumerator;
@ -54,11 +54,11 @@ namespace Audio
void enumerate(); void enumerate();
IMMDevice* mapIndexToInterface(int index); IMMDevice* mapIndexToInterface(int index);
}; };
class XpEnumerator: public Enumerator class XpEnumerator: public Enumerator
{ {
public: public:
XpEnumerator(); XpEnumerator();
~XpEnumerator(); ~XpEnumerator();
@ -70,25 +70,25 @@ namespace Audio
int idAt(int index); int idAt(int index);
int indexOfDefaultDevice(); int indexOfDefaultDevice();
protected: protected:
std::vector<std::wstring> mNameList; std::vector<std::wstring> mNameList;
int mDirection; int mDirection;
}; };
class DSoundHelper class DSoundHelper
{ {
public: public:
static void checkComResult(HRESULT code); static void checkComResult(HRESULT code);
static GUID deviceId2Guid(int deviceId, bool captureDevice); static GUID deviceId2Guid(int deviceId, bool captureDevice);
}; };
#if !defined(_MSC_VER) #if !defined(_MSC_VER)
typedef struct IDirectSoundNotify8 *LPDIRECTSOUNDNOTIFY8; typedef struct IDirectSoundNotify8 *LPDIRECTSOUNDNOTIFY8;
#endif #endif
class DSoundInputDevice: public InputDevice class DSoundInputDevice: public InputDevice
{ {
public: public:
DSoundInputDevice(GUID deviceId); DSoundInputDevice(GUID deviceId);
~DSoundInputDevice(); ~DSoundInputDevice();
@ -102,7 +102,7 @@ namespace Audio
int readBuffer(void* buffer); int readBuffer(void* buffer);
Format getFormat(); Format getFormat();
protected: protected:
Mutex mGuard; /// Mutex to protect this instance. Mutex mGuard; /// Mutex to protect this instance.
LPDIRECTSOUNDCAPTURE8 mDevice; LPDIRECTSOUNDCAPTURE8 mDevice;
LPDIRECTSOUNDCAPTUREBUFFER8 mBuffer; LPDIRECTSOUNDCAPTUREBUFFER8 mBuffer;
@ -134,11 +134,11 @@ namespace Audio
void closeDevice(); void closeDevice();
static void threadProc(void* arg); static void threadProc(void* arg);
}; };
class DSoundOutputDevice: public OutputDevice class DSoundOutputDevice: public OutputDevice
{ {
public: public:
DSoundOutputDevice(GUID deviceId); DSoundOutputDevice(GUID deviceId);
~DSoundOutputDevice(); ~DSoundOutputDevice();
@ -151,7 +151,7 @@ namespace Audio
bool closing(); bool closing();
Format getFormat(); Format getFormat();
protected: protected:
Mutex mGuard; /// Mutex to protect this instance Mutex mGuard; /// Mutex to protect this instance
int mDeviceID; int mDeviceID;
LPDIRECTSOUND8 mDevice; LPDIRECTSOUND8 mDevice;
@ -181,7 +181,7 @@ namespace Audio
bool getMediaFrame(); bool getMediaFrame();
static void threadProc(void* arg); static void threadProc(void* arg);
}; };
} }
#endif #endif

View File

@ -5,10 +5,10 @@ set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (USE_NULL_UUID OFF CACHE BOOL "When enabled linking to libuuid is avoided") set (USE_NULL_UUID OFF CACHE BOOL "When enabled linking to libuuid is avoided")
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set (CMAKE_POSITION_INDEPENDENT_CODE ON)
file(GLOB HELPER_LIB_SOURCES "*.cpp" "*.h") file (GLOB HELPER_LIB_SOURCES "*.cpp" "*.h")
add_library(helper_lib ${HELPER_LIB_SOURCES}) add_library(helper_lib ${HELPER_LIB_SOURCES})
target_include_directories(helper_lib PRIVATE ../../libs/ ../../engine ../) target_include_directories(helper_lib PRIVATE ../../libs/ ../../engine ../)
target_compile_definitions(helper_lib PRIVATE -D_CRT_SECURE_NO_WARNINGS) target_compile_definitions(helper_lib PRIVATE -D_CRT_SECURE_NO_WARNINGS -D_UNICODE)

View File

@ -1,5 +1,6 @@
#include "HL_Usb.h" #include "HL_Usb.h"
#include "HL_Exception.h" #include "HL_Exception.h"
#ifdef TARGET_WIN #ifdef TARGET_WIN
#include <devguid.h> #include <devguid.h>
@ -9,7 +10,7 @@
UsbChangeListener::UsbChangeListener() UsbChangeListener::UsbChangeListener()
:mNotifyHandle(NULL), mHiddenWindow(NULL), mDelegate(NULL) :mNotifyHandle(NULL), mHiddenWindow(NULL), mDelegate(NULL)
{ {
wsprintf(mWindowClassName, ADR_WINDOW_CLASS_NAME, (unsigned int)rand()); wsprintfW(mWindowClassName, ADR_WINDOW_CLASS_NAME, (unsigned int)rand());
} }
UsbChangeListener::~UsbChangeListener() UsbChangeListener::~UsbChangeListener()
@ -30,16 +31,16 @@ UsbChangeListener::Delegate* UsbChangeListener::getDelegate() const
void UsbChangeListener::start() void UsbChangeListener::start()
{ {
// Exposing Window to Mixer // Exposing Window to Mixer
WNDCLASSEX wcx; WNDCLASSEXW wcx;
memset( &wcx, 0, sizeof(WNDCLASSEX) ); memset( &wcx, 0, sizeof(WNDCLASSEXW) );
wcx.cbSize = sizeof(WNDCLASSEX); wcx.cbSize = sizeof(WNDCLASSEXW);
wcx.lpszClassName = mWindowClassName; wcx.lpszClassName = mWindowClassName;
wcx.lpfnWndProc = (WNDPROC)ADRWindowProc; wcx.lpfnWndProc = (WNDPROC)ADRWindowProc;
::RegisterClassEx(&wcx); ::RegisterClassExW(&wcx);
wchar_t windowname[128]; wchar_t windowname[128];
wsprintf(windowname, ADR_WINDOW_NAME, rand()); wsprintfW(windowname, ADR_WINDOW_NAME, rand());
mHiddenWindow = CreateWindow( mWindowClassName, mHiddenWindow = CreateWindowW( mWindowClassName,
windowname, windowname,
WS_POPUP | WS_DISABLED, WS_POPUP | WS_DISABLED,
0, 0, 0, 0, 0, 0, 0, 0,
@ -102,8 +103,8 @@ void UsbChangeListener::stop()
::DestroyWindow(mHiddenWindow); ::DestroyWindow(mHiddenWindow);
mHiddenWindow = NULL; mHiddenWindow = NULL;
::UnregisterClass(mWindowClassName, NULL); ::UnregisterClassW(mWindowClassName, NULL);
} }
} }
#endif #endif