| 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 #ifndef MEDIA_CAST_LOGGING_LOG_SERIALIZER_H_ | 5 #ifndef MEDIA_CAST_LOGGING_LOG_SERIALIZER_H_ |
| 6 #define MEDIA_CAST_LOGGING_LOG_SERIALIZER_H_ | 6 #define MEDIA_CAST_LOGGING_LOG_SERIALIZER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "media/cast/logging/encoding_event_subscriber.h" | 10 #include "media/cast/logging/encoding_event_subscriber.h" |
| 12 | 11 |
| 13 namespace media { | 12 namespace media { |
| 14 namespace cast { | 13 namespace cast { |
| 15 | 14 |
| 16 // Serialize |frame_events|, |packet_events|, |log_metadata| | 15 // Serialize |frame_events|, |packet_events|, |log_metadata| |
| 17 // returned from EncodingEventSubscriber. | 16 // returned from EncodingEventSubscriber. |
| 18 // Result is written to |output|, which can hold |max_output_bytes| of data. | 17 // Result is written to |output|, which can hold |max_output_bytes| of data. |
| 19 // If |compress| is true, |output| will be set with data compresssed in | 18 // If |compress| is true, |output| will be set with data compresssed in |
| 20 // gzip format. | 19 // gzip format. |
| 21 // |output_bytes| will be set to number of bytes written. | 20 // |output_bytes| will be set to number of bytes written. |
| 22 // | 21 // |
| 23 // Returns |true| if serialization is successful. This function | 22 // Returns |true| if serialization is successful. This function |
| 24 // returns |false| if the serialized string will exceed |max_output_bytes|. | 23 // returns |false| if the serialized string will exceed |max_output_bytes|. |
| 25 // | 24 // |
| 26 // See .cc file for format specification. | 25 // See .cc file for format specification. |
| 27 bool SerializeEvents(const media::cast::proto::LogMetadata& log_metadata, | 26 bool SerializeEvents(const media::cast::proto::LogMetadata& log_metadata, |
| 28 const FrameEventMap& frame_events, | 27 const FrameEventList& frame_events, |
| 29 const PacketEventMap& packet_events, | 28 const PacketEventList& packet_events, |
| 30 bool compress, | 29 bool compress, |
| 31 int max_output_bytes, | 30 int max_output_bytes, |
| 32 char* output, | 31 char* output, |
| 33 int* output_bytes); | 32 int* output_bytes); |
| 34 | 33 |
| 35 } // namespace cast | 34 } // namespace cast |
| 36 } // namespace media | 35 } // namespace media |
| 37 | 36 |
| 38 #endif // MEDIA_CAST_LOGGING_LOG_SERIALIZER_H_ | 37 #endif // MEDIA_CAST_LOGGING_LOG_SERIALIZER_H_ |
| OLD | NEW |