summaryrefslogtreecommitdiffstats
path: root/media/cast/logging/log_serializer.h
blob: 8aff54fc95d48595aec5a5c55e96bc98d4c4a8b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_CAST_LOGGING_LOG_SERIALIZER_H_
#define MEDIA_CAST_LOGGING_LOG_SERIALIZER_H_

#include <string>

#include "media/cast/logging/encoding_event_subscriber.h"

namespace media {
namespace cast {

// Serialize |frame_events|, |packet_events|, |log_metadata|
// returned from EncodingEventSubscriber.
// Result is written to |output|, which can hold |max_output_bytes| of data.
// If |compress| is true, |output| will be set with data compresssed in
// gzip format.
// |output_bytes| will be set to number of bytes written.
//
// Returns |true| if serialization is successful. This function
// returns |false| if the serialized string will exceed |max_output_bytes|.
//
// See .cc file for format specification.
bool SerializeEvents(const media::cast::proto::LogMetadata& log_metadata,
                     const FrameEventList& frame_events,
                     const PacketEventList& packet_events,
                     bool compress,
                     int max_output_bytes,
                     char* output,
                     int* output_bytes);

}  // namespace cast
}  // namespace media

#endif  // MEDIA_CAST_LOGGING_LOG_SERIALIZER_H_