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.
diff --git a/android/metadatadriver.cpp b/android/metadatadriver.cpp
index 3856e5d..128554f 100644
--- a/android/metadatadriver.cpp
+++ b/android/metadatadriver.cpp
@@ -530,7 +530,7 @@
 {
     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 9b42e8a..57f026c 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 @@
     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 d28000e..b6360d2 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 @@
 {
     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 @@
                             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 @@
     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 @@
             // 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 a40a81d..1729798 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 @@
         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 a79143e..cd00b51 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_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 da833b0..370b31d 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 @@
 #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* util = NULL;
-    util = OSCL_NEW(PVFrameAndMetadataUtility, ());
+    util = OSCL_NEW(PVFrameAndMetadataUtility, (aHwAccelerated));
     if (util)
     {
         util->Construct(aOutputFormatMIMEType,
@@ -374,7 +374,8 @@
 }
 
 
-PVFrameAndMetadataUtility::PVFrameAndMetadataUtility() :
+PVFrameAndMetadataUtility::PVFrameAndMetadataUtility(bool aHwAccelerated) :
+        iHwAccelerated(aHwAccelerated),
         OsclTimerObject(OsclActiveObject::EPriorityNominal, "PVFrameMetadataUtility"),
         iCommandId(0),
         iState(PVFM_UTILITY_STATE_IDLE),
@@ -433,7 +434,7 @@
     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 @@
     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 3b2208c..2fb9c1f 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 @@
         static PVFrameAndMetadataUtility* New(char *aOutputFormatMIMEType,
                                               PVCommandStatusObserver *aCmdObserver,
                                               PVErrorEventObserver *aErrorObserver,
-                                              PVInformationalEventObserver *aInfoObserver);
+                                              PVInformationalEventObserver *aInfoObserver,
+                                              bool aHwAccelerated = true);
         ~PVFrameAndMetadataUtility();
 
         // From PVFrameAndMetadataInterface
@@ -444,9 +445,10 @@
         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 e534387..3584217 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 @@
     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 e5790a2..86679a3 100644
--- a/engines/player/include/pv_player_factory.h
+++ b/engines/player/include/pv_player_factory.h
@@ -60,7 +60,8 @@
          **/
         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 567d1c9..1027bb6 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 @@
 
 
 
-PVPlayerEngine::PVPlayerEngine() :
+PVPlayerEngine::PVPlayerEngine(bool aHwAccelerated) :
+        iHwAccelerated(aHwAccelerated),
         OsclTimerObject(OsclActiveObject::EPriorityNominal, "PVPlayerEngine"),
         iCommandId(0),
         iState(PVP_ENGINE_STATE_IDLE),
@@ -4459,7 +4461,7 @@
             }
 
             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 @@
                             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 a8a6d6c..be6b16d 100644
--- a/engines/player/src/pv_player_engine.h
+++ b/engines/player/src/pv_player_engine.h
@@ -893,7 +893,8 @@
     public:
         static PVPlayerEngine* New(PVCommandStatusObserver *aCmdObserver,
                                    PVErrorEventObserver *aErrorObserver,
-                                   PVInformationalEventObserver *aInfoObserver);
+                                   PVInformationalEventObserver *aInfoObserver,
+                                   bool aHwAccelerated);
         ~PVPlayerEngine();
 
         // From PVPlayerInterface
@@ -967,7 +968,7 @@
         void PVPlayerWatchdogTimerEvent();
 
     private:
-        PVPlayerEngine();
+        PVPlayerEngine(bool aHwAccelerated);
         void Construct(PVCommandStatusObserver *aCmdObserver,
                        PVErrorEventObserver *aErrorObserver,
                        PVInformationalEventObserver *aInfoObserver);
@@ -1179,6 +1180,7 @@
         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 1eb56b7..ff114b1 100644
--- a/engines/player/src/pv_player_factory.cpp
+++ b/engines/player/src/pv_player_factory.cpp
@@ -44,9 +44,10 @@
 
 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 3b5bc13..3aa8aeb 100644
--- a/engines/player/src/pv_player_node_registry.cpp
+++ b/engines/player/src/pv_player_node_registry.cpp
@@ -231,7 +231,7 @@
 }
 
 
-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 @@
 #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 42b54b6..f4426d0 100644
--- a/engines/player/src/pv_player_node_registry.h
+++ b/engines/player/src/pv_player_node_registry.h
@@ -118,7 +118,7 @@
          *
          * @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 1efa265..0205531 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 @@
          *
          * @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 d36ad8d..c5db838 100644
--- a/nodes/pvomxbasedecnode/include/pvmf_omx_basedec_node.h
+++ b/nodes/pvomxbasedecnode/include/pvmf_omx_basedec_node.h
@@ -363,7 +363,7 @@
 
 {
     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 @@
         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 f6d49e0..fa58641 100644
--- a/nodes/pvomxbasedecnode/src/pvmf_omx_basedec_node.cpp
+++ b/nodes/pvomxbasedecnode/src/pvmf_omx_basedec_node.cpp
@@ -522,7 +522,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // 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 @@
         iResetInProgress(false),
         iResetMsgSent(false),
         iStopInResetMsgSent(false),
-        iCompactFSISettingSucceeded(false)
+        iCompactFSISettingSucceeded(false),
+        bHWAccelerated(accelerated? OMX_TRUE: OMX_FALSE)
 {
     iThreadSafeHandlerEventHandler = NULL;
     iThreadSafeHandlerEmptyBufferDone = NULL;
@@ -4062,7 +4063,7 @@
                         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 719040f..894e238 100644
--- a/nodes/pvomxvideodecnode/include/pvmf_omx_videodec_factory.h
+++ b/nodes/pvomxvideodecnode/include/pvmf_omx_videodec_factory.h
@@ -49,7 +49,7 @@
          * @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 18b17ef..06e7dad 100644
--- a/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_factory.cpp
+++ b/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_factory.cpp
@@ -35,10 +35,10 @@
 
 
 ////////////////////////////////////////////////////////////////////////////
-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 0193cf5..780665d 100644
--- a/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp
+++ b/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.cpp
@@ -139,8 +139,8 @@
 /////////////////////////////////////////////////////////////////////////////
 // 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 e692aa8..2db338e 100644
--- a/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.h
+++ b/nodes/pvomxvideodecnode/src/pvmf_omx_videodec_node.h
@@ -127,7 +127,7 @@
         : public PVMFOMXBaseDecNode
 {
     public:
-        PVMFOMXVideoDecNode(int32 aPriority);
+        PVMFOMXVideoDecNode(int32 aPriority, bool aHwAccelerated);
         ~PVMFOMXVideoDecNode();
 
         // From PVMFNodeInterface