Upstream version 8.37.180.0
[platform/framework/web/crosswalk.git] / src / media / cast / logging / proto / raw_events.proto
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
3 // found in the LICENSE file.
4
5 // Protocol for audio messages.
6
7 syntax = "proto2";
8
9 option optimize_for = LITE_RUNTIME;
10
11 package media.cast.proto;
12
13 // Keep in sync with media/cast/logging/logging_defines.h.
14 // For compatibility reasons, existing values in this enum must not be changed.
15 enum EventType {
16   UNKNOWN = 0;
17   
18   // Note: 1-28 are deprecated in favor of unified event types. Do not use.
19   // Generic events. No longer used.
20   RTT_MS = 1;
21   PACKET_LOSS = 2;
22   JITTER_MS = 3;
23   VIDEO_ACK_RECEIVED = 4;  // Sender side frame event.
24   REMB_BITRATE = 5;        // Generic event. No longer used.
25   // Audio receiver.
26   AUDIO_ACK_SENT = 6;
27   // Video receiver.
28   VIDEO_ACK_SENT = 7;
29   // Audio sender.
30   AUDIO_FRAME_CAPTURE_END = 8;
31   AUDIO_FRAME_CAPTURE_BEGIN = 9;
32   AUDIO_FRAME_ENCODED = 10;
33   // Audio receiver.
34   AUDIO_PLAYOUT_DELAY = 11;
35   AUDIO_FRAME_DECODED = 12;
36   // Video sender.
37   VIDEO_FRAME_CAPTURE_BEGIN = 13;
38   VIDEO_FRAME_CAPTURE_END = 14;
39   VIDEO_FRAME_SENT_TO_ENCODER = 15;  // Deprecated
40   VIDEO_FRAME_ENCODED = 16;
41   // Video receiver.
42   VIDEO_FRAME_DECODED = 17;
43   VIDEO_RENDER_DELAY = 18;
44   // Send-side packet events.
45   // AUDIO_PACKET_SENT_TO_PACER = 19;  // Deprecated
46   // VIDEO_PACKET_SENT_TO_PACER = 20;  // Deprecated
47   AUDIO_PACKET_SENT_TO_NETWORK = 21;
48   VIDEO_PACKET_SENT_TO_NETWORK = 22;
49   AUDIO_PACKET_RETRANSMITTED = 23;
50   VIDEO_PACKET_RETRANSMITTED = 24;
51   // Receiver-side packet events.
52   AUDIO_PACKET_RECEIVED = 25;
53   VIDEO_PACKET_RECEIVED = 26;
54   DUPLICATE_AUDIO_PACKET_RECEIVED = 27;
55   DUPLICATE_VIDEO_PACKET_RECEIVED = 28;
56   
57   
58   // New, unified event types.
59   FRAME_CAPTURE_BEGIN = 29;
60   FRAME_CAPTURE_END = 30;
61   FRAME_ENCODED = 31;
62   FRAME_ACK_RECEIVED = 32;
63   FRAME_ACK_SENT = 33;
64   FRAME_DECODED = 34;
65   FRAME_PLAYOUT = 35;
66   PACKET_SENT_TO_NETWORK = 36;
67   PACKET_RETRANSMITTED = 37;
68   PACKET_RECEIVED = 38;
69   PACKET_RTX_REJECTED = 39;
70 }
71
72 // Contains information independent of the stream that describes the system
73 // setup, e.g. OS and hardware info.
74 message GeneralDescription {
75   optional string product = 1;
76   optional string product_version = 2;
77   optional string os = 3;
78 }
79
80 // Each log will contain one |LogMetadata|.
81 message LogMetadata {
82   // |true| if the events are related to audio. |false| if they are related to
83   // video.
84   optional bool is_audio = 1;
85
86   // Used as a reference for all event entries.
87   // i.e. the original RTP timestamp for each event will be
88   // |first_rtp_timestamp| + |relative_rtp_timestamp|.
89   optional uint32 first_rtp_timestamp = 2;
90
91   // Number of AggregatedFrameEvent's.
92   optional int32 num_frame_events = 3;
93
94   // Number of AggregatedPacketEvent's.
95   optional int32 num_packet_events = 4;
96
97   // The internal timestamp value in milliseconds that represents the time
98   // of the Unix epoch. This is used for relating the timestamps in the events
99   // to a real time and date.
100   optional int64 reference_timestamp_ms_at_unix_epoch = 5;
101
102   // Extra data to attach to the log, e.g. experiment tags,
103   // in key-value JSON string format. The data is supplied by the application.
104   optional string extra_data = 6;
105
106   optional GeneralDescription general_description = 7;
107 }
108
109 message AggregatedFrameEvent {
110   optional uint32 relative_rtp_timestamp = 1;
111
112   repeated EventType event_type = 2 [packed = true];
113   
114   // The internal timestamp value in milliseconds. Use
115   // LogMetadata.reference_timestamp_ms_at_unix_epoch to relate to a real time
116   // and date.
117   repeated int64 event_timestamp_ms = 3 [packed = true];
118
119   // Only set if there is a frame encoded event.
120   optional int32 encoded_frame_size = 4;
121
122   // Only set if there is a frame playout event.
123   optional int32 delay_millis = 5;
124
125   // Only set if there is a video frame encoded event.
126   optional bool key_frame = 6;
127   
128   // Only set if there is a video frame encoded event.
129   optional int32 target_bitrate = 7;
130 };
131
132 message BasePacketEvent {
133   optional int32 packet_id = 1;
134   repeated EventType event_type = 2 [packed = true];
135   
136   // The internal timestamp value in milliseconds. Use
137   // LogMetadata.reference_timestamp_ms_at_unix_epoch to relate to a real time
138   // and date.
139   repeated int64 event_timestamp_ms = 3 [packed = true];
140
141   // Size of the packet.
142   optional int32 size = 4;
143 }
144
145 message AggregatedPacketEvent {
146   optional uint32 relative_rtp_timestamp = 1;
147   repeated BasePacketEvent base_packet_event = 2;
148 };
149