omx_clocksrc_component.c File Reference

#include <omxcore.h>
#include <omx_base_clock_port.h>
#include <omx_clocksrc_component.h>
#include <config.h>
#include <unistd.h>

Go to the source code of this file.

Defines

#define MAX_COMPONENT_CLOCKSRC   1

Functions

OMX_ERRORTYPE omx_clocksrc_component_Constructor (OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
OMX_ERRORTYPE omx_clocksrc_component_Destructor (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_clocksrc_component_GetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_clocksrc_component_SetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_clocksrc_component_SendCommand (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_COMMANDTYPE Cmd, OMX_IN OMX_U32 nParam, OMX_IN OMX_PTR pCmdData)
OMX_ERRORTYPE omx_clocksrc_component_GetConfig (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_INOUT OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE omx_clocksrc_component_SetConfig (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_IN OMX_PTR pComponentConfigStructure)
void omx_clocksrc_component_BufferMgmtCallback (OMX_COMPONENTTYPE *openmaxStandComp, OMX_BUFFERHEADERTYPE *outputbuffer)
void * omx_clocksrc_BufferMgmtFunction (void *param)
OMX_ERRORTYPE clocksrc_port_FlushProcessingBuffers (omx_base_PortType *openmaxStandPort)
 Releases buffers under processing. This function must be implemented in the derived classes, for the specific processing.


Detailed Description

OpenMAX clocksrc_component component. This component does not perform any multimedia processing. It is provides the media and the reference clock for all the clients connected to it.

Copyright (C) 2008 STMicroelectronics Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Date
2008-07-04 11:48:31 +0200 (Fri, 04 Jul 2008)
Revision
Rev
560
Author
Author
gsent

Definition in file omx_clocksrc_component.c.


Define Documentation

#define MAX_COMPONENT_CLOCKSRC   1

Definition at line 37 of file omx_clocksrc_component.c.

Referenced by omx_clocksrc_component_Constructor().


Function Documentation

OMX_ERRORTYPE clocksrc_port_FlushProcessingBuffers ( omx_base_PortType openmaxStandPort  ) 

Releases buffers under processing. This function must be implemented in the derived classes, for the specific processing.

Definition at line 800 of file omx_clocksrc_component.c.

References omx_base_PortType::bIsPortFlushed, omx_base_PortType::BufferProcessedCallback, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEB_LEV_PARAMS, DEBUG, dequeue(), OMX_PARAM_PORTDEFINITIONTYPE::eDir, omx_base_PortType::hTunneledComponent, queue_t::nelem, omx_base_PortType::nNumAssignedBuffers, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, omx_base_PortType::nTunnelFlags, OMX_DirInput, OMX_ErrorNone, OMX_FALSE, OMX_StatePause, OMX_TRUE, omx_base_PortType::pBufferQueue, omx_base_PortType::pBufferSem, OMX_COMPONENTTYPE::pComponentPrivate, PORT_IS_BUFFER_SUPPLIER, PORT_IS_TUNNELED, PORT_IS_TUNNELED_N_BUFFER_SUPPLIER, queue(), tsem_t::semval, omx_base_PortType::sPortParam, omx_base_PortType::standCompContainer, tsem_down(), tsem_reset(), tsem_signal(), and tsem_up().

Referenced by omx_clocksrc_component_Constructor().

void* omx_clocksrc_BufferMgmtFunction ( void *  param  ) 

This is the central function for buffer processing of a two port source component. It is executed in a separate thread, is synchronized with semaphores at each port, those are released each time a new buffer is available on the given port.

Definition at line 629 of file omx_clocksrc_component.c.

References DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEB_LEV_SIMPLE_SEQ, DEBUG, dequeue(), OMX_TIME_MEDIATIMETYPE::eUpdateType, MAX_CLOCK_PORTS, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_FALSE, OMX_PortDomainOther, OMX_StateExecuting, OMX_StateIdle, OMX_StateInvalid, OMX_StateLoaded, OMX_StatePause, OMX_TIME_UpdateClockStateChanged, OMX_TIME_UpdateRequestFulfillment, OMX_TIME_UpdateScaleChanged, OMX_TransStateIdleToLoaded, OMX_TransStateInvalid, OMX_TransStateLoadedToIdle, OMX_TransStateMax, OMX_TransStatePauseToExecuting, OMX_TRUE, omx_base_clock_PortType::pBufferQueue, omx_base_clock_PortType::pBufferSem, OMX_COMPONENTTYPE::pComponentPrivate, PORT_IS_BEING_FLUSHED, PORT_IS_ENABLED, PORT_IS_TUNNELED, omx_base_clock_PortType::ReturnBufferFunction, omx_base_clock_PortType::sMediaTime, tsem_down(), and tsem_up().

Referenced by omx_clocksrc_component_Constructor().

void omx_clocksrc_component_BufferMgmtCallback ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_BUFFERHEADERTYPE outputbuffer 
)

This function plays the input buffer. When fully consumed it returns.

Definition at line 614 of file omx_clocksrc_component.c.

References OMX_TIME_MEDIATIMETYPE::eUpdateType, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERHEADERTYPE::nOutputPortIndex, OMX_TIME_UpdateMax, OMX_BUFFERHEADERTYPE::pBuffer, OMX_COMPONENTTYPE::pComponentPrivate, and omx_base_clock_PortType::sMediaTime.

Referenced by omx_clocksrc_component_Constructor().

OMX_ERRORTYPE omx_clocksrc_component_Constructor ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_STRING  cComponentName 
)

The Constructor

Allocate Ports and call port constructor.

Definition at line 48 of file omx_clocksrc_component.c.

References base_clock_port_Constructor(), clocksrc_port_FlushProcessingBuffers(), fd, OMX_COMPONENTTYPE::GetConfig, OMX_COMPONENTTYPE::GetParameter, MAX_COMPONENT_CLOCKSRC, omx_base_source_Constructor(), omx_clocksrc_BufferMgmtFunction(), omx_clocksrc_component_BufferMgmtCallback(), omx_clocksrc_component_Destructor(), omx_clocksrc_component_GetConfig(), omx_clocksrc_component_GetParameter(), omx_clocksrc_component_SendCommand(), omx_clocksrc_component_SetConfig(), omx_clocksrc_component_SetParameter(), OMX_ErrorInsufficientResources, OMX_ErrorNone, OMX_FALSE, OMX_PortDomainOther, OMX_TIME_ClockStateStopped, OMX_TIME_RefClockNone, OMX_TIME_UpdateMax, OMX_COMPONENTTYPE::pComponentPrivate, OMX_COMPONENTTYPE::SendCommand, OMX_COMPONENTTYPE::SetConfig, setHeader(), OMX_COMPONENTTYPE::SetParameter, and tsem_init().

Referenced by omx_component_library_Setup().

OMX_ERRORTYPE omx_clocksrc_component_Destructor ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Destructor

Definition at line 141 of file omx_clocksrc_component.c.

References fd, omx_base_source_Destructor(), OMX_PortDomainOther, OMX_TIME_ClockStateMax, OMX_COMPONENTTYPE::pComponentPrivate, and tsem_deinit().

Referenced by omx_clocksrc_component_Constructor().

OMX_ERRORTYPE omx_clocksrc_component_GetConfig ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_INDEXTYPE  nIndex,
OMX_INOUT OMX_PTR  pComponentConfigStructure 
)

