PDA

View Full Version : Doubt on AllocateBuffer and UseBuffer



maks78in
09-03-2007, 05:33 AM
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

mpranav
09-05-2007, 12:00 AM
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

maks78in
09-05-2007, 08:44 AM
Hello Pranav
Thanks for the reply. Can you please explain with a scenario as I am not able to understand it.
Regards
Subhish

maks78in
09-05-2007, 08:45 AM
Hello Pranav
Thanks for the reply. Can you please explain with a scenario as I am not able to understand it.
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

mpranav
09-23-2007, 10:29 PM
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

fakhir
09-24-2007, 09:33 PM
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.

tlongo
10-03-2007, 06:14 AM
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.

rnixon
05-13-2008, 10:13 AM
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.

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