Classes | Defines | Typedefs | Functions

limoi base core
[LIM integration layer base]

Classes

struct  limoi_buffer_share_policy_t
struct  limoi_component_cmd_t
struct  limoi_component_callbacks_t

Defines

#define LIMOI_MUXER_AUDIO_INPUT_BUFFER_NUM   64
#define LIMOI_MUXER_AUDIO_INPUT_BUFFER_BYTES   (1024 * 4)
#define LIMOI_MUXER_VIDEO_INPUT_BUFFER_NUM   64
#define LIMOI_MUXER_VIDEO_INPUT_BUFFER_BYTES   (1024 * 8)
#define LIMOI_VIDEO_ENCODER_INPUT_BUFFER_NUM   4
#define LIMOI_VIDEO_ENCODER_INPUT_BUFFER_BYTES   (352 * 288 + 352 * 288 / 2)
#define LIMOI_VIDEO_ENCODER_OUTPUT_BUFFER_NUM   4
#define LIMOI_VIDEO_ENCODER_OUTPUT_BUFFER_BYTES   (1024 * 8)
#define LIMOI_AUDIO_ENCODER_INPUT_BUFFER_NUM   4
#define LIMOI_AUDIO_ENCODER_INPUT_BUFFER_BYTES   (1024 * 192)
#define LIMOI_AUDIO_ENCODER_OUTPUT_BUFFER_NUM   4
#define LIMOI_AUDIO_ENCODER_OUTPUT_BUFFER_BYTES   (1024 * 32)
#define LIMOI_DEMUXER_AUDIO_OUTPUT_BUFFER_NUM   64
#define LIMOI_DEMUXER_AUDIO_OUTPUT_BUFFER_BYTES   (1024 * 4)
#define LIMOI_DEMUXER_VIDEO_OUTPUT_BUFFER_NUM   64
#define LIMOI_DEMUXER_VIDEO_OUTPUT_BUFFER_BYTES   (1024 * 8)
#define LIMOI_VIDEO_DECODER_INPUT_BUFFER_NUM   4
#define LIMOI_VIDEO_DECODER_INPUT_BUFFER_BYTES   (1024 * 8)
#define LIMOI_VIDEO_DECODER_OUTPUT_BUFFER_NUM   4
#define LIMOI_VIDEO_DECODER_OUTPUT_BUFFER_BYTES   (352 * 288 + 352 * 288 / 2)
#define LIMOI_AUDIO_DECODER_INPUT_BUFFER_NUM   4
#define LIMOI_AUDIO_DECODER_INPUT_BUFFER_BYTES   (1024 * 4)
#define LIMOI_AUDIO_DECODER_OUTPUT_BUFFER_NUM   4
#define LIMOI_AUDIO_DECODER_OUTPUT_BUFFER_BYTES   (1024 * 192)
#define LIMOI_MAX_CLOCK_PORTS   8
#define LIMOI_MAX_CLOCK_PORT_BUFFERS   8
#define LIMOI_URI_MAX_LENGTH   4096
#define LIMOI_COMPONENT_CMD_Q_DEPTH_MAX   128
#define LIMOI_COMPONENT_CLIENT_EVENT_SET_DEPTH_MAX   64
#define LIMOI_PRELOAD_BUFFER_COUNT   2
#define LIMOI_BUFFER_SHARING_POOL_MAX   8
#define LIMOI_BUFFER_SHARING_PAIRS_MAX   8
#define OMX_COMPONENT(hComp)   (((OMX_COMPONENTTYPE *)(hComp))->pComponentPrivate)
#define LIMOI_COMPONENT(hComp)   ((limoi_component_t *)OMX_COMPONENT(hComp))

Typedefs

typedef struct limoi_port_t limoi_port_t
typedef struct
limoi_component_priv_t 
limoi_component_priv_t
typedef struct
limoi_component_priv_t
limoi_component_t
typedef int(* limoi_resource_preempt_cb_t )(int manager_id, int resource_id, OMX_HANDLETYPE hComp)
typedef void(* limoi_resource_notify_cb_t )(int manager_id, int resource_id, int status, OMX_HANDLETYPE hComp)

Functions

