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

Side by Side Diff: chrome/renderer/media/cast_transport_ipc.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_transport_ipc.h" 5 #include "chrome/renderer/media/cast_transport_ipc.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 23 matching lines...) Expand all
34 CastTransportIPC::~CastTransportIPC() { 34 CastTransportIPC::~CastTransportIPC() {
35 Send(new CastHostMsg_Delete(channel_id_)); 35 Send(new CastHostMsg_Delete(channel_id_));
36 if (CastIPCDispatcher::Get()) { 36 if (CastIPCDispatcher::Get()) {
37 CastIPCDispatcher::Get()->RemoveSender(channel_id_); 37 CastIPCDispatcher::Get()->RemoveSender(channel_id_);
38 } 38 }
39 } 39 }
40 40
41 void CastTransportIPC::InitializeStream( 41 void CastTransportIPC::InitializeStream(
42 const media::cast::CastTransportRtpConfig& config, 42 const media::cast::CastTransportRtpConfig& config,
43 std::unique_ptr<media::cast::RtcpObserver> rtcp_observer) { 43 std::unique_ptr<media::cast::RtcpObserver> rtcp_observer) {
44 DCHECK(clients_.find(config.ssrc) == clients_.end()); 44 if (rtcp_observer) {
45 clients_[config.ssrc] = std::move(rtcp_observer); 45 DCHECK(clients_.find(config.ssrc) == clients_.end());
46 clients_[config.ssrc] = std::move(rtcp_observer);
47 }
46 Send(new CastHostMsg_InitializeStream(channel_id_, config)); 48 Send(new CastHostMsg_InitializeStream(channel_id_, config));
47 } 49 }
48 50
49 void CastTransportIPC::InsertFrame(uint32_t ssrc, 51 void CastTransportIPC::InsertFrame(uint32_t ssrc,
50 const media::cast::EncodedFrame& frame) { 52 const media::cast::EncodedFrame& frame) {
51 Send(new CastHostMsg_InsertFrame(channel_id_, ssrc, frame)); 53 Send(new CastHostMsg_InsertFrame(channel_id_, ssrc, frame));
52 } 54 }
53 55
54 void CastTransportIPC::SendSenderReport( 56 void CastTransportIPC::SendSenderReport(
55 uint32_t ssrc, 57 uint32_t ssrc,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 175 }
174 } 176 }
175 177
176 void CastTransportIPC::Send(IPC::Message* message) { 178 void CastTransportIPC::Send(IPC::Message* message) {
177 if (CastIPCDispatcher::Get()) { 179 if (CastIPCDispatcher::Get()) {
178 CastIPCDispatcher::Get()->Send(message); 180 CastIPCDispatcher::Get()->Send(message);
179 } else { 181 } else {
180 delete message; 182 delete message;
181 } 183 }
182 } 184 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698