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

Side by Side Diff: webrtc/api/rtpreceiverinterface.h

Issue 1999853002: Forward the SignalFirstPacketReceived to RtpReceiver. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Make the destructor of RtpReceiverObserverInterface virtual. Created 4 years, 7 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
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 // This file contains interfaces for RtpReceivers 11 // This file contains interfaces for RtpReceivers
12 // http://w3c.github.io/webrtc-pc/#rtcrtpreceiver-interface 12 // http://w3c.github.io/webrtc-pc/#rtcrtpreceiver-interface
13 13
14 #ifndef WEBRTC_API_RTPRECEIVERINTERFACE_H_ 14 #ifndef WEBRTC_API_RTPRECEIVERINTERFACE_H_
15 #define WEBRTC_API_RTPRECEIVERINTERFACE_H_ 15 #define WEBRTC_API_RTPRECEIVERINTERFACE_H_
16 16
17 #include <string> 17 #include <string>
18 18
19 #include "webrtc/api/mediastreaminterface.h" 19 #include "webrtc/api/mediastreaminterface.h"
20 #include "webrtc/api/proxy.h" 20 #include "webrtc/api/proxy.h"
21 #include "webrtc/base/refcount.h" 21 #include "webrtc/base/refcount.h"
22 #include "webrtc/base/scoped_ref_ptr.h" 22 #include "webrtc/base/scoped_ref_ptr.h"
23 #include "webrtc/pc/mediasession.h"
23 24
24 namespace webrtc { 25 namespace webrtc {
25 26
27 class RtpReceiverObserverInterface : public rtc::RefCountInterface {
pthatcher2 2016/05/20 20:23:14 Why does it need to be refcounted?
28 public:
29 virtual void onFirstPacketReceived(cricket::MediaType media_type) = 0;
pthatcher2 2016/05/20 20:23:14 OnFirstPacketReceived
30
31 protected:
32 virtual ~RtpReceiverObserverInterface() {}
33 };
34
26 class RtpReceiverInterface : public rtc::RefCountInterface { 35 class RtpReceiverInterface : public rtc::RefCountInterface {
27 public: 36 public:
28 virtual rtc::scoped_refptr<MediaStreamTrackInterface> track() const = 0; 37 virtual rtc::scoped_refptr<MediaStreamTrackInterface> track() const = 0;
29 38
30 // Not to be confused with "mid", this is a field we can temporarily use 39 // Not to be confused with "mid", this is a field we can temporarily use
31 // to uniquely identify a receiver until we implement Unified Plan SDP. 40 // to uniquely identify a receiver until we implement Unified Plan SDP.
32 virtual std::string id() const = 0; 41 virtual std::string id() const = 0;
33 42
34 virtual void Stop() = 0; 43 virtual void Stop() = 0;
35 44
36 // The WebRTC specification only defines RTCRtpParameters in terms of senders, 45 // The WebRTC specification only defines RTCRtpParameters in terms of senders,
37 // but this API also applies them to receivers, similar to ORTC: 46 // but this API also applies them to receivers, similar to ORTC:
38 // http://ortc.org/wp-content/uploads/2016/03/ortc.html#rtcrtpparameters*. 47 // http://ortc.org/wp-content/uploads/2016/03/ortc.html#rtcrtpparameters*.
39 virtual RtpParameters GetParameters() const = 0; 48 virtual RtpParameters GetParameters() const = 0;
40 virtual bool SetParameters(const RtpParameters& parameters) = 0; 49 virtual bool SetParameters(const RtpParameters& parameters) = 0;
41 50
51 virtual void RegisterRtpReceiverObserver(
52 RtpReceiverObserverInterface* observer) = 0;
53
42 protected: 54 protected:
43 virtual ~RtpReceiverInterface() {} 55 virtual ~RtpReceiverInterface() {}
44 }; 56 };
45 57
46 // Define proxy for RtpReceiverInterface. 58 // Define proxy for RtpReceiverInterface.
47 BEGIN_SIGNALING_PROXY_MAP(RtpReceiver) 59 BEGIN_SIGNALING_PROXY_MAP(RtpReceiver)
48 PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track) 60 PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track)
49 PROXY_CONSTMETHOD0(std::string, id) 61 PROXY_CONSTMETHOD0(std::string, id)
50 PROXY_METHOD0(void, Stop) 62 PROXY_METHOD0(void, Stop)
51 PROXY_CONSTMETHOD0(RtpParameters, GetParameters); 63 PROXY_CONSTMETHOD0(RtpParameters, GetParameters);
52 PROXY_METHOD1(bool, SetParameters, const RtpParameters&) 64 PROXY_METHOD1(bool, SetParameters, const RtpParameters&)
65 PROXY_METHOD1(void, RegisterRtpReceiverObserver, RtpReceiverObserverInterface*);
53 END_SIGNALING_PROXY() 66 END_SIGNALING_PROXY()
54 67
55 } // namespace webrtc 68 } // namespace webrtc
56 69
57 #endif // WEBRTC_API_RTPRECEIVERINTERFACE_H_ 70 #endif // WEBRTC_API_RTPRECEIVERINTERFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698