omx_videosrc_component.c File Reference

#include <assert.h>
#include <omxcore.h>
#include <omx_base_video_port.h>
#include <omx_videosrc_component.h>

Go to the source code of this file.

Defines

#define MAX_COMPONENT_VIDEOSRC   1
#define DEFAULT_FILENAME_LENGTH   256
#define CLEAR(x)   memset (&(x), 0, sizeof (x))

Functions

OMX_ERRORTYPE omx_videosrc_component_Constructor (OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
OMX_ERRORTYPE omx_videosrc_component_Destructor (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_videosrc_component_Init (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_videosrc_component_Deinit (OMX_COMPONENTTYPE *openmaxStandComp)
void omx_videosrc_component_BufferMgmtCallback (OMX_COMPONENTTYPE *openmaxStandComp, OMX_BUFFERHEADERTYPE *pOutputBuffer)
OMX_ERRORTYPE omx_videosrc_component_SetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_videosrc_component_GetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_videosrc_component_MessageHandler (OMX_COMPONENTTYPE *openmaxStandComp, internalRequestMessageType *message)
OMX_ERRORTYPE videosrc_port_AllocateBuffer (omx_base_PortType *openmaxStandPort, OMX_BUFFERHEADERTYPE **pBuffer, OMX_U32 nPortIndex, OMX_PTR pAppPrivate, OMX_U32 nSizeBytes)
OMX_ERRORTYPE videosrc_port_FreeBuffer (omx_base_PortType *openmaxStandPort, OMX_U32 nPortIndex, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE videosrc_port_AllocateTunnelBuffer (omx_base_PortType *openmaxStandPort, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_U32 nSizeBytes)
OMX_ERRORTYPE videosrc_port_FreeTunnelBuffer (omx_base_PortType *openmaxStandPort, OMX_U32 nPortIndex)


Detailed Description

OpenMAX video source component. This component is a video source component that captures video from the video camera.This camera component is based on V4L2.

Copyright (C) 2007-2008 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
2008-06-27 12:00:23 +0200 (Fri, 27 Jun 2008)
Revision
Rev
554
Author
Author
pankaj_sen

Definition in file omx_videosrc_component.c.


Define Documentation

#define CLEAR (  )     memset (&(x), 0, sizeof (x))

Definition at line 43 of file omx_videosrc_component.c.

#define DEFAULT_FILENAME_LENGTH   256

Definition at line 41 of file omx_videosrc_component.c.

#define MAX_COMPONENT_VIDEOSRC   1

Definition at line 36 of file omx_videosrc_component.c.

Referenced by omx_videosrc_component_Constructor().


Function Documentation

void omx_videosrc_component_BufferMgmtCallback ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_BUFFERHEADERTYPE pOutputBuffer 
)

This function processes the input file and returns packet by packet as an output data this packet is used in video decoder component for decoding

return the current output buffer

Definition at line 301 of file omx_videosrc_component.c.

References CLEAR, DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEBUG, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERHEADERTYPE::nOffset, OMX_FALSE, OMX_StateExecuting, OMX_BUFFERHEADERTYPE::pBuffer, OMX_COMPONENTTYPE::pComponentPrivate, and tsem_down().

Referenced by omx_videosrc_component_Constructor().

OMX_ERRORTYPE omx_videosrc_component_Constructor ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_STRING  cComponentName 
)

The Constructor

Allocate Ports and call port constructor.

Definition at line 63 of file omx_videosrc_component.c.

References base_video_port_Constructor(), DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEBUG, OMX_VIDEO_PARAM_PORTFORMATTYPE::eColorFormat, OMX_VIDEO_PORTDEFINITIONTYPE::eColorFormat, err, OMX_PARAM_PORTDEFINITIONTYPE::format, OMX_COMPONENTTYPE::GetParameter, MAX_COMPONENT_VIDEOSRC, OMX_PARAM_PORTDEFINITIONTYPE::nBufferSize, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameHeight, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameWidth, omx_base_source_Constructor(), OMX_BASE_SOURCE_OUTPUTPORT_INDEX, OMX_COLOR_FormatYUV420Planar, OMX_ErrorHardware, OMX_ErrorInsufficientResources, OMX_ErrorNone, OMX_FALSE, OMX_PortDomainVideo, omx_videosrc_component_BufferMgmtCallback(), omx_videosrc_component_Destructor(), omx_videosrc_component_GetParameter(), omx_videosrc_component_MessageHandler(), omx_videosrc_component_SetParameter(), OMX_COMPONENTTYPE::pComponentPrivate, OMX_COMPONENTTYPE::SetParameter, omx_base_video_PortType::sPortParam, omx_base_video_PortType::sVideoParam, tsem_init(), OMX_PARAM_PORTDEFINITIONTYPE::video, VIDEO_DEV_NAME, videosrc_port_AllocateBuffer(), videosrc_port_AllocateTunnelBuffer(), videosrc_port_FreeBuffer(), and videosrc_port_FreeTunnelBuffer().

Referenced by omx_component_library_Setup().

OMX_ERRORTYPE omx_videosrc_component_Deinit ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The DeInitialization function

closing input file

Definition at line 282 of file omx_videosrc_component.c.

References DEB_LEV_FUNCTION_NAME, DEBUG, OMX_ErrorNone, OMX_FALSE, OMX_COMPONENTTYPE::pComponentPrivate, and tsem_reset().

Referenced by omx_videosrc_component_MessageHandler().

OMX_ERRORTYPE omx_videosrc_component_Destructor ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Destructor

Definition at line 160 of file omx_videosrc_component.c.

References DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEBUG, err, omx_base_source_Destructor(), OMX_ErrorNone, OMX_PortDomainVideo, OMX_COMPONENTTYPE::pComponentPrivate, and tsem_deinit().

Referenced by omx_videosrc_component_Constructor().

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

Definition at line 413 of file omx_videosrc_component.c.

References checkHeader(), DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_VIDEO_PARAM_PORTFORMATTYPE::nPortIndex, omx_base_component_GetParameter(), OMX_BASE_SOURCE_OUTPUTPORT_INDEX, OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexParamVideoInit, OMX_IndexParamVideoPortFormat, OMX_IndexVendorFileReadInputFilename, OMX_PortDomainVideo, OMX_COMPONENTTYPE::pComponentPrivate, and omx_base_video_PortType::sVideoParam.

Referenced by omx_videosrc_component_Constructor().

OMX_ERRORTYPE omx_videosrc_component_Init ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Initialization function

Initialize video capture pixel format

initialization for buff mgmt callback function

Definition at line 198 of file omx_videosrc_component.c.

References DEB_ALL_MESS, DEB_LEV_FUNCTION_NAME, DEBUG, OMX_VIDEO_PORTDEFINITIONTYPE::eColorFormat, err, OMX_PARAM_PORTDEFINITIONTYPE::format, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameHeight, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameWidth, OMX_BASE_SOURCE_OUTPUTPORT_INDEX, OMX_COLOR_Format16bitRGB565, OMX_COLOR_Format24bitRGB888, OMX_COLOR_Format32bitARGB8888, OMX_COLOR_FormatYUV411Planar, OMX_COLOR_FormatYUV420PackedPlanar, OMX_COLOR_FormatYUV420Planar, OMX_COLOR_FormatYUV422Planar, OMX_ErrorNone, OMX_FALSE, OMX_TRUE, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_video_PortType::sPortParam, tsem_up(), and OMX_PARAM_PORTDEFINITIONTYPE::video.

Referenced by omx_videosrc_component_MessageHandler().

OMX_ERRORTYPE omx_videosrc_component_MessageHandler ( OMX_COMPONENTTYPE openmaxStandComp,
internalRequestMessageType message 
)

This function initializes and deinitializes the library related initialization needed for file parsing

Definition at line 460 of file omx_videosrc_component.c.

References DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, err, internalRequestMessageType::messageParam, internalRequestMessageType::messageType, omx_base_component_MessageHandler(), OMX_CommandStateSet, OMX_ErrorNone, OMX_StateExecuting, OMX_StateIdle, omx_videosrc_component_Deinit(), omx_videosrc_component_Init(), and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_videosrc_component_Constructor().

OMX_ERRORTYPE omx_videosrc_component_SetParameter ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_INDEXTYPE  nParamIndex,
OMX_IN OMX_PTR  ComponentParameterStructure 
)

Definition at line 357 of file omx_videosrc_component.c.

References DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_PARAM_PORTDEFINITIONTYPE::format, OMX_PARAM_PORTDEFINITIONTYPE::nBufferSize, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameHeight, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameWidth, OMX_VIDEO_PARAM_PORTFORMATTYPE::nPortIndex, omx_base_component_ParameterSanityCheck(), omx_base_component_SetParameter(), OMX_BASE_SOURCE_OUTPUTPORT_INDEX, OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexParamPortDefinition, OMX_IndexParamVideoPortFormat, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_video_PortType::sPortParam, omx_base_video_PortType::sVideoParam, and OMX_PARAM_PORTDEFINITIONTYPE::video.

Referenced by omx_videosrc_component_Constructor().

OMX_ERRORTYPE videosrc_port_AllocateBuffer ( omx_base_PortType openmaxStandPort,
OMX_BUFFERHEADERTYPE **  pBuffer,
OMX_U32  nPortIndex,
OMX_PTR  pAppPrivate,
OMX_U32  nSizeBytes 
)

Definition at line 486 of file omx_videosrc_component.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 omx_videosrc_component_Constructor().

OMX_ERRORTYPE videosrc_port_AllocateTunnelBuffer ( omx_base_PortType openmaxStandPort,
OMX_IN OMX_U32  nPortIndex,
OMX_IN OMX_U32  nSizeBytes 
)

Definition at line 625 of file omx_videosrc_component.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 omx_videosrc_component_Constructor().

OMX_ERRORTYPE videosrc_port_FreeBuffer ( omx_base_PortType openmaxStandPort,
OMX_U32  nPortIndex,
OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 559 of file omx_videosrc_component.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 omx_videosrc_component_Constructor().

OMX_ERRORTYPE videosrc_port_FreeTunnelBuffer ( omx_base_PortType openmaxStandPort,
OMX_U32  nPortIndex 
)

Definition at line 698 of file omx_videosrc_component.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 omx_videosrc_component_Constructor().


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