Confused about when OMX_AllocateBuffer should be called?

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

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).

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.

Yes.

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

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