Definition at line 318 of file omx_clocksrc_component.c.

References DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_ErrorBadParameter, OMX_ErrorNone, OMX_IndexConfigTimeActiveRefClock, OMX_IndexConfigTimeClockState, OMX_IndexConfigTimeCurrentMediaTime, OMX_IndexConfigTimeCurrentWallTime, OMX_IndexConfigTimeScale, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_clocksrc_component_Constructor().

OMX_ERRORTYPE omx_clocksrc_component_GetParameter ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_INDEXTYPE  nParamIndex,
OMX_INOUT OMX_PTR  ComponentParameterStructure 
)

Definition at line 178 of file omx_clocksrc_component.c.

References checkHeader(), DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_OTHER_PARAM_PORTFORMATTYPE::nPortIndex, omx_base_component_GetParameter(), OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexParamOtherInit, OMX_IndexParamOtherPortFormat, OMX_PortDomainOther, OMX_COMPONENTTYPE::pComponentPrivate, and omx_base_clock_PortType::sOtherParam.

Referenced by omx_clocksrc_component_Constructor().

OMX_ERRORTYPE omx_clocksrc_component_SendCommand ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_COMMANDTYPE  Cmd,
OMX_IN OMX_U32  nParam,
OMX_IN OMX_PTR  pCmdData 
)

Definition at line 257 of file omx_clocksrc_component.c.

References DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_ALL, omx_base_component_SendCommand(), OMX_CommandPortDisable, OMX_CommandPortEnable, OMX_CommandStateSet, OMX_ErrorBadPortIndex, OMX_PortDomainOther, OMX_StateExecuting, OMX_StateIdle, OMX_StateInvalid, OMX_StateLoaded, OMX_StatePause, OMX_TransStateIdleToLoaded, OMX_TransStateInvalid, OMX_TransStatePauseToExecuting, OMX_COMPONENTTYPE::pComponentPrivate, and tsem_up().

Referenced by omx_clocksrc_component_Constructor().

OMX_ERRORTYPE omx_clocksrc_component_SetConfig ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_INDEXTYPE  nIndex,
OMX_IN OMX_PTR  pComponentConfigStructure 
)

????

Definition at line 361 of file omx_clocksrc_component.c.

References DEB_ALL_MESS, DEB_LEV_FUNCTION_NAME, DEB_LEV_SIMPLE_SEQ, DEBUG, fd, OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorIncorrectStateTransition, OMX_ErrorNone, OMX_ErrorSameState, OMX_IndexConfigTimeActiveRefClock, OMX_IndexConfigTimeClientStartTime, OMX_IndexConfigTimeClockState, OMX_IndexConfigTimeCurrentAudioReference, OMX_IndexConfigTimeCurrentVideoReference, OMX_IndexConfigTimeMediaTimeRequest, OMX_IndexConfigTimeScale, OMX_PortDomainOther, OMX_TIME_ClockStateRunning, OMX_TIME_ClockStateStopped, OMX_TIME_ClockStateWaitingForStartTime, OMX_TIME_UpdateClockStateChanged, OMX_TIME_UpdateRequestFulfillment, OMX_TIME_UpdateScaleChanged, OMX_COMPONENTTYPE::pComponentPrivate, PORT_IS_ENABLED, tsem_down(), and tsem_up().

Referenced by omx_clocksrc_component_Constructor().

OMX_ERRORTYPE omx_clocksrc_component_SetParameter ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_INDEXTYPE  nParamIndex,
OMX_INOUT OMX_PTR  ComponentParameterStructure 
)

Definition at line 218 of file omx_clocksrc_component.c.

References DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_OTHER_PARAM_PORTFORMATTYPE::nPortIndex, omx_base_component_ParameterSanityCheck(), omx_base_component_SetParameter(), OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexParamOtherPortFormat, OMX_PortDomainOther, OMX_COMPONENTTYPE::pComponentPrivate, and omx_base_clock_PortType::sOtherParam.

Referenced by omx_clocksrc_component_Constructor().


Generated for OpenMAX Bellagio rel. 0.9.0 by  doxygen 1.5.1
SourceForge.net Logo