OpenMAX Bellagio 0.9.3
|
#include "omxcore.h"
Go to the source code of this file.
Data Structures | |
struct | ComponentListType |
struct | NameIndexType |
Macros | |
#define | MAX_COMPONENTS_TYPES_HANDLED 500 |
#define | RM_SHOW_NAME 0x01 |
#define | RM_SHOW_ADDRESS 0x02 |
Typedefs | |
typedef struct ComponentListType | ComponentListType |
typedef struct NameIndexType | NameIndexType |
Functions | |
OMX_ERRORTYPE | RM_RegisterComponent (char *name, int max_components) |
OMX_ERRORTYPE | addElemToList (ComponentListType **list, OMX_COMPONENTTYPE *openmaxStandComp, int index, OMX_BOOL bIsWaiting) |
OMX_ERRORTYPE | removeElemFromList (ComponentListType **list, OMX_COMPONENTTYPE *openmaxStandComp) |
int | numElemInList (ComponentListType *list) |
OMX_ERRORTYPE | clearList (ComponentListType **list) |
OMX_ERRORTYPE | RM_Init () |
OMX_ERRORTYPE | RM_Deinit () |
OMX_ERRORTYPE | RM_getResource (OMX_COMPONENTTYPE *openmaxStandComp) |
OMX_ERRORTYPE | RM_releaseResource (OMX_COMPONENTTYPE *openmaxStandComp) |
OMX_ERRORTYPE | RM_waitForResource (OMX_COMPONENTTYPE *openmaxStandComp) |
OMX_ERRORTYPE | RM_removeFromWaitForResource (OMX_COMPONENTTYPE *openmaxStandComp) |
void | RM_printList (ComponentListType *list, int viewFlag) |
Variables | |
int | globalIndex |
NameIndexType * | listOfcomponentRegistered |
ComponentListType ** | globalComponentList |
ComponentListType ** | globalWaitingComponentList |
#define MAX_COMPONENTS_TYPES_HANDLED 500 |
src/omx_reference_resource_manager.h
This simple resource manager emulates the behavior of a real RM. It applies the rules defined in the OpenMAX spec. It can be replaced in the future by a real system.
Copyright (C) 2007-2009 STMicroelectronics Copyright (C) 2007-2009 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
Definition at line 31 of file omx_reference_resource_manager.h.
#define RM_SHOW_ADDRESS 0x02 |
Definition at line 66 of file omx_reference_resource_manager.h.
#define RM_SHOW_NAME 0x01 |
Debug flags
Definition at line 65 of file omx_reference_resource_manager.h.
typedef struct ComponentListType ComponentListType |
Definition at line 36 of file omx_reference_resource_manager.h.
typedef struct NameIndexType NameIndexType |
Definition at line 44 of file omx_reference_resource_manager.h.
OMX_ERRORTYPE addElemToList | ( | ComponentListType ** | list, |
OMX_COMPONENTTYPE * | openmaxStandComp, | ||
int | index, | ||
OMX_BOOL | bIsWaiting | ||
) |
This function adds a new element to a given list. If it does not yet exists, this function also allocates the list.
Definition at line 114 of file omx_reference_resource_manager.c.
References DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEBUG, globalComponentList, globalWaitingComponentList, OMX_ErrorInsufficientResources, and OMX_COMPONENTTYPE::pComponentPrivate.
Referenced by RM_getResource(), and RM_waitForResource().
OMX_ERRORTYPE clearList | ( | ComponentListType ** | list | ) |
This function deallocate any remaining element in a list and dispose it
Definition at line 228 of file omx_reference_resource_manager.c.
References DEB_LEV_FUNCTION_NAME, DEBUG, ComponentListType::next, and OMX_ErrorNone.
Referenced by RM_Deinit().
int numElemInList | ( | ComponentListType * | list | ) |
This function returns the number of elements present in the list. If the list does not exists, this function returns 0 elements without further warnings
Definition at line 207 of file omx_reference_resource_manager.c.
References DEB_LEV_FUNCTION_NAME, DEB_LEV_SIMPLE_SEQ, DEBUG, and ComponentListType::next.
Referenced by RM_getResource(), and RM_releaseResource().
OMX_ERRORTYPE removeElemFromList | ( | ComponentListType ** | list, |
OMX_COMPONENTTYPE * | openmaxStandComp | ||
) |
This function removes the given element from the list, if present. If the list is empty, this function cleans up everything.
Definition at line 162 of file omx_reference_resource_manager.c.
References DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEBUG, ComponentListType::next, OMX_ErrorComponentNotFound, OMX_ErrorNone, OMX_ErrorUndefined, OMX_FALSE, OMX_TRUE, and ComponentListType::openmaxStandComp.
Referenced by RM_getResource(), RM_releaseResource(), and RM_removeFromWaitForResource().
OMX_ERRORTYPE RM_Deinit | ( | ) |
This function de-initializes the resource manager. In the current implementation its responsibility is to clean up any queue that can be left pending at the end of usage. With a correct use of the resource manager it won't happen, but it is safer to clean up everything this these lists are global and alive for all the life of IL client, beyond the usual OMX_Init - Deinit scope.
Definition at line 98 of file omx_reference_resource_manager.c.
References clearList(), DEB_LEV_FUNCTION_NAME, DEBUG, globalComponentList, globalWaitingComponentList, and OMX_ErrorNone.
Referenced by BOSA_ST_DeInitComponentLoader(), and BOSA_STE_DeInitComponentLoader().
OMX_ERRORTYPE RM_getResource | ( | OMX_COMPONENTTYPE * | openmaxStandComp | ) |
This function is executed by a component when it changes state from Loaded to Idle. If it return ErrorNone the resource is granted and it can transit to Idle. In case the resource is already busy, the resource manager preempt another component with a lower priority and a oldest time flag if it exists. Differently it returns OMX_ErrorInsufficientResources
Definition at line 349 of file omx_reference_resource_manager.c.
References addElemToList(), NameIndexType::component_name, DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEB_LEV_SIMPLE_SEQ, DEBUG, err, globalComponentList, NameIndexType::index, listOfcomponentRegistered, omx_base_component_PrivateType::name, omx_base_component_PrivateType::nGroupPriority, numElemInList(), OMX_ErrorInsufficientResources, OMX_ErrorNone, OMX_FALSE, ComponentListType::openmaxStandComp, OMX_COMPONENTTYPE::pComponentPrivate, preemptComponent(), removeElemFromList(), and searchLowerPriority().
Referenced by omx_base_component_DoStateSet().
OMX_ERRORTYPE RM_Init | ( | ) |
This function initializes the Resource manager. In the current implementation it does not perform any operation
Definition at line 47 of file omx_reference_resource_manager.c.
References NameIndexType::component_name, DEB_LEV_FUNCTION_NAME, DEBUG, globalComponentList, globalIndex, globalWaitingComponentList, NameIndexType::index, listOfcomponentRegistered, MAX_COMPONENTS_TYPES_HANDLED, and OMX_ErrorNone.
Referenced by BOSA_ST_InitComponentLoader(), and BOSA_STE_InitComponentLoader().
void RM_printList | ( | ComponentListType * | list, |
int | viewFlag | ||
) |
This debug function is capable of printing the full list actually stored
Definition at line 251 of file omx_reference_resource_manager.c.
References omx_base_component_PrivateType::name, ComponentListType::next, ComponentListType::openmaxStandComp, OMX_COMPONENTTYPE::pComponentPrivate, RM_SHOW_ADDRESS, and RM_SHOW_NAME.
OMX_ERRORTYPE RM_RegisterComponent | ( | char * | name, |
int | max_components | ||
) |
This function is called during initialization by any component interested in be handled by the internal resource manager
Definition at line 67 of file omx_reference_resource_manager.c.
References NameIndexType::component_name, DEB_LEV_FUNCTION_NAME, DEBUG, globalIndex, NameIndexType::index, listOfcomponentRegistered, NameIndexType::max_components, OMX_ErrorInsufficientResources, OMX_ErrorNone, and OMX_MAX_STRINGNAME_SIZE.
Referenced by omx_audio_mixer_component_Constructor(), omx_clocksrc_component_Constructor(), omx_video_scheduler_component_Constructor(), and omx_volume_component_Constructor().
OMX_ERRORTYPE RM_releaseResource | ( | OMX_COMPONENTTYPE * | openmaxStandComp | ) |
This function is called by a component when it transit from Idle to Loaded and can release its used resource handled by the resource manager
Definition at line 404 of file omx_reference_resource_manager.c.
References NameIndexType::component_name, DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEBUG, err, globalComponentList, globalWaitingComponentList, NameIndexType::index, listOfcomponentRegistered, omx_base_component_PrivateType::name, numElemInList(), OMX_CommandStateSet, OMX_ErrorNone, OMX_ErrorUndefined, OMX_SendCommand, OMX_StateIdle, ComponentListType::openmaxStandComp, OMX_COMPONENTTYPE::pComponentPrivate, and removeElemFromList().
Referenced by omx_base_component_DoStateSet().
OMX_ERRORTYPE RM_removeFromWaitForResource | ( | OMX_COMPONENTTYPE * | openmaxStandComp | ) |
This function removes a component from the waiting queue if the IL client decides that the component should not wait any more for the resource
Definition at line 490 of file omx_reference_resource_manager.c.
References NameIndexType::component_name, DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEBUG, globalComponentList, listOfcomponentRegistered, omx_base_component_PrivateType::name, OMX_ErrorNone, OMX_COMPONENTTYPE::pComponentPrivate, and removeElemFromList().
Referenced by omx_base_component_DoStateSet().
OMX_ERRORTYPE RM_waitForResource | ( | OMX_COMPONENTTYPE * | openmaxStandComp | ) |
This function adds the given component to the waiting queue for the given resource. When a resource becomes available through the RM_releaseResource function the first element in the queue is taken off the list and it receives the resource just released.
Definition at line 456 of file omx_reference_resource_manager.c.
References addElemToList(), NameIndexType::component_name, DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEBUG, globalWaitingComponentList, NameIndexType::index, listOfcomponentRegistered, omx_base_component_PrivateType::name, OMX_ErrorNone, OMX_TRUE, and OMX_COMPONENTTYPE::pComponentPrivate.
Referenced by omx_base_component_DoStateSet().
|
extern |
Definition at line 35 of file omx_reference_resource_manager.c.
Referenced by addElemToList(), RM_Deinit(), RM_getResource(), RM_Init(), RM_releaseResource(), and RM_removeFromWaitForResource().
|
extern |
src/omx_reference_resource_manager.c
This simple resource manager emulates the behavior of a real RM. It applies the rules defined in the OpenMAX spec. It can be replaced in the future by a real system.
Copyright (C) 2007-2009 STMicroelectronics Copyright (C) 2007-2009 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
Definition at line 33 of file omx_reference_resource_manager.c.
Referenced by RM_Init(), and RM_RegisterComponent().
|
extern |
Definition at line 36 of file omx_reference_resource_manager.c.
Referenced by addElemToList(), RM_Deinit(), RM_Init(), RM_releaseResource(), and RM_waitForResource().
|
extern |
Definition at line 34 of file omx_reference_resource_manager.c.
Referenced by RM_getResource(), RM_Init(), RM_RegisterComponent(), RM_releaseResource(), RM_removeFromWaitForResource(), and RM_waitForResource().