OMX_ERRORTYPE limoi_component_init (OMX_HANDLETYPE *hComp, int bytes)
OMX_ERRORTYPE limoi_component_init_sync (OMX_HANDLETYPE *hComp, int bytes)
OMX_ERRORTYPE limoi_component_set_buffer_share_policy (OMX_HANDLETYPE hComp, const limoi_buffer_share_policy_t *policy)
OMX_ERRORTYPE limoi_component_deinit (OMX_HANDLETYPE hComp)
OMX_STATETYPE limoi_component_state (OMX_HANDLETYPE hComp)
void limoi_component_lock (OMX_HANDLETYPE hComp)
void limoi_component_unlock (OMX_HANDLETYPE hComp)
void limoi_component_cond_broadcast (OMX_HANDLETYPE hComp)
int limoi_component_cond_timedwait (OMX_HANDLETYPE hComp, int miliseconds)
int limoi_component_set_callbacks (OMX_HANDLETYPE hComp, limoi_component_callbacks_t *callbacks)
int limoi_component_set_name_version (OMX_HANDLETYPE hComp, const char *name, const char *version)
int limoi_component_add_role (OMX_HANDLETYPE hComp, const char *role)
OMX_ERRORTYPE limoi_component_get_current_role (OMX_HANDLETYPE hComp, char *role)
int limoi_component_add_port (OMX_HANDLETYPE hComp, const OMX_PARAM_PORTDEFINITIONTYPE *port)
limoi_port_tlimoi_component_get_port (OMX_HANDLETYPE hComponent, OMX_U32 nPortIndex)
OMX_ERRORTYPE limoi_component_get_parameter (OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentParameterStructure)
OMX_ERRORTYPE limoi_component_set_parameter (OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentParameterStructure)
OMX_PARAM_PORTDEFINITIONTYPElimoi_component_get_port_definition (limoi_port_t *port)
OMX_PARAM_BUFFERSUPPLIERTYPElimoi_component_get_port_buffer_supplier (limoi_port_t *port)
int limoi_component_port_buffer_share_enabled (limoi_port_t *port)
OMX_BUFFERHEADERTYPE ** limoi_component_get_port_buffer (OMX_HANDLETYPE hComp, limoi_port_t *limoi_port, int timeout)
int limoi_component_realloc_port_buffer (OMX_HANDLETYPE hComp, limoi_port_t *limoi_port, OMX_BUFFERHEADERTYPE *buf_header, int bytes)
int limoi_component_hold_port_buffer (OMX_HANDLETYPE hComp, limoi_port_t *limoi_port, OMX_BUFFERHEADERTYPE **buf_header)
int limoi_component_release_port_buffer (OMX_HANDLETYPE hComp, limoi_port_t *limoi_port, OMX_BUFFERHEADERTYPE **buf_header)
int limoi_component_put_port_buffer (OMX_HANDLETYPE hComp, limoi_port_t *limoi_port, OMX_BUFFERHEADERTYPE **buf_header)
int limoi_component_share_port_buffer (OMX_HANDLETYPE hComp, limoi_port_t *in_port, limoi_port_t *out_port, OMX_BUFFERHEADERTYPE **in_buf_header, OMX_BUFFERHEADERTYPE *out_buf_header)
void limoi_component_deliver_event (OMX_HANDLETYPE hComp, OMX_EVENTTYPE eEvent, OMX_U32 nData1, OMX_U32 nData2, OMX_PTR pEventData)
void limoi_component_goto_invalid_state (OMX_HANDLETYPE hComp)
void * limoi_resource_acquire (int manager_id, int resource_id, limoi_resource_preempt_cb_t preempt, OMX_HANDLETYPE hComp)
int limoi_resource_release (int manager_id, int resource_id, OMX_HANDLETYPE hComp)
int limoi_resource_wait (int manager_id, int resource_id, OMX_HANDLETYPE hComp, limoi_resource_notify_cb_t notify)
int limoi_resource_cancel_wait (int manager_id, int resource_id, OMX_HANDLETYPE hComp)

Detailed Description

limoi base component root class that all LIM components inherit.

component mutex policy

to prevent system deadlock, if needed, mutex must be acquired in the following order, base->port->other (component subclass ones for example)


Define Documentation

