| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 video_encoder_.reset(new ExternalVideoEncoder( | 141 video_encoder_.reset(new ExternalVideoEncoder( |
| 142 cast_environment_, | 142 cast_environment_, |
| 143 video_config_, | 143 video_config_, |
| 144 base::Bind(&IgnoreInitializationStatus), | 144 base::Bind(&IgnoreInitializationStatus), |
| 145 base::Bind(&VEAFactory::CreateVideoEncodeAccelerator, | 145 base::Bind(&VEAFactory::CreateVideoEncodeAccelerator, |
| 146 base::Unretained(&vea_factory)), | 146 base::Unretained(&vea_factory)), |
| 147 base::Bind(&CreateSharedMemory))); | 147 base::Bind(&CreateSharedMemory))); |
| 148 vea_factory.FinishCreatingVideoEncodeAccelerator(); | 148 vea_factory.FinishCreatingVideoEncodeAccelerator(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 virtual ~ExternalVideoEncoderTest() {} | 151 ~ExternalVideoEncoderTest() override {} |
| 152 | 152 |
| 153 void AdvanceClockAndVideoFrameTimestamp() { | 153 void AdvanceClockAndVideoFrameTimestamp() { |
| 154 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(33)); | 154 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(33)); |
| 155 video_frame_->set_timestamp( | 155 video_frame_->set_timestamp( |
| 156 video_frame_->timestamp() + base::TimeDelta::FromMilliseconds(33)); | 156 video_frame_->timestamp() + base::TimeDelta::FromMilliseconds(33)); |
| 157 } | 157 } |
| 158 | 158 |
| 159 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment. | 159 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment. |
| 160 test::FakeVideoEncodeAccelerator* fake_vea_; // Owned by video_encoder_. | 160 test::FakeVideoEncodeAccelerator* fake_vea_; // Owned by video_encoder_. |
| 161 std::vector<uint32> stored_bitrates_; | 161 std::vector<uint32> stored_bitrates_; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 base::Unretained(&vea_factory)), | 252 base::Unretained(&vea_factory)), |
| 253 base::Bind(&CreateSharedMemory))); | 253 base::Bind(&CreateSharedMemory))); |
| 254 | 254 |
| 255 video_encoder.reset(); | 255 video_encoder.reset(); |
| 256 vea_factory.FinishCreatingVideoEncodeAccelerator(); | 256 vea_factory.FinishCreatingVideoEncodeAccelerator(); |
| 257 task_runner->RunTasks(); | 257 task_runner->RunTasks(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 } // namespace cast | 260 } // namespace cast |
| 261 } // namespace media | 261 } // namespace media |
| OLD | NEW |