cpplint passes for vie_performance_monitor, vie_manager_base, vie_impl, vie_renderer, vie_defines and vie_render_manager.

NOLINT is used where API changes would be needed, for include guards and include files in WebRTC root.

Lots of changes, but no real logical changes.

BUG=627
TEST=vie_auto_test + compiles on all platforms.

Review URL: https://webrtc-codereview.appspot.com/679004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2454 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mflodman@webrtc.org 2012-06-28 07:29:46 +00:00
parent 100463e828
commit cee447a5bb
13 changed files with 209 additions and 247 deletions

View File

@ -178,7 +178,7 @@ int ViEChannelManager::DeleteChannel(int channel_id) {
ChannelGroup* group = NULL; ChannelGroup* group = NULL;
{ {
// Write lock to make sure no one is using the channel. // Write lock to make sure no one is using the channel.
ViEManagerWriteScoped wl(*this); ViEManagerWriteScoped wl(this);
// Protect the maps. // Protect the maps.
CriticalSectionScoped cs(*channel_id_critsect_); CriticalSectionScoped cs(*channel_id_critsect_);
@ -251,7 +251,7 @@ int ViEChannelManager::DeleteChannel(int channel_id) {
int ViEChannelManager::SetVoiceEngine(VoiceEngine* voice_engine) { int ViEChannelManager::SetVoiceEngine(VoiceEngine* voice_engine) {
// Write lock to make sure no one is using the channel. // Write lock to make sure no one is using the channel.
ViEManagerWriteScoped wl(*this); ViEManagerWriteScoped wl(this);
CriticalSectionScoped cs(*channel_id_critsect_); CriticalSectionScoped cs(*channel_id_critsect_);

View File

@ -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 * 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 * that can be found in the LICENSE file in the root of the source
@ -8,254 +8,214 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
/* #ifndef WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_ // NOLINT
* vie_defines.h #define WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_ // NOLINT
*/
#ifndef WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_ #include "engine_configurations.h" // NOLINT
#define WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_
#include "engine_configurations.h"
#ifdef WEBRTC_MAC_INTEL
#include <stdio.h>
#include <unistd.h>
#endif
// TODO(mflodman) Remove.
#ifdef WEBRTC_ANDROID #ifdef WEBRTC_ANDROID
#include <pthread.h> #include <arpa/inet.h> // NOLINT
#include <sys/types.h> #include <linux/net.h> // NOLINT
#include <sys/socket.h> #include <netinet/in.h> // NOLINT
#include <netinet/in.h> #include <pthread.h> // NOLINT
#include <arpa/inet.h> #include <stdio.h> // NOLINT
#include <linux/net.h> #include <stdlib.h> // NOLINT
#include <stdio.h> #include <string.h> // NOLINT
#include <stdlib.h> #include <sys/types.h> // NOLINT
#include <string.h> #include <sys/socket.h> // NOLINT
#include <time.h> #include <sys/time.h> // NOLINT
#include <sys/time.h> #include <time.h> // NOLINT
#endif #endif
namespace webrtc namespace webrtc {
{
// ===================================================
// ViE Defines
// ===================================================
// General // General
enum { kViEMinKeyRequestIntervalMs = 300}; enum { kViEMinKeyRequestIntervalMs = 300 };
// ViEBase // ViEBase
enum { kViEMaxNumberOfChannels = 32}; enum { kViEMaxNumberOfChannels = 32 };
enum { kViEVersionMaxMessageSize = 1024 }; enum { kViEVersionMaxMessageSize = 1024 };
enum { kViEMaxModuleVersionSize = 960 }; enum { kViEMaxModuleVersionSize = 960 };
// ViECapture // ViECapture
enum { kViEMaxCaptureDevices=10}; enum { kViEMaxCaptureDevices = 10 };
// Width used if no send codec has been set when a capture device is started enum { kViECaptureDefaultWidth = 352 };
enum { kViECaptureDefaultWidth = 352}; enum { kViECaptureDefaultHeight = 288 };
// Height used if no send codec has been set when a capture device is started enum { kViECaptureDefaultFramerate = 30 };
enum { kViECaptureDefaultHeight = 288};
enum { kViECaptureDefaultFramerate = 30};
enum { kViECaptureMaxSnapshotWaitTimeMs = 500 }; enum { kViECaptureMaxSnapshotWaitTimeMs = 500 };
// ViECodec // ViECodec
enum { kViEMaxCodecWidth = 1920}; enum { kViEMaxCodecWidth = 1920 };
enum { kViEMaxCodecHeight = 1200}; enum { kViEMaxCodecHeight = 1200 };
enum { kViEMaxCodecFramerate = 60}; enum { kViEMaxCodecFramerate = 60 };
enum { kViEMinCodecBitrate = 30}; enum { kViEMinCodecBitrate = 30 };
// ViEEncryption // ViEEncryption
enum { kViEMaxSrtpKeyLength = 30}; enum { kViEMaxSrtpKeyLength = 30 };
enum { kViEMinSrtpEncryptLength = 16}; enum { kViEMinSrtpEncryptLength = 16 };
enum { kViEMaxSrtpEncryptLength = 256}; enum { kViEMaxSrtpEncryptLength = 256 };
enum { kViEMaxSrtpAuthSh1Length = 20}; enum { kViEMaxSrtpAuthSh1Length = 20 };
enum { kViEMaxSrtpTagAuthNullLength = 12}; enum { kViEMaxSrtpTagAuthNullLength = 12 };
enum { kViEMaxSrtpKeyAuthNullLength = 256}; enum { kViEMaxSrtpKeyAuthNullLength = 256 };
// ViEExternalCodec
// ViEFile // ViEFile
enum { kViEMaxFilePlayers = 3}; enum { kViEMaxFilePlayers = 3 };
// ViEImageProcess
// ViENetwork // ViENetwork
enum { kViEMaxMtu = 1500}; enum { kViEMaxMtu = 1500 };
enum { kViESocketThreads = 1}; enum { kViESocketThreads = 1 };
enum { kViENumReceiveSocketBuffers = 500}; enum { kViENumReceiveSocketBuffers = 500 };
// ViERender // ViERender
// Max valid time set in SetRenderTimeoutImage // Max valid time set in SetRenderTimeoutImage
enum { kViEMaxRenderTimeoutTimeMs = 10000}; enum { kViEMaxRenderTimeoutTimeMs = 10000 };
// Min valid time set in SetRenderTimeoutImage // Min valid time set in SetRenderTimeoutImage
enum { kViEMinRenderTimeoutTimeMs = 33}; enum { kViEMinRenderTimeoutTimeMs = 33 };
enum { kViEDefaultRenderDelayMs = 10}; enum { kViEDefaultRenderDelayMs = 10 };
// ViERTP_RTCP // ViERTP_RTCP
enum { kNackHistorySize = 400}; enum { kNackHistorySize = 400 };
// Id definitions // Id definitions
enum { enum {
kViEChannelIdBase=0x0, kViEChannelIdBase = 0x0,
kViEChannelIdMax=0xFF, kViEChannelIdMax = 0xFF,
kViECaptureIdBase=0x1001, kViECaptureIdBase = 0x1001,
kViECaptureIdMax=0x10FF, kViECaptureIdMax = 0x10FF,
kViEFileIdBase=0x2000, kViEFileIdBase = 0x2000,
kViEFileIdMax=0x200F, kViEFileIdMax = 0x200F,
kViEDummyChannelId=0xFFFF kViEDummyChannelId = 0xFFFF
}; };
// Module id // Module id
// Create a unique id based on the ViE instance id and the // Create a unique id based on the ViE instance id and the
// channel id. ViE id > 0 and 0 <= channel id <= 255 // channel id. ViE id > 0 and 0 <= channel id <= 255
inline int ViEId(const int vieId, const int channelId = -1) inline int ViEId(const int vieId, const int channelId = -1) {
{ if (channelId == -1) {
if (channelId == -1) return static_cast<int>((vieId << 16) + kViEDummyChannelId);
{ }
return (int) ((vieId << 16) + kViEDummyChannelId); return static_cast<int>((vieId << 16) + channelId);
}
return (int) ((vieId << 16) + channelId);
} }
inline int ViEModuleId(const int vieId, const int channelId = -1) inline int ViEModuleId(const int vieId, const int channelId = -1) {
{ if (channelId == -1) {
if (channelId == -1) return static_cast<int>((vieId << 16) + kViEDummyChannelId);
{ }
return (int) ((vieId << 16) + kViEDummyChannelId); return static_cast<int>((vieId << 16) + channelId);
}
return (int) ((vieId << 16) + channelId);
} }
inline int ChannelId(const int moduleId) inline int ChannelId(const int moduleId) {
{ return static_cast<int>(moduleId & 0xffff);
return (int) (moduleId & 0xffff);
} }
// Windows specific.
// ============================================================================
// Platform specifics
// ============================================================================
//-------------------------------------
// Windows
//-------------------------------------
#if defined(_WIN32) #if defined(_WIN32)
// Build information macros // Build information macros
#if defined(_DEBUG) #if defined(_DEBUG)
#define BUILDMODE TEXT("d") #define BUILDMODE TEXT("d")
#elif defined(DEBUG) #elif defined(DEBUG)
#define BUILDMODE TEXT("d") #define BUILDMODE TEXT("d")
#elif defined(NDEBUG) #elif defined(NDEBUG)
#define BUILDMODE TEXT("r") #define BUILDMODE TEXT("r")
#else #else
#define BUILDMODE TEXT("?") #define BUILDMODE TEXT("?")
#endif #endif
#define BUILDTIME TEXT(__TIME__) #define BUILDTIME TEXT(__TIME__)
#define BUILDDATE TEXT(__DATE__) #define BUILDDATE TEXT(__DATE__)
// example: "Oct 10 2002 12:05:30 r" // Example: "Oct 10 2002 12:05:30 r".
#define BUILDINFO BUILDDATE TEXT(" ") BUILDTIME TEXT(" ") BUILDMODE #define BUILDINFO BUILDDATE TEXT(" ") BUILDTIME TEXT(" ") BUILDMODE
#define RENDER_MODULE_TYPE kRenderWindows
// Warning pragmas.
// new behavior: elements of array 'XXX' will be default initialized.
#pragma warning(disable: 4351)
// 'this' : used in base member initializer list.
#pragma warning(disable: 4355)
// Frame pointer register 'ebp' modified by inline assembly code.
#pragma warning(disable: 4731)
#define RENDER_MODULE_TYPE kRenderWindows // Include libraries.
// Warning pragmas #pragma comment(lib, "winmm.lib")
// new behavior: elements of array 'XXX' will be default initialized
#pragma warning(disable: 4351)
// 'this' : used in base member initializer list
#pragma warning(disable: 4355)
// frame pointer register 'ebp' modified by inline assembly code
#pragma warning(disable: 4731)
// Include libraries #ifndef WEBRTC_EXTERNAL_TRANSPORT
#pragma comment( lib, "winmm.lib" ) #pragma comment(lib, "ws2_32.lib")
#ifndef WEBRTC_EXTERNAL_TRANSPORT #pragma comment(lib, "Iphlpapi.lib") // _GetAdaptersAddresses
#pragma comment( lib, "ws2_32.lib" ) #endif
#pragma comment( lib, "Iphlpapi.lib" ) // _GetAdaptersAddresses
#endif
#endif #endif
// Mac specific.
//-------------------------------------
// Mac
//-------------------------------------
#ifdef WEBRTC_MAC_INTEL #ifdef WEBRTC_MAC_INTEL
#define SLEEP(x) usleep(x * 1000) #define SLEEP(x) usleep(x * 1000)
// Build information macros // Build information macros.
#define TEXT(x) x #define TEXT(x) x
#if defined(_DEBUG) #if defined(_DEBUG)
#define BUILDMODE TEXT("d") #define BUILDMODE TEXT("d")
#elif defined(DEBUG) #elif defined(DEBUG)
#define BUILDMODE TEXT("d") #define BUILDMODE TEXT("d")
#elif defined(NDEBUG) #elif defined(NDEBUG)
#define BUILDMODE TEXT("r") #define BUILDMODE TEXT("r")
#else #else
#define BUILDMODE TEXT("?") #define BUILDMODE TEXT("?")
#endif #endif
#define BUILDTIME TEXT(__TIME__) #define BUILDTIME TEXT(__TIME__)
#define BUILDDATE TEXT(__DATE__) #define BUILDDATE TEXT(__DATE__)
// example: "Oct 10 2002 12:05:30 r" // Example: "Oct 10 2002 12:05:30 r".
#define BUILDINFO BUILDDATE TEXT(" ") BUILDTIME TEXT(" ") BUILDMODE #define BUILDINFO BUILDDATE TEXT(" ") BUILDTIME TEXT(" ") BUILDMODE
#define RENDER_MODULE_TYPE kRenderWindows
#define RENDER_MODULE_TYPE kRenderWindows
#endif #endif
//------------------------------------- // Linux specific.
// Linux
//-------------------------------------
#ifndef WEBRTC_ANDROID #ifndef WEBRTC_ANDROID
#ifdef WEBRTC_LINUX #ifdef WEBRTC_LINUX
// Build information macros.
#if defined(_DEBUG)
#define BUILDMODE "d"
#elif defined(DEBUG)
#define BUILDMODE "d"
#elif defined(NDEBUG)
#define BUILDMODE "r"
#else
#define BUILDMODE "?"
#endif
// Build information macros #define BUILDTIME __TIME__
#if defined(_DEBUG) #define BUILDDATE __DATE__
#define BUILDMODE "d"
#elif defined(DEBUG)
#define BUILDMODE "d"
#elif defined(NDEBUG)
#define BUILDMODE "r"
#else
#define BUILDMODE "?"
#endif
#define BUILDTIME __TIME__ // Example: "Oct 10 2002 12:05:30 r".
#define BUILDDATE __DATE__ #define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE
#endif // WEBRTC_LINUX
// example: "Oct 10 2002 12:05:30 r" #endif // WEBRTC_ANDROID
#define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE
#endif // ifdef WEBRTC_LINUX
#endif // ifndef WEBRTC_ANDROID
// Android specific.
#ifdef WEBRTC_ANDROID #ifdef WEBRTC_ANDROID
#define FAR
#define __cdecl
#define FAR #if defined(_DEBUG)
#define __cdecl #define BUILDMODE "d"
#elif defined(DEBUG)
#define BUILDMODE "d"
#elif defined(NDEBUG)
#define BUILDMODE "r"
#else
#define BUILDMODE "?"
#endif
#if defined(_DEBUG) #define BUILDTIME __TIME__
#define BUILDMODE "d" #define BUILDDATE __DATE__
#elif defined(DEBUG)
#define BUILDMODE "d"
#elif defined(NDEBUG)
#define BUILDMODE "r"
#else
#define BUILDMODE "?"
#endif
#define BUILDTIME __TIME__ // Example: "Oct 10 2002 12:05:30 r".
#define BUILDDATE __DATE__ #define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE
// example: "Oct 10 2002 12:05:30 r" #endif // WEBRTC_ANDROID
#define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE
#endif // #ifdef WEBRTC_ANDROID } // namespace webrtc
} //namespace webrtc #endif // WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_ // NOLINT
#endif // WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_

View File

@ -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 * 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 * that can be found in the LICENSE file in the root of the source
@ -8,10 +8,10 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_ #ifndef WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_ // NOLINT
#define WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_ #define WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_ // NOLINT
#include "engine_configurations.h" #include "engine_configurations.h" // NOLINT
#include "video_engine/vie_defines.h" #include "video_engine/vie_defines.h"
#include "video_engine/vie_base_impl.h" #include "video_engine/vie_base_impl.h"
@ -112,4 +112,4 @@ class VideoEngineImpl
} // namespace webrtc } // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_ #endif // WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_ // NOLINT

View File

@ -296,7 +296,7 @@ int ViEInputManager::DestroyCaptureDevice(const int capture_id) {
{ {
// We need exclusive access to the object to delete it. // We need exclusive access to the object to delete it.
// Take this write lock first since the read lock is taken before map_cs_. // Take this write lock first since the read lock is taken before map_cs_.
ViEManagerWriteScoped wl(*this); ViEManagerWriteScoped wl(this);
CriticalSectionScoped cs(map_cs_.get()); CriticalSectionScoped cs(map_cs_.get());
vie_capture = ViECapturePtr(capture_id); vie_capture = ViECapturePtr(capture_id);
@ -413,7 +413,7 @@ int ViEInputManager::DestroyFilePlayer(int file_id) {
{ {
// We need exclusive access to the object to delete it. // We need exclusive access to the object to delete it.
// Take this write lock first since the read lock is taken before map_cs_. // Take this write lock first since the read lock is taken before map_cs_.
ViEManagerWriteScoped wl(*this); ViEManagerWriteScoped wl(this);
CriticalSectionScoped cs(map_cs_.get()); CriticalSectionScoped cs(map_cs_.get());
vie_file_player = ViEFilePlayerPtr(file_id); vie_file_player = ViEFilePlayerPtr(file_id);

View File

@ -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 * 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 * that can be found in the LICENSE file in the root of the source
@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include "assert.h" #include <assert.h>
#include "system_wrappers/interface/rw_lock_wrapper.h" #include "system_wrappers/interface/rw_lock_wrapper.h"
#include "video_engine/vie_manager_base.h" #include "video_engine/vie_manager_base.h"
@ -50,8 +50,8 @@ ViEManagerScopedBase::~ViEManagerScopedBase() {
vie_manager_->ReleaseLockManager(); vie_manager_->ReleaseLockManager();
} }
ViEManagerWriteScoped::ViEManagerWriteScoped(ViEManagerBase& vie_manager) ViEManagerWriteScoped::ViEManagerWriteScoped(ViEManagerBase* vie_manager)
: vie_manager_(&vie_manager) { : vie_manager_(vie_manager) {
vie_manager_->WriteLockManager(); vie_manager_->WriteLockManager();
} }
@ -60,13 +60,13 @@ ViEManagerWriteScoped::~ViEManagerWriteScoped() {
} }
ViEManagedItemScopedBase::ViEManagedItemScopedBase( ViEManagedItemScopedBase::ViEManagedItemScopedBase(
ViEManagerScopedBase& vie_scoped_manager) ViEManagerScopedBase* vie_scoped_manager)
: vie_scoped_manager_(vie_scoped_manager) { : vie_scoped_manager_(vie_scoped_manager) {
vie_scoped_manager_.ref_count_++; vie_scoped_manager_->ref_count_++;
} }
ViEManagedItemScopedBase::~ViEManagedItemScopedBase() { ViEManagedItemScopedBase::~ViEManagedItemScopedBase() {
vie_scoped_manager_.ref_count_--; vie_scoped_manager_->ref_count_--;
} }
} // namespace webrtc } // namespace webrtc

View File

@ -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 * 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 * that can be found in the LICENSE file in the root of the source
@ -8,23 +8,23 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef WEBRTC_VIDEO_ENGINE_VIE_MANAGER_BASE_H_ #ifndef WEBRTC_VIDEO_ENGINE_VIE_MANAGER_BASE_H_ // NOLINT
#define WEBRTC_VIDEO_ENGINE_VIE_MANAGER_BASE_H_ #define WEBRTC_VIDEO_ENGINE_VIE_MANAGER_BASE_H_ // NOLINT
namespace webrtc { namespace webrtc {
class RWLockWrapper; class RWLockWrapper;
class ViEManagerBase { class ViEManagerBase {
friend class ViEManagerScopedBase;
friend class ViEManagedItemScopedBase; friend class ViEManagedItemScopedBase;
friend class ViEManagerScopedBase;
friend class ViEManagerWriteScoped; friend class ViEManagerWriteScoped;
public: public:
ViEManagerBase(); ViEManagerBase();
~ViEManagerBase(); ~ViEManagerBase();
private: private:
// Exclusive lock, used by ViEManagerWriteScoped // Exclusive lock, used by ViEManagerWriteScoped.
void WriteLockManager(); void WriteLockManager();
// Releases exclusive lock, used by ViEManagerWriteScoped. // Releases exclusive lock, used by ViEManagerWriteScoped.
@ -41,7 +41,7 @@ class ViEManagerBase {
class ViEManagerWriteScoped { class ViEManagerWriteScoped {
public: public:
explicit ViEManagerWriteScoped(ViEManagerBase& vie_manager); explicit ViEManagerWriteScoped(ViEManagerBase* vie_manager);
~ViEManagerWriteScoped(); ~ViEManagerWriteScoped();
private: private:
@ -63,12 +63,13 @@ class ViEManagerScopedBase {
class ViEManagedItemScopedBase { class ViEManagedItemScopedBase {
public: public:
explicit ViEManagedItemScopedBase(ViEManagerScopedBase& vie_scoped_manager); explicit ViEManagedItemScopedBase(ViEManagerScopedBase* vie_scoped_manager);
~ViEManagedItemScopedBase(); ~ViEManagedItemScopedBase();
protected: protected:
ViEManagerScopedBase& vie_scoped_manager_; ViEManagerScopedBase* vie_scoped_manager_;
}; };
} // namespace webrtc } // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_VIE_MANAGER_BASE_H_ #endif // WEBRTC_VIDEO_ENGINE_VIE_MANAGER_BASE_H_ // NOLINT

View File

@ -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 * 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 * that can be found in the LICENSE file in the root of the source
@ -8,16 +8,16 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include "vie_performance_monitor.h" #include "video_engine/vie_performance_monitor.h"
#include "cpu_wrapper.h" #include "system_wrappers/interface/cpu_wrapper.h"
#include "critical_section_wrapper.h" #include "system_wrappers/interface/critical_section_wrapper.h"
#include "event_wrapper.h" #include "system_wrappers/interface/event_wrapper.h"
#include "thread_wrapper.h" #include "system_wrappers/interface/thread_wrapper.h"
#include "tick_util.h" #include "system_wrappers/interface/tick_util.h"
#include "trace.h" #include "system_wrappers/interface/trace.h"
#include "vie_base.h" #include "video_engine/include/vie_base.h"
#include "vie_defines.h" #include "video_engine/vie_defines.h"
namespace webrtc { namespace webrtc {

View File

@ -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 * 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 * that can be found in the LICENSE file in the root of the source
@ -11,17 +11,17 @@
// ViEPerformanceMonitor is used to check the current CPU usage and triggers a // ViEPerformanceMonitor is used to check the current CPU usage and triggers a
// callback when getting over a specified threshold. // callback when getting over a specified threshold.
#ifndef WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_ #ifndef WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_ // NOLINT
#define WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_ #define WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_ // NOLINT
#include "system_wrappers/interface/scoped_ptr.h" #include "system_wrappers/interface/scoped_ptr.h"
#include "typedefs.h" #include "typedefs.h" // NOLINT
#include "vie_defines.h" #include "video_engine/vie_defines.h"
namespace webrtc { namespace webrtc {
class CriticalSectionWrapper;
class CpuWrapper; class CpuWrapper;
class CriticalSectionWrapper;
class EventWrapper; class EventWrapper;
class ThreadWrapper; class ThreadWrapper;
class ViEBaseObserver; class ViEBaseObserver;
@ -51,4 +51,4 @@ class ViEPerformanceMonitor {
} // namespace webrtc } // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_ #endif // WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_ // NOLINT

View File

@ -75,7 +75,7 @@ int ViERenderImpl::RegisterVideoRenderModule(
WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
"%s (&render_module: %p)", __FUNCTION__, &render_module); "%s (&render_module: %p)", __FUNCTION__, &render_module);
if (shared_data_->render_manager()->RegisterVideoRenderModule( if (shared_data_->render_manager()->RegisterVideoRenderModule(
render_module) != 0) { &render_module) != 0) {
shared_data_->SetLastError(kViERenderUnknownError); shared_data_->SetLastError(kViERenderUnknownError);
return -1; return -1;
} }
@ -87,7 +87,7 @@ int ViERenderImpl::DeRegisterVideoRenderModule(
WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()), WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
"%s (&render_module: %p)", __FUNCTION__, &render_module); "%s (&render_module: %p)", __FUNCTION__, &render_module);
if (shared_data_->render_manager()->DeRegisterVideoRenderModule( if (shared_data_->render_manager()->DeRegisterVideoRenderModule(
render_module) != 0) { &render_module) != 0) {
// Error logging is done in ViERenderManager::DeRegisterVideoRenderModule. // Error logging is done in ViERenderManager::DeRegisterVideoRenderModule.
shared_data_->SetLastError(kViERenderUnknownError); shared_data_->SetLastError(kViERenderUnknownError);
return -1; return -1;

View File

@ -10,7 +10,7 @@
#include "video_engine/vie_render_manager.h" #include "video_engine/vie_render_manager.h"
#include "engine_configurations.h" #include "engine_configurations.h" // NOLINT
#include "modules/video_render/main/interface/video_render.h" #include "modules/video_render/main/interface/video_render.h"
#include "modules/video_render/main/interface/video_render_defines.h" #include "modules/video_render/main/interface/video_render_defines.h"
#include "system_wrappers/interface/critical_section_wrapper.h" #include "system_wrappers/interface/critical_section_wrapper.h"
@ -55,28 +55,28 @@ ViERenderManager::~ViERenderManager() {
} }
WebRtc_Word32 ViERenderManager::RegisterVideoRenderModule( WebRtc_Word32 ViERenderManager::RegisterVideoRenderModule(
VideoRender& render_module) { VideoRender* render_module) {
// See if there is already a render module registered for the window that // See if there is already a render module registered for the window that
// the registrant render module is associated with. // the registrant render module is associated with.
VideoRender* current_module = FindRenderModule(render_module.Window()); VideoRender* current_module = FindRenderModule(render_module->Window());
if (current_module) { if (current_module) {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_),
"A module is already registered for this window (window=%p, " "A module is already registered for this window (window=%p, "
"current module=%p, registrant module=%p.", "current module=%p, registrant module=%p.",
render_module.Window(), current_module, &render_module); render_module->Window(), current_module, render_module);
return -1; return -1;
} }
// Register module. // Register module.
render_list_.PushBack(static_cast<void*>(&render_module)); render_list_.PushBack(static_cast<void*>(render_module));
use_external_render_module_ = true; use_external_render_module_ = true;
return 0; return 0;
} }
WebRtc_Word32 ViERenderManager::DeRegisterVideoRenderModule( WebRtc_Word32 ViERenderManager::DeRegisterVideoRenderModule(
VideoRender& render_module) { VideoRender* render_module) {
// Check if there are streams in the module. // Check if there are streams in the module.
WebRtc_UWord32 n_streams = render_module.GetNumIncomingRenderStreams(); WebRtc_UWord32 n_streams = render_module->GetNumIncomingRenderStreams();
if (n_streams != 0) { if (n_streams != 0) {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_),
"There are still %d streams in this module, cannot " "There are still %d streams in this module, cannot "
@ -89,7 +89,7 @@ WebRtc_Word32 ViERenderManager::DeRegisterVideoRenderModule(
bool found = false; bool found = false;
for (list_item = render_list_.First(); list_item != NULL; for (list_item = render_list_.First(); list_item != NULL;
list_item = render_list_.Next(list_item)) { list_item = render_list_.Next(list_item)) {
if (&render_module == static_cast<VideoRender*>(list_item->GetItem())) { if (render_module == static_cast<VideoRender*>(list_item->GetItem())) {
// We've found our renderer. // We've found our renderer.
render_list_.Erase(list_item); render_list_.Erase(list_item);
found = true; found = true;
@ -154,7 +154,7 @@ WebRtc_Word32 ViERenderManager::RemoveRenderStream(
const WebRtc_Word32 render_id) { const WebRtc_Word32 render_id) {
// We need exclusive right to the items in the render manager to delete a // We need exclusive right to the items in the render manager to delete a
// stream. // stream.
ViEManagerWriteScoped scope(*this); ViEManagerWriteScoped scope(this);
CriticalSectionScoped cs(list_cs_.get()); CriticalSectionScoped cs(list_cs_.get());
MapItem* map_item = stream_to_vie_renderer_.Find(render_id); MapItem* map_item = stream_to_vie_renderer_.Find(render_id);

View File

@ -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 * 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 * that can be found in the LICENSE file in the root of the source
@ -8,13 +8,14 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef WEBRTC_VIDEO_ENGINE_VIE_RENDER_MANAGER_H_ #ifndef WEBRTC_VIDEO_ENGINE_VIE_RENDER_MANAGER_H_ // NOLINT
#define WEBRTC_VIDEO_ENGINE_VIE_RENDER_MANAGER_H_ #define WEBRTC_VIDEO_ENGINE_VIE_RENDER_MANAGER_H_ // NOLINT
#include "system_wrappers/interface/list_wrapper.h" #include "system_wrappers/interface/list_wrapper.h"
#include "system_wrappers/interface/map_wrapper.h" #include "system_wrappers/interface/map_wrapper.h"
#include "system_wrappers/interface/scoped_ptr.h" #include "system_wrappers/interface/scoped_ptr.h"
#include "typedefs.h" #include "typedefs.h" // NOLINT
#include "video_engine/vie_manager_base.h" #include "video_engine/vie_manager_base.h"
namespace webrtc { namespace webrtc {
@ -31,8 +32,8 @@ class ViERenderManager : private ViEManagerBase {
explicit ViERenderManager(WebRtc_Word32 engine_id); explicit ViERenderManager(WebRtc_Word32 engine_id);
~ViERenderManager(); ~ViERenderManager();
WebRtc_Word32 RegisterVideoRenderModule(VideoRender& render_module); WebRtc_Word32 RegisterVideoRenderModule(VideoRender* render_module);
WebRtc_Word32 DeRegisterVideoRenderModule(VideoRender& render_module); WebRtc_Word32 DeRegisterVideoRenderModule(VideoRender* render_module);
ViERenderer* AddRenderStream(const WebRtc_Word32 render_id, ViERenderer* AddRenderStream(const WebRtc_Word32 render_id,
void* window, void* window,
@ -69,4 +70,4 @@ class ViERenderManagerScoped: private ViEManagerScopedBase {
} // namespace webrtc } // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_VIE_RENDER_MANAGER_H_ #endif // WEBRTC_VIDEO_ENGINE_VIE_RENDER_MANAGER_H_ // NOLINT

View File

@ -150,7 +150,7 @@ ViEExternalRendererImpl::ViEExternalRendererImpl()
external_renderer_format_(kVideoUnknown), external_renderer_format_(kVideoUnknown),
external_renderer_width_(0), external_renderer_width_(0),
external_renderer_height_(0), external_renderer_height_(0),
converted_frame_(new VideoFrame()){ converted_frame_(new VideoFrame()) {
} }
int ViEExternalRendererImpl::SetViEExternalRenderer( int ViEExternalRendererImpl::SetViEExternalRenderer(

View File

@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef WEBRTC_VIDEO_ENGINE_VIE_RENDERER_H_ #ifndef WEBRTC_VIDEO_ENGINE_VIE_RENDERER_H_ // NOLINT
#define WEBRTC_VIDEO_ENGINE_VIE_RENDERER_H_ #define WEBRTC_VIDEO_ENGINE_VIE_RENDERER_H_ // NOLINT
#include "modules/video_render/main/interface/video_render_defines.h" #include "modules/video_render/main/interface/video_render_defines.h"
#include "system_wrappers/interface/map_wrapper.h" #include "system_wrappers/interface/map_wrapper.h"
@ -113,4 +113,4 @@ class ViERenderer: public ViEFrameCallback {
} // namespace webrtc } // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_VIE_RENDERER_H_ #endif // WEBRTC_VIDEO_ENGINE_VIE_RENDERER_H_ // NOLINT