Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / media / cast / logging / logging_defines.h
blobf1d5c81620c2b14e3cdeced23463609d1e3cd47c
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.
5 #ifndef MEDIA_CAST_LOGGING_LOGGING_DEFINES_H_
6 #define MEDIA_CAST_LOGGING_LOGGING_DEFINES_H_
8 #include <map>
9 #include <string>
10 #include <vector>
12 #include "base/time/time.h"
14 namespace media {
15 namespace cast {
17 static const uint32 kFrameIdUnknown = 0xFFFFFFFF;
19 typedef uint32 RtpTimestamp;
21 enum CastLoggingEvent {
22 kUnknown,
23 // Generic events. These are no longer used.
24 kRttMs,
25 kPacketLoss,
26 kJitterMs,
27 kVideoAckReceived, // Sender side frame event.
28 kRembBitrate, // Generic event. No longer used.
29 // Receiver side frame events.
30 kAudioAckSent,
31 kVideoAckSent,
32 // Audio sender.
33 kAudioFrameCaptureBegin,
34 kAudioFrameCaptureEnd,
35 kAudioFrameEncoded,
36 // Audio receiver.
37 kAudioFrameDecoded,
38 kAudioPlayoutDelay,
39 // Video sender.
40 kVideoFrameCaptureBegin,
41 kVideoFrameCaptureEnd,
42 kVideoFrameSentToEncoder, // Deprecated
43 kVideoFrameEncoded,
44 // Video receiver.
45 kVideoFrameDecoded,
46 kVideoRenderDelay,
47 // Send-side packet events.
48 kAudioPacketSentToNetwork,
49 kVideoPacketSentToNetwork,
50 kAudioPacketRetransmitted,
51 kVideoPacketRetransmitted,
52 // Receive-side packet events.
53 kAudioPacketReceived,
54 kVideoPacketReceived,
55 kDuplicateAudioPacketReceived,
56 kDuplicateVideoPacketReceived,
57 kNumOfLoggingEvents = kDuplicateVideoPacketReceived
60 const char* CastLoggingToString(CastLoggingEvent event);
62 // CastLoggingEvent are classified into one of three following types.
63 enum EventMediaType { AUDIO_EVENT, VIDEO_EVENT, OTHER_EVENT };
65 EventMediaType GetEventMediaType(CastLoggingEvent event);
67 struct FrameEvent {
68 FrameEvent();
69 ~FrameEvent();
71 RtpTimestamp rtp_timestamp;
72 uint32 frame_id;
73 // Size of encoded frame. Only set for kVideoFrameEncoded event.
74 size_t size;
76 // Time of event logged.
77 base::TimeTicks timestamp;
79 CastLoggingEvent type;
81 // Render / playout delay. Only set for kAudioPlayoutDelay and
82 // kVideoRenderDelay events.
83 base::TimeDelta delay_delta;
85 // Whether the frame is a key frame. Only set for kVideoFrameEncoded event.
86 bool key_frame;
88 // The requested target bitrate of the encoder at the time the frame is
89 // encoded. Only set for kVideoFrameEncoded event.
90 int target_bitrate;
93 struct PacketEvent {
94 PacketEvent();
95 ~PacketEvent();
97 RtpTimestamp rtp_timestamp;
98 uint32 frame_id;
99 uint16 max_packet_id;
100 uint16 packet_id;
101 size_t size;
103 // Time of event logged.
104 base::TimeTicks timestamp;
105 CastLoggingEvent type;
108 } // namespace cast
109 } // namespace media
111 #endif // MEDIA_CAST_LOGGING_LOGGING_DEFINES_H_