omx_videodec_component.c File Reference

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

Go to the source code of this file.

Defines

#define MAX_COMPONENT_VIDEODEC   4
#define OUTPUT_DECODED_COLOR_FMT   OMX_COLOR_FormatYUV420Planar
#define DEFAULT_WIDTH   352
#define DEFAULT_HEIGHT   288
#define DEFAULT_VIDEO_OUTPUT_BUF_SIZE   DEFAULT_WIDTH*DEFAULT_HEIGHT*3/2

Functions

OMX_ERRORTYPE omx_videodec_component_Constructor (OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
OMX_ERRORTYPE omx_videodec_component_Destructor (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_videodec_component_ffmpegLibInit (omx_videodec_component_PrivateType *omx_videodec_component_Private)
void omx_videodec_component_ffmpegLibDeInit (omx_videodec_component_PrivateType *omx_videodec_component_Private)
void SetInternalVideoParameters (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_videodec_component_Init (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_videodec_component_Deinit (OMX_COMPONENTTYPE *openmaxStandComp)
void omx_videodec_component_BufferMgmtCallback (OMX_COMPONENTTYPE *openmaxStandComp, OMX_BUFFERHEADERTYPE *pInputBuffer, OMX_BUFFERHEADERTYPE *pOutputBuffer)
OMX_ERRORTYPE omx_videodec_component_SetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_videodec_component_GetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_videodec_component_MessageHandler (OMX_COMPONENTTYPE *openmaxStandComp, internalRequestMessageType *message)
OMX_ERRORTYPE omx_videodec_component_ComponentRoleEnum (OMX_IN OMX_HANDLETYPE hComponent, OMX_OUT OMX_U8 *cRole, OMX_IN OMX_U32 nIndex)
OMX_ERRORTYPE omx_videodec_component_SetConfig (OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE omx_videodec_component_GetExtensionIndex (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE *pIndexType)


Detailed Description

This component implements H.264 / MPEG-4 AVC video decoder. The H.264 / MPEG-4 AVC Video decoder is based on the 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_videodec_component.c.


Define Documentation

#define DEFAULT_HEIGHT   288

Definition at line 45 of file omx_videodec_component.c.

#define DEFAULT_VIDEO_OUTPUT_BUF_SIZE   DEFAULT_WIDTH*DEFAULT_HEIGHT*3/2

define the max input buffer size

Definition at line 47 of file omx_videodec_component.c.

Referenced by omx_videodec_component_Constructor().

#define DEFAULT_WIDTH   352

Definition at line 44 of file omx_videodec_component.c.

#define MAX_COMPONENT_VIDEODEC   4

Maximum Number of Video Component Instance

Definition at line 36 of file omx_videodec_component.c.

Referenced by omx_videodec_component_Constructor().

#define OUTPUT_DECODED_COLOR_FMT   OMX_COLOR_FormatYUV420Planar

The output decoded color format

Definition at line 42 of file omx_videodec_component.c.

Referenced by omx_videodec_component_Constructor().


Function Documentation

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

This function is used to process the input buffer and provide one output buffer

Fill up the current input buffer when a new buffer has arrived

Send Port Settings changed call back

This condition becomes true when the input buffer has completely be consumed. In this case is immediately switched because there is no real buffer consumption

Few bytes may be left in the input buffer but can't generate one output frame. Request for new Input Buffer

Definition at line 405 of file omx_videodec_component.c.

References DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_PARAM_PORTDEFINITIONTYPE::format, OMX_BUFFERHEADERTYPE::nAllocLen, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameHeight, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameWidth, OMX_BUFFERHEADERTYPE::nOffset, OMX_BASE_FILTER_INPUTPORT_INDEX, OMX_EventPortSettingsChanged, OMX_VIDEO_CodingAVC, OMX_VIDEO_CodingMPEG4, OMX_BUFFERHEADERTYPE::pBuffer, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_video_PortType::sPortParam, tsem_down(), and OMX_PARAM_PORTDEFINITIONTYPE::video.

Referenced by omx_videodec_component_Constructor().

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

OMX_ERRORTYPE omx_videodec_component_Constructor ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_STRING  cComponentName 
)

The Constructor of the video decoder component

Parameters:
cComponentName is the name of the constructed component

Allocate Ports and call port constructor.

here we can override whatever defaults the base_component constructor set e.g. we can override the function pointers in the private struct

Domain specific section for the ports. first we set the parameter common to both formats

settings of output port parameter definition

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_videodec_component_private

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

Definition at line 52 of file omx_videodec_component.c.

References base_video_port_Constructor(), OMX_COMPONENTTYPE::ComponentRoleEnum, DEB_LEV_FUNCTION_NAME, DEBUG, DEFAULT_OUT_BUFFER_SIZE, DEFAULT_VIDEO_OUTPUT_BUF_SIZE, OMX_VIDEO_PARAM_PORTFORMATTYPE::eColorFormat, OMX_VIDEO_PORTDEFINITIONTYPE::eColorFormat, OMX_PARAM_PORTDEFINITIONTYPE::format, OMX_COMPONENTTYPE::GetExtensionIndex, OMX_COMPONENTTYPE::GetParameter, MAX_COMPONENT_VIDEODEC, OMX_PARAM_PORTDEFINITIONTYPE::nBufferSize, omx_base_filter_Constructor(), OMX_BASE_FILTER_INPUTPORT_INDEX, OMX_BASE_FILTER_OUTPUTPORT_INDEX, OMX_ErrorInsufficientResources, OMX_ErrorInvalidComponentName, OMX_ErrorNone, OMX_FALSE, OMX_TRUE, OMX_VIDEO_CodingAVC, OMX_VIDEO_CodingMPEG4, OMX_VIDEO_CodingUnused, omx_videodec_component_BufferMgmtCallback(), omx_videodec_component_ComponentRoleEnum(), omx_videodec_component_Destructor(), omx_videodec_component_GetExtensionIndex(), omx_videodec_component_GetParameter(), omx_videodec_component_MessageHandler(), omx_videodec_component_SetConfig(), omx_videodec_component_SetParameter(), OUTPUT_DECODED_COLOR_FMT, OMX_COMPONENTTYPE::pComponentPrivate, OMX_COMPONENTTYPE::SetConfig, SetInternalVideoParameters(), OMX_COMPONENTTYPE::SetParameter, omx_base_video_PortType::sPortParam, omx_base_video_PortType::sVideoParam, tsem_init(), OMX_PARAM_PORTDEFINITIONTYPE::video, VIDEO_DEC_BASE_NAME, VIDEO_DEC_H264_NAME, VIDEO_DEC_MPEG4_NAME, OMX_VIDEO_PARAM_PORTFORMATTYPE::xFramerate, and OMX_VIDEO_PORTDEFINITIONTYPE::xFramerate.

Referenced by omx_component_library_Setup().

OMX_ERRORTYPE omx_videodec_component_Deinit ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Deinitialization function of the video decoder

Definition at line 368 of file omx_videodec_component.c.

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

Referenced by omx_videodec_component_MessageHandler().

OMX_ERRORTYPE omx_videodec_component_Destructor ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The destructor of the video decoder component

Definition at line 173 of file omx_videodec_component.c.

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

Referenced by omx_videodec_component_Constructor().

void omx_videodec_component_ffmpegLibDeInit ( omx_videodec_component_PrivateType *  omx_videodec_component_Private  ) 

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

Definition at line 260 of file omx_videodec_component.c.

Referenced by omx_videodec_component_Deinit(), and omx_videodec_component_MessageHandler().

OMX_ERRORTYPE omx_videodec_component_ffmpegLibInit ( omx_videodec_component_PrivateType *  omx_videodec_component_Private  ) 

It initializates the FFmpeg framework, and opens an FFmpeg videodecoder of type specified by IL client

Find the decoder corresponding to the video type specified by IL client

necessary flags for MPEG-4 or H.264 stream

Definition at line 210 of file omx_videodec_component.c.

References DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_ErrorComponentNotFound, OMX_ErrorInsufficientResources, OMX_ErrorNone, OMX_VIDEO_CodingAVC, OMX_VIDEO_CodingMPEG4, and tsem_up().

Referenced by omx_videodec_component_MessageHandler().

OMX_ERRORTYPE omx_videodec_component_GetExtensionIndex ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_STRING  cParameterName,
OMX_OUT OMX_INDEXTYPE pIndexType 
)

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

OMX_ERRORTYPE omx_videodec_component_Init ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Initialization function of the video decoder

Temporary First Output buffer size

Definition at line 352 of file omx_videodec_component.c.

References OMX_ErrorNone, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_videodec_component_MessageHandler().

OMX_ERRORTYPE omx_videodec_component_MessageHandler ( OMX_COMPONENTTYPE openmaxStandComp,
internalRequestMessageType message 
)

OMX_ERRORTYPE omx_videodec_component_SetConfig ( OMX_HANDLETYPE  hComponent,
OMX_INDEXTYPE  nIndex,
OMX_PTR  pComponentConfigStructure 
)

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

void SetInternalVideoParameters ( OMX_COMPONENTTYPE openmaxStandComp  ) 


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