Removed the last lint warnings in video_engine.
BUG= TEST= Review URL: https://webrtc-codereview.appspot.com/670006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2468 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
efe20b39db
commit
ab2610ffd9
@ -11,7 +11,7 @@
|
|||||||
#ifndef WEBRTC_VIDEO_ENGINE_STREAM_SYNCHRONIZATION_H_
|
#ifndef WEBRTC_VIDEO_ENGINE_STREAM_SYNCHRONIZATION_H_
|
||||||
#define WEBRTC_VIDEO_ENGINE_STREAM_SYNCHRONIZATION_H_
|
#define WEBRTC_VIDEO_ENGINE_STREAM_SYNCHRONIZATION_H_
|
||||||
|
|
||||||
#include "typedefs.h"
|
#include "typedefs.h" // NOLINT
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ int ViEBaseImpl::CreateChannel(int& video_channel) { // NOLINT
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shared_data_.channel_manager()->CreateChannel(video_channel) == -1) {
|
if (shared_data_.channel_manager()->CreateChannel(&video_channel) == -1) {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_.instance_id()),
|
WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_.instance_id()),
|
||||||
"%s: Could not create channel", __FUNCTION__);
|
"%s: Could not create channel", __FUNCTION__);
|
||||||
video_channel = -1;
|
video_channel = -1;
|
||||||
@ -439,7 +439,7 @@ int ViEBaseImpl::CreateChannel(int& video_channel, // NOLINT
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shared_data_.channel_manager()->CreateChannel(video_channel,
|
if (shared_data_.channel_manager()->CreateChannel(&video_channel,
|
||||||
original_channel,
|
original_channel,
|
||||||
sender) == -1) {
|
sender) == -1) {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_.instance_id()),
|
WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(shared_data_.instance_id()),
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include "video_engine/vie_channel_manager.h"
|
#include "video_engine/vie_channel_manager.h"
|
||||||
|
|
||||||
#include "engine_configurations.h"
|
#include "engine_configurations.h" // NOLINT
|
||||||
#include "modules/rtp_rtcp/interface/rtp_rtcp.h"
|
#include "modules/rtp_rtcp/interface/rtp_rtcp.h"
|
||||||
#include "modules/utility/interface/process_thread.h"
|
#include "modules/utility/interface/process_thread.h"
|
||||||
#include "system_wrappers/interface/critical_section_wrapper.h"
|
#include "system_wrappers/interface/critical_section_wrapper.h"
|
||||||
@ -27,7 +27,7 @@ namespace webrtc {
|
|||||||
ViEChannelManager::ViEChannelManager(
|
ViEChannelManager::ViEChannelManager(
|
||||||
int engine_id,
|
int engine_id,
|
||||||
int number_of_cores,
|
int number_of_cores,
|
||||||
ViEPerformanceMonitor& vie_performance_monitor,
|
ViEPerformanceMonitor* vie_performance_monitor,
|
||||||
const OverUseDetectorOptions& options)
|
const OverUseDetectorOptions& options)
|
||||||
: channel_id_critsect_(CriticalSectionWrapper::CreateCriticalSection()),
|
: channel_id_critsect_(CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
engine_id_(engine_id),
|
engine_id_(engine_id),
|
||||||
@ -74,12 +74,12 @@ ViEChannelManager::~ViEChannelManager() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ViEChannelManager::SetModuleProcessThread(
|
void ViEChannelManager::SetModuleProcessThread(
|
||||||
ProcessThread& module_process_thread) {
|
ProcessThread* module_process_thread) {
|
||||||
assert(!module_process_thread_);
|
assert(!module_process_thread_);
|
||||||
module_process_thread_ = &module_process_thread;
|
module_process_thread_ = module_process_thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ViEChannelManager::CreateChannel(int& channel_id) {
|
int ViEChannelManager::CreateChannel(int* channel_id) {
|
||||||
CriticalSectionScoped cs(*channel_id_critsect_);
|
CriticalSectionScoped cs(*channel_id_critsect_);
|
||||||
|
|
||||||
// Get a new channel id.
|
// Get a new channel id.
|
||||||
@ -112,13 +112,13 @@ int ViEChannelManager::CreateChannel(int& channel_id) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
channel_id = new_channel_id;
|
*channel_id = new_channel_id;
|
||||||
group->AddChannel(channel_id);
|
group->AddChannel(*channel_id);
|
||||||
channel_groups_.push_back(group);
|
channel_groups_.push_back(group);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ViEChannelManager::CreateChannel(int& channel_id,
|
int ViEChannelManager::CreateChannel(int* channel_id,
|
||||||
int original_channel,
|
int original_channel,
|
||||||
bool sender) {
|
bool sender) {
|
||||||
CriticalSectionScoped cs(*channel_id_critsect_);
|
CriticalSectionScoped cs(*channel_id_critsect_);
|
||||||
@ -167,8 +167,8 @@ int ViEChannelManager::CreateChannel(int& channel_id,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
channel_id = new_channel_id;
|
*channel_id = new_channel_id;
|
||||||
channel_group->AddChannel(channel_id);
|
channel_group->AddChannel(*channel_id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,19 +371,6 @@ ViEChannel* ViEChannelManager::ViEChannelPtr(int channel_id) const {
|
|||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViEChannelManager::GetViEChannels(MapWrapper& channel_map) {
|
|
||||||
CriticalSectionScoped cs(*channel_id_critsect_);
|
|
||||||
if (channel_map.Size() == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add all items to 'channelMap'.
|
|
||||||
for (ChannelMap::iterator it = channel_map_.begin(); it != channel_map_.end();
|
|
||||||
++it) {
|
|
||||||
channel_map.Insert(it->first, it->second);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ViEEncoder* ViEChannelManager::ViEEncoderPtr(int video_channel_id) const {
|
ViEEncoder* ViEChannelManager::ViEEncoderPtr(int video_channel_id) const {
|
||||||
CriticalSectionScoped cs(*channel_id_critsect_);
|
CriticalSectionScoped cs(*channel_id_critsect_);
|
||||||
EncoderMap::const_iterator it = vie_encoder_map_.find(video_channel_id);
|
EncoderMap::const_iterator it = vie_encoder_map_.find(video_channel_id);
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "engine_configurations.h"
|
#include "engine_configurations.h" // NOLINT
|
||||||
#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_channel_group.h"
|
#include "video_engine/vie_channel_group.h"
|
||||||
#include "video_engine/vie_defines.h"
|
#include "video_engine/vie_defines.h"
|
||||||
#include "video_engine/vie_manager_base.h"
|
#include "video_engine/vie_manager_base.h"
|
||||||
@ -43,19 +43,19 @@ class ViEChannelManager: private ViEManagerBase {
|
|||||||
public:
|
public:
|
||||||
ViEChannelManager(int engine_id,
|
ViEChannelManager(int engine_id,
|
||||||
int number_of_cores,
|
int number_of_cores,
|
||||||
ViEPerformanceMonitor& vie_performance_monitor,
|
ViEPerformanceMonitor* vie_performance_monitor,
|
||||||
const OverUseDetectorOptions& options);
|
const OverUseDetectorOptions& options);
|
||||||
~ViEChannelManager();
|
~ViEChannelManager();
|
||||||
|
|
||||||
void SetModuleProcessThread(ProcessThread& module_process_thread);
|
void SetModuleProcessThread(ProcessThread* module_process_thread);
|
||||||
|
|
||||||
// Creates a new channel. 'channelId' will be the id of the created channel.
|
// Creates a new channel. 'channel_id' will be the id of the created channel.
|
||||||
int CreateChannel(int& channel_id);
|
int CreateChannel(int* channel_id);
|
||||||
|
|
||||||
// Creates a new channel grouped with |original_channel|. The new channel
|
// Creates a new channel grouped with |original_channel|. The new channel
|
||||||
// will get its own |ViEEncoder| if |sender| is set to true. It will be a
|
// will get its own |ViEEncoder| if |sender| is set to true. It will be a
|
||||||
// receive only channel, without an own |ViEEncoder| if |sender| is false.
|
// receive only channel, without an own |ViEEncoder| if |sender| is false.
|
||||||
int CreateChannel(int& channel_id, int original_channel, bool sender);
|
int CreateChannel(int* channel_id, int original_channel, bool sender);
|
||||||
|
|
||||||
// Deletes a channel.
|
// Deletes a channel.
|
||||||
int DeleteChannel(int channel_id);
|
int DeleteChannel(int channel_id);
|
||||||
@ -82,12 +82,9 @@ class ViEChannelManager: private ViEManagerBase {
|
|||||||
RemoteBitrateEstimator* remote_bitrate_estimator);
|
RemoteBitrateEstimator* remote_bitrate_estimator);
|
||||||
|
|
||||||
// Used by ViEChannelScoped, forcing a manager user to use scoped.
|
// Used by ViEChannelScoped, forcing a manager user to use scoped.
|
||||||
// Returns a pointer to the channel with id 'channelId'.
|
// Returns a pointer to the channel with id 'channel_id'.
|
||||||
ViEChannel* ViEChannelPtr(int channel_id) const;
|
ViEChannel* ViEChannelPtr(int channel_id) const;
|
||||||
|
|
||||||
// Adds all channels to channel_map.
|
|
||||||
void GetViEChannels(MapWrapper& channel_map);
|
|
||||||
|
|
||||||
// Methods used by ViECaptureScoped and ViEEncoderScoped.
|
// Methods used by ViECaptureScoped and ViEEncoderScoped.
|
||||||
// Gets the ViEEncoder used as input for video_channel_id
|
// Gets the ViEEncoder used as input for video_channel_id
|
||||||
ViEEncoder* ViEEncoderPtr(int video_channel_id) const;
|
ViEEncoder* ViEEncoderPtr(int video_channel_id) const;
|
||||||
|
@ -193,5 +193,4 @@ int ViEFrameProviderBase::NumberOfRegisteredFrameCallbacks() {
|
|||||||
CriticalSectionScoped cs(provider_cs_.get());
|
CriticalSectionScoped cs(provider_cs_.get());
|
||||||
return frame_callbacks_.size();
|
return frame_callbacks_.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespac webrtc
|
} // namespac webrtc
|
||||||
|
@ -49,8 +49,7 @@ class ViERembTest : public ::testing::Test {
|
|||||||
scoped_ptr<VieRemb> vie_remb_;
|
scoped_ptr<VieRemb> vie_remb_;
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(ViERembTest, OneModuleTestForSendingRemb)
|
TEST_F(ViERembTest, OneModuleTestForSendingRemb) {
|
||||||
{
|
|
||||||
MockRtpRtcp rtp;
|
MockRtpRtcp rtp;
|
||||||
vie_remb_->AddReceiveChannel(&rtp);
|
vie_remb_->AddReceiveChannel(&rtp);
|
||||||
vie_remb_->AddRembSender(&rtp);
|
vie_remb_->AddRembSender(&rtp);
|
||||||
@ -78,8 +77,7 @@ TEST_F(ViERembTest, OneModuleTestForSendingRemb)
|
|||||||
vie_remb_->RemoveRembSender(&rtp);
|
vie_remb_->RemoveRembSender(&rtp);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ViERembTest, LowerEstimateToSendRemb)
|
TEST_F(ViERembTest, LowerEstimateToSendRemb) {
|
||||||
{
|
|
||||||
MockRtpRtcp rtp;
|
MockRtpRtcp rtp;
|
||||||
vie_remb_->AddReceiveChannel(&rtp);
|
vie_remb_->AddReceiveChannel(&rtp);
|
||||||
vie_remb_->AddRembSender(&rtp);
|
vie_remb_->AddRembSender(&rtp);
|
||||||
@ -100,8 +98,7 @@ TEST_F(ViERembTest, LowerEstimateToSendRemb)
|
|||||||
vie_remb_->Process();
|
vie_remb_->Process();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ViERembTest, VerifyCombinedBitrateEstimate)
|
TEST_F(ViERembTest, VerifyCombinedBitrateEstimate) {
|
||||||
{
|
|
||||||
MockRtpRtcp rtp_0;
|
MockRtpRtcp rtp_0;
|
||||||
MockRtpRtcp rtp_1;
|
MockRtpRtcp rtp_1;
|
||||||
vie_remb_->AddReceiveChannel(&rtp_0);
|
vie_remb_->AddReceiveChannel(&rtp_0);
|
||||||
@ -133,8 +130,7 @@ TEST_F(ViERembTest, VerifyCombinedBitrateEstimate)
|
|||||||
vie_remb_->RemoveReceiveChannel(&rtp_1);
|
vie_remb_->RemoveReceiveChannel(&rtp_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ViERembTest, NoRembForIncreasedBitrate)
|
TEST_F(ViERembTest, NoRembForIncreasedBitrate) {
|
||||||
{
|
|
||||||
MockRtpRtcp rtp_0;
|
MockRtpRtcp rtp_0;
|
||||||
MockRtpRtcp rtp_1;
|
MockRtpRtcp rtp_1;
|
||||||
vie_remb_->AddReceiveChannel(&rtp_0);
|
vie_remb_->AddReceiveChannel(&rtp_0);
|
||||||
@ -170,8 +166,8 @@ TEST_F(ViERembTest, NoRembForIncreasedBitrate)
|
|||||||
// Decresing the estimate less than 3% shouldn't trigger a new callback.
|
// Decresing the estimate less than 3% shouldn't trigger a new callback.
|
||||||
int lower_estimate = bitrate_estimate[0] * 98 / 100;
|
int lower_estimate = bitrate_estimate[0] * 98 / 100;
|
||||||
vie_remb_->OnReceiveBitrateChanged(ssrc[0], lower_estimate);
|
vie_remb_->OnReceiveBitrateChanged(ssrc[0], lower_estimate);
|
||||||
EXPECT_CALL(rtp_0, SetREMBData(_, _, _))
|
EXPECT_CALL(rtp_0, SetREMBData(_, _, _))
|
||||||
.Times(0);
|
.Times(0);
|
||||||
|
|
||||||
vie_remb_->Process();
|
vie_remb_->Process();
|
||||||
vie_remb_->RemoveReceiveChannel(&rtp_1);
|
vie_remb_->RemoveReceiveChannel(&rtp_1);
|
||||||
@ -179,8 +175,7 @@ TEST_F(ViERembTest, NoRembForIncreasedBitrate)
|
|||||||
vie_remb_->RemoveRembSender(&rtp_0);
|
vie_remb_->RemoveRembSender(&rtp_0);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ViERembTest, ChangeSendRtpModule)
|
TEST_F(ViERembTest, ChangeSendRtpModule) {
|
||||||
{
|
|
||||||
MockRtpRtcp rtp_0;
|
MockRtpRtcp rtp_0;
|
||||||
MockRtpRtcp rtp_1;
|
MockRtpRtcp rtp_1;
|
||||||
vie_remb_->AddReceiveChannel(&rtp_0);
|
vie_remb_->AddReceiveChannel(&rtp_0);
|
||||||
@ -225,8 +220,7 @@ TEST_F(ViERembTest, ChangeSendRtpModule)
|
|||||||
vie_remb_->RemoveReceiveChannel(&rtp_1);
|
vie_remb_->RemoveReceiveChannel(&rtp_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ViERembTest, OnlyOneRembForDoubleProcess)
|
TEST_F(ViERembTest, OnlyOneRembForDoubleProcess) {
|
||||||
{
|
|
||||||
MockRtpRtcp rtp;
|
MockRtpRtcp rtp;
|
||||||
unsigned int bitrate_estimate = 456;
|
unsigned int bitrate_estimate = 456;
|
||||||
unsigned int ssrc[] = { 1234 };
|
unsigned int ssrc[] = { 1234 };
|
||||||
@ -252,8 +246,7 @@ TEST_F(ViERembTest, OnlyOneRembForDoubleProcess)
|
|||||||
vie_remb_->RemoveRembSender(&rtp);
|
vie_remb_->RemoveRembSender(&rtp);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ViERembTest, NoOnReceivedBitrateChangedCall)
|
TEST_F(ViERembTest, NoOnReceivedBitrateChangedCall) {
|
||||||
{
|
|
||||||
MockRtpRtcp rtp;
|
MockRtpRtcp rtp;
|
||||||
EXPECT_CALL(rtp, RemoteSSRC())
|
EXPECT_CALL(rtp, RemoteSSRC())
|
||||||
.WillRepeatedly(Return(1234));
|
.WillRepeatedly(Return(1234));
|
||||||
@ -273,8 +266,7 @@ TEST_F(ViERembTest, NoOnReceivedBitrateChangedCall)
|
|||||||
|
|
||||||
// Only register receiving modules and make sure we fallback to trigger a REMB
|
// Only register receiving modules and make sure we fallback to trigger a REMB
|
||||||
// packet on this one.
|
// packet on this one.
|
||||||
TEST_F(ViERembTest, NoSendingRtpModule)
|
TEST_F(ViERembTest, NoSendingRtpModule) {
|
||||||
{
|
|
||||||
MockRtpRtcp rtp;
|
MockRtpRtcp rtp;
|
||||||
vie_remb_->AddReceiveChannel(&rtp);
|
vie_remb_->AddReceiveChannel(&rtp);
|
||||||
|
|
||||||
|
@ -8,14 +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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cpu_info.h"
|
#include "modules/utility/interface/process_thread.h"
|
||||||
#include "process_thread.h"
|
#include "system_wrappers/interface/cpu_info.h"
|
||||||
#include "trace.h"
|
#include "system_wrappers/interface/trace.h"
|
||||||
#include "vie_channel_manager.h"
|
#include "video_engine/vie_channel_manager.h"
|
||||||
#include "vie_defines.h"
|
#include "video_engine/vie_defines.h"
|
||||||
#include "vie_input_manager.h"
|
#include "video_engine/vie_input_manager.h"
|
||||||
#include "vie_render_manager.h"
|
#include "video_engine/vie_render_manager.h"
|
||||||
#include "vie_shared_data.h"
|
#include "video_engine/vie_shared_data.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
@ -29,14 +29,14 @@ ViESharedData::ViESharedData()
|
|||||||
over_use_detector_options_(),
|
over_use_detector_options_(),
|
||||||
vie_performance_monitor_(ViEPerformanceMonitor(instance_id_)),
|
vie_performance_monitor_(ViEPerformanceMonitor(instance_id_)),
|
||||||
channel_manager_(*new ViEChannelManager(instance_id_, number_cores_,
|
channel_manager_(*new ViEChannelManager(instance_id_, number_cores_,
|
||||||
vie_performance_monitor_,
|
&vie_performance_monitor_,
|
||||||
over_use_detector_options_)),
|
over_use_detector_options_)),
|
||||||
input_manager_(*new ViEInputManager(instance_id_)),
|
input_manager_(*new ViEInputManager(instance_id_)),
|
||||||
render_manager_(*new ViERenderManager(instance_id_)),
|
render_manager_(*new ViERenderManager(instance_id_)),
|
||||||
module_process_thread_(ProcessThread::CreateProcessThread()),
|
module_process_thread_(ProcessThread::CreateProcessThread()),
|
||||||
last_error_(0) {
|
last_error_(0) {
|
||||||
Trace::CreateTrace();
|
Trace::CreateTrace();
|
||||||
channel_manager_.SetModuleProcessThread(*module_process_thread_);
|
channel_manager_.SetModuleProcessThread(module_process_thread_);
|
||||||
input_manager_.SetModuleProcessThread(module_process_thread_);
|
input_manager_.SetModuleProcessThread(module_process_thread_);
|
||||||
module_process_thread_->Start();
|
module_process_thread_->Start();
|
||||||
}
|
}
|
||||||
|
@ -8,14 +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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "vie_sync_module.h"
|
#include "video_engine/vie_sync_module.h"
|
||||||
|
|
||||||
#include "critical_section_wrapper.h"
|
#include "modules/rtp_rtcp/interface/rtp_rtcp.h"
|
||||||
#include "rtp_rtcp.h"
|
#include "modules/video_coding/main/interface/video_coding.h"
|
||||||
#include "trace.h"
|
#include "system_wrappers/interface/critical_section_wrapper.h"
|
||||||
#include "video_coding.h"
|
#include "system_wrappers/interface/trace.h"
|
||||||
#include "voe_video_sync.h"
|
|
||||||
#include "video_engine/stream_synchronization.h"
|
#include "video_engine/stream_synchronization.h"
|
||||||
|
#include "voice_engine/main/interface/voe_video_sync.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user