OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #ifndef WEBRTC_API_RTPTRANSPORTINTERFACE_H_ | |
12 #define WEBRTC_API_RTPTRANSPORTINTERFACE_H_ | |
13 | |
14 #include <string> | |
15 | |
16 #include "webrtc/api/packettransportinterface.h" | |
17 #include "webrtc/api/rtcerror.h" | |
18 #include "webrtc/base/optional.h" | |
19 | |
20 namespace webrtc { | |
21 | |
22 class RtpTransportShim; | |
23 | |
24 struct RtcpParameters { | |
25 // The SSRC to be used in the "SSRC of packet sender" field. | |
26 // If not set, one will be chosen by the implementation. | |
27 // TODO(deadbeef): Not implemented. | |
28 rtc::Optional<uint32_t> ssrc; | |
29 | |
30 // RTCP CNAME; if empty, one will be chosen by the implementation. | |
31 std::string cname; | |
32 | |
33 // Send reduced-size RTCP? | |
34 bool reduced_size = false; | |
35 | |
36 // Send RTCP multiplexed on the RTP transport? | |
37 bool mux = true; | |
38 }; | |
39 | |
40 // Base class for different types of RTP transports that can be created by an | |
41 // OrtcFactory. Used by RtpSender/RtpReceivers. | |
42 class RtpTransportInterface { | |
43 public: | |
44 virtual ~RtpTransportInterface() {} | |
45 | |
46 // Returns packet transport that's used to send RTP packets. | |
47 virtual PacketTransportInterface* GetRtpPacketTransport() const = 0; | |
48 | |
49 // Returns separate packet transport that's used to send RTCP packets. | |
50 // If RTCP multiplexing is being used, returns nullptr. | |
51 virtual PacketTransportInterface* GetRtcpPacketTransport() const = 0; | |
52 | |
53 // Set/get RTCP params. Changing "mux" from "true" to "false" is not allowed. | |
54 virtual RTCError SetRtcpParameters(const RtcpParameters& parameters) = 0; | |
55 virtual RtcpParameters GetRtcpParameters() const = 0; | |
56 | |
57 protected: | |
58 // Only for internal use. | |
59 // Returns a pointer to the internal (non-public) interface. | |
60 virtual RtpTransportShim* GetInternal() = 0; | |
pthatcher1
2017/02/08 01:33:49
Again, I'd like to understand this model better.
Taylor Brandstetter
2017/02/10 00:19:45
Ok, so suppose the user of the API passes an "RtpT
| |
61 | |
62 // Classes that can use this internal interface. | |
63 friend class OrtcFactory; | |
64 friend class RtpSenderShim; | |
65 friend class RtpReceiverShim; | |
66 friend class RtpTransportControllerShim; | |
67 }; | |
68 | |
69 } // namespace webrtc | |
70 | |
71 #endif // WEBRTC_API_RTPTRANSPORTINTERFACE_H_ | |
OLD | NEW |