OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/encoding_event_subscriber.h" | 5 #include "media/cast/logging/encoding_event_subscriber.h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 DCHECK(frame_event_map_.size() <= kMaxMapSize); | 109 DCHECK(frame_event_map_.size() <= kMaxMapSize); |
110 DCHECK(frame_event_storage_.size() <= max_frames_); | 110 DCHECK(frame_event_storage_.size() <= max_frames_); |
111 } | 111 } |
112 | 112 |
113 void EncodingEventSubscriber::OnReceivePacketEvent( | 113 void EncodingEventSubscriber::OnReceivePacketEvent( |
114 const PacketEvent& packet_event) { | 114 const PacketEvent& packet_event) { |
115 DCHECK(thread_checker_.CalledOnValidThread()); | 115 DCHECK(thread_checker_.CalledOnValidThread()); |
116 | 116 |
117 if (event_media_type_ != packet_event.media_type) | 117 if (event_media_type_ != packet_event.media_type) |
118 return; | 118 return; |
| 119 |
119 RtpTimestamp relative_rtp_timestamp = | 120 RtpTimestamp relative_rtp_timestamp = |
120 GetRelativeRtpTimestamp(packet_event.rtp_timestamp); | 121 GetRelativeRtpTimestamp(packet_event.rtp_timestamp); |
121 PacketEventMap::iterator it = | 122 PacketEventMap::iterator it = |
122 packet_event_map_.find(relative_rtp_timestamp); | 123 packet_event_map_.find(relative_rtp_timestamp); |
123 linked_ptr<AggregatedPacketEvent> event_proto; | 124 linked_ptr<AggregatedPacketEvent> event_proto; |
124 BasePacketEvent* base_packet_event_proto = NULL; | 125 BasePacketEvent* base_packet_event_proto = NULL; |
125 | 126 |
126 // Look up existing entry. If not found, create a new entry and add to map. | 127 // Look up existing entry. If not found, create a new entry and add to map. |
127 if (it == packet_event_map_.end()) { | 128 if (it == packet_event_map_.end()) { |
128 event_proto.reset(new AggregatedPacketEvent); | 129 event_proto.reset(new AggregatedPacketEvent); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 frame_event_storage_index_ = 0; | 277 frame_event_storage_index_ = 0; |
277 packet_event_map_.clear(); | 278 packet_event_map_.clear(); |
278 packet_event_storage_.clear(); | 279 packet_event_storage_.clear(); |
279 packet_event_storage_index_ = 0; | 280 packet_event_storage_index_ = 0; |
280 seen_first_rtp_timestamp_ = false; | 281 seen_first_rtp_timestamp_ = false; |
281 first_rtp_timestamp_ = 0u; | 282 first_rtp_timestamp_ = 0u; |
282 } | 283 } |
283 | 284 |
284 } // namespace cast | 285 } // namespace cast |
285 } // namespace media | 286 } // namespace media |
OLD | NEW |