Buffer Management


Data Structures

struct  OMX_BUFFERHEADERTYPE

Defines

#define OMX_BUFFERFLAG_EOS   0x00000001
#define OMX_BUFFERFLAG_STARTTIME   0x00000002
#define OMX_BUFFERFLAG_DECODEONLY   0x00000004
#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)

Enumerations

enum  OMX_BUFFERSUPPLIERTYPE { OMX_BufferSupplyUnspecified = 0x0, OMX_BufferSupplyInput, OMX_BufferSupplyOutput, OMX_BufferSupplyMax = 0x7FFFFFFF }

Variables

OMX_ERRORTYPE(* OMX_COMPONENTTYPE::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(* OMX_COMPONENTTYPE::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(* OMX_COMPONENTTYPE::FreeBuffer )(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* OMX_COMPONENTTYPE::EmptyThisBuffer )(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* OMX_COMPONENTTYPE::FillThisBuffer )(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* OMX_COMPONENTTYPE::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(* OMX_CALLBACKTYPE::EmptyBufferDone )(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_PTR pAppData, OMX_IN OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE(* OMX_CALLBACKTYPE::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_NoError. Otherwise the appropriate OMX error will be returned.

Definition at line 992 of file OMX_Core.h.

Referenced by main(), and videodecEventHandler().

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

Definition at line 343 of file OMX_Core.h.

#define OMX_BUFFERFLAG_EOS   0x00000001

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

Definition at line 320 of file OMX_Core.h.

Referenced by camera_sourceFillBufferDone().

#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_ExecutingState. 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_NoError. Otherwise the appropriate OMX error will be returned.

Definition at line 1057 of file OMX_Core.h.

Referenced by audiodecEmptyBufferDone(), audiodecFillBufferDone(), audiomixerEmptyBufferDone(), audiomixerFillBufferDone(), audiosrcFillBufferDone(), colorconvFillBufferDone(), filereaderFillBufferDone(), main(), parser3gpFillBufferDone(), videodecEmptyBufferDone(), videodecFillBufferDone(), videoencEmptyBufferDone(), videosrcFillBufferDone(), volcEmptyBufferDone(), and volumeFillBufferDone().

#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_NoError. Otherwise the appropriate OMX error will be returned.

Definition at line 1087 of file OMX_Core.h.

Referenced by alsasinkEmptyBufferDone(), audiodecEmptyBufferDone(), audiodecFillBufferDone(), audiomixerFillBufferDone(), audiosinkEmptyBufferDone(), audiosrcFillBufferDone(), camera_sourceFillBufferDone(), colorconvEmptyBufferDone(), colorconvFillBufferDone(), fb_sinkEmptyBufferDone(), main(), videodecEmptyBufferDone(), videodecEventHandler(), videodecFillBufferDone(), videoencEmptyBufferDone(), videoencFillBufferDone(), videosrcFillBufferDone(), volcFillBufferDone(), volumeEmptyBufferDone(), and volumeFillBufferDone().

#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_NoError. Otherwise the appropriate OMX error will be returned.

Definition at line 1026 of file OMX_Core.h.

Referenced by audiodecEventHandler(), base_port_FreeTunnelBuffer(), main(), and videosrc_port_FreeTunnelBuffer().

#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_NoError. Otherwise the appropriate OMX error will be returned.

Definition at line 950 of file OMX_Core.h.

Referenced by audiodecEventHandler(), base_port_AllocateTunnelBuffer(), main(), videodecEventHandler(), and videosrc_port_AllocateTunnelBuffer().

#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_NoError. Otherwise the appropriate OMX error will be returned.

Definition at line 1129 of file OMX_Core.h.


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_BufferSupplyMax 

Definition at line 561 of file OMX_Core.h.


Variable Documentation

OMX_ERRORTYPE(* OMX_COMPONENTTYPE::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.

Referenced by omx_base_component_Constructor().

OMX_ERRORTYPE(* OMX_CALLBACKTYPE::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.

Referenced by main(), and omx_base_component_SetCallbacks().

OMX_ERRORTYPE(* OMX_COMPONENTTYPE::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.

Referenced by omx_base_component_Constructor().

OMX_ERRORTYPE(* OMX_CALLBACKTYPE::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.

Referenced by main(), and omx_base_component_SetCallbacks().

OMX_ERRORTYPE(* OMX_COMPONENTTYPE::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.

Referenced by omx_base_component_Constructor().

OMX_ERRORTYPE(* OMX_COMPONENTTYPE::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.

Referenced by omx_base_component_Constructor().

OMX_ERRORTYPE(* OMX_COMPONENTTYPE::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.

Referenced by omx_base_component_Constructor().

OMX_ERRORTYPE(* OMX_COMPONENTTYPE::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]


Generated for OpenMAX Bellagio rel. 0.3.5-svn by  doxygen 1.5.1
SourceForge.net Logo