Cromarty
Posts: 64
Joined: Thu Jan 03, 2013 5:03 pm
Location: Godalming, South-east UK
Contact: Website

Refilling input buffer in ilclient empty buffer done callbac

Thu Jun 19, 2014 6:23 pm

Hello.

I have been looking at the hello_audio example.

I want to be able to refill a buffer in the empty_buffer_done callback but I can't really understand in the given example how to get at which buffer is being returned.

The definition of the callback in this example is different from the definition of the EmptyBufferDone callback as it is defined in the library code.

Here is the callback from the example (apologies for not using the code feature to paste this but it is not easy to do that when you can't see):

static void input_buffer_callback(void *data, COMPONENT_T * comp) {
// do nothing - could add a callback to the user
// to indicate more buffers may be available.
}

Any ideas of how I can identify and refill the emptied buffer?

Mike
--
Michael Ray
Analyst/Programmer
Surrey, UK
4xB, 1xB+,
Creator and admin of:
raspberry-vi@freelists.org
Ham radio call: G4XBF
'Suddenly I am become death, destroyer of SD cards'

hjimbens
Posts: 78
Joined: Fri May 24, 2013 9:05 am

Re: Refilling input buffer in ilclient empty buffer done cal

Thu Jun 19, 2014 6:58 pm

Hi, the empty_buffer_done callback does not tell you which buffer was emptied. All you know is that *a* buffer was emptied, so at least one empty buffer will be available. Using ilclient_get_input_buffer you can ask for an empty buffer.

Cromarty
Posts: 64
Joined: Thu Jan 03, 2013 5:03 pm
Location: Godalming, South-east UK
Contact: Website

Re: Refilling input buffer in ilclient empty buffer done cal

Thu Jun 19, 2014 9:15 pm

Thanks for a fast reply.

Does calling ilclient_get_input_buffer somehow remove the previously emptied buffer?

In other words, if I originally specified I wanted two buffers, when the callback is called and I make a call to ilclient_get_input_buffer, and then submit that buffer after filling it, are there still only two buffers? The first one having been removed or somehow re-initialized?

Mike
--
Michael Ray
Analyst/Programmer
Surrey, UK
4xB, 1xB+,
Creator and admin of:
raspberry-vi@freelists.org
Ham radio call: G4XBF
'Suddenly I am become death, destroyer of SD cards'

hjimbens
Posts: 78
Joined: Fri May 24, 2013 9:05 am

Re: Refilling input buffer in ilclient empty buffer done cal

Fri Jun 20, 2014 7:07 am

Yes, ilclient_get_input_buffer gets an empty buffer from the pool that you specified earlier. If all buffers are busy/non-empty the functions returns 0.

Cromarty
Posts: 64
Joined: Thu Jan 03, 2013 5:03 pm
Location: Godalming, South-east UK
Contact: Website

Re: Refilling input buffer in ilclient empty buffer done cal

Fri Jun 20, 2014 11:06 am

That's great. Thanks for your help.

Mike
--
Michael Ray
Analyst/Programmer
Surrey, UK
4xB, 1xB+,
Creator and admin of:
raspberry-vi@freelists.org
Ham radio call: G4XBF
'Suddenly I am become death, destroyer of SD cards'

Return to “OpenMAX”