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_SOUNDOUTPUTSTREAMINTERFACE_H_ | 11 #ifndef WEBRTC_SOUND_SOUNDOUTPUTSTREAMINTERFACE_H_ |
12 #define WEBRTC_SOUND_SOUNDOUTPUTSTREAMINTERFACE_H_ | 12 #define WEBRTC_SOUND_SOUNDOUTPUTSTREAMINTERFACE_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 outputting a stream to a playback device. | 19 // Interface for outputting a stream to a playback device. |
20 // Semantics and thread-safety of EnableBufferMonitoring()/ | 20 // Semantics and thread-safety of EnableBufferMonitoring()/ |
21 // DisableBufferMonitoring() are the same as for rtc::Worker. | 21 // DisableBufferMonitoring() are the same as for rtc::Worker. |
22 class SoundOutputStreamInterface { | 22 class SoundOutputStreamInterface { |
23 public: | 23 public: |
24 virtual ~SoundOutputStreamInterface() {} | 24 virtual ~SoundOutputStreamInterface(); |
25 | 25 |
26 // Enables monitoring the available buffer space on the current thread. | 26 // Enables monitoring the available buffer space on the current thread. |
27 virtual bool EnableBufferMonitoring() = 0; | 27 virtual bool EnableBufferMonitoring() = 0; |
28 // Disables the monitoring. | 28 // Disables the monitoring. |
29 virtual bool DisableBufferMonitoring() = 0; | 29 virtual bool DisableBufferMonitoring() = 0; |
30 | 30 |
31 // Write the given samples to the devices. If currently monitoring then this | 31 // Write the given samples to the devices. If currently monitoring then this |
32 // may only be called from the monitoring thread. | 32 // may only be called from the monitoring thread. |
33 virtual bool WriteSamples(const void *sample_data, | 33 virtual bool WriteSamples(const void *sample_data, |
34 size_t size) = 0; | 34 size_t size) = 0; |
(...skipping 19 matching lines...) Expand all Loading... |
54 | 54 |
55 // Notifies the producer of the available buffer space for writes. | 55 // Notifies the producer of the available buffer space for writes. |
56 // It fires continuously as long as the space is greater than zero. | 56 // It fires continuously as long as the space is greater than zero. |
57 // The first parameter is the amount of buffer space available for data to | 57 // The first parameter is the amount of buffer space available for data to |
58 // be written (i.e., the maximum amount of data that can be written right now | 58 // be written (i.e., the maximum amount of data that can be written right now |
59 // with WriteSamples() without blocking). | 59 // with WriteSamples() without blocking). |
60 // The 2nd parameter is the stream that is issuing the callback. | 60 // The 2nd parameter is the stream that is issuing the callback. |
61 sigslot::signal2<size_t, SoundOutputStreamInterface *> SignalBufferSpace; | 61 sigslot::signal2<size_t, SoundOutputStreamInterface *> SignalBufferSpace; |
62 | 62 |
63 protected: | 63 protected: |
64 SoundOutputStreamInterface() {} | 64 SoundOutputStreamInterface(); |
65 | 65 |
66 private: | 66 private: |
67 RTC_DISALLOW_COPY_AND_ASSIGN(SoundOutputStreamInterface); | 67 RTC_DISALLOW_COPY_AND_ASSIGN(SoundOutputStreamInterface); |
68 }; | 68 }; |
69 | 69 |
70 } // namespace rtc | 70 } // namespace rtc |
71 | 71 |
72 #endif // WEBRTC_SOUND_SOUNDOUTPUTSTREAMINTERFACE_H_ | 72 #endif // WEBRTC_SOUND_SOUNDOUTPUTSTREAMINTERFACE_H_ |
OLD | NEW |