Fix Windows x64 errors in video_codecs_test_framework

Fixed a few size_t converted to int warnings (interpreted as errors).
Fixed cpplint warnings.

BUG=webrtc:1323
TEST=manual compile on Windows with GYP_DEFINES=target_arch=x64 and
ninja -C out\Debug_x64 (also compiled with Release_x64)

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3507 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kjellander@webrtc.org
2013-02-13 09:35:12 +00:00
parent 6388c3e2fd
commit 9c4e662ea8
5 changed files with 11 additions and 10 deletions

View File

@@ -13,6 +13,7 @@
#include <cassert> #include <cassert>
#include <cstring> #include <cstring>
#include <limits> #include <limits>
#include <vector>
#include "system_wrappers/interface/cpu_info.h" #include "system_wrappers/interface/cpu_info.h"
@@ -59,7 +60,7 @@ bool VideoProcessorImpl::Init() {
bit_rate_factor_ = config_.codec_settings->maxFramerate * 0.001 * 8; // bits bit_rate_factor_ = config_.codec_settings->maxFramerate * 0.001 * 8; // bits
// Initialize data structures used by the encoder/decoder APIs // Initialize data structures used by the encoder/decoder APIs
int frame_length_in_bytes = frame_reader_->FrameLength(); size_t frame_length_in_bytes = frame_reader_->FrameLength();
source_buffer_ = new WebRtc_UWord8[frame_length_in_bytes]; source_buffer_ = new WebRtc_UWord8[frame_length_in_bytes];
last_successful_frame_buffer_ = new WebRtc_UWord8[frame_length_in_bytes]; last_successful_frame_buffer_ = new WebRtc_UWord8[frame_length_in_bytes];
// Set fixed properties common for all frames. // Set fixed properties common for all frames.
@@ -325,7 +326,7 @@ void VideoProcessorImpl::FrameDecoded(const I420VideoFrame& image) {
} else { // No resize. } else { // No resize.
// Update our copy of the last successful frame: // Update our copy of the last successful frame:
// TODO(mikhal): Add as a member function, so won't be allocated per frame. // TODO(mikhal): Add as a member function, so won't be allocated per frame.
int length = CalcBufferSize(kI420,image.width(), image.height()); int length = CalcBufferSize(kI420, image.width(), image.height());
scoped_array<uint8_t> image_buffer(new uint8_t[length]); scoped_array<uint8_t> image_buffer(new uint8_t[length]);
length = ExtractBuffer(image, length, image_buffer.get()); length = ExtractBuffer(image, length, image_buffer.get());
assert(length > 0); assert(length > 0);

View File

@@ -12,13 +12,13 @@
#include <cassert> #include <cassert>
#include "testsupport/fileutils.h" #include "webrtc/test/testsupport/fileutils.h"
namespace webrtc { namespace webrtc {
namespace test { namespace test {
FrameReaderImpl::FrameReaderImpl(std::string input_filename, FrameReaderImpl::FrameReaderImpl(std::string input_filename,
int frame_length_in_bytes) size_t frame_length_in_bytes)
: input_filename_(input_filename), : input_filename_(input_filename),
frame_length_in_bytes_(frame_length_in_bytes), frame_length_in_bytes_(frame_length_in_bytes),
input_file_(NULL) { input_file_(NULL) {

View File

@@ -14,7 +14,7 @@
#include <cstdio> #include <cstdio>
#include <string> #include <string>
#include "typedefs.h" #include "webrtc/typedefs.h"
namespace webrtc { namespace webrtc {
namespace test { namespace test {
@@ -52,7 +52,7 @@ class FrameReaderImpl : public FrameReader {
// input_filename The file to read from. // input_filename The file to read from.
// frame_length_in_bytes The size of each frame. // frame_length_in_bytes The size of each frame.
// For YUV this is 3 * width * height / 2 // For YUV this is 3 * width * height / 2
FrameReaderImpl(std::string input_filename, int frame_length_in_bytes); FrameReaderImpl(std::string input_filename, size_t frame_length_in_bytes);
virtual ~FrameReaderImpl(); virtual ~FrameReaderImpl();
bool Init(); bool Init();
bool ReadFrame(WebRtc_UWord8* source_buffer); bool ReadFrame(WebRtc_UWord8* source_buffer);

View File

@@ -8,7 +8,7 @@
* 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 "testsupport/frame_writer.h" #include "webrtc/test/testsupport/frame_writer.h"
#include <cassert> #include <cassert>
@@ -16,7 +16,7 @@ namespace webrtc {
namespace test { namespace test {
FrameWriterImpl::FrameWriterImpl(std::string output_filename, FrameWriterImpl::FrameWriterImpl(std::string output_filename,
int frame_length_in_bytes) size_t frame_length_in_bytes)
: output_filename_(output_filename), : output_filename_(output_filename),
frame_length_in_bytes_(frame_length_in_bytes), frame_length_in_bytes_(frame_length_in_bytes),
output_file_(NULL) { output_file_(NULL) {

View File

@@ -14,7 +14,7 @@
#include <cstdio> #include <cstdio>
#include <string> #include <string>
#include "typedefs.h" #include "webrtc/typedefs.h"
namespace webrtc { namespace webrtc {
namespace test { namespace test {
@@ -50,7 +50,7 @@ class FrameWriterImpl : public FrameWriter {
// existing. // existing.
// frame_length_in_bytes The size of each frame. // frame_length_in_bytes The size of each frame.
// For YUV: 3*width*height/2 // For YUV: 3*width*height/2
FrameWriterImpl(std::string output_filename, int frame_length_in_bytes); FrameWriterImpl(std::string output_filename, size_t frame_length_in_bytes);
virtual ~FrameWriterImpl(); virtual ~FrameWriterImpl();
bool Init(); bool Init();
bool WriteFrame(WebRtc_UWord8* frame_buffer); bool WriteFrame(WebRtc_UWord8* frame_buffer);