| OLD | NEW |
| 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 20 matching lines...) Expand all Loading... |
| 31 *options)); | 31 *options)); |
| 32 } | 32 } |
| 33 | 33 |
| 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::InitializeAudio( | 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 DCHECK(clients_.find(config.ssrc) == clients_.end()); |
| 45 clients_[config.ssrc] = std::move(rtcp_observer); | 45 clients_[config.ssrc] = std::move(rtcp_observer); |
| 46 Send(new CastHostMsg_InitializeAudio(channel_id_, config)); | 46 Send(new CastHostMsg_InitializeStream(channel_id_, config)); |
| 47 } | |
| 48 | |
| 49 void CastTransportIPC::InitializeVideo( | |
| 50 const media::cast::CastTransportRtpConfig& config, | |
| 51 std::unique_ptr<media::cast::RtcpObserver> rtcp_observer) { | |
| 52 DCHECK(clients_.find(config.ssrc) == clients_.end()); | |
| 53 clients_[config.ssrc] = std::move(rtcp_observer); | |
| 54 Send(new CastHostMsg_InitializeVideo(channel_id_, config)); | |
| 55 } | 47 } |
| 56 | 48 |
| 57 void CastTransportIPC::InsertFrame(uint32_t ssrc, | 49 void CastTransportIPC::InsertFrame(uint32_t ssrc, |
| 58 const media::cast::EncodedFrame& frame) { | 50 const media::cast::EncodedFrame& frame) { |
| 59 Send(new CastHostMsg_InsertFrame(channel_id_, ssrc, frame)); | 51 Send(new CastHostMsg_InsertFrame(channel_id_, ssrc, frame)); |
| 60 } | 52 } |
| 61 | 53 |
| 62 void CastTransportIPC::SendSenderReport( | 54 void CastTransportIPC::SendSenderReport( |
| 63 uint32_t ssrc, | 55 uint32_t ssrc, |
| 64 base::TimeTicks current_time, | 56 base::TimeTicks current_time, |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 173 } |
| 182 } | 174 } |
| 183 | 175 |
| 184 void CastTransportIPC::Send(IPC::Message* message) { | 176 void CastTransportIPC::Send(IPC::Message* message) { |
| 185 if (CastIPCDispatcher::Get()) { | 177 if (CastIPCDispatcher::Get()) { |
| 186 CastIPCDispatcher::Get()->Send(message); | 178 CastIPCDispatcher::Get()->Send(message); |
| 187 } else { | 179 } else { |
| 188 delete message; | 180 delete message; |
| 189 } | 181 } |
| 190 } | 182 } |
| OLD | NEW |