| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "media/cast/cast_sender_impl.h" | 5 #include "media/cast/cast_sender_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 scoped_refptr<CastEnvironment> cast_environment_; | 71 scoped_refptr<CastEnvironment> cast_environment_; |
| 72 base::WeakPtr<AudioSender> audio_sender_; | 72 base::WeakPtr<AudioSender> audio_sender_; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(LocalAudioFrameInput); | 74 DISALLOW_COPY_AND_ASSIGN(LocalAudioFrameInput); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 scoped_ptr<CastSender> CastSender::Create( | 77 scoped_ptr<CastSender> CastSender::Create( |
| 78 scoped_refptr<CastEnvironment> cast_environment, | 78 scoped_refptr<CastEnvironment> cast_environment, |
| 79 CastTransportSender* const transport_sender) { | 79 CastTransportSender* const transport_sender) { |
| 80 CHECK(cast_environment); | 80 CHECK(cast_environment.get()); |
| 81 return scoped_ptr<CastSender>( | 81 return scoped_ptr<CastSender>( |
| 82 new CastSenderImpl(cast_environment, transport_sender)); | 82 new CastSenderImpl(cast_environment, transport_sender)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 CastSenderImpl::CastSenderImpl( | 85 CastSenderImpl::CastSenderImpl( |
| 86 scoped_refptr<CastEnvironment> cast_environment, | 86 scoped_refptr<CastEnvironment> cast_environment, |
| 87 CastTransportSender* const transport_sender) | 87 CastTransportSender* const transport_sender) |
| 88 : cast_environment_(cast_environment), | 88 : cast_environment_(cast_environment), |
| 89 transport_sender_(transport_sender), | 89 transport_sender_(transport_sender), |
| 90 weak_factory_(this) { | 90 weak_factory_(this) { |
| 91 CHECK(cast_environment); | 91 CHECK(cast_environment.get()); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void CastSenderImpl::InitializeAudio( | 94 void CastSenderImpl::InitializeAudio( |
| 95 const AudioSenderConfig& audio_config, | 95 const AudioSenderConfig& audio_config, |
| 96 const CastInitializationCallback& cast_initialization_cb) { | 96 const CastInitializationCallback& cast_initialization_cb) { |
| 97 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 97 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 98 CHECK(audio_config.use_external_encoder || | 98 CHECK(audio_config.use_external_encoder || |
| 99 cast_environment_->HasAudioThread()); | 99 cast_environment_->HasAudioThread()); |
| 100 | 100 |
| 101 VLOG(1) << "CastSenderImpl@" << this << "::InitializeAudio()"; | 101 VLOG(1) << "CastSenderImpl@" << this << "::InitializeAudio()"; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (audio_sender_) { | 165 if (audio_sender_) { |
| 166 audio_sender_->SetTargetPlayoutDelay(new_target_playout_delay); | 166 audio_sender_->SetTargetPlayoutDelay(new_target_playout_delay); |
| 167 } | 167 } |
| 168 if (video_sender_) { | 168 if (video_sender_) { |
| 169 video_sender_->SetTargetPlayoutDelay(new_target_playout_delay); | 169 video_sender_->SetTargetPlayoutDelay(new_target_playout_delay); |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace cast | 173 } // namespace cast |
| 174 } // namespace media | 174 } // namespace media |
| OLD | NEW |