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

Side by Side Diff: webrtc/ortc/rtpsendershim.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/rtpreceivershim.cc ('k') | webrtc/ortc/rtpsendershim.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_RTPSENDERSHIM_H_
12 #define WEBRTC_ORTC_RTPSENDERSHIM_H_
13
14 #include <memory>
15
16 #include "webrtc/api/ortc/ortcrtpsenderinterface.h"
17 #include "webrtc/api/rtcerror.h"
18 #include "webrtc/api/rtpparameters.h"
19 #include "webrtc/base/constructormagic.h"
20 #include "webrtc/ortc/rtptransportcontrollershim.h"
21 #include "webrtc/ortc/rtptransportshim.h"
22 #include "webrtc/pc/rtpsender.h"
23
24 namespace webrtc {
25
26 // Implementation of OrtcRtpSenderInterface that works with RtpTransportShim,
27 // and wraps a VideoRtpSender/AudioRtpSender that's normally used with the
28 // PeerConnection.
29 //
30 // TODO(deadbeef): When BaseChannel is split apart into separate
31 // "RtpSender"/"RtpTransceiver"/"RtpSender"/"RtpReceiver" objects, this shim
32 // object can be removed.
33 class RtpSenderShim : public OrtcRtpSenderInterface {
34 public:
35 // Doesn't take ownership of |transport| or |rtp_transport_controller|.
36 static RTCErrorOr<std::unique_ptr<OrtcRtpSenderInterface>> CreateProxied(
37 cricket::MediaType kind,
38 RtpTransportShim* transport);
39 ~RtpSenderShim() override;
40
41 // OrtcRtpSenderInterface implementation.
42 RTCError SetTrack(MediaStreamTrackInterface* track) override;
43 rtc::scoped_refptr<MediaStreamTrackInterface> GetTrack() const override;
44
45 RTCError SetTransport(RtpTransportInterface* transport) override;
46 RtpTransportInterface* GetTransport() const override;
47
48 RTCError Send(const RtpParameters& parameters) override;
49 RtpParameters GetParameters() const override;
50
51 cricket::MediaType GetKind() const override;
52
53 private:
54 // Methods called internally be Create factory method.
55 RtpSenderShim(cricket::MediaType kind,
56 RtpTransportShim* transport,
57 RtpTransportControllerShim* rtp_transport_controller);
58 void CreateInternalSender();
59
60 cricket::MediaType kind_;
61 RtpTransportShim* transport_;
62 RtpTransportControllerShim* rtp_transport_controller_;
63 // Scoped refptr due to ref-counted interface, but we should be the only
64 // reference holder.
65 rtc::scoped_refptr<RtpSenderInternal> internal_sender_;
66 RtpParameters last_applied_parameters_;
67
68 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RtpSenderShim);
69 };
70
71 } // namespace webrtc
72
73 #endif // WEBRTC_ORTC_RTPSENDERSHIM_H_
OLDNEW
« no previous file with comments | « webrtc/ortc/rtpreceivershim.cc ('k') | webrtc/ortc/rtpsendershim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698