#define LIMOI_AUDIO_DECODER_INPUT_BUFFER_BYTES   (1024 * 4)
#define LIMOI_AUDIO_DECODER_INPUT_BUFFER_NUM   4
#define LIMOI_AUDIO_DECODER_OUTPUT_BUFFER_BYTES   (1024 * 192)
#define LIMOI_AUDIO_DECODER_OUTPUT_BUFFER_NUM   4
#define LIMOI_AUDIO_ENCODER_INPUT_BUFFER_BYTES   (1024 * 192)
#define LIMOI_AUDIO_ENCODER_INPUT_BUFFER_NUM   4
#define LIMOI_AUDIO_ENCODER_OUTPUT_BUFFER_BYTES   (1024 * 32)
#define LIMOI_AUDIO_ENCODER_OUTPUT_BUFFER_NUM   4
#define LIMOI_BUFFER_SHARING_PAIRS_MAX   8

limoi component maximum number of port-pairs that share buffers.

#define LIMOI_BUFFER_SHARING_POOL_MAX   8

limoi component maximum number of run time buffer share requests. maximum allowed buffers to be shared with output ports before buffers are recycled back.

#define LIMOI_COMPONENT (   hComp  )     ((limoi_component_t *)OMX_COMPONENT(hComp))
#define LIMOI_COMPONENT_CLIENT_EVENT_SET_DEPTH_MAX   64

limoi component client event set maximum depeth

#define LIMOI_COMPONENT_CMD_Q_DEPTH_MAX   128

limoi component command queue maximum depth

#define LIMOI_DEMUXER_AUDIO_OUTPUT_BUFFER_BYTES   (1024 * 4)
#define LIMOI_DEMUXER_AUDIO_OUTPUT_BUFFER_NUM   64
#define LIMOI_DEMUXER_VIDEO_OUTPUT_BUFFER_BYTES   (1024 * 8)
#define LIMOI_DEMUXER_VIDEO_OUTPUT_BUFFER_NUM   64
#define LIMOI_MAX_CLOCK_PORT_BUFFERS   8

maximum number of clock port buffers.

#define LIMOI_MAX_CLOCK_PORTS   8

maximum number of clock ports.

#define LIMOI_MUXER_AUDIO_INPUT_BUFFER_BYTES   (1024 * 4)
#define LIMOI_MUXER_AUDIO_INPUT_BUFFER_NUM   64
#define LIMOI_MUXER_VIDEO_INPUT_BUFFER_BYTES   (1024 * 8)
#define LIMOI_MUXER_VIDEO_INPUT_BUFFER_NUM   64
#define LIMOI_PRELOAD_BUFFER_COUNT   2

limoi component chain buffer preload count.

#define LIMOI_URI_MAX_LENGTH   4096

maximum URI length in bytes. platform specific, can be tuned, either up or down.

#define LIMOI_VIDEO_DECODER_INPUT_BUFFER_BYTES   (1024 * 8)
#define LIMOI_VIDEO_DECODER_INPUT_BUFFER_NUM   4
#define LIMOI_VIDEO_DECODER_OUTPUT_BUFFER_BYTES   (352 * 288 + 352 * 288 / 2)
#define LIMOI_VIDEO_DECODER_OUTPUT_BUFFER_NUM   4
#define LIMOI_VIDEO_ENCODER_INPUT_BUFFER_BYTES   (352 * 288 + 352 * 288 / 2)
#define LIMOI_VIDEO_ENCODER_INPUT_BUFFER_NUM   4
#define LIMOI_VIDEO_ENCODER_OUTPUT_BUFFER_BYTES   (1024 * 8)
#define LIMOI_VIDEO_ENCODER_OUTPUT_BUFFER_NUM   4
#define OMX_COMPONENT (   hComp  )     (((OMX_COMPONENTTYPE *)(hComp))->pComponentPrivate)

Typedef Documentation

opaque limoi component private data structure.

limoi component base class structure. all limoi components shall derive from this base structure, by specifying their first structure member as 'limoi_component_t parent'.

limoi component implementation can choose not to use this structure, however in that case component shall provide complete implementation of all methods.

typedef struct limoi_port_t limoi_port_t

opaque limoi component port handle.

typedef void(* limoi_resource_notify_cb_t)(int manager_id, int resource_id, int status, OMX_HANDLETYPE hComp)

resource notification callback type.

0 if resource becomes available, -1 if error.

typedef int(* limoi_resource_preempt_cb_t)(int manager_id, int resource_id, OMX_HANDLETYPE hComp)

