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 3f7739d506a0523a75f46b7431a6b15ca5e2b961..0a9af11f603021447278127d2308022b6da858e4 100644 |
| --- a/chrome/browser/media/cast_transport_host_filter.cc |
| +++ b/chrome/browser/media/cast_transport_host_filter.cc |
| @@ -38,11 +38,21 @@ bool CastTransportHostFilter::OnMessageReceived(const IPC::Message& message) { |
| OnResendFrameForKickstart) |
| IPC_MESSAGE_HANDLER(CastHostMsg_CancelSendingFrames, |
| OnCancelSendingFrames) |
| + IPC_MESSAGE_HANDLER(CastHostMsg_AddValidSsrc, |
| + OnAddValidSsrc) |
| + IPC_MESSAGE_HANDLER(CastHostMsg_SendRtcpFromRtpReceiver, |
| + OnSendRtcpFromRtpReceiver) |
| IPC_MESSAGE_UNHANDLED(handled = false); |
| IPC_END_MESSAGE_MAP(); |
| return handled; |
| } |
| +void CastTransportHostFilter::ReceivedPacket( |
| + int32 channel_id, |
| + scoped_ptr<media::cast::Packet> packet) { |
| + Send(new CastMsg_ReceivedPacket(channel_id, *packet)); |
| +} |
| + |
| void CastTransportHostFilter::NotifyStatusChange( |
| int32 channel_id, |
| media::cast::CastTransportStatus status) { |
| @@ -74,6 +84,7 @@ void CastTransportHostFilter::SendCastMessage( |
| void CastTransportHostFilter::OnNew( |
| int32 channel_id, |
| + const net::IPEndPoint& local_end_point, |
| const net::IPEndPoint& remote_end_point, |
| const base::DictionaryValue& options) { |
| if (!power_save_blocker_) { |
| @@ -92,6 +103,7 @@ void CastTransportHostFilter::OnNew( |
| media::cast::CastTransportSender::Create( |
| g_browser_process->net_log(), |
| &clock_, |
| + local_end_point, |
| remote_end_point, |
| make_scoped_ptr(options.DeepCopy()), |
| base::Bind(&CastTransportHostFilter::NotifyStatusChange, |
| @@ -101,6 +113,9 @@ void CastTransportHostFilter::OnNew( |
| weak_factory_.GetWeakPtr(), |
| channel_id), |
| base::TimeDelta::FromSeconds(kSendRawEventsIntervalSecs), |
| + base::Bind(&CastTransportHostFilter::ReceivedPacket, |
| + weak_factory_.GetWeakPtr(), |
| + channel_id), |
| base::MessageLoopProxy::current()); |
| id_map_.AddWithID(sender.release(), channel_id); |
| } |
| @@ -222,4 +237,37 @@ void CastTransportHostFilter::OnSendSenderReport( |
| } |
| } |
| +void CastTransportHostFilter::OnAddValidSsrc(int32 channel_id, uint32 ssrc) { |
| + media::cast::CastTransportSender* sender = |
| + id_map_.Lookup(channel_id); |
|
miu
2014/12/04 04:18:53
I think this statement fits on one line.
hubbe
2014/12/05 23:57:20
Fixed all over this file.
|
| + if (sender) { |
| + sender->AddValidSsrc(ssrc); |
| + } else { |
| + DVLOG(1) |
| + << "CastTransportHostFilter::OnAddValidSsrc " |
| + << "on non-existing channel"; |
| + } |
| +} |
| + |
| +void CastTransportHostFilter::OnSendRtcpFromRtpReceiver( |
| + int32 channel_id, |
| + const media::cast::SendRtcpFromRtpReceiver_Params& params) { |
| + media::cast::CastTransportSender* sender = |
| + id_map_.Lookup(channel_id); |
|
miu
2014/12/04 04:18:53
ditto (one line)
hubbe
2014/12/05 23:57:20
Done.
|
| + if (sender) { |
| + sender->SendRtcpFromRtpReceiver(params.ssrc, |
| + params.sender_ssrc, |
| + params.time_data, |
| + params.cast_message.get(), |
| + params.target_delay, |
| + params.rtcp_events.get(), |
| + params.rtp_receiver_statistics.get()); |
| + } else { |
| + DVLOG(1) |
| + << "CastTransportHostFilter::OnSendRtcpFromRtpReceiver " |
| + << "on non-existing channel"; |
| + } |
| +} |
| + |
| + |
| } // namespace cast |