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;
{
// Write lock to make sure no one is using the channel.
ViEManagerWriteScoped wl(*this);
ViEManagerWriteScoped wl(this);
// Protect the maps.
CriticalSectionScoped cs(*channel_id_critsect_);
@ -251,7 +251,7 @@ int ViEChannelManager::DeleteChannel(int channel_id) {
int ViEChannelManager::SetVoiceEngine(VoiceEngine* voice_engine) {
// Write lock to make sure no one is using the channel.
ViEManagerWriteScoped wl(*this);
ViEManagerWriteScoped wl(this);
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
* 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.
*/
/*
* vie_defines.h
*/
#ifndef WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_ // NOLINT
#define WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_ // NOLINT
#ifndef WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_
#define WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_
#include "engine_configurations.h"
#ifdef WEBRTC_MAC_INTEL
#include <stdio.h>
#include <unistd.h>
#endif
#include "engine_configurations.h" // NOLINT
// TODO(mflodman) Remove.
#ifdef WEBRTC_ANDROID
#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <linux/net.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include <arpa/inet.h> // NOLINT
#include <linux/net.h> // NOLINT
#include <netinet/in.h> // NOLINT
#include <pthread.h> // NOLINT
#include <stdio.h> // NOLINT
#include <stdlib.h> // NOLINT
#include <string.h> // NOLINT
#include <sys/types.h> // NOLINT
#include <sys/socket.h> // NOLINT
#include <sys/time.h> // NOLINT
#include <time.h> // NOLINT
#endif
namespace webrtc
{
// ===================================================
// ViE Defines
// ===================================================
namespace webrtc {
// General
enum { kViEMinKeyRequestIntervalMs = 300};
enum { kViEMinKeyRequestIntervalMs = 300 };
// ViEBase
enum { kViEMaxNumberOfChannels = 32};
enum { kViEMaxNumberOfChannels = 32 };
enum { kViEVersionMaxMessageSize = 1024 };
enum { kViEMaxModuleVersionSize = 960 };
// ViECapture
enum { kViEMaxCaptureDevices=10};
// Width used if no send codec has been set when a capture device is started
enum { kViECaptureDefaultWidth = 352};
// Height used if no send codec has been set when a capture device is started
enum { kViECaptureDefaultHeight = 288};
enum { kViECaptureDefaultFramerate = 30};
enum { kViEMaxCaptureDevices = 10 };
enum { kViECaptureDefaultWidth = 352 };
enum { kViECaptureDefaultHeight = 288 };
enum { kViECaptureDefaultFramerate = 30 };
enum { kViECaptureMaxSnapshotWaitTimeMs = 500 };
// ViECodec
enum { kViEMaxCodecWidth = 1920};
enum { kViEMaxCodecHeight = 1200};
enum { kViEMaxCodecFramerate = 60};
enum { kViEMinCodecBitrate = 30};
enum { kViEMaxCodecWidth = 1920 };
enum { kViEMaxCodecHeight = 1200 };
enum { kViEMaxCodecFramerate = 60 };
enum { kViEMinCodecBitrate = 30 };
// ViEEncryption
enum { kViEMaxSrtpKeyLength = 30};
enum { kViEMinSrtpEncryptLength = 16};
enum { kViEMaxSrtpEncryptLength = 256};
enum { kViEMaxSrtpAuthSh1Length = 20};
enum { kViEMaxSrtpTagAuthNullLength = 12};
enum { kViEMaxSrtpKeyAuthNullLength = 256};
// ViEExternalCodec
enum { kViEMaxSrtpKeyLength = 30 };
enum { kViEMinSrtpEncryptLength = 16 };
enum { kViEMaxSrtpEncryptLength = 256 };
enum { kViEMaxSrtpAuthSh1Length = 20 };
enum { kViEMaxSrtpTagAuthNullLength = 12 };
enum { kViEMaxSrtpKeyAuthNullLength = 256 };
// ViEFile
enum { kViEMaxFilePlayers = 3};
// ViEImageProcess
enum { kViEMaxFilePlayers = 3 };
// ViENetwork
enum { kViEMaxMtu = 1500};
enum { kViESocketThreads = 1};
enum { kViENumReceiveSocketBuffers = 500};
enum { kViEMaxMtu = 1500 };
enum { kViESocketThreads = 1 };
enum { kViENumReceiveSocketBuffers = 500 };
// ViERender
// Max valid time set in SetRenderTimeoutImage
enum { kViEMaxRenderTimeoutTimeMs = 10000};
enum { kViEMaxRenderTimeoutTimeMs = 10000 };
// Min valid time set in SetRenderTimeoutImage
enum { kViEMinRenderTimeoutTimeMs = 33};
enum { kViEDefaultRenderDelayMs = 10};
enum { kViEMinRenderTimeoutTimeMs = 33 };
enum { kViEDefaultRenderDelayMs = 10 };
// ViERTP_RTCP
enum { kNackHistorySize = 400};
enum { kNackHistorySize = 400 };
// Id definitions
enum {
kViEChannelIdBase=0x0,
kViEChannelIdMax=0xFF,
kViECaptureIdBase=0x1001,
kViECaptureIdMax=0x10FF,
kViEFileIdBase=0x2000,
kViEFileIdMax=0x200F,
kViEDummyChannelId=0xFFFF
kViEChannelIdBase = 0x0,
kViEChannelIdMax = 0xFF,
kViECaptureIdBase = 0x1001,
kViECaptureIdMax = 0x10FF,
kViEFileIdBase = 0x2000,
kViEFileIdMax = 0x200F,
kViEDummyChannelId = 0xFFFF
};
// Module id
// Create a unique id based on the ViE instance id and the
// channel id. ViE id > 0 and 0 <= channel id <= 255
inline int ViEId(const int vieId, const int channelId = -1)
{
if (channelId == -1)
{
return (int) ((vieId << 16) + kViEDummyChannelId);
}
return (int) ((vieId << 16) + channelId);
inline int ViEId(const int vieId, const int channelId = -1) {
if (channelId == -1) {
return static_cast<int>((vieId << 16) + kViEDummyChannelId);
}
return static_cast<int>((vieId << 16) + channelId);
}
inline int ViEModuleId(const int vieId, const int channelId = -1)
{
if (channelId == -1)
{
return (int) ((vieId << 16) + kViEDummyChannelId);
}
return (int) ((vieId << 16) + channelId);
inline int ViEModuleId(const int vieId, const int channelId = -1) {
if (channelId == -1) {
return static_cast<int>((vieId << 16) + kViEDummyChannelId);
}
return static_cast<int>((vieId << 16) + channelId);
}
inline int ChannelId(const int moduleId)
{
return (int) (moduleId & 0xffff);
inline int ChannelId(const int moduleId) {
return static_cast<int>(moduleId & 0xffff);
}
// ============================================================================
// Platform specifics
// ============================================================================
//-------------------------------------
// Windows
//-------------------------------------
// Windows specific.
#if defined(_WIN32)
// Build information macros
#if defined(_DEBUG)
#define BUILDMODE TEXT("d")
#elif defined(DEBUG)
#define BUILDMODE TEXT("d")
#elif defined(NDEBUG)
#define BUILDMODE TEXT("r")
#else
#define BUILDMODE TEXT("?")
#endif
// Build information macros
#if defined(_DEBUG)
#define BUILDMODE TEXT("d")
#elif defined(DEBUG)
#define BUILDMODE TEXT("d")
#elif defined(NDEBUG)
#define BUILDMODE TEXT("r")
#else
#define BUILDMODE TEXT("?")
#endif
#define BUILDTIME TEXT(__TIME__)
#define BUILDDATE TEXT(__DATE__)
#define BUILDTIME TEXT(__TIME__)
#define BUILDDATE TEXT(__DATE__)
// example: "Oct 10 2002 12:05:30 r"
#define BUILDINFO BUILDDATE TEXT(" ") BUILDTIME TEXT(" ") BUILDMODE
// Example: "Oct 10 2002 12:05:30 r".
#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
// 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)
// Include libraries.
#pragma comment(lib, "winmm.lib")
// Include libraries
#pragma comment( lib, "winmm.lib" )
#ifndef WEBRTC_EXTERNAL_TRANSPORT
#pragma comment( lib, "ws2_32.lib" )
#pragma comment( lib, "Iphlpapi.lib" ) // _GetAdaptersAddresses
#endif
#ifndef WEBRTC_EXTERNAL_TRANSPORT
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "Iphlpapi.lib") // _GetAdaptersAddresses
#endif
#endif
//-------------------------------------
// Mac
//-------------------------------------
// Mac specific.
#ifdef WEBRTC_MAC_INTEL
#define SLEEP(x) usleep(x * 1000)
#define SLEEP(x) usleep(x * 1000)
// Build information macros
#define TEXT(x) x
#if defined(_DEBUG)
#define BUILDMODE TEXT("d")
#elif defined(DEBUG)
#define BUILDMODE TEXT("d")
#elif defined(NDEBUG)
#define BUILDMODE TEXT("r")
#else
#define BUILDMODE TEXT("?")
#endif
// Build information macros.
#define TEXT(x) x
#if defined(_DEBUG)
#define BUILDMODE TEXT("d")
#elif defined(DEBUG)
#define BUILDMODE TEXT("d")
#elif defined(NDEBUG)
#define BUILDMODE TEXT("r")
#else
#define BUILDMODE TEXT("?")
#endif
#define BUILDTIME TEXT(__TIME__)
#define BUILDDATE TEXT(__DATE__)
#define BUILDTIME TEXT(__TIME__)
#define BUILDDATE TEXT(__DATE__)
// example: "Oct 10 2002 12:05:30 r"
#define BUILDINFO BUILDDATE TEXT(" ") BUILDTIME TEXT(" ") BUILDMODE
#define RENDER_MODULE_TYPE kRenderWindows
// Example: "Oct 10 2002 12:05:30 r".
#define BUILDINFO BUILDDATE TEXT(" ") BUILDTIME TEXT(" ") BUILDMODE
#define RENDER_MODULE_TYPE kRenderWindows
#endif
//-------------------------------------
// Linux
//-------------------------------------
// Linux specific.
#ifndef WEBRTC_ANDROID
#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
#if defined(_DEBUG)
#define BUILDMODE "d"
#elif defined(DEBUG)
#define BUILDMODE "d"
#elif defined(NDEBUG)
#define BUILDMODE "r"
#else
#define BUILDMODE "?"
#endif
#define BUILDTIME __TIME__
#define BUILDDATE __DATE__
#define BUILDTIME __TIME__
#define BUILDDATE __DATE__
// example: "Oct 10 2002 12:05:30 r"
#define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE
#endif // ifdef WEBRTC_LINUX
#endif // ifndef WEBRTC_ANDROID
// Example: "Oct 10 2002 12:05:30 r".
#define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE
#endif // WEBRTC_LINUX
#endif // WEBRTC_ANDROID
// Android specific.
#ifdef WEBRTC_ANDROID
#define FAR
#define __cdecl
#define FAR
#define __cdecl
#if defined(_DEBUG)
#define BUILDMODE "d"
#elif defined(DEBUG)
#define BUILDMODE "d"
#elif defined(NDEBUG)
#define BUILDMODE "r"
#else
#define BUILDMODE "?"
#endif
#if defined(_DEBUG)
#define BUILDMODE "d"
#elif defined(DEBUG)
#define BUILDMODE "d"
#elif defined(NDEBUG)
#define BUILDMODE "r"
#else
#define BUILDMODE "?"
#endif
#define BUILDTIME __TIME__
#define BUILDDATE __DATE__
#define BUILDTIME __TIME__
#define BUILDDATE __DATE__
// Example: "Oct 10 2002 12:05:30 r".
#define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE
// example: "Oct 10 2002 12:05:30 r"
#define BUILDINFO BUILDDATE " " BUILDTIME " " BUILDMODE
#endif // WEBRTC_ANDROID
#endif // #ifdef WEBRTC_ANDROID
} // namespace webrtc
} //namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_H_
#endif // WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_DEFINES_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
* 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.
*/
#ifndef WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_
#define WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_
#ifndef WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_ // NOLINT
#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_base_impl.h"
@ -112,4 +112,4 @@ class VideoEngineImpl
} // 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.
// 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());
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.
// 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());
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
* 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.
*/
#include "assert.h"
#include <assert.h>
#include "system_wrappers/interface/rw_lock_wrapper.h"
#include "video_engine/vie_manager_base.h"
@ -50,8 +50,8 @@ ViEManagerScopedBase::~ViEManagerScopedBase() {
vie_manager_->ReleaseLockManager();
}
ViEManagerWriteScoped::ViEManagerWriteScoped(ViEManagerBase& vie_manager)
: vie_manager_(&vie_manager) {
ViEManagerWriteScoped::ViEManagerWriteScoped(ViEManagerBase* vie_manager)
: vie_manager_(vie_manager) {
vie_manager_->WriteLockManager();
}
@ -60,13 +60,13 @@ ViEManagerWriteScoped::~ViEManagerWriteScoped() {
}
ViEManagedItemScopedBase::ViEManagedItemScopedBase(
ViEManagerScopedBase& vie_scoped_manager)
ViEManagerScopedBase* vie_scoped_manager)
: vie_scoped_manager_(vie_scoped_manager) {
vie_scoped_manager_.ref_count_++;
vie_scoped_manager_->ref_count_++;
}
ViEManagedItemScopedBase::~ViEManagedItemScopedBase() {
vie_scoped_manager_.ref_count_--;
vie_scoped_manager_->ref_count_--;
}
} // 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
* 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.
*/
#ifndef WEBRTC_VIDEO_ENGINE_VIE_MANAGER_BASE_H_
#define WEBRTC_VIDEO_ENGINE_VIE_MANAGER_BASE_H_
#ifndef WEBRTC_VIDEO_ENGINE_VIE_MANAGER_BASE_H_ // NOLINT
#define WEBRTC_VIDEO_ENGINE_VIE_MANAGER_BASE_H_ // NOLINT
namespace webrtc {
class RWLockWrapper;
class ViEManagerBase {
friend class ViEManagerScopedBase;
friend class ViEManagedItemScopedBase;
friend class ViEManagerScopedBase;
friend class ViEManagerWriteScoped;
public:
ViEManagerBase();
~ViEManagerBase();
private:
// Exclusive lock, used by ViEManagerWriteScoped
// Exclusive lock, used by ViEManagerWriteScoped.
void WriteLockManager();
// Releases exclusive lock, used by ViEManagerWriteScoped.
@ -41,7 +41,7 @@ class ViEManagerBase {
class ViEManagerWriteScoped {
public:
explicit ViEManagerWriteScoped(ViEManagerBase& vie_manager);
explicit ViEManagerWriteScoped(ViEManagerBase* vie_manager);
~ViEManagerWriteScoped();
private:
@ -63,12 +63,13 @@ class ViEManagerScopedBase {
class ViEManagedItemScopedBase {
public:
explicit ViEManagedItemScopedBase(ViEManagerScopedBase& vie_scoped_manager);
explicit ViEManagedItemScopedBase(ViEManagerScopedBase* vie_scoped_manager);
~ViEManagedItemScopedBase();
protected:
ViEManagerScopedBase& vie_scoped_manager_;
ViEManagerScopedBase* vie_scoped_manager_;
};
} // 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
* 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.
*/
#include "vie_performance_monitor.h"
#include "video_engine/vie_performance_monitor.h"
#include "cpu_wrapper.h"
#include "critical_section_wrapper.h"
#include "event_wrapper.h"
#include "thread_wrapper.h"
#include "tick_util.h"
#include "trace.h"
#include "vie_base.h"
#include "vie_defines.h"
#include "system_wrappers/interface/cpu_wrapper.h"
#include "system_wrappers/interface/critical_section_wrapper.h"
#include "system_wrappers/interface/event_wrapper.h"
#include "system_wrappers/interface/thread_wrapper.h"
#include "system_wrappers/interface/tick_util.h"
#include "system_wrappers/interface/trace.h"
#include "video_engine/include/vie_base.h"
#include "video_engine/vie_defines.h"
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
* 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
// callback when getting over a specified threshold.
#ifndef WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_
#define WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_
#ifndef WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_ // NOLINT
#define WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_ // NOLINT
#include "system_wrappers/interface/scoped_ptr.h"
#include "typedefs.h"
#include "vie_defines.h"
#include "typedefs.h" // NOLINT
#include "video_engine/vie_defines.h"
namespace webrtc {
class CriticalSectionWrapper;
class CpuWrapper;
class CriticalSectionWrapper;
class EventWrapper;
class ThreadWrapper;
class ViEBaseObserver;
@ -51,4 +51,4 @@ class ViEPerformanceMonitor {
} // 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()),
"%s (&render_module: %p)", __FUNCTION__, &render_module);
if (shared_data_->render_manager()->RegisterVideoRenderModule(
render_module) != 0) {
&render_module) != 0) {
shared_data_->SetLastError(kViERenderUnknownError);
return -1;
}
@ -87,7 +87,7 @@ int ViERenderImpl::DeRegisterVideoRenderModule(
WEBRTC_TRACE(kTraceApiCall, kTraceVideo, ViEId(shared_data_->instance_id()),
"%s (&render_module: %p)", __FUNCTION__, &render_module);
if (shared_data_->render_manager()->DeRegisterVideoRenderModule(
render_module) != 0) {
&render_module) != 0) {
// Error logging is done in ViERenderManager::DeRegisterVideoRenderModule.
shared_data_->SetLastError(kViERenderUnknownError);
return -1;

View File

@ -10,7 +10,7 @@
#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_defines.h"
#include "system_wrappers/interface/critical_section_wrapper.h"
@ -55,28 +55,28 @@ ViERenderManager::~ViERenderManager() {
}
WebRtc_Word32 ViERenderManager::RegisterVideoRenderModule(
VideoRender& render_module) {
VideoRender* render_module) {
// See if there is already a render module registered for the window that
// the registrant render module is associated with.
VideoRender* current_module = FindRenderModule(render_module.Window());
VideoRender* current_module = FindRenderModule(render_module->Window());
if (current_module) {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_),
"A module is already registered for this window (window=%p, "
"current module=%p, registrant module=%p.",
render_module.Window(), current_module, &render_module);
render_module->Window(), current_module, render_module);
return -1;
}
// Register module.
render_list_.PushBack(static_cast<void*>(&render_module));
render_list_.PushBack(static_cast<void*>(render_module));
use_external_render_module_ = true;
return 0;
}
WebRtc_Word32 ViERenderManager::DeRegisterVideoRenderModule(
VideoRender& render_module) {
VideoRender* render_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) {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_),
"There are still %d streams in this module, cannot "
@ -89,7 +89,7 @@ WebRtc_Word32 ViERenderManager::DeRegisterVideoRenderModule(
bool found = false;
for (list_item = render_list_.First(); list_item != NULL;
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.
render_list_.Erase(list_item);
found = true;
@ -154,7 +154,7 @@ WebRtc_Word32 ViERenderManager::RemoveRenderStream(
const WebRtc_Word32 render_id) {
// We need exclusive right to the items in the render manager to delete a
// stream.
ViEManagerWriteScoped scope(*this);
ViEManagerWriteScoped scope(this);
CriticalSectionScoped cs(list_cs_.get());
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
* 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.
*/
#ifndef WEBRTC_VIDEO_ENGINE_VIE_RENDER_MANAGER_H_
#define WEBRTC_VIDEO_ENGINE_VIE_RENDER_MANAGER_H_
#ifndef WEBRTC_VIDEO_ENGINE_VIE_RENDER_MANAGER_H_ // NOLINT
#define WEBRTC_VIDEO_ENGINE_VIE_RENDER_MANAGER_H_ // NOLINT
#include "system_wrappers/interface/list_wrapper.h"
#include "system_wrappers/interface/map_wrapper.h"
#include "system_wrappers/interface/scoped_ptr.h"
#include "typedefs.h"
#include "typedefs.h" // NOLINT
#include "video_engine/vie_manager_base.h"
namespace webrtc {
@ -31,8 +32,8 @@ class ViERenderManager : private ViEManagerBase {
explicit ViERenderManager(WebRtc_Word32 engine_id);
~ViERenderManager();
WebRtc_Word32 RegisterVideoRenderModule(VideoRender& render_module);
WebRtc_Word32 DeRegisterVideoRenderModule(VideoRender& render_module);
WebRtc_Word32 RegisterVideoRenderModule(VideoRender* render_module);
WebRtc_Word32 DeRegisterVideoRenderModule(VideoRender* render_module);
ViERenderer* AddRenderStream(const WebRtc_Word32 render_id,
void* window,
@ -69,4 +70,4 @@ class ViERenderManagerScoped: private ViEManagerScopedBase {
} // 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_width_(0),
external_renderer_height_(0),
converted_frame_(new VideoFrame()){
converted_frame_(new VideoFrame()) {
}
int ViEExternalRendererImpl::SetViEExternalRenderer(

View File

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