omx_videosrc_component.h File Reference

#include <OMX_Types.h>
#include <OMX_Component.h>
#include <OMX_Core.h>
#include <OMX_Video.h>
#include <pthread.h>
#include <omx_base_source.h>
#include <string.h>
#include <linux/videodev.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <sys/time.h>

Go to the source code of this file.

Defines

#define MAX_NUM_OF_videosrc_component_INSTANCES   1
#define VIDEO_DEV_NAME   "/dev/video"
#define omx_videosrc_component_PrivateType_FIELDS

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_MessageHandler (OMX_COMPONENTTYPE *, internalRequestMessageType *)
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 *outputbuffer)
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_SetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR ComponentParameterStructure)
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.

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_videosrc_component.h.


Define Documentation

#define MAX_NUM_OF_videosrc_component_INSTANCES   1

Maximum number of base_component component instances

Definition at line 52 of file omx_videosrc_component.h.

#define omx_videosrc_component_PrivateType_FIELDS

Value:

omx_base_source_PrivateType_FIELDS \\
  tsem_t* videoSyncSem; \ \
  OMX_BOOL videoReady;  \ \
  OMX_BOOL bIsEOSSent;  \ \
  OMX_S32 deviceHandle; \ \
  struct video_capability capability; \ \
  struct video_window captureWindow; \ \
  struct video_picture imageProperties; \ \
  struct video_mbuf memoryBuffer; \ \
  char* memoryMap; \ \
  struct video_mmap* mmaps; \ \
  OMX_U32 iFrameIndex; \ \
  OMX_U32 iFrameSize; \ \
  OMX_BOOL bOutBufferMemoryMapped;
Video Source component private structure. see the define above

Definition at line 60 of file omx_videosrc_component.h.

#define VIDEO_DEV_NAME   "/dev/video"

Definition at line 54 of file omx_videosrc_component.h.

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 442 of file omx_videosrc_component.c.

References 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 
)

OMX_ERRORTYPE omx_videosrc_component_Deinit ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The DeInitialization function

closing input file

Definition at line 426 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  ) 

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_Init ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Initialization function

Video Capability Query

The pointer memoryMap and the offsets within memoryBuffer.offsets combine to give us the address of each buffered frame. For example: Buffered Frame 0 is located at: memoryMap + memoryBuffer.offsets[0] Buffered Frame 1 is located at: memoryMap + memoryBuffer.offsets[1] Buffered Frame 2 is located at: memoryMap + memoryBuffer.offsets[2] etc... The number of buffered frames is stored in memoryBuffer.frames.

initialization for buff mgmt callback function

Definition at line 216 of file omx_videosrc_component.c.

References DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEB_LEV_PARAMS, DEBUG, OMX_VIDEO_PORTDEFINITIONTYPE::eColorFormat, 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_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 
)

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

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_AllocateTunnelBuffer ( omx_base_PortType openmaxStandPort,
OMX_IN OMX_U32  nPortIndex,
OMX_IN OMX_U32  nSizeBytes 
)

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

OMX_ERRORTYPE videosrc_port_FreeTunnelBuffer ( omx_base_PortType openmaxStandPort,
OMX_U32  nPortIndex 
)


Generated for OpenMAX Bellagio rel. 0.3.5-svn by  doxygen 1.5.1
SourceForge.net Logo