| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 video_frame_ = media::VideoFrame::CreateFrame( | 102 video_frame_ = media::VideoFrame::CreateFrame( |
| 103 VideoFrame::I420, size, gfx::Rect(size), size, base::TimeDelta()); | 103 VideoFrame::I420, size, gfx::Rect(size), size, base::TimeDelta()); |
| 104 PopulateVideoFrame(video_frame_, 123); | 104 PopulateVideoFrame(video_frame_, 123); |
| 105 | 105 |
| 106 testing_clock_ = new base::SimpleTestTickClock(); | 106 testing_clock_ = new base::SimpleTestTickClock(); |
| 107 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); | 107 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); |
| 108 cast_environment_ = | 108 cast_environment_ = |
| 109 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), | 109 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), |
| 110 task_runner_, | 110 task_runner_, |
| 111 task_runner_, | 111 task_runner_, |
| 112 task_runner_, | 112 task_runner_); |
| 113 GetDefaultCastSenderLoggingConfig()); | |
| 114 scoped_ptr<VideoEncodeAccelerator> fake_vea( | 113 scoped_ptr<VideoEncodeAccelerator> fake_vea( |
| 115 new test::FakeVideoEncodeAccelerator()); | 114 new test::FakeVideoEncodeAccelerator()); |
| 116 video_encoder_.reset( | 115 video_encoder_.reset( |
| 117 new ExternalVideoEncoder(cast_environment_, | 116 new ExternalVideoEncoder(cast_environment_, |
| 118 video_config_, | 117 video_config_, |
| 119 base::Bind(&CreateVideoEncodeAccelerator, | 118 base::Bind(&CreateVideoEncodeAccelerator, |
| 120 task_runner_, | 119 task_runner_, |
| 121 base::Passed(&fake_vea)), | 120 base::Passed(&fake_vea)), |
| 122 base::Bind(&CreateSharedMemory))); | 121 base::Bind(&CreateSharedMemory))); |
| 123 } | 122 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 video_frame_, capture_time, frame_encoded_callback)); | 156 video_frame_, capture_time, frame_encoded_callback)); |
| 158 task_runner_->RunTasks(); | 157 task_runner_->RunTasks(); |
| 159 } | 158 } |
| 160 // We need to run the task to cleanup the GPU instance. | 159 // We need to run the task to cleanup the GPU instance. |
| 161 video_encoder_.reset(NULL); | 160 video_encoder_.reset(NULL); |
| 162 task_runner_->RunTasks(); | 161 task_runner_->RunTasks(); |
| 163 } | 162 } |
| 164 | 163 |
| 165 } // namespace cast | 164 } // namespace cast |
| 166 } // namespace media | 165 } // namespace media |
| OLD | NEW |