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

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

Issue 2675173003: Adding "adapter" ORTC objects on top of ChannelManager/BaseChannel/etc. (Closed)
Patch Set: Adding OrtcFactory unit tests. 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
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_ORTCRTPSENDERADAPTER_H_
12 #define WEBRTC_ORTC_ORTCRTPSENDERADAPTER_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/rtptransportcontrolleradapter.h"
21 #include "webrtc/pc/rtpsender.h"
22
23 namespace webrtc {
24
25 // Implementation of OrtcRtpSenderInterface that works with RtpTransportAdapter,
26 // and wraps a VideoRtpSender/AudioRtpSender that's normally used with the
27 // PeerConnection.
28 //
29 // TODO(deadbeef): When BaseChannel is split apart into separate
30 // "RtpSender"/"RtpTransceiver"/"RtpSender"/"RtpReceiver" objects, this adapter
31 // object can be removed.
32 class OrtcRtpSenderAdapter : public OrtcRtpSenderInterface {
33 public:
34 // Doesn't take ownership of |transport| or |rtp_transport_controller|.
35 static RTCErrorOr<std::unique_ptr<OrtcRtpSenderInterface>> CreateProxied(
36 cricket::MediaType kind,
37 RtpTransportInterface* transport);
38 ~OrtcRtpSenderAdapter() override;
39
40 // OrtcRtpSenderInterface implementation.
41 RTCError SetTrack(MediaStreamTrackInterface* track) override;
42 rtc::scoped_refptr<MediaStreamTrackInterface> GetTrack() const override;
43
44 RTCError SetTransport(RtpTransportInterface* transport) override;
45 RtpTransportInterface* GetTransport() const override;
46
47 RTCError Send(const RtpParameters& parameters) override;
48 RtpParameters GetParameters() const override;
49
50 cricket::MediaType GetKind() const override;
51
52 private:
53 // Methods called internally be Create factory method.
54 OrtcRtpSenderAdapter(cricket::MediaType kind,
55 RtpTransportInterface* transport,
56 RtpTransportControllerAdapter* rtp_transport_controller);
57 void CreateInternalSender();
58
59 cricket::MediaType kind_;
60 RtpTransportInterface* transport_;
61 RtpTransportControllerAdapter* rtp_transport_controller_;
62 // Scoped refptr due to ref-counted interface, but we should be the only
63 // reference holder.
64 rtc::scoped_refptr<RtpSenderInternal> internal_sender_;
65 RtpParameters last_applied_parameters_;
66
67 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(OrtcRtpSenderAdapter);
68 };
69
70 } // namespace webrtc
71
72 #endif // WEBRTC_ORTC_ORTCRTPSENDERADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698