blob: b80f6b2bd4e0f4783a7b21727e1a7e74cf7209f5 [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
2 * libjingle
jlmiller@webrtc.org5f93d0a2015-01-20 21:36:13 +00003 * Copyright 2012 Google Inc.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00004 *
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
deadbeef70ab1a12015-09-28 16:53:55 -070031#include "webrtc/base/basictypes.h"
32
henrike@webrtc.org28e20752013-07-10 00:45:36 +000033namespace cricket {
34
35class AudioRenderer;
36class VideoCapturer;
37class VideoRenderer;
38struct AudioOptions;
39struct VideoOptions;
40
41} // namespace cricket
42
43namespace webrtc {
44
deadbeef70ab1a12015-09-28 16:53:55 -070045// 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
47// the long term.
48
49// TODO(deadbeef): These interfaces are effectively just a way for the
50// RtpSenders/Receivers to get to the BaseChannels. These interfaces should be
51// refactored away eventually, as the classes converge.
52
henrike@webrtc.org28e20752013-07-10 00:45:36 +000053// This interface is called by AudioTrackHandler classes in mediastreamhandler.h
54// to change the settings of an audio track connected to certain PeerConnection.
55class AudioProviderInterface {
56 public:
57 // Enable/disable the audio playout of a remote audio track with |ssrc|.
Peter Boström0c4e06b2015-10-07 12:23:21 +020058 virtual void SetAudioPlayout(uint32_t ssrc,
59 bool enable,
henrike@webrtc.org1e09a712013-07-26 19:17:59 +000060 cricket::AudioRenderer* renderer) = 0;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000061 // Enable/disable sending audio on the local audio track with |ssrc|.
62 // When |enable| is true |options| should be applied to the audio track.
Peter Boström0c4e06b2015-10-07 12:23:21 +020063 virtual void SetAudioSend(uint32_t ssrc,
64 bool enable,
henrike@webrtc.org1e09a712013-07-26 19:17:59 +000065 const cricket::AudioOptions& options,
66 cricket::AudioRenderer* renderer) = 0;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000067
wu@webrtc.orgb9a088b2014-02-13 23:18:49 +000068 // Sets the audio playout volume of a remote audio track with |ssrc|.
69 // |volume| is in the range of [0, 10].
Peter Boström0c4e06b2015-10-07 12:23:21 +020070 virtual void SetAudioPlayoutVolume(uint32_t ssrc, double volume) = 0;
wu@webrtc.orgb9a088b2014-02-13 23:18:49 +000071
henrike@webrtc.org28e20752013-07-10 00:45:36 +000072 protected:
73 virtual ~AudioProviderInterface() {}
74};
75
76// This interface is called by VideoTrackHandler classes in mediastreamhandler.h
77// to change the settings of a video track connected to a certain
78// PeerConnection.
79class VideoProviderInterface {
80 public:
Peter Boström0c4e06b2015-10-07 12:23:21 +020081 virtual bool SetCaptureDevice(uint32_t ssrc,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000082 cricket::VideoCapturer* camera) = 0;
83 // Enable/disable the video playout of a remote video track with |ssrc|.
Peter Boström0c4e06b2015-10-07 12:23:21 +020084 virtual void SetVideoPlayout(uint32_t ssrc,
85 bool enable,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000086 cricket::VideoRenderer* renderer) = 0;
87 // Enable sending video on the local video track with |ssrc|.
Peter Boström0c4e06b2015-10-07 12:23:21 +020088 virtual void SetVideoSend(uint32_t ssrc,
89 bool enable,
henrike@webrtc.org28e20752013-07-10 00:45:36 +000090 const cricket::VideoOptions* options) = 0;
91
92 protected:
93 virtual ~VideoProviderInterface() {}
94};
95
96} // namespace webrtc
97
98#endif // TALK_APP_WEBRTC_MEDIASTREAMPROVIDER_H_