aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2010-01-12 15:18:30 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2010-01-12 15:18:30 -0800
commita18ef85ef728403129fb92f9f2a4f123941415c0 (patch)
tree78e9b6bae837c6fdd3e9be9457ac40cadd21bc22
parent5109388c810790f08bdf188b16a60c9020254296 (diff)
downloadopencore-a18ef85ef728403129fb92f9f2a4f123941415c0.tar.gz
android-2.1_r1 snapshot
-rw-r--r--android/android_surface_output.cpp2
-rw-r--r--android/author/android_audio_input.cpp8
-rw-r--r--android/author/android_audio_input.h3
-rw-r--r--android/author/android_camera_input.cpp5
-rw-r--r--android/author/authordriver.cpp8
-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.h15
-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
-rw-r--r--nodes/pvprotocolenginenode/protocol_common/src/pvmf_protocol_engine_node_common.h2
-rw-r--r--oscl/oscl/osclio/src/oscl_file_native.cpp14
-rw-r--r--protocols/rtsp_client_engine/inc/pvrtspenginenodeextensioninterface.h2
29 files changed, 120 insertions, 55 deletions
diff --git a/android/android_surface_output.cpp b/android/android_surface_output.cpp
index 075768b7a..748faa8ce 100644
--- a/android/android_surface_output.cpp
+++ b/android/android_surface_output.cpp
@@ -935,7 +935,7 @@ void AndroidSurfaceOutput::Run()
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 f7539cc3d..81e121e09 100644
--- a/android/author/android_audio_input.cpp
+++ b/android/author/android_audio_input.cpp
@@ -695,6 +695,14 @@ bool AndroidAudioInput::setAudioNumChannels(int32 iNumChannels)
}
////////////////////////////////////////////////////////////////////////////
+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 a410f2ab7..965022ec4 100644
--- a/android/author/android_audio_input.h
+++ b/android/author/android_audio_input.h
@@ -298,6 +298,9 @@ public:
/* 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 38dc39c7b..4bb4e8f41 100644
--- a/android/author/android_camera_input.cpp
+++ b/android/author/android_camera_input.cpp
@@ -425,7 +425,7 @@ void AndroidCameraInput::writeComplete(PVMFStatus aStatus,
// 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 @@ PVMFStatus AndroidCameraInput::DoStart()
{
LOGV("DoStart");
+ iAudioFirstFrameTs = 0;
// Set the clock state observer
if (iAuthorClock) {
iAuthorClock->ConstructMediaClockNotificationsInterface(iClockNotificationsInf, *this);
@@ -988,7 +989,6 @@ PVMFStatus AndroidCameraInput::DoReset()
// 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 @@ PVMFStatus AndroidCameraInput::DoStop(const AndroidCameraInputCmd& aCmd)
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 7aada711a..13994d22f 100644
--- a/android/author/authordriver.cpp
+++ b/android/author/authordriver.cpp
@@ -313,6 +313,10 @@ void AuthorDriver::handleSetAudioSource(set_audio_source_command *ac)
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 @@ void AuthorDriver::handleSetVideoSource(set_video_source_command *ac)
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 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 77df3552d..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
@@ -1624,14 +1626,7 @@ class PVPlayerWatchdogTimer : public OsclTimerObject
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 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
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 8b3ce5dc7..dd00ae56b 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 @@ class InterfacingObjectContainer
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 368b47506..d3df6f58d 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 @@ uint32 OsclNativeFile::Write(const OsclAny *buffer, uint32 size, uint32 numeleme
#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 11d029648..397304b99 100644
--- a/protocols/rtsp_client_engine/inc/pvrtspenginenodeextensioninterface.h
+++ b/protocols/rtsp_client_engine/inc/pvrtspenginenodeextensioninterface.h
@@ -134,7 +134,7 @@ class PVRTSPEngineNodeServerInfo
#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;