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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 video_sender_->GetTargetPlayoutDelay()); | 128 video_sender_->GetTargetPlayoutDelay()); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 void CastSenderImpl::InitializeVideo( | 132 void CastSenderImpl::InitializeVideo( |
133 const VideoSenderConfig& video_config, | 133 const VideoSenderConfig& video_config, |
134 const CastInitializationCallback& cast_initialization_cb, | 134 const CastInitializationCallback& cast_initialization_cb, |
135 const CreateVideoEncodeAcceleratorCallback& create_vea_cb, | 135 const CreateVideoEncodeAcceleratorCallback& create_vea_cb, |
136 const CreateVideoEncodeMemoryCallback& create_video_encode_mem_cb) { | 136 const CreateVideoEncodeMemoryCallback& create_video_encode_mem_cb) { |
137 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 137 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
138 CHECK(video_config.use_external_encoder || | |
139 cast_environment_->HasVideoThread()); | |
140 | 138 |
141 VLOG(1) << "CastSenderImpl@" << this << "::InitializeVideo()"; | 139 VLOG(1) << "CastSenderImpl@" << this << "::InitializeVideo()"; |
142 | 140 |
143 video_sender_.reset(new VideoSender( | 141 video_sender_.reset(new VideoSender( |
144 cast_environment_, | 142 cast_environment_, |
145 video_config, | 143 video_config, |
146 base::Bind(&CastSenderImpl::OnVideoInitialized, | 144 base::Bind(&CastSenderImpl::OnVideoInitialized, |
147 weak_factory_.GetWeakPtr(), cast_initialization_cb), | 145 weak_factory_.GetWeakPtr(), cast_initialization_cb), |
148 create_vea_cb, | 146 create_vea_cb, |
149 create_video_encode_mem_cb, | 147 create_video_encode_mem_cb, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 if (result == STATUS_VIDEO_INITIALIZED) { | 185 if (result == STATUS_VIDEO_INITIALIZED) { |
188 video_frame_input_ = | 186 video_frame_input_ = |
189 new LocalVideoFrameInput(cast_environment_, video_sender_->AsWeakPtr(), | 187 new LocalVideoFrameInput(cast_environment_, video_sender_->AsWeakPtr(), |
190 video_sender_->CreateVideoFrameFactory()); | 188 video_sender_->CreateVideoFrameFactory()); |
191 } | 189 } |
192 initialization_cb.Run(result); | 190 initialization_cb.Run(result); |
193 } | 191 } |
194 | 192 |
195 } // namespace cast | 193 } // namespace cast |
196 } // namespace media | 194 } // namespace media |
OLD | NEW |