Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: chrome/browser/media/cast_transport_host_filter.cc

Issue 178073004: Cast: IPC from browser to renderer to send packet events from transport to cast library. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 807d0e1019fb68b545335098fa0c22af3fbc6728..2f879315594ac9c8be59f01fe0e68424d3755044 100644
--- a/chrome/browser/media/cast_transport_host_filter.cc
+++ b/chrome/browser/media/cast_transport_host_filter.cc
@@ -8,6 +8,12 @@
#include "chrome/browser/net/chrome_net_log.h"
#include "media/cast/transport/cast_transport_sender.h"
+namespace {
+
+// How often to send raw events.
+const int kSendRawEventsIntervalSecs = 1;
+}
+
namespace cast {
CastTransportHostFilter::CastTransportHostFilter()
@@ -58,9 +64,18 @@ void CastTransportHostFilter::ReceivedRtpStatistics(
channel_id, audio, sender_info, time_sent, rtp_timestamp));
}
-void CastTransportHostFilter::OnNew(int32 channel_id,
- const net::IPEndPoint& local_end_point,
- const net::IPEndPoint& remote_end_point) {
+void CastTransportHostFilter::RawEvents(
+ int32 channel_id,
+ const std::vector<media::cast::PacketEvent>& packet_events) {
+ if (!packet_events.empty())
+ Send(new CastMsg_RawEvents(channel_id, packet_events));
+}
+
+void CastTransportHostFilter::OnNew(
+ int32 channel_id,
+ const net::IPEndPoint& local_end_point,
+ const net::IPEndPoint& remote_end_point,
+ const media::cast::CastLoggingConfig& logging_config) {
if (id_map_.Lookup(channel_id)) {
id_map_.Remove(channel_id);
}
@@ -71,9 +86,14 @@ void CastTransportHostFilter::OnNew(int32 channel_id,
&clock_,
local_end_point,
remote_end_point,
+ 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,
« no previous file with comments | « chrome/browser/media/cast_transport_host_filter.h ('k') | chrome/browser/media/cast_transport_host_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698