aboutsummaryrefslogtreecommitdiff
path: root/codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2009-12-02 22:18:44 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-02 22:18:44 -0800
commit9d018d8437a4936275270b7866b9bf557f566d37 (patch)
tree7c0ff1a49e7d6a193e45dd1874103859aaf37e36 /codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp
parent5e291bbb990db983435932e76319a2fd19a302c0 (diff)
parent674995079ccb3544671ae00d378d2d932ca9d062 (diff)
downloadopencore-9d018d8437a4936275270b7866b9bf557f566d37.tar.gz
am 67499507: Enable the support for selecting preferred video codecs (software based vs hardware based)
Merge commit '674995079ccb3544671ae00d378d2d932ca9d062' into eclair-mr2 * commit '674995079ccb3544671ae00d378d2d932ca9d062': Enable the support for selecting preferred video codecs (software based vs hardware based)
Diffstat (limited to 'codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp')
-rw-r--r--codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp b/codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp
index d28000e75..b6360d2f3 100644
--- a/codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp
+++ b/codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp
@@ -81,6 +81,7 @@ typedef struct PVOMXMasterRegistryStruct
{
OMX_U8 CompName[PV_OMX_MAX_COMPONENT_NAME_LENGTH];
OMX_U8 CompRole[PV_OMX_MAX_COMPONENT_NAME_LENGTH];
+ OMX_BOOL bHWAccelerated;
OMX_U32 OMXCoreIndex;
OMX_U32 CompIndex;
} PVOMXMasterRegistryStruct;
@@ -275,6 +276,11 @@ static OMX_ERRORTYPE _OMX_MasterInit(OMXMasterCoreGlobalData *data)
strncpy((OMX_STRING)pOMXMasterRegistry[master_index].CompRole, (OMX_STRING)ComponentRoles[role], PV_OMX_MAX_COMPONENT_NAME_LENGTH);
pOMXMasterRegistry[master_index].OMXCoreIndex = jj;
pOMXMasterRegistry[master_index].CompIndex = component_index;
+ if (strstr(ComponentName, "OMX.PV.")) {
+ pOMXMasterRegistry[master_index].bHWAccelerated = OMX_FALSE;
+ } else {
+ pOMXMasterRegistry[master_index].bHWAccelerated = OMX_TRUE;
+ }
master_index++;
}
@@ -529,7 +535,8 @@ OSCL_EXPORT_REF OMX_ERRORTYPE OMX_APIENTRY OMX_MasterGetHandle(
OMX_OUT OMX_HANDLETYPE* pHandle,
OMX_IN OMX_STRING cComponentName,
OMX_IN OMX_PTR pAppData,
- OMX_IN OMX_CALLBACKTYPE* pCallBacks)
+ OMX_IN OMX_CALLBACKTYPE* pCallBacks,
+ OMX_BOOL bHWAccelerated)
{
OMX_ERRORTYPE Status = OMX_ErrorNone;
OMX_U32 ii, kk;
@@ -561,8 +568,13 @@ OSCL_EXPORT_REF OMX_ERRORTYPE OMX_APIENTRY OMX_MasterGetHandle(
// go through the list of supported components and find the component based on its name (identifier)
if (!oscl_strcmp((OMX_STRING)pOMXMasterRegistry[ii].CompName, cComponentName))
{
- // found a matching name
- break;
+ // when we are not requesting a HW accelelrated codec, we must find a software
+ // codec.
+ if (!bHWAccelerated) {
+ if (!pOMXMasterRegistry[ii].bHWAccelerated) break;
+ } else {
+ break;
+ }
}
}
if (ii == (data->iTotalNumOMXComponents))