Enable cpplint for more webrtc subfolders and fix all uncovered cpplint errors.
This CL enableds cpplint for webrtc/common_video, webrtc/sound and webrtc/tools. BUG=webrtc:5273 TESTED=Fixed issues reported by: find webrtc/common_video webrtc/sound webrtc/tools -type f -name *.cc -o -name *.h | xargs cpplint.py followed by 'git cl presubmit'. Review URL: https://codereview.webrtc.org/1511603004 Cr-Commit-Position: refs/heads/master@{#10967}
This commit is contained in:
parent
162abd3562
commit
0f2e939a92
@ -18,8 +18,11 @@ import sys
|
||||
CPPLINT_DIRS = [
|
||||
'webrtc/audio',
|
||||
'webrtc/call',
|
||||
'webrtc/common_video',
|
||||
'webrtc/examples',
|
||||
'webrtc/modules/video_processing',
|
||||
'webrtc/sound',
|
||||
'webrtc/tools',
|
||||
'webrtc/video',
|
||||
]
|
||||
|
||||
|
||||
@ -8,8 +8,6 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/video_frame.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
@ -17,6 +15,7 @@
|
||||
#include "webrtc/base/bind.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/test/fake_texture_frame.h"
|
||||
#include "webrtc/video_frame.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -174,7 +173,7 @@ TEST(TestVideoFrame, ShallowCopy) {
|
||||
|
||||
TEST(TestVideoFrame, Reset) {
|
||||
VideoFrame frame;
|
||||
ASSERT_TRUE(frame.CreateEmptyFrame(5, 5, 5, 5, 5) == 0);
|
||||
ASSERT_EQ(frame.CreateEmptyFrame(5, 5, 5, 5, 5), 0);
|
||||
frame.set_ntp_time_ms(1);
|
||||
frame.set_timestamp(2);
|
||||
frame.set_render_time_ms(3);
|
||||
|
||||
@ -152,6 +152,7 @@ int ConvertNV12ToRGB565(const uint8_t* src_frame,
|
||||
double I420PSNR(const VideoFrame* ref_frame, const VideoFrame* test_frame);
|
||||
// Compute SSIM for an I420 frame (all planes).
|
||||
double I420SSIM(const VideoFrame* ref_frame, const VideoFrame* test_frame);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_
|
||||
|
||||
@ -346,4 +346,4 @@ TEST_F(TestLibYuv, StrideAlignment) {
|
||||
EXPECT_EQ(64, stride_uv);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace webrtc
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#include "webrtc/sound/alsasoundsystem.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
#include "webrtc/base/arraysize.h"
|
||||
#include "webrtc/base/common.h"
|
||||
@ -259,12 +260,12 @@ class AlsaInputStream :
|
||||
}
|
||||
|
||||
bool GetVolume(int *volume) override {
|
||||
// TODO: Implement this.
|
||||
// TODO(henrika): Implement this.
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SetVolume(int volume) override {
|
||||
// TODO: Implement this.
|
||||
// TODO(henrika): Implement this.
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -390,12 +391,12 @@ class AlsaOutputStream : public SoundOutputStreamInterface,
|
||||
}
|
||||
|
||||
bool GetVolume(int *volume) override {
|
||||
// TODO: Implement this.
|
||||
// TODO(henrika): Implement this.
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SetVolume(int volume) override {
|
||||
// TODO: Implement this.
|
||||
// TODO(henrika): Implement this.
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -569,7 +570,6 @@ bool AlsaSoundSystem::EnumerateDevices(
|
||||
strcmp(name, ignore_null) != 0 &&
|
||||
strcmp(name, ignore_pulse) != 0 &&
|
||||
!rtc::starts_with(name, ignore_prefix)) {
|
||||
|
||||
// Yes, we do.
|
||||
char *desc = symbol_table_.snd_device_name_get_hint()(*list, "DESC");
|
||||
if (!desc) {
|
||||
@ -622,7 +622,6 @@ StreamInterface *AlsaSoundSystem::OpenDevice(
|
||||
int wait_timeout_ms,
|
||||
int flags,
|
||||
int freq)) {
|
||||
|
||||
if (!IsInitialized()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#ifdef HAVE_LIBPULSE
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
#include "webrtc/base/arraysize.h"
|
||||
#include "webrtc/base/common.h"
|
||||
@ -216,17 +217,6 @@ class PulseAudioStream {
|
||||
class PulseAudioInputStream :
|
||||
public SoundInputStreamInterface,
|
||||
private rtc::Worker {
|
||||
|
||||
struct GetVolumeCallbackData {
|
||||
PulseAudioInputStream *instance;
|
||||
pa_cvolume *channel_volumes;
|
||||
};
|
||||
|
||||
struct GetSourceChannelCountCallbackData {
|
||||
PulseAudioInputStream *instance;
|
||||
uint8_t *channels;
|
||||
};
|
||||
|
||||
public:
|
||||
PulseAudioInputStream(PulseAudioSoundSystem *pulse,
|
||||
pa_stream *stream,
|
||||
@ -386,6 +376,16 @@ class PulseAudioInputStream :
|
||||
}
|
||||
|
||||
private:
|
||||
struct GetVolumeCallbackData {
|
||||
PulseAudioInputStream* instance;
|
||||
pa_cvolume* channel_volumes;
|
||||
};
|
||||
|
||||
struct GetSourceChannelCountCallbackData {
|
||||
PulseAudioInputStream* instance;
|
||||
uint8_t* channels;
|
||||
};
|
||||
|
||||
void Lock() {
|
||||
stream_.Lock();
|
||||
}
|
||||
@ -580,12 +580,6 @@ class PulseAudioInputStream :
|
||||
class PulseAudioOutputStream :
|
||||
public SoundOutputStreamInterface,
|
||||
private rtc::Worker {
|
||||
|
||||
struct GetVolumeCallbackData {
|
||||
PulseAudioOutputStream *instance;
|
||||
pa_cvolume *channel_volumes;
|
||||
};
|
||||
|
||||
public:
|
||||
PulseAudioOutputStream(PulseAudioSoundSystem *pulse,
|
||||
pa_stream *stream,
|
||||
@ -733,7 +727,7 @@ class PulseAudioOutputStream :
|
||||
}
|
||||
|
||||
#if 0
|
||||
// TODO: Versions 0.9.16 and later of Pulse have a new API for
|
||||
// TODO(henrika): Versions 0.9.16 and later of Pulse have a new API for
|
||||
// zero-copy writes, but Hardy is not new enough to have that so we can't
|
||||
// rely on it. Perhaps auto-detect if it's present or not and use it if we
|
||||
// can?
|
||||
@ -777,6 +771,11 @@ class PulseAudioOutputStream :
|
||||
#endif
|
||||
|
||||
private:
|
||||
struct GetVolumeCallbackData {
|
||||
PulseAudioOutputStream* instance;
|
||||
pa_cvolume* channel_volumes;
|
||||
};
|
||||
|
||||
void Lock() {
|
||||
stream_.Lock();
|
||||
}
|
||||
@ -1165,7 +1164,7 @@ bool PulseAudioSoundSystem::ConnectToPulse(pa_context *context) {
|
||||
pa_context *PulseAudioSoundSystem::CreateNewConnection() {
|
||||
// Create connection context.
|
||||
std::string app_name;
|
||||
// TODO: Pulse etiquette says this name should be localized. Do
|
||||
// TODO(henrika): Pulse etiquette says this name should be localized. Do
|
||||
// we care?
|
||||
rtc::Filesystem::GetApplicationName(&app_name);
|
||||
pa_context *context = symbol_table_.pa_context_new()(
|
||||
|
||||
@ -65,4 +65,4 @@ class SoundInputStreamInterface {
|
||||
|
||||
} // namespace rtc
|
||||
|
||||
#endif // WEBRTC_SOUND_SOUNDOUTPUTSTREAMINTERFACE_H_
|
||||
#endif // WEBRTC_SOUND_SOUNDINPUTSTREAMINTERFACE_H_
|
||||
|
||||
@ -65,7 +65,7 @@ static void DitherSilence(AudioFrame* frame) {
|
||||
sum_squared += frame->data_[n] * frame->data_[n];
|
||||
if (sum_squared <= sum_squared_silence) {
|
||||
for (size_t n = 0; n < frame->samples_per_channel_; n++)
|
||||
frame->data_[n] = (rand() & 0xF) - 8;
|
||||
frame->data_[n] = (rand() & 0xF) - 8; // NOLINT: ignore non-threadsafe.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
|
||||
#include "webrtc/tools/frame_editing/frame_editing_lib.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_TOOLS_FRAME_EDITING_FRAME_EDITING_H_
|
||||
#define WEBRTC_TOOLS_FRAME_EDITING_FRAME_EDITING_H_
|
||||
#ifndef WEBRTC_TOOLS_FRAME_EDITING_FRAME_EDITING_LIB_H_
|
||||
#define WEBRTC_TOOLS_FRAME_EDITING_FRAME_EDITING_LIB_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -36,4 +36,4 @@ int EditFrames(const std::string& in_path, int width, int height,
|
||||
int last_frame_to_process, const std::string& out_path);
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_TOOLS_FRAME_EDITING_FRAME_EDITING_H_
|
||||
#endif // WEBRTC_TOOLS_FRAME_EDITING_FRAME_EDITING_LIB_H_
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user