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_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)
message ("Using OpenSSL include files from ${OPENSSL_INCLUDE}")
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()
if (CMAKE_SYSTEM MATCHES "Linux*")
add_definitions(-DTARGET_LINUX)
add_definitions (-DTARGET_LINUX)
endif()
if (CMAKE_SYSTEM MATCHES "Darwin*")
add_definitions(-DTARGET_OSX)
add_definitions (-DTARGET_OSX)
endif()
set (RTPHONE_SOURCES
@ -133,7 +133,7 @@ set (RTPHONE_HEADERS
${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}/ice)
@ -150,7 +150,7 @@ add_subdirectory(${rtphone_engine}/helper)
add_subdirectory(${rtphone_engine}/audio)
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
uuid)
@ -161,7 +161,7 @@ else ()
endif ()
if (USE_AMR_CODEC)
set(LIBS ${LIBS} opencore-amrnb opencore-amrwb)
set (LIBS ${LIBS} opencore-amrnb opencore-amrwb)
endif (USE_AMR_CODEC)
target_link_libraries(rtphone

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -5,10 +5,10 @@ set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
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})
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_Exception.h"
#ifdef TARGET_WIN
#include <devguid.h>
@ -9,7 +10,7 @@
UsbChangeListener::UsbChangeListener()
: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()
@ -30,16 +31,16 @@ UsbChangeListener::Delegate* UsbChangeListener::getDelegate() const
void UsbChangeListener::start()
{
// Exposing Window to Mixer
WNDCLASSEX wcx;
memset( &wcx, 0, sizeof(WNDCLASSEX) );
wcx.cbSize = sizeof(WNDCLASSEX);
wcx.lpszClassName = mWindowClassName;
WNDCLASSEXW wcx;
memset( &wcx, 0, sizeof(WNDCLASSEXW) );
wcx.cbSize = sizeof(WNDCLASSEXW);
wcx.lpszClassName = mWindowClassName;
wcx.lpfnWndProc = (WNDPROC)ADRWindowProc;
::RegisterClassEx(&wcx);
::RegisterClassExW(&wcx);
wchar_t windowname[128];
wsprintf(windowname, ADR_WINDOW_NAME, rand());
mHiddenWindow = CreateWindow( mWindowClassName,
wsprintfW(windowname, ADR_WINDOW_NAME, rand());
mHiddenWindow = CreateWindowW( mWindowClassName,
windowname,
WS_POPUP | WS_DISABLED,
0, 0, 0, 0,
@ -102,7 +103,7 @@ void UsbChangeListener::stop()
::DestroyWindow(mHiddenWindow);
mHiddenWindow = NULL;
::UnregisterClass(mWindowClassName, NULL);
::UnregisterClassW(mWindowClassName, NULL);
}
}