PDA

View Full Version : Confused about when OMX_AllocateBuffer should be called?



guoyin.chen
10-21-2008, 08:19 PM
Dear Friends,

I am confused about whether compoent's OMX_AllocateBuffer should be called in non-tunneled.

In IL 1.2 spec:
For a port connected to the IL client, the IL client may allocate the buffers itself and then pass them to the port via an OMX_UseBuffer call on the port, or it may direct the port to perform the allocation via an OMX_AllocateBuffer call on the port. For each port, the IL client shall exclusively use OMX_UseBuffer or OMX_AllocateBuffer.

How IL client to decied it should allocate the buffers itself or it should use compenent's OMX_AllocateBuffer? Is OMX_AllocateBuffer should be supported by all component? Is any component like video decoder which just just want it reuse the buffer from other components(like demuxer and video sink) or client?

Thanks

rnixon
10-22-2008, 09:24 AM
I am confused about whether compoent's OMX_AllocateBuffer should be called in non-tunneled.OMX_AllocateBuffer can only be used in non-tunnelled communication, i.e. it may only be called by the IL client on a port that is not tunnelled with other components.

In this type of communication (sometimes, slightly incorrectly, referred to as "base profile" communication), the IL client is always the buffer supplier. It choses to use OMX_UseBuffer or OMX_AllocateBuffer (one choice for all buffers on a port).

How IL client to decied it should allocate the buffers itself or it should use compenent's OMX_AllocateBuffer?If the IL client is able to use component-allocated buffers without any overhead (e.g. extra copies), then it should (by using OMX_AllocateBuffer). If it can't, then it may want to allocate the buffers itself. The optimal decision will depend upon which (IL client or component) takes the biggest hit when not allocating buffers itself.

Is OMX_AllocateBuffer should be supported by all component?Yes.

guoyin.chen
10-22-2008, 07:01 PM
Thanks for your reply!

If the IL client is able to use component-allocated buffers without any overhead (e.g. extra copies), then it should (by using OMX_AllocateBuffer). If it can't, then it may want to allocate the buffers itself. The optimal decision will depend upon which (IL client or component) takes the biggest hit when not allocating buffers itself.

Still, one question is How client knows which one is the biggest hit? The compoent looks like a black box to client. Client dont know which one is best for compent. And there is not way for compoent to tell Client that the component perfer using OMX_AllocateBuffer or letting client allocating the buffers. So does all this depend on client code?


Best Regards

rnixon
10-24-2008, 08:59 AM
Still, one question is How client knows which one is the biggest hit?In general, it doesn't. If you want optimal performance, then you need to code some platform / component-specific knowledge into your client.

Thanks,

Roger