| OLD | NEW |
| 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(enum) \ | 9 #define TO_PROTO_ENUM(enum) \ |
| 10 case enum: \ | 10 case enum: \ |
| 11 return proto::enum | 11 return proto::enum |
| 12 | 12 |
| 13 namespace media { | 13 namespace media { |
| 14 namespace cast { | 14 namespace cast { |
| 15 | 15 |
| 16 proto::EventType ToProtoEventType(CastLoggingEvent event) { | 16 proto::EventType ToProtoEventType(CastLoggingEvent event) { |
| 17 switch (event) { | 17 switch (event) { |
| 18 TO_PROTO_ENUM(UNKNOWN); | 18 TO_PROTO_ENUM(UNKNOWN); |
| 19 TO_PROTO_ENUM(FRAME_CAPTURE_BEGIN); | 19 TO_PROTO_ENUM(FRAME_CAPTURE_BEGIN); |
| 20 TO_PROTO_ENUM(FRAME_CAPTURE_END); | 20 TO_PROTO_ENUM(FRAME_CAPTURE_END); |
| 21 TO_PROTO_ENUM(FRAME_ENCODED); | 21 TO_PROTO_ENUM(FRAME_ENCODED); |
| 22 TO_PROTO_ENUM(FRAME_ACK_RECEIVED); | 22 TO_PROTO_ENUM(FRAME_ACK_RECEIVED); |
| 23 TO_PROTO_ENUM(FRAME_ACK_SENT); | 23 TO_PROTO_ENUM(FRAME_ACK_SENT); |
| 24 TO_PROTO_ENUM(FRAME_DECODED); | 24 TO_PROTO_ENUM(FRAME_DECODED); |
| 25 TO_PROTO_ENUM(FRAME_PLAYOUT); | 25 TO_PROTO_ENUM(FRAME_PLAYOUT); |
| 26 TO_PROTO_ENUM(PACKET_SENT_TO_NETWORK); | 26 TO_PROTO_ENUM(PACKET_SENT_TO_NETWORK); |
| 27 TO_PROTO_ENUM(PACKET_RETRANSMITTED); | 27 TO_PROTO_ENUM(PACKET_RETRANSMITTED); |
| 28 TO_PROTO_ENUM(PACKET_RTX_REJECTED); |
| 28 TO_PROTO_ENUM(PACKET_RECEIVED); | 29 TO_PROTO_ENUM(PACKET_RECEIVED); |
| 29 } | 30 } |
| 30 NOTREACHED(); | 31 NOTREACHED(); |
| 31 return proto::UNKNOWN; | 32 return proto::UNKNOWN; |
| 32 } | 33 } |
| 33 | 34 |
| 34 } // namespace cast | 35 } // namespace cast |
| 35 } // namespace media | 36 } // namespace media |
| OLD | NEW |