Fix Chromium clang plugin warnings

NOTRY=true
BUG=webrtc:163

Review-Url: https://codereview.webrtc.org/2288153002
Cr-Commit-Position: refs/heads/master@{#13964}
This commit is contained in:
kwiberg
2016-08-29 14:46:07 -07:00
committed by Commit bot
parent 31dea98e9c
commit 83ffe453ec
9 changed files with 63 additions and 26 deletions

View File

@ -239,11 +239,6 @@ source_set("audio_processing") {
# TODO(jschuh): Bug 1348: fix this warning. # TODO(jschuh): Bug 1348: fix this warning.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
if (is_clang) {
# Suppress warnings from the Chromium Clang plugins (bugs.webrtc.org/163).
configs -= [ "//build/config/clang:find_bad_constructs" ]
}
deps += [ deps += [
"../../base:rtc_base_approved", "../../base:rtc_base_approved",
"../../common_audio", "../../common_audio",

View File

@ -28,6 +28,9 @@ extern "C" {
namespace webrtc { namespace webrtc {
Aec::Aec() = default;
Aec::~Aec() = default;
// Measured delays [ms] // Measured delays [ms]
// Device Chrome GTP // Device Chrome GTP
// MacBook Air 10 // MacBook Air 10

View File

@ -65,6 +65,9 @@ struct AecCore;
class ApmDataDumper; class ApmDataDumper;
typedef struct Aec { typedef struct Aec {
Aec();
~Aec();
std::unique_ptr<ApmDataDumper> data_dumper; std::unique_ptr<ApmDataDumper> data_dumper;
int delayCtr; int delayCtr;

View File

@ -278,6 +278,20 @@ int AudioProcessingImpl::MaybeInitializeCapture(
return MaybeInitialize(processing_config); return MaybeInitialize(processing_config);
} }
#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
AudioProcessingImpl::ApmDebugDumpThreadState::ApmDebugDumpThreadState()
: event_msg(new audioproc::Event()) {}
AudioProcessingImpl::ApmDebugDumpThreadState::~ApmDebugDumpThreadState() {}
AudioProcessingImpl::ApmDebugDumpState::ApmDebugDumpState()
: debug_file(FileWrapper::Create()) {}
AudioProcessingImpl::ApmDebugDumpState::~ApmDebugDumpState() {}
#endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
// Calls InitializeLocked() if any of the audio parameters have changed from // Calls InitializeLocked() if any of the audio parameters have changed from
// their current values (needs to be called while holding the crit_render_lock). // their current values (needs to be called while holding the crit_render_lock).
int AudioProcessingImpl::MaybeInitialize( int AudioProcessingImpl::MaybeInitialize(
@ -1524,4 +1538,28 @@ int AudioProcessingImpl::WriteConfigMessage(bool forced) {
} }
#endif // WEBRTC_AUDIOPROC_DEBUG_DUMP #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
AudioProcessingImpl::ApmCaptureState::ApmCaptureState(
bool transient_suppressor_enabled,
const std::vector<Point>& array_geometry,
SphericalPointf target_direction)
: aec_system_delay_jumps(-1),
delay_offset_ms(0),
was_stream_delay_set(false),
last_stream_delay_ms(0),
last_aec_system_delay_ms(0),
stream_delay_jumps(-1),
output_will_be_muted(false),
key_pressed(false),
transient_suppressor_enabled(transient_suppressor_enabled),
array_geometry(array_geometry),
target_direction(target_direction),
fwd_proc_format(kSampleRate16kHz),
split_rate(kSampleRate16kHz) {}
AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default;
AudioProcessingImpl::ApmRenderState::ApmRenderState() = default;
AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default;
} // namespace webrtc } // namespace webrtc

View File

@ -45,7 +45,7 @@ class AudioProcessingImpl : public AudioProcessing {
explicit AudioProcessingImpl(const Config& config); explicit AudioProcessingImpl(const Config& config);
// AudioProcessingImpl takes ownership of beamformer. // AudioProcessingImpl takes ownership of beamformer.
AudioProcessingImpl(const Config& config, NonlinearBeamformer* beamformer); AudioProcessingImpl(const Config& config, NonlinearBeamformer* beamformer);
virtual ~AudioProcessingImpl(); ~AudioProcessingImpl() override;
int Initialize() override; int Initialize() override;
int Initialize(int input_sample_rate_hz, int Initialize(int input_sample_rate_hz,
int output_sample_rate_hz, int output_sample_rate_hz,
@ -133,7 +133,8 @@ class AudioProcessingImpl : public AudioProcessing {
#ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP
// State for the debug dump. // State for the debug dump.
struct ApmDebugDumpThreadState { struct ApmDebugDumpThreadState {
ApmDebugDumpThreadState() : event_msg(new audioproc::Event()) {} ApmDebugDumpThreadState();
~ApmDebugDumpThreadState();
std::unique_ptr<audioproc::Event> event_msg; // Protobuf message. std::unique_ptr<audioproc::Event> event_msg; // Protobuf message.
std::string event_str; // Memory for protobuf serialization. std::string event_str; // Memory for protobuf serialization.
@ -142,7 +143,8 @@ class AudioProcessingImpl : public AudioProcessing {
}; };
struct ApmDebugDumpState { struct ApmDebugDumpState {
ApmDebugDumpState() : debug_file(FileWrapper::Create()) {} ApmDebugDumpState();
~ApmDebugDumpState();
// Number of bytes that can still be written to the log before the maximum // Number of bytes that can still be written to the log before the maximum
// size is reached. A value of <= 0 indicates that no limit is used. // size is reached. A value of <= 0 indicates that no limit is used.
int64_t num_bytes_left_for_log_ = -1; int64_t num_bytes_left_for_log_ = -1;
@ -287,20 +289,8 @@ class AudioProcessingImpl : public AudioProcessing {
struct ApmCaptureState { struct ApmCaptureState {
ApmCaptureState(bool transient_suppressor_enabled, ApmCaptureState(bool transient_suppressor_enabled,
const std::vector<Point>& array_geometry, const std::vector<Point>& array_geometry,
SphericalPointf target_direction) SphericalPointf target_direction);
: aec_system_delay_jumps(-1), ~ApmCaptureState();
delay_offset_ms(0),
was_stream_delay_set(false),
last_stream_delay_ms(0),
last_aec_system_delay_ms(0),
stream_delay_jumps(-1),
output_will_be_muted(false),
key_pressed(false),
transient_suppressor_enabled(transient_suppressor_enabled),
array_geometry(array_geometry),
target_direction(target_direction),
fwd_proc_format(kSampleRate16kHz),
split_rate(kSampleRate16kHz) {}
int aec_system_delay_jumps; int aec_system_delay_jumps;
int delay_offset_ms; int delay_offset_ms;
bool was_stream_delay_set; bool was_stream_delay_set;
@ -342,6 +332,8 @@ class AudioProcessingImpl : public AudioProcessing {
} capture_nonlocked_; } capture_nonlocked_;
struct ApmRenderState { struct ApmRenderState {
ApmRenderState();
~ApmRenderState();
std::unique_ptr<AudioConverter> render_converter; std::unique_ptr<AudioConverter> render_converter;
std::unique_ptr<AudioBuffer> render_audio; std::unique_ptr<AudioBuffer> render_audio;
} render_ GUARDED_BY(crit_render_); } render_ GUARDED_BY(crit_render_);

View File

@ -28,7 +28,7 @@ class EchoCancellationImpl : public EchoCancellation {
public: public:
EchoCancellationImpl(rtc::CriticalSection* crit_render, EchoCancellationImpl(rtc::CriticalSection* crit_render,
rtc::CriticalSection* crit_capture); rtc::CriticalSection* crit_capture);
virtual ~EchoCancellationImpl(); ~EchoCancellationImpl() override;
int ProcessRenderAudio(const AudioBuffer* audio); int ProcessRenderAudio(const AudioBuffer* audio);
int ProcessCaptureAudio(AudioBuffer* audio, int stream_delay_ms); int ProcessCaptureAudio(AudioBuffer* audio, int stream_delay_ms);

View File

@ -29,7 +29,7 @@ class EchoControlMobileImpl : public EchoControlMobile {
EchoControlMobileImpl(rtc::CriticalSection* crit_render, EchoControlMobileImpl(rtc::CriticalSection* crit_render,
rtc::CriticalSection* crit_capture); rtc::CriticalSection* crit_capture);
virtual ~EchoControlMobileImpl(); ~EchoControlMobileImpl() override;
int ProcessRenderAudio(const AudioBuffer* audio); int ProcessRenderAudio(const AudioBuffer* audio);
int ProcessCaptureAudio(AudioBuffer* audio, int stream_delay_ms); int ProcessCaptureAudio(AudioBuffer* audio, int stream_delay_ms);

View File

@ -93,6 +93,12 @@ webrtc::SignalClassifier::SignalType ClassifySignal(
} // namespace } // namespace
SignalClassifier::FrameExtender::FrameExtender(size_t frame_size,
size_t extended_frame_size)
: x_old_(extended_frame_size - frame_size, 0.f) {}
SignalClassifier::FrameExtender::~FrameExtender() = default;
void SignalClassifier::FrameExtender::ExtendFrame( void SignalClassifier::FrameExtender::ExtendFrame(
rtc::ArrayView<const float> x, rtc::ArrayView<const float> x,
rtc::ArrayView<float> x_extended) { rtc::ArrayView<float> x_extended) {

View File

@ -37,8 +37,8 @@ class SignalClassifier {
private: private:
class FrameExtender { class FrameExtender {
public: public:
FrameExtender(size_t frame_size, size_t extended_frame_size) FrameExtender(size_t frame_size, size_t extended_frame_size);
: x_old_(extended_frame_size - frame_size, 0.f) {} ~FrameExtender();
void ExtendFrame(rtc::ArrayView<const float> x, void ExtendFrame(rtc::ArrayView<const float> x,
rtc::ArrayView<float> x_extended); rtc::ArrayView<float> x_extended);