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

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

Issue 134843005: Cast:Updating logging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responding to review and removing unused files Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/cast/logging/logging_internal.h ('k') | media/cast/logging/logging_raw.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "media/cast/logging/logging_internal.h"
6
7 namespace media {
8 namespace cast {
9
10 FrameLogData::FrameLogData(base::TickClock* clock)
11 : clock_(clock),
12 frame_map_() {}
13
14 FrameLogData::~FrameLogData() {}
15
16 void FrameLogData::Insert(uint32 rtp_timestamp, uint32 frame_id) {
17 FrameEvent info;
18 InsertBase(rtp_timestamp, frame_id, info);
19 }
20
21 void FrameLogData::InsertWithSize(
22 uint32 rtp_timestamp, uint32 frame_id, int size) {
23 FrameEvent info;
24 info.size = size;
25 InsertBase(rtp_timestamp, frame_id, info);
26 }
27
28 void FrameLogData::InsertWithDelay(
29 uint32 rtp_timestamp, uint32 frame_id, base::TimeDelta delay) {
30 FrameEvent info;
31 info.delay_delta = delay;
32 InsertBase(rtp_timestamp, frame_id, info);
33 }
34
35 void FrameLogData::InsertBase(
36 uint32 rtp_timestamp, uint32 frame_id, FrameEvent info) {
37 info.timestamp = clock_->NowTicks();
38 info.frame_id = frame_id;
39 frame_map_.insert(std::make_pair(rtp_timestamp, info));
40 }
41
42 PacketLogData::PacketLogData(base::TickClock* clock)
43 : clock_(clock),
44 packet_map_() {}
45
46 PacketLogData::~PacketLogData() {}
47
48 void PacketLogData::Insert(uint32 rtp_timestamp,
49 uint32 frame_id, uint16 packet_id, uint16 max_packet_id, int size) {
50 PacketEvent info;
51 info.size = size;
52 info.max_packet_id = max_packet_id;
53 info.frame_id = frame_id;
54 info.timestamp = clock_->NowTicks();
55 // Is this a new frame?
56 PacketMap::iterator it = packet_map_.find(rtp_timestamp);
57 if (it == packet_map_.end()) {
58 // New rtp_timestamp id - create base packet map.
59 BasePacketMap base_map;
60 base_map.insert(std::make_pair(packet_id, info));
61 packet_map_.insert(std::make_pair(rtp_timestamp, base_map));
62 } else {
63 // Existing rtp_timestamp.
64 it->second.insert(std::make_pair(packet_id, info));
65 }
66 }
67
68 GenericLogData::GenericLogData(base::TickClock* clock)
69 : clock_(clock) {}
70
71 GenericLogData::~GenericLogData() {}
72
73 void GenericLogData::Insert(int data) {
74 data_.push_back(data);
75 timestamp_.push_back(clock_->NowTicks());
76 }
77
78 } // namespace cast
79 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/logging/logging_internal.h ('k') | media/cast/logging/logging_raw.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698