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

Unified Diff: media/cast/logging/logging_impl.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
« no previous file with comments | « media/cast/logging/logging_impl.h ('k') | media/cast/logging/logging_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/logging/logging_impl.cc
diff --git a/media/cast/logging/logging_impl.cc b/media/cast/logging/logging_impl.cc
index 75a239622ae432fbb06504620869146a2415e807..74c504d8495cf768e47161f6ce0f6ad44c05f49d 100644
--- a/media/cast/logging/logging_impl.cc
+++ b/media/cast/logging/logging_impl.cc
@@ -79,26 +79,40 @@ void LoggingImpl::InsertFrameEventWithDelay(
}
}
+void LoggingImpl::InsertSinglePacketEvent(const base::TimeTicks& time_of_event,
+ CastLoggingEvent event,
+ const Packet& packet) {
+ DCHECK(main_thread_proxy_->RunsTasksOnCurrentThread());
+
+ // Parse basic properties.
+ uint32 rtp_timestamp;
+ uint16 packet_id, max_packet_id;
+ const uint8* packet_data = &packet[0];
+ base::BigEndianReader big_endian_reader(
+ reinterpret_cast<const char*>(packet_data + 4), 4);
+ big_endian_reader.ReadU32(&rtp_timestamp);
+ base::BigEndianReader cast_big_endian_reader(
+ reinterpret_cast<const char*>(packet_data + 12 + 2), 4);
+ cast_big_endian_reader.ReadU16(&packet_id);
+ cast_big_endian_reader.ReadU16(&max_packet_id);
+
+ // rtp_timestamp is enough - no need for frame_id as well.
+ InsertPacketEvent(time_of_event,
+ event,
+ rtp_timestamp,
+ kFrameIdUnknown,
+ packet_id,
+ max_packet_id,
+ packet.size());
+}
+
void LoggingImpl::InsertPacketListEvent(const base::TimeTicks& time_of_event,
CastLoggingEvent event,
const PacketList& packets) {
DCHECK(main_thread_proxy_->RunsTasksOnCurrentThread());
- for (unsigned int i = 0; i < packets.size(); ++i) {
- const Packet& packet = packets[i];
- // Parse basic properties.
- uint32 rtp_timestamp;
- uint16 packet_id, max_packet_id;
- const uint8* packet_data = &packet[0];
- base::BigEndianReader big_endian_reader(
- reinterpret_cast<const char*>(packet_data + 4), 4);
- big_endian_reader.ReadU32(&rtp_timestamp);
- base::BigEndianReader cast_big_endian_reader(
- reinterpret_cast<const char*>(packet_data + 12 + 2), 4);
- cast_big_endian_reader.ReadU16(&packet_id);
- cast_big_endian_reader.ReadU16(&max_packet_id);
- // rtp_timestamp is enough - no need for frame_id as well.
- InsertPacketEvent(time_of_event, event, rtp_timestamp, kFrameIdUnknown,
- packet_id, max_packet_id, packet.size());
+ for (PacketList::const_iterator it = packets.begin(); it != packets.end();
+ ++it) {
+ InsertSinglePacketEvent(time_of_event, event, *it);
}
}
« no previous file with comments | « media/cast/logging/logging_impl.h ('k') | media/cast/logging/logging_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698