android-2.1_r1 snapshot
diff --git a/android/android_surface_output.cpp b/android/android_surface_output.cpp
index 075768b..748faa8 100644
--- a/android/android_surface_output.cpp
+++ b/android/android_surface_output.cpp
@@ -935,7 +935,7 @@
LOGV("Flushing buffers after EOS");
processWriteResponseQueue(0);
} else {
- processWriteResponseQueue(1);
+ processWriteResponseQueue(2);
}
}
diff --git a/android/author/android_audio_input.cpp b/android/author/android_audio_input.cpp
index f7539cc..81e121e 100644
--- a/android/author/android_audio_input.cpp
+++ b/android/author/android_audio_input.cpp
@@ -695,6 +695,14 @@
}
////////////////////////////////////////////////////////////////////////////
+bool AndroidAudioInput::setAudioSource(uint32 iSource)
+{
+ iAudioSource = iSource;
+ LOGV("AndroidAudioInput::setAudioSource() iAudioSource %d set", iAudioSource);
+ return true;
+}
+
+////////////////////////////////////////////////////////////////////////////
// Private methods
////////////////////////////////////////////////////////////////////////////
diff --git a/android/author/android_audio_input.h b/android/author/android_audio_input.h
index a410f2a..965022e 100644
--- a/android/author/android_audio_input.h
+++ b/android/author/android_audio_input.h
@@ -298,6 +298,9 @@
/* Set the input number of channels */
bool setAudioNumChannels(int32 iNumChannels);
+ /* Sets the audio input source */
+ bool setAudioSource(uint32 iSource);
+
/* From PVMFMediaClockStateObserver and its base*/
void ClockStateUpdated();
void NotificationsInterfaceDestroyed();
diff --git a/android/author/android_camera_input.cpp b/android/author/android_camera_input.cpp
index 38dc39c..4bb4e8f 100644
--- a/android/author/android_camera_input.cpp
+++ b/android/author/android_camera_input.cpp
@@ -425,7 +425,7 @@
// Note for low frame rate, we don't bother to log view finder freezes
int processingTimeInMs = (systemTime()/1000000L - iAudioFirstFrameTs) - data.iXferHeader.timestamp;
if (processingTimeInMs >= VIEW_FINDER_FREEZE_DETECTION_TOLERANCE && mFrameRate >= 10.0) {
- LOGW("Frame %p takes too long (%d ms) to process", data.iFrameBuffer.get(), processingTimeInMs);
+ LOGW("Frame %p takes too long (%d ms) to process, staring at %d", data.iFrameBuffer.get(), processingTimeInMs, iAudioFirstFrameTs);
}
mCamera->releaseRecordingFrame(data.iFrameBuffer);
@@ -944,6 +944,7 @@
{
LOGV("DoStart");
+ iAudioFirstFrameTs = 0;
// Set the clock state observer
if (iAuthorClock) {
iAuthorClock->ConstructMediaClockNotificationsInterface(iClockNotificationsInf, *this);
@@ -988,7 +989,6 @@
// Remove and destroy the clock state observer
RemoveDestroyClockObs();
iDataEventCounter = 0;
- iAudioFirstFrameTs = 0;
iWriteState = EWriteOK;
if ( (iState == STATE_STARTED) || (iState == STATE_PAUSED) ) {
if (mCamera != NULL) {
@@ -1026,7 +1026,6 @@
RemoveDestroyClockObs();
iDataEventCounter = 0;
- iAudioFirstFrameTs = 0;
iWriteState = EWriteOK;
if (mCamera != NULL) {
mCamera->setListener(NULL);
diff --git a/android/author/authordriver.cpp b/android/author/authordriver.cpp
index 7aada71..13994d2 100644
--- a/android/author/authordriver.cpp
+++ b/android/author/authordriver.cpp
@@ -313,6 +313,10 @@
commandFailed(ac);
return;
}
+ // force audio source to camcorder when recording video
+ if (mVideoInputMIO != NULL) {
+ mAudioInputMIO->setAudioSource(AUDIO_SOURCE_CAMCORDER);
+ }
}
OSCL_TRY(error, mAuthor->AddDataSource(*mAudioNode, ac));
@@ -335,6 +339,10 @@
if (mCamera == 0 ||
(mCamera != 0 && cameraInput->SetCamera(mCamera) == PVMFSuccess)) {
mVideoInputMIO = cameraInput;
+ // force audio source to camcorder when recording video
+ if (mAudioInputMIO != NULL) {
+ mAudioInputMIO->setAudioSource(AUDIO_SOURCE_CAMCORDER);
+ }
break;
}
}
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 77df355..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
@@ -1624,14 +1626,7 @@
void setTimerDuration(uint32 aTimerDuration)
{
Cancel();
- if (aTimerDuration == 0)
- {
- iTimerDuration = PVPLAYERENGINE_DEFAULT_WATCHDOGTIMER_INTERVAL;
- }
- else
- {
- iTimerDuration = aTimerDuration;
- }
+ iTimerDuration = (PVPLAYERENGINE_DEFAULT_WATCHDOGTIMER_INTERVAL < aTimerDuration) ? aTimerDuration : PVPLAYERENGINE_DEFAULT_WATCHDOGTIMER_INTERVAL;
}
uint32 getTimerDurationInMS()
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
diff --git a/nodes/pvprotocolenginenode/protocol_common/src/pvmf_protocol_engine_node_common.h b/nodes/pvprotocolenginenode/protocol_common/src/pvmf_protocol_engine_node_common.h
index 8b3ce5d..dd00ae5 100644
--- a/nodes/pvprotocolenginenode/protocol_common/src/pvmf_protocol_engine_node_common.h
+++ b/nodes/pvprotocolenginenode/protocol_common/src/pvmf_protocol_engine_node_common.h
@@ -1426,6 +1426,8 @@
void setSocketReconnectCmdSent(const bool aSocketReconnectCmdSent = true)
{
iSocketReconnectCmdSent = aSocketReconnectCmdSent;
+ iCurrSocketConnection = true;
+ iPrevSocketConnection = true;
}
bool ignoreCurrentInputData() const
{
diff --git a/oscl/oscl/osclio/src/oscl_file_native.cpp b/oscl/oscl/osclio/src/oscl_file_native.cpp
index 368b475..d3df6f5 100644
--- a/oscl/oscl/osclio/src/oscl_file_native.cpp
+++ b/oscl/oscl/osclio/src/oscl_file_native.cpp
@@ -33,6 +33,10 @@
#include "oscl_file_types.h"
#include "oscl_file_handle.h"
+// FIXME:
+// Is 100 milliseconds a good choice for writing out a single
+// compressed video frame?
+static const int FILE_WRITER_SPEED_TOLERANCE_IN_MILLISECONDS = 100;
OsclNativeFile::OsclNativeFile()
{
@@ -325,7 +329,15 @@
#endif
if (iFile)
{
- return fwrite(buffer, OSCL_STATIC_CAST(int32, size), OSCL_STATIC_CAST(int32, numelements), iFile);
+ struct timeval startTimeVal, endTimeVal;
+ gettimeofday(&startTimeVal, NULL);
+ uint32 items = fwrite(buffer, OSCL_STATIC_CAST(int32, size), OSCL_STATIC_CAST(int32, numelements), iFile);
+ gettimeofday(&endTimeVal, NULL);
+ long long timeInMicroSeconds = (endTimeVal.tv_sec - startTimeVal.tv_sec) * 1000000LL + (endTimeVal.tv_usec - startTimeVal.tv_usec);
+ if (timeInMicroSeconds/1000 > FILE_WRITER_SPEED_TOLERANCE_IN_MILLISECONDS) {
+ LOGW("writing %d bytes takes too long (%lld micro seconds)", items, timeInMicroSeconds);
+ }
+ return items;
}
return 0;
}
diff --git a/protocols/rtsp_client_engine/inc/pvrtspenginenodeextensioninterface.h b/protocols/rtsp_client_engine/inc/pvrtspenginenodeextensioninterface.h
index 11d0296..397304b 100644
--- a/protocols/rtsp_client_engine/inc/pvrtspenginenodeextensioninterface.h
+++ b/protocols/rtsp_client_engine/inc/pvrtspenginenodeextensioninterface.h
@@ -134,7 +134,7 @@
#define PVRTSPENGINENODE_DEFAULT_KEEP_ALIVE_INTERVAL 55
#define PVRTSPENGINENODE_DEFAULT_RTSP_INACTIVITY_TIMER 15
-#define PVRTSPENGINENODE_DEFAULT_NUMBER_OF_REDIRECT_TRIALS 1
+#define PVRTSPENGINENODE_DEFAULT_NUMBER_OF_REDIRECT_TRIALS 8
//Forward Declarations
class PVMFPortInterface;