I need to make an audio codec library OpenSL ES compliant. Upon going through the specification of OpenSL ES, I have come to an understanding that it is an application layer similar to the OpenMAX AL . Could you kindly explain how i would be able to integrate the audio codec library (in the absence of an integration layer).
I am assuming that you are looking to expose an audio codec library through OpenSL ES which is currently not listed as part of the specification. You can do this by creating a vendor specific extension. If you only need to let the application know that the codec library exists, you can extend the “SL_AUDIOCODEC” macros:
Then, when your application calls Engine:SLAudioDecoderCapabilities:GetAudioDecoders() the implementation can return SL_AUDIOCODEC_MYCODECNAME in the list of supported codecs.
The application can find out if your vendor extension exists by calling Engine:SLEngineItf:IsExtensionSupported(). If you need to pass information to the codec, you can do so through the SLConfigExtensionsItf interface.
If this is not what you are trying to do, please post additional information so we can try to assist you in your issue.
I need to design the API’s for an audio codec such that they are compliant to OpenSL ES. Could you tell me which API’s i should be using to do functions like memory allocation for the library,input/output audio data handling for the audio codec library. Is there any sample implementation of the OpenSL ES (handling an audio codec)available? I am currently referring the OpenSL_ES_Specification_1.1 pdf. Are there any other supporting docs for the implementation of API.
When you design the APIs for your audio codec, you need to take into account the implementation which will be using it. OpenSL ES does not expose the codec API, nor does it expose the input/output audio data handling of the codec. These APIs would be dependent on the specific implementation of OpenSL ES. Because of this, it is not possible for a codec to be “OpenSL ES compliant”. Unfortunately, there is currently no sample implementation of OpenSL ES available.
You may consider looking at the OpenMAX IL 1.1 specification (OpenMAX Overview - The Khronos Group Inc). OpenMAX IL defines component interfaces for the integration layer of a media chain. From your description it sounds as if that is what you are looking to do. There is an OpenMAX IL open source project available at http://omxil.sourceforge.net/.
I need to plug in the audio codec library into the OpenSL implementation of Android 2.3. So How will i do that. And is it the same procedure if what i am trying to plug in is an codec like an mp3 or a post-processing module ?
If you want to submit buffers from the application to your codec through OpenSL ES for testing purposes, I suggest you take a look at section 8.14 SLBufferQueueItf and example B.1.1 Buffer Queue in the specification. If your implementation supports it, the buffer queue mechanism allows you to submit buffers from the application for processing by the underlying media engine.