Doubt on AllocateBuffer and UseBuffer

Hello All
I am having a doubt on AllocateBuffer and UseBuffer. The definition says that component shall return from AllocateBuffer function within 5milliseconds whereas it shall return from UseBuffer 20 milliseconds. Since AllocateBuffer has to allocate both buffer header and a buffer of specified size,AllocateBuffer function should be given more time than UseBuffer in which only allocation of buffer header is done. If I am wrong please correct me.
Regards
Subhish

Hi Subhish,

I think the reason for this is that allocate buffer would initialize from the beginning whereas usebuffer would be creating a new header and use the buffer of the another port(of other component) which depending on the component implementation might require changing its private data also. Also, if the components are setup using tunneling that those settings might have to be changed. Probably this is the reason.

Regards,
Pranav

Hello Pranav
Thanks for the reply. Can you please explain with a scenario as I am not able to understand it.
Regards
Subhish

Hello Pranav
Thanks for the reply. Can you please explain with a scenario as I am not able to understand it.
Regards
Subhish

Hi ,

Suppose the port is tunneled-with this if usebuffer is called, so you would be using the buffer of a tunnelled component.Now for this the non-supplier port will have to set its header according to that of the supplier port and may have to change its private data as well. I think the primary reason is that since you are using a buffer of another component/port, give more time since you are dependent on another component which is unlike Allocate buffer.

Cheers,
//Pranav

According to the IL 1.1 specification, AllocateBuffer is only used to allocate buffers which are used for communication between the IL client and a component.

UseBuffer on the other hand can be used to allocate buffers which are used for communication between tunneled components. So if you call UseBuffer on component “A”'s output port, which is connected to component “B”'s input port, then “A”'s UseBuffer call may further call UseBuffer on “B” and so this will take longer. Furthermore, if buffer sharing is enabled on “B” then B will take longer to process this request.

All time references within the specification are referenced as “Should” and not “Shall”.

The specification defines “Should” as :

The stated functionality is not a requirement for an implementation of the
OpenMAX IL API but is recommended or is a good practice. Should is
usually used as follows: “The component should begin processing buffers
immediately after it transitions to the OMX_StateExecuting state.” While
this is good practice, there may be a valid reason to delay processing buffers,
such as not having input data available.

As has been said, the specification uses “should”, i.e. a recommendation. Conformant components may take longer.

AllocateBuffer is only used in base profile i.e. a single component being used by an IL client. UseBuffer can be used in tunnelled IL chains. Here the buffer may be shared by the component along the IL chain, so this has a higher expected time upper-bound.

Thanks,

Roger