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_RECEIVER_H_
6 #define MEDIA_CAST_RTCP_RTCP_RECEIVER_H_
8 #include "media/cast/rtcp/rtcp.h"
9 #include "media/cast/rtcp/rtcp_defines.h"
10 #include "media/cast/rtcp/rtcp_utility.h"
11 #include "media/cast/transport/cast_transport_defines.h"
16 class RtcpReceiverFeedback
{
18 virtual void OnReceivedSenderReport(
19 const transport::RtcpSenderInfo
& remote_sender_info
) = 0;
21 virtual void OnReceiverReferenceTimeReport(
22 const RtcpReceiverReferenceTimeReport
& remote_time_report
) = 0;
24 virtual void OnReceivedSendReportRequest() = 0;
26 virtual void OnReceivedReceiverLog(
27 const RtcpReceiverLogMessage
& receiver_log
) = 0;
29 virtual void OnReceivedSenderLog(
30 const transport::RtcpSenderLogMessage
& sender_log
) = 0;
32 virtual ~RtcpReceiverFeedback() {}
35 class RtcpRttFeedback
{
37 virtual void OnReceivedDelaySinceLastReport(
38 uint32 receivers_ssrc
,
40 uint32 delay_since_last_report
) = 0;
42 virtual ~RtcpRttFeedback() {}
47 explicit RtcpReceiver(scoped_refptr
<CastEnvironment
> cast_environment
,
48 RtcpSenderFeedback
* sender_feedback
,
49 RtcpReceiverFeedback
* receiver_feedback
,
50 RtcpRttFeedback
* rtt_feedback
,
52 virtual ~RtcpReceiver();
54 void SetRemoteSSRC(uint32 ssrc
);
56 void IncomingRtcpPacket(RtcpParser
* rtcp_parser
);
59 void HandleSenderReport(RtcpParser
* rtcp_parser
);
61 void HandleReceiverReport(RtcpParser
* rtcp_parser
);
63 void HandleReportBlock(const RtcpField
* rtcp_field
, uint32 remote_ssrc
);
65 void HandleSDES(RtcpParser
* rtcp_parser
);
66 void HandleSDESChunk(RtcpParser
* rtcp_parser
);
68 void HandleBYE(RtcpParser
* rtcp_parser
);
70 void HandleXr(RtcpParser
* rtcp_parser
);
71 void HandleRrtr(RtcpParser
* rtcp_parser
, uint32 remote_ssrc
);
72 void HandleDlrr(RtcpParser
* rtcp_parser
);
74 // Generic RTP Feedback.
75 void HandleNACK(RtcpParser
* rtcp_parser
);
76 void HandleNACKItem(const RtcpField
* rtcp_field
,
77 std::list
<uint16
>* nack_sequence_numbers
);
79 void HandleSendReportRequest(RtcpParser
* rtcp_parser
);
82 void HandlePLI(RtcpParser
* rtcp_parser
);
84 void HandleSLI(RtcpParser
* rtcp_parser
);
85 void HandleSLIItem(RtcpField
* rtcpPacket
);
87 void HandleRpsi(RtcpParser
* rtcp_parser
);
89 void HandleFIR(RtcpParser
* rtcp_parser
);
90 void HandleFIRItem(const RtcpField
* rtcp_field
);
92 void HandlePayloadSpecificApp(RtcpParser
* rtcp_parser
);
93 void HandlePayloadSpecificRembItem(RtcpParser
* rtcp_parser
);
94 void HandlePayloadSpecificCastItem(RtcpParser
* rtcp_parser
);
95 void HandlePayloadSpecificCastNackItem(
96 const RtcpField
* rtcp_field
,
97 MissingFramesAndPacketsMap
* missing_frames_and_packets
);
99 void HandleApplicationSpecificCastReceiverLog(RtcpParser
* rtcp_parser
);
100 void HandleApplicationSpecificCastSenderLog(RtcpParser
* rtcp_parser
);
101 void HandleApplicationSpecificCastReceiverEventLog(
102 RtcpParser
* rtcp_parser
,
103 RtcpReceiverEventLogMessages
* event_log_messages
);
108 // Not owned by this class.
109 RtcpSenderFeedback
* const sender_feedback_
;
110 RtcpReceiverFeedback
* const receiver_feedback_
;
111 RtcpRttFeedback
* const rtt_feedback_
;
112 scoped_refptr
<CastEnvironment
> cast_environment_
;
114 transport::FrameIdWrapHelper ack_frame_id_wrap_helper_
;
116 DISALLOW_COPY_AND_ASSIGN(RtcpReceiver
);
122 #endif // MEDIA_CAST_RTCP_RTCP_RECEIVER_H_