omx_videoenc_component.c File Reference

#include <omxcore.h>
#include <omx_base_video_port.h>
#include <omx_videoenc_component.h>
#include <OMX_Video.h>

Go to the source code of this file.

Defines

#define MAX_COMPONENT_VIDEOENC   4
#define OUTPUT_ENCODED_COLOR_FMT   OMX_COLOR_FormatYUV420Planar

Functions

OMX_ERRORTYPE omx_videoenc_component_Constructor (OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
OMX_ERRORTYPE omx_videoenc_component_Destructor (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_videoenc_component_ffmpegLibInit (omx_videoenc_component_PrivateType *omx_videoenc_component_Private)
void omx_videoenc_component_ffmpegLibDeInit (omx_videoenc_component_PrivateType *omx_videoenc_component_Private)
void SetInternalVideoEncParameters (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_videoenc_component_Init (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_videoenc_component_Deinit (OMX_COMPONENTTYPE *openmaxStandComp)
void omx_videoenc_component_BufferMgmtCallback (OMX_COMPONENTTYPE *openmaxStandComp, OMX_BUFFERHEADERTYPE *pInputBuffer, OMX_BUFFERHEADERTYPE *pOutputBuffer)
OMX_ERRORTYPE omx_videoenc_component_SetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_videoenc_component_GetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_videoenc_component_MessageHandler (OMX_COMPONENTTYPE *openmaxStandComp, internalRequestMessageType *message)
OMX_ERRORTYPE omx_videoenc_component_ComponentRoleEnum (OMX_IN OMX_HANDLETYPE hComponent, OMX_OUT OMX_U8 *cRole, OMX_IN OMX_U32 nIndex)


Detailed Description

This component implements MPEG-4 video encoder. The MPEG-4 Video encoder is based on FFmpeg software library.

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_videoenc_component.c.


Define Documentation

#define MAX_COMPONENT_VIDEOENC   4

Maximum Number of Video Component Instance

Definition at line 36 of file omx_videoenc_component.c.

Referenced by omx_videoenc_component_Constructor().

#define OUTPUT_ENCODED_COLOR_FMT   OMX_COLOR_FormatYUV420Planar

The output encoded color format

Definition at line 42 of file omx_videoenc_component.c.


Function Documentation

void omx_videoenc_component_BufferMgmtCallback ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_BUFFERHEADERTYPE pInputBuffer,
OMX_BUFFERHEADERTYPE pOutputBuffer 
)

OMX_ERRORTYPE omx_videoenc_component_ComponentRoleEnum ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_U8 cRole,
OMX_IN OMX_U32  nIndex 
)

OMX_ERRORTYPE omx_videoenc_component_Constructor ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_STRING  cComponentName 
)

The Constructor of the video encoder component

Parameters:
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 ports. first we set the parameter common to both formats

now it's time to know the video coding type of the component

general configuration irrespective of any video formats setting other parameters of omx_videoenc_component_private

initializing the coenc context etc that was done earlier by ffmpeglibinit function

Definition at line 47 of file omx_videoenc_component.c.

References base_video_port_Constructor(), OMX_COMPONENTTYPE::ComponentRoleEnum, DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEBUG, OMX_VIDEO_PARAM_PORTFORMATTYPE::eColorFormat, OMX_VIDEO_PORTDEFINITIONTYPE::eColorFormat, OMX_PARAM_PORTDEFINITIONTYPE::format, OMX_COMPONENTTYPE::GetParameter, MAX_COMPONENT_VIDEOENC, OMX_PARAM_PORTDEFINITIONTYPE::nBufferSize, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameHeight, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameWidth, omx_base_filter_Constructor(), OMX_BASE_FILTER_INPUTPORT_INDEX, OMX_BASE_FILTER_OUTPUTPORT_INDEX, OMX_COLOR_FormatYUV420Planar, OMX_ErrorInsufficientResources, OMX_ErrorInvalidComponentName, OMX_ErrorNone, OMX_FALSE, OMX_TRUE, OMX_VIDEO_CodingMPEG4, OMX_VIDEO_CodingUnused, omx_videoenc_component_BufferMgmtCallback(), omx_videoenc_component_ComponentRoleEnum(), omx_videoenc_component_Destructor(), omx_videoenc_component_GetParameter(), omx_videoenc_component_MessageHandler(), omx_videoenc_component_SetParameter(), OMX_COMPONENTTYPE::pComponentPrivate, SetInternalVideoEncParameters(), OMX_COMPONENTTYPE::SetParameter, omx_base_video_PortType::sPortParam, omx_base_video_PortType::sVideoParam, tsem_init(), OMX_PARAM_PORTDEFINITIONTYPE::video, VIDEO_ENC_BASE_NAME, VIDEO_ENC_MPEG4_NAME, and OMX_VIDEO_PORTDEFINITIONTYPE::xFramerate.

Referenced by omx_component_library_Setup().

OMX_ERRORTYPE omx_videoenc_component_Deinit ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Deinitialization function of the video encoder

Definition at line 309 of file omx_videoenc_component.c.

References OMX_ErrorNone, OMX_FALSE, omx_videoenc_component_ffmpegLibDeInit(), and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_videoenc_component_MessageHandler().

OMX_ERRORTYPE omx_videoenc_component_Destructor ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The destructor of the video encoder component

Definition at line 162 of file omx_videoenc_component.c.

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

Referenced by omx_videoenc_component_Constructor().

void omx_videoenc_component_ffmpegLibDeInit ( omx_videoenc_component_PrivateType *  omx_videoenc_component_Private  ) 

It Deinitializates the ffmpeg framework, and close the ffmpeg video encoder of selected coding type

Definition at line 244 of file omx_videoenc_component.c.

Referenced by omx_videoenc_component_Deinit().

OMX_ERRORTYPE omx_videoenc_component_ffmpegLibInit ( omx_videoenc_component_PrivateType *  omx_videoenc_component_Private  ) 

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

OMX_ERRORTYPE omx_videoenc_component_Init ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Initialization function of the video encoder

Temporary First Output buffer size

Definition at line 295 of file omx_videoenc_component.c.

References OMX_ErrorNone, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_videoenc_component_MessageHandler().

OMX_ERRORTYPE omx_videoenc_component_MessageHandler ( OMX_COMPONENTTYPE openmaxStandComp,
internalRequestMessageType message 
)

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

void SetInternalVideoEncParameters ( OMX_COMPONENTTYPE openmaxStandComp  ) 


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