omx_fbdev_sink_component.h

Go to the documentation of this file.
00001 
00030 #ifndef _OMX_FBDEV_SINK_COMPONENT_H_
00031 #define _OMX_FBDEV_SINK_COMPONENT_H_
00032 
00033 #include <OMX_Types.h>
00034 #include <OMX_Component.h>
00035 #include <OMX_Core.h>
00036 #include <OMX_Video.h>
00037 #include <OMX_IVCommon.h>
00038 #include <pthread.h>
00039 #include <sys/ioctl.h>
00040 #include <sys/mman.h>
00041 #include <fcntl.h>
00042 #include <unistd.h>
00043 #include <string.h>
00044 #include <sys/time.h>
00045 
00046 #include <omx_base_video_port.h>
00047 #include <omx_base_sink.h>
00048 #include <linux/fb.h>
00049 
00053 #define FBDEV_FILENAME  "/dev/fb0" 
00054 
00056 #define MAX_NUM_OF_fbdev_sink_component_INSTANCES 2
00057 
00060 DERIVEDCLASS(omx_fbdev_sink_component_PortType, omx_base_video_PortType)
00061 #define omx_fbdev_sink_component_PortType_FIELDS omx_base_video_PortType_FIELDS \
00062  \
00063   OMX_CONFIG_RECTTYPE omxConfigCrop; \
00064  \
00065   OMX_CONFIG_ROTATIONTYPE omxConfigRotate; \
00066  \
00067   OMX_CONFIG_MIRRORTYPE omxConfigMirror; \
00068  \
00069   OMX_CONFIG_SCALEFACTORTYPE omxConfigScale; \
00070  \
00071   OMX_CONFIG_POINTTYPE omxConfigOutputPosition;
00072 ENDCLASS(omx_fbdev_sink_component_PortType)
00073 
00074 
00077 DERIVEDCLASS(omx_fbdev_sink_component_PrivateType, omx_base_sink_PrivateType)
00078 #define omx_fbdev_sink_component_PrivateType_FIELDS omx_base_sink_PrivateType_FIELDS \
00079  \
00080   int fd; \
00081  \
00082   struct fb_var_screeninfo vscr_info; \
00083  \
00084   struct fb_fix_screeninfo fscr_info; \
00085  \
00086   unsigned char *scr_ptr; \
00087  \
00088   OMX_COLOR_FORMATTYPE fbpxlfmt; \
00089  \
00090   OMX_U32 fbwidth; \
00091  \
00092   OMX_U32 fbheight; \
00093  \
00094   OMX_U32 fbbpp; \
00095  \
00096   OMX_S32 fbstride; \
00097  \
00098   OMX_U32 product;
00099 ENDCLASS(omx_fbdev_sink_component_PrivateType)
00100 
00101 /* Component private entry points declaration */
00102 OMX_ERRORTYPE omx_fbdev_sink_component_Constructor(OMX_COMPONENTTYPE *openmaxStandComp,OMX_STRING cComponentName);
00103 OMX_ERRORTYPE omx_fbdev_sink_component_Destructor(OMX_COMPONENTTYPE *openmaxStandComp);
00104 OMX_ERRORTYPE omx_fbdev_sink_component_Init(OMX_COMPONENTTYPE *openmaxStandComp);
00105 OMX_ERRORTYPE omx_fbdev_sink_component_Deinit(OMX_COMPONENTTYPE *openmaxStandComp);
00106 OMX_ERRORTYPE omx_fbdev_sink_component_MessageHandler(OMX_COMPONENTTYPE* , internalRequestMessageType*);
00107 
00108 void omx_fbdev_sink_component_BufferMgmtCallback(
00109   OMX_COMPONENTTYPE *openmaxStandComp,
00110   OMX_BUFFERHEADERTYPE* pInputBuffer);
00111 
00112 OMX_ERRORTYPE omx_fbdev_sink_component_SetConfig(
00113   OMX_IN  OMX_HANDLETYPE hComponent,
00114   OMX_IN  OMX_INDEXTYPE nIndex,
00115   OMX_IN  OMX_PTR pComponentConfigStructure);
00116 
00117 OMX_ERRORTYPE omx_fbdev_sink_component_GetParameter(
00118   OMX_IN  OMX_HANDLETYPE hComponent,
00119   OMX_IN  OMX_INDEXTYPE nParamIndex,
00120   OMX_INOUT OMX_PTR ComponentParameterStructure);
00121 
00122 OMX_ERRORTYPE omx_fbdev_sink_component_SetParameter(
00123   OMX_IN  OMX_HANDLETYPE hComponent,
00124   OMX_IN  OMX_INDEXTYPE nParamIndex,
00125   OMX_IN  OMX_PTR ComponentParameterStructure);
00126 
00127 OMX_ERRORTYPE omx_fbdev_sink_component_GetConfig(
00128   OMX_IN  OMX_HANDLETYPE hComponent,
00129   OMX_IN  OMX_INDEXTYPE nIndex,
00130   OMX_INOUT OMX_PTR pComponentConfigStructure);
00131 
00135 OMX_COLOR_FORMATTYPE find_omx_pxlfmt(struct fb_var_screeninfo *vscr_info);
00136 
00138 enum PixelFormat find_ffmpeg_pxlfmt(OMX_COLOR_FORMATTYPE omx_pxlfmt);
00139 
00141 OMX_S32 calcStride(OMX_U32 width, OMX_COLOR_FORMATTYPE omx_pxlfmt);
00142 
00144 void omx_img_copy(OMX_U8* src_ptr, OMX_S32 src_stride, OMX_U32 src_width, OMX_U32 src_height, 
00145                   OMX_S32 src_offset_x, OMX_S32 src_offset_y,
00146                   OMX_U8* dest_ptr, OMX_S32 dest_stride, OMX_U32 dest_width,  OMX_U32 dest_height, 
00147                   OMX_S32 dest_offset_x, OMX_S32 dest_offset_y, 
00148                   OMX_S32 cpy_width, OMX_U32 cpy_height, OMX_COLOR_FORMATTYPE colorformat,OMX_COLOR_FORMATTYPE fbpxlfmt);
00149 
00155 long GetTime();
00156 
00157 #endif

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