OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/host/client_session.h" | 5 #include "remoting/host/client_session.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "remoting/base/capabilities.h" | 10 #include "remoting/base/capabilities.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 DCHECK(CalledOnValidThread()); | 449 DCHECK(CalledOnValidThread()); |
450 | 450 |
451 if (video_scheduler_.get()) { | 451 if (video_scheduler_.get()) { |
452 video_scheduler_->Stop(); | 452 video_scheduler_->Stop(); |
453 video_scheduler_ = NULL; | 453 video_scheduler_ = NULL; |
454 } | 454 } |
455 | 455 |
456 // Create VideoEncoder and DesktopCapturer to match the session's video | 456 // Create VideoEncoder and DesktopCapturer to match the session's video |
457 // channel configuration. | 457 // channel configuration. |
458 scoped_ptr<webrtc::DesktopCapturer> video_capturer = | 458 scoped_ptr<webrtc::DesktopCapturer> video_capturer = |
459 extension_manager_->OnCreateVideoCapturer( | 459 desktop_environment_->CreateVideoCapturer(); |
460 desktop_environment_->CreateVideoCapturer()); | 460 extension_manager_->OnCreateVideoCapturer(&video_capturer); |
461 scoped_ptr<VideoEncoder> video_encoder = | 461 scoped_ptr<VideoEncoder> video_encoder = |
462 extension_manager_->OnCreateVideoEncoder( | 462 CreateVideoEncoder(connection_->session()->config()); |
463 CreateVideoEncoder(connection_->session()->config())); | 463 extension_manager_->OnCreateVideoEncoder(&video_encoder); |
464 | 464 |
465 // Don't start the VideoScheduler if either capturer or encoder are missing. | 465 // Don't start the VideoScheduler if either capturer or encoder are missing. |
466 if (!video_capturer || !video_encoder) | 466 if (!video_capturer || !video_encoder) |
467 return; | 467 return; |
468 | 468 |
469 // Create a VideoScheduler to pump frames from the capturer to the client. | 469 // Create a VideoScheduler to pump frames from the capturer to the client. |
470 video_scheduler_ = new VideoScheduler( | 470 video_scheduler_ = new VideoScheduler( |
471 video_capture_task_runner_, | 471 video_capture_task_runner_, |
472 video_encode_task_runner_, | 472 video_encode_task_runner_, |
473 network_task_runner_, | 473 network_task_runner_, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); | 528 return scoped_ptr<AudioEncoder>(new AudioEncoderVerbatim()); |
529 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { | 529 } else if (audio_config.codec == protocol::ChannelConfig::CODEC_OPUS) { |
530 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); | 530 return scoped_ptr<AudioEncoder>(new AudioEncoderOpus()); |
531 } | 531 } |
532 | 532 |
533 NOTREACHED(); | 533 NOTREACHED(); |
534 return scoped_ptr<AudioEncoder>(); | 534 return scoped_ptr<AudioEncoder>(); |
535 } | 535 } |
536 | 536 |
537 } // namespace remoting | 537 } // namespace remoting |
OLD | NEW |