Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(760)

Side by Side Diff: talk/app/webrtc/mediastreamprovider.h

Issue 1505253004: Support for remote audio into tracks (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 11 matching lines...) Expand all
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #ifndef TALK_APP_WEBRTC_MEDIASTREAMPROVIDER_H_ 28 #ifndef TALK_APP_WEBRTC_MEDIASTREAMPROVIDER_H_
29 #define TALK_APP_WEBRTC_MEDIASTREAMPROVIDER_H_ 29 #define TALK_APP_WEBRTC_MEDIASTREAMPROVIDER_H_
30 30
31 #include "webrtc/base/basictypes.h" 31 #include "webrtc/base/basictypes.h"
32 #include "webrtc/base/scoped_ptr.h"
32 33
33 namespace cricket { 34 namespace cricket {
34 35
35 class AudioRenderer; 36 class AudioRenderer;
36 class VideoCapturer; 37 class VideoCapturer;
37 class VideoRenderer; 38 class VideoRenderer;
38 struct AudioOptions; 39 struct AudioOptions;
39 struct VideoOptions; 40 struct VideoOptions;
40 41
41 } // namespace cricket 42 } // namespace cricket
42 43
43 namespace webrtc { 44 namespace webrtc {
44 45
46 class AudioSinkInterface;
47
45 // TODO(deadbeef): Change the key from an ssrc to a "sender_id" or 48 // TODO(deadbeef): Change the key from an ssrc to a "sender_id" or
46 // "receiver_id" string, which will be the MSID in the short term and MID in 49 // "receiver_id" string, which will be the MSID in the short term and MID in
47 // the long term. 50 // the long term.
48 51
49 // TODO(deadbeef): These interfaces are effectively just a way for the 52 // TODO(deadbeef): These interfaces are effectively just a way for the
50 // RtpSenders/Receivers to get to the BaseChannels. These interfaces should be 53 // RtpSenders/Receivers to get to the BaseChannels. These interfaces should be
51 // refactored away eventually, as the classes converge. 54 // refactored away eventually, as the classes converge.
52 55
53 // This interface is called by AudioRtpSender/Receivers to change the settings 56 // This interface is called by AudioRtpSender/Receivers to change the settings
54 // of an audio track connected to certain PeerConnection. 57 // of an audio track connected to certain PeerConnection.
55 class AudioProviderInterface { 58 class AudioProviderInterface {
56 public: 59 public:
57 // Enable/disable the audio playout of a remote audio track with |ssrc|. 60 // Enable/disable the audio playout of a remote audio track with |ssrc|.
58 virtual void SetAudioPlayout(uint32_t ssrc, bool enable) = 0; 61 virtual void SetAudioPlayout(uint32_t ssrc, bool enable) = 0;
59 // Enable/disable sending audio on the local audio track with |ssrc|. 62 // Enable/disable sending audio on the local audio track with |ssrc|.
60 // When |enable| is true |options| should be applied to the audio track. 63 // When |enable| is true |options| should be applied to the audio track.
61 virtual void SetAudioSend(uint32_t ssrc, 64 virtual void SetAudioSend(uint32_t ssrc,
62 bool enable, 65 bool enable,
63 const cricket::AudioOptions& options, 66 const cricket::AudioOptions& options,
64 cricket::AudioRenderer* renderer) = 0; 67 cricket::AudioRenderer* renderer) = 0;
65 68
66 // Sets the audio playout volume of a remote audio track with |ssrc|. 69 // Sets the audio playout volume of a remote audio track with |ssrc|.
67 // |volume| is in the range of [0, 10]. 70 // |volume| is in the range of [0, 10].
68 virtual void SetAudioPlayoutVolume(uint32_t ssrc, double volume) = 0; 71 virtual void SetAudioPlayoutVolume(uint32_t ssrc, double volume) = 0;
69 72
73 // Allows for setting a direct audio sink for an incoming audio source.
74 // Only one audio sink is supported per ssrc and ownership of the sink is
75 // passed to the provider.
76 virtual void SetRawAudioSink(
77 uint32_t ssrc,
78 rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) = 0;
79
70 protected: 80 protected:
71 virtual ~AudioProviderInterface() {} 81 virtual ~AudioProviderInterface() {}
72 }; 82 };
73 83
74 // This interface is called by VideoRtpSender/Receivers to change the settings 84 // This interface is called by VideoRtpSender/Receivers to change the settings
75 // of a video track connected to a certain PeerConnection. 85 // of a video track connected to a certain PeerConnection.
76 class VideoProviderInterface { 86 class VideoProviderInterface {
77 public: 87 public:
78 virtual bool SetCaptureDevice(uint32_t ssrc, 88 virtual bool SetCaptureDevice(uint32_t ssrc,
79 cricket::VideoCapturer* camera) = 0; 89 cricket::VideoCapturer* camera) = 0;
80 // Enable/disable the video playout of a remote video track with |ssrc|. 90 // Enable/disable the video playout of a remote video track with |ssrc|.
81 virtual void SetVideoPlayout(uint32_t ssrc, 91 virtual void SetVideoPlayout(uint32_t ssrc,
82 bool enable, 92 bool enable,
83 cricket::VideoRenderer* renderer) = 0; 93 cricket::VideoRenderer* renderer) = 0;
84 // Enable sending video on the local video track with |ssrc|. 94 // Enable sending video on the local video track with |ssrc|.
85 virtual void SetVideoSend(uint32_t ssrc, 95 virtual void SetVideoSend(uint32_t ssrc,
86 bool enable, 96 bool enable,
87 const cricket::VideoOptions* options) = 0; 97 const cricket::VideoOptions* options) = 0;
88 98
89 protected: 99 protected:
90 virtual ~VideoProviderInterface() {} 100 virtual ~VideoProviderInterface() {}
91 }; 101 };
92 102
93 } // namespace webrtc 103 } // namespace webrtc
94 104
95 #endif // TALK_APP_WEBRTC_MEDIASTREAMPROVIDER_H_ 105 #endif // TALK_APP_WEBRTC_MEDIASTREAMPROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698