summaryrefslogtreecommitdiffstats
path: root/media/cast/logging/logging_defines.cc
blob: c3c872ae0578f844d4eac151dab6e999d92be7e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright 2013 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/logging_defines.h"

#include "base/logging.h"

#define ENUM_TO_STRING(enum) \
  case enum:                 \
    return #enum

namespace media {
namespace cast {

const char* CastLoggingToString(CastLoggingEvent event) {
  switch (event) {
    ENUM_TO_STRING(UNKNOWN);
    ENUM_TO_STRING(FRAME_CAPTURE_BEGIN);
    ENUM_TO_STRING(FRAME_CAPTURE_END);
    ENUM_TO_STRING(FRAME_ENCODED);
    ENUM_TO_STRING(FRAME_ACK_RECEIVED);
    ENUM_TO_STRING(FRAME_ACK_SENT);
    ENUM_TO_STRING(FRAME_DECODED);
    ENUM_TO_STRING(FRAME_PLAYOUT);
    ENUM_TO_STRING(PACKET_SENT_TO_NETWORK);
    ENUM_TO_STRING(PACKET_RETRANSMITTED);
    ENUM_TO_STRING(PACKET_RTX_REJECTED);
    ENUM_TO_STRING(PACKET_RECEIVED);
  }
  NOTREACHED();
  return "";
}

FrameEvent::FrameEvent()
    : frame_id(kFrameIdUnknown),
      width(0),
      height(0),
      size(0u),
      type(UNKNOWN),
      media_type(UNKNOWN_EVENT),
      key_frame(false),
      target_bitrate(0),
      encoder_cpu_utilization(-1.0),
      idealized_bitrate_utilization(-1.0) {}
FrameEvent::~FrameEvent() {}

PacketEvent::PacketEvent()
    : frame_id(kFrameIdUnknown),
      max_packet_id(0),
      packet_id(0),
      size(0),
      type(UNKNOWN),
      media_type(UNKNOWN_EVENT) {}
PacketEvent::~PacketEvent() {}

}  // namespace cast
}  // namespace media