blob: 85f37fa7a0d5d208dd769e3d9bcc0377b9975cab [file] [log] [blame]
deadbeefe814a0d2017-02-25 18:15:09 -08001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef API_ORTC_RTPTRANSPORTCONTROLLERINTERFACE_H_
12#define API_ORTC_RTPTRANSPORTCONTROLLERINTERFACE_H_
deadbeefe814a0d2017-02-25 18:15:09 -080013
14#include <vector>
15
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "api/ortc/rtptransportinterface.h"
deadbeefe814a0d2017-02-25 18:15:09 -080017
18namespace webrtc {
19
20class 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.
37class 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 Bonadei92ea95e2017-09-15 06:47:31 +020057#endif // API_ORTC_RTPTRANSPORTCONTROLLERINTERFACE_H_