#include "tsemaphore.h"
#include "queue.h"
#include "omx_classmagic.h"
Go to the source code of this file.
Data Structures | |
struct | omx_base_PortType |
Defines | |
#define | TUNNEL_USE_BUFFER_RETRY 20 |
#define | TUNNEL_USE_BUFFER_RETRY_USLEEP_TIME 50000 |
#define | PORT_IS_BEING_FLUSHED(pPort) (pPort->bIsPortFlushed == OMX_TRUE) |
#define | PORT_IS_BEING_DISABLED(pPort) (pPort->bIsTransientToDisabled == OMX_TRUE) |
#define | PORT_IS_ENABLED(pPort) (pPort->sPortParam.bEnabled == OMX_TRUE) |
#define | PORT_IS_POPULATED(pPort) (pPort->sPortParam.bPopulated == OMX_TRUE) |
#define | PORT_IS_TUNNELED(pPort) (pPort->nTunnelFlags & TUNNEL_ESTABLISHED) |
#define | PORT_IS_DEEP_TUNNELED(pPort) (pPort->nTunnelFlags & PROPRIETARY_COMMUNICATION_ESTABLISHED) |
#define | PORT_IS_BUFFER_SUPPLIER(pPort) (pPort->nTunnelFlags & TUNNEL_IS_SUPPLIER) |
#define | PORT_IS_TUNNELED_N_BUFFER_SUPPLIER(pPort) (pPort->nTunnelFlags== (TUNNEL_ESTABLISHED | TUNNEL_IS_SUPPLIER)) |
#define | omx_base_PortType_FIELDS |
Typedefs | |
typedef struct omx_base_PortType | omx_base_PortType |
the base structure that describes each port. | |
Enumerations | |
enum | BUFFER_STATUS_FLAG { BUFFER_FREE = 0, BUFFER_ALLOCATED = 0x0001, BUFFER_ASSIGNED = 0x0002, HEADER_ALLOCATED = 0x0004 } |
enum | TUNNEL_STATUS_FLAG { NO_TUNNEL = 0, TUNNEL_ESTABLISHED = 0x0001, TUNNEL_IS_SUPPLIER = 0x0002, PROPRIETARY_COMMUNICATION_ESTABLISHED = 0x0004 } |
the status of a port related to the tunneling with another component More... | |
Functions | |
OMX_ERRORTYPE | base_port_Constructor (OMX_COMPONENTTYPE *openmaxStandComp, omx_base_PortType **openmaxStandPort, OMX_U32 nPortIndex, OMX_BOOL isInput) |
The base contructor for the generic OpenMAX ST port. | |
OMX_ERRORTYPE | base_port_Destructor (omx_base_PortType *openmaxStandPort) |
The base destructor for the generic OpenMAX ST port. | |
OMX_ERRORTYPE | base_port_DisablePort (omx_base_PortType *openmaxStandPort) |
Disables the port. | |
OMX_ERRORTYPE | base_port_EnablePort (omx_base_PortType *openmaxStandPort) |
Enables the port. | |
OMX_ERRORTYPE | base_port_SendBufferFunction (omx_base_PortType *openmaxStandPort, OMX_BUFFERHEADERTYPE *pBuffer) |
The entry point for sending buffers to the port. | |
OMX_ERRORTYPE | base_port_AllocateBuffer (omx_base_PortType *openmaxStandPort, OMX_BUFFERHEADERTYPE **pBuffer, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes) |
Called by the standard allocate buffer, it implements a base functionality. | |
OMX_ERRORTYPE | base_port_UseBuffer (omx_base_PortType *openmaxStandPort, OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes, OMX_U8 *pBuffer) |
Called by the standard use buffer, it implements a base functionality. | |
OMX_ERRORTYPE | base_port_FreeBuffer (omx_base_PortType *openmaxStandPort, OMX_U32 nPortIndex, OMX_BUFFERHEADERTYPE *pBuffer) |
Called by the standard function. | |
OMX_ERRORTYPE | base_port_FlushProcessingBuffers (omx_base_PortType *openmaxStandPort) |
Releases buffers under processing. | |
OMX_ERRORTYPE | base_port_ReturnBufferFunction (omx_base_PortType *openmaxStandPort, OMX_BUFFERHEADERTYPE *pBuffer) |
Returns buffers when processed. | |
OMX_ERRORTYPE | base_port_ComponentTunnelRequest (omx_base_PortType *openmaxStandPort, OMX_IN OMX_HANDLETYPE hTunneledComp, OMX_IN OMX_U32 nTunneledPort, OMX_INOUT OMX_TUNNELSETUPTYPE *pTunnelSetup) |
Setup Tunnel with the port. | |
OMX_ERRORTYPE | base_port_AllocateTunnelBuffer (omx_base_PortType *openmaxStandPort, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_U32 nSizeBytes) |
Allocate Buffers for tunneling use. | |
OMX_ERRORTYPE | base_port_FreeTunnelBuffer (omx_base_PortType *openmaxStandPort, OMX_U32 nPortIndex) |
Free buffers used in tunnel. |
Copyright (C) 2007 STMicroelectronics Copyright (C) 2007-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$ Revision $Rev$ Author $Author$
Definition in file omx_base_port.h.
#define omx_base_PortType_FIELDS |
Setup tunnel with the port
Definition at line 110 of file omx_base_port.h.
#define PORT_IS_BEING_DISABLED | ( | pPort | ) | (pPort->bIsTransientToDisabled == OMX_TRUE) |
#define PORT_IS_BEING_FLUSHED | ( | pPort | ) | (pPort->bIsPortFlushed == OMX_TRUE) |
Port Specific Macro's
Definition at line 43 of file omx_base_port.h.
Referenced by base_port_ReturnBufferFunction(), base_port_SendBufferFunction(), omx_audio_mixer_BufferMgmtFunction(), omx_base_filter_BufferMgmtFunction(), omx_base_sink_BufferMgmtFunction(), omx_base_source_BufferMgmtFunction(), and omx_base_source_twoport_BufferMgmtFunction().
#define PORT_IS_BUFFER_SUPPLIER | ( | pPort | ) | (pPort->nTunnelFlags & TUNNEL_IS_SUPPLIER) |
Definition at line 49 of file omx_base_port.h.
Referenced by base_port_DisablePort(), base_port_EnablePort(), base_port_FlushProcessingBuffers(), base_port_ReturnBufferFunction(), base_port_SendBufferFunction(), omx_base_component_DoStateSet(), omx_base_component_GetParameter(), omx_base_component_MessageHandler(), and omx_base_component_SetParameter().
#define PORT_IS_DEEP_TUNNELED | ( | pPort | ) | (pPort->nTunnelFlags & PROPRIETARY_COMMUNICATION_ESTABLISHED) |
Definition at line 48 of file omx_base_port.h.
#define PORT_IS_ENABLED | ( | pPort | ) | (pPort->sPortParam.bEnabled == OMX_TRUE) |
Definition at line 45 of file omx_base_port.h.
Referenced by base_port_DisablePort(), base_port_EnablePort(), base_port_SendBufferFunction(), omx_audio_mixer_BufferMgmtFunction(), omx_audio_mixer_component_BufferMgmtCallback(), omx_base_component_DoStateSet(), omx_base_component_ParameterSanityCheck(), and omx_base_component_SetParameter().
#define PORT_IS_POPULATED | ( | pPort | ) | (pPort->sPortParam.bPopulated == OMX_TRUE) |
Definition at line 46 of file omx_base_port.h.
#define PORT_IS_TUNNELED | ( | pPort | ) | (pPort->nTunnelFlags & TUNNEL_ESTABLISHED) |
Definition at line 47 of file omx_base_port.h.
Referenced by base_port_FlushProcessingBuffers(), base_port_ReturnBufferFunction(), base_port_SendBufferFunction(), omx_base_component_DoStateSet(), omx_base_component_GetParameter(), omx_base_component_MessageHandler(), and omx_base_component_SetParameter().
#define PORT_IS_TUNNELED_N_BUFFER_SUPPLIER | ( | pPort | ) | (pPort->nTunnelFlags== (TUNNEL_ESTABLISHED | TUNNEL_IS_SUPPLIER)) |
Definition at line 50 of file omx_base_port.h.
Referenced by base_port_AllocateBuffer(), base_port_AllocateTunnelBuffer(), base_port_FlushProcessingBuffers(), base_port_FreeBuffer(), base_port_FreeTunnelBuffer(), base_port_ReturnBufferFunction(), base_port_SendBufferFunction(), base_port_UseBuffer(), omx_base_component_DoStateSet(), videosrc_port_AllocateBuffer(), videosrc_port_AllocateTunnelBuffer(), videosrc_port_FreeBuffer(), and videosrc_port_FreeTunnelBuffer().
#define TUNNEL_USE_BUFFER_RETRY 20 |
Definition at line 37 of file omx_base_port.h.
Referenced by base_port_AllocateTunnelBuffer(), base_port_FreeTunnelBuffer(), videosrc_port_AllocateTunnelBuffer(), and videosrc_port_FreeTunnelBuffer().
#define TUNNEL_USE_BUFFER_RETRY_USLEEP_TIME 50000 |
Definition at line 38 of file omx_base_port.h.
Referenced by base_port_AllocateTunnelBuffer(), base_port_FreeTunnelBuffer(), videosrc_port_AllocateTunnelBuffer(), and videosrc_port_FreeTunnelBuffer().
typedef struct omx_base_PortType omx_base_PortType |
the base structure that describes each port.
The data structure that describes a port contains the basic elements used in the base component. Other elements can be added in the derived components structures.
Definition at line 109 of file omx_base_port.h.
enum BUFFER_STATUS_FLAG |
The following enum values are used to characterize each buffer allocated or assigned to the component. A buffer list is created for each port of the component. The buffer can be assigned to the port, or owned by the port. The buffer flag are applied for each buffer in each port buffer list. The following use cases are currently implemented:
BUFFER_FREE | |
BUFFER_ALLOCATED | This flag is applied to a buffer when it is allocated by the given port of the component |
BUFFER_ASSIGNED | This flag is applied to a buffer when it is assigned from another port or by the IL client |
HEADER_ALLOCATED | This flag is applied to a buffer when buffer header is allocated by the given port of the component |
Definition at line 76 of file omx_base_port.h.
enum TUNNEL_STATUS_FLAG |
the status of a port related to the tunneling with another component
NO_TUNNEL | No tunnel established |
TUNNEL_ESTABLISHED | the TUNNEL_ESTABLISHED specifies if a port is tunneled. It is assigned to a private field of the port if it is tunneled |
TUNNEL_IS_SUPPLIER | the TUNNEL_IS_SUPPLIER specifies if a tunneled port is the supplier. It is assigned to a private field of the port if it is tunneled and also it is the buffer supplier for the tunnel. |
PROPRIETARY_COMMUNICATION_ESTABLISHED |
Definition at line 88 of file omx_base_port.h.
OMX_ERRORTYPE base_port_AllocateBuffer | ( | omx_base_PortType * | openmaxStandPort, | |
OMX_BUFFERHEADERTYPE ** | pBuffer, | |||
OMX_U32 | nPortIndex, | |||
OMX_PTR | pAppPrivate, | |||
OMX_U32 | nSizeBytes | |||
) |
Called by the standard allocate buffer, it implements a base functionality.
This function can be overriden if the allocation of the buffer is not a simply malloc call. The parameters are the same as the standard function, except for the handle of the port instead of the handler of the component When the buffers needed by this port are all assigned or allocated, the variable bIsFullOfBuffers becomes equal to OMX_TRUE
Definition at line 358 of file omx_base_port.c.
References omx_base_PortType::bBufferStateAllocated, omx_base_PortType::bIsFullOfBuffers, omx_base_PortType::bIsTransientToEnabled, OMX_PARAM_PORTDEFINITIONTYPE::bPopulated, BUFFER_ALLOCATED, BUFFER_FREE, DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEB_LEV_PARAMS, DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_PARAM_PORTDEFINITIONTYPE::eDir, HEADER_ALLOCATED, OMX_BUFFERHEADERTYPE::nAllocLen, OMX_PARAM_PORTDEFINITIONTYPE::nBufferCountActual, OMX_PARAM_PORTDEFINITIONTYPE::nBufferSize, OMX_BUFFERHEADERTYPE::nInputPortIndex, omx_base_PortType::nNumAssignedBuffers, OMX_BUFFERHEADERTYPE::nOutputPortIndex, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, OMX_DirInput, OMX_ErrorBadPortIndex, OMX_ErrorIncorrectStateTransition, OMX_ErrorInsufficientResources, OMX_ErrorNone, OMX_TransStateLoadedToIdle, OMX_TRUE, omx_base_PortType::pAllocSem, OMX_BUFFERHEADERTYPE::pAppPrivate, OMX_BUFFERHEADERTYPE::pBuffer, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_PortType::pInternalBufferStorage, PORT_IS_TUNNELED_N_BUFFER_SUPPLIER, OMX_BUFFERHEADERTYPE::pPlatformPrivate, setHeader(), omx_base_PortType::sPortParam, omx_base_PortType::standCompContainer, omx_base_component_PrivateType::transientState, and tsem_up().
Referenced by base_port_Constructor().
OMX_ERRORTYPE base_port_AllocateTunnelBuffer | ( | omx_base_PortType * | openmaxStandPort, | |
OMX_IN OMX_U32 | nPortIndex, | |||
OMX_IN OMX_U32 | nSizeBytes | |||
) |
Allocate Buffers for tunneling use.
Definition at line 584 of file omx_base_port.c.
References omx_base_PortType::bBufferStateAllocated, omx_base_PortType::bIsFullOfBuffers, omx_base_PortType::bIsTransientToEnabled, OMX_PARAM_PORTDEFINITIONTYPE::bPopulated, BUFFER_ALLOCATED, BUFFER_FREE, DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEB_LEV_PARAMS, DEB_LEV_SIMPLE_SEQ, DEBUG, omx_base_PortType::hTunneledComponent, omx_base_component_PrivateType::name, OMX_PARAM_PORTDEFINITIONTYPE::nBufferCountActual, omx_base_PortType::nNumAssignedBuffers, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, omx_base_PortType::nTunneledPort, omx_base_PortType::nTunnelFlags, OMX_ErrorBadPortIndex, OMX_ErrorIncorrectStateTransition, OMX_ErrorInsufficientResources, OMX_ErrorNone, OMX_TransStateLoadedToIdle, OMX_TRUE, OMX_UseBuffer, omx_base_PortType::pBufferQueue, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_PortType::pInternalBufferStorage, PORT_IS_TUNNELED_N_BUFFER_SUPPLIER, queue(), omx_base_PortType::sPortParam, omx_base_PortType::standCompContainer, omx_base_component_PrivateType::transientState, TUNNEL_USE_BUFFER_RETRY, and TUNNEL_USE_BUFFER_RETRY_USLEEP_TIME.
Referenced by base_port_Constructor().
OMX_ERRORTYPE base_port_ComponentTunnelRequest | ( | omx_base_PortType * | openmaxStandPort, | |
OMX_IN OMX_HANDLETYPE | hTunneledComp, | |||
OMX_IN OMX_U32 | nTunneledPort, | |||
OMX_INOUT OMX_TUNNELSETUPTYPE * | pTunnelSetup | |||
) |
Setup Tunnel with the port.
Definition at line 881 of file omx_base_port.c.
References OMX_PARAM_PORTDEFINITIONTYPE::audio, DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEBUG, OMX_PARAM_BUFFERSUPPLIERTYPE::eBufferSupplier, omx_base_PortType::eBufferSupplier, OMX_VIDEO_PORTDEFINITIONTYPE::eCompressionFormat, OMX_PARAM_PORTDEFINITIONTYPE::eDir, OMX_PARAM_PORTDEFINITIONTYPE::eDomain, OMX_AUDIO_PORTDEFINITIONTYPE::eEncoding, err, OMX_PARAM_PORTDEFINITIONTYPE::format, omx_base_PortType::hTunneledComponent, OMX_PARAM_PORTDEFINITIONTYPE::nBufferCountMin, omx_base_PortType::nNumTunnelBuffer, OMX_PARAM_BUFFERSUPPLIERTYPE::nPortIndex, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, omx_base_PortType::nTunneledPort, omx_base_PortType::nTunnelFlags, OMX_AUDIO_CodingMax, OMX_BufferSupplyInput, OMX_BufferSupplyOutput, OMX_BufferSupplyUnspecified, OMX_DirInput, OMX_ErrorNone, OMX_ErrorPortsNotCompatible, OMX_GetParameter, OMX_IndexParamCompBufferSupplier, OMX_IndexParamPortDefinition, OMX_PortDomainAudio, OMX_PortDomainVideo, OMX_PORTTUNNELFLAG_READONLY, OMX_SetParameter, OMX_VIDEO_CodingMax, setHeader(), omx_base_PortType::sPortParam, TUNNEL_ESTABLISHED, TUNNEL_IS_SUPPLIER, and OMX_PARAM_PORTDEFINITIONTYPE::video.
Referenced by base_port_Constructor().
OMX_ERRORTYPE base_port_Constructor | ( | OMX_COMPONENTTYPE * | openmaxStandComp, | |
omx_base_PortType ** | openmaxStandPort, | |||
OMX_U32 | nPortIndex, | |||
OMX_BOOL | isInput | |||
) |
The base contructor for the generic OpenMAX ST port.
This function is executed by the component that uses a port. The parameter contains the info about the component. It takes care of constructing the instance of the port and every object needed by the base port.
openmaxStandPort | the ST port to be initialized |
openmaxStandPort | the ST port to be initialized | |
isInput | specifices if the port is an input or an output |
Allocate and initialize buffer queue
Definition at line 57 of file omx_base_port.c.
References base_port_AllocateBuffer(), base_port_AllocateTunnelBuffer(), base_port_ComponentTunnelRequest(), base_port_Destructor(), base_port_DisablePort(), base_port_EnablePort(), base_port_FlushProcessingBuffers(), base_port_FreeBuffer(), base_port_FreeTunnelBuffer(), base_port_ReturnBufferFunction(), base_port_SendBufferFunction(), base_port_UseBuffer(), DEB_LEV_FUNCTION_NAME, DEBUG, DEFAULT_MIN_NUMBER_BUFFERS_PER_PORT, DEFAULT_NUMBER_BUFFERS_PER_PORT, OMX_BufferSupplyUnspecified, OMX_DirInput, OMX_DirOutput, OMX_ErrorInsufficientResources, OMX_ErrorNone, OMX_FALSE, OMX_TRUE, queue_init(), setHeader(), and tsem_init().
Referenced by base_audio_port_Constructor(), base_video_port_Constructor(), and omx_symbianoutputstreamsink_component_Constructor().
OMX_ERRORTYPE base_port_Destructor | ( | omx_base_PortType * | openmaxStandPort | ) |
The base destructor for the generic OpenMAX ST port.
This function is executed by the component that uses a port. The parameter contains the info about the component. It takes care of destructing the instance of the port and every object used by the base port.
openmaxStandPort | the ST port to be disposed |
Allocate and initialize buffer queue
Definition at line 132 of file omx_base_port.c.
References OMX_ErrorNone, omx_base_PortType::pAllocSem, omx_base_PortType::pBufferQueue, omx_base_PortType::pBufferSem, queue_deinit(), and tsem_deinit().
Referenced by base_audio_port_Destructor(), base_port_Constructor(), base_video_port_Destructor(), and omx_camera_source_component_Destructor().
OMX_ERRORTYPE base_port_DisablePort | ( | omx_base_PortType * | openmaxStandPort | ) |
Disables the port.
This function is called due to a request by the IL client
openmaxStandPort | the reference to the port |
Definition at line 248 of file omx_base_port.c.
References OMX_PARAM_PORTDEFINITIONTYPE::bEnabled, omx_base_PortType::bIsTransientToDisabled, omx_base_component_PrivateType::bMgmtSem, DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEB_LEV_PARAMS, DEBUG, dequeue(), err, omx_base_component_PrivateType::name, queue_t::nelem, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, omx_base_PortType::nTunnelFlags, OMX_ErrorNone, OMX_FALSE, OMX_StateLoaded, omx_base_PortType::pAllocSem, omx_base_PortType::pBufferQueue, omx_base_PortType::pBufferSem, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_PortType::Port_FreeTunnelBuffer, PORT_IS_BUFFER_SUPPLIER, PORT_IS_ENABLED, tsem_t::semval, omx_base_PortType::sPortParam, omx_base_PortType::standCompContainer, omx_base_component_PrivateType::state, tsem_down(), tsem_reset(), and tsem_up().
Referenced by base_port_Constructor().
OMX_ERRORTYPE base_port_EnablePort | ( | omx_base_PortType * | openmaxStandPort | ) |
Enables the port.
This function is called due to a request by the IL client
openmaxStandPort | the reference to the port |
Definition at line 302 of file omx_base_port.c.
References OMX_PARAM_PORTDEFINITIONTYPE::bEnabled, omx_base_PortType::bIsTransientToEnabled, omx_base_component_PrivateType::bMgmtSem, OMX_PARAM_PORTDEFINITIONTYPE::bPopulated, DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEB_LEV_PARAMS, DEBUG, err, OMX_PARAM_PORTDEFINITIONTYPE::nBufferCountActual, OMX_PARAM_PORTDEFINITIONTYPE::nBufferSize, queue_t::nelem, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, omx_base_PortType::nTunnelFlags, OMX_ErrorNone, OMX_FALSE, OMX_StateExecuting, OMX_StateLoaded, OMX_StateWaitForResources, OMX_TRUE, omx_base_PortType::pAllocSem, omx_base_PortType::pBufferQueue, omx_base_PortType::pBufferSem, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_PortType::Port_AllocateTunnelBuffer, PORT_IS_BUFFER_SUPPLIER, PORT_IS_ENABLED, tsem_t::semval, omx_base_PortType::sPortParam, omx_base_PortType::standCompContainer, omx_base_component_PrivateType::state, tsem_down(), and tsem_up().
Referenced by base_port_Constructor().
OMX_ERRORTYPE base_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 161 of file omx_base_port.c.
References omx_base_PortType::bIsPortFlushed, omx_base_component_PrivateType::bMgmtSem, omx_base_component_PrivateType::bStateSem, omx_base_PortType::BufferProcessedCallback, omx_base_component_PrivateType::callbackData, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEB_LEV_PARAMS, DEBUG, dequeue(), OMX_PARAM_PORTDEFINITIONTYPE::eDir, omx_base_component_PrivateType::flush_all_condition, omx_base_component_PrivateType::flush_condition, omx_base_component_PrivateType::flush_mutex, omx_base_PortType::hTunneledComponent, omx_base_component_PrivateType::name, 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, omx_base_component_PrivateType::state, tsem_down(), tsem_reset(), tsem_signal(), and tsem_up().
Referenced by base_port_Constructor().
OMX_ERRORTYPE base_port_FreeBuffer | ( | omx_base_PortType * | openmaxStandPort, | |
OMX_U32 | nPortIndex, | |||
OMX_BUFFERHEADERTYPE * | pBuffer | |||
) |
Called by the standard function.
It frees the buffer header and in case also the buffer itself, if needed. When all the bufers are done, the variable bIsEmptyOfBuffers is set to OMX_TRUE
Definition at line 520 of file omx_base_port.c.
References omx_base_PortType::bBufferStateAllocated, omx_base_PortType::bIsEmptyOfBuffers, omx_base_PortType::bIsFullOfBuffers, omx_base_PortType::bIsTransientToDisabled, OMX_PARAM_PORTDEFINITIONTYPE::bPopulated, BUFFER_ALLOCATED, BUFFER_ASSIGNED, BUFFER_FREE, omx_base_component_PrivateType::callbackData, omx_base_component_PrivateType::callbacks, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEB_LEV_PARAMS, DEBUG, OMX_CALLBACKTYPE::EventHandler, HEADER_ALLOCATED, OMX_PARAM_PORTDEFINITIONTYPE::nBufferCountActual, omx_base_PortType::nNumAssignedBuffers, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, OMX_ErrorBadPortIndex, OMX_ErrorInsufficientResources, OMX_ErrorNone, OMX_ErrorPortUnpopulated, OMX_EventError, OMX_FALSE, OMX_TransStateIdleToLoaded, OMX_TRUE, omx_base_PortType::pAllocSem, OMX_BUFFERHEADERTYPE::pBuffer, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_PortType::pInternalBufferStorage, PORT_IS_TUNNELED_N_BUFFER_SUPPLIER, omx_base_PortType::sPortParam, omx_base_PortType::standCompContainer, omx_base_component_PrivateType::transientState, and tsem_up().
Referenced by base_port_Constructor().
OMX_ERRORTYPE base_port_FreeTunnelBuffer | ( | omx_base_PortType * | openmaxStandPort, | |
OMX_U32 | nPortIndex | |||
) |
Free buffers used in tunnel.
Definition at line 660 of file omx_base_port.c.
References omx_base_PortType::bBufferStateAllocated, omx_base_PortType::bIsEmptyOfBuffers, omx_base_PortType::bIsFullOfBuffers, omx_base_PortType::bIsTransientToDisabled, OMX_PARAM_PORTDEFINITIONTYPE::bPopulated, BUFFER_ALLOCATED, BUFFER_ASSIGNED, BUFFER_FREE, omx_base_component_PrivateType::callbackData, omx_base_component_PrivateType::callbacks, DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEB_LEV_PARAMS, DEBUG, OMX_CALLBACKTYPE::EventHandler, omx_base_PortType::hTunneledComponent, OMX_PARAM_PORTDEFINITIONTYPE::nBufferCountActual, queue_t::nelem, omx_base_PortType::nNumAssignedBuffers, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, omx_base_PortType::nTunneledPort, OMX_ErrorBadPortIndex, OMX_ErrorIncorrectStateTransition, OMX_ErrorNone, OMX_ErrorPortUnpopulated, OMX_EventError, OMX_FALSE, OMX_FreeBuffer, OMX_TransStateIdleToLoaded, OMX_TRUE, OMX_BUFFERHEADERTYPE::pBuffer, omx_base_PortType::pBufferQueue, omx_base_PortType::pBufferSem, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_PortType::pInternalBufferStorage, PORT_IS_TUNNELED_N_BUFFER_SUPPLIER, tsem_t::semval, omx_base_PortType::sPortParam, omx_base_PortType::standCompContainer, omx_base_component_PrivateType::transientState, TUNNEL_USE_BUFFER_RETRY, and TUNNEL_USE_BUFFER_RETRY_USLEEP_TIME.
Referenced by base_port_Constructor().
OMX_ERRORTYPE base_port_ReturnBufferFunction | ( | omx_base_PortType * | openmaxStandPort, | |
OMX_BUFFERHEADERTYPE * | pBuffer | |||
) |
Returns buffers when processed.
Call appropriate function to return buffers to peer or IL Client
Returns Input/Output Buffer to the IL client or Tunneled Component
Definition at line 818 of file omx_base_port.c.
References omx_base_PortType::BufferProcessedCallback, omx_base_component_PrivateType::callbackData, DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEBUG, OMX_PARAM_PORTDEFINITIONTYPE::eDir, omx_base_PortType::hTunneledComponent, omx_base_component_PrivateType::name, OMX_BUFFERHEADERTYPE::nInputPortIndex, omx_base_PortType::nNumBufferFlushed, OMX_BUFFERHEADERTYPE::nOutputPortIndex, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, omx_base_PortType::nTunneledPort, OMX_DirInput, OMX_ErrorNone, omx_base_PortType::pBufferQueue, omx_base_PortType::pBufferSem, OMX_COMPONENTTYPE::pComponentPrivate, PORT_IS_BEING_FLUSHED, PORT_IS_BUFFER_SUPPLIER, PORT_IS_TUNNELED, PORT_IS_TUNNELED_N_BUFFER_SUPPLIER, queue(), omx_base_PortType::sPortParam, omx_base_PortType::standCompContainer, and tsem_up().
Referenced by base_port_Constructor().
OMX_ERRORTYPE base_port_SendBufferFunction | ( | omx_base_PortType * | openmaxStandPort, | |
OMX_BUFFERHEADERTYPE * | pBuffer | |||
) |
The entry point for sending buffers to the port.
This function can be called by the EmptyThisBuffer or FillThisBuffer. It depends on the nature of the port, that can be an input or output port.
The entry point for sending buffers to the port.
This function can be called by the EmptyThisBuffer or FillThisBuffer. It depends on the nature of the port, that can be an input or output port.
Definition at line 736 of file omx_base_port.c.
References omx_base_component_PrivateType::bMgmtSem, checkHeader(), DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEB_LEV_PARAMS, DEBUG, OMX_PARAM_PORTDEFINITIONTYPE::eDir, err, omx_base_component_PrivateType::name, OMX_PARAM_PORTDEFINITIONTYPE::nBufferCountActual, OMX_BUFFERHEADERTYPE::nInputPortIndex, OMX_BUFFERHEADERTYPE::nOutputPortIndex, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, OMX_DirInput, OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorIncorrectStateOperation, OMX_ErrorInvalidState, OMX_ErrorNone, OMX_FALSE, OMX_StateExecuting, OMX_StateIdle, OMX_StateInvalid, OMX_StatePause, OMX_TransStateExecutingToIdle, OMX_TRUE, OMX_BUFFERHEADERTYPE::pBuffer, omx_base_PortType::pBufferQueue, omx_base_PortType::pBufferSem, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_PortType::pInternalBufferStorage, PORT_IS_BEING_DISABLED, PORT_IS_BEING_FLUSHED, PORT_IS_BUFFER_SUPPLIER, PORT_IS_ENABLED, PORT_IS_TUNNELED, PORT_IS_TUNNELED_N_BUFFER_SUPPLIER, queue(), omx_base_PortType::sPortParam, omx_base_PortType::standCompContainer, omx_base_component_PrivateType::state, omx_base_component_PrivateType::transientState, and tsem_up().
Referenced by base_port_Constructor().
OMX_ERRORTYPE base_port_UseBuffer | ( | omx_base_PortType * | openmaxStandPort, | |
OMX_BUFFERHEADERTYPE ** | ppBufferHdr, | |||
OMX_U32 | nPortIndex, | |||
OMX_PTR | pAppPrivate, | |||
OMX_U32 | nSizeBytes, | |||
OMX_U8 * | pBuffer | |||
) |
Called by the standard use buffer, it implements a base functionality.
This function can be overriden if the use buffer implicate more complicated operations. The parameters are the same as the standard function, except for the handle of the port instead of the handler of the component When the buffers needed by this port are all assigned or allocated, the variable bIsFullOfBuffers becomes equal to OMX_TRUE
This function can be overriden if the use buffer implicate more complicated operations. The parameters are the same as the standard function, except for the handle of the port instead of the handler of the component. When the buffers needed by this port are all assigned or allocated, the variable bIsFullOfBuffers becomes equal to OMX_TRUE
Definition at line 436 of file omx_base_port.c.
References omx_base_PortType::bBufferStateAllocated, omx_base_PortType::bIsEmptyOfBuffers, omx_base_PortType::bIsFullOfBuffers, omx_base_PortType::bIsTransientToEnabled, OMX_PARAM_PORTDEFINITIONTYPE::bPopulated, BUFFER_ASSIGNED, BUFFER_FREE, DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEB_LEV_PARAMS, DEBUG, OMX_PARAM_PORTDEFINITIONTYPE::eDir, HEADER_ALLOCATED, OMX_BUFFERHEADERTYPE::nAllocLen, omx_base_component_PrivateType::name, OMX_PARAM_PORTDEFINITIONTYPE::nBufferCountActual, OMX_PARAM_PORTDEFINITIONTYPE::nBufferSize, OMX_BUFFERHEADERTYPE::nInputPortIndex, omx_base_PortType::nNumAssignedBuffers, OMX_BUFFERHEADERTYPE::nOutputPortIndex, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, OMX_DirInput, OMX_ErrorBadPortIndex, OMX_ErrorIncorrectStateTransition, OMX_ErrorInsufficientResources, OMX_ErrorNone, OMX_FALSE, OMX_TransStateLoadedToIdle, OMX_TRUE, omx_base_PortType::pAllocSem, OMX_BUFFERHEADERTYPE::pAppPrivate, OMX_BUFFERHEADERTYPE::pBuffer, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_PortType::pInternalBufferStorage, PORT_IS_TUNNELED_N_BUFFER_SUPPLIER, OMX_BUFFERHEADERTYPE::pPlatformPrivate, setHeader(), omx_base_PortType::sPortParam, omx_base_PortType::standCompContainer, omx_base_component_PrivateType::transientState, and tsem_up().
Referenced by base_port_Constructor().