Remove ChangeUniqueID.

This fixes a two year old TODO of deleting dead code :)
In cases where the _id or id_ member variable is being used for tracing,
I changed the member to at least be const.

It doesn't look like id's are that useful anymore so maybe the next step is to get rid of them.

BUG=
R=henrika@webrtc.org, perkj@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8201}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8201 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
tommi@webrtc.org
2015-01-29 12:12:49 +00:00
parent 1ece0cbbec
commit 4161715e3f
71 changed files with 32 additions and 392 deletions

View File

@ -15,18 +15,12 @@
namespace webrtc {
VPMBrightnessDetection::VPMBrightnessDetection() :
id_(0) {
VPMBrightnessDetection::VPMBrightnessDetection() {
Reset();
}
VPMBrightnessDetection::~VPMBrightnessDetection() {}
int32_t VPMBrightnessDetection::ChangeUniqueId(const int32_t id) {
id_ = id;
return VPM_OK;
}
void VPMBrightnessDetection::Reset() {
frame_cnt_bright_ = 0;
frame_cnt_dark_ = 0;

View File

@ -22,15 +22,12 @@ class VPMBrightnessDetection {
public:
VPMBrightnessDetection();
~VPMBrightnessDetection();
int32_t ChangeUniqueId(int32_t id);
void Reset();
int32_t ProcessFrame(const I420VideoFrame& frame,
const VideoProcessingModule::FrameStats& stats);
private:
int32_t id_;
uint32_t frame_cnt_bright_;
uint32_t frame_cnt_dark_;
};

View File

@ -51,18 +51,12 @@ const uint16_t VPMDeflickering::prob_uw16_[kNumProbs] = {102, 205, 410, 614,
const uint16_t VPMDeflickering::weight_uw16_[kNumQuants - kMaxOnlyLength] =
{16384, 18432, 20480, 22528, 24576, 26624, 28672, 30720, 32768}; // <Q15>
VPMDeflickering::VPMDeflickering()
: id_(0) {
VPMDeflickering::VPMDeflickering() {
Reset();
}
VPMDeflickering::~VPMDeflickering() {}
int32_t VPMDeflickering::ChangeUniqueId(const int32_t id) {
id_ = id;
return 0;
}
void VPMDeflickering::Reset() {
mean_buffer_length_ = 0;
detection_state_ = 0;

View File

@ -23,8 +23,6 @@ class VPMDeflickering {
VPMDeflickering();
~VPMDeflickering();
int32_t ChangeUniqueId(int32_t id);
void Reset();
int32_t ProcessFrame(I420VideoFrame* frame,
VideoProcessingModule::FrameStats* stats);
@ -41,8 +39,6 @@ class VPMDeflickering {
enum { kNumQuants = kNumProbs + 2 };
enum { kMaxOnlyLength = 5 };
int32_t id_;
uint32_t mean_buffer_length_;
uint8_t detection_state_; // 0: No flickering
// 1: Flickering detected

View File

@ -13,8 +13,7 @@
namespace webrtc {
VPMFramePreprocessor::VPMFramePreprocessor()
: id_(0),
content_metrics_(NULL),
: content_metrics_(NULL),
resampled_frame_(),
enable_ca_(false),
frame_cnt_(0) {
@ -30,11 +29,6 @@ VPMFramePreprocessor::~VPMFramePreprocessor() {
delete vd_;
}
int32_t VPMFramePreprocessor::ChangeUniqueId(const int32_t id) {
id_ = id;
return VPM_OK;
}
void VPMFramePreprocessor::Reset() {
ca_->Release();
vd_->Reset();

View File

@ -27,8 +27,6 @@ class VPMFramePreprocessor {
VPMFramePreprocessor();
~VPMFramePreprocessor();
int32_t ChangeUniqueId(const int32_t id);
void Reset();
// Enable temporal decimation.
@ -63,7 +61,6 @@ class VPMFramePreprocessor {
// we can compute new content metrics every |kSkipFrameCA| frames.
enum { kSkipFrameCA = 2 };
int32_t id_;
VideoContentMetrics* content_metrics_;
I420VideoFrame resampled_frame_;
VPMSpatialResampler* spatial_resampler_;

View File

@ -46,26 +46,8 @@ void VideoProcessingModule::Destroy(VideoProcessingModule* module) {
delete static_cast<VideoProcessingModuleImpl*>(module);
}
int32_t VideoProcessingModuleImpl::ChangeUniqueId(const int32_t id) {
CriticalSectionScoped mutex(&mutex_);
id_ = id;
brightness_detection_.ChangeUniqueId(id);
deflickering_.ChangeUniqueId(id);
frame_pre_processor_.ChangeUniqueId(id);
return VPM_OK;
}
int32_t VideoProcessingModuleImpl::Id() const {
CriticalSectionScoped mutex(&mutex_);
return id_;
}
VideoProcessingModuleImpl::VideoProcessingModuleImpl(const int32_t id)
: id_(id),
mutex_(*CriticalSectionWrapper::CreateCriticalSection()) {
brightness_detection_.ChangeUniqueId(id);
deflickering_.ChangeUniqueId(id);
frame_pre_processor_.ChangeUniqueId(id);
: mutex_(*CriticalSectionWrapper::CreateCriticalSection()) {
}
VideoProcessingModuleImpl::~VideoProcessingModuleImpl() {

View File

@ -27,10 +27,6 @@ class VideoProcessingModuleImpl : public VideoProcessingModule {
virtual ~VideoProcessingModuleImpl();
int32_t Id() const;
virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE;
virtual void Reset() OVERRIDE;
virtual int32_t Deflickering(I420VideoFrame* frame,
@ -70,11 +66,10 @@ class VideoProcessingModuleImpl : public VideoProcessingModule {
virtual VideoContentMetrics* ContentMetrics() const OVERRIDE;
private:
int32_t id_;
CriticalSectionWrapper& mutex_;
VPMDeflickering deflickering_;
VPMBrightnessDetection brightness_detection_;
VPMFramePreprocessor frame_pre_processor_;
VPMFramePreprocessor frame_pre_processor_;
};
} // namespace