1 // Copyright 2019 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.
4 
5 #ifndef CAST_STREAMING_RTCP_SESSION_H_
6 #define CAST_STREAMING_RTCP_SESSION_H_
7 
8 #include "cast/streaming/ntp_time.h"
9 #include "cast/streaming/ssrc.h"
10 
11 namespace openscreen {
12 namespace cast {
13 
14 // Session-level configuration and shared components for the RTCP messaging
15 // associated with a single Cast RTP stream. Multiple packet serialization and
16 // parsing components share a single RtcpSession instance for data consistency.
17 class RtcpSession {
18  public:
19   // |start_time| should be the current time, as it is used by NtpTimeConverter
20   // to set a fixed reference point between the local Clock and current "real
21   // world" wall time.
22   RtcpSession(Ssrc sender_ssrc,
23               Ssrc receiver_ssrc,
24               Clock::time_point start_time);
25   ~RtcpSession();
26 
sender_ssrc()27   Ssrc sender_ssrc() const { return sender_ssrc_; }
receiver_ssrc()28   Ssrc receiver_ssrc() const { return receiver_ssrc_; }
ntp_converter()29   const NtpTimeConverter& ntp_converter() const { return ntp_converter_; }
30 
31  private:
32   const Ssrc sender_ssrc_;
33   const Ssrc receiver_ssrc_;
34 
35   // Translates between system time (internal format) and NTP (wire format).
36   NtpTimeConverter ntp_converter_;
37 };
38 
39 }  // namespace cast
40 }  // namespace openscreen
41 
42 #endif  // CAST_STREAMING_RTCP_SESSION_H_
43