| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 data.ntp_fraction = ntp_fraction; | 71 data.ntp_fraction = ntp_fraction; |
| 72 data.rtp_timestamp = rtp_timestamp; | 72 data.rtp_timestamp = rtp_timestamp; |
| 73 Send(new CastHostMsg_SendRtcpFromRtpSender( | 73 Send(new CastHostMsg_SendRtcpFromRtpSender( |
| 74 channel_id_, | 74 channel_id_, |
| 75 data, | 75 data, |
| 76 dlrr)); | 76 dlrr)); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void CastTransportSenderIPC::ResendPackets( | 79 void CastTransportSenderIPC::ResendPackets( |
| 80 bool is_audio, | 80 bool is_audio, |
| 81 const media::cast::MissingFramesAndPacketsMap& missing_packets) { | 81 const media::cast::MissingFramesAndPacketsMap& missing_packets, |
| 82 bool cancel_rtx_not_in_list) { |
| 82 Send(new CastHostMsg_ResendPackets(channel_id_, | 83 Send(new CastHostMsg_ResendPackets(channel_id_, |
| 83 is_audio, | 84 is_audio, |
| 84 missing_packets)); | 85 missing_packets, |
| 86 cancel_rtx_not_in_list)); |
| 85 } | 87 } |
| 86 | 88 |
| 87 void CastTransportSenderIPC::OnReceivedPacket( | 89 void CastTransportSenderIPC::OnReceivedPacket( |
| 88 const media::cast::Packet& packet) { | 90 const media::cast::Packet& packet) { |
| 89 if (!packet_callback_.is_null()) { | 91 if (!packet_callback_.is_null()) { |
| 90 // TODO(hubbe): Perhaps an non-ownership-transferring cb here? | 92 // TODO(hubbe): Perhaps an non-ownership-transferring cb here? |
| 91 scoped_ptr<media::cast::transport::Packet> packet_copy( | 93 scoped_ptr<media::cast::transport::Packet> packet_copy( |
| 92 new media::cast::transport::Packet(packet)); | 94 new media::cast::transport::Packet(packet)); |
| 93 packet_callback_.Run(packet_copy.Pass()); | 95 packet_callback_.Run(packet_copy.Pass()); |
| 94 } else { | 96 } else { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 106 raw_events_callback_.Run(packet_events); | 108 raw_events_callback_.Run(packet_events); |
| 107 } | 109 } |
| 108 | 110 |
| 109 void CastTransportSenderIPC::Send(IPC::Message* message) { | 111 void CastTransportSenderIPC::Send(IPC::Message* message) { |
| 110 if (CastIPCDispatcher::Get()) { | 112 if (CastIPCDispatcher::Get()) { |
| 111 CastIPCDispatcher::Get()->Send(message); | 113 CastIPCDispatcher::Get()->Send(message); |
| 112 } else { | 114 } else { |
| 113 delete message; | 115 delete message; |
| 114 } | 116 } |
| 115 } | 117 } |
| OLD | NEW |