| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/test/simple_test_tick_clock.h" | 9 #include "base/test/simple_test_tick_clock.h" |
| 10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 video_config.use_external_encoder = external; | 63 video_config.use_external_encoder = external; |
| 64 video_config.width = kWidth; | 64 video_config.width = kWidth; |
| 65 video_config.height = kHeight; | 65 video_config.height = kHeight; |
| 66 video_config.max_bitrate = 5000000; | 66 video_config.max_bitrate = 5000000; |
| 67 video_config.min_bitrate = 1000000; | 67 video_config.min_bitrate = 1000000; |
| 68 video_config.start_bitrate = 1000000; | 68 video_config.start_bitrate = 1000000; |
| 69 video_config.max_qp = 56; | 69 video_config.max_qp = 56; |
| 70 video_config.min_qp = 0; | 70 video_config.min_qp = 0; |
| 71 video_config.max_frame_rate = 30; | 71 video_config.max_frame_rate = 30; |
| 72 video_config.max_number_of_video_buffers_used = 1; | 72 video_config.max_number_of_video_buffers_used = 1; |
| 73 video_config.codec = transport::kVp8; | 73 video_config.codec = kVp8; |
| 74 | 74 |
| 75 if (external) { | 75 if (external) { |
| 76 video_sender_.reset(new PeerVideoSender(cast_environment_, | 76 video_sender_.reset(new PeerVideoSender(cast_environment_, |
| 77 video_config, | 77 video_config, |
| 78 new test::FakeGpuVideoAcceleratorFactories(task_runner_), | 78 new test::FakeGpuVideoAcceleratorFactories(task_runner_), |
| 79 &mock_transport_)); | 79 &mock_transport_)); |
| 80 } else { | 80 } else { |
| 81 video_sender_.reset(new PeerVideoSender(cast_environment_, video_config, | 81 video_sender_.reset(new PeerVideoSender(cast_environment_, video_config, |
| 82 NULL, &mock_transport_)); | 82 NULL, &mock_transport_)); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 virtual void SetUp() { | 86 virtual void SetUp() { |
| 87 task_runner_ = new test::FakeTaskRunner(&testing_clock_); | 87 task_runner_ = new test::FakeTaskRunner(&testing_clock_); |
| 88 cast_environment_ = new CastEnvironment(&testing_clock_, task_runner_, | 88 cast_environment_ = new CastEnvironment(&testing_clock_, task_runner_, |
| 89 task_runner_, task_runner_, task_runner_, task_runner_, | 89 task_runner_, task_runner_, task_runner_, task_runner_, |
| 90 task_runner_, GetDefaultCastLoggingConfig()); | 90 GetDefaultCastLoggingConfig()); |
| 91 } | 91 } |
| 92 | 92 |
| 93 scoped_refptr<media::VideoFrame> GetNewVideoFrame() { | 93 scoped_refptr<media::VideoFrame> GetNewVideoFrame() { |
| 94 gfx::Size size(kWidth, kHeight); | 94 gfx::Size size(kWidth, kHeight); |
| 95 scoped_refptr<media::VideoFrame> video_frame = | 95 scoped_refptr<media::VideoFrame> video_frame = |
| 96 media::VideoFrame::CreateFrame(VideoFrame::I420, size, gfx::Rect(size), | 96 media::VideoFrame::CreateFrame(VideoFrame::I420, size, gfx::Rect(size), |
| 97 size, base::TimeDelta()); | 97 size, base::TimeDelta()); |
| 98 PopulateVideoFrame(video_frame, kPixelValue); | 98 PopulateVideoFrame(video_frame, kPixelValue); |
| 99 return video_frame; | 99 return video_frame; |
| 100 } | 100 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 base::TimeDelta::FromMilliseconds(1 + kDefaultRtpMaxDelayMs); | 178 base::TimeDelta::FromMilliseconds(1 + kDefaultRtpMaxDelayMs); |
| 179 | 179 |
| 180 // Make sure that we do a re-send. | 180 // Make sure that we do a re-send. |
| 181 testing_clock_.Advance(max_resend_timeout); | 181 testing_clock_.Advance(max_resend_timeout); |
| 182 task_runner_->RunTasks(); | 182 task_runner_->RunTasks(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace cast | 185 } // namespace cast |
| 186 } // namespace media | 186 } // namespace media |
| 187 | 187 |
| OLD | NEW |