deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef API_ORTC_RTPTRANSPORTCONTROLLERINTERFACE_H_ |
| 12 | #define API_ORTC_RTPTRANSPORTCONTROLLERINTERFACE_H_ |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 13 | |
| 14 | #include <vector> |
| 15 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 16 | #include "api/ortc/rtptransportinterface.h" |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
| 19 | |
| 20 | class RtpTransportControllerAdapter; |
| 21 | |
| 22 | // Used to group RTP transports between a local endpoint and the same remote |
| 23 | // endpoint, for the purpose of sharing bandwidth estimation and other things. |
| 24 | // |
| 25 | // Comparing this to the PeerConnection model, non-budled audio/video would use |
| 26 | // two RtpTransports with a single RtpTransportController, whereas bundled |
| 27 | // media would use a single RtpTransport, and two PeerConnections would use |
| 28 | // independent RtpTransportControllers. |
| 29 | // |
| 30 | // RtpTransports are associated with this controller when they're created, by |
| 31 | // passing the controller into OrtcFactory's relevant "CreateRtpTransport" |
| 32 | // method. When a transport is destroyed, it's automatically disassociated. |
| 33 | // GetTransports returns all currently associated transports. |
| 34 | // |
| 35 | // This is the RTP equivalent of "IceTransportController" in ORTC; RtpTransport |
| 36 | // is to RtpTransportController as IceTransport is to IceTransportController. |
| 37 | class RtpTransportControllerInterface { |
| 38 | public: |
| 39 | virtual ~RtpTransportControllerInterface() {} |
| 40 | |
| 41 | // Returns all transports associated with this controller (see explanation |
| 42 | // above). No ordering is guaranteed. |
| 43 | virtual std::vector<RtpTransportInterface*> GetTransports() const = 0; |
| 44 | |
| 45 | protected: |
| 46 | // Only for internal use. Returns a pointer to an internal interface, for use |
| 47 | // by the implementation. |
| 48 | virtual RtpTransportControllerAdapter* GetInternal() = 0; |
| 49 | |
| 50 | // Classes that can use this internal interface. |
| 51 | friend class OrtcFactory; |
| 52 | friend class RtpTransportAdapter; |
| 53 | }; |
| 54 | |
| 55 | } // namespace webrtc |
| 56 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 57 | #endif // API_ORTC_RTPTRANSPORTCONTROLLERINTERFACE_H_ |