Closed dk-3cx closed 1 day ago
Hmm. We did not anticipate that. I try to avoid conditional compilation tricks. I think it might work if I change SL_IID_ENGINE to OBOE_SL_IID_ENGINE, etcetera.
@dk-3cx - Do you think that would be enough to avoid the naming collisions?
Our code works fine if I remove all the mentioned constants. Renaming them seems to have the same effect. But is such a solution acceptable from your side? I guess you named them this way for a reason, no? (to satisfy some extern
declarations)
We encountered the same issue. The definitions in src/opensles/EngineOpenSLES.cpp
caused errors in other code that directly uses OpenSL ES. For now, we are also temporarily removing this section to bypass the problem.
I guess you named them this way for a reason, no? (to satisfy some extern declarations)
Right. So renaming them would fix your problem but unfix the original problem when libOpenSLes.so is missing.
I coulld add a #ifndef around SL_IID_ENGINE and the other stubs as you suggested. I wish there was some way to use link time information to make compile time decisions. But it sems like the order is wrong.
We will look for some alternative but we will probably go with the #ifndef. We want to move carefully to avoid further breakage.
Oboe version: 1.9.0 Doesn't reproduce in 1.8.1
The recent change in
src/opensles/EngineOpenSLES.cpp
included into Oboe 1.9.0 has introduced stubs for OpenSL ES global constants inside the Oboe library and initializes them all withnullptr
:We develop an Android app (in Kotlin) with a native library for it that uses both Oboe and OpenSL. OpenSL is used NOT as a backend for Oboe, but independently from Oboe. Oboe is statically linked with our native lib, while
libOpenSLES.so
is used as a shared library. This leads to crashes due to null pointer exceptions, because the stubs in Oboe hide the original constants fromlibOpenSLES.so
.Could you please fix it in some way, e.g. by introducing some
#ifdef
with a macro that can be passed to cmake when building Oboe? So that we can choose during the compilation if we need these stubs or not.