Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: webrtc/ortc/rtptransportshim.h

Issue 2675173003: Adding "adapter" ORTC objects on top of ChannelManager/BaseChannel/etc. (Closed)
Patch Set: Rebase onto split-off RtcError CL Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/ortc/rtptransportcontrollershim.cc ('k') | webrtc/ortc/rtptransportshim.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_ORTC_RTPTRANSPORTSHIM_H_
12 #define WEBRTC_ORTC_RTPTRANSPORTSHIM_H_
13
14 #include <memory>
15 #include <vector>
16
17 #include "webrtc/api/ortc/rtptransportinterface.h"
18 #include "webrtc/api/rtcerror.h"
19 #include "webrtc/base/constructormagic.h"
20 #include "webrtc/media/base/streamparams.h"
21 #include "webrtc/ortc/rtptransportcontrollershim.h"
22 #include "webrtc/pc/channel.h"
23
24 namespace webrtc {
25
26 // Implementation of RtpTransportInterface to be used with RtpSenderShim,
27 // RtpReceiverShim, and RtpTransportControllerShimShim classes.
28 //
29 // TODO(deadbeef): When BaseChannel is split apart into separate
30 // "RtpTransport"/"RtpTransceiver"/"RtpSender"/"RtpReceiver" objects, this shim
31 // object can be removed.
32 class RtpTransportShim : public RtpTransportInterface {
33 public:
34 // |rtp| can't be null. |rtcp| can if RTCP muxing is used immediately (meaning
35 // |rtcp_parameters.mux| is also true).
36 static RTCErrorOr<std::unique_ptr<RtpTransportInterface>> CreateProxied(
37 const RtcpParameters& rtcp_parameters,
38 PacketTransportInterface* rtp,
39 PacketTransportInterface* rtcp,
40 RtpTransportControllerInterface* rtp_transport_controller);
41 // Version of the above method that takes ownership of
42 // |rtp_transport_controller|.
43 static RTCErrorOr<std::unique_ptr<RtpTransportInterface>> CreateProxied(
44 const RtcpParameters& rtcp_parameters,
45 PacketTransportInterface* rtp,
46 PacketTransportInterface* rtcp,
47 std::unique_ptr<RtpTransportControllerInterface>
48 rtp_transport_controller);
49 ~RtpTransportShim() override;
50
51 // RtpTransportInterface implementation.
52 PacketTransportInterface* GetRtpPacketTransport() const override;
53 PacketTransportInterface* GetRtcpPacketTransport() const override;
54 RTCError SetRtcpParameters(const RtcpParameters& parameters) override;
55 RtcpParameters GetRtcpParameters() const override { return rtcp_parameters_; }
56
57 // Methods used internally by RtpSenderShim/RtpReceiverShim.
58 RtpTransportControllerShim* rtp_transport_controller() {
59 return rtp_transport_controller_;
60 }
61
62 protected:
63 RtpTransportShim* GetInternal() override { return this; }
64
65 private:
66 RtpTransportShim(const RtcpParameters& rtcp_parameters,
67 PacketTransportInterface* rtp,
68 PacketTransportInterface* rtcp,
69 RtpTransportControllerShim* rtp_transport_controller);
70
71 PacketTransportInterface* rtp_packet_transport_;
72 PacketTransportInterface* rtcp_packet_transport_;
73 RtpTransportControllerShim* rtp_transport_controller_;
74 // Non-null if this class owns the transport controller.
75 std::unique_ptr<RtpTransportControllerInterface>
76 owned_rtp_transport_controller_;
77 RtcpParameters rtcp_parameters_;
78
79 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpTransportShim);
80 };
81 typedef RtpTransportShim RtpTransportInternal;
82
83 } // namespace webrtc
84
85 #endif // WEBRTC_ORTC_RTPTRANSPORTSHIM_H_
OLDNEW
« no previous file with comments | « webrtc/ortc/rtptransportcontrollershim.cc ('k') | webrtc/ortc/rtptransportshim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698