| 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 #include "webrtc/modules/audio_device/android/opensles_common.h" | 11 #include "webrtc/modules/audio_device/android/opensles_common.h" |
| 12 | 12 |
| 13 #include <SLES/OpenSLES.h> | 13 #include <SLES/OpenSLES.h> |
| 14 | 14 |
| 15 #include "webrtc/rtc_base/arraysize.h" | 15 #include "webrtc/base/arraysize.h" |
| 16 #include "webrtc/rtc_base/checks.h" | 16 #include "webrtc/base/checks.h" |
| 17 | 17 |
| 18 namespace webrtc { | 18 namespace webrtc { |
| 19 | 19 |
| 20 // Returns a string representation given an integer SL_RESULT_XXX code. | 20 // Returns a string representation given an integer SL_RESULT_XXX code. |
| 21 // The mapping can be found in <SLES/OpenSLES.h>. | 21 // The mapping can be found in <SLES/OpenSLES.h>. |
| 22 const char* GetSLErrorString(size_t code) { | 22 const char* GetSLErrorString(size_t code) { |
| 23 static const char* sl_error_strings[] = { | 23 static const char* sl_error_strings[] = { |
| 24 "SL_RESULT_SUCCESS", // 0 | 24 "SL_RESULT_SUCCESS", // 0 |
| 25 "SL_RESULT_PRECONDITIONS_VIOLATED", // 1 | 25 "SL_RESULT_PRECONDITIONS_VIOLATED", // 1 |
| 26 "SL_RESULT_PARAMETER_INVALID", // 2 | 26 "SL_RESULT_PARAMETER_INVALID", // 2 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } else if (format.numChannels == 2) { | 94 } else if (format.numChannels == 2) { |
| 95 format.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT; | 95 format.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT; |
| 96 } else { | 96 } else { |
| 97 RTC_CHECK(false) << "Unsupported number of channels: " | 97 RTC_CHECK(false) << "Unsupported number of channels: " |
| 98 << format.numChannels; | 98 << format.numChannels; |
| 99 } | 99 } |
| 100 return format; | 100 return format; |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace webrtc | 103 } // namespace webrtc |
| OLD | NEW |