resource preempt request callback type. when called, component shall immediately relinquish specified resource, by calling limoi_resource_release(), after internal cleanup.

Returns:
0 if resource successfully preempted, -1 if error.

Function Documentation

int limoi_component_add_port ( OMX_HANDLETYPE  hComp,
const OMX_PARAM_PORTDEFINITIONTYPE port 
)

set component ports

Parameters:
port port definition.
Returns:
0 on success, -1 on failure.
int limoi_component_add_role ( OMX_HANDLETYPE  hComp,
const char *  role 
)

add component role

Parameters:
role role description string.
Returns:
0 on success, -1 on failure.
void limoi_component_cond_broadcast ( OMX_HANDLETYPE  hComp  ) 

broadcast limoi component conditional. caller must hold component lock by ().

int limoi_component_cond_timedwait ( OMX_HANDLETYPE  hComp,
int  miliseconds 
)

timed wait on limoi component condition. caller must hold component lock by ().

OMX_ERRORTYPE limoi_component_deinit ( OMX_HANDLETYPE  hComp  ) 

limoi component deinitialization routine. destructs limoi base component.

Parameters:
hComp component handle.
void limoi_component_deliver_event ( OMX_HANDLETYPE  hComp,
OMX_EVENTTYPE  eEvent,
OMX_U32  nData1,
OMX_U32  nData2,
OMX_PTR  pEventData 
)

deliver limoi component event.

OMX_ERRORTYPE limoi_component_get_current_role ( OMX_HANDLETYPE  hComp,
char *  role 
)

get current component role helper function to get current role set by client, if available.

Parameters:
hComp component handle.
role role description string buffer, with length no less than OMX_MAX_STRINGNAME_SIZE
Returns:
OpenMax error code.
OMX_ERRORTYPE limoi_component_get_parameter ( OMX_HANDLETYPE  hComponent,
OMX_INDEXTYPE  nIndex,
OMX_PTR  pComponentParameterStructure 
)

limoi component get parameter

limoi_port_t* limoi_component_get_port ( OMX_HANDLETYPE  hComponent,
OMX_U32  nPortIndex 
)

get component port from port index.

Returns:
limoi port handle if successful, NULL otherwise.
OMX_BUFFERHEADERTYPE** limoi_component_get_port_buffer ( OMX_HANDLETYPE  hComp,
limoi_port_t limoi_port,
int  timeout 
)

get next component port buffer.

Parameters:
timeout timeout value in miliseconds, -1 to wait infinitely.
Returns:
buffer header if successful, NULL otherwise.
OMX_PARAM_BUFFERSUPPLIERTYPE* limoi_component_get_port_buffer_supplier ( limoi_port_t port  ) 

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.

OMX_PARAM_PORTDEFINITIONTYPE* limoi_component_get_port_definition ( limoi_port_t port  ) 

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.

void limoi_component_goto_invalid_state ( OMX_HANDLETYPE  hComp  ) 

send component to invalid state. set component state to OMX_StateInvalid and deliver client error event OMX_ErrorInvalidState. Following IL spec, client must reinit component before using it again, by OMX_FreeHandle() and OMX_GetHandle().

int limoi_component_hold_port_buffer ( OMX_HANDLETYPE  hComp,
limoi_port_t limoi_port,
OMX_BUFFERHEADERTYPE **  buf_header 
)

hold component port buffer hold current buffer and advance queue pointer.

Parameters:
buf_header buffer returned by limoi_component_get_port_buffer().
Returns:
0 if successful, -1 otherwise.
OMX_ERRORTYPE limoi_component_init ( OMX_HANDLETYPE *  hComp,
int  bytes 
)

limoi asynchronous component initialization routine. constructs limoi asynchronous base component and allocates component private data.

Parameters:
hComp component handle.
bytes size of component private data in bytes.
OMX_ERRORTYPE limoi_component_init_sync ( OMX_HANDLETYPE *  hComp,
int  bytes 
)

limoi synchronous component initialization routine. constructs limoi synchronous base component and allocates component private data.

Parameters:
hComp component handle.
bytes size of component private data in bytes.
void limoi_component_lock ( OMX_HANDLETYPE  hComp  ) 

lock limoi component. lock can be recursive, but the same number of unlock is required.

