OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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_MODULES_AUDIO_DEVICE_ANDROID_OPENSLES_COMMON_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_OPENSLES_COMMON_H_ |
12 #define WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_OPENSLES_COMMON_H_ | 12 #define WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_OPENSLES_COMMON_H_ |
13 | 13 |
14 #include <stddef.h> | 14 #include <stddef.h> |
15 #include <SLES/OpenSLES.h> | 15 #include <SLES/OpenSLES.h> |
16 | 16 |
17 #include "webrtc/rtc_base/checks.h" | |
18 | |
19 namespace webrtc { | 17 namespace webrtc { |
20 | 18 |
21 // Returns a string representation given an integer SL_RESULT_XXX code. | 19 // Returns a string representation given an integer SL_RESULT_XXX code. |
22 // The mapping can be found in <SLES/OpenSLES.h>. | 20 // The mapping can be found in <SLES/OpenSLES.h>. |
23 const char* GetSLErrorString(size_t code); | 21 const char* GetSLErrorString(size_t code); |
24 | 22 |
25 // Configures an SL_DATAFORMAT_PCM structure based on native audio parameters. | 23 // Configures an SL_DATAFORMAT_PCM structure based on native audio parameters. |
26 SLDataFormat_PCM CreatePCMConfiguration(size_t channels, | 24 SLDataFormat_PCM CreatePCMConfiguration(size_t channels, |
27 int sample_rate, | 25 int sample_rate, |
28 size_t bits_per_sample); | 26 size_t bits_per_sample); |
(...skipping 24 matching lines...) Expand all Loading... |
53 | 51 |
54 private: | 52 private: |
55 SLType obj_; | 53 SLType obj_; |
56 }; | 54 }; |
57 | 55 |
58 typedef ScopedSLObject<SLObjectItf, const SLObjectItf_*> ScopedSLObjectItf; | 56 typedef ScopedSLObject<SLObjectItf, const SLObjectItf_*> ScopedSLObjectItf; |
59 | 57 |
60 } // namespace webrtc | 58 } // namespace webrtc |
61 | 59 |
62 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_OPENSLES_COMMON_H_ | 60 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_OPENSLES_COMMON_H_ |
OLD | NEW |