omx_fbdev_sink_component.c File Reference

#include <errno.h>
#include <omxcore.h>
#include <omx_fbdev_sink_component.h>
#include <config.h>

Go to the source code of this file.

Defines

#define HEIGHT_OFFSET   10
#define MAX_COMPONENT_FBDEVSINK   2

Functions

long GetTime ()
OMX_ERRORTYPE omx_fbdev_sink_component_Constructor (OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
OMX_ERRORTYPE omx_fbdev_sink_component_Destructor (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_S32 calcStride2 (omx_fbdev_sink_component_PrivateType *omx_fbdev_sink_component_Private)
OMX_ERRORTYPE omx_fbdev_sink_component_Init (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_fbdev_sink_component_Deinit (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_S32 calcStride (OMX_U32 width, OMX_COLOR_FORMATTYPE omx_pxlfmt)
OMX_COLOR_FORMATTYPE find_omx_pxlfmt (struct fb_var_screeninfo *vscr_info)
void omx_img_copy (OMX_U8 *src_ptr, OMX_S32 src_stride, OMX_U32 src_width, OMX_U32 src_height, OMX_S32 src_offset_x, OMX_S32 src_offset_y, OMX_U8 *dest_ptr, OMX_S32 dest_stride, OMX_U32 dest_width, OMX_U32 dest_height, OMX_S32 dest_offset_x, OMX_S32 dest_offset_y, OMX_S32 cpy_width, OMX_U32 cpy_height, OMX_COLOR_FORMATTYPE colorformat, OMX_COLOR_FORMATTYPE fbpxlfmt)
OMX_ERRORTYPE omx_fbdev_sink_component_port_SendBufferFunction (omx_base_PortType *openmaxStandPort, OMX_BUFFERHEADERTYPE *pBuffer)
 the entry point for sending buffers to the fbdev sink port
OMX_BOOL omx_fbdev_sink_component_ClockPortHandleFunction (omx_fbdev_sink_component_PrivateType *omx_fbdev_sink_component_Private, OMX_BUFFERHEADERTYPE *pInputBuffer)
void omx_fbdev_sink_component_BufferMgmtCallback (OMX_COMPONENTTYPE *openmaxStandComp, OMX_BUFFERHEADERTYPE *pInputBuffer)
OMX_ERRORTYPE omx_fbdev_sink_component_SetConfig (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_IN OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE omx_fbdev_sink_component_GetConfig (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_INOUT OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE omx_fbdev_sink_component_SetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_fbdev_sink_component_GetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_fbdev_sink_component_MessageHandler (OMX_COMPONENTTYPE *openmaxStandComp, internalRequestMessageType *message)


Define Documentation

#define HEIGHT_OFFSET   10

height offset - reqd tadjust the display position - at the centre of upper half of screen

Definition at line 37 of file omx_fbdev_sink_component.c.

Referenced by omx_fbdev_sink_component_BufferMgmtCallback(), and omx_fbdev_sink_component_Init().

#define MAX_COMPONENT_FBDEVSINK   2

Maximum number of sink component instances

Definition at line 46 of file omx_fbdev_sink_component.c.

Referenced by omx_fbdev_sink_component_Constructor().


Function Documentation

OMX_S32 calcStride ( OMX_U32  width,
OMX_COLOR_FORMATTYPE  omx_pxlfmt 
)

This function takes two inputs -

Parameters:
width is the input picture width
omx_pxlfmt is the input openmax standard pixel format It calculates the byte per pixel needed to display the picture with the input omx_pxlfmt The output stride for display is thus omx_fbdev_sink_component_Private->product of input width and byte per pixel

Definition at line 327 of file omx_fbdev_sink_component.c.

Referenced by omx_fbdev_sink_component_Constructor(), omx_fbdev_sink_component_SetParameter(), omx_ffmpeg_colorconv_component_BufferMgmtCallback(), omx_ffmpeg_colorconv_component_Constructor(), omx_ffmpeg_colorconv_component_SetParameter(), and omx_img_copy().

OMX_S32 calcStride2 ( omx_fbdev_sink_component_PrivateType *  omx_fbdev_sink_component_Private  ) 

Definition at line 214 of file omx_fbdev_sink_component.c.

Referenced by omx_fbdev_sink_component_Init().

OMX_COLOR_FORMATTYPE find_omx_pxlfmt ( struct fb_var_screeninfo *  vscr_info  ) 

Returns the OpenMAX color format type corresponding to an fbdev fb_var_screeninfo structure

Parameters:
vscr_info contains the frame buffer display settings We extract the rgba configuration of the frame buffer from this structure and thereby apply the appropriate OpenMAX standard color format equivalent to this configuration the r,g,b,a content length is needed to get the bit per pixel values r,g,b,a content offsets determine their respective positions

check if gray scale - if so then, switch according to bit per pixel criteria

now check the rgba components and set the corresponding color formats

Definition at line 409 of file omx_fbdev_sink_component.c.

References OMX_COLOR_Format12bitRGB444, OMX_COLOR_Format16bitARGB1555, OMX_COLOR_Format16bitARGB4444, OMX_COLOR_Format16bitBGR565, OMX_COLOR_Format16bitRGB565, OMX_COLOR_Format18bitARGB1665, OMX_COLOR_Format18bitRGB666, OMX_COLOR_Format19bitARGB1666, OMX_COLOR_Format24bitARGB1887, OMX_COLOR_Format24bitBGR888, OMX_COLOR_Format24bitRGB888, OMX_COLOR_Format25bitARGB1888, OMX_COLOR_Format32bitARGB8888, OMX_COLOR_Format32bitBGRA8888, OMX_COLOR_Format8bitRGB332, OMX_COLOR_FormatL16, OMX_COLOR_FormatL2, OMX_COLOR_FormatL24, OMX_COLOR_FormatL32, OMX_COLOR_FormatL4, OMX_COLOR_FormatL8, OMX_COLOR_FormatMonochrome, and OMX_COLOR_FormatUnused.

Referenced by omx_fbdev_sink_component_Init().

long GetTime (  ) 

Returns a time value in milliseconds based on a clock starting at some arbitrary base. Given a call to GetTime that returns a value of n a subsequent call to GetTime made m milliseconds later should return a value of (approximately) (n+m). This method is used, for instance, to compute the duration of call.

Definition at line 57 of file omx_fbdev_sink_component.c.

Referenced by omx_fbdev_sink_component_BufferMgmtCallback().

void omx_fbdev_sink_component_BufferMgmtCallback ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_BUFFERHEADERTYPE pInputBuffer 
)

buffer management callback function takes one input buffer and displays its contents

FIXME: Configuration values should be clamped to prevent memory trampling and potential segfaults. It might be best to store clamped AND unclamped values on a per-port basis so that OMX_GetConfig can still return the unclamped ones.

getting current time

Copy image data into in_buffer

Definition at line 1192 of file omx_fbdev_sink_component.c.

References DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEBUG, dequeue(), err, GetTime(), HEIGHT_OFFSET, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERHEADERTYPE::nFlags, OMX_BUFFERHEADERTYPE::nInputPortIndex, OMX_BUFFERHEADERTYPE::nTimeStamp, OMX_BASE_SINK_CLOCKPORT_INDEX, OMX_BASE_SINK_INPUTPORT_INDEX, OMX_BUFFERFLAG_STARTTIME, OMX_ErrorNone, omx_img_copy(), OMX_IndexConfigTimeClientStartTime, OMX_MirrorBoth, OMX_MirrorVertical, OMX_SetConfig, OMX_TIME_ClockStateRunning, OMX_BUFFERHEADERTYPE::pBuffer, OMX_COMPONENTTYPE::pComponentPrivate, PORT_IS_TUNNELED, setHeader(), and tsem_down().

Referenced by omx_fbdev_sink_component_Constructor().

OMX_BOOL omx_fbdev_sink_component_ClockPortHandleFunction ( omx_fbdev_sink_component_PrivateType *  omx_fbdev_sink_component_Private,
OMX_BUFFERHEADERTYPE pInputBuffer 
)

PORT_IS_BEING_FLUSHED(pPort) &&

Definition at line 1085 of file omx_fbdev_sink_component.c.

References DEB_LEV_ERR, DEBUG, dequeue(), err, OMX_TIME_MEDIATIMETYPE::eUpdateType, fd, omx_base_clock_PortType::hTunneledComponent, OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE::nMediaTimestamp, OMX_TIME_MEDIATIMETYPE::nOffset, OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE::nOffset, OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE::nPortIndex, OMX_TIME_CONFIG_TIMESTAMPTYPE::nPortIndex, OMX_BUFFERHEADERTYPE::nTimeStamp, OMX_TIME_CONFIG_TIMESTAMPTYPE::nTimestamp, omx_base_clock_PortType::nTunneledPort, OMX_TIME_MEDIATIMETYPE::nWallTimeAtMediaTime, OMX_BASE_SINK_CLOCKPORT_INDEX, OMX_ErrorNone, OMX_FALSE, OMX_IndexConfigTimeCurrentVideoReference, OMX_IndexConfigTimeMediaTimeRequest, OMX_SetConfig, OMX_TIME_UpdateRequestFulfillment, OMX_TIME_UpdateScaleChanged, OMX_TRUE, OMX_BUFFERHEADERTYPE::pBuffer, omx_base_clock_PortType::pBufferQueue, omx_base_clock_PortType::pBufferSem, OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE::pClientPrivate, PORT_IS_BEING_FLUSHED, PORT_IS_TUNNELED, omx_base_clock_PortType::ReturnBufferFunction, tsem_t::semval, setHeader(), omx_base_clock_PortType::sMediaTimeRequest, tsem_down(), and OMX_TIME_MEDIATIMETYPE::xScale.

Referenced by omx_fbdev_sink_component_port_SendBufferFunction().

OMX_ERRORTYPE omx_fbdev_sink_component_Constructor ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_STRING  cComponentName 
)

The Constructor

Parameters:
openmaxStandComp is the handle to be constructed
cComponentName is the name of the constructed component

we could create our own port structures here fixme maybe the base class could use a "port factory" function pointer?

Allocate Ports and call port constructor.

Domain specific section for the allocated port.

Set configs

set the function pointers

Definition at line 69 of file omx_fbdev_sink_component.c.

References base_clock_port_Constructor(), base_video_port_Constructor(), calcStride(), DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEB_LEV_PARAMS, DEBUG, err, fd, OMX_COMPONENTTYPE::GetParameter, MAX_COMPONENT_FBDEVSINK, omx_base_sink_Constructor(), OMX_BASE_SINK_INPUTPORT_INDEX, OMX_COLOR_Format24bitRGB888, OMX_ErrorInsufficientResources, OMX_ErrorNone, omx_fbdev_sink_component_BufferMgmtCallback(), omx_fbdev_sink_component_Destructor(), omx_fbdev_sink_component_GetParameter(), omx_fbdev_sink_component_MessageHandler(), omx_fbdev_sink_component_port_SendBufferFunction(), omx_fbdev_sink_component_SetParameter(), OMX_MirrorNone, OMX_PortDomainOther, OMX_PortDomainVideo, OMX_TRUE, OMX_COMPONENTTYPE::pComponentPrivate, setHeader(), and OMX_COMPONENTTYPE::SetParameter.

Referenced by omx_component_library_Setup().

OMX_ERRORTYPE omx_fbdev_sink_component_Deinit ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The deinitialization function It deallocates the frame buffer memory, and closes frame buffer

Definition at line 309 of file omx_fbdev_sink_component.c.

References OMX_ErrorHardware, OMX_ErrorNone, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_fbdev_sink_component_MessageHandler().

OMX_ERRORTYPE omx_fbdev_sink_component_Destructor ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Destructor

Definition at line 185 of file omx_fbdev_sink_component.c.

References fd, omx_base_sink_Destructor(), OMX_ErrorNone, OMX_PortDomainOther, OMX_PortDomainVideo, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_fbdev_sink_component_Constructor().

OMX_ERRORTYPE omx_fbdev_sink_component_GetConfig ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_INDEXTYPE  nIndex,
OMX_INOUT OMX_PTR  pComponentConfigStructure 
)

Definition at line 1408 of file omx_fbdev_sink_component.c.

References DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_CONFIG_POINTTYPE::nPortIndex, OMX_CONFIG_SCALEFACTORTYPE::nPortIndex, OMX_CONFIG_MIRRORTYPE::nPortIndex, OMX_CONFIG_ROTATIONTYPE::nPortIndex, OMX_CONFIG_RECTTYPE::nPortIndex, omx_base_component_GetConfig(), OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexConfigCommonInputCrop, OMX_IndexConfigCommonMirror, OMX_IndexConfigCommonOutputPosition, OMX_IndexConfigCommonRotate, OMX_IndexConfigCommonScale, OMX_COMPONENTTYPE::pComponentPrivate, and setHeader().

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

Definition at line 1604 of file omx_fbdev_sink_component.c.

References checkHeader(), DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_OTHER_PARAM_PORTFORMATTYPE::nPortIndex, OMX_VIDEO_PARAM_PORTFORMATTYPE::nPortIndex, omx_base_component_GetParameter(), OMX_BASE_SINK_INPUTPORT_INDEX, OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexParamOtherInit, OMX_IndexParamOtherPortFormat, OMX_IndexParamVideoInit, OMX_IndexParamVideoPortFormat, OMX_PortDomainOther, OMX_PortDomainVideo, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_fbdev_sink_component_Constructor().

OMX_ERRORTYPE omx_fbdev_sink_component_Init ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The initialization function This function opens the frame buffer device and allocates memory for display also it finds the frame buffer supported display formats

frame buffer display configuration get

From the frame buffer display rgb formats, find the corresponding standard OMX format It is needed to convert the input rgb content onto frame buffer supported rgb content

the allocated memory has more vertical reolution than needed because we want to show the output displayed not at the corner of screen, but at the centre of upper part of screen

memory map frame buf memory

Definition at line 231 of file omx_fbdev_sink_component.c.

References calcStride2(), DEB_LEV_ERR, DEB_LEV_PARAMS, DEB_LEV_SIMPLE_SEQ, DEBUG, FBDEV_FILENAME, find_omx_pxlfmt(), HEIGHT_OFFSET, OMX_BASE_SINK_INPUTPORT_INDEX, OMX_COLOR_FormatUnused, OMX_ErrorHardware, OMX_ErrorNone, OMX_ErrorUnsupportedSetting, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_fbdev_sink_component_MessageHandler().

OMX_ERRORTYPE omx_fbdev_sink_component_MessageHandler ( OMX_COMPONENTTYPE openmaxStandComp,
internalRequestMessageType message 
)

Definition at line 1666 of file omx_fbdev_sink_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_fbdev_sink_component_Deinit(), omx_fbdev_sink_component_Init(), OMX_StateExecuting, OMX_StateIdle, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_fbdev_sink_component_Constructor().

OMX_ERRORTYPE omx_fbdev_sink_component_port_SendBufferFunction ( omx_base_PortType openmaxStandPort,
OMX_BUFFERHEADERTYPE pBuffer 
)

the entry point for sending buffers to the fbdev sink 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 996 of file omx_fbdev_sink_component.c.

References omx_base_component_PrivateType::bMgmtSem, checkHeader(), DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEBUG, OMX_PARAM_PORTDEFINITIONTYPE::eDir, err, omx_base_component_PrivateType::name, OMX_PARAM_PORTDEFINITIONTYPE::nBufferCountActual, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERHEADERTYPE::nFlags, OMX_BUFFERHEADERTYPE::nInputPortIndex, OMX_BUFFERHEADERTYPE::nOutputPortIndex, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, OMX_BASE_SINK_CLOCKPORT_INDEX, OMX_BASE_SINK_INPUTPORT_INDEX, OMX_BUFFERFLAG_STARTTIME, OMX_DirInput, OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorIncorrectStateOperation, OMX_ErrorInvalidState, OMX_ErrorNone, OMX_FALSE, omx_fbdev_sink_component_ClockPortHandleFunction(), 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, omx_base_component_PrivateType::ports, queue(), omx_base_PortType::sPortParam, omx_base_PortType::standCompContainer, omx_base_component_PrivateType::state, omx_base_component_PrivateType::transientState, and tsem_up().

Referenced by omx_fbdev_sink_component_Constructor().

OMX_ERRORTYPE omx_fbdev_sink_component_SetConfig ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_INDEXTYPE  nIndex,
OMX_IN OMX_PTR  pComponentConfigStructure 
)

Definition at line 1294 of file omx_fbdev_sink_component.c.

References checkHeader(), DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_CONFIG_MIRRORTYPE::eMirror, err, OMX_CONFIG_RECTTYPE::nHeight, OMX_CONFIG_RECTTYPE::nLeft, OMX_CONFIG_POINTTYPE::nPortIndex, OMX_CONFIG_SCALEFACTORTYPE::nPortIndex, OMX_CONFIG_MIRRORTYPE::nPortIndex, OMX_CONFIG_ROTATIONTYPE::nPortIndex, OMX_CONFIG_RECTTYPE::nPortIndex, OMX_CONFIG_ROTATIONTYPE::nRotation, OMX_CONFIG_RECTTYPE::nTop, OMX_CONFIG_RECTTYPE::nWidth, OMX_CONFIG_POINTTYPE::nX, OMX_CONFIG_POINTTYPE::nY, omx_base_component_SetConfig(), OMX_BASE_SINK_INPUTPORT_INDEX, OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_ErrorUnsupportedSetting, OMX_IndexConfigCommonInputCrop, OMX_IndexConfigCommonMirror, OMX_IndexConfigCommonOutputPosition, OMX_IndexConfigCommonRotate, OMX_IndexConfigCommonScale, OMX_MirrorBoth, OMX_MirrorHorizontal, OMX_COMPONENTTYPE::pComponentPrivate, OMX_CONFIG_SCALEFACTORTYPE::xHeight, and OMX_CONFIG_SCALEFACTORTYPE::xWidth.

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

Definition at line 1486 of file omx_fbdev_sink_component.c.

References OMX_VIDEO_PORTDEFINITIONTYPE::bFlagErrorConcealment, calcStride(), OMX_VIDEO_PORTDEFINITIONTYPE::cMIMEType, DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_VIDEO_PARAM_PORTFORMATTYPE::eColorFormat, OMX_VIDEO_PARAM_PORTFORMATTYPE::eCompressionFormat, OMX_OTHER_PARAM_PORTFORMATTYPE::eFormat, OMX_OTHER_PORTDEFINITIONTYPE::eFormat, err, OMX_PARAM_PORTDEFINITIONTYPE::format, OMX_VIDEO_PORTDEFINITIONTYPE::nBitrate, OMX_PARAM_PORTDEFINITIONTYPE::nBufferCountActual, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameHeight, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameWidth, OMX_OTHER_PARAM_PORTFORMATTYPE::nPortIndex, OMX_VIDEO_PARAM_PORTFORMATTYPE::nPortIndex, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, omx_base_component_ParameterSanityCheck(), omx_base_component_SetParameter(), OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_ErrorUnsupportedSetting, OMX_IndexParamOtherPortFormat, OMX_IndexParamPortDefinition, OMX_IndexParamVideoPortFormat, OMX_PortDomainOther, OMX_PortDomainVideo, OMX_VIDEO_CodingUnused, OMX_PARAM_PORTDEFINITIONTYPE::other, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_clock_PortType::sOtherParam, omx_base_clock_PortType::sPortParam, OMX_PARAM_PORTDEFINITIONTYPE::video, OMX_VIDEO_PARAM_PORTFORMATTYPE::xFramerate, and OMX_VIDEO_PORTDEFINITIONTYPE::xFramerate.

Referenced by omx_fbdev_sink_component_Constructor().

void omx_img_copy ( OMX_U8 src_ptr,
OMX_S32  src_stride,
OMX_U32  src_width,
OMX_U32  src_height,
OMX_S32  src_offset_x,
OMX_S32  src_offset_y,
OMX_U8 dest_ptr,
OMX_S32  dest_stride,
OMX_U32  dest_width,
OMX_U32  dest_height,
OMX_S32  dest_offset_x,
OMX_S32  dest_offset_y,
OMX_S32  cpy_width,
OMX_U32  cpy_height,
OMX_COLOR_FORMATTYPE  colorformat,
OMX_COLOR_FORMATTYPE  fbpxlfmt 
)

This function copies source image to destination image of required dimension and color formats

Parameters:
src_ptr is the source image strting pointer
src_stride is the source image stride (src_width * byte_per_pixel)
src_width is source image width
src_height is source image height
src_offset_x is x offset value (if any) from starting pointer
src_offset_y is y offset value (if any) from starting pointer
dest_ptr is the destination image strting pointer
dest_stride is the destination image stride (dest_width * byte_per_pixel)
dest_width is destination image width
dest_height is destination image height
dest_offset_x is x offset value (if any) from ending pointer
dest_offset_y is y offset value (if any) from ending pointer
cpy_width is the source image copy width - it determines the portion of source image to be copied from source to destination image
cpy_height is the source image copy height - it determines the portion of source image to be copied from source to destination image
colorformat is the source image color format
fbpxlfmt undocumented

CAUTION: We don't do any checking of boundaries! (FIXME - see omx_ffmpeg_colorconv_component_BufferMgmtCallback) Input frame is planar, not interleaved Feel free to add more formats if implementing them

Watch out for odd or non-multiple-of-4 (4:1:1) luma resolutions (I don't check)

Planar vs. PackedPlanar will have to be handled differently if/when slicing is implemented

OpenMAX IL spec says chroma channels are subsampled by 4x horizontally AND vertically in YUV 4:1:1. Conventional wisdom (wiki) tells us that it is only subsampled horizontally. Following OpenMAX spec anyway. Technically I guess this would be YUV 4:1:0.

Planar vs. PackedPlanar will have to be handled differently if/when slicing is implemented

Planar vs. PackedPlanar will have to be handled differently if/when slicing is implemented

Pointers to the start of each plane to make things easier

Figure out total offsets

If input stride is negative, reverse source row order

Pointers to use with memcpy

Pointers to destination planes to make things easier

Figure out total offsets

If output stride is negative, reverse destination row order

Pointers to use with memcpy

fbpxlfmt is the output (frame buffer supported) image color format here fbpxlfmt is OMX_COLOR_Format32bitARGB8888 always because the frame buffer has configuration of rgba 8/0 8/0 8/0 8/0 with pixel depth 8 if other configuration frame buffer is employed then appropriate conversion policy should be written

Definition at line 542 of file omx_fbdev_sink_component.c.

References calcStride(), DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_COLOR_Format16bitARGB1555, OMX_COLOR_Format16bitBGR565, OMX_COLOR_Format16bitRGB565, OMX_COLOR_Format24bitBGR888, OMX_COLOR_Format24bitRGB888, OMX_COLOR_Format32bitARGB8888, OMX_COLOR_Format32bitBGRA8888, OMX_COLOR_Format8bitRGB332, OMX_COLOR_FormatYUV411PackedPlanar, OMX_COLOR_FormatYUV411Planar, OMX_COLOR_FormatYUV420PackedPlanar, OMX_COLOR_FormatYUV420Planar, OMX_COLOR_FormatYUV422PackedPlanar, and OMX_COLOR_FormatYUV422Planar.

Referenced by omx_fbdev_sink_component_BufferMgmtCallback(), and omx_ffmpeg_colorconv_component_BufferMgmtCallback().


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