Remove Unused AsTextButtonBorder RTTI helper.
[chromium-blink-merge.git] / media / cast / rtcp / rtcp_defines.h
blob40f4a0d788501375b6a20c0b8cf4a2d4dfbcf789
1 // Copyright 2013 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 #ifndef MEDIA_CAST_RTCP_RTCP_DEFINES_H_
6 #define MEDIA_CAST_RTCP_RTCP_DEFINES_H_
8 #include <list>
9 #include <map>
10 #include <set>
12 #include "media/cast/cast_config.h"
13 #include "media/cast/cast_defines.h"
14 #include "media/cast/logging/logging_defines.h"
15 #include "media/cast/transport/cast_transport_defines.h"
17 namespace media {
18 namespace cast {
20 static const size_t kRtcpCastLogHeaderSize = 12;
21 static const size_t kRtcpSenderFrameLogSize = 4;
22 static const size_t kRtcpReceiverFrameLogSize = 8;
23 static const size_t kRtcpReceiverEventLogSize = 4;
25 // Handle the per frame ACK and NACK messages.
26 class RtcpCastMessage {
27 public:
28 explicit RtcpCastMessage(uint32 media_ssrc);
29 ~RtcpCastMessage();
31 void Copy(const RtcpCastMessage& cast_message);
33 uint32 media_ssrc_;
34 uint32 ack_frame_id_;
35 MissingFramesAndPacketsMap missing_frames_and_packets_;
37 DISALLOW_COPY_AND_ASSIGN(RtcpCastMessage);
40 // Log messages from receiver to sender.
41 struct RtcpReceiverEventLogMessage {
42 RtcpReceiverEventLogMessage();
43 ~RtcpReceiverEventLogMessage();
45 CastLoggingEvent type;
46 base::TimeTicks event_timestamp;
47 base::TimeDelta delay_delta;
48 uint16 packet_id;
51 typedef std::list<RtcpReceiverEventLogMessage> RtcpReceiverEventLogMessages;
53 struct RtcpReceiverFrameLogMessage {
54 explicit RtcpReceiverFrameLogMessage(uint32 rtp_timestamp);
55 ~RtcpReceiverFrameLogMessage();
57 uint32 rtp_timestamp_;
58 RtcpReceiverEventLogMessages event_log_messages_;
60 // TODO(mikhal): Investigate what's the best way to allow adding
61 // DISALLOW_COPY_AND_ASSIGN, as currently it contradicts the implementation
62 // and possible changes have a big impact on design.
65 typedef std::list<RtcpReceiverFrameLogMessage> RtcpReceiverLogMessage;
67 struct RtcpRpsiMessage {
68 RtcpRpsiMessage();
69 ~RtcpRpsiMessage();
71 uint32 remote_ssrc;
72 uint8 payload_type;
73 uint64 picture_id;
76 struct RtcpNackMessage {
77 RtcpNackMessage();
78 ~RtcpNackMessage();
80 uint32 remote_ssrc;
81 std::list<uint16> nack_list;
83 DISALLOW_COPY_AND_ASSIGN(RtcpNackMessage);
86 struct RtcpRembMessage {
87 RtcpRembMessage();
88 ~RtcpRembMessage();
90 uint32 remb_bitrate;
91 std::list<uint32> remb_ssrcs;
93 DISALLOW_COPY_AND_ASSIGN(RtcpRembMessage);
96 struct RtcpReceiverReferenceTimeReport {
97 RtcpReceiverReferenceTimeReport();
98 ~RtcpReceiverReferenceTimeReport();
100 uint32 remote_ssrc;
101 uint32 ntp_seconds;
102 uint32 ntp_fraction;
105 inline bool operator==(RtcpReceiverReferenceTimeReport lhs,
106 RtcpReceiverReferenceTimeReport rhs) {
107 return lhs.remote_ssrc == rhs.remote_ssrc &&
108 lhs.ntp_seconds == rhs.ntp_seconds &&
109 lhs.ntp_fraction == rhs.ntp_fraction;
112 // Struct used by raw event subscribers as an intermediate format before
113 // sending off to the other side via RTCP.
114 // (i.e., WindowedRtcpEventRtp{Sender,Receiver}Subscriber)
115 struct RtcpEvent {
116 RtcpEvent();
117 ~RtcpEvent();
119 CastLoggingEvent type;
121 // Time of event logged.
122 base::TimeTicks timestamp;
124 // Render/playout delay. Only set for kAudioPlayoutDelay and
125 // kVideoRenderDelay events.
126 base::TimeDelta delay_delta;
128 // Only set for packet events. (kAudioPacketReceived, kVideoPacketReceived)
129 uint16 packet_id;
132 } // namespace cast
133 } // namespace media
135 #endif // MEDIA_CAST_RTCP_RTCP_DEFINES_H_