int limoi_component_port_buffer_share_enabled ( limoi_port_t port  ) 

check whether port buffer share is enabled at run time.

Returns:
1 if enabled, 0 otherwise.
int limoi_component_put_port_buffer ( OMX_HANDLETYPE  hComp,
limoi_port_t limoi_port,
OMX_BUFFERHEADERTYPE **  buf_header 
)

put back component port buffer. caller must not hold any mutex, since successful putting buffer may lead to API calls on tunneled component.

Returns:
0 if successful, -1 if internal error, 1 if client or tunneled component error.
int limoi_component_realloc_port_buffer ( OMX_HANDLETYPE  hComp,
limoi_port_t limoi_port,
OMX_BUFFERHEADERTYPE buf_header,
int  bytes 
)

reallocate component port buffer.

Parameters:
buf_header port buffer header
bytes reallocation port buffer bytes.
Returns:
0 if successful, -1 otherwise.
int limoi_component_release_port_buffer ( OMX_HANDLETYPE  hComp,
limoi_port_t limoi_port,
OMX_BUFFERHEADERTYPE **  buf_header 
)

release component port buffer caller must not hold any mutex, since successful releasing buffer may lead to API calls on tunneled component.

Parameters:
buf_header buffer returned by limoi_component_get_port_buffer().
Returns:
0 if successful, -1 if internal error, 1 if client or tunneled component error.
OMX_ERRORTYPE limoi_component_set_buffer_share_policy ( OMX_HANDLETYPE  hComp,
const limoi_buffer_share_policy_t policy 
)

set limoi component buffer sharing policy. only can be called when component is in OMX_StateLoaded state.

Parameters:
hComp component handle.
policy component buffer sharing policy.
int limoi_component_set_callbacks ( OMX_HANDLETYPE  hComp,
limoi_component_callbacks_t callbacks 
)

set limoi component callbacks.

Parameters:
callbacks limoi_component_callbacks_t callbacks.
Returns:
0 on success, -1 on failure.
int limoi_component_set_name_version ( OMX_HANDLETYPE  hComp,
const char *  name,
const char *  version 
)

set component name and version.

Parameters:
name component name assigned by component implementor.
version component version string assigned by component implementor. format: 'maj.minor.revison.step'.
Returns:
0 on success, -1 on failure.
OMX_ERRORTYPE limoi_component_set_parameter ( OMX_HANDLETYPE  hComponent,
OMX_INDEXTYPE  nIndex,
OMX_PTR  pComponentParameterStructure 
)

limoi component set parameter regardless of actual component state.

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

share buffer between input and output port. caller must hold base->mutex

can only and must be called by component that implements buffer sharing, this call internally replaces buffer pointer of the output buffer header with that of supplied input buffer header. It then registers with system this sharing request, and automatically releases buffer upon output port and its tunnel has done with the buffer.

Returns:
0 if successful, -1 if error.
OMX_STATETYPE limoi_component_state ( OMX_HANDLETYPE  hComp  ) 

get limoi component current state.

void limoi_component_unlock ( OMX_HANDLETYPE  hComp  ) 

unlock limoi component.

void* limoi_resource_acquire ( int  manager_id,
int  resource_id,
limoi_resource_preempt_cb_t  preempt,
OMX_HANDLETYPE  hComp 
)

acquire specified component resource

resource preemptation request callback, called by resource manager to request component to release specified resource when it is allowed by policy, meaning there's higher priority component is requesting the resource.

Returns:
opaque resource object if successful. NULL otherwise.
int limoi_resource_cancel_wait ( int  manager_id,
int  resource_id,
OMX_HANDLETYPE  hComp 
)

cancel wait on specified component resource

Returns:
0 if wait canceled, -1 otherwise.
int limoi_resource_release ( int  manager_id,
int  resource_id,
OMX_HANDLETYPE  hComp 
)

release specified component resource

Returns:
0 if successful, -1 otherwise.
int limoi_resource_wait ( int  manager_id,
int  resource_id,
OMX_HANDLETYPE  hComp,
limoi_resource_notify_cb_t  notify 
)

wait on specified component resource

Parameters:
notify callback to notify resource wait status
Returns:
0 if wait request is successfully queued, -1 otherwise.
LIMOpenMAX Implementation API Reference - Generated by doxygen