Buffer Allocation

After the component is configured, the next step is to allocate the buffers. Hardware components use physical memory for output buffers to interface with the VPU, so the client uses the AllocateBuffer model for the port.

  1. To allocate the buffer, the components are moved from the Loaded state to the Idle state as (1) in the following diagram.
  2. On the input port, the client can use either OMX_UseBuffer or OMX_AllocateBuffer calls to the OMX component as (2) in the following diagram. The component is called for the number of input buffers in a loop.
  3. On the output port, the client can use either OMX_UseBuffer or OMX_AllocateBuffer calls to the OMX component as (4) in the following diagram. The component is called for the number of input buffers in a loop
  4. Once the buffers are successfully allocated on the input and output ports, the OMX components generate the OMX_EventCmdComplete event for the Loaded-to-Idle state transition and send it to the client using EventHandlerCallback as (6) in the following diagram.

The following diagram shows the buffer allocation workflow.

Figure 1. Buffer Allocation Workflow