Enable the "unused variable" warning on Windows.
- Break out direct_show_base_classes to its own gyp file to have it
treated as third party code.
- Fix the resulting warnings (courtesy of Tommi).
BUG=
TEST=build on Windows (vie_auto_test currently failing at HEAD)
Review URL: https://webrtc-codereview.appspot.com/489001
git-svn-id: http://webrtc.googlecode.com/svn/trunk@2000 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/src/build/common.gypi b/src/build/common.gypi
index 5e49164..c4526f7 100644
--- a/src/build/common.gypi
+++ b/src/build/common.gypi
@@ -46,13 +46,6 @@
'build_libyuv%': 1,
'conditions': [
- ['OS=="win"', {
- # TODO(andrew, perkj): does this need to be here?
- # Path needed to build Direct Show base classes on Windows.
- # The code is included in the Windows SDK.
- 'direct_show_base_classes':
- 'C:/Program Files/Microsoft SDKs/Windows/v7.1/Samples/multimedia/directshow/baseclasses/',
- }],
['build_with_chromium==1', {
# Exclude pulse audio on Chromium since its prerequisites don't require
# pulse audio.
@@ -146,12 +139,15 @@
'defines': [
'WEBRTC_WIN',
],
- # TODO(andrew): remove this block when possible.
+ # TODO(andrew): enable all warnings when possible.
# 4389: Signed/unsigned mismatch.
# 4373: MSVC legacy warning for ignoring const / volatile in
# signatures. TODO(phoglund): get rid of 4373 supression when
# http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
'msvs_disabled_warnings': [4389, 4373],
+
+ # Re-enable some warnings that Chromium disables.
+ 'msvs_disabled_warnings!': [4189,],
}],
['OS=="android"', {
'defines': [
diff --git a/src/modules/audio_device/main/source/win/audio_device_core_win.cc b/src/modules/audio_device/main/source/win/audio_device_core_win.cc
index d85576d..bbc3692 100644
--- a/src/modules/audio_device/main/source/win/audio_device_core_win.cc
+++ b/src/modules/audio_device/main/source/win/audio_device_core_win.cc
@@ -1888,7 +1888,6 @@
CriticalSectionScoped lock(_critSect);
- HRESULT hr(S_OK);
WebRtc_Word32 ret(-1);
WCHAR szDeviceName[MAX_PATH];
const int bufferLen = sizeof(szDeviceName)/sizeof(szDeviceName)[0];
@@ -1969,7 +1968,6 @@
CriticalSectionScoped lock(_critSect);
- HRESULT hr(S_OK);
WebRtc_Word32 ret(-1);
WCHAR szDeviceName[MAX_PATH];
const int bufferLen = sizeof(szDeviceName)/sizeof(szDeviceName)[0];
@@ -2786,7 +2784,6 @@
return 0;
}
- HRESULT hr = S_OK;
{
CriticalSectionScoped critScoped(_critSect);
@@ -3037,7 +3034,6 @@
return 0;
}
- HRESULT hr = S_OK;
{
CriticalSectionScoped critScoped(_critSect);
@@ -3505,13 +3501,7 @@
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "[REND] device period : %u (%3.2f ms)",
(DWORD)devPeriod, (double)(devPeriod/10000.0));
- // The Event Driven renderer will be woken up every defaultDevicePeriod hundred-nano-seconds.
- // Convert that time into a number of frames.
- //
- double devicePeriodInSeconds = devPeriod / (10000.0*1000.0);
- UINT32 devicePeriodInFrames = static_cast<UINT32>(_playSampleRate * devicePeriodInSeconds + 0.5);
-
- // Derive inital rendering delay.
+ // Derive initial rendering delay.
// Example: 10*(960/480) + 15 = 20 + 15 = 35ms
//
int playout_delay = 10 * (bufferLength / _playBlockSize) +
@@ -3716,7 +3706,6 @@
DWORD AudioDeviceWindowsCore::InitCaptureThreadPriority()
{
- HRESULT hr = S_OK;
_hMmTask = NULL;
_SetThreadName(-1, "webrtc_core_audio_capture_thread");
@@ -3916,7 +3905,6 @@
bool keepRecording = true;
HANDLE waitArray[2] = {_hShutdownCaptureEvent, _hCaptureSamplesReadyEvent};
HRESULT hr = S_OK;
- HANDLE hMmTask = NULL;
LARGE_INTEGER t1;
LARGE_INTEGER t2;
@@ -3925,9 +3913,6 @@
BYTE* syncBuffer = NULL;
UINT32 syncBufIndex = 0;
- WebRtc_UWord32 newMicLevel(0);
- WebRtc_UWord32 currentMicLevel(0);
-
_readSamples = 0;
// Initialize COM as MTA in this thread.
diff --git a/src/modules/audio_device/main/source/win/audio_device_utility_win.cc b/src/modules/audio_device/main/source/win/audio_device_utility_win.cc
index 5a29972..010ef3a 100644
--- a/src/modules/audio_device/main/source/win/audio_device_utility_win.cc
+++ b/src/modules/audio_device/main/source/win/audio_device_utility_win.cc
@@ -77,7 +77,6 @@
char os[STRING_MAX_SIZE];
if (WideCharToMultiByte(CP_UTF8, 0, szOS, -1, os, STRING_MAX_SIZE, NULL, NULL) == 0)
{
- DWORD err = GetLastError();
strncpy(os, "Could not get OS info", STRING_MAX_SIZE);
}
// DEBUG_PRINTP("OS info: %s\n", os);
diff --git a/src/modules/audio_device/main/source/win/audio_mixer_manager_win.cc b/src/modules/audio_device/main/source/win/audio_mixer_manager_win.cc
index c3cf72e..b9b5caa 100644
--- a/src/modules/audio_device/main/source/win/audio_mixer_manager_win.cc
+++ b/src/modules/audio_device/main/source/win/audio_mixer_manager_win.cc
@@ -1161,7 +1161,6 @@
}
const UINT mixerID(_outputMixerID);
- const DWORD dwControlID(_speakerState[_outputMixerID].dwVolumeControlID);
MIXERCONTROL mixerControl;
// Retrieve one control line for a specified volume-control identifier
diff --git a/src/modules/udp_transport/source/udp_socket2_manager_windows.cc b/src/modules/udp_transport/source/udp_socket2_manager_windows.cc
index 8a08057..32863d3 100644
--- a/src/modules/udp_transport/source/udp_socket2_manager_windows.cc
+++ b/src/modules/udp_transport/source/udp_socket2_manager_windows.cc
@@ -131,7 +131,6 @@
_pCrit->Enter();
// Start worker threads.
_stopped = false;
- WebRtc_Word32 i = 0;
WebRtc_Word32 error = 0;
ListItem* pItem = _workerThreadsList.First();
UdpSocket2WorkerWindows* pWorker;
diff --git a/src/modules/udp_transport/source/udp_socket2_windows.cc b/src/modules/udp_transport/source/udp_socket2_windows.cc
index d7a3736..40bd4d2 100644
--- a/src/modules/udp_transport/source/udp_socket2_windows.cc
+++ b/src/modules/udp_transport/source/udp_socket2_windows.cc
@@ -1302,7 +1302,7 @@
{
assert(_outstandingCallsDisabled.Value() == 0);
- const WebRtc_Word32 outstandingCalls = ++_outstandingCalls;
+ ++_outstandingCalls;
return true;
}
diff --git a/src/modules/video_capture/main/source/Windows/device_info_windows.cc b/src/modules/video_capture/main/source/Windows/device_info_windows.cc
index 8df0373..2dcaa24 100644
--- a/src/modules/video_capture/main/source/Windows/device_info_windows.cc
+++ b/src/modules/video_capture/main/source/Windows/device_info_windows.cc
@@ -311,11 +311,10 @@
{
char tempDevicePathUTF8[256];
tempDevicePathUTF8[0] = 0;
- const int compresult =
- WideCharToMultiByte(CP_UTF8, 0, varName.bstrVal, -1,
- tempDevicePathUTF8,
- sizeof(tempDevicePathUTF8), NULL,
- NULL);
+ WideCharToMultiByte(CP_UTF8, 0, varName.bstrVal, -1,
+ tempDevicePathUTF8,
+ sizeof(tempDevicePathUTF8), NULL,
+ NULL);
if (strncmp(tempDevicePathUTF8,
(const char*) deviceUniqueIdUTF8,
deviceUniqueIdUTF8Length) == 0)
@@ -525,7 +524,6 @@
VideoCaptureCapabilityWindows* capability =
new VideoCaptureCapabilityWindows();
WebRtc_Word64 avgTimePerFrame = 0;
- bool interlaced = false;
if (pmt->formattype == FORMAT_VideoInfo)
{
diff --git a/src/modules/video_capture/main/source/Windows/direct_show_base_classes.gyp b/src/modules/video_capture/main/source/Windows/direct_show_base_classes.gyp
new file mode 100644
index 0000000..ae680cc
--- /dev/null
+++ b/src/modules/video_capture/main/source/Windows/direct_show_base_classes.gyp
@@ -0,0 +1,109 @@
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS. All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+
+# This target is broken out into its own gyp file in order to be treated as
+# third party code. (Since src/build/common.gypi is not included,
+# chromium_code is disabled).
+#
+# We can't place this in third_party/ because Chromium parses
+# video_capture.gypi and would fail to find it in the Chromium third_party/.
+{
+ 'targets': [
+ {
+ 'target_name': 'direct_show_base_classes',
+ 'type': 'static_library',
+ 'variables': {
+ # Path needed to build the Direct Show base classes on Windows. The
+ # code is included in the Windows SDK.
+ 'direct_show_dir':
+ 'C:/Program Files/Microsoft SDKs/Windows/v7.1/Samples/multimedia/directshow/baseclasses/',
+ },
+ 'defines!': [
+ 'NOMINMAX',
+ ],
+ 'include_dirs': [
+ '<(direct_show_dir)',
+ ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '<(direct_show_dir)',
+ ],
+ },
+ 'sources': [
+ '<(direct_show_dir)amextra.cpp',
+ '<(direct_show_dir)amextra.h',
+ '<(direct_show_dir)amfilter.cpp',
+ '<(direct_show_dir)amfilter.h',
+ '<(direct_show_dir)amvideo.cpp',
+ '<(direct_show_dir)arithutil.cpp',
+ '<(direct_show_dir)cache.h',
+ '<(direct_show_dir)checkbmi.h',
+ '<(direct_show_dir)combase.cpp',
+ '<(direct_show_dir)combase.h',
+ '<(direct_show_dir)cprop.cpp',
+ '<(direct_show_dir)cprop.h',
+ '<(direct_show_dir)ctlutil.cpp',
+ '<(direct_show_dir)ctlutil.h',
+ '<(direct_show_dir)ddmm.cpp',
+ '<(direct_show_dir)ddmm.h',
+ '<(direct_show_dir)dllentry.cpp',
+ '<(direct_show_dir)dllsetup.cpp',
+ '<(direct_show_dir)dllsetup.h',
+ '<(direct_show_dir)dxmperf.h',
+ '<(direct_show_dir)fourcc.h',
+ '<(direct_show_dir)measure.h',
+ '<(direct_show_dir)msgthrd.h',
+ '<(direct_show_dir)mtype.cpp',
+ '<(direct_show_dir)mtype.h',
+ '<(direct_show_dir)outputq.cpp',
+ '<(direct_show_dir)outputq.h',
+ '<(direct_show_dir)perflog.cpp',
+ '<(direct_show_dir)perflog.h',
+ '<(direct_show_dir)perfstruct.h',
+ '<(direct_show_dir)pstream.cpp',
+ '<(direct_show_dir)pstream.h',
+ '<(direct_show_dir)pullpin.cpp',
+ '<(direct_show_dir)pullpin.h',
+ '<(direct_show_dir)refclock.cpp',
+ '<(direct_show_dir)refclock.h',
+ '<(direct_show_dir)reftime.h',
+ '<(direct_show_dir)renbase.cpp',
+ '<(direct_show_dir)renbase.h',
+ '<(direct_show_dir)schedule.cpp',
+ '<(direct_show_dir)schedule.h',
+ '<(direct_show_dir)seekpt.cpp',
+ '<(direct_show_dir)seekpt.h',
+ '<(direct_show_dir)source.cpp',
+ '<(direct_show_dir)source.h',
+ '<(direct_show_dir)streams.h',
+ '<(direct_show_dir)strmctl.cpp',
+ '<(direct_show_dir)strmctl.h',
+ '<(direct_show_dir)sysclock.cpp',
+ '<(direct_show_dir)sysclock.h',
+ '<(direct_show_dir)transfrm.cpp',
+ '<(direct_show_dir)transfrm.h',
+ '<(direct_show_dir)transip.cpp',
+ '<(direct_show_dir)transip.h',
+ '<(direct_show_dir)videoctl.cpp',
+ '<(direct_show_dir)videoctl.h',
+ '<(direct_show_dir)vtrans.cpp',
+ '<(direct_show_dir)vtrans.h',
+ '<(direct_show_dir)winctrl.cpp',
+ '<(direct_show_dir)winctrl.h',
+ '<(direct_show_dir)winutil.cpp',
+ '<(direct_show_dir)winutil.h',
+ '<(direct_show_dir)wxdebug.cpp',
+ '<(direct_show_dir)wxdebug.h',
+ '<(direct_show_dir)wxlist.cpp',
+ '<(direct_show_dir)wxlist.h',
+ '<(direct_show_dir)wxutil.cpp',
+ '<(direct_show_dir)wxutil.h',
+ ],
+ },
+ ],
+}
diff --git a/src/modules/video_capture/main/source/Windows/help_functions_windows.cc b/src/modules/video_capture/main/source/Windows/help_functions_windows.cc
index dd533a3..405a53d 100644
--- a/src/modules/video_capture/main/source/Windows/help_functions_windows.cc
+++ b/src/modules/video_capture/main/source/Windows/help_functions_windows.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
+ * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@@ -40,7 +40,6 @@
// get first unconnected pin
hr = pPinEnum->Reset(); // set to first pin
- int count = 0;
while (S_OK == pPinEnum->Next(1, &pin, NULL))
{
PIN_DIRECTION pPinDir;
@@ -72,7 +71,6 @@
}
// get first unconnected pin
hr = pPinEnum->Reset(); // set to first pin
- int count = 0;
while (S_OK == pPinEnum->Next(1, &pin, NULL))
{
PIN_DIRECTION pPinDir;
diff --git a/src/modules/video_capture/main/source/Windows/sink_filter_windows.cc b/src/modules/video_capture/main/source/Windows/sink_filter_windows.cc
index 88e47a0..91213c0 100644
--- a/src/modules/video_capture/main/source/Windows/sink_filter_windows.cc
+++ b/src/modules/video_capture/main/source/Windows/sink_filter_windows.cc
@@ -412,7 +412,6 @@
STDMETHODIMP CaptureSinkFilter::Pause()
{
- HRESULT hr = S_OK;
LockFilter();
if (m_State == State_Stopped)
{
diff --git a/src/modules/video_capture/main/source/Windows/video_capture_windows.cc b/src/modules/video_capture/main/source/Windows/video_capture_windows.cc
index 20ebe98..d347734 100644
--- a/src/modules/video_capture/main/source/Windows/video_capture_windows.cc
+++ b/src/modules/video_capture/main/source/Windows/video_capture_windows.cc
@@ -62,8 +62,6 @@
WebRtc_Word32 VideoCaptureDS::Init(const WebRtc_Word32 id,
const char* deviceUniqueIdUTF8)
{
- WebRtc_Word32 result = 0;
-
const WebRtc_Word32 nameLength =
(WebRtc_Word32) strlen((char*) deviceUniqueIdUTF8);
if (nameLength > kVideoCaptureUniqueNameLength)
diff --git a/src/modules/video_capture/main/source/video_capture.gypi b/src/modules/video_capture/main/source/video_capture.gypi
index 99a4937..d338af6 100644
--- a/src/modules/video_capture/main/source/video_capture.gypi
+++ b/src/modules/video_capture/main/source/video_capture.gypi
@@ -1,4 +1,4 @@
-# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
@@ -13,7 +13,7 @@
'type': '<(library)',
'dependencies': [
'webrtc_utility',
- '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
+ '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
],
'include_dirs': [
@@ -91,12 +91,11 @@
},
}], # mac
['OS=="win"', {
+ 'dependencies': [
+ '<(webrtc_root)/modules/video_capture/main/source/Windows/direct_show_base_classes.gyp:direct_show_base_classes',
+ ],
'include_dirs': [
'Windows',
- '<(direct_show_base_classes)',
- ],
- 'defines!': [
- 'NOMINMAX',
],
'sources': [
'Windows/help_functions_windows.h',
@@ -109,74 +108,6 @@
'Windows/video_capture_windows.cc',
'Windows/device_info_windows.cc',
'Windows/video_capture_factory_windows.cc',
- '<(direct_show_base_classes)amextra.cpp',
- '<(direct_show_base_classes)amextra.h',
- '<(direct_show_base_classes)amfilter.cpp',
- '<(direct_show_base_classes)amfilter.h',
- '<(direct_show_base_classes)amvideo.cpp',
- '<(direct_show_base_classes)arithutil.cpp',
- '<(direct_show_base_classes)cache.h',
- '<(direct_show_base_classes)checkbmi.h',
- '<(direct_show_base_classes)combase.cpp',
- '<(direct_show_base_classes)combase.h',
- '<(direct_show_base_classes)cprop.cpp',
- '<(direct_show_base_classes)cprop.h',
- '<(direct_show_base_classes)ctlutil.cpp',
- '<(direct_show_base_classes)ctlutil.h',
- '<(direct_show_base_classes)ddmm.cpp',
- '<(direct_show_base_classes)ddmm.h',
- '<(direct_show_base_classes)dllentry.cpp',
- '<(direct_show_base_classes)dllsetup.cpp',
- '<(direct_show_base_classes)dllsetup.h',
- '<(direct_show_base_classes)dxmperf.h',
- '<(direct_show_base_classes)fourcc.h',
- '<(direct_show_base_classes)measure.h',
- '<(direct_show_base_classes)msgthrd.h',
- '<(direct_show_base_classes)mtype.cpp',
- '<(direct_show_base_classes)mtype.h',
- '<(direct_show_base_classes)outputq.cpp',
- '<(direct_show_base_classes)outputq.h',
- '<(direct_show_base_classes)perflog.cpp',
- '<(direct_show_base_classes)perflog.h',
- '<(direct_show_base_classes)perfstruct.h',
- '<(direct_show_base_classes)pstream.cpp',
- '<(direct_show_base_classes)pstream.h',
- '<(direct_show_base_classes)pullpin.cpp',
- '<(direct_show_base_classes)pullpin.h',
- '<(direct_show_base_classes)refclock.cpp',
- '<(direct_show_base_classes)refclock.h',
- '<(direct_show_base_classes)reftime.h',
- '<(direct_show_base_classes)renbase.cpp',
- '<(direct_show_base_classes)renbase.h',
- '<(direct_show_base_classes)schedule.cpp',
- '<(direct_show_base_classes)schedule.h',
- '<(direct_show_base_classes)seekpt.cpp',
- '<(direct_show_base_classes)seekpt.h',
- '<(direct_show_base_classes)source.cpp',
- '<(direct_show_base_classes)source.h',
- '<(direct_show_base_classes)streams.h',
- '<(direct_show_base_classes)strmctl.cpp',
- '<(direct_show_base_classes)strmctl.h',
- '<(direct_show_base_classes)sysclock.cpp',
- '<(direct_show_base_classes)sysclock.h',
- '<(direct_show_base_classes)transfrm.cpp',
- '<(direct_show_base_classes)transfrm.h',
- '<(direct_show_base_classes)transip.cpp',
- '<(direct_show_base_classes)transip.h',
- '<(direct_show_base_classes)videoctl.cpp',
- '<(direct_show_base_classes)videoctl.h',
- '<(direct_show_base_classes)vtrans.cpp',
- '<(direct_show_base_classes)vtrans.h',
- '<(direct_show_base_classes)winctrl.cpp',
- '<(direct_show_base_classes)winctrl.h',
- '<(direct_show_base_classes)winutil.cpp',
- '<(direct_show_base_classes)winutil.h',
- '<(direct_show_base_classes)wxdebug.cpp',
- '<(direct_show_base_classes)wxdebug.h',
- '<(direct_show_base_classes)wxlist.cpp',
- '<(direct_show_base_classes)wxlist.h',
- '<(direct_show_base_classes)wxutil.cpp',
- '<(direct_show_base_classes)wxutil.h',
],
'msvs_settings': {
'VCLibrarianTool': {
diff --git a/src/modules/video_render/main/source/windows/video_render_direct3d9.cc b/src/modules/video_render/main/source/windows/video_render_direct3d9.cc
index 7e2509d..faddeb7 100644
--- a/src/modules/video_render/main/source/windows/video_render_direct3d9.cc
+++ b/src/modules/video_render/main/source/windows/video_render_direct3d9.cc
@@ -701,8 +701,6 @@
for (DWORD x = 0; x < width; x)
{
- DWORD a = (DWORD) 0;
-
DWORD temp = ((DWORD*) lr.pBits)[dwOffset + x];
if ((temp & 0x00FFFFFF)
== transparentColorKey->dwColorSpaceLowValue)
@@ -844,7 +842,6 @@
std::map<int, D3D9Channel*>::iterator ddIt;
ddIt = _d3dChannels.find(streamId & 0x0000ffff);
- D3D9Channel* ddobj = NULL;
if (ddIt != _d3dChannels.end())
{
delete ddIt->second;
diff --git a/src/modules/video_render/main/source/windows/video_render_directdraw.cc b/src/modules/video_render/main/source/windows/video_render_directdraw.cc
index 5f512e3..aad2277 100644
--- a/src/modules/video_render/main/source/windows/video_render_directdraw.cc
+++ b/src/modules/video_render/main/source/windows/video_render_directdraw.cc
@@ -3024,7 +3024,6 @@
{
if (it->second)
{
- int channel = it->first;
_frameChanged = it->second->IsOffScreenSurfaceUpdated(this);
}
it++;
diff --git a/src/modules/video_render/main/source/windows/video_render_windows_impl.cc b/src/modules/video_render/main/source/windows/video_render_windows_impl.cc
index cdc74bb..7a7bd80 100644
--- a/src/modules/video_render/main/source/windows/video_render_windows_impl.cc
+++ b/src/modules/video_render/main/source/windows/video_render_windows_impl.cc
@@ -501,7 +501,6 @@
DWORD nInstanceCount = 0;
DWORD nItem = 0;
- DWORD nCurCount = 0;
// Get the IDxDiagContainer object called "DxDiag_DisplayDevices".
// This call may take some time while dxdiag gathers the info.
@@ -868,7 +867,6 @@
// Read the registry to check if HW acceleration is enabled or not.
HKEY regKey;
DWORD value = 0;
- DWORD valueLength = 4;
//Assume the best
badDriver = false;
@@ -883,7 +881,6 @@
DWORD driverPathLen = 512;
TCHAR driverPath[512];
memset(driverPath, 0, driverPathLen * sizeof(TCHAR));
- DWORD dwType = REG_SZ;
long retVal = RegQueryValueEx(regKey, _T("\\Device\\Video0"), NULL,
NULL, (BYTE*) driverPath, &driverPathLen);
diff --git a/src/modules/video_render/main/test/testAPI/testAPI.cc b/src/modules/video_render/main/test/testAPI/testAPI.cc
index 9eb653e..7874808 100644
--- a/src/modules/video_render/main/test/testAPI/testAPI.cc
+++ b/src/modules/video_render/main/test/testAPI/testAPI.cc
@@ -163,10 +163,7 @@
NULL); // no window creation data
if (!hwndMain)
- {
- int error = GetLastError();
return -1;
- }
// Show the window using the flag specified by the program
// that started the application, and send the application
diff --git a/src/system_wrappers/interface/static_instance.h b/src/system_wrappers/interface/static_instance.h
index 8fe91cc..b670f96 100644
--- a/src/system_wrappers/interface/static_instance.h
+++ b/src/system_wrappers/interface/static_instance.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
+ * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@@ -128,10 +128,8 @@
// local copy.
T* new_instance = T::CreateInstance();
if (1 == InterlockedIncrement(&instance_count)) {
- T* old_value = static_cast<T*> (InterlockedExchangePointer(
- reinterpret_cast<void* volatile*>(&instance), new_instance));
- assert(old_value == NULL);
- assert(instance);
+ InterlockedExchangePointer(reinterpret_cast<void* volatile*>(&instance),
+ new_instance);
} else {
InterlockedDecrement(&instance_count);
if (new_instance) {
diff --git a/src/system_wrappers/source/cpu_win.cc b/src/system_wrappers/source/cpu_win.cc
index 5792023..86a6a6a 100644
--- a/src/system_wrappers/source/cpu_win.cc
+++ b/src/system_wrappers/source/cpu_win.cc
@@ -85,8 +85,7 @@
CpuWindows::~CpuWindows()
{
// All resources are reclaimed in StopPollingCpu().
- const bool success = StopPollingCpu();
- assert(success);
+ StopPollingCpu();
DeAllocateComplexDataTypes();
}
@@ -189,8 +188,7 @@
CriticalSectionScoped cs(terminate_crit_);
if (terminate_)
{
- const bool success = Terminate();
- assert(success);
+ Terminate();
terminate_cond_->WakeAll();
return false;
}
@@ -220,10 +218,8 @@
}
// UpdateCpuUsage() returns false if a single (or more) CPU read(s) failed.
- // Not a major problem if it happens but make sure it doesnt trigger in
- // debug.
- const bool success = UpdateCpuUsage();
- assert(success);
+ // Not a major problem if it happens.
+ UpdateCpuUsage();
return true;
}
diff --git a/src/system_wrappers/source/trace_win.cc b/src/system_wrappers/source/trace_win.cc
index db3da76..f81ed8b 100644
--- a/src/system_wrappers/source/trace_win.cc
+++ b/src/system_wrappers/source/trace_win.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
+ * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@@ -113,8 +113,6 @@
TCHAR szDateStr[20];
TCHAR szTimeStr[20];
- TCHAR *pSzDateStr = szDateStr;
- TCHAR *pSzTimeStr = szTimeStr;
// Create date string (e.g. Apr 04 2002)
GetDateFormat(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, TEXT("MMM dd yyyy"),
diff --git a/src/video_engine/main/test/WindowsTest/ChannelDlg.cc b/src/video_engine/main/test/WindowsTest/ChannelDlg.cc
index 026cab7..945f34e 100644
--- a/src/video_engine/main/test/WindowsTest/ChannelDlg.cc
+++ b/src/video_engine/main/test/WindowsTest/ChannelDlg.cc
@@ -67,7 +67,7 @@
void* voiceEngine
,CWnd* pParent,CDXChannelDlgObserver* observer,
int parentChannel/*=-1*/)
- : CDialog(CDXChannelDlg::IDD, pParent),
+ : CDialog(CDXChannelDlg::IDD, pParent),
_canAddLog(true),
_dialogObserver(observer),
_videoEngine(videoEngine),
@@ -81,85 +81,80 @@
_externalTransport(NULL)
{
strcpy(_logMsg,"");
- _channelId = -1;
+ _channelId = -1;
_audioChannel=-1;
_captureId=-1;
- //_transport = NULL;
-
-
- //{{AFX_DATA_INIT(CDXChannelDlg)
- //}}AFX_DATA_INIT
- // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
+ //{{AFX_DATA_INIT(CDXChannelDlg)
+ //}}AFX_DATA_INIT
+ // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
InitializeCriticalSection(&_critCallback);
unsigned int threadID;
_callbackThread=(HANDLE)_beginthreadex(NULL,1024*1024,CallbackThread,(void*)this,0, &threadID);
-
-
}
void CDXChannelDlg::DoDataExchange(CDataExchange* pDX)
{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CDXChannelDlg)
- DDX_Control(pDX, IDC_DEVICE, m_ctrlDevice);
- DDX_Control(pDX, IDC_CODEC_LIST, m_ctrlCodec);
- DDX_Control(pDX, IDC_CAPTURE, m_ctrlLiveRemoteVideo);
- DDX_Control(pDX, IDC_LIVEVIDEO, m_ctrlLiveVideo);
- DDX_Control(pDX, IDC_LOCAL_PORT1, m_localPort1);
- DDX_Control(pDX, IDC_REMOTE_PORT1, m_remotePort1);
- DDX_Control(pDX, IDC_IPADDRESS1, m_remoteIp1);
- DDX_Control(pDX, IDC_CODEC_SIZE, m_ctrlCodecSize);
- DDX_Control(pDX, IDC_RTCPMODE, m_ctrlRtcpMode);
- DDX_Control(pDX, IDC_PACKETBURST, m_ctrlPacketBurst);
- DDX_Control(pDX, IDC_BITRATE, m_ctrlBitrate);
- DDX_Control(pDX, IDC_MIN_FRAME_RATE, m_ctrlMinFrameRate);
- DDX_Control(pDX, IDC_TMMBR,m_cbTmmbr);
- DDX_Control(pDX, IDC_EXTTRANSPORT,m_cbExternalTransport);
- DDX_Control(pDX, IDC_PACKETLOSS,m_ctrlPacketLoss);
- DDX_Control(pDX, IDC_DELAY,m_ctrlDelay);
- DDX_Control(pDX, IDC_FREEZELOG,m_cbFreezeLog);
- DDX_Control(pDX,IDC_INFORMATION,m_ctrlInfo);
- //}}AFX_DATA_MAP
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CDXChannelDlg)
+ DDX_Control(pDX, IDC_DEVICE, m_ctrlDevice);
+ DDX_Control(pDX, IDC_CODEC_LIST, m_ctrlCodec);
+ DDX_Control(pDX, IDC_CAPTURE, m_ctrlLiveRemoteVideo);
+ DDX_Control(pDX, IDC_LIVEVIDEO, m_ctrlLiveVideo);
+ DDX_Control(pDX, IDC_LOCAL_PORT1, m_localPort1);
+ DDX_Control(pDX, IDC_REMOTE_PORT1, m_remotePort1);
+ DDX_Control(pDX, IDC_IPADDRESS1, m_remoteIp1);
+ DDX_Control(pDX, IDC_CODEC_SIZE, m_ctrlCodecSize);
+ DDX_Control(pDX, IDC_RTCPMODE, m_ctrlRtcpMode);
+ DDX_Control(pDX, IDC_PACKETBURST, m_ctrlPacketBurst);
+ DDX_Control(pDX, IDC_BITRATE, m_ctrlBitrate);
+ DDX_Control(pDX, IDC_MIN_FRAME_RATE, m_ctrlMinFrameRate);
+ DDX_Control(pDX, IDC_TMMBR,m_cbTmmbr);
+ DDX_Control(pDX, IDC_EXTTRANSPORT,m_cbExternalTransport);
+ DDX_Control(pDX, IDC_PACKETLOSS,m_ctrlPacketLoss);
+ DDX_Control(pDX, IDC_DELAY,m_ctrlDelay);
+ DDX_Control(pDX, IDC_FREEZELOG,m_cbFreezeLog);
+ DDX_Control(pDX,IDC_INFORMATION,m_ctrlInfo);
+ //}}AFX_DATA_MAP
}
-// ON_WM_SYSKEYDOWN ALT+key
+// ON_WM_SYSKEYDOWN ALT+key
BEGIN_MESSAGE_MAP(CDXChannelDlg, CDialog)
- //{{AFX_MSG_MAP(CDXChannelDlg)
- ON_WM_SYSCOMMAND()
- ON_WM_RBUTTONUP()
- //ON_WM_DEVICECHANGE()
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- ON_BN_CLICKED(IDC_STARTSEND, OnStartSend)
- ON_BN_CLICKED(IDC_STOPSend, OnStopSend)
- //ON_WM_TIMER()
- ON_WM_DESTROY()
- //}}AFX_MSG_MAP
- ON_CBN_SELCHANGE(IDC_CODEC_LIST, OnCbnSelchangeCodecList)
- ON_CBN_SELCHANGE(IDC_DEVICE, OnCbnSelchangeDevice)
- ON_CBN_SELCHANGE(IDC_CODEC_SIZE, OnCbnSelchangeSize)
- ON_CBN_SELCHANGE(IDC_BITRATE, OnCbnSelchangeBitrate)
- //ON_MESSAGE(WM_DISPLAYCHANGE, OnDisplayChange)
- ON_CBN_SELCHANGE(IDC_MIN_FRAME_RATE, OnCbnSelchangeMinFrameRate)
- ON_BN_CLICKED(IDC_STARTLISTEN, OnBnClickedStartlisten)
- ON_BN_CLICKED(IDC_STOPLISTEN, OnBnClickedStoplisten)
- ON_BN_CLICKED(IDC_TMMBR, &CDXChannelDlg::OnBnClickedTmmbr)
- ON_CBN_SELCHANGE(IDC_RTCPMODE, &CDXChannelDlg::OnCbnSelchangeRtcpmode)
- ON_BN_CLICKED(IDC_PROT_NACK, &CDXChannelDlg::OnBnClickedProtNack)
- ON_BN_CLICKED(IDC_PROT_NONE, &CDXChannelDlg::OnBnClickedProtNone)
- ON_BN_CLICKED(IDC_PROT_FEC, &CDXChannelDlg::OnBnClickedProtFec)
- ON_BN_CLICKED(IDC_FREEZELOG, &CDXChannelDlg::OnBnClickedFreezelog)
- ON_BN_CLICKED(IDC_VERSION, &CDXChannelDlg::OnBnClickedVersion)
- ON_BN_CLICKED(IDC_EXTTRANSPORT, &CDXChannelDlg::OnBnClickedExttransport)
- ON_CBN_SELCHANGE(IDC_PACKETLOSS, &CDXChannelDlg::OnCbnSelchangePacketloss)
- ON_CBN_SELCHANGE(IDC_DELAY, &CDXChannelDlg::OnCbnSelchangeDelay)
- ON_BN_CLICKED(IDC_BTN_RECORD_INCOMING, &CDXChannelDlg::OnBnClickedBtnRecordIncoming)
- ON_BN_CLICKED(IDC_BTN_RECORD_OUTGOING, &CDXChannelDlg::OnBnClickedBtnRecordOutgoing)
- ON_BN_CLICKED(IDC_BTN_CREATE_SLAVE, &CDXChannelDlg::OnBnClickedBtnCreateSlave)
- ON_BN_CLICKED(IDC_PROT_NACKFEC, &CDXChannelDlg::OnBnClickedProtNackFec)
+ //{{AFX_MSG_MAP(CDXChannelDlg)
+ ON_WM_SYSCOMMAND()
+ ON_WM_RBUTTONUP()
+ //ON_WM_DEVICECHANGE()
+ ON_WM_PAINT()
+ ON_WM_QUERYDRAGICON()
+ ON_BN_CLICKED(IDC_STARTSEND, OnStartSend)
+ ON_BN_CLICKED(IDC_STOPSend, OnStopSend)
+ //ON_WM_TIMER()
+ ON_WM_DESTROY()
+ //}}AFX_MSG_MAP
+ ON_CBN_SELCHANGE(IDC_CODEC_LIST, OnCbnSelchangeCodecList)
+ ON_CBN_SELCHANGE(IDC_DEVICE, OnCbnSelchangeDevice)
+ ON_CBN_SELCHANGE(IDC_CODEC_SIZE, OnCbnSelchangeSize)
+ ON_CBN_SELCHANGE(IDC_BITRATE, OnCbnSelchangeBitrate)
+ //ON_MESSAGE(WM_DISPLAYCHANGE, OnDisplayChange)
+ ON_CBN_SELCHANGE(IDC_MIN_FRAME_RATE, OnCbnSelchangeMinFrameRate)
+ ON_BN_CLICKED(IDC_STARTLISTEN, OnBnClickedStartlisten)
+ ON_BN_CLICKED(IDC_STOPLISTEN, OnBnClickedStoplisten)
+ ON_BN_CLICKED(IDC_TMMBR, &CDXChannelDlg::OnBnClickedTmmbr)
+ ON_CBN_SELCHANGE(IDC_RTCPMODE, &CDXChannelDlg::OnCbnSelchangeRtcpmode)
+ ON_BN_CLICKED(IDC_PROT_NACK, &CDXChannelDlg::OnBnClickedProtNack)
+ ON_BN_CLICKED(IDC_PROT_NONE, &CDXChannelDlg::OnBnClickedProtNone)
+ ON_BN_CLICKED(IDC_PROT_FEC, &CDXChannelDlg::OnBnClickedProtFec)
+ ON_BN_CLICKED(IDC_FREEZELOG, &CDXChannelDlg::OnBnClickedFreezelog)
+ ON_BN_CLICKED(IDC_VERSION, &CDXChannelDlg::OnBnClickedVersion)
+ ON_BN_CLICKED(IDC_EXTTRANSPORT, &CDXChannelDlg::OnBnClickedExttransport)
+ ON_CBN_SELCHANGE(IDC_PACKETLOSS, &CDXChannelDlg::OnCbnSelchangePacketloss)
+ ON_CBN_SELCHANGE(IDC_DELAY, &CDXChannelDlg::OnCbnSelchangeDelay)
+ ON_BN_CLICKED(IDC_BTN_RECORD_INCOMING, &CDXChannelDlg::OnBnClickedBtnRecordIncoming)
+ ON_BN_CLICKED(IDC_BTN_RECORD_OUTGOING, &CDXChannelDlg::OnBnClickedBtnRecordOutgoing)
+ ON_BN_CLICKED(IDC_BTN_CREATE_SLAVE, &CDXChannelDlg::OnBnClickedBtnCreateSlave)
+ ON_BN_CLICKED(IDC_PROT_NACKFEC, &CDXChannelDlg::OnBnClickedProtNackFec)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
@@ -168,312 +163,301 @@
BOOL CDXChannelDlg::OnInitDialog()
{
- CDialog::OnInitDialog();
+ CDialog::OnInitDialog();
- // Set the icon for this dialog. The framework does this automatically
- // when the application's main window is not a dialog
- SetIcon(m_hIcon, TRUE); // Set big icon
- SetIcon(m_hIcon, FALSE); // Set small icon
+ // Set the icon for this dialog. The framework does this automatically
+ // when the application's main window is not a dialog
+ SetIcon(m_hIcon, TRUE); // Set big icon
+ SetIcon(m_hIcon, FALSE); // Set small icon
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("5"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("6"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("7"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("8"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("9"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("10"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("11"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("12"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("13"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("14"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("15"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("16"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("17"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("18"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("19"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("20"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("21"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("22"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("23"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("24"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("25"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("26"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("27"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("28"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("29"));
- ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("30"));
- m_ctrlMinFrameRate.SetCurSel(25);
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("5"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("6"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("7"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("8"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("9"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("10"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("11"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("12"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("13"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("14"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("15"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("16"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("17"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("18"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("19"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("20"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("21"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("22"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("23"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("24"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("25"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("26"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("27"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("28"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("29"));
+ ::SendMessage(m_ctrlMinFrameRate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("30"));
+ m_ctrlMinFrameRate.SetCurSel(25);
- // Codec sizes
- for(VideoSize i=UNDEFINED;i<NUMBER_OF_VIDEO_SIZE;i=VideoSize(i+1))
- {
- char sizeStr[64];
- int width=0;
- int height=0;
- GetWidthHeight(i,width,height);
- sprintf(sizeStr,"%d x %d",width,height);
- ::SendMessage(m_ctrlCodecSize.m_hWnd, CB_ADDSTRING, 0,(LPARAM) CharToTchar(sizeStr,-1));
- }
- m_ctrlCodecSize.SetCurSel(8);
+ // Codec sizes
+ for(VideoSize i=UNDEFINED;i<NUMBER_OF_VIDEO_SIZE;i=VideoSize(i+1))
+ {
+ char sizeStr[64];
+ int width=0;
+ int height=0;
+ GetWidthHeight(i,width,height);
+ sprintf(sizeStr,"%d x %d",width,height);
+ ::SendMessage(m_ctrlCodecSize.m_hWnd, CB_ADDSTRING, 0,(LPARAM) CharToTchar(sizeStr,-1));
+ }
+ m_ctrlCodecSize.SetCurSel(8);
- // RTCP mode
- /*
- kRtcpNone = 0,
- kRtcpCompound_RFC4585 = 1,
- kRtcpNonCompound_RFC5506 = 2 */
- ::SendMessage(m_ctrlRtcpMode.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("RTCP_NONE"));
- ::SendMessage(m_ctrlRtcpMode.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("RTCP_COMPOUND_RFC4585"));
- ::SendMessage(m_ctrlRtcpMode.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("RTCP_NON_COMPOUND_RFC5506"));
- m_ctrlRtcpMode.SetCurSel(2);
+ // RTCP mode
+ /*
+ kRtcpNone = 0,
+ kRtcpCompound_RFC4585 = 1,
+ kRtcpNonCompound_RFC5506 = 2 */
+ ::SendMessage(m_ctrlRtcpMode.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("RTCP_NONE"));
+ ::SendMessage(m_ctrlRtcpMode.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("RTCP_COMPOUND_RFC4585"));
+ ::SendMessage(m_ctrlRtcpMode.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("RTCP_NON_COMPOUND_RFC5506"));
+ m_ctrlRtcpMode.SetCurSel(2);
- //Packet Burst
- ::SendMessage(m_ctrlPacketBurst.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("0"));
- ::SendMessage(m_ctrlPacketBurst.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("10"));
- ::SendMessage(m_ctrlPacketBurst.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("20"));
- ::SendMessage(m_ctrlPacketBurst.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("30"));
- m_ctrlPacketBurst.SetCurSel(0);
+ //Packet Burst
+ ::SendMessage(m_ctrlPacketBurst.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("0"));
+ ::SendMessage(m_ctrlPacketBurst.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("10"));
+ ::SendMessage(m_ctrlPacketBurst.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("20"));
+ ::SendMessage(m_ctrlPacketBurst.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("30"));
+ m_ctrlPacketBurst.SetCurSel(0);
- //Send Bitrate
- ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("50"));
- ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("100"));
- ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("200"));
- ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("300"));
- ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("500"));
- ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("1000"));
- ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("2000"));
- ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("3000"));
- ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("4000"));
- ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("5000"));
- ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("6000"));
- ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("7000"));
+ //Send Bitrate
+ ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("50"));
+ ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("100"));
+ ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("200"));
+ ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("300"));
+ ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("500"));
+ ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("1000"));
+ ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("2000"));
+ ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("3000"));
+ ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("4000"));
+ ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("5000"));
+ ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("6000"));
+ ::SendMessage(m_ctrlBitrate.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("7000"));
- m_ctrlBitrate.SetCurSel(3);
+ m_ctrlBitrate.SetCurSel(3);
- // External transport packet loss
- ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("0"));
- ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("2"));
- ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("4"));
- ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("6"));
- ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("8"));
- ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("10"));
- ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("12"));
- ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("14"));
- ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("16"));
- ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("18"));
- ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("20"));
- m_ctrlPacketLoss.SetCurSel(0);
+ // External transport packet loss
+ ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("0"));
+ ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("2"));
+ ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("4"));
+ ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("6"));
+ ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("8"));
+ ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("10"));
+ ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("12"));
+ ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("14"));
+ ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("16"));
+ ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("18"));
+ ::SendMessage(m_ctrlPacketLoss.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("20"));
+ m_ctrlPacketLoss.SetCurSel(0);
- // External transport delay
- ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("0"));
- ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("30"));
- ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("60"));
- ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("90"));
- ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("120"));
- ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("150"));
- ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("180"));
- ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("210"));
- m_ctrlDelay.SetCurSel(0);
+ // External transport delay
+ ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("0"));
+ ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("30"));
+ ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("60"));
+ ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("90"));
+ ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("120"));
+ ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("150"));
+ ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("180"));
+ ::SendMessage(m_ctrlDelay.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("210"));
+ m_ctrlDelay.SetCurSel(0);
+ _vieBase=ViEBase::GetInterface(_videoEngine);
+ TEST_MUSTPASS(_vieBase==0,-5);
- _vieBase=ViEBase::GetInterface(_videoEngine);
- TEST_MUSTPASS(_vieBase==0,-5);
+ _vieCapture=ViECapture::GetInterface(_videoEngine);
+ TEST_MUSTPASS(_vieCapture==0,-5);
- _vieCapture=ViECapture::GetInterface(_videoEngine);
- TEST_MUSTPASS(_vieCapture==0,-5);
+ _vieRTPRTCP=ViERTP_RTCP::GetInterface(_videoEngine);
+ TEST_MUSTPASS(_vieRTPRTCP==0,-5);
- _vieRTPRTCP=ViERTP_RTCP::GetInterface(_videoEngine);
- TEST_MUSTPASS(_vieRTPRTCP==0,-5);
+ _vieRender=ViERender::GetInterface(_videoEngine);
+ TEST_MUSTPASS(_vieRender==0,-5);
- _vieRender=ViERender::GetInterface(_videoEngine);
- TEST_MUSTPASS(_vieRender==0,-5);
+ _vieCodec=ViECodec::GetInterface(_videoEngine);
+ TEST_MUSTPASS(_vieCodec==0,-5);
+ _vieNetwork=ViENetwork::GetInterface(_videoEngine);
+ TEST_MUSTPASS(_vieNetwork==0,-5);
- _vieCodec=ViECodec::GetInterface(_videoEngine);
- TEST_MUSTPASS(_vieCodec==0,-5);
- _vieNetwork=ViENetwork::GetInterface(_videoEngine);
- TEST_MUSTPASS(_vieNetwork==0,-5);
-
- _vieFile=ViEFile::GetInterface(_videoEngine);
- TEST_MUSTPASS(_vieFile==0,-5);
+ _vieFile=ViEFile::GetInterface(_videoEngine);
+ TEST_MUSTPASS(_vieFile==0,-5);
#ifndef NO_VOICE_ENGINE
- _veBase = VoEBase::GetInterface(_voiceEngine);
- _veNetwork = VoENetwork::GetInterface(_voiceEngine);
- _veCodec = VoECodec::GetInterface(_voiceEngine);
- _veRTCP = VoERTP_RTCP::GetInterface(_voiceEngine);
- TEST_MUSTPASS(_vieBase->SetVoiceEngine(_voiceEngine),-5);
+ _veBase = VoEBase::GetInterface(_voiceEngine);
+ _veNetwork = VoENetwork::GetInterface(_voiceEngine);
+ _veCodec = VoECodec::GetInterface(_voiceEngine);
+ _veRTCP = VoERTP_RTCP::GetInterface(_voiceEngine);
+ TEST_MUSTPASS(_vieBase->SetVoiceEngine(_voiceEngine),-5);
#endif
- int err = 0;
+ char str[64];
+ bool found = false;
- char str[64];
- bool found = false;
-
-
- int captureIdx = 0;
- while (-1 !=_vieCapture->GetCaptureDevice(captureIdx,str,sizeof(str),NULL,0))
- {
- char* tmp = strstr(str,"(VFW)");
- if (!tmp)
- {
- ::SendMessage(m_ctrlDevice.m_hWnd, CB_ADDSTRING, 0,(LPARAM)CharToTchar(str,-1));
- found = true;
- }
- captureIdx++;
- memset(str, 0, 64);
- }
- WIN32_FIND_DATA FindFileData;
- HANDLE hFind;
- //char fileSearch[256];
- //strcpy(fileSearch,_T("*.avi"));
- hFind = FindFirstFile(_T("*.avi"), &FindFileData);
- if (hFind != INVALID_HANDLE_VALUE)
+ int captureIdx = 0;
+ while (-1 !=_vieCapture->GetCaptureDevice(captureIdx,str,sizeof(str),NULL,0))
+ {
+ char* tmp = strstr(str,"(VFW)");
+ if (!tmp)
{
-
- ::SendMessage(m_ctrlDevice.m_hWnd, CB_ADDSTRING, 0,(LPARAM)(FindFileData.cFileName));
- while(FindNextFile(hFind,&FindFileData))
- {
- ::SendMessage(m_ctrlDevice.m_hWnd, CB_ADDSTRING, 0,(LPARAM)(FindFileData.cFileName));
- }
- FindClose(hFind);
+ ::SendMessage(m_ctrlDevice.m_hWnd, CB_ADDSTRING, 0,(LPARAM)CharToTchar(str,-1));
+ found = true;
}
+ captureIdx++;
+ memset(str, 0, 64);
+ }
+ WIN32_FIND_DATA FindFileData;
+ HANDLE hFind;
+ //char fileSearch[256];
+ //strcpy(fileSearch,_T("*.avi"));
+ hFind = FindFirstFile(_T("*.avi"), &FindFileData);
+ if (hFind != INVALID_HANDLE_VALUE)
+ {
+ ::SendMessage(m_ctrlDevice.m_hWnd, CB_ADDSTRING, 0,(LPARAM)(FindFileData.cFileName));
+ while(FindNextFile(hFind,&FindFileData))
+ {
+ ::SendMessage(m_ctrlDevice.m_hWnd, CB_ADDSTRING, 0,(LPARAM)(FindFileData.cFileName));
+ }
+ FindClose(hFind);
+ }
+ ::SendMessage(m_ctrlDevice.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("Conference"));
+ ::SendMessage(m_ctrlDevice.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("None"));
+ if (!found)
+ {
+ strncpy(str,"N/A",64);
+ ::SendMessage(m_ctrlDevice.m_hWnd, CB_ADDSTRING, 0,(LPARAM)CharToTchar(str,-1));
+ }
+ m_ctrlDevice.SetCurSel(0);
- ::SendMessage(m_ctrlDevice.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("Conference"));
- ::SendMessage(m_ctrlDevice.m_hWnd, CB_ADDSTRING, 0,(LPARAM)_T("None"));
-
- if (!found)
- {
- strncpy(str,"N/A",64);
- ::SendMessage(m_ctrlDevice.m_hWnd, CB_ADDSTRING, 0,(LPARAM)CharToTchar(str,-1));
- }
- m_ctrlDevice.SetCurSel(0);
-
- //Codecs
- int numOfCodecs = _vieCodec->NumberOfCodecs();
- for(int i=0; i<numOfCodecs;++i)
- {
- VideoCodec codec;
- if(-1 !=_vieCodec->GetCodec(i,codec))
- {
- ::SendMessage(m_ctrlCodec.m_hWnd, CB_ADDSTRING, 0,(LPARAM)CharToTchar(codec.plName,-1));
- }
- }
- m_ctrlCodec.SetCurSel(0);
+ //Codecs
+ int numOfCodecs = _vieCodec->NumberOfCodecs();
+ for(int i=0; i<numOfCodecs;++i)
+ {
+ VideoCodec codec;
+ if(-1 !=_vieCodec->GetCodec(i,codec))
+ {
+ ::SendMessage(m_ctrlCodec.m_hWnd, CB_ADDSTRING, 0,(LPARAM)CharToTchar(codec.plName,-1));
+ }
+ }
+ m_ctrlCodec.SetCurSel(0);
#ifndef NO_VOICE_ENGINE
- CodecInst voiceCodec;
- int numOfVeCodecs = _veCodec->NumOfCodecs();
- for(int i=0; i<numOfVeCodecs;++i)
- {
- if(_veCodec->GetCodec(i,voiceCodec)!=-1)
- {
- if(strncmp(voiceCodec.plname,"ISAC",4)==0)
- break;
+ CodecInst voiceCodec;
+ int numOfVeCodecs = _veCodec->NumOfCodecs();
+ for(int i=0; i<numOfVeCodecs;++i)
+ {
+ if(_veCodec->GetCodec(i,voiceCodec)!=-1)
+ {
+ if(strncmp(voiceCodec.plname,"ISAC",4)==0)
+ break;
+ }
+ }
+ _audioChannel = _veBase->CreateChannel();
- }
- }
-
- _audioChannel = _veBase->CreateChannel();
-
-
- TEST_MUSTPASS(_veRTCP->SetRTCPStatus(_audioChannel, true),-5);
- TEST_MUSTPASS(_veCodec->SetSendCodec(_audioChannel, voiceCodec),-5);
- TEST_MUSTPASS(_veBase->StartPlayout(_audioChannel),-5);
-
+ TEST_MUSTPASS(_veRTCP->SetRTCPStatus(_audioChannel, true),-5);
+ TEST_MUSTPASS(_veCodec->SetSendCodec(_audioChannel, voiceCodec),-5);
+ TEST_MUSTPASS(_veBase->StartPlayout(_audioChannel),-5);
#endif //NO_VOICE_ENGINE
- if(_parentChannel==-1)
- {
- TEST_MUSTPASS(_vieBase->CreateChannel(_channelId),-5);
- }
- else // This is a slave channel
- {
- TEST_MUSTPASS(_vieBase->CreateChannel(_channelId,_parentChannel),-5);
- }
+ if(_parentChannel==-1)
+ {
+ TEST_MUSTPASS(_vieBase->CreateChannel(_channelId),-5);
+ }
+ else // This is a slave channel
+ {
+ TEST_MUSTPASS(_vieBase->CreateChannel(_channelId,_parentChannel),-5);
+ }
#ifndef NO_VOICE_ENGINE
- TEST_MUSTPASS(_vieBase->ConnectAudioChannel(_channelId,_audioChannel),-5);
+ TEST_MUSTPASS(_vieBase->ConnectAudioChannel(_channelId,_audioChannel),-5);
#endif
- _channelPool.AddChannel(_channelId);
+ _channelPool.AddChannel(_channelId);
- //Set Receive codec
- {
+ //Set Receive codec
+ {
VideoCodec codec;
int numOfCodecs = _vieCodec->NumberOfCodecs();;
- for(int i=0; i<numOfCodecs;++i)
- {
- if(-1 !=_vieCodec->GetCodec(i,codec))
- {
- if(codec.codecType == webrtc::kVideoCodecVP8)
- {
- codec.codecSpecific.VP8.feedbackModeOn = true;
- codec.codecSpecific.VP8.pictureLossIndicationOn = true;
- }
- TEST_MUSTPASS(_vieCodec->SetReceiveCodec(_channelId,codec),-5);
- }
- }
- }
-
- //TMMBR
- m_cbTmmbr.SetCheck(BST_CHECKED);
- OnBnClickedTmmbr();
-
- //Packet Burst
- m_ctrlPacketBurst.SetCurSel(0);
-
-
- //Protection method none
- CButton *opProtection = (CButton *) GetDlgItem(IDC_PROT_NONE);
- opProtection->SetCheck(BST_CHECKED);
- OnBnClickedProtNone();
-
-
- // Configure the renderer
- ConfigureRender();
-
- TEST_MUSTPASS(_vieCodec->RegisterEncoderObserver(_channelId,*this),kViECodecObserverAlreadyRegistered);
- TEST_MUSTPASS(_vieCodec->RegisterDecoderObserver(_channelId,*this),-5);
-
- TEST_MUSTPASS(_vieBase->RegisterObserver(*this),kViEBaseObserverAlreadyRegistered);
-
-
-
-
- //Set captions based on channel id
- m_remoteIp1.SetAddress(127,0,0,1);
- CString port;
- port.AppendFormat(_T("%d"),11111+_channelId*4);
- m_remotePort1.SetWindowText(port);
- m_localPort1.SetWindowText(port);
-
- CString title;
- this->GetWindowText(title);
- if(_parentChannel==-1)
- {
- title.AppendFormat(_T("%s - channel %d"),title,_channelId);
- }
- else
+ for(int i=0; i<numOfCodecs;++i)
{
- title.AppendFormat(_T("%s - slave channel %d - parent %d"),title,_channelId,_parentChannel);
+ if(-1 !=_vieCodec->GetCodec(i,codec))
+ {
+ if(codec.codecType == webrtc::kVideoCodecVP8)
+ {
+ codec.codecSpecific.VP8.feedbackModeOn = true;
+ codec.codecSpecific.VP8.pictureLossIndicationOn = true;
+ }
+ TEST_MUSTPASS(_vieCodec->SetReceiveCodec(_channelId,codec),-5);
+ }
}
- this->SetWindowText(title);
+ }
- if(_parentChannel!=-1)
- m_ctrlDevice.EnableWindow(FALSE); //Prevent from changing capture device
+ //TMMBR
+ m_cbTmmbr.SetCheck(BST_CHECKED);
+ OnBnClickedTmmbr();
- return TRUE; // return TRUE unless you set the focus to a control
+ //Packet Burst
+ m_ctrlPacketBurst.SetCurSel(0);
+
+
+ //Protection method none
+ CButton *opProtection = (CButton *) GetDlgItem(IDC_PROT_NONE);
+ opProtection->SetCheck(BST_CHECKED);
+ OnBnClickedProtNone();
+
+
+ // Configure the renderer
+ ConfigureRender();
+
+ TEST_MUSTPASS(_vieCodec->RegisterEncoderObserver(_channelId,*this),kViECodecObserverAlreadyRegistered);
+ TEST_MUSTPASS(_vieCodec->RegisterDecoderObserver(_channelId,*this),-5);
+
+ TEST_MUSTPASS(_vieBase->RegisterObserver(*this),kViEBaseObserverAlreadyRegistered);
+
+
+
+
+ //Set captions based on channel id
+ m_remoteIp1.SetAddress(127,0,0,1);
+ CString port;
+ port.AppendFormat(_T("%d"),11111+_channelId*4);
+ m_remotePort1.SetWindowText(port);
+ m_localPort1.SetWindowText(port);
+
+ CString title;
+ this->GetWindowText(title);
+ if(_parentChannel==-1)
+ {
+ title.AppendFormat(_T("%s - channel %d"),title,_channelId);
+ }
+ else
+ {
+ title.AppendFormat(_T("%s - slave channel %d - parent %d"),title,_channelId,_parentChannel);
+ }
+ this->SetWindowText(title);
+
+ if(_parentChannel!=-1)
+ m_ctrlDevice.EnableWindow(FALSE); //Prevent from changing capture device
+
+ return TRUE; // return TRUE unless you set the focus to a control
}
void CDXChannelDlg::OnTimer(UINT nIDEvent)
{
- CDialog::OnTimer(nIDEvent);
+ CDialog::OnTimer(nIDEvent);
}
void CDXChannelDlg::SetSendCodec()
@@ -493,7 +477,7 @@
//Set the codec bitrate
CString bitrateStr;
- m_ctrlBitrate.GetLBText(m_ctrlBitrate.GetCurSel(), bitrateStr);
+ m_ctrlBitrate.GetLBText(m_ctrlBitrate.GetCurSel(), bitrateStr);
int bitrate = _ttoi(bitrateStr.GetBuffer(0));
if(codec.codecType!=kVideoCodecI420)
{
@@ -507,8 +491,8 @@
if(strncmp(codec.plName, "VP8", 5) == 0)
{
- codec.codecSpecific.VP8.feedbackModeOn = true;
- codec.codecSpecific.VP8.pictureLossIndicationOn = true;
+ codec.codecSpecific.VP8.feedbackModeOn = true;
+ codec.codecSpecific.VP8.pictureLossIndicationOn = true;
TEST_MUSTPASS(_vieRTPRTCP->SetKeyFrameRequestMethod(_channelId, kViEKeyFrameRequestPliRtcp),-5);
}else
{
@@ -528,30 +512,22 @@
return;
BYTE part1, part2, part3, part4;
- char sendIP1[16];
- m_remoteIp1.GetAddress(part1, part2, part3, part4);
- sprintf(sendIP1,"%d.%d.%d.%d",part1,part2,part3,part4);
+ char sendIP1[16];
+ m_remoteIp1.GetAddress(part1, part2, part3, part4);
+ sprintf(sendIP1,"%d.%d.%d.%d",part1,part2,part3,part4);
CString strPort;
m_remotePort1.GetWindowText(strPort);
- int remotePort1 = _ttoi(strPort.GetString());
+ int remotePort1 = _ttoi(strPort.GetString());
-#ifdef IPV6
- char* recIP = "::0";
-#else
- char* recIP = "0.0.0.0";
-#endif //IPV6
+ TEST_MUSTPASS(_vieNetwork->SetSendDestination(_channelId,sendIP1,remotePort1),kViENetworkAlreadySending);
- TEST_MUSTPASS(_vieNetwork->SetSendDestination(_channelId,sendIP1,remotePort1),kViENetworkAlreadySending);
-
- #ifndef NO_VOICE_ENGINE
- m_localPort1.GetWindowText(strPort);
- int localPort1 = _ttoi(strPort.GetString());
- int res=_veBase->SetLocalReceiver(_audioChannel,localPort1+2);
-
- TEST_MUSTPASS(_veBase->SetSendDestination(_audioChannel, remotePort1+2, sendIP1),-5)
- #endif
-
+#ifndef NO_VOICE_ENGINE
+ m_localPort1.GetWindowText(strPort);
+ int localPort1 = _ttoi(strPort.GetString());
+ _veBase->SetLocalReceiver(_audioChannel,localPort1+2);
+ TEST_MUSTPASS(_veBase->SetSendDestination(_audioChannel, remotePort1+2, sendIP1),-5)
+#endif
}
void CDXChannelDlg::SetLocalReceiver()
@@ -560,20 +536,17 @@
return;
CString strPort;
- m_localPort1.GetWindowText(strPort);
- int localPort1 = _ttoi(strPort.GetString());
+ m_localPort1.GetWindowText(strPort);
+ int localPort1 = _ttoi(strPort.GetString());
// May fail because we are sending
TEST_MUSTPASS(_vieNetwork->SetLocalReceiver(_channelId, localPort1),-5);
- #ifndef NO_VOICE_ENGINE
- int res=_veBase->SetLocalReceiver(_audioChannel,localPort1+2);
- #endif
-
-
-
+#ifndef NO_VOICE_ENGINE
+ _veBase->SetLocalReceiver(_audioChannel,localPort1+2);
+#endif
}
void CDXChannelDlg::SetCaptureDevice()
@@ -584,11 +557,11 @@
int camSel=-1;
camSel=m_ctrlDevice.GetCurSel();
- CString captureStr;
+ CString captureStr;
//captureStr.Compare
- m_ctrlDevice.GetLBText(camSel, captureStr);
- if(captureStr!=_T("N/A") != 0)
- {
+ m_ctrlDevice.GetLBText(camSel, captureStr);
+ if(captureStr!=_T("N/A") != 0)
+ {
TEST_MUSTPASS(_vieFile->StopPlayFile(_captureId),kViEFileNotPlaying);
TEST_MUSTPASS(_vieCapture->DisconnectCaptureDevice(_channelId),kViECaptureDeviceNotConnected);
@@ -667,7 +640,7 @@
SetSendCodec();
if(_captureId==-1) // If no capture device has been set.
- SetCaptureDevice(); //Set the capture device
+ SetCaptureDevice(); //Set the capture device
@@ -739,26 +712,26 @@
if(_videoEngine)
- {
+ {
if(_parentChannel==-1)
{
_vieCodec->DeregisterEncoderObserver(_channelId);
}
_vieBase->DeleteChannel(_channelId);
_channelPool.RemoveChannel(_channelId);
- }
+ }
- _videoEngine = NULL;
+ _videoEngine = NULL;
#ifndef NO_VOICE_ENGINE
if (_voiceEngine)
- {
+ {
_veBase->DeleteChannel(_audioChannel);
_veBase->Release();
_veNetwork->Release();
_veCodec->Release();
_veRTCP->Release();
- }
+ }
#endif
@@ -790,14 +763,14 @@
#ifdef TEST_EXTERNAL_TRANSPORT
- if(_transport)
- delete _transport;
- _transport = NULL;
+ if(_transport)
+ delete _transport;
+ _transport = NULL;
#endif
delete _externalTransport;
- CDialog::OnDestroy();
+ CDialog::OnDestroy();
if(_dialogObserver)
{
_dialogObserver->ChannelDialogEnded(this);
@@ -815,57 +788,57 @@
void CDXChannelDlg::OnPaint()
{
if (IsIconic())
- {
- CPaintDC dc(this); // device context for painting
+ {
+ CPaintDC dc(this); // device context for painting
- SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
+ SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
- // Center icon in client rectangle
- int cxIcon = GetSystemMetrics(SM_CXICON);
- int cyIcon = GetSystemMetrics(SM_CYICON);
- CRect rect;
- GetClientRect(&rect);
- int x = (rect.Width() - cxIcon + 1) / 2;
- int y = (rect.Height() - cyIcon + 1) / 2;
+ // Center icon in client rectangle
+ int cxIcon = GetSystemMetrics(SM_CXICON);
+ int cyIcon = GetSystemMetrics(SM_CYICON);
+ CRect rect;
+ GetClientRect(&rect);
+ int x = (rect.Width() - cxIcon + 1) / 2;
+ int y = (rect.Height() - cyIcon + 1) / 2;
- // Draw the icon
- dc.DrawIcon(x, y, m_hIcon);
- }
- else
- {
- CDialog::OnPaint();
- }
+ // Draw the icon
+ dc.DrawIcon(x, y, m_hIcon);
+ }
+ else
+ {
+ CDialog::OnPaint();
+ }
}
BOOL CDXChannelDlg::OnDeviceChange( UINT nID, DWORD lParam)
{
- if(nID == DBT_DEVNODES_CHANGED)
- {
- // SetCaptureDevice();
- }
- return CDialog::OnDeviceChange(nID, lParam);
+ if(nID == DBT_DEVNODES_CHANGED)
+ {
+ // SetCaptureDevice();
+ }
+ return CDialog::OnDeviceChange(nID, lParam);
}
void CDXChannelDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
- if(SC_MAXIMIZE == nID)
- {}
- CDialog::OnSysCommand(nID, lParam);
+ if(SC_MAXIMIZE == nID)
+ {}
+ CDialog::OnSysCommand(nID, lParam);
}
static bool fullScreen = false;
void CDXChannelDlg::OnRButtonUp( UINT nFlags, CPoint point)
{
- CDialog::OnRButtonUp( nFlags, point);
+ CDialog::OnRButtonUp( nFlags, point);
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CDXChannelDlg::OnQueryDragIcon()
{
- return (HCURSOR) m_hIcon;
+ return (HCURSOR) m_hIcon;
}
void CDXChannelDlg::OnCbnSelchangeCodecList()
@@ -992,7 +965,6 @@
char version[1024];
_vieBase->GetVersion(version);
MessageBox(CharToTchar(version,-1));
- int p=strlen(version);
#ifndef NO_VOICE_ENGINE
_veBase->GetVersion(version);
MessageBox(CharToTchar(version,-1));
@@ -1094,8 +1066,8 @@
unsigned int framerate,
unsigned int bitrate)
{
- char str[64];
- sprintf(str,"Incoming Fr:%d br %d\n", framerate, bitrate);
+ char str[64];
+ sprintf(str,"Incoming Fr:%d br %d\n", framerate, bitrate);
AddToInfo(str);
}
@@ -1112,18 +1084,18 @@
void CDXChannelDlg::OutgoingRate(const int videoChannel,
unsigned int framerate,
unsigned int bitrate)
- {
- char str[64];
+ {
+ char str[64];
sprintf(str,"Send Fr:%d br %d", framerate, bitrate);
AddToInfo(str);
- }
+ }
void CDXChannelDlg::IncomingCodecChanged(const int videoChannel,
const VideoCodec& videoCodec)
- {
- char str[128];
+ {
+ char str[128];
sprintf(str,"Incoming codec channel:%d pltype:%d width:%d height:%d\n", videoChannel, videoCodec.plType, videoCodec.width,videoCodec.height);
AddToInfo(str);
- }
+ }
void CDXChannelDlg::BrightnessAlarm(const int captureId,
const Brightness brightness)
{
@@ -1236,7 +1208,7 @@
videoCodec.height=288;
videoCodec.codecType=webrtc::kVideoCodecVP8;
videoCodec.maxFramerate=30;
- TEST_MUSTPASS(_vieFile->StartRecordIncomingVideo(_channelId,_fileName,audioSource,audioCodec, videoCodec),-5);
+ TEST_MUSTPASS(_vieFile->StartRecordIncomingVideo(_channelId,_fileName,audioSource,audioCodec, videoCodec),-5);
}
else
{
@@ -1278,7 +1250,7 @@
videoCodec.height=288;
videoCodec.codecType=webrtc::kVideoCodecVP8;
videoCodec.maxFramerate=30;
- TEST_MUSTPASS(_vieFile->StartRecordOutgoingVideo(_channelId,_fileName,audioSource,audioCodec,videoCodec),-5);
+ TEST_MUSTPASS(_vieFile->StartRecordOutgoingVideo(_channelId,_fileName,audioSource,audioCodec,videoCodec),-5);
}
else
{
diff --git a/src/video_engine/main/test/WindowsTest/WindowsTest.cc b/src/video_engine/main/test/WindowsTest/WindowsTest.cc
index ceda8a9..ff8159c 100644
--- a/src/video_engine/main/test/WindowsTest/WindowsTest.cc
+++ b/src/video_engine/main/test/WindowsTest/WindowsTest.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
+ * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@@ -74,10 +74,10 @@
}
{
- WindowsTestMainDlg dlg(_videoEngine,_voiceEngine);
+ WindowsTestMainDlg dlg(_videoEngine,_voiceEngine);
- m_pMainWnd = &dlg;
- int nResponse = dlg.DoModal();
+ m_pMainWnd = &dlg;
+ dlg.DoModal();
}
vieBase->Release();
diff --git a/src/video_engine/main/test/WindowsTest/tbExternalTransport.cc b/src/video_engine/main/test/WindowsTest/tbExternalTransport.cc
index f0910ee..df490fa 100644
--- a/src/video_engine/main/test/WindowsTest/tbExternalTransport.cc
+++ b/src/video_engine/main/test/WindowsTest/tbExternalTransport.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
+ * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@@ -78,10 +78,6 @@
sequenceNumber += (((unsigned char*) data)[3]);
- int marker=((unsigned char*)data)[1] & 0x80;
- unsigned int timestamp=((((unsigned char*)data)[4]) << 24) + ((((unsigned char*)data)[5])<<16) +((((unsigned char*)data)[6])<<8)+(((unsigned char*)data)[7]);
-
-
// Packet loss
int dropThis = rand() % 100;
bool nacked=false;
diff --git a/src/video_engine/test/auto_test/source/vie_autotest_win.cc b/src/video_engine/test/auto_test/source/vie_autotest_win.cc
index 7887767..051169d 100755
--- a/src/video_engine/test/auto_test/source/vie_autotest_win.cc
+++ b/src/video_engine/test/auto_test/source/vie_autotest_win.cc
@@ -181,10 +181,8 @@
hinst, // instance handle
NULL); // no window creation data
- if (!hwndMain) {
- int error = GetLastError();
+ if (!hwndMain)
return -1;
- }
// Show the window using the flag specified by the program
// that started the application, and send the application
diff --git a/src/voice_engine/main/test/win_test/WinTestDlg.cc b/src/voice_engine/main/test/win_test/WinTestDlg.cc
index de54802..85da41d 100644
--- a/src/voice_engine/main/test/win_test/WinTestDlg.cc
+++ b/src/voice_engine/main/test/win_test/WinTestDlg.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
+ * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@@ -1215,8 +1215,7 @@
if (_veRtpRtcpPtr) _veRtpRtcpPtr->Release();
if (_vePtr)
{
- bool ret = VoiceEngine::Delete(_vePtr);
- ASSERT(ret == true);
+ VoiceEngine::Delete(_vePtr);
}
VoiceEngine::SetTraceFilter(kTraceNone);
}
@@ -1416,7 +1415,6 @@
float lVol(0.0);
float rVol(0.0);
int leftVol, rightVol;
- unsigned int volumePan(0);
CSliderCtrl* slider(NULL);
_veVolumeControlPtr->GetOutputVolumePan(-1, lVol, rVol);
@@ -1777,9 +1775,6 @@
GetDlgItem(IDC_CHECK_NS_1)->EnableWindow(TRUE);
GetDlgItem(IDC_CHECK_FEC)->EnableWindow(TRUE);
- bool enabled(false);
- bool includeCSRCs(false);
-
// Always set send codec to default codec <=> index 0.
CodecInst codec;
_veCodecPtr->GetCodec(0, codec);
@@ -1819,10 +1814,6 @@
GetDlgItem(IDC_CHECK_CONFERENCE_2)->EnableWindow(TRUE);
GetDlgItem(IDC_CHECK_ON_HOLD_2)->EnableWindow(TRUE);
- bool enabled(false);
- bool includeCSRCs(false);
-
-
// Always set send codec to default codec <=> index 0.
CodecInst codec;
_veCodecPtr->GetCodec(0, codec);
@@ -2478,7 +2469,6 @@
void CWinTestDlg::OnBnClickedCheckExtMediaIn1()
{
- int ret(0);
int channel = GetDlgItemInt(IDC_EDIT_1);
CButton* buttonExtTrans = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_IN_1);
int check = buttonExtTrans->GetCheck();
@@ -2497,7 +2487,6 @@
void CWinTestDlg::OnBnClickedCheckExtMediaIn2()
{
- int ret(0);
int channel = GetDlgItemInt(IDC_EDIT_2);
CButton* buttonExtTrans = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_IN_2);
int check = buttonExtTrans->GetCheck();
@@ -2516,7 +2505,6 @@
void CWinTestDlg::OnBnClickedCheckExtMediaOut1()
{
- int ret(0);
int channel = GetDlgItemInt(IDC_EDIT_1);
CButton* buttonExtTrans = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT_1);
int check = buttonExtTrans->GetCheck();
@@ -2535,7 +2523,6 @@
void CWinTestDlg::OnBnClickedCheckExtMediaOut2()
{
- int ret(0);
int channel = GetDlgItemInt(IDC_EDIT_2);
CButton* buttonExtTrans = (CButton*)GetDlgItem(IDC_CHECK_EXT_MEDIA_OUT_2);
int check = buttonExtTrans->GetCheck();
@@ -2951,7 +2938,6 @@
void CWinTestDlg::OnBnClickedCheckDelayEstimate1()
{
- int channel = GetDlgItemInt(IDC_EDIT_1);
CButton* button = (CButton*)GetDlgItem(IDC_CHECK_DELAY_ESTIMATE_1);
int check = button->GetCheck();
const bool enable = (check == BST_CHECKED);
@@ -3112,7 +3098,6 @@
const char micFile[] = "../../test/data/voice_engine/audio_short16.pcm";
// const char micFile[] = "../../test/data/voice_engine/audio_long16noise.pcm";
- int ret(0);
int channel(-1);
CButton* buttonExtTrans = (CButton*)GetDlgItem(IDC_CHECK_PLAY_FILE_IN);
int check = buttonExtTrans->GetCheck();