OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // The file defines the symbols from OpenSLES that android is using. It then | 5 // The file defines the symbols from OpenSLES that android is using. It then |
6 // loads the library dynamically on first use. | 6 // loads the library dynamically on first use. |
7 | 7 |
8 // The openSLES API is using constant as part of the API. This file will define | 8 // The openSLES API is using constant as part of the API. This file will define |
9 // proxies for those constants and redefine those when the library is first | 9 // proxies for those constants and redefine those when the library is first |
10 // loaded. For this, it need to be able to change their content and so import | 10 // loaded. For this, it need to be able to change their content and so import |
11 // the headers without const. This is correct because OpenSLES.h is a C API. | 11 // the headers without const. This is correct because OpenSLES.h is a C API. |
12 #define const | 12 #define const |
13 #include <SLES/OpenSLES.h> | 13 #include <SLES/OpenSLES.h> |
14 #include <SLES/OpenSLES_Android.h> | 14 #include <SLES/OpenSLES_Android.h> |
15 #undef const | 15 #undef const |
16 | 16 |
| 17 #include <stddef.h> |
| 18 |
17 #include "base/files/file_path.h" | 19 #include "base/files/file_path.h" |
18 #include "base/logging.h" | 20 #include "base/logging.h" |
19 #include "base/native_library.h" | 21 #include "base/native_library.h" |
20 | 22 |
21 // The constants used in chromium. SLInterfaceID is actually a pointer to | 23 // The constants used in chromium. SLInterfaceID is actually a pointer to |
22 // SLInterfaceID_. Those symbols are defined as extern symbols in the OpenSLES | 24 // SLInterfaceID_. Those symbols are defined as extern symbols in the OpenSLES |
23 // headers. They will be initialized to their correct values when the library is | 25 // headers. They will be initialized to their correct values when the library is |
24 // loaded. | 26 // loaded. |
25 SLInterfaceID SL_IID_ENGINE = NULL; | 27 SLInterfaceID SL_IID_ENGINE = NULL; |
26 SLInterfaceID SL_IID_ANDROIDSIMPLEBUFFERQUEUE = NULL; | 28 SLInterfaceID SL_IID_ANDROIDSIMPLEBUFFERQUEUE = NULL; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 "slCreateEngine")); | 101 "slCreateEngine")); |
100 DCHECK(g_sl_create_engine_handle) | 102 DCHECK(g_sl_create_engine_handle) |
101 << "Unable to find symbol for slCreateEngine"; | 103 << "Unable to find symbol for slCreateEngine"; |
102 return g_sl_create_engine_handle(engine, | 104 return g_sl_create_engine_handle(engine, |
103 num_options, | 105 num_options, |
104 engine_options, | 106 engine_options, |
105 num_interfaces, | 107 num_interfaces, |
106 interface_ids, | 108 interface_ids, |
107 interfaces_required); | 109 interfaces_required); |
108 } | 110 } |
OLD | NEW |