Chromium Code Reviews| Index: chrome/renderer/media/cast_transport_sender_ipc.cc |
| diff --git a/chrome/renderer/media/cast_transport_sender_ipc.cc b/chrome/renderer/media/cast_transport_sender_ipc.cc |
| index 03f3ca8d8d35721ea95e792fdf0a1c4bfcd0cf8e..c723240d5df56ac12ab02584c384d59e86a733cf 100644 |
| --- a/chrome/renderer/media/cast_transport_sender_ipc.cc |
| +++ b/chrome/renderer/media/cast_transport_sender_ipc.cc |
| @@ -47,18 +47,22 @@ CastTransportSenderIPC::~CastTransportSenderIPC() { |
| void CastTransportSenderIPC::InitializeAudio( |
| const media::cast::CastTransportRtpConfig& config, |
| const media::cast::RtcpCastMessageCallback& cast_message_cb, |
| - const media::cast::RtcpRttCallback& rtt_cb) { |
| + const media::cast::RtcpRttCallback& rtt_cb, |
| + const media::cast::RtcpPliCallback& pli_cb) { |
| clients_[config.ssrc].cast_message_cb = cast_message_cb; |
| clients_[config.ssrc].rtt_cb = rtt_cb; |
| + clients_[config.ssrc].pli_cb = pli_cb; |
| Send(new CastHostMsg_InitializeAudio(channel_id_, config)); |
| } |
| void CastTransportSenderIPC::InitializeVideo( |
| const media::cast::CastTransportRtpConfig& config, |
| const media::cast::RtcpCastMessageCallback& cast_message_cb, |
| - const media::cast::RtcpRttCallback& rtt_cb) { |
| + const media::cast::RtcpRttCallback& rtt_cb, |
| + const media::cast::RtcpPliCallback& pli_cb) { |
| clients_[config.ssrc].cast_message_cb = cast_message_cb; |
| clients_[config.ssrc].rtt_cb = rtt_cb; |
| + clients_[config.ssrc].pli_cb = pli_cb; |
| Send(new CastHostMsg_InitializeVideo(channel_id_, config)); |
| } |
| @@ -102,6 +106,7 @@ void CastTransportSenderIPC::SendRtcpFromRtpReceiver( |
| uint32_t sender_ssrc, |
| const media::cast::RtcpTimeData& time_data, |
| const media::cast::RtcpCastMessage* cast_message, |
| + const media::cast::RtcpPliMessage* pli_message, |
| base::TimeDelta target_delay, |
| const media::cast::ReceiverRtcpEventSubscriber::RtcpEvents* rtcp_events, |
| const media::cast::RtpReceiverStatistics* rtp_receiver_statistics) { |
| @@ -116,6 +121,10 @@ void CastTransportSenderIPC::SendRtcpFromRtpReceiver( |
| params.cast_message.reset( |
| const_cast<media::cast::RtcpCastMessage*>(cast_message)); |
| } |
| + if (pli_message) { |
| + params.pli_message.reset( |
|
dcheng
2016/03/01 23:44:12
Maybe the parameters shouldn't be const?
xjz
2016/03/02 04:24:17
The const_cast is used here only for the purpose t
dcheng
2016/03/02 07:41:24
But what's the point of making it const? Either th
xjz
2016/03/16 00:25:50
Not applicable.
|
| + const_cast<media::cast::RtcpPliMessage*>(pli_message)); |
| + } |
| params.target_delay = target_delay; |
| if (rtcp_events) { |
| params.rtcp_events.reset( |
| @@ -134,6 +143,7 @@ void CastTransportSenderIPC::SendRtcpFromRtpReceiver( |
| ignore_result(params.rtp_receiver_statistics.release()); |
| ignore_result(params.cast_message.release()); |
| + ignore_result(params.pli_message.release()); |
| ignore_result(params.rtcp_events.release()); |
| } |
| @@ -184,6 +194,17 @@ void CastTransportSenderIPC::OnRtcpCastMessage( |
| it->second.cast_message_cb.Run(cast_message); |
| } |
| +void CastTransportSenderIPC::OnReceivedPli(uint32_t ssrc) { |
| + ClientMap::iterator it = clients_.find(ssrc); |
| + if (it == clients_.end()) { |
| + LOG(ERROR) << "Received picture loss indicator from for unknown SSRC: " |
| + << ssrc; |
| + return; |
| + } |
| + if (!it->second.pli_cb.is_null()) |
| + it->second.pli_cb.Run(); |
| +} |
| + |
| void CastTransportSenderIPC::OnReceivedPacket( |
| const media::cast::Packet& packet) { |
| if (!packet_callback_.is_null()) { |