Chromium Code Reviews| Index: chrome/browser/media/cast_transport_host_filter.cc |
| diff --git a/chrome/browser/media/cast_transport_host_filter.cc b/chrome/browser/media/cast_transport_host_filter.cc |
| index bf8fc0b81940cfd8553282e6dd17131271395ce3..725247cc8c5c5e438a11a988a28167a98075a131 100644 |
| --- a/chrome/browser/media/cast_transport_host_filter.cc |
| +++ b/chrome/browser/media/cast_transport_host_filter.cc |
| @@ -89,6 +89,7 @@ bool CastTransportHostFilter::OnMessageReceived(const IPC::Message& message) { |
| IPC_MESSAGE_HANDLER(CastHostMsg_InitializeRtpReceiverRtcpBuilder, |
| OnInitializeRtpReceiverRtcpBuilder) |
| IPC_MESSAGE_HANDLER(CastHostMsg_AddCastFeedback, OnAddCastFeedback) |
| + IPC_MESSAGE_HANDLER(CastHostMsg_AddPli, OnAddPli) |
| IPC_MESSAGE_HANDLER(CastHostMsg_AddRtcpEvents, OnAddRtcpEvents) |
| IPC_MESSAGE_HANDLER(CastHostMsg_AddRtpReceiverReport, |
| OnAddRtpReceiverReport) |
| @@ -100,16 +101,21 @@ bool CastTransportHostFilter::OnMessageReceived(const IPC::Message& message) { |
| } |
| void CastTransportHostFilter::SendRtt(int32_t channel_id, |
| - uint32_t ssrc, |
| + uint32_t rtp_sender_ssrc, |
| base::TimeDelta rtt) { |
| - Send(new CastMsg_Rtt(channel_id, ssrc, rtt)); |
| + Send(new CastMsg_Rtt(channel_id, rtp_sender_ssrc, rtt)); |
| } |
| void CastTransportHostFilter::SendCastMessage( |
| int32_t channel_id, |
| - uint32_t ssrc, |
| + uint32_t rtp_sender_ssrc, |
| const media::cast::RtcpCastMessage& cast_message) { |
| - Send(new CastMsg_RtcpCastMessage(channel_id, ssrc, cast_message)); |
| + Send(new CastMsg_RtcpCastMessage(channel_id, rtp_sender_ssrc, cast_message)); |
| +} |
| + |
| +void CastTransportHostFilter::SendReceivedPli(int32_t channel_id, |
| + uint32_t rtp_sender_ssrc) { |
| + Send(new CastMsg_Pli(channel_id, rtp_sender_ssrc)); |
| } |
| void CastTransportHostFilter::OnNew(int32_t channel_id, |
| @@ -168,13 +174,12 @@ void CastTransportHostFilter::OnInitializeAudio( |
| media::cast::CastTransportSender* sender = id_map_.Lookup(channel_id); |
| if (sender) { |
| sender->InitializeAudio( |
| - config, |
| - base::Bind(&CastTransportHostFilter::SendCastMessage, |
| - weak_factory_.GetWeakPtr(), |
| - channel_id, config.ssrc), |
| + config, base::Bind(&CastTransportHostFilter::SendCastMessage, |
| + weak_factory_.GetWeakPtr(), channel_id, config.ssrc), |
| base::Bind(&CastTransportHostFilter::SendRtt, |
| - weak_factory_.GetWeakPtr(), |
| - channel_id, config.ssrc)); |
| + weak_factory_.GetWeakPtr(), channel_id, config.ssrc), |
| + base::Bind(&CastTransportHostFilter::SendReceivedPli, |
| + weak_factory_.GetWeakPtr(), channel_id, config.ssrc)); |
| } else { |
| DVLOG(1) |
| << "CastTransportHostFilter::OnInitializeAudio on non-existing channel"; |
| @@ -187,13 +192,12 @@ void CastTransportHostFilter::OnInitializeVideo( |
| media::cast::CastTransportSender* sender = id_map_.Lookup(channel_id); |
| if (sender) { |
| sender->InitializeVideo( |
| - config, |
| - base::Bind(&CastTransportHostFilter::SendCastMessage, |
| - weak_factory_.GetWeakPtr(), |
| - channel_id, config.ssrc), |
| + config, base::Bind(&CastTransportHostFilter::SendCastMessage, |
| + weak_factory_.GetWeakPtr(), channel_id, config.ssrc), |
| base::Bind(&CastTransportHostFilter::SendRtt, |
| - weak_factory_.GetWeakPtr(), |
| - channel_id, config.ssrc)); |
| + weak_factory_.GetWeakPtr(), channel_id, config.ssrc), |
| + base::Bind(&CastTransportHostFilter::SendReceivedPli, |
| + weak_factory_.GetWeakPtr(), channel_id, config.ssrc)); |
| } else { |
| DVLOG(1) |
| << "CastTransportHostFilter::OnInitializeVideo on non-existing channel"; |
| @@ -296,6 +300,17 @@ void CastTransportHostFilter::OnAddCastFeedback( |
| } |
| } |
| +void CastTransportHostFilter::OnAddPli( |
| + int32_t channel_id, |
| + const ::media::cast::RtcpPliMessage& pli_message) { |
|
dcheng
2016/03/16 01:39:24
Nit: no :: for local consistency
xjz
2016/03/16 17:12:13
Done.
|
| + media::cast::CastTransportSender* sender = id_map_.Lookup(channel_id); |
| + if (sender) { |
| + sender->AddPli(pli_message); |
| + } else { |
| + DVLOG(1) << "CastTransportHostFilter::OnAddPli on non-existing channel"; |
| + } |
| +} |
| + |
| void CastTransportHostFilter::OnAddRtcpEvents( |
| int32_t channel_id, |
| const media::cast::ReceiverRtcpEventSubscriber::RtcpEvents& rtcp_events) { |