Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(842)

Side by Side Diff: chrome/renderer/media/cast_session_delegate.cc

Issue 2307653002: Adding CastRemotingSender for media remoting. (Closed)
Patch Set: Rebased. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(transport_config, nullptr);
176 }
177
157 void CastSessionDelegate::StartUDP( 178 void CastSessionDelegate::StartUDP(
158 const net::IPEndPoint& local_endpoint, 179 const net::IPEndPoint& local_endpoint,
159 const net::IPEndPoint& remote_endpoint, 180 const net::IPEndPoint& remote_endpoint,
160 std::unique_ptr<base::DictionaryValue> options, 181 std::unique_ptr<base::DictionaryValue> options,
161 const ErrorCallback& error_callback) { 182 const ErrorCallback& error_callback) {
162 DCHECK(io_task_runner_->BelongsToCurrentThread()); 183 DCHECK(io_task_runner_->BelongsToCurrentThread());
163 CastSessionDelegateBase::StartUDP(local_endpoint, remote_endpoint, 184 CastSessionDelegateBase::StartUDP(local_endpoint, remote_endpoint,
164 std::move(options), error_callback); 185 std::move(options), error_callback);
165 event_subscribers_.reset( 186 event_subscribers_.reset(
166 new media::cast::RawEventSubscriberBundle(cast_environment_)); 187 new media::cast::RawEventSubscriberBundle(cast_environment_));
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 error_callback.Run(base::StringPrintf("%s codec runtime error.", 324 error_callback.Run(base::StringPrintf("%s codec runtime error.",
304 is_for_audio ? "Audio" : "Video")); 325 is_for_audio ? "Audio" : "Video"));
305 break; 326 break;
306 } 327 }
307 } 328 }
308 329
309 void CastSessionDelegate::ReceivePacket( 330 void CastSessionDelegate::ReceivePacket(
310 std::unique_ptr<media::cast::Packet> packet) { 331 std::unique_ptr<media::cast::Packet> packet) {
311 // Do nothing (frees packet) 332 // Do nothing (frees packet)
312 } 333 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698