Classes | Defines | Enumerations | Functions

limoi base internals
[LIM integration layer base]

Classes

struct  limoi_audio_renderer_priv_t
struct  limoi_audio_decoder_priv_t
struct  limoi_audio_encoder_priv_t
struct  limoi_role_t
struct  limoi_param_config_t
struct  limoi_component_client_event_t
struct  limoi_port_buffer_t
struct  LIMOX_PARAM_BUFFERSHAREPOLICY
struct  limoi_port_t
struct  limoi_component_priv_t
struct  limoi_demuxer_priv_t
struct  limoi_muxer_priv_t
struct  limoi_video_renderer_priv_t
struct  limoi_video_scheduler_priv_t
struct  limoi_video_decoder_priv_t
struct  limoi_video_encoder_priv_t

Defines

#define LIMOI_COMPONENT_PORT_BUF_Q_MAX   256
#define COMP_MAIN_THREAD_BUSY   0x0001
#define COMP_SUB_THREAD_BUSY   0x0002
#define COMP_BUFFER_CONSUMING_BUSY   0x0004
#define LIMOI_COMPONENT_PRIV(hComp)   (*LIMOI_COMPONENT(hComp))
#define LIMOI_PORTDEF(p)
#define LIMOI_BUF_SUPPLIER(p)

Enumerations

enum  LIMOX_BUFFERSHARETYPE { LIMOX_BufferShareDisabled, LIMOX_BufferShareSupplier, LIMOX_BufferShareConsumer }

Functions

