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

Side by Side Diff: media/cast/logging/proto/proto_utils.cc

Issue 270493003: Cast: Deduplicate event types in cast library. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
« no previous file with comments | « media/cast/logging/logging_raw_unittest.cc ('k') | media/cast/logging/proto/raw_events.proto » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "media/cast/logging/proto/proto_utils.h" 5 #include "media/cast/logging/proto/proto_utils.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 #define TO_PROTO_ENUM(from_enum, to_enum) \ 9 #define TO_PROTO_ENUM(enum) \
10 case from_enum: \ 10 case enum: \
11 return media::cast::proto::to_enum 11 return proto::enum
12 12
13 namespace media { 13 namespace media {
14 namespace cast { 14 namespace cast {
15 15
16 media::cast::proto::EventType ToProtoEventType(CastLoggingEvent event) { 16 proto::EventType ToProtoEventType(CastLoggingEvent event) {
17 switch (event) { 17 switch (event) {
18 TO_PROTO_ENUM(kUnknown, UNKNOWN); 18 TO_PROTO_ENUM(UNKNOWN);
19 TO_PROTO_ENUM(kRttMs, RTT_MS); 19 TO_PROTO_ENUM(FRAME_CAPTURE_BEGIN);
20 TO_PROTO_ENUM(kPacketLoss, PACKET_LOSS); 20 TO_PROTO_ENUM(FRAME_CAPTURE_END);
21 TO_PROTO_ENUM(kJitterMs, JITTER_MS); 21 TO_PROTO_ENUM(FRAME_ENCODED);
22 TO_PROTO_ENUM(kVideoAckReceived, VIDEO_ACK_RECEIVED); 22 TO_PROTO_ENUM(FRAME_ACK_RECEIVED);
23 TO_PROTO_ENUM(kRembBitrate, REMB_BITRATE); 23 TO_PROTO_ENUM(FRAME_ACK_SENT);
24 TO_PROTO_ENUM(kAudioAckSent, AUDIO_ACK_SENT); 24 TO_PROTO_ENUM(FRAME_DECODED);
25 TO_PROTO_ENUM(kVideoAckSent, VIDEO_ACK_SENT); 25 TO_PROTO_ENUM(FRAME_PLAYOUT);
26 TO_PROTO_ENUM(kAudioFrameCaptureEnd, AUDIO_FRAME_CAPTURE_END); 26 TO_PROTO_ENUM(PACKET_SENT_TO_NETWORK);
27 TO_PROTO_ENUM(kAudioFrameCaptureBegin, AUDIO_FRAME_CAPTURE_BEGIN); 27 TO_PROTO_ENUM(PACKET_RETRANSMITTED);
28 TO_PROTO_ENUM(kAudioFrameEncoded, AUDIO_FRAME_ENCODED); 28 TO_PROTO_ENUM(PACKET_RECEIVED);
29 TO_PROTO_ENUM(kAudioPlayoutDelay, AUDIO_PLAYOUT_DELAY);
30 TO_PROTO_ENUM(kAudioFrameDecoded, AUDIO_FRAME_DECODED);
31 TO_PROTO_ENUM(kVideoFrameCaptureBegin, VIDEO_FRAME_CAPTURE_BEGIN);
32 TO_PROTO_ENUM(kVideoFrameCaptureEnd, VIDEO_FRAME_CAPTURE_END);
33 TO_PROTO_ENUM(kVideoFrameSentToEncoder, VIDEO_FRAME_SENT_TO_ENCODER);
34 TO_PROTO_ENUM(kVideoFrameEncoded, VIDEO_FRAME_ENCODED);
35 TO_PROTO_ENUM(kVideoFrameDecoded, VIDEO_FRAME_DECODED);
36 TO_PROTO_ENUM(kVideoRenderDelay, VIDEO_RENDER_DELAY);
37 TO_PROTO_ENUM(kAudioPacketSentToNetwork, AUDIO_PACKET_SENT_TO_NETWORK);
38 TO_PROTO_ENUM(kVideoPacketSentToNetwork, VIDEO_PACKET_SENT_TO_NETWORK);
39 TO_PROTO_ENUM(kAudioPacketRetransmitted, AUDIO_PACKET_RETRANSMITTED);
40 TO_PROTO_ENUM(kVideoPacketRetransmitted, VIDEO_PACKET_RETRANSMITTED);
41 TO_PROTO_ENUM(kAudioPacketReceived, AUDIO_PACKET_RECEIVED);
42 TO_PROTO_ENUM(kVideoPacketReceived, VIDEO_PACKET_RECEIVED);
43 TO_PROTO_ENUM(kDuplicateAudioPacketReceived,
44 DUPLICATE_AUDIO_PACKET_RECEIVED);
45 TO_PROTO_ENUM(kDuplicateVideoPacketReceived,
46 DUPLICATE_VIDEO_PACKET_RECEIVED);
47 } 29 }
48 NOTREACHED(); 30 NOTREACHED();
49 return media::cast::proto::UNKNOWN; 31 return proto::UNKNOWN;
50 } 32 }
51 33
52 } // namespace cast 34 } // namespace cast
53 } // namespace media 35 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/logging/logging_raw_unittest.cc ('k') | media/cast/logging/proto/raw_events.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698