omxcameratest.c File Reference

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <OMX_Core.h>
#include <OMX_Component.h>
#include <OMX_Types.h>
#include "omxcameratest.h"

Go to the source code of this file.

Functions

OMX_ERRORTYPE camera_sourceEventHandler (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_EVENTTYPE eEvent, OMX_OUT OMX_U32 Data1, OMX_OUT OMX_U32 Data2, OMX_OUT OMX_PTR pEventData)
OMX_ERRORTYPE camera_sourceFillBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE colorconvEventHandler (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_EVENTTYPE eEvent, OMX_OUT OMX_U32 Data1, OMX_OUT OMX_U32 Data2, OMX_OUT OMX_PTR pEventData)
OMX_ERRORTYPE colorconvEmptyBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE colorconvFillBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE fbsinkEventHandler (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_EVENTTYPE eEvent, OMX_OUT OMX_U32 Data1, OMX_OUT OMX_U32 Data2, OMX_OUT OMX_PTR pEventData)
OMX_ERRORTYPE fbsinkEmptyBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE setHeader (OMX_PTR header, OMX_U32 size)
 Simply fills the first two fields in any OMX structure with the size and the version.
OMX_ERRORTYPE setCameraParameters (OMX_BOOL bCameraStillImageMode)
OMX_ERRORTYPE setColorConvParameters ()
OMX_ERRORTYPE setFbsinkParameters ()
void display_help (char *cSelfName)
int main (int argc, char **argv)

Variables

OMX_CALLBACKTYPE camera_source_callbacks
OMX_CALLBACKTYPE colorconv_callbacks
OMX_CALLBACKTYPE fbsink_callbacks
appPrivateTypeappPriv = NULL
OMX_PORTBUFFERCTXT sCameraPortBufferList [(OMX_CAMPORT_INDEX_MAX)]
FILE * fCapture = NULL
char g_DefaultCaptureFileName [] = "capture.yuv"
FILE * fThumbnail = NULL
char g_DefaultThumbnailFileName [] = "thumbnail.yuv"


Detailed Description

Test application that uses two OpenMAX components, a camera and a fbsink. The preview port of the camera is tunneled with the fbsink component; The output video/image data of the capture port and thumbnail port of the camera are saved in disk files, respectively.

Copyright (C) 2007 Motorola

This code is licensed under LGPL see README for full LGPL notice.

Date Author Comment Fri, 06 Jul 2007 Motorola File created Fri, 15 Feb 2008 Motorola Update: The current implementation for this test app can only support one color format and image size on each port. To convert color formats and image sizes to other choices on some port, that port must be tunneled with a color conversion component. Tue, 06 Apr 2008 STM Update: Adding support for the color converter

This Program 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.

$Date$ Revision $Rev$ Author $Author$

Definition in file omxcameratest.c.


Function Documentation

OMX_ERRORTYPE camera_sourceEventHandler ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_EVENTTYPE  eEvent,
OMX_OUT OMX_U32  Data1,
OMX_OUT OMX_U32  Data2,
OMX_OUT OMX_PTR  pEventData 
)

OMX_ERRORTYPE camera_sourceFillBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

OMX_ERRORTYPE colorconvEmptyBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 210 of file omxcameratest.c.

OMX_ERRORTYPE colorconvEventHandler ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_EVENTTYPE  eEvent,
OMX_OUT OMX_U32  Data1,
OMX_OUT OMX_U32  Data2,
OMX_OUT OMX_PTR  pEventData 
)

callbacks implementation of color converter component

Definition at line 166 of file omxcameratest.c.

OMX_ERRORTYPE colorconvFillBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 224 of file omxcameratest.c.

void display_help ( char *  cSelfName  ) 

Definition at line 571 of file omxcameratest.c.

References g_DefaultCaptureFileName, and g_DefaultThumbnailFileName.

OMX_ERRORTYPE fbsinkEmptyBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 283 of file omxcameratest.c.

References DEB_LEV_FUNCTION_NAME, DEB_LEV_SIMPLE_SEQ, DEBUG, and OMX_ErrorNone.

OMX_ERRORTYPE fbsinkEventHandler ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_EVENTTYPE  eEvent,
OMX_OUT OMX_U32  Data1,
OMX_OUT OMX_U32  Data2,
OMX_OUT OMX_PTR  pEventData 
)

int main ( int  argc,
char **  argv 
)

OMX_ERRORTYPE setCameraParameters ( OMX_BOOL  bCameraStillImageMode  ) 

OMX_ERRORTYPE setColorConvParameters (  ) 

OMX_ERRORTYPE setFbsinkParameters (  ) 

OMX_ERRORTYPE setHeader ( OMX_PTR  header,
OMX_U32  size 
)

Simply fills the first two fields in any OMX structure with the size and the version.

Parameters:
header pointer to the structure to be filled
size size of the structure. It can be obtained with a call to sizeof of the structure type

Definition at line 298 of file omxcameratest.c.

References OMX_VERSIONTYPE::nRevision, OMX_VERSIONTYPE::nStep, OMX_VERSIONTYPE::nVersionMajor, OMX_VERSIONTYPE::nVersionMinor, OMX_ErrorNone, OMX_VERSIONTYPE::s, SPECREVISION, SPECSTEP, SPECVERSIONMAJOR, SPECVERSIONMINOR, VERSIONMAJOR, VERSIONMINOR, VERSIONREVISION, and VERSIONSTEP.


Variable Documentation

Definition at line 70 of file omxcameratest.c.

Initial value:

 {
  .EventHandler = camera_sourceEventHandler,
  .EmptyBufferDone = NULL,
  .FillBufferDone = camera_sourceFillBufferDone
}

Definition at line 50 of file omxcameratest.c.

Initial value:

 {
  .EventHandler = colorconvEventHandler,
  .EmptyBufferDone = colorconvEmptyBufferDone,
  .FillBufferDone = colorconvFillBufferDone
}

Definition at line 57 of file omxcameratest.c.

Initial value:

 {
  .EventHandler = fbsinkEventHandler,
  .EmptyBufferDone = fbsinkEmptyBufferDone,
  .FillBufferDone = NULL
}

Definition at line 64 of file omxcameratest.c.

FILE* fCapture = NULL

Definition at line 74 of file omxcameratest.c.

Referenced by camera_sourceFillBufferDone(), and main().

FILE* fThumbnail = NULL

Definition at line 76 of file omxcameratest.c.

Referenced by camera_sourceFillBufferDone(), and main().

char g_DefaultCaptureFileName[] = "capture.yuv"

Definition at line 75 of file omxcameratest.c.

Referenced by display_help(), and main().

char g_DefaultThumbnailFileName[] = "thumbnail.yuv"

Definition at line 77 of file omxcameratest.c.

Referenced by display_help(), and main().

OMX_PORTBUFFERCTXT sCameraPortBufferList[(OMX_CAMPORT_INDEX_MAX)]

Definition at line 72 of file omxcameratest.c.


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