| 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/base/refcount.h" | 22 #include "webrtc/base/refcount.h" |
| 22 #include "webrtc/base/scoped_ref_ptr.h" | 23 #include "webrtc/base/scoped_ref_ptr.h" |
| 23 #include "webrtc/pc/mediasession.h" | 24 #include "webrtc/pc/mediasession.h" |
| 24 | 25 |
| 25 namespace webrtc { | 26 namespace webrtc { |
| 26 | 27 |
| 27 class RtpSenderInterface : public rtc::RefCountInterface { | 28 class RtpSenderInterface : public rtc::RefCountInterface { |
| 28 public: | 29 public: |
| 29 // Returns true if successful in setting the track. | 30 // Returns true if successful in setting the track. |
| 30 // Fails if an audio track is set on a video RtpSender, or vice-versa. | 31 // Fails if an audio track is set on a video RtpSender, or vice-versa. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 44 // Not to be confused with "mid", this is a field we can temporarily use | 45 // Not to be confused with "mid", this is a field we can temporarily use |
| 45 // to uniquely identify a receiver until we implement Unified Plan SDP. | 46 // to uniquely identify a receiver until we implement Unified Plan SDP. |
| 46 virtual std::string id() const = 0; | 47 virtual std::string id() const = 0; |
| 47 | 48 |
| 48 // TODO(deadbeef): Support one sender having multiple stream ids. | 49 // TODO(deadbeef): Support one sender having multiple stream ids. |
| 49 virtual void set_stream_id(const std::string& stream_id) = 0; | 50 virtual void set_stream_id(const std::string& stream_id) = 0; |
| 50 virtual std::string stream_id() const = 0; | 51 virtual std::string stream_id() const = 0; |
| 51 | 52 |
| 52 virtual void Stop() = 0; | 53 virtual void Stop() = 0; |
| 53 | 54 |
| 55 virtual RtpParameters GetParameters() const = 0; |
| 56 virtual bool SetParameters(const RtpParameters& parameters) = 0; |
| 57 |
| 54 protected: | 58 protected: |
| 55 virtual ~RtpSenderInterface() {} | 59 virtual ~RtpSenderInterface() {} |
| 56 }; | 60 }; |
| 57 | 61 |
| 58 // Define proxy for RtpSenderInterface. | 62 // Define proxy for RtpSenderInterface. |
| 59 BEGIN_PROXY_MAP(RtpSender) | 63 BEGIN_PROXY_MAP(RtpSender) |
| 60 PROXY_METHOD1(bool, SetTrack, MediaStreamTrackInterface*) | 64 PROXY_METHOD1(bool, SetTrack, MediaStreamTrackInterface*) |
| 61 PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track) | 65 PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track) |
| 62 PROXY_METHOD1(void, SetSsrc, uint32_t) | 66 PROXY_METHOD1(void, SetSsrc, uint32_t) |
| 63 PROXY_CONSTMETHOD0(uint32_t, ssrc) | 67 PROXY_CONSTMETHOD0(uint32_t, ssrc) |
| 64 PROXY_CONSTMETHOD0(cricket::MediaType, media_type) | 68 PROXY_CONSTMETHOD0(cricket::MediaType, media_type) |
| 65 PROXY_CONSTMETHOD0(std::string, id) | 69 PROXY_CONSTMETHOD0(std::string, id) |
| 66 PROXY_METHOD1(void, set_stream_id, const std::string&) | 70 PROXY_METHOD1(void, set_stream_id, const std::string&) |
| 67 PROXY_CONSTMETHOD0(std::string, stream_id) | 71 PROXY_CONSTMETHOD0(std::string, stream_id) |
| 68 PROXY_METHOD0(void, Stop) | 72 PROXY_METHOD0(void, Stop) |
| 73 PROXY_CONSTMETHOD0(RtpParameters, GetParameters); |
| 74 PROXY_METHOD1(bool, SetParameters, const RtpParameters&) |
| 69 END_PROXY() | 75 END_PROXY() |
| 70 | 76 |
| 71 } // namespace webrtc | 77 } // namespace webrtc |
| 72 | 78 |
| 73 #endif // WEBRTC_API_RTPSENDERINTERFACE_H_ | 79 #endif // WEBRTC_API_RTPSENDERINTERFACE_H_ |
| OLD | NEW |