OLD | NEW |
(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 // This file contains interfaces for RtpSenders |
| 12 // http://w3c.github.io/webrtc-pc/#rtcrtpsender-interface |
| 13 |
| 14 #ifndef WEBRTC_API_ORTC_ORTCRTPSENDERINTERFACE_H_ |
| 15 #define WEBRTC_API_ORTC_ORTCRTPSENDERINTERFACE_H_ |
| 16 |
| 17 #include "webrtc/api/mediatypes.h" |
| 18 #include "webrtc/api/mediastreaminterface.h" |
| 19 #include "webrtc/api/ortc/rtptransportinterface.h" |
| 20 #include "webrtc/api/rtcerror.h" |
| 21 #include "webrtc/api/rtpparameters.h" |
| 22 |
| 23 namespace webrtc { |
| 24 |
| 25 // Note: Since sender capabilities may depend on how the OrtcFactory was |
| 26 // created, instead of a static "GetCapabilities" method on this interface, |
| 27 // there is a "GetRtpSenderCapabilities" method on the OrtcFactory. |
| 28 class OrtcRtpSenderInterface { |
| 29 public: |
| 30 virtual ~OrtcRtpSenderInterface() {} |
| 31 |
| 32 // Returns INVALID_PARAMETER error if an audio track is set on a video |
| 33 // RtpSender, or vice-versa. |
| 34 virtual RTCError SetTrack(MediaStreamTrackInterface* track) = 0; |
| 35 // Returns previously set (or constructed-with) track. |
| 36 virtual rtc::scoped_refptr<MediaStreamTrackInterface> GetTrack() const = 0; |
| 37 |
| 38 // Switches to sending media on a new transport. |
| 39 virtual RTCError SetTransport(RtpTransportInterface* transport) = 0; |
| 40 // Returns previously set (or constructed-with) transport. |
| 41 virtual RtpTransportInterface* GetTransport() const = 0; |
| 42 |
| 43 // Start sending media with |parameters| (if |parameters| contains an active |
| 44 // encoding). |
| 45 // |
| 46 // There are no limitations to how the parameters can be changed after the |
| 47 // initial call to Send, as long as they're valid (for example, they can't |
| 48 // use the same payload type for two codecs). |
| 49 virtual RTCError Send(const RtpParameters& parameters) = 0; |
| 50 // Returns parameters that were last successfully passed into Send, or empty |
| 51 // parameters if that hasn't yet occurred. |
| 52 virtual RtpParameters GetParameters() const = 0; |
| 53 |
| 54 // Audio or video sender? |
| 55 virtual cricket::MediaType GetKind() const = 0; |
| 56 |
| 57 // TODO(deadbeef): SSRC conflict signal. |
| 58 }; |
| 59 |
| 60 } // namespace webrtc |
| 61 |
| 62 #endif // WEBRTC_API_ORTC_ORTCRTPSENDERINTERFACE_H_ |
OLD | NEW |