| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/test/test_video_renderer.h" | 5 #include "remoting/test/test_video_renderer.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 287 |
| 288 TestVideoRenderer::~TestVideoRenderer() { | 288 TestVideoRenderer::~TestVideoRenderer() { |
| 289 DCHECK(thread_checker_.CalledOnValidThread()); | 289 DCHECK(thread_checker_.CalledOnValidThread()); |
| 290 | 290 |
| 291 video_decode_task_runner_->DeleteSoon(FROM_HERE, core_.release()); | 291 video_decode_task_runner_->DeleteSoon(FROM_HERE, core_.release()); |
| 292 | 292 |
| 293 // The thread's message loop will run until it runs out of work. | 293 // The thread's message loop will run until it runs out of work. |
| 294 video_decode_thread_->Stop(); | 294 video_decode_thread_->Stop(); |
| 295 } | 295 } |
| 296 | 296 |
| 297 bool TestVideoRenderer::Initialize(const ClientContext& client_context, | 297 bool TestVideoRenderer::Initialize( |
| 298 protocol::PerformanceTracker* perf_tracker) { | 298 const ClientContext& client_context, |
| 299 protocol::FrameStatsConsumer* stats_consumer) { |
| 299 return true; | 300 return true; |
| 300 } | 301 } |
| 301 | 302 |
| 302 void TestVideoRenderer::OnSessionConfig(const protocol::SessionConfig& config) { | 303 void TestVideoRenderer::OnSessionConfig(const protocol::SessionConfig& config) { |
| 303 DCHECK(thread_checker_.CalledOnValidThread()); | 304 DCHECK(thread_checker_.CalledOnValidThread()); |
| 304 | 305 |
| 305 VLOG(2) << "TestVideoRenderer::OnSessionConfig() Called"; | 306 VLOG(2) << "TestVideoRenderer::OnSessionConfig() Called"; |
| 306 protocol::ChannelConfig::Codec codec = config.video_config().codec; | 307 protocol::ChannelConfig::Codec codec = config.video_config().codec; |
| 307 SetCodecForDecoding(codec); | 308 SetCodecForDecoding(codec); |
| 308 } | 309 } |
| 309 | 310 |
| 310 protocol::VideoStub* TestVideoRenderer::GetVideoStub() { | 311 protocol::VideoStub* TestVideoRenderer::GetVideoStub() { |
| 311 DCHECK(thread_checker_.CalledOnValidThread()); | 312 DCHECK(thread_checker_.CalledOnValidThread()); |
| 312 | 313 |
| 313 VLOG(2) << "TestVideoRenderer::GetVideoStub() Called"; | 314 VLOG(2) << "TestVideoRenderer::GetVideoStub() Called"; |
| 314 return this; | 315 return this; |
| 315 } | 316 } |
| 316 | 317 |
| 317 protocol::FrameConsumer* TestVideoRenderer::GetFrameConsumer() { | 318 protocol::FrameConsumer* TestVideoRenderer::GetFrameConsumer() { |
| 318 DCHECK(thread_checker_.CalledOnValidThread()); | 319 DCHECK(thread_checker_.CalledOnValidThread()); |
| 319 NOTREACHED(); | 320 NOTREACHED(); |
| 320 return nullptr; | 321 return nullptr; |
| 321 } | 322 } |
| 323 protocol::FrameStatsConsumer* TestVideoRenderer::GetFrameStatsConsumer() { |
| 324 return nullptr; |
| 325 } |
| 322 | 326 |
| 323 void TestVideoRenderer::ProcessVideoPacket( | 327 void TestVideoRenderer::ProcessVideoPacket( |
| 324 std::unique_ptr<VideoPacket> video_packet, | 328 std::unique_ptr<VideoPacket> video_packet, |
| 325 const base::Closure& done) { | 329 const base::Closure& done) { |
| 326 DCHECK(thread_checker_.CalledOnValidThread()); | 330 DCHECK(thread_checker_.CalledOnValidThread()); |
| 327 DCHECK(video_decode_task_runner_) << "Failed to start video decode thread"; | 331 DCHECK(video_decode_task_runner_) << "Failed to start video decode thread"; |
| 328 | 332 |
| 329 if (video_packet->has_data() && video_packet->data().size() != 0) { | 333 if (video_packet->has_data() && video_packet->data().size() != 0) { |
| 330 VLOG(2) << "process video packet is called!"; | 334 VLOG(2) << "process video packet is called!"; |
| 331 | 335 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 DCHECK(thread_checker_.CalledOnValidThread()); | 383 DCHECK(thread_checker_.CalledOnValidThread()); |
| 380 | 384 |
| 381 video_decode_task_runner_->PostTask( | 385 video_decode_task_runner_->PostTask( |
| 382 FROM_HERE, | 386 FROM_HERE, |
| 383 base::Bind(&Core::save_frame_data_to_disk, base::Unretained(core_.get()), | 387 base::Bind(&Core::save_frame_data_to_disk, base::Unretained(core_.get()), |
| 384 save_frame_data_to_disk)); | 388 save_frame_data_to_disk)); |
| 385 } | 389 } |
| 386 | 390 |
| 387 } // namespace test | 391 } // namespace test |
| 388 } // namespace remoting | 392 } // namespace remoting |
| OLD | NEW |