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

Side by Side Diff: media/cast/logging/log_deserializer.h

Issue 241833002: Cast: Limit number of events/packets in EncodingEventSubscriber protos. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix merge Created 6 years, 7 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
OLDNEW
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 #ifndef MEDIA_CAST_LOGGING_LOG_DESERIALIZER_H_ 5 #ifndef MEDIA_CAST_LOGGING_LOG_DESERIALIZER_H_
6 #define MEDIA_CAST_LOGGING_LOG_DESERIALIZER_H_ 6 #define MEDIA_CAST_LOGGING_LOG_DESERIALIZER_H_
7 7
8 #include <map>
8 #include <string> 9 #include <string>
9 10
10 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/linked_ptr.h"
11 #include "media/cast/logging/encoding_event_subscriber.h" 12 #include "media/cast/logging/logging_defines.h"
13 #include "media/cast/logging/proto/raw_events.pb.h"
12 14
13 namespace media { 15 namespace media {
14 namespace cast { 16 namespace cast {
15 17
18 typedef std::map<RtpTimestamp,
19 linked_ptr<media::cast::proto::AggregatedFrameEvent> >
20 FrameEventMap;
21 typedef std::map<RtpTimestamp,
22 linked_ptr<media::cast::proto::AggregatedPacketEvent> >
23 PacketEventMap;
24
16 // Represents deserialized raw event logs for a particular stream. 25 // Represents deserialized raw event logs for a particular stream.
17 struct DeserializedLog { 26 struct DeserializedLog {
18 DeserializedLog(); 27 DeserializedLog();
19 ~DeserializedLog(); 28 ~DeserializedLog();
20 proto::LogMetadata metadata; 29 proto::LogMetadata metadata;
21 FrameEventMap frame_events; 30 FrameEventMap frame_events;
22 PacketEventMap packet_events; 31 PacketEventMap packet_events;
23 }; 32 };
24 33
25 // This function takes the output of LogSerializer and deserializes it into 34 // This function takes the output of LogSerializer and deserializes it into
26 // its original format. Returns true if deserialization is successful. All 35 // its original format. Returns true if deserialization is successful. All
27 // output arguments are valid if this function returns true. 36 // output arguments are valid if this function returns true.
28 // |data|: Serialized event logs with length |data_bytes|. 37 // |data|: Serialized event logs with length |data_bytes|.
29 // |compressed|: true if |data| is compressed in gzip format. 38 // |compressed|: true if |data| is compressed in gzip format.
30 // |log_metadata|: This will be populated with deserialized LogMetadata proto. 39 // |log_metadata|: This will be populated with deserialized LogMetadata proto.
31 // |audio_log|, |video_log|: These will be populated with deserialized 40 // |audio_log|, |video_log|: These will be populated with deserialized
32 // log data for audio and video streams, respectively. 41 // log data for audio and video streams, respectively.
33 bool DeserializeEvents(const char* data, 42 bool DeserializeEvents(const char* data,
34 int data_bytes, 43 int data_bytes,
35 bool compressed, 44 bool compressed,
36 DeserializedLog* audio_log, 45 DeserializedLog* audio_log,
37 DeserializedLog* video_log); 46 DeserializedLog* video_log);
38 47
39 } // namespace cast 48 } // namespace cast
40 } // namespace media 49 } // namespace media
41 50
42 #endif // MEDIA_CAST_LOGGING_LOG_DESERIALIZER_H_ 51 #endif // MEDIA_CAST_LOGGING_LOG_DESERIALIZER_H_
OLDNEW
« no previous file with comments | « media/cast/logging/encoding_event_subscriber_unittest.cc ('k') | media/cast/logging/log_deserializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698