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_
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"
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
{
28 explicit RtcpCastMessage(uint32 media_ssrc
);
31 void Copy(const RtcpCastMessage
& cast_message
);
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
;
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
{
76 struct RtcpNackMessage
{
81 std::list
<uint16
> nack_list
;
83 DISALLOW_COPY_AND_ASSIGN(RtcpNackMessage
);
86 struct RtcpRembMessage
{
91 std::list
<uint32
> remb_ssrcs
;
93 DISALLOW_COPY_AND_ASSIGN(RtcpRembMessage
);
96 struct RtcpReceiverReferenceTimeReport
{
97 RtcpReceiverReferenceTimeReport();
98 ~RtcpReceiverReferenceTimeReport();
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)
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)
135 #endif // MEDIA_CAST_RTCP_RTCP_DEFINES_H_