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 393090f80a2ab8747900aa7f4bc4d19edccd723c..968dc12d277030dd184b81298a0231aae378a8ed 100644 |
| --- a/chrome/browser/media/cast_transport_host_filter.cc |
| +++ b/chrome/browser/media/cast_transport_host_filter.cc |
| @@ -8,6 +8,13 @@ |
| #include "chrome/browser/net/chrome_net_log.h" |
| #include "media/cast/transport/cast_transport_sender.h" |
| +namespace { |
| + |
| +// How often to send raw events. |
| +static const int kSendRawEventsIntervalSecs = 1; |
|
miu
2014/02/26 22:43:51
nit: No need for 'static' if this is in the anonym
imcheng
2014/02/26 23:35:55
Done.
|
| + |
| +} |
| + |
| namespace cast { |
| CastTransportHostFilter::CastTransportHostFilter() |
| @@ -61,9 +68,17 @@ void CastTransportHostFilter::ReceivedRtpStatistics( |
| rtp_timestamp)); |
| } |
| +void CastTransportHostFilter::RawEvents( |
| + int32 channel_id, |
| + const std::vector<media::cast::PacketEvent>& packet_events) { |
| + if (!packet_events.empty()) |
|
miu
2014/02/26 22:43:51
Out of curiosity: Are we concerned about how much
imcheng
2014/02/26 23:35:55
Here's my rough calculation of how much data is be
|
| + Send(new CastMsg_RawEvents(channel_id, packet_events)); |
| +} |
| + |
| void CastTransportHostFilter::OnNew( |
| int32 channel_id, |
| - const media::cast::transport::CastTransportConfig& config) { |
| + const media::cast::transport::CastTransportConfig& config, |
| + const media::cast::CastLoggingConfig& logging_config) { |
| media::cast::transport::CastTransportSender* sender = |
| id_map_.Lookup(channel_id); |
| if (sender) { |
| @@ -75,9 +90,14 @@ void CastTransportHostFilter::OnNew( |
| g_browser_process->net_log(), |
| &clock_, |
| config, |
| + logging_config, |
| base::Bind(&CastTransportHostFilter::NotifyStatusChange, |
| base::Unretained(this), |
| channel_id), |
| + base::Bind(&CastTransportHostFilter::RawEvents, |
| + base::Unretained(this), |
| + channel_id), |
| + base::TimeDelta::FromSeconds(kSendRawEventsIntervalSecs), |
| base::MessageLoopProxy::current()); |
| sender->SetPacketReceiver( |
| base::Bind(&CastTransportHostFilter::ReceivedPacket, |