| 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_sender_ipc.h" | 5 #include "chrome/renderer/media/cast_transport_sender_ipc.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "chrome/common/cast_messages.h" | 9 #include "chrome/common/cast_messages.h" |
| 10 #include "chrome/renderer/media/cast_ipc_dispatcher.h" | 10 #include "chrome/renderer/media/cast_ipc_dispatcher.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 void CastTransportSenderIPC::InitializeVideo( | 44 void CastTransportSenderIPC::InitializeVideo( |
| 45 const media::cast::CastTransportRtpConfig& config, | 45 const media::cast::CastTransportRtpConfig& config, |
| 46 const media::cast::RtcpCastMessageCallback& cast_message_cb, | 46 const media::cast::RtcpCastMessageCallback& cast_message_cb, |
| 47 const media::cast::RtcpRttCallback& rtt_cb) { | 47 const media::cast::RtcpRttCallback& rtt_cb) { |
| 48 clients_[config.ssrc].cast_message_cb = cast_message_cb; | 48 clients_[config.ssrc].cast_message_cb = cast_message_cb; |
| 49 clients_[config.ssrc].rtt_cb = rtt_cb; | 49 clients_[config.ssrc].rtt_cb = rtt_cb; |
| 50 Send(new CastHostMsg_InitializeVideo(channel_id_, config)); | 50 Send(new CastHostMsg_InitializeVideo(channel_id_, config)); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void CastTransportSenderIPC::InsertCodedAudioFrame( | 53 void CastTransportSenderIPC::InsertFrame(uint32 ssrc, |
| 54 const media::cast::EncodedFrame& audio_frame) { | 54 const media::cast::EncodedFrame& frame) { |
| 55 Send(new CastHostMsg_InsertCodedAudioFrame(channel_id_, audio_frame)); | 55 Send(new CastHostMsg_InsertFrame(channel_id_, ssrc, frame)); |
| 56 } | |
| 57 | |
| 58 void CastTransportSenderIPC::InsertCodedVideoFrame( | |
| 59 const media::cast::EncodedFrame& video_frame) { | |
| 60 Send(new CastHostMsg_InsertCodedVideoFrame(channel_id_, video_frame)); | |
| 61 } | 56 } |
| 62 | 57 |
| 63 void CastTransportSenderIPC::SendSenderReport( | 58 void CastTransportSenderIPC::SendSenderReport( |
| 64 uint32 ssrc, | 59 uint32 ssrc, |
| 65 base::TimeTicks current_time, | 60 base::TimeTicks current_time, |
| 66 uint32 current_time_as_rtp_timestamp) { | 61 uint32 current_time_as_rtp_timestamp) { |
| 67 Send(new CastHostMsg_SendSenderReport(channel_id_, | 62 Send(new CastHostMsg_SendSenderReport(channel_id_, |
| 68 ssrc, | 63 ssrc, |
| 69 current_time, | 64 current_time, |
| 70 current_time_as_rtp_timestamp)); | 65 current_time_as_rtp_timestamp)); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 it->second.cast_message_cb.Run(cast_message); | 120 it->second.cast_message_cb.Run(cast_message); |
| 126 } | 121 } |
| 127 | 122 |
| 128 void CastTransportSenderIPC::Send(IPC::Message* message) { | 123 void CastTransportSenderIPC::Send(IPC::Message* message) { |
| 129 if (CastIPCDispatcher::Get()) { | 124 if (CastIPCDispatcher::Get()) { |
| 130 CastIPCDispatcher::Get()->Send(message); | 125 CastIPCDispatcher::Get()->Send(message); |
| 131 } else { | 126 } else { |
| 132 delete message; | 127 delete message; |
| 133 } | 128 } |
| 134 } | 129 } |
| OLD | NEW |