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

Side by Side Diff: media/cast/logging/logging_raw.cc

Issue 69603002: Incorporating logging into Cast (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/cast/logging/logging_raw.h" 5 #include "media/cast/logging/logging_raw.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // Create a new map entry. 57 // Create a new map entry.
58 FrameEvent info; 58 FrameEvent info;
59 info.frame_id = frame_id; 59 info.frame_id = frame_id;
60 info.timestamp.push_back(clock_->NowTicks()); 60 info.timestamp.push_back(clock_->NowTicks());
61 info.type.push_back(event); 61 info.type.push_back(event);
62 frame_map_.insert(std::make_pair(rtp_timestamp, info)); 62 frame_map_.insert(std::make_pair(rtp_timestamp, info));
63 } else { 63 } else {
64 // Insert to an existing entry. 64 // Insert to an existing entry.
65 it->second.timestamp.push_back(clock_->NowTicks()); 65 it->second.timestamp.push_back(clock_->NowTicks());
66 it->second.type.push_back(event); 66 it->second.type.push_back(event);
67 // Do we have a valid frame_id?
68 // We don't always have it to begin with.
69 // TODO(mikhal): Switch frame_id to int when the fix gets in.
70 // This is currently illegal, as frame_id is uint8.
71 if (it->second.frame_id == -1 && frame_id != -1)
72 it->second.frame_id = frame_id;
67 } 73 }
68 } 74 }
69 75
70 void LoggingRaw::InsertPacketEvent(CastLoggingEvent event, 76 void LoggingRaw::InsertPacketEvent(CastLoggingEvent event,
71 uint32 rtp_timestamp, 77 uint32 rtp_timestamp,
72 uint8 frame_id, 78 uint8 frame_id,
73 uint16 packet_id, 79 uint16 packet_id,
74 uint16 max_packet_id, 80 uint16 max_packet_id,
75 int size) { 81 size_t size) {
76 // Is this packet belonging to a new frame? 82 // Is this packet belonging to a new frame?
77 PacketRawMap::iterator it = packet_map_.find(rtp_timestamp); 83 PacketRawMap::iterator it = packet_map_.find(rtp_timestamp);
78 if (it == packet_map_.end()) { 84 if (it == packet_map_.end()) {
79 // Create a new entry - start with base packet map. 85 // Create a new entry - start with base packet map.
80 PacketEvent info; 86 PacketEvent info;
81 info.frame_id = frame_id; 87 info.frame_id = frame_id;
82 info.max_packet_id = max_packet_id; 88 info.max_packet_id = max_packet_id;
83 BasePacketInfo base_info; 89 BasePacketInfo base_info;
84 base_info.size = size; 90 base_info.size = size;
85 base_info.timestamp.push_back(clock_->NowTicks()); 91 base_info.timestamp.push_back(clock_->NowTicks());
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 136 }
131 137
132 void LoggingRaw::Reset() { 138 void LoggingRaw::Reset() {
133 frame_map_.clear(); 139 frame_map_.clear();
134 packet_map_.clear(); 140 packet_map_.clear();
135 generic_map_.clear(); 141 generic_map_.clear();
136 } 142 }
137 143
138 } // namespace cast 144 } // namespace cast
139 } // namespace media 145 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698