int buffer_share_validate_policy (OMX_HANDLETYPE hComp, OMX_U32 nPortIndex)
int buffer_share_is_supplier (OMX_HANDLETYPE hComp, limoi_port_t *limoi_port)
void * buffer_share_get_supplier_buffer (OMX_HANDLETYPE hComp, limoi_port_t *limoi_port, int index)
int buffer_share_get_buffer_count_size (OMX_HANDLETYPE hComp, limoi_port_t *limoi_port, OMX_U32 *count, OMX_U32 *bytes)
int buffer_share_set_buffer_count_size (OMX_HANDLETYPE hComp, limoi_port_t *limoi_port, OMX_U32 count, OMX_U32 bytes)
int buffer_share_pool_in (OMX_HANDLETYPE hComp, limoi_port_t *in_port, limoi_port_t *out_port, OMX_BUFFERHEADERTYPE **in_buf_header, OMX_BUFFERHEADERTYPE *out_buf_header)
int buffer_share_pool_out (OMX_HANDLETYPE hComp, limoi_port_t *out_port, OMX_BUFFERHEADERTYPE *out_buf_header)
static int tunnel_is_supplier (limoi_port_t *limoi_port)
static int tunnel_is_allocator (OMX_HANDLETYPE hComp, limoi_port_t *limoi_port)
void param_release (list_t *params_list_head)
OMX_ERRORTYPE param_allocate_and_set (OMX_INDEXTYPE nIndex, void *param, int bytes, list_t *params_list_head)
void event_deliver (OMX_HANDLETYPE hComp, OMX_EVENTTYPE eEvent, OMX_U32 nData1, OMX_U32 nData2, OMX_PTR pEventData)
void event_deliver_real (OMX_HANDLETYPE hComp)
OMX_ERRORTYPE sync_consume_buffers (OMX_HANDLETYPE hComp)
void * thread_main_handle (void *arg)
int command_interface_init (OMX_HANDLETYPE hComp)
void command_interface_deinit (OMX_HANDLETYPE hComp)
OMX_ERRORTYPE command_callback (limoi_component_priv_t *base, limoi_component_cmd_t *cmd, int prep)
void role_release (list_t *roles_list_head)
void port_release (list_t *ports_list_head, OMX_HANDLETYPE hComp)
void port_disable (limoi_component_cmd_t *cmd)
void port_enable (limoi_component_cmd_t *cmd)
void port_flush (limoi_component_cmd_t *cmd)
OMX_ERRORTYPE port_activate_buffer_all (OMX_HANDLETYPE hComp)
OMX_ERRORTYPE port_deactivate_buffer_all (OMX_HANDLETYPE hComp)
OMX_ERRORTYPE port_free_buffer_all (OMX_HANDLETYPE hComp)
void port_disable_now (OMX_HANDLETYPE hComp, OMX_U32 nPortIndex)
int port_allocate_buffer (OMX_HANDLETYPE hComp, limoi_port_t *limoi_port)
OMX_ERRORTYPE state_set (limoi_component_cmd_t *cmd)
OMX_ERRORTYPE omx_send_command (OMX_HANDLETYPE hComponent, OMX_COMMANDTYPE Cmd, OMX_U32 nParam1, OMX_PTR pCmdData)
OMX_ERRORTYPE omx_component_role_enum (OMX_HANDLETYPE hComponent, OMX_U8 *cRole, OMX_U32 nIndex)
OMX_ERRORTYPE omx_get_parameter (OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nParamIndex, OMX_PTR pComponentParameterStructure)
OMX_ERRORTYPE omx_set_parameter (OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentParameterStructure)
OMX_ERRORTYPE omx_get_config (OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE omx_set_config (OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE omx_get_component_version (OMX_HANDLETYPE hComponent, OMX_STRING pComponentName, OMX_VERSIONTYPE *pComponentVersion, OMX_VERSIONTYPE *pSpecVersion, OMX_UUIDTYPE *pComponentUUID)
OMX_ERRORTYPE omx_set_callbacks (OMX_HANDLETYPE hComponent, OMX_CALLBACKTYPE *pCallbacks, OMX_PTR pAppData)
OMX_ERRORTYPE omx_use_buffer (OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes, OMX_U8 *pBuffer)
OMX_ERRORTYPE omx_allocate_buffer (OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE **ppBuffer, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes)
OMX_ERRORTYPE omx_free_buffer (OMX_HANDLETYPE hComponent, OMX_U32 nPortIndex, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE omx_empty_this_buffer (OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE omx_fill_this_buffer (OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE omx_get_state (OMX_HANDLETYPE hComponent, OMX_STATETYPE *pState)
OMX_ERRORTYPE omx_component_tunnel_request (OMX_HANDLETYPE hComp, OMX_U32 nPort, OMX_HANDLETYPE hTunneledComp, OMX_U32 nTunneledPort, OMX_TUNNELSETUPTYPE *pTunnelSetup)

Detailed Description

limoi base component class internal implementations.


Define Documentation

#define COMP_BUFFER_CONSUMING_BUSY   0x0004
#define COMP_MAIN_THREAD_BUSY   0x0001

component busy status bit flags.

#define COMP_SUB_THREAD_BUSY   0x0002
#define LIMOI_BUF_SUPPLIER (   p  ) 
Value:
((OMX_PARAM_BUFFERSUPPLIERTYPE *)         \
                               (((limoi_param_config_t *)               \
                                 ((p)->params_list_head.prev->prev))    \
                                ->param_config))

port buffer supplier type parameter helper. shortcut helper for efficient port supplier type parameter access, API can be used only when port is added by limoi_component_add_port(). API does not implement any lock mechanism internally, it is the caller's responsibility to properly aquire component lock.

#define LIMOI_COMPONENT_PORT_BUF_Q_MAX   256

limoi component port buffer queue max number of entries.

#define LIMOI_COMPONENT_PRIV (   hComp  )     (*LIMOI_COMPONENT(hComp))
#define LIMOI_PORTDEF (   p  ) 
Value:
((OMX_PARAM_PORTDEFINITIONTYPE *)              \
                          (((limoi_param_config_t *)                    \
                            ((p)->params_list_head.prev))               \
                           ->param_config))

port definition parameter helper. shortcut helper for efficient port definition parameter access, API can be used only when port is added by limoi_component_add_port(). API does not implement any lock mechanism internally, it is the caller's responsibility to properly aquire component lock.


Enumeration Type Documentation

limoi component port buffer sharing type.

Enumerator:
LIMOX_BufferShareDisabled 
LIMOX_BufferShareSupplier 
LIMOX_BufferShareConsumer 

Function Documentation

int buffer_share_get_buffer_count_size ( OMX_HANDLETYPE  hComp,
limoi_port_t limoi_port,
OMX_U32 *  count,
OMX_U32 *  bytes 
)

get minimum buffer count and size in bytes of given port. check will go through entire tunnel and share chain when available. caller must not hold any mutex, as this may require tunnel component access.

Returns:
0 on success, -1 on error.
void* buffer_share_get_supplier_buffer ( OMX_HANDLETYPE  hComp,
limoi_port_t limoi_port,
int  index 
)

get supplier port buffer by index. caller must hold port mutex. caller must have made sure calling port is a consumer.

Parameters:
index port buffer index.
Returns:
current port buffer on success, NULL otherwise.
int buffer_share_is_supplier ( OMX_HANDLETYPE  hComp,
limoi_port_t limoi_port 
)

check whether port is a buffer share supplier.

int buffer_share_pool_in ( OMX_HANDLETYPE  hComp,
limoi_port_t in_port,
limoi_port_t out_port,
OMX_BUFFERHEADERTYPE **  in_buf_header,
OMX_BUFFERHEADERTYPE out_buf_header 
)

add buffer sharing request to request pool caller must hold base->mutex

Returns:
0 if successful, -1 if error.
int buffer_share_pool_out ( OMX_HANDLETYPE  hComp,
limoi_port_t out_port,
OMX_BUFFERHEADERTYPE out_buf_header 
)

retrieve and release buffer sharing request from request pool. caller must hold base->mutex

note that buffer header is dereferenced, because FillThisBuffer API does not carry the implementation specific queue info.

Returns:
0 if matching found, 1 if no matching found, -1 otherwise.
int buffer_share_set_buffer_count_size ( OMX_HANDLETYPE  hComp,
limoi_port_t limoi_port,
OMX_U32  count,
OMX_U32  bytes 
)

set minimum buffer count and size in bytes of given port. check will go through entire tunnel and share chain when available. caller must not hold any mutex, as this may require tunnel component access.

Returns:
0 on success, -1 on error.
int buffer_share_validate_policy ( OMX_HANDLETYPE  hComp,
OMX_U32  nPortIndex 
)

validate component buffer share policy. called upon tunnel setup on per port basis, by default buffer share policy is turned off for base profile (non-tunneled) component.

Returns:
0 on success, -1 on failure.
OMX_ERRORTYPE command_callback ( limoi_component_priv_t base,
limoi_component_cmd_t cmd,
int  prep 
)

component command callback wrapper caller must not hold base->mutex

void command_interface_deinit ( OMX_HANDLETYPE  hComp  ) 
int command_interface_init ( OMX_HANDLETYPE  hComp  ) 

command interface initialization.

Returns:
0 if successful,-1 otherwise.
void event_deliver ( OMX_HANDLETYPE  hComp,
OMX_EVENTTYPE  eEvent,
OMX_U32  nData1,
OMX_U32  nData2,
OMX_PTR  pEventData 
)

queue up client event into internal event buffer queue. caller should not hold any mutex.

void event_deliver_real ( OMX_HANDLETYPE  hComp  ) 

consume internal event buffer and deliver event back to client. caller should not hold any mutex.

OMX_ERRORTYPE omx_allocate_buffer ( OMX_HANDLETYPE  hComponent,
OMX_BUFFERHEADERTYPE **  ppBuffer,
OMX_U32  nPortIndex,
OMX_PTR  pAppPrivate,
OMX_U32  nSizeBytes 
)
OMX_ERRORTYPE omx_component_role_enum ( OMX_HANDLETYPE  hComponent,
OMX_U8 *  cRole,
OMX_U32  nIndex 
)
OMX_ERRORTYPE omx_component_tunnel_request ( OMX_HANDLETYPE  hComp,
OMX_U32  nPort,
OMX_HANDLETYPE  hTunneledComp,
OMX_U32  nTunneledPort,
OMX_TUNNELSETUPTYPE pTunnelSetup 
)
OMX_ERRORTYPE omx_empty_this_buffer ( OMX_HANDLETYPE  hComponent,
OMX_BUFFERHEADERTYPE pBuffer 
)
OMX_ERRORTYPE omx_fill_this_buffer ( OMX_HANDLETYPE  hComponent,
OMX_BUFFERHEADERTYPE pBuffer 
)
OMX_ERRORTYPE omx_free_buffer ( OMX_HANDLETYPE  hComponent,
OMX_U32  nPortIndex,
OMX_BUFFERHEADERTYPE pBuffer 
)
OMX_ERRORTYPE omx_get_component_version ( OMX_HANDLETYPE  hComponent,
OMX_STRING  pComponentName,
OMX_VERSIONTYPE pComponentVersion,
OMX_VERSIONTYPE pSpecVersion,
OMX_UUIDTYPE *  pComponentUUID 
)
OMX_ERRORTYPE omx_get_config ( OMX_HANDLETYPE  hComponent,
OMX_INDEXTYPE  nIndex,
OMX_PTR  pComponentConfigStructure 
)
OMX_ERRORTYPE omx_get_parameter ( OMX_HANDLETYPE  hComponent,
OMX_INDEXTYPE  nParamIndex,
OMX_PTR  pComponentParameterStructure 
)
OMX_ERRORTYPE omx_get_state ( OMX_HANDLETYPE  hComponent,
OMX_STATETYPE pState 
)
OMX_ERRORTYPE omx_send_command ( OMX_HANDLETYPE  hComponent,
OMX_COMMANDTYPE  Cmd,
OMX_U32  nParam1,
OMX_PTR  pCmdData 
)
OMX_ERRORTYPE omx_set_callbacks ( OMX_HANDLETYPE  hComponent,
OMX_CALLBACKTYPE pCallbacks,
OMX_PTR  pAppData 
)
OMX_ERRORTYPE omx_set_config ( OMX_HANDLETYPE  hComponent,
OMX_INDEXTYPE  nIndex,
OMX_PTR  pComponentConfigStructure 
)
OMX_ERRORTYPE omx_set_parameter ( OMX_HANDLETYPE  hComponent,
OMX_INDEXTYPE  nIndex,
OMX_PTR  pComponentParameterStructure 
)
OMX_ERRORTYPE omx_use_buffer ( OMX_HANDLETYPE  hComponent,
OMX_BUFFERHEADERTYPE **  ppBufferHdr,
OMX_U32  nPortIndex,
OMX_PTR  pAppPrivate,
OMX_U32  nSizeBytes,
OMX_U8 *  pBuffer 
)
OMX_ERRORTYPE param_allocate_and_set ( OMX_INDEXTYPE  nIndex,
void *  param,
int  bytes,
list_t params_list_head 
)

allocate and set component parameter.

void param_release ( list_t params_list_head  ) 

release all component or port parameter entries.

OMX_ERRORTYPE port_activate_buffer_all ( OMX_HANDLETYPE  hComp  ) 

activate all component ports and their buffers. caller must hold base->mutex.

int port_allocate_buffer ( OMX_HANDLETYPE  hComp,
limoi_port_t limoi_port 
)

allocate port buffer. allocate port buffers per port definition, populating. buffers do not belong to any bufq yet. caller should not hold any mutext.

Returns:
0 if successful, -1 otherwise.
OMX_ERRORTYPE port_deactivate_buffer_all ( OMX_HANDLETYPE  hComp  ) 

deactivate all component ports and their buffers. caller must hold base->mutex.

void port_disable ( limoi_component_cmd_t cmd  ) 

disable component port and release all port resources. caller should not hold any mutex.

void port_disable_now ( OMX_HANDLETYPE  hComp,
OMX_U32  nPortIndex 
)

immediately respond to port disable command. set bPortDisabled right away. caller must hold base->mutex.

void port_enable ( limoi_component_cmd_t cmd  ) 

enable component port and allocate all port resources. caller should not hold any mutex.

void port_flush ( limoi_component_cmd_t cmd  ) 

release all port buffers. caller should not hold any mutex.

OMX_ERRORTYPE port_free_buffer_all ( OMX_HANDLETYPE  hComp  ) 

free all component ports and their buffers. caller must hold base->mutex.

void port_release ( list_t ports_list_head,
OMX_HANDLETYPE  hComp 
)

release all port entries from component.

void role_release ( list_t roles_list_head  ) 
OMX_ERRORTYPE state_set ( limoi_component_cmd_t cmd  ) 

component state set command handler. caller should not hold any mutex.

OMX_ERRORTYPE sync_consume_buffers ( OMX_HANDLETYPE  hComp  ) 

synchronously consume component port buffers.

void* thread_main_handle ( void *  arg  ) 

component main thread handler.

static int tunnel_is_allocator ( OMX_HANDLETYPE  hComp,
limoi_port_t limoi_port 
) [inline, static]
static int tunnel_is_supplier ( limoi_port_t limoi_port  )  [inline, static]
LIMOpenMAX Implementation API Reference - Generated by doxygen