OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_SOUND_SOUNDINPUTSTREAMINTERFACE_H_ | 11 #ifndef WEBRTC_SOUND_SOUNDINPUTSTREAMINTERFACE_H_ |
12 #define WEBRTC_SOUND_SOUNDINPUTSTREAMINTERFACE_H_ | 12 #define WEBRTC_SOUND_SOUNDINPUTSTREAMINTERFACE_H_ |
13 | 13 |
14 #include "webrtc/base/constructormagic.h" | 14 #include "webrtc/base/constructormagic.h" |
15 #include "webrtc/base/sigslot.h" | 15 #include "webrtc/base/sigslot.h" |
16 | 16 |
17 namespace rtc { | 17 namespace rtc { |
18 | 18 |
19 // Interface for consuming an input stream from a recording device. | 19 // Interface for consuming an input stream from a recording device. |
20 // Semantics and thread-safety of StartReading()/StopReading() are the same as | 20 // Semantics and thread-safety of StartReading()/StopReading() are the same as |
21 // for rtc::Worker. | 21 // for rtc::Worker. |
22 class SoundInputStreamInterface { | 22 class SoundInputStreamInterface { |
23 public: | 23 public: |
24 virtual ~SoundInputStreamInterface() {} | 24 virtual ~SoundInputStreamInterface(); |
25 | 25 |
26 // Starts the reading of samples on the current thread. | 26 // Starts the reading of samples on the current thread. |
27 virtual bool StartReading() = 0; | 27 virtual bool StartReading() = 0; |
28 // Stops the reading of samples. | 28 // Stops the reading of samples. |
29 virtual bool StopReading() = 0; | 29 virtual bool StopReading() = 0; |
30 | 30 |
31 // Retrieves the current input volume for this stream. Nominal range is | 31 // Retrieves the current input volume for this stream. Nominal range is |
32 // defined by SoundSystemInterface::k(Max|Min)Volume, but values exceeding the | 32 // defined by SoundSystemInterface::k(Max|Min)Volume, but values exceeding the |
33 // max may be possible in some implementations. This call retrieves the actual | 33 // max may be possible in some implementations. This call retrieves the actual |
34 // volume currently in use by the OS, not a cached value from a previous | 34 // volume currently in use by the OS, not a cached value from a previous |
(...skipping 15 matching lines...) Expand all Loading... |
50 // Notifies the consumer of new data read from the device. | 50 // Notifies the consumer of new data read from the device. |
51 // The first parameter is a pointer to the data read, and is only valid for | 51 // The first parameter is a pointer to the data read, and is only valid for |
52 // the duration of the call. | 52 // the duration of the call. |
53 // The second parameter is the amount of data read in bytes (i.e., the valid | 53 // The second parameter is the amount of data read in bytes (i.e., the valid |
54 // length of the memory pointed to). | 54 // length of the memory pointed to). |
55 // The 3rd parameter is the stream that is issuing the callback. | 55 // The 3rd parameter is the stream that is issuing the callback. |
56 sigslot::signal3<const void *, size_t, | 56 sigslot::signal3<const void *, size_t, |
57 SoundInputStreamInterface *> SignalSamplesRead; | 57 SoundInputStreamInterface *> SignalSamplesRead; |
58 | 58 |
59 protected: | 59 protected: |
60 SoundInputStreamInterface() {} | 60 SoundInputStreamInterface(); |
61 | 61 |
62 private: | 62 private: |
63 RTC_DISALLOW_COPY_AND_ASSIGN(SoundInputStreamInterface); | 63 RTC_DISALLOW_COPY_AND_ASSIGN(SoundInputStreamInterface); |
64 }; | 64 }; |
65 | 65 |
66 } // namespace rtc | 66 } // namespace rtc |
67 | 67 |
68 #endif // WEBRTC_SOUND_SOUNDOUTPUTSTREAMINTERFACE_H_ | 68 #endif // WEBRTC_SOUND_SOUNDOUTPUTSTREAMINTERFACE_H_ |
OLD | NEW |