From 9c4e662ea866e4a108e30f8a31a746a4eb453005 Mon Sep 17 00:00:00 2001 From: "kjellander@webrtc.org" Date: Wed, 13 Feb 2013 09:35:12 +0000 Subject: [PATCH] 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 --- webrtc/modules/video_coding/codecs/test/videoprocessor.cc | 5 +++-- webrtc/test/testsupport/frame_reader.cc | 4 ++-- webrtc/test/testsupport/frame_reader.h | 4 ++-- webrtc/test/testsupport/frame_writer.cc | 4 ++-- webrtc/test/testsupport/frame_writer.h | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor.cc b/webrtc/modules/video_coding/codecs/test/videoprocessor.cc index 4494e53cf0..2149823f4b 100644 --- a/webrtc/modules/video_coding/codecs/test/videoprocessor.cc +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor.cc @@ -13,6 +13,7 @@ #include #include #include +#include #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 // 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]; last_successful_frame_buffer_ = new WebRtc_UWord8[frame_length_in_bytes]; // Set fixed properties common for all frames. @@ -325,7 +326,7 @@ void VideoProcessorImpl::FrameDecoded(const I420VideoFrame& image) { } else { // No resize. // Update our copy of the last successful 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 image_buffer(new uint8_t[length]); length = ExtractBuffer(image, length, image_buffer.get()); assert(length > 0); diff --git a/webrtc/test/testsupport/frame_reader.cc b/webrtc/test/testsupport/frame_reader.cc index 8fea9f339b..1736b8a637 100644 --- a/webrtc/test/testsupport/frame_reader.cc +++ b/webrtc/test/testsupport/frame_reader.cc @@ -12,13 +12,13 @@ #include -#include "testsupport/fileutils.h" +#include "webrtc/test/testsupport/fileutils.h" namespace webrtc { namespace test { FrameReaderImpl::FrameReaderImpl(std::string input_filename, - int frame_length_in_bytes) + size_t frame_length_in_bytes) : input_filename_(input_filename), frame_length_in_bytes_(frame_length_in_bytes), input_file_(NULL) { diff --git a/webrtc/test/testsupport/frame_reader.h b/webrtc/test/testsupport/frame_reader.h index 831f58f6c9..4413df9a73 100644 --- a/webrtc/test/testsupport/frame_reader.h +++ b/webrtc/test/testsupport/frame_reader.h @@ -14,7 +14,7 @@ #include #include -#include "typedefs.h" +#include "webrtc/typedefs.h" namespace webrtc { namespace test { @@ -52,7 +52,7 @@ class FrameReaderImpl : public FrameReader { // input_filename The file to read from. // frame_length_in_bytes The size of each frame. // 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(); bool Init(); bool ReadFrame(WebRtc_UWord8* source_buffer); diff --git a/webrtc/test/testsupport/frame_writer.cc b/webrtc/test/testsupport/frame_writer.cc index 3d5a109166..d0b0b76f8d 100644 --- a/webrtc/test/testsupport/frame_writer.cc +++ b/webrtc/test/testsupport/frame_writer.cc @@ -8,7 +8,7 @@ * 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 @@ -16,7 +16,7 @@ namespace webrtc { namespace test { FrameWriterImpl::FrameWriterImpl(std::string output_filename, - int frame_length_in_bytes) + size_t frame_length_in_bytes) : output_filename_(output_filename), frame_length_in_bytes_(frame_length_in_bytes), output_file_(NULL) { diff --git a/webrtc/test/testsupport/frame_writer.h b/webrtc/test/testsupport/frame_writer.h index 4df4ffea40..7b802f238a 100644 --- a/webrtc/test/testsupport/frame_writer.h +++ b/webrtc/test/testsupport/frame_writer.h @@ -14,7 +14,7 @@ #include #include -#include "typedefs.h" +#include "webrtc/typedefs.h" namespace webrtc { namespace test { @@ -50,7 +50,7 @@ class FrameWriterImpl : public FrameWriter { // existing. // frame_length_in_bytes The size of each frame. // 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(); bool Init(); bool WriteFrame(WebRtc_UWord8* frame_buffer);