Classes | Defines | Typedefs | Enumerations | Variables

Buffer Management

Classes

struct  OMX_BUFFERHEADERTYPE

Defines

#define OMX_BUFFERFLAG_EOS   0x00000001
#define OMX_BUFFERFLAG_STARTTIME   0x00000002
#define OMX_BUFFERFLAG_DECODEONLY   0x00000004
#define OMX_BUFFERFLAG_CODECCONFIG   0x00000080
#define OMX_UseBuffer(hComponent,ppBufferHdr,nPortIndex,pAppPrivate,nSizeBytes,pBuffer)
#define OMX_AllocateBuffer(hComponent,ppBuffer,nPortIndex,pAppPrivate,nSizeBytes)
#define OMX_FreeBuffer(hComponent,nPortIndex,pBuffer)
#define OMX_EmptyThisBuffer(hComponent,pBuffer)
#define OMX_FillThisBuffer(hComponent,pBuffer)
#define OMX_UseEGLImage(hComponent,ppBufferHdr,nPortIndex,pAppPrivate,eglImage)

Typedefs

typedef struct OMX_BUFFERHEADERTYPE OMX_BUFFERHEADERTYPE
typedef enum OMX_BUFFERSUPPLIERTYPE OMX_BUFFERSUPPLIERTYPE

Enumerations

enum  OMX_BUFFERSUPPLIERTYPE {
  OMX_BufferSupplyUnspecified = 0x0, OMX_BufferSupplyInput, OMX_BufferSupplyOutput, OMX_BufferSupplyKhronosExtensions = 0x6F000000,
  OMX_BufferSupplyVendorStartUnused = 0x7F000000, OMX_BufferSupplyMax = 0x7FFFFFFF
}

Variables

OMX_ERRORTYPE(* UseBuffer )(OMX_IN OMX_HANDLETYPE hComponent, OMX_INOUT OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes, OMX_IN OMX_U8 *pBuffer)
OMX_ERRORTYPE(* AllocateBuffer )(OMX_IN OMX_HANDLETYPE hComponent, OMX_INOUT OMX_BUFFERHEADERTYPE **ppBuffer, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes)
OMX_ERRORTYPE(* FreeBuffer )(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* EmptyThisBuffer )(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* FillThisBuffer )(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* UseEGLImage )(OMX_IN OMX_HANDLETYPE hComponent, OMX_INOUT OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_PTR pAppPrivate, OMX_IN void *eglImage)
OMX_ERRORTYPE(* EmptyBufferDone )(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_PTR pAppData, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* FillBufferDone )(OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)

Detailed Description

Buffer handling functions and structures


Define Documentation

