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 "base/basictypes.h" | |
18 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
19 #include "base/logging.h" | 18 #include "base/logging.h" |
20 #include "base/native_library.h" | 19 #include "base/native_library.h" |
21 | 20 |
22 // The constants used in chromium. SLInterfaceID is actually a pointer to | 21 // The constants used in chromium. SLInterfaceID is actually a pointer to |
23 // SLInterfaceID_. Those symbols are defined as extern symbols in the OpenSLES | 22 // SLInterfaceID_. Those symbols are defined as extern symbols in the OpenSLES |
24 // headers. They will be initialized to their correct values when the library is | 23 // headers. They will be initialized to their correct values when the library is |
25 // loaded. | 24 // loaded. |
26 SLInterfaceID SL_IID_ENGINE = NULL; | 25 SLInterfaceID SL_IID_ENGINE = NULL; |
27 SLInterfaceID SL_IID_ANDROIDSIMPLEBUFFERQUEUE = NULL; | 26 SLInterfaceID SL_IID_ANDROIDSIMPLEBUFFERQUEUE = NULL; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 "slCreateEngine")); | 99 "slCreateEngine")); |
101 DCHECK(g_sl_create_engine_handle) | 100 DCHECK(g_sl_create_engine_handle) |
102 << "Unable to find symbol for slCreateEngine"; | 101 << "Unable to find symbol for slCreateEngine"; |
103 return g_sl_create_engine_handle(engine, | 102 return g_sl_create_engine_handle(engine, |
104 num_options, | 103 num_options, |
105 engine_options, | 104 engine_options, |
106 num_interfaces, | 105 num_interfaces, |
107 interface_ids, | 106 interface_ids, |
108 interfaces_required); | 107 interfaces_required); |
109 } | 108 } |
OLD | NEW |