| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <deque> | 5 #include <deque> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 scoped_ptr<uint8[]> image_data_; | 198 scoped_ptr<uint8[]> image_data_; |
| 199 DesktopFrame* frame_; | 199 DesktopFrame* frame_; |
| 200 | 200 |
| 201 DISALLOW_COPY_AND_ASSIGN(VideoDecoderTester); | 201 DISALLOW_COPY_AND_ASSIGN(VideoDecoderTester); |
| 202 }; | 202 }; |
| 203 | 203 |
| 204 // The VideoEncoderTester provides a hook for retrieving the data, and passing | 204 // The VideoEncoderTester provides a hook for retrieving the data, and passing |
| 205 // the message to other subprograms for validaton. | 205 // the message to other subprograms for validaton. |
| 206 class VideoEncoderTester { | 206 class VideoEncoderTester { |
| 207 public: | 207 public: |
| 208 VideoEncoderTester() | 208 VideoEncoderTester() : decoder_tester_(nullptr), data_available_(0) {} |
| 209 : decoder_tester_(nullptr), | |
| 210 data_available_(0) { | |
| 211 } | |
| 212 | 209 |
| 213 ~VideoEncoderTester() { | 210 ~VideoEncoderTester() { |
| 214 EXPECT_GT(data_available_, 0); | 211 EXPECT_GT(data_available_, 0); |
| 215 } | 212 } |
| 216 | 213 |
| 217 void DataAvailable(scoped_ptr<VideoPacket> packet) { | 214 void DataAvailable(scoped_ptr<VideoPacket> packet) { |
| 218 ++data_available_; | 215 ++data_available_; |
| 219 // Send the message to the VideoDecoderTester. | 216 // Send the message to the VideoDecoderTester. |
| 220 if (decoder_tester_) { | 217 if (decoder_tester_) { |
| 221 decoder_tester_->ReceivedPacket(packet.get()); | 218 decoder_tester_->ReceivedPacket(packet.get()); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 447 |
| 451 if (frame_count >= kWarmUpFrameCount) { | 448 if (frame_count >= kWarmUpFrameCount) { |
| 452 elapsed = base::TimeTicks::Now() - start_time; | 449 elapsed = base::TimeTicks::Now() - start_time; |
| 453 } | 450 } |
| 454 } | 451 } |
| 455 | 452 |
| 456 return (frame_count * base::TimeDelta::FromSeconds(1)) / elapsed; | 453 return (frame_count * base::TimeDelta::FromSeconds(1)) / elapsed; |
| 457 } | 454 } |
| 458 | 455 |
| 459 } // namespace remoting | 456 } // namespace remoting |
| OLD | NEW |