aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2009-12-01 14:49:58 -0800
committerJames Dong <jdong@google.com>2009-12-02 17:25:46 -0800
commit674995079ccb3544671ae00d378d2d932ca9d062 (patch)
treea4bf99d4b171ba3558a87511963b90853a8e7f5d
parenta9e855cd0ce9104c087b748c68c67c2621ae2072 (diff)
downloadopencore-674995079ccb3544671ae00d378d2d932ca9d062.tar.gz
Enable the support for selecting preferred video codecs (software based vs hardware based)
This patch allows us to exclusively use software video codec for metadata retriever to avoid cases where the metadata retriever contents hw accelerated video codecs with some foreground video playback process. Currently, if the hw accelerated video codec is taken by the metadata retriever, then the foreground video playback process has to use software-based video codec for playback. End users won't have a very good experience using software-based video codec for playing high resolution videos in the foreground, if not always impossible. The change touches many files in OpenCore, but the actual change in each file is just a line or two. Thanks for comments from the reviewers. I was able to greatly reduce the number of files that are changed. We should have used the configuration files to advertise whether an omx core is hardware-based or software-based. Currently, this patch recognizes the software codecs by checking the component name. If the component name contains "PV", then it is a software-based codec. This is a hack. In addition, it would be nice to have more options for selecting a codec. For instance: option a. hardware only; b. hardware preferred; c. software only and d. software preferred. but that adds more complexity. Removed a new method based on reviewer's comment.
-rw-r--r--android/metadatadriver.cpp2
-rw-r--r--codecs_v2/omx/omx_common/include/pv_omxcore.h3
-rw-r--r--codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp18
-rw-r--r--engines/adapters/player/framemetadatautility/include/pv_frame_metadata_factory.h3
-rw-r--r--engines/adapters/player/framemetadatautility/src/pv_frame_metadata_factory.cpp5
-rw-r--r--engines/adapters/player/framemetadatautility/src/pv_frame_metadata_utility.cpp11
-rw-r--r--engines/adapters/player/framemetadatautility/src/pv_frame_metadata_utility.h6
-rw-r--r--engines/player/config/core/pv_player_node_registry_populator.cpp4
-rw-r--r--engines/player/include/pv_player_factory.h3
-rw-r--r--engines/player/src/pv_player_engine.cpp12
-rw-r--r--engines/player/src/pv_player_engine.h6
-rw-r--r--engines/player/src/pv_player_factory.cpp5
-rw-r--r--engines/player/src/pv_player_node_registry.cpp17
-rw-r--r--engines/player/src/pv_player_node_registry.h2
-rw-r--r--nodes/common/include/pv_player_node_registry_interface.h2
-rw-r--r--nodes/pvomxbasedecnode/include/pvmf_omx_basedec_node.h4
-rw-r--r--nodes/pvomxbasedecnode/src/pvmf_omx_basedec_node.cpp7
-rw-r--r--nodes/pvomxvideodecnode/include/pvmf_omx_videodec_factory.h2
-rw-r--r--nodes/pvomxvideodecnode/src/pvmf_omx_videodec_factory.cpp4
-rw-r--r--nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp4
-rw-r--r--nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.h2
21 files changed, 81 insertions, 41 deletions
diff --git a/android/metadatadriver.cpp b/android/metadatadriver.cpp
index 3856e5d5e..128554f08 100644
--- a/android/metadatadriver.cpp
+++ b/android/metadatadriver.cpp
@@ -530,7 +530,7 @@ void MetadataDriver::handleCreate()
{
LOGV("handleCreate");
int error = 0;
- OSCL_TRY(error, mUtil = PVFrameAndMetadataFactory::CreateFrameAndMetadataUtility((char*)PVMF_MIME_YUV420, this, this, this));
+ OSCL_TRY(error, mUtil = PVFrameAndMetadataFactory::CreateFrameAndMetadataUtility((char*)PVMF_MIME_YUV420, this, this, this, false));
if (error || mUtil->SetMode(PV_FRAME_METADATA_INTERFACE_MODE_SOURCE_METADATA_AND_THUMBNAIL) != PVMFSuccess) {
handleCommandFailure();
} else {
diff --git a/codecs_v2/omx/omx_common/include/pv_omxcore.h b/codecs_v2/omx/omx_common/include/pv_omxcore.h
index 9b42e8ac6..57f026ca0 100644
--- a/codecs_v2/omx/omx_common/include/pv_omxcore.h
+++ b/codecs_v2/omx/omx_common/include/pv_omxcore.h
@@ -312,7 +312,8 @@ class OMXGlobalData
OSCL_IMPORT_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_IN OMX_BOOL bHWAccelerated = OMX_TRUE);
OSCL_IMPORT_REF OMX_ERRORTYPE OMX_MasterGetRolesOfComponent(
OMX_IN OMX_STRING compName,
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))
diff --git a/engines/adapters/player/framemetadatautility/include/pv_frame_metadata_factory.h b/engines/adapters/player/framemetadatautility/include/pv_frame_metadata_factory.h
index a40a81d43..1729798f4 100644
--- a/engines/adapters/player/framemetadatautility/include/pv_frame_metadata_factory.h
+++ b/engines/adapters/player/framemetadatautility/include/pv_frame_metadata_factory.h
@@ -60,7 +60,8 @@ class PVFrameAndMetadataFactory
OSCL_IMPORT_REF static PVFrameAndMetadataInterface* CreateFrameAndMetadataUtility(char *aOutputFormatMIMEType,
PVCommandStatusObserver* aCmdStatusObserver,
PVErrorEventObserver *aErrorEventObserver,
- PVInformationalEventObserver *aInfoEventObserver);
+ PVInformationalEventObserver *aInfoEventObserver,
+ bool aHwAccelerate = true);
/**
* This function allows the application to delete an instance of a pvFrameAndMetadata utility
* and reclaim all allocated resources. An utility instance can be deleted only in
diff --git a/engines/adapters/player/framemetadatautility/src/pv_frame_metadata_factory.cpp b/engines/adapters/player/framemetadatautility/src/pv_frame_metadata_factory.cpp
index a79143edf..cd00b51e7 100644
--- a/engines/adapters/player/framemetadatautility/src/pv_frame_metadata_factory.cpp
+++ b/engines/adapters/player/framemetadatautility/src/pv_frame_metadata_factory.cpp
@@ -47,9 +47,10 @@ OSCL_DLL_ENTRY_POINT_DEFAULT()
OSCL_EXPORT_REF PVFrameAndMetadataInterface *PVFrameAndMetadataFactory::CreateFrameAndMetadataUtility(char *aOutputFormatMIMEType,
PVCommandStatusObserver* aCmdStatusObserver,
PVErrorEventObserver *aErrorEventObserver,
- PVInformationalEventObserver *aInfoEventObserver)
+ PVInformationalEventObserver *aInfoEventObserver,
+ bool aHwAccelerated)
{
- return PVFrameAndMetadataUtility::New(aOutputFormatMIMEType, aCmdStatusObserver, aErrorEventObserver, aInfoEventObserver);
+ return PVFrameAndMetadataUtility::New(aOutputFormatMIMEType, aCmdStatusObserver, aErrorEventObserver, aInfoEventObserver, aHwAccelerated);
}
diff --git a/engines/adapters/player/framemetadatautility/src/pv_frame_metadata_utility.cpp b/engines/adapters/player/framemetadatautility/src/pv_frame_metadata_utility.cpp
index da833b063..370b31da8 100644
--- a/engines/adapters/player/framemetadatautility/src/pv_frame_metadata_utility.cpp
+++ b/engines/adapters/player/framemetadatautility/src/pv_frame_metadata_utility.cpp
@@ -37,7 +37,7 @@ static const char PVFMUTIL_FRAMERETRIEVAL_TIMEOUT_KEY[] = "x-pvmf/fmu/timeout-fr
#define PVFMUTIL_VIDEOFRAMEBUFFER_MEMPOOL_BUFFERSIZE PVFMUTIL_VIDEOFRAMEBUFFER_MAXSIZE*2
PVFrameAndMetadataUtility* PVFrameAndMetadataUtility::New(char *aOutputFormatMIMEType, PVCommandStatusObserver *aCmdObserver,
- PVErrorEventObserver *aErrorObserver, PVInformationalEventObserver *aInfoObserver)
+ PVErrorEventObserver *aErrorObserver, PVInformationalEventObserver *aInfoObserver, bool aHwAccelerated)
{
if (aOutputFormatMIMEType == NULL || aCmdObserver == NULL ||
aErrorObserver == NULL || aInfoObserver == NULL)
@@ -47,7 +47,7 @@ PVFrameAndMetadataUtility* PVFrameAndMetadataUtility::New(char *aOutputFormatMIM
}
PVFrameAndMetadataUtility* util = NULL;
- util = OSCL_NEW(PVFrameAndMetadataUtility, ());
+ util = OSCL_NEW(PVFrameAndMetadataUtility, (aHwAccelerated));
if (util)
{
util->Construct(aOutputFormatMIMEType,
@@ -374,7 +374,8 @@ PVCommandId PVFrameAndMetadataUtility::RemoveDataSource(PVPlayerDataSource& aDat
}
-PVFrameAndMetadataUtility::PVFrameAndMetadataUtility() :
+PVFrameAndMetadataUtility::PVFrameAndMetadataUtility(bool aHwAccelerated) :
+ iHwAccelerated(aHwAccelerated),
OsclTimerObject(OsclActiveObject::EPriorityNominal, "PVFrameMetadataUtility"),
iCommandId(0),
iState(PVFM_UTILITY_STATE_IDLE),
@@ -433,7 +434,7 @@ void PVFrameAndMetadataUtility::Construct(char *aOutputFormatMIMEType, PVCommand
iInfoEventObserver = aInfoObserver;
// Create the player instance
- iPlayer = PVPlayerFactory::CreatePlayer(this, this, this);
+ iPlayer = PVPlayerFactory::CreatePlayer(this, this, this, iHwAccelerated);
OSCL_ASSERT(iPlayer != NULL);
// Allocate memory for vectors
@@ -2615,7 +2616,7 @@ PVMFStatus PVFrameAndMetadataUtility::DoPlayerShutdownRestart(void)
leavecode = 0;
PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iPerfLogger, PVLOGMSG_NOTICE,
(0, "PVFrameAndMetadataUtility::CreatePlayer Called Tick=%d", OsclTickCount::TickCount()));
- OSCL_TRY(leavecode, iPlayer = PVPlayerFactory::CreatePlayer(this, this, this));
+ OSCL_TRY(leavecode, iPlayer = PVPlayerFactory::CreatePlayer(this, this, this, iHwAccelerated));
OSCL_FIRST_CATCH_ANY(leavecode,
PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVFrameAndMetadataUtility::DoPlayerShutdownRestart() Player engine could not be instantiated! Asserting"));
OSCL_ASSERT(false);
diff --git a/engines/adapters/player/framemetadatautility/src/pv_frame_metadata_utility.h b/engines/adapters/player/framemetadatautility/src/pv_frame_metadata_utility.h
index 3b2208c40..2fb9c1f07 100644
--- a/engines/adapters/player/framemetadatautility/src/pv_frame_metadata_utility.h
+++ b/engines/adapters/player/framemetadatautility/src/pv_frame_metadata_utility.h
@@ -411,7 +411,8 @@ class PVFrameAndMetadataUtility : public OsclTimerObject,
static PVFrameAndMetadataUtility* New(char *aOutputFormatMIMEType,
PVCommandStatusObserver *aCmdObserver,
PVErrorEventObserver *aErrorObserver,
- PVInformationalEventObserver *aInfoObserver);
+ PVInformationalEventObserver *aInfoObserver,
+ bool aHwAccelerated = true);
~PVFrameAndMetadataUtility();
// From PVFrameAndMetadataInterface
@@ -444,9 +445,10 @@ class PVFrameAndMetadataUtility : public OsclTimerObject,
PVMFStatus verifyParametersSync(PvmiMIOSession aSession, PvmiKvp* aParameters, int aNumElements);
private:
+ bool iHwAccelerated;
PVMFBasicErrorInfoMessage* CreateBasicErrInfoMessage(PVMFErrorInfoMessageInterface* nextmsg, PVFMErrorEventType aErrEvent = PVFMErrPlayerEngine);
- PVFrameAndMetadataUtility();
+ PVFrameAndMetadataUtility(bool aHwAccelerated);
void Construct(char *aOutputFormatMIMEType,
PVCommandStatusObserver *aCmdObserver,
PVErrorEventObserver *aErrorObserver,
diff --git a/engines/player/config/core/pv_player_node_registry_populator.cpp b/engines/player/config/core/pv_player_node_registry_populator.cpp
index e53438741..358421730 100644
--- a/engines/player/config/core/pv_player_node_registry_populator.cpp
+++ b/engines/player/config/core/pv_player_node_registry_populator.cpp
@@ -150,7 +150,9 @@ void PVPlayerRegistryPopulator::RegisterAllNodes(PVPlayerNodeRegistryInterface*
nodeinfo.iNodeUUID = KPVMFOMXVideoDecNodeUuid;
nodeinfo.iOutputType.clear();
nodeinfo.iOutputType.push_back(PVMF_MIME_YUV420);
- nodeinfo.iNodeCreateFunc = PVMFOMXVideoDecNodeFactory::CreatePVMFOMXVideoDecNode;
+ // Only CreatePVMFOMXVideoDecNode has a different funtional pointer type
+ // we do a cast here so that iNodeCreateFunc can be used uniformly for other types of nodes
+ nodeinfo.iNodeCreateFunc = (PVMFNodeInterface*(*)(int32))PVMFOMXVideoDecNodeFactory::CreatePVMFOMXVideoDecNode;
nodeinfo.iNodeReleaseFunc = PVMFOMXVideoDecNodeFactory::DeletePVMFOMXVideoDecNode;
aRegistry->RegisterNode(nodeinfo);
#endif
diff --git a/engines/player/include/pv_player_factory.h b/engines/player/include/pv_player_factory.h
index e5790a245..86679a3d7 100644
--- a/engines/player/include/pv_player_factory.h
+++ b/engines/player/include/pv_player_factory.h
@@ -60,7 +60,8 @@ class PVPlayerFactory
**/
OSCL_IMPORT_REF static PVPlayerInterface* CreatePlayer(PVCommandStatusObserver* aCmdStatusObserver,
PVErrorEventObserver *aErrorEventObserver,
- PVInformationalEventObserver *aInfoEventObserver);
+ PVInformationalEventObserver *aInfoEventObserver,
+ bool aHwAccelerated = true);
/**
* This function allows the application to delete an instance of a pvPlayer
* and reclaim all allocated resources. A player can be deleted only in
diff --git a/engines/player/src/pv_player_engine.cpp b/engines/player/src/pv_player_engine.cpp
index 567d1c9c9..1027bb663 100644
--- a/engines/player/src/pv_player_engine.cpp
+++ b/engines/player/src/pv_player_engine.cpp
@@ -96,10 +96,11 @@
PVPlayerEngine* PVPlayerEngine::New(PVCommandStatusObserver* aCmdStatusObserver,
PVErrorEventObserver *aErrorEventObserver,
- PVInformationalEventObserver *aInfoEventObserver)
+ PVInformationalEventObserver *aInfoEventObserver,
+ bool aHwAccelerated)
{
PVPlayerEngine* engine = NULL;
- engine = OSCL_NEW(PVPlayerEngine, ());
+ engine = OSCL_NEW(PVPlayerEngine, (aHwAccelerated));
if (engine)
{
engine->Construct(aCmdStatusObserver,
@@ -1026,7 +1027,8 @@ bool PVPlayerEngine::queryInterface(const PVUuid& uuid, PVInterface*& iface)
-PVPlayerEngine::PVPlayerEngine() :
+PVPlayerEngine::PVPlayerEngine(bool aHwAccelerated) :
+ iHwAccelerated(aHwAccelerated),
OsclTimerObject(OsclActiveObject::EPriorityNominal, "PVPlayerEngine"),
iCommandId(0),
iState(PVP_ENGINE_STATE_IDLE),
@@ -4459,7 +4461,7 @@ PVMFStatus PVPlayerEngine::DoSetupSourceNode(PVCommandId aCmdId, OsclAny* aCmdCo
}
int32 leavecode = 0;
- OSCL_TRY(leavecode, iSourceNode = iPlayerNodeRegistry.CreateNode(foundUuids[0]));
+ OSCL_TRY(leavecode, iSourceNode = iPlayerNodeRegistry.CreateNode(foundUuids[0], true));
OSCL_FIRST_CATCH_ANY(leavecode,
PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSetupDecNode() Error in creating SourceNode"));
return PVMFFailure;);
@@ -6729,7 +6731,7 @@ PVMFStatus PVPlayerEngine::DoDecNodeQueryCapConfigIF(PVCommandId aCmdId, OsclAny
if (!foundUuids.empty())
{
PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "PVPlayerEngine::DoDecNodeQueryCapConfigIF() Node found for %s, sink %s", currTrack->getTrackMimeType().get_str(), iSinkFormat.getMIMEStrPtr()));
- iTrackSelectionList[i].iTsDecNode = iPlayerNodeRegistry.CreateNode(foundUuids[0]);
+ iTrackSelectionList[i].iTsDecNode = iPlayerNodeRegistry.CreateNode(foundUuids[0], iHwAccelerated);
if (iTrackSelectionList[i].iTsDecNode != NULL)
{
diff --git a/engines/player/src/pv_player_engine.h b/engines/player/src/pv_player_engine.h
index a8a6d6c76..be6b16d0b 100644
--- a/engines/player/src/pv_player_engine.h
+++ b/engines/player/src/pv_player_engine.h
@@ -893,7 +893,8 @@ class PVPlayerEngine : public OsclTimerObject,
public:
static PVPlayerEngine* New(PVCommandStatusObserver *aCmdObserver,
PVErrorEventObserver *aErrorObserver,
- PVInformationalEventObserver *aInfoObserver);
+ PVInformationalEventObserver *aInfoObserver,
+ bool aHwAccelerated);
~PVPlayerEngine();
// From PVPlayerInterface
@@ -967,7 +968,7 @@ class PVPlayerEngine : public OsclTimerObject,
void PVPlayerWatchdogTimerEvent();
private:
- PVPlayerEngine();
+ PVPlayerEngine(bool aHwAccelerated);
void Construct(PVCommandStatusObserver *aCmdObserver,
PVErrorEventObserver *aErrorObserver,
PVInformationalEventObserver *aInfoObserver);
@@ -1179,6 +1180,7 @@ class PVPlayerEngine : public OsclTimerObject,
PVMFStatus DoVerifyAndSetPlayerParameter(PvmiKvp& aParameter, bool aSetParam);
PVMFStatus DoVerifyAndSetPlayerProductInfoParameter(PvmiKvp& aParameter, bool aSetParam);
PVMFStatus DoSetConfigSyncMargin(int32 aEarlyMargin, int32 aLateMargin, int32 aMediaType);
+ bool iHwAccelerated;
int32 iCapConfigContext;
// Engine datapath and related variables
diff --git a/engines/player/src/pv_player_factory.cpp b/engines/player/src/pv_player_factory.cpp
index 1eb56b799..ff114b14a 100644
--- a/engines/player/src/pv_player_factory.cpp
+++ b/engines/player/src/pv_player_factory.cpp
@@ -44,9 +44,10 @@ OSCL_DLL_ENTRY_POINT_DEFAULT()
OSCL_EXPORT_REF PVPlayerInterface *PVPlayerFactory::CreatePlayer(PVCommandStatusObserver* aCmdStatusObserver,
PVErrorEventObserver *aErrorEventObserver,
- PVInformationalEventObserver *aInfoEventObserver)
+ PVInformationalEventObserver *aInfoEventObserver,
+ bool aHwAccelerated)
{
- return PVPlayerEngine::New(aCmdStatusObserver, aErrorEventObserver, aInfoEventObserver);
+ return PVPlayerEngine::New(aCmdStatusObserver, aErrorEventObserver, aInfoEventObserver, aHwAccelerated);
}
OSCL_EXPORT_REF bool PVPlayerFactory::DeletePlayer(PVPlayerInterface* aPlayer)
diff --git a/engines/player/src/pv_player_node_registry.cpp b/engines/player/src/pv_player_node_registry.cpp
index 3b5bc139c..3aa8aeba1 100644
--- a/engines/player/src/pv_player_node_registry.cpp
+++ b/engines/player/src/pv_player_node_registry.cpp
@@ -231,7 +231,7 @@ PVMFStatus PVPlayerNodeRegistry::QueryRegistry(PVMFFormatType& aInputType, PVMFF
}
-PVMFNodeInterface* PVPlayerNodeRegistry::CreateNode(PVUuid& aUuid)
+PVMFNodeInterface* PVPlayerNodeRegistry::CreateNode(PVUuid& aUuid, bool aHwAccelerated)
{
PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "PVPlayerNodeRegistry::CreateNode() IN"));
bool iFoundFlag = false;
@@ -266,8 +266,21 @@ PVMFNodeInterface* PVPlayerNodeRegistry::CreateNode(PVUuid& aUuid)
#endif
if (NULL != nodeInfo->iNodeCreateFunc)
{
- nodeInterface = (*(iType[NodeSearchCount].iNodeCreateFunc))(priority);
+ if (KPVMFOMXVideoDecNodeUuid == aUuid)
+ {
+ // FIXME:
+ // for now, we care about whether it is hardware-based or not only when it is a video decoder node.
+ // do a cast on the fucntion pointer
+ PVMFNodeInterface*(*aVideoDecNodeCreateFunc)(int32, bool);
+ aVideoDecNodeCreateFunc = (PVMFNodeInterface*(*)(int32, bool)) (iType[NodeSearchCount].iNodeCreateFunc);
+ nodeInterface = (*(aVideoDecNodeCreateFunc))(priority, aHwAccelerated);
+ }
+ else
+ {
+ nodeInterface = (*(iType[NodeSearchCount].iNodeCreateFunc))(priority);
+ }
}
+
PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "PVPlayerNodeRegistry::CreateNode() OUT"));
return nodeInterface;
}
diff --git a/engines/player/src/pv_player_node_registry.h b/engines/player/src/pv_player_node_registry.h
index 42b54b6e0..f4426d0a7 100644
--- a/engines/player/src/pv_player_node_registry.h
+++ b/engines/player/src/pv_player_node_registry.h
@@ -118,7 +118,7 @@ class PVPlayerNodeRegistry : public PVPlayerNodeRegistryInterface
*
* @returns a pointer to node
**/
- virtual PVMFNodeInterface* CreateNode(PVUuid& aUuid);
+ virtual PVMFNodeInterface* CreateNode(PVUuid& aUuid, bool aHwAccelerated);
/**
* The ReleaseNode for PVPlayerNodeRegistry. Used for releasing a node.
diff --git a/nodes/common/include/pv_player_node_registry_interface.h b/nodes/common/include/pv_player_node_registry_interface.h
index 1efa265be..0205531d1 100644
--- a/nodes/common/include/pv_player_node_registry_interface.h
+++ b/nodes/common/include/pv_player_node_registry_interface.h
@@ -119,7 +119,7 @@ class PVPlayerNodeRegistryInterface
*
* @returns a pointer to node
**/
- virtual PVMFNodeInterface* CreateNode(PVUuid& aUuid) = 0;
+ virtual PVMFNodeInterface* CreateNode(PVUuid& aUuid, bool aHwAccelerated = true) = 0;
/**
* The ReleaseNode for PVPlayerNodeRegistry. Used for releasing a node.
diff --git a/nodes/pvomxbasedecnode/include/pvmf_omx_basedec_node.h b/nodes/pvomxbasedecnode/include/pvmf_omx_basedec_node.h
index d36ad8d49..c5db83876 100644
--- a/nodes/pvomxbasedecnode/include/pvmf_omx_basedec_node.h
+++ b/nodes/pvomxbasedecnode/include/pvmf_omx_basedec_node.h
@@ -363,7 +363,7 @@ class PVMFOMXBaseDecNode
{
public:
- OSCL_IMPORT_REF PVMFOMXBaseDecNode(int32 aPriority, const char aAOName[]);
+ OSCL_IMPORT_REF PVMFOMXBaseDecNode(int32 aPriority, const char aAOName[], bool aHwAccelerated = true);
OSCL_IMPORT_REF virtual ~PVMFOMXBaseDecNode();
// From PVMFNodeInterface
@@ -826,7 +826,7 @@ class PVMFOMXBaseDecNode
OMX_TICKS iOMXTicksTimestamp;
OSCL_IMPORT_REF OMX_TICKS ConvertTimestampIntoOMXTicks(const MediaClockConverter &src);
uint32 ConvertOMXTicksIntoTimestamp(const OMX_TICKS &src);
-
+ OMX_BOOL bHWAccelerated;
};
diff --git a/nodes/pvomxbasedecnode/src/pvmf_omx_basedec_node.cpp b/nodes/pvomxbasedecnode/src/pvmf_omx_basedec_node.cpp
index f6d49e05e..fa5864170 100644
--- a/nodes/pvomxbasedecnode/src/pvmf_omx_basedec_node.cpp
+++ b/nodes/pvomxbasedecnode/src/pvmf_omx_basedec_node.cpp
@@ -522,7 +522,7 @@ OSCL_EXPORT_REF PVMFStatus PVMFOMXBaseDecNode::SetDecoderNodeConfiguration(PVMFO
/////////////////////////////////////////////////////////////////////////////
// Class Constructor
/////////////////////////////////////////////////////////////////////////////
-OSCL_EXPORT_REF PVMFOMXBaseDecNode::PVMFOMXBaseDecNode(int32 aPriority, const char aAOName[]) :
+OSCL_EXPORT_REF PVMFOMXBaseDecNode::PVMFOMXBaseDecNode(int32 aPriority, const char aAOName[], bool accelerated) :
OsclActiveObject(aPriority, aAOName),
iInPort(NULL),
iOutPort(NULL),
@@ -550,7 +550,8 @@ OSCL_EXPORT_REF PVMFOMXBaseDecNode::PVMFOMXBaseDecNode(int32 aPriority, const ch
iResetInProgress(false),
iResetMsgSent(false),
iStopInResetMsgSent(false),
- iCompactFSISettingSucceeded(false)
+ iCompactFSISettingSucceeded(false),
+ bHWAccelerated(accelerated? OMX_TRUE: OMX_FALSE)
{
iThreadSafeHandlerEventHandler = NULL;
iThreadSafeHandlerEmptyBufferDone = NULL;
@@ -4062,7 +4063,7 @@ void PVMFOMXBaseDecNode::DoPrepare(PVMFOMXBaseDecNodeCommand& aCmd)
else
#endif
// try to create component
- err = OMX_MasterGetHandle(&iOMXDecoder, (OMX_STRING) aInputParameters.cComponentName, (OMX_PTR) this, (OMX_CALLBACKTYPE *) & iCallbacks);
+ err = OMX_MasterGetHandle(&iOMXDecoder, (OMX_STRING) aInputParameters.cComponentName, (OMX_PTR) this, (OMX_CALLBACKTYPE *) & iCallbacks, bHWAccelerated);
// if successful, no need to continue
if ((err == OMX_ErrorNone) && (iOMXDecoder != NULL))
{
diff --git a/nodes/pvomxvideodecnode/include/pvmf_omx_videodec_factory.h b/nodes/pvomxvideodecnode/include/pvmf_omx_videodec_factory.h
index 719040f69..894e23888 100644
--- a/nodes/pvomxvideodecnode/include/pvmf_omx_videodec_factory.h
+++ b/nodes/pvomxvideodecnode/include/pvmf_omx_videodec_factory.h
@@ -49,7 +49,7 @@ class PVMFOMXVideoDecNodeFactory
* @param aPriority The active object priority for the node. Default is standard priority if not specified
* @returns A pointer to an instance of PVMFOMXVideoDecNode as PVMFNodeInterface reference or leaves if instantiation fails
**/
- OSCL_IMPORT_REF static PVMFNodeInterface* CreatePVMFOMXVideoDecNode(int32 aPriority = OsclActiveObject::EPriorityNominal);
+ OSCL_IMPORT_REF static PVMFNodeInterface* CreatePVMFOMXVideoDecNode(int32 aPriority = OsclActiveObject::EPriorityNominal, bool aHwAccelerated = true);
/**
* Deletes an instance of PVMFOMXVideoDecNode
diff --git a/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_factory.cpp b/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_factory.cpp
index 18b17efa2..06e7dadc9 100644
--- a/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_factory.cpp
+++ b/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_factory.cpp
@@ -35,10 +35,10 @@ OSCL_DLL_ENTRY_POINT_DEFAULT()
////////////////////////////////////////////////////////////////////////////
-OSCL_EXPORT_REF PVMFNodeInterface* PVMFOMXVideoDecNodeFactory::CreatePVMFOMXVideoDecNode(int32 aPriority)
+OSCL_EXPORT_REF PVMFNodeInterface* PVMFOMXVideoDecNodeFactory::CreatePVMFOMXVideoDecNode(int32 aPriority, bool aHwAccelerated)
{
PVMFNodeInterface* node = NULL;
- node = new PVMFOMXVideoDecNode(aPriority);
+ node = new PVMFOMXVideoDecNode(aPriority, aHwAccelerated);
if (node == NULL)
{
OSCL_LEAVE(OsclErrNoMemory);
diff --git a/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp b/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp
index 0193cf5e6..780665d1c 100644
--- a/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp
+++ b/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp
@@ -139,8 +139,8 @@ PVMFStatus PVMFOMXVideoDecNode::ThreadLogon()
/////////////////////////////////////////////////////////////////////////////
// Class Constructor
/////////////////////////////////////////////////////////////////////////////
-PVMFOMXVideoDecNode::PVMFOMXVideoDecNode(int32 aPriority) :
- PVMFOMXBaseDecNode(aPriority, "PVMFOMXVideoDecNode"),
+PVMFOMXVideoDecNode::PVMFOMXVideoDecNode(int32 aPriority, bool aHwAccelerated) :
+ PVMFOMXBaseDecNode(aPriority, "PVMFOMXVideoDecNode", aHwAccelerated),
iH263MaxBitstreamFrameSize(PVOMXVIDEODECNODE_CONFIG_H263MAXBITSTREAMFRAMESIZE_DEF),
iH263MaxWidth(PVOMXVIDEODECNODE_CONFIG_H263MAXWIDTH_DEF),
iH263MaxHeight(PVOMXVIDEODECNODE_CONFIG_H263MAXHEIGHT_DEF),
diff --git a/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.h b/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.h
index e692aa8f4..2db338ec7 100644
--- a/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.h
+++ b/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.h
@@ -127,7 +127,7 @@ class PVMFOMXVideoDecNode
: public PVMFOMXBaseDecNode
{
public:
- PVMFOMXVideoDecNode(int32 aPriority);
+ PVMFOMXVideoDecNode(int32 aPriority, bool aHwAccelerated);
~PVMFOMXVideoDecNode();
// From PVMFNodeInterface