Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / media / cast / logging / proto / proto_utils.cc
blob90517e1fa10af51d82aea67b2a5b01c833c4c659
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.
5 #include "media/cast/logging/proto/proto_utils.h"
7 #include "base/logging.h"
9 #define TO_PROTO_ENUM(from_enum, to_enum) \
10 case from_enum: \
11 return media::cast::proto::to_enum
13 namespace media {
14 namespace cast {
16 media::cast::proto::EventType ToProtoEventType(CastLoggingEvent event) {
17 switch (event) {
18 TO_PROTO_ENUM(kUnknown, UNKNOWN);
19 TO_PROTO_ENUM(kRttMs, RTT_MS);
20 TO_PROTO_ENUM(kPacketLoss, PACKET_LOSS);
21 TO_PROTO_ENUM(kJitterMs, JITTER_MS);
22 TO_PROTO_ENUM(kVideoAckReceived, VIDEO_ACK_RECEIVED);
23 TO_PROTO_ENUM(kRembBitrate, REMB_BITRATE);
24 TO_PROTO_ENUM(kAudioAckSent, AUDIO_ACK_SENT);
25 TO_PROTO_ENUM(kVideoAckSent, VIDEO_ACK_SENT);
26 TO_PROTO_ENUM(kAudioFrameCaptureEnd, AUDIO_FRAME_CAPTURE_END);
27 TO_PROTO_ENUM(kAudioFrameCaptureBegin, AUDIO_FRAME_CAPTURE_BEGIN);
28 TO_PROTO_ENUM(kAudioFrameEncoded, AUDIO_FRAME_ENCODED);
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);
48 NOTREACHED();
49 return media::cast::proto::UNKNOWN;
52 } // namespace cast
53 } // namespace media