#define OMX_AllocateBuffer (   hComponent,
  ppBuffer,
  nPortIndex,
  pAppPrivate,
  nSizeBytes 
)
Value:
((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer(       \
        hComponent,                                         \
        ppBuffer,                                           \
        nPortIndex,                                         \
        pAppPrivate,                                        \
        nSizeBytes)

The OMX_AllocateBuffer macro will request that the component allocate a new buffer and buffer header. The component will allocate the buffer and the buffer header and return a pointer to the buffer header. This is a blocking call.

The component should return from this call within 5 msec.

Parameters:
[in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function.
[out] ppBuffer pointer to an OMX_BUFFERHEADERTYPE structure used to receive the pointer to the buffer header
[in] nPortIndex nPortIndex is used to select the port on the component the buffer will be used with. The port can be found by using the nPortIndex value as an index into the Port Definition array of the component.
[in] pAppPrivate pAppPrivate is used to initialize the pAppPrivate member of the buffer header structure.
[in] nSizeBytes size of the buffer to allocate. Used when bAllocateNew is true.
Returns:
OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
#define OMX_BUFFERFLAG_CODECCONFIG   0x00000080

Codec Config Buffer Flag: OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an output port when all bytes in the buffer form part or all of a set of codec specific configuration data. Examples include SPS/PPS nal units for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for OMX_AUDIO_CodingAAC. Any component that for a given stream sets OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes with frame data in the same buffer, and shall send all buffers containing codec configuration bytes before any buffers containing frame data that those configurations bytes describe. If the stream format for a particular codec has a frame specific header at the start of each frame, for example OMX_AUDIO_CodingMP3 or OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as normal without setting OMX_BUFFERFLAG_CODECCONFIG.

#define OMX_BUFFERFLAG_DECODEONLY   0x00000004

Decode Only Buffer Flag:

The source of a stream (e.g. a demux component) sets the DECODEONLY flag on any buffer that should shall be decoded but should not be displayed. This flag is used, for instance, when a source seeks to a target interframe that requires the decode of frames preceding the target to facilitate the target's reconstruction. In this case the source would emit the frames preceding the target downstream but mark them as decode only.

The DECODEONLY is associated with buffer data and propagated in a manner identical to the buffer timestamp.

A component that renders data should ignore all buffers with the DECODEONLY flag set.

#define OMX_BUFFERFLAG_EOS   0x00000001

End of Stream Buffer Flag:

A component sets EOS when it has no more data to emit on a particular output port. Thus an output port shall set EOS on the last buffer it emits. A component's determination of when an output port should cease sending data is implemenation specific.

#define OMX_BUFFERFLAG_STARTTIME   0x00000002

Start Time Buffer Flag:

The source of a stream (e.g. a demux component) sets the STARTTIME flag on the buffer that contains the starting timestamp for the stream. The starting timestamp corresponds to the first data that should be displayed at startup or after a seek. The first timestamp of the stream is not necessarily the start time. For instance, in the case of a seek to a particular video frame, the target frame may be an interframe. Thus the first buffer of the stream will be the intra-frame preceding the target frame and the starttime will occur with the target frame (with any other required frames required to reconstruct the target intervening).

The STARTTIME flag is directly associated with the buffer's timestamp ' thus its association to buffer data and its propagation is identical to the timestamp's.

When a Sync Component client receives a buffer with the STARTTIME flag it shall perform a SetConfig on its sync port using OMX_ConfigTimeClientStartTime and passing the buffer's timestamp.

#define OMX_EmptyThisBuffer (   hComponent,
  pBuffer 
)
Value:
((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer(      \
        hComponent,                                         \
        pBuffer)

The OMX_EmptyThisBuffer macro will send a buffer full of data to an input port of a component. The buffer will be emptied by the component and returned to the application via the EmptyBufferDone call back. This is a non-blocking call in that the component will record the buffer and return immediately and then empty the buffer, later, at the proper time. As expected, this macro may be invoked only while the component is in the OMX_StateExecuting. If nPortIndex does not specify an input port, the component shall return an error.

The component should return from this call within 5 msec.

Parameters:
[in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function.
[in] pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer.
Returns:
OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
#define OMX_FillThisBuffer (   hComponent,
  pBuffer 
)
Value:
((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer(       \
        hComponent,                                         \
        pBuffer)

The OMX_FillThisBuffer macro will send an empty buffer to an output port of a component. The buffer will be filled by the component and returned to the application via the FillBufferDone call back. This is a non-blocking call in that the component will record the buffer and return immediately and then fill the buffer, later, at the proper time. As expected, this macro may be invoked only while the component is in the OMX_ExecutingState. If nPortIndex does not specify an output port, the component shall return an error.

The component should return from this call within 5 msec.

Parameters:
[in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function.
[in] pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer.
Returns:
OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
#define OMX_FreeBuffer (   hComponent,
  nPortIndex,
  pBuffer 
)
Value:
((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer(           \
        hComponent,                                         \
        nPortIndex,                                         \
        pBuffer)

The OMX_FreeBuffer macro will release a buffer header from the component which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If the component allocated the buffer (see the OMX_UseBuffer macro) then the component shall free the buffer and buffer header. This is a blocking call.

The component should return from this call within 20 msec.

Parameters:
[in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function.
[in] nPortIndex nPortIndex is used to select the port on the component the buffer will be used with.
[in] pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer.
Returns:
OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
#define OMX_UseBuffer (   hComponent,
  ppBufferHdr,
  nPortIndex,
  pAppPrivate,
  nSizeBytes,
  pBuffer 
)
Value:
((OMX_COMPONENTTYPE*)hComponent)->UseBuffer(            \
           hComponent,                                      \
           ppBufferHdr,                                     \
           nPortIndex,                                      \
           pAppPrivate,                                     \
           nSizeBytes,                                      \
           pBuffer)

The OMX_UseBuffer macro will request that the component use a buffer (and allocate its own buffer header) already allocated by another component, or by the IL Client. This is a blocking call.

The component should return from this call within 20 msec.

Parameters:
[in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function.
[out] ppBuffer pointer to an OMX_BUFFERHEADERTYPE structure used to receive the pointer to the buffer header
Returns:
OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
#define OMX_UseEGLImage (   hComponent,
  ppBufferHdr,
  nPortIndex,
  pAppPrivate,
  eglImage 
)
Value:
((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage(          \
           hComponent,                                      \
           ppBufferHdr,                                     \
           nPortIndex,                                      \
           pAppPrivate,                                     \
           eglImage)

The OMX_UseEGLImage macro will request that the component use a EGLImage provided by EGL (and allocate its own buffer header) This is a blocking call.

The component should return from this call within 20 msec.

Parameters:
[in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function.
[out] ppBuffer pointer to an OMX_BUFFERHEADERTYPE structure used to receive the pointer to the buffer header. Note that the memory location used for this buffer is NOT visible to the IL Client.
[in] nPortIndex nPortIndex is used to select the port on the component the buffer will be used with. The port can be found by using the nPortIndex value as an index into the Port Definition array of the component.
[in] pAppPrivate pAppPrivate is used to initialize the pAppPrivate member of the buffer header structure.
[in] eglImage eglImage contains the handle of the EGLImage to use as a buffer on the specified port. The component is expected to validate properties of the EGLImage against the configuration of the port to ensure the component can use the EGLImage as a buffer.
Returns:
OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.

Typedef Documentation

The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier preference when tunneling between two ports.


Enumeration Type Documentation

The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier preference when tunneling between two ports.

Enumerator:
OMX_BufferSupplyUnspecified 

port supplying the buffers is unspecified, or don't care

OMX_BufferSupplyInput 

input port supplies the buffers

OMX_BufferSupplyOutput 

output port supplies the buffers

OMX_BufferSupplyKhronosExtensions 

Reserved region for introducing Khronos Standard Extensions

OMX_BufferSupplyVendorStartUnused 

Reserved region for introducing Vendor Extensions

OMX_BufferSupplyMax 

Variable Documentation

OMX_ERRORTYPE(* AllocateBuffer)(OMX_IN OMX_HANDLETYPE hComponent, OMX_INOUT OMX_BUFFERHEADERTYPE **ppBuffer, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes) [inherited]

refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL specification for details on the AllocateBuffer method.

OMX_ERRORTYPE(* EmptyBufferDone)(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_PTR pAppData, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer) [inherited]

The EmptyBufferDone method is used to return emptied buffers from an input port back to the application for reuse. This is a blocking call so the application should not attempt to refill the buffers during this call, but should queue them and refill them in another thread. There is no error return, so the application shall handle any errors generated internally.

The application should return from this call within 5 msec.

Parameters:
hComponent handle of the component to access. This is the component handle returned by the call to the GetHandle function.
pAppData pointer to an application defined value that was provided in the pAppData parameter to the OMX_GetHandle method for the component. This application defined value is provided so that the application can have a component specific context when receiving the callback.
pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer indicating the buffer that was emptied.
OMX_ERRORTYPE(* EmptyThisBuffer)(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer) [inherited]

refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL specification for details on the EmptyThisBuffer method.

OMX_ERRORTYPE(* FillBufferDone)(OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer) [inherited]

The FillBufferDone method is used to return filled buffers from an output port back to the application for emptying and then reuse. This is a blocking call so the application should not attempt to empty the buffers during this call, but should queue the buffers and empty them in another thread. There is no error return, so the application shall handle any errors generated internally. The application shall also update the buffer header to indicate the number of bytes placed into the buffer.

The application should return from this call within 5 msec.

Parameters:
hComponent handle of the component to access. This is the component handle returned by the call to the GetHandle function.
pAppData pointer to an application defined value that was provided in the pAppData parameter to the OMX_GetHandle method for the component. This application defined value is provided so that the application can have a component specific context when receiving the callback.
pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer indicating the buffer that was filled.
OMX_ERRORTYPE(* FillThisBuffer)(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer) [inherited]

refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL specification for details on the FillThisBuffer method.

OMX_ERRORTYPE(* FreeBuffer)(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer) [inherited]

refer to OMX_FreeBuffer in OMX_core.h or the OMX IL specification for details on the FreeBuffer method.

OMX_ERRORTYPE(* UseBuffer)(OMX_IN OMX_HANDLETYPE hComponent, OMX_INOUT OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes, OMX_IN OMX_U8 *pBuffer) [inherited]

refer to OMX_UseBuffer in OMX_core.h or the OMX IL specification for details on the UseBuffer method.

OMX_ERRORTYPE(* UseEGLImage)(OMX_IN OMX_HANDLETYPE hComponent, OMX_INOUT OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_PTR pAppPrivate, OMX_IN void *eglImage) [inherited]
LIMOpenMAX Implementation API Reference - Generated by doxygen