| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 video_sender_->GetTargetPlayoutDelay()); | 114 video_sender_->GetTargetPlayoutDelay()); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 void CastSenderImpl::InitializeVideo( | 118 void CastSenderImpl::InitializeVideo( |
| 119 const VideoSenderConfig& video_config, | 119 const VideoSenderConfig& video_config, |
| 120 const CastInitializationCallback& cast_initialization_cb, | 120 const CastInitializationCallback& cast_initialization_cb, |
| 121 const CreateVideoEncodeAcceleratorCallback& create_vea_cb, | 121 const CreateVideoEncodeAcceleratorCallback& create_vea_cb, |
| 122 const CreateVideoEncodeMemoryCallback& create_video_encode_mem_cb) { | 122 const CreateVideoEncodeMemoryCallback& create_video_encode_mem_cb) { |
| 123 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 123 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 124 CHECK(video_config.use_external_encoder || | |
| 125 cast_environment_->HasVideoThread()); | |
| 126 | 124 |
| 127 VLOG(1) << "CastSenderImpl@" << this << "::InitializeVideo()"; | 125 VLOG(1) << "CastSenderImpl@" << this << "::InitializeVideo()"; |
| 128 | 126 |
| 129 video_sender_.reset(new VideoSender( | 127 video_sender_.reset(new VideoSender( |
| 130 cast_environment_, | 128 cast_environment_, |
| 131 video_config, | 129 video_config, |
| 132 base::Bind(&CastSenderImpl::OnVideoInitialized, | 130 base::Bind(&CastSenderImpl::OnVideoInitialized, |
| 133 weak_factory_.GetWeakPtr(), cast_initialization_cb), | 131 weak_factory_.GetWeakPtr(), cast_initialization_cb), |
| 134 create_vea_cb, | 132 create_vea_cb, |
| 135 create_video_encode_mem_cb, | 133 create_video_encode_mem_cb, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 const CastInitializationCallback& initialization_cb, | 168 const CastInitializationCallback& initialization_cb, |
| 171 media::cast::CastInitializationStatus result) { | 169 media::cast::CastInitializationStatus result) { |
| 172 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 170 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
| 173 video_frame_input_ = | 171 video_frame_input_ = |
| 174 new LocalVideoFrameInput(cast_environment_, video_sender_->AsWeakPtr()); | 172 new LocalVideoFrameInput(cast_environment_, video_sender_->AsWeakPtr()); |
| 175 initialization_cb.Run(result); | 173 initialization_cb.Run(result); |
| 176 } | 174 } |
| 177 | 175 |
| 178 } // namespace cast | 176 } // namespace cast |
| 179 } // namespace media | 177 } // namespace media |
| OLD | NEW |