| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright 2012 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_API_MEDIASTREAMPROVIDER_H_ | |
| 12 #define WEBRTC_API_MEDIASTREAMPROVIDER_H_ | |
| 13 | |
| 14 #include <memory> | |
| 15 | |
| 16 #include "webrtc/api/rtpsenderinterface.h" | |
| 17 #include "webrtc/base/basictypes.h" | |
| 18 #include "webrtc/media/base/videosinkinterface.h" | |
| 19 #include "webrtc/media/base/videosourceinterface.h" | |
| 20 | |
| 21 namespace cricket { | |
| 22 | |
| 23 class AudioSource; | |
| 24 class VideoFrame; | |
| 25 struct AudioOptions; | |
| 26 struct VideoOptions; | |
| 27 | |
| 28 } // namespace cricket | |
| 29 | |
| 30 namespace webrtc { | |
| 31 | |
| 32 class AudioSinkInterface; | |
| 33 | |
| 34 // TODO(deadbeef): Change the key from an ssrc to a "sender_id" or | |
| 35 // "receiver_id" string, which will be the MSID in the short term and MID in | |
| 36 // the long term. | |
| 37 | |
| 38 // TODO(deadbeef): These interfaces are effectively just a way for the | |
| 39 // RtpSenders/Receivers to get to the BaseChannels. These interfaces should be | |
| 40 // refactored away eventually, as the classes converge. | |
| 41 | |
| 42 // This interface is called by AudioRtpSender/Receivers to change the settings | |
| 43 // of an audio track connected to certain PeerConnection. | |
| 44 class AudioProviderInterface { | |
| 45 public: | |
| 46 // Enable/disable the audio playout of a remote audio track with |ssrc|. | |
| 47 virtual void SetAudioPlayout(uint32_t ssrc, bool enable) = 0; | |
| 48 // Enable/disable sending audio on the local audio track with |ssrc|. | |
| 49 // When |enable| is true |options| should be applied to the audio track. | |
| 50 virtual void SetAudioSend(uint32_t ssrc, | |
| 51 bool enable, | |
| 52 const cricket::AudioOptions& options, | |
| 53 cricket::AudioSource* source) = 0; | |
| 54 | |
| 55 // Sets the audio playout volume of a remote audio track with |ssrc|. | |
| 56 // |volume| is in the range of [0, 10]. | |
| 57 virtual void SetAudioPlayoutVolume(uint32_t ssrc, double volume) = 0; | |
| 58 | |
| 59 // Allows for setting a direct audio sink for an incoming audio source. | |
| 60 // Only one audio sink is supported per ssrc and ownership of the sink is | |
| 61 // passed to the provider. | |
| 62 virtual void SetRawAudioSink( | |
| 63 uint32_t ssrc, | |
| 64 std::unique_ptr<webrtc::AudioSinkInterface> sink) = 0; | |
| 65 | |
| 66 virtual RtpParameters GetAudioRtpSendParameters(uint32_t ssrc) const = 0; | |
| 67 virtual bool SetAudioRtpSendParameters(uint32_t ssrc, | |
| 68 const RtpParameters& parameters) = 0; | |
| 69 | |
| 70 virtual RtpParameters GetAudioRtpReceiveParameters(uint32_t ssrc) const = 0; | |
| 71 virtual bool SetAudioRtpReceiveParameters( | |
| 72 uint32_t ssrc, | |
| 73 const RtpParameters& parameters) = 0; | |
| 74 | |
| 75 // Called when the first audio packet is received. | |
| 76 sigslot::signal0<> SignalFirstAudioPacketReceived; | |
| 77 | |
| 78 protected: | |
| 79 virtual ~AudioProviderInterface() {} | |
| 80 }; | |
| 81 | |
| 82 // This interface is called by VideoRtpSender/Receivers to change the settings | |
| 83 // of a video track connected to a certain PeerConnection. | |
| 84 class VideoProviderInterface { | |
| 85 public: | |
| 86 // Enable/disable the video playout of a remote video track with |ssrc|. | |
| 87 virtual void SetVideoPlayout( | |
| 88 uint32_t ssrc, | |
| 89 bool enable, | |
| 90 rtc::VideoSinkInterface<cricket::VideoFrame>* sink) = 0; | |
| 91 // Enable/disable sending video on the local video track with |ssrc|. | |
| 92 // TODO(deadbeef): Make |options| a reference parameter. | |
| 93 // TODO(deadbeef): Eventually, |enable| and |options| will be contained | |
| 94 // in |source|. When that happens, remove those parameters and rename | |
| 95 // this to SetVideoSource. | |
| 96 virtual void SetVideoSend( | |
| 97 uint32_t ssrc, | |
| 98 bool enable, | |
| 99 const cricket::VideoOptions* options, | |
| 100 rtc::VideoSourceInterface<cricket::VideoFrame>* source) = 0; | |
| 101 | |
| 102 virtual RtpParameters GetVideoRtpSendParameters(uint32_t ssrc) const = 0; | |
| 103 virtual bool SetVideoRtpSendParameters(uint32_t ssrc, | |
| 104 const RtpParameters& parameters) = 0; | |
| 105 | |
| 106 virtual RtpParameters GetVideoRtpReceiveParameters(uint32_t ssrc) const = 0; | |
| 107 virtual bool SetVideoRtpReceiveParameters( | |
| 108 uint32_t ssrc, | |
| 109 const RtpParameters& parameters) = 0; | |
| 110 | |
| 111 // Called when the first video packet is received. | |
| 112 sigslot::signal0<> SignalFirstVideoPacketReceived; | |
| 113 | |
| 114 protected: | |
| 115 virtual ~VideoProviderInterface() {} | |
| 116 }; | |
| 117 | |
| 118 } // namespace webrtc | |
| 119 | |
| 120 #endif // WEBRTC_API_MEDIASTREAMPROVIDER_H_ | |
| OLD | NEW |