OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_DEFINES_H_ | 11 #ifndef MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_DEFINES_H_ |
12 #define MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_DEFINES_H_ | 12 #define MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_DEFINES_H_ |
13 | 13 |
14 #include <stddef.h> | 14 #include <stddef.h> |
15 | 15 |
16 #include "typedefs.h" // NOLINT(build/include) | 16 #include "typedefs.h" // NOLINT(build/include) |
17 | 17 |
18 namespace webrtc { | 18 namespace webrtc { |
19 | 19 |
20 static const int kAdmMaxDeviceNameSize = 128; | 20 static const int kAdmMaxDeviceNameSize = 128; |
21 static const int kAdmMaxFileNameSize = 512; | 21 static const int kAdmMaxFileNameSize = 512; |
22 static const int kAdmMaxGuidSize = 128; | 22 static const int kAdmMaxGuidSize = 128; |
23 | 23 |
24 static const int kAdmMinPlayoutBufferSizeMs = 10; | 24 static const int kAdmMinPlayoutBufferSizeMs = 10; |
25 static const int kAdmMaxPlayoutBufferSizeMs = 250; | 25 static const int kAdmMaxPlayoutBufferSizeMs = 250; |
26 | 26 |
27 // ---------------------------------------------------------------------------- | 27 // ---------------------------------------------------------------------------- |
28 // AudioDeviceObserver | |
29 // ---------------------------------------------------------------------------- | |
30 | |
31 class AudioDeviceObserver { | |
32 public: | |
33 enum ErrorCode { kRecordingError = 0, kPlayoutError = 1 }; | |
34 enum WarningCode { kRecordingWarning = 0, kPlayoutWarning = 1 }; | |
35 | |
36 virtual void OnErrorIsReported(const ErrorCode error) = 0; | |
37 virtual void OnWarningIsReported(const WarningCode warning) = 0; | |
38 | |
39 protected: | |
40 virtual ~AudioDeviceObserver() {} | |
41 }; | |
42 | |
43 // ---------------------------------------------------------------------------- | |
44 // AudioTransport | 28 // AudioTransport |
45 // ---------------------------------------------------------------------------- | 29 // ---------------------------------------------------------------------------- |
46 | 30 |
47 class AudioTransport { | 31 class AudioTransport { |
48 public: | 32 public: |
49 virtual int32_t RecordedDataIsAvailable(const void* audioSamples, | 33 virtual int32_t RecordedDataIsAvailable(const void* audioSamples, |
50 const size_t nSamples, | 34 const size_t nSamples, |
51 const size_t nBytesPerSample, | 35 const size_t nBytesPerSample, |
52 const size_t nChannels, | 36 const size_t nChannels, |
53 const uint32_t samplesPerSec, | 37 const uint32_t samplesPerSec, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 private: | 143 private: |
160 int sample_rate_; | 144 int sample_rate_; |
161 size_t channels_; | 145 size_t channels_; |
162 size_t frames_per_buffer_; | 146 size_t frames_per_buffer_; |
163 size_t frames_per_10ms_buffer_; | 147 size_t frames_per_10ms_buffer_; |
164 }; | 148 }; |
165 | 149 |
166 } // namespace webrtc | 150 } // namespace webrtc |
167 | 151 |
168 #endif // MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_DEFINES_H_ | 152 #endif // MODULES_AUDIO_DEVICE_INCLUDE_AUDIO_DEVICE_DEFINES_H_ |
OLD | NEW |