| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 224 |
| 225 void SetUp() final { | 225 void SetUp() final { |
| 226 clock_ = new base::SimpleTestTickClock(); | 226 clock_ = new base::SimpleTestTickClock(); |
| 227 clock_->Advance(base::TimeTicks::Now() - base::TimeTicks()); | 227 clock_->Advance(base::TimeTicks::Now() - base::TimeTicks()); |
| 228 | 228 |
| 229 power_source_ = new TestPowerSource(); | 229 power_source_ = new TestPowerSource(); |
| 230 power_monitor_.reset( | 230 power_monitor_.reset( |
| 231 new base::PowerMonitor(scoped_ptr<TestPowerSource>(power_source_))); | 231 new base::PowerMonitor(scoped_ptr<TestPowerSource>(power_source_))); |
| 232 | 232 |
| 233 cast_environment_ = new CastEnvironment( | 233 cast_environment_ = new CastEnvironment( |
| 234 scoped_ptr<base::TickClock>(clock_).Pass(), | 234 scoped_ptr<base::TickClock>(clock_), message_loop_.task_runner(), |
| 235 message_loop_.task_runner(), message_loop_.task_runner(), | 235 message_loop_.task_runner(), message_loop_.task_runner()); |
| 236 message_loop_.task_runner()); | |
| 237 encoder_.reset(new H264VideoToolboxEncoder( | 236 encoder_.reset(new H264VideoToolboxEncoder( |
| 238 cast_environment_, video_sender_config_, | 237 cast_environment_, video_sender_config_, |
| 239 base::Bind(&SaveOperationalStatus, &operational_status_))); | 238 base::Bind(&SaveOperationalStatus, &operational_status_))); |
| 240 message_loop_.RunUntilIdle(); | 239 message_loop_.RunUntilIdle(); |
| 241 EXPECT_EQ(STATUS_INITIALIZED, operational_status_); | 240 EXPECT_EQ(STATUS_INITIALIZED, operational_status_); |
| 242 } | 241 } |
| 243 | 242 |
| 244 void TearDown() final { | 243 void TearDown() final { |
| 245 encoder_.reset(); | 244 encoder_.reset(); |
| 246 message_loop_.RunUntilIdle(); | 245 message_loop_.RunUntilIdle(); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); | 411 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); |
| 413 | 412 |
| 414 // After a power resume event, the factory should produce frames right away | 413 // After a power resume event, the factory should produce frames right away |
| 415 // because the encoder re-initializes on its own. | 414 // because the encoder re-initializes on its own. |
| 416 power_source_->GenerateResumeEvent(); | 415 power_source_->GenerateResumeEvent(); |
| 417 CreateFrameAndMemsetPlane(video_frame_factory.get()); | 416 CreateFrameAndMemsetPlane(video_frame_factory.get()); |
| 418 } | 417 } |
| 419 | 418 |
| 420 } // namespace cast | 419 } // namespace cast |
| 421 } // namespace media | 420 } // namespace media |
| OLD | NEW |