Chromium Code Reviews| 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 "chrome/renderer/media/cast_session_delegate.h" | 5 #include "chrome/renderer/media/cast_session_delegate.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 video_frame_input_available_callback_ = callback; | 147 video_frame_input_available_callback_ = callback; |
| 148 | 148 |
| 149 cast_sender_->InitializeVideo( | 149 cast_sender_->InitializeVideo( |
| 150 config, | 150 config, |
| 151 base::Bind(&CastSessionDelegate::OnOperationalStatusChange, | 151 base::Bind(&CastSessionDelegate::OnOperationalStatusChange, |
| 152 weak_factory_.GetWeakPtr(), false, error_callback), | 152 weak_factory_.GetWeakPtr(), false, error_callback), |
| 153 create_vea_cb, | 153 create_vea_cb, |
| 154 create_video_encode_mem_cb); | 154 create_video_encode_mem_cb); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void CastSessionDelegate::StartRemotingStream( | |
| 158 int32_t stream_id, | |
| 159 const FrameSenderConfig& config, | |
| 160 const ErrorCallback& error_callback) { | |
| 161 DCHECK(io_task_runner_->BelongsToCurrentThread()); | |
| 162 | |
| 163 if (!cast_transport_) { | |
| 164 error_callback.Run("Destination not set."); | |
| 165 return; | |
| 166 } | |
| 167 | |
| 168 media::cast::CastTransportRtpConfig transport_config; | |
| 169 transport_config.ssrc = config.sender_ssrc; | |
| 170 transport_config.feedback_ssrc = config.receiver_ssrc; | |
| 171 transport_config.rtp_payload_type = config.rtp_payload_type; | |
| 172 transport_config.rtp_stream_id = stream_id; | |
| 173 transport_config.aes_key = config.aes_key; | |
| 174 transport_config.aes_iv_mask = config.aes_iv_mask; | |
| 175 cast_transport_->InitializeStream( | |
| 176 transport_config, std::unique_ptr<media::cast::RtcpObserver>()); | |
|
dcheng
2016/09/10 02:31:36
Nit: nullptr as the second argument here.
xjz
2016/09/12 18:22:06
Done.
| |
| 177 } | |
| 178 | |
| 157 void CastSessionDelegate::StartUDP( | 179 void CastSessionDelegate::StartUDP( |
| 158 const net::IPEndPoint& local_endpoint, | 180 const net::IPEndPoint& local_endpoint, |
| 159 const net::IPEndPoint& remote_endpoint, | 181 const net::IPEndPoint& remote_endpoint, |
| 160 std::unique_ptr<base::DictionaryValue> options, | 182 std::unique_ptr<base::DictionaryValue> options, |
| 161 const ErrorCallback& error_callback) { | 183 const ErrorCallback& error_callback) { |
| 162 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 184 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 163 CastSessionDelegateBase::StartUDP(local_endpoint, remote_endpoint, | 185 CastSessionDelegateBase::StartUDP(local_endpoint, remote_endpoint, |
| 164 std::move(options), error_callback); | 186 std::move(options), error_callback); |
| 165 event_subscribers_.reset( | 187 event_subscribers_.reset( |
| 166 new media::cast::RawEventSubscriberBundle(cast_environment_)); | 188 new media::cast::RawEventSubscriberBundle(cast_environment_)); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 error_callback.Run(base::StringPrintf("%s codec runtime error.", | 325 error_callback.Run(base::StringPrintf("%s codec runtime error.", |
| 304 is_for_audio ? "Audio" : "Video")); | 326 is_for_audio ? "Audio" : "Video")); |
| 305 break; | 327 break; |
| 306 } | 328 } |
| 307 } | 329 } |
| 308 | 330 |
| 309 void CastSessionDelegate::ReceivePacket( | 331 void CastSessionDelegate::ReceivePacket( |
| 310 std::unique_ptr<media::cast::Packet> packet) { | 332 std::unique_ptr<media::cast::Packet> packet) { |
| 311 // Do nothing (frees packet) | 333 // Do nothing (frees packet) |
| 312 } | 334 } |
| OLD | NEW |