diff options
Diffstat (limited to 'chromium/media/cast/logging/proto/proto_utils.cc')
-rw-r--r-- | chromium/media/cast/logging/proto/proto_utils.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/chromium/media/cast/logging/proto/proto_utils.cc b/chromium/media/cast/logging/proto/proto_utils.cc new file mode 100644 index 00000000000..03251e64c03 --- /dev/null +++ b/chromium/media/cast/logging/proto/proto_utils.cc @@ -0,0 +1,36 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "media/cast/logging/proto/proto_utils.h" + +#include "base/logging.h" + +#define TO_PROTO_ENUM(enum) \ + case enum: \ + return proto::enum + +namespace media { +namespace cast { + +proto::EventType ToProtoEventType(CastLoggingEvent event) { + switch (event) { + 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_RTX_REJECTED); + TO_PROTO_ENUM(PACKET_RECEIVED); + } + NOTREACHED(); + return proto::UNKNOWN; +} + +} // namespace cast +} // namespace media |