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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/logging/proto/proto_utils.cc
diff --git a/media/cast/logging/proto/proto_utils.cc b/media/cast/logging/proto/proto_utils.cc
index 90517e1fa10af51d82aea67b2a5b01c833c4c659..1f05616d83f05d5822d046a5bd47d80b82bc769b 100644
--- a/media/cast/logging/proto/proto_utils.cc
+++ b/media/cast/logging/proto/proto_utils.cc
@@ -6,47 +6,29 @@
#include "base/logging.h"
-#define TO_PROTO_ENUM(from_enum, to_enum) \
- case from_enum: \
- return media::cast::proto::to_enum
+#define TO_PROTO_ENUM(enum) \
+ case enum: \
+ return proto::enum
namespace media {
namespace cast {
-media::cast::proto::EventType ToProtoEventType(CastLoggingEvent event) {
+proto::EventType ToProtoEventType(CastLoggingEvent event) {
switch (event) {
- TO_PROTO_ENUM(kUnknown, UNKNOWN);
- TO_PROTO_ENUM(kRttMs, RTT_MS);
- TO_PROTO_ENUM(kPacketLoss, PACKET_LOSS);
- TO_PROTO_ENUM(kJitterMs, JITTER_MS);
- TO_PROTO_ENUM(kVideoAckReceived, VIDEO_ACK_RECEIVED);
- TO_PROTO_ENUM(kRembBitrate, REMB_BITRATE);
- TO_PROTO_ENUM(kAudioAckSent, AUDIO_ACK_SENT);
- TO_PROTO_ENUM(kVideoAckSent, VIDEO_ACK_SENT);
- TO_PROTO_ENUM(kAudioFrameCaptureEnd, AUDIO_FRAME_CAPTURE_END);
- TO_PROTO_ENUM(kAudioFrameCaptureBegin, AUDIO_FRAME_CAPTURE_BEGIN);
- TO_PROTO_ENUM(kAudioFrameEncoded, AUDIO_FRAME_ENCODED);
- TO_PROTO_ENUM(kAudioPlayoutDelay, AUDIO_PLAYOUT_DELAY);
- TO_PROTO_ENUM(kAudioFrameDecoded, AUDIO_FRAME_DECODED);
- TO_PROTO_ENUM(kVideoFrameCaptureBegin, VIDEO_FRAME_CAPTURE_BEGIN);
- TO_PROTO_ENUM(kVideoFrameCaptureEnd, VIDEO_FRAME_CAPTURE_END);
- TO_PROTO_ENUM(kVideoFrameSentToEncoder, VIDEO_FRAME_SENT_TO_ENCODER);
- TO_PROTO_ENUM(kVideoFrameEncoded, VIDEO_FRAME_ENCODED);
- TO_PROTO_ENUM(kVideoFrameDecoded, VIDEO_FRAME_DECODED);
- TO_PROTO_ENUM(kVideoRenderDelay, VIDEO_RENDER_DELAY);
- TO_PROTO_ENUM(kAudioPacketSentToNetwork, AUDIO_PACKET_SENT_TO_NETWORK);
- TO_PROTO_ENUM(kVideoPacketSentToNetwork, VIDEO_PACKET_SENT_TO_NETWORK);
- TO_PROTO_ENUM(kAudioPacketRetransmitted, AUDIO_PACKET_RETRANSMITTED);
- TO_PROTO_ENUM(kVideoPacketRetransmitted, VIDEO_PACKET_RETRANSMITTED);
- TO_PROTO_ENUM(kAudioPacketReceived, AUDIO_PACKET_RECEIVED);
- TO_PROTO_ENUM(kVideoPacketReceived, VIDEO_PACKET_RECEIVED);
- TO_PROTO_ENUM(kDuplicateAudioPacketReceived,
- DUPLICATE_AUDIO_PACKET_RECEIVED);
- TO_PROTO_ENUM(kDuplicateVideoPacketReceived,
- DUPLICATE_VIDEO_PACKET_RECEIVED);
+ TO_PROTO_ENUM(UNKNOWN);
+ TO_PROTO_ENUM(FRAME_CAPTURE_BEGIN);
+ TO_PROTO_ENUM(FRAME_CAPTURE_END);
+ TO_PROTO_ENUM(FRAME_ENCODED);
+ TO_PROTO_ENUM(FRAME_ACK_RECEIVED);
+ TO_PROTO_ENUM(FRAME_ACK_SENT);
+ TO_PROTO_ENUM(FRAME_DECODED);
+ TO_PROTO_ENUM(FRAME_PLAYOUT);
+ TO_PROTO_ENUM(PACKET_SENT_TO_NETWORK);
+ TO_PROTO_ENUM(PACKET_RETRANSMITTED);
+ TO_PROTO_ENUM(PACKET_RECEIVED);
}
NOTREACHED();
- return media::cast::proto::UNKNOWN;
+ return proto::UNKNOWN;
}
} // namespace cast
« 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