OLD | NEW |
| (Empty) |
1 /* | |
2 * libjingle | |
3 * Copyright 2012 Google Inc. | |
4 * | |
5 * Redistribution and use in source and binary forms, with or without | |
6 * modification, are permitted provided that the following conditions are met: | |
7 * | |
8 * 1. Redistributions of source code must retain the above copyright notice, | |
9 * this list of conditions and the following disclaimer. | |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | |
11 * this list of conditions and the following disclaimer in the documentation | |
12 * and/or other materials provided with the distribution. | |
13 * 3. The name of the author may not be used to endorse or promote products | |
14 * derived from this software without specific prior written permission. | |
15 * | |
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED | |
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | |
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
26 */ | |
27 | |
28 #ifndef TALK_APP_WEBRTC_MEDIASTREAMPROVIDER_H_ | |
29 #define TALK_APP_WEBRTC_MEDIASTREAMPROVIDER_H_ | |
30 | |
31 #include "webrtc/base/basictypes.h" | |
32 #include "webrtc/base/scoped_ptr.h" | |
33 #include "webrtc/media/base/videosinkinterface.h" | |
34 | |
35 namespace cricket { | |
36 | |
37 class AudioRenderer; | |
38 class VideoCapturer; | |
39 class VideoFrame; | |
40 class VideoRenderer; | |
41 struct AudioOptions; | |
42 struct VideoOptions; | |
43 | |
44 } // namespace cricket | |
45 | |
46 namespace webrtc { | |
47 | |
48 class AudioSinkInterface; | |
49 | |
50 // TODO(deadbeef): Change the key from an ssrc to a "sender_id" or | |
51 // "receiver_id" string, which will be the MSID in the short term and MID in | |
52 // the long term. | |
53 | |
54 // TODO(deadbeef): These interfaces are effectively just a way for the | |
55 // RtpSenders/Receivers to get to the BaseChannels. These interfaces should be | |
56 // refactored away eventually, as the classes converge. | |
57 | |
58 // This interface is called by AudioRtpSender/Receivers to change the settings | |
59 // of an audio track connected to certain PeerConnection. | |
60 class AudioProviderInterface { | |
61 public: | |
62 // Enable/disable the audio playout of a remote audio track with |ssrc|. | |
63 virtual void SetAudioPlayout(uint32_t ssrc, bool enable) = 0; | |
64 // Enable/disable sending audio on the local audio track with |ssrc|. | |
65 // When |enable| is true |options| should be applied to the audio track. | |
66 virtual void SetAudioSend(uint32_t ssrc, | |
67 bool enable, | |
68 const cricket::AudioOptions& options, | |
69 cricket::AudioRenderer* renderer) = 0; | |
70 | |
71 // Sets the audio playout volume of a remote audio track with |ssrc|. | |
72 // |volume| is in the range of [0, 10]. | |
73 virtual void SetAudioPlayoutVolume(uint32_t ssrc, double volume) = 0; | |
74 | |
75 // Allows for setting a direct audio sink for an incoming audio source. | |
76 // Only one audio sink is supported per ssrc and ownership of the sink is | |
77 // passed to the provider. | |
78 virtual void SetRawAudioSink( | |
79 uint32_t ssrc, | |
80 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) = 0; | |
81 | |
82 protected: | |
83 virtual ~AudioProviderInterface() {} | |
84 }; | |
85 | |
86 // This interface is called by VideoRtpSender/Receivers to change the settings | |
87 // of a video track connected to a certain PeerConnection. | |
88 class VideoProviderInterface { | |
89 public: | |
90 virtual bool SetCaptureDevice(uint32_t ssrc, | |
91 cricket::VideoCapturer* camera) = 0; | |
92 // Enable/disable the video playout of a remote video track with |ssrc|. | |
93 virtual void SetVideoPlayout( | |
94 uint32_t ssrc, | |
95 bool enable, | |
96 rtc::VideoSinkInterface<cricket::VideoFrame>* sink) = 0; | |
97 // Enable sending video on the local video track with |ssrc|. | |
98 virtual void SetVideoSend(uint32_t ssrc, | |
99 bool enable, | |
100 const cricket::VideoOptions* options) = 0; | |
101 | |
102 protected: | |
103 virtual ~VideoProviderInterface() {} | |
104 }; | |
105 | |
106 } // namespace webrtc | |
107 | |
108 #endif // TALK_APP_WEBRTC_MEDIASTREAMPROVIDER_H_ | |
OLD | NEW |