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

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

Issue 2675173003: Adding "adapter" ORTC objects on top of ChannelManager/BaseChannel/etc. (Closed)
Patch Set: Add memcheck suppression for end-to-end tests. Created 3 years, 9 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/ortcrtpreceiver_unittest.cc ('k') | webrtc/ortc/ortcrtpreceiveradapter.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_ORTCRTPRECEIVERADAPTER_H_
12 #define WEBRTC_ORTC_ORTCRTPRECEIVERADAPTER_H_
13
14 #include <memory>
15
16 #include "webrtc/api/ortc/ortcrtpreceiverinterface.h"
17 #include "webrtc/api/rtcerror.h"
18 #include "webrtc/api/rtpparameters.h"
19 #include "webrtc/base/constructormagic.h"
20 #include "webrtc/base/sigslot.h"
21 #include "webrtc/base/thread.h"
22 #include "webrtc/ortc/rtptransportcontrolleradapter.h"
23 #include "webrtc/pc/rtpreceiver.h"
24
25 namespace webrtc {
26
27 // Implementation of OrtcRtpReceiverInterface that works with
28 // RtpTransportAdapter, and wraps a VideoRtpReceiver/AudioRtpReceiver that's
29 // normally used with the PeerConnection.
30 //
31 // TODO(deadbeef): When BaseChannel is split apart into separate
32 // "RtpReceiver"/"RtpTransceiver"/"RtpReceiver"/"RtpReceiver" objects, this
33 // adapter object can be removed.
34 class OrtcRtpReceiverAdapter : public OrtcRtpReceiverInterface {
35 public:
36 // Wraps |wrapped_receiver| in a proxy that will safely call methods on the
37 // correct thread.
38 static std::unique_ptr<OrtcRtpReceiverInterface> CreateProxy(
39 std::unique_ptr<OrtcRtpReceiverAdapter> wrapped_receiver);
40
41 // Should only be called by RtpTransportControllerAdapter.
42 OrtcRtpReceiverAdapter(
43 cricket::MediaType kind,
44 RtpTransportInterface* transport,
45 RtpTransportControllerAdapter* rtp_transport_controller);
46 ~OrtcRtpReceiverAdapter() override;
47
48 // OrtcRtpReceiverInterface implementation.
49 rtc::scoped_refptr<MediaStreamTrackInterface> GetTrack() const override;
50
51 RTCError SetTransport(RtpTransportInterface* transport) override;
52 RtpTransportInterface* GetTransport() const override;
53
54 RTCError Receive(const RtpParameters& parameters) override;
55 RtpParameters GetParameters() const override;
56
57 cricket::MediaType GetKind() const override;
58
59 // Used so that the RtpTransportControllerAdapter knows when it can
60 // deallocate resources allocated for this object.
61 sigslot::signal0<> SignalDestroyed;
62
63 private:
64 void MaybeRecreateInternalReceiver();
65
66 cricket::MediaType kind_;
67 RtpTransportInterface* transport_;
68 RtpTransportControllerAdapter* rtp_transport_controller_;
69 // Scoped refptr due to ref-counted interface, but we should be the only
70 // reference holder.
71 rtc::scoped_refptr<RtpReceiverInternal> internal_receiver_;
72 RtpParameters last_applied_parameters_;
73
74 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(OrtcRtpReceiverAdapter);
75 };
76
77 } // namespace webrtc
78
79 #endif // WEBRTC_ORTC_ORTCRTPRECEIVERADAPTER_H_
OLDNEW
« no previous file with comments | « webrtc/ortc/ortcrtpreceiver_unittest.cc ('k') | webrtc/ortc/ortcrtpreceiveradapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698