OpenSL callback methods on queues

574 views
Skip to first unread message

James Moore

unread,
Aug 7, 2012, 3:32:05 PM8/7/12
to andro...@googlegroups.com
I'm confused about the opensl callback methods on buffer queues. The sample code specifies a callback like this:

    // get the buffer queue interface

    result = (*bqPlayerObject)->GetInterface(bqPlayerObject, SL_IID_BUFFERQUEUE,

            &bqPlayerBufferQueue);

    assert(SL_RESULT_SUCCESS == result);


    // register callback on the buffer queue

    result = (*bqPlayerBufferQueue)->RegisterCallback(bqPlayerBufferQueue, bqPlayerCallback, NULL);

    assert(SL_RESULT_SUCCESS == result);

Where bqPlayerCallback is:

  void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context)

But the opensl spec says that buffer queue callbacks look like:
void BufferQueueCallback(

SLBufferQueueItf queueItf,

SLuint32 eventFlags,

const void * pBuffer,

SLuint32 bufferSize,

SLuint32 dataUsed,

void *pContext)

What am I missing? 

Glenn Kasten

unread,
Aug 8, 2012, 11:44:55 AM8/8/12
to andro...@googlegroups.com
You're probably looking at OpenSL ES 1.1, which is incompatible with OpenSL ES 1.0.1 in this area.
The Android implementation is based on OpenSL ES 1.0.1. 
After installing NDK, open NDKroot/docs/opensles/index.html in browser and look at these sections:
 Planning for source compatibility, bullet 1
 Android simple buffer queue data locator and interface
For convenience, a copy of the 1.0.1 spec is included in that same directory. There's also example code in NDK that uses the 1.0.1 version of the API.

James Moore

unread,
Aug 13, 2012, 12:24:53 PM8/13/12
to andro...@googlegroups.com
On Wednesday, August 8, 2012 8:44:55 AM UTC-7, Glenn Kasten wrote:
You're probably looking at OpenSL ES 1.1, which is incompatible with OpenSL ES 1.0.1 in this area.

Yes, that was the problem, and looking at the right spec did clear up a bunch of my questions.  Thanks!

 - James

Reply all
Reply to author
Forward
0 new messages