OLD | NEW |
---|---|
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 RtpSenders | 11 // This file contains interfaces for RtpSenders |
12 // http://w3c.github.io/webrtc-pc/#rtcrtpsender-interface | 12 // http://w3c.github.io/webrtc-pc/#rtcrtpsender-interface |
13 | 13 |
14 #ifndef WEBRTC_API_RTPSENDERINTERFACE_H_ | 14 #ifndef WEBRTC_API_RTPSENDERINTERFACE_H_ |
15 #define WEBRTC_API_RTPSENDERINTERFACE_H_ | 15 #define WEBRTC_API_RTPSENDERINTERFACE_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/api/rtpparameters.h" | 21 #include "webrtc/api/rtpparameters.h" |
22 #include "webrtc/api/statstypes.h" | |
22 #include "webrtc/base/refcount.h" | 23 #include "webrtc/base/refcount.h" |
23 #include "webrtc/base/scoped_ref_ptr.h" | 24 #include "webrtc/base/scoped_ref_ptr.h" |
24 #include "webrtc/pc/mediasession.h" | 25 #include "webrtc/pc/mediasession.h" |
25 | 26 |
26 namespace webrtc { | 27 namespace webrtc { |
27 | 28 |
28 class RtpSenderInterface : public rtc::RefCountInterface { | 29 class RtpSenderInterface : public rtc::RefCountInterface { |
29 public: | 30 public: |
30 // Returns true if successful in setting the track. | 31 // Returns true if successful in setting the track. |
31 // Fails if an audio track is set on a video RtpSender, or vice-versa. | 32 // Fails if an audio track is set on a video RtpSender, or vice-versa. |
(...skipping 16 matching lines...) Expand all Loading... | |
48 | 49 |
49 // TODO(deadbeef): Support one sender having multiple stream ids. | 50 // TODO(deadbeef): Support one sender having multiple stream ids. |
50 virtual void set_stream_id(const std::string& stream_id) = 0; | 51 virtual void set_stream_id(const std::string& stream_id) = 0; |
51 virtual std::string stream_id() const = 0; | 52 virtual std::string stream_id() const = 0; |
52 | 53 |
53 virtual void Stop() = 0; | 54 virtual void Stop() = 0; |
54 | 55 |
55 virtual RtpParameters GetParameters() const = 0; | 56 virtual RtpParameters GetParameters() const = 0; |
56 virtual bool SetParameters(const RtpParameters& parameters) = 0; | 57 virtual bool SetParameters(const RtpParameters& parameters) = 0; |
57 | 58 |
59 // Returns a scoped_refptr(nullptr) if there are no stats. | |
perkj_webrtc
2016/03/29 11:03:39
? StatsReport::Id is a scoped_refptr?
nisse-webrtc
2016/03/29 11:37:31
Yes, defined in statstypes.h as
typedef rtc::sc
| |
60 virtual StatsReport::Id stats_id() = 0; | |
61 virtual void ReportStats(StatsReport* report) = 0; | |
perkj_webrtc
2016/03/29 11:03:39
Prefer GetStats anyway (saw your comments) since i
nisse-webrtc
2016/03/29 11:37:31
Most other GetStats methods either take an observe
tommi
2016/03/30 11:46:45
Is this method's implementation expected to block
nisse-webrtc
2016/03/30 12:09:31
It shouldn't block. If the RtpSender is connected
| |
62 | |
58 protected: | 63 protected: |
59 virtual ~RtpSenderInterface() {} | 64 virtual ~RtpSenderInterface() {} |
60 }; | 65 }; |
61 | 66 |
62 // Define proxy for RtpSenderInterface. | 67 // Define proxy for RtpSenderInterface. |
63 BEGIN_PROXY_MAP(RtpSender) | 68 BEGIN_PROXY_MAP(RtpSender) |
64 PROXY_METHOD1(bool, SetTrack, MediaStreamTrackInterface*) | 69 PROXY_METHOD1(bool, SetTrack, MediaStreamTrackInterface*) |
65 PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track) | 70 PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track) |
66 PROXY_METHOD1(void, SetSsrc, uint32_t) | 71 PROXY_METHOD1(void, SetSsrc, uint32_t) |
67 PROXY_CONSTMETHOD0(uint32_t, ssrc) | 72 PROXY_CONSTMETHOD0(uint32_t, ssrc) |
68 PROXY_CONSTMETHOD0(cricket::MediaType, media_type) | 73 PROXY_CONSTMETHOD0(cricket::MediaType, media_type) |
69 PROXY_CONSTMETHOD0(std::string, id) | 74 PROXY_CONSTMETHOD0(std::string, id) |
70 PROXY_METHOD1(void, set_stream_id, const std::string&) | 75 PROXY_METHOD1(void, set_stream_id, const std::string&) |
71 PROXY_CONSTMETHOD0(std::string, stream_id) | 76 PROXY_CONSTMETHOD0(std::string, stream_id) |
72 PROXY_METHOD0(void, Stop) | 77 PROXY_METHOD0(void, Stop) |
73 PROXY_CONSTMETHOD0(RtpParameters, GetParameters); | 78 PROXY_CONSTMETHOD0(RtpParameters, GetParameters); |
74 PROXY_METHOD1(bool, SetParameters, const RtpParameters&) | 79 PROXY_METHOD1(bool, SetParameters, const RtpParameters&) |
80 PROXY_METHOD0(StatsReport::Id, stats_id) | |
81 PROXY_METHOD1(void, ReportStats, StatsReport*) | |
tommi
2016/03/30 11:46:45
as is, all proxy methods involve a synchronous thr
| |
75 END_PROXY() | 82 END_PROXY() |
76 | 83 |
77 } // namespace webrtc | 84 } // namespace webrtc |
78 | 85 |
79 #endif // WEBRTC_API_RTPSENDERINTERFACE_H_ | 86 #endif // WEBRTC_API_RTPSENDERINTERFACE_H_ |
OLD | NEW |