aboutsummaryrefslogtreecommitdiff
path: root/engines/player
diff options
context:
space:
mode:
authorPacketVideo CM <engbuild@pv.com>2010-06-15 16:36:12 -0700
committerPacketVideo CM <engbuild@pv.com>2010-06-15 16:36:12 -0700
commitfcb8ca592866686eedae42e32cc38a7d728211ca (patch)
treee2053f842bc9df3ca385fc7bd2e81bf748ebc068 /engines/player
parentbca3457cc10f1568a38933fae72136a2ef02761f (diff)
downloadopencore-fcb8ca592866686eedae42e32cc38a7d728211ca.tar.gz
RIO-9185: CommonParserNode for AMR and WAV
Change-Id: I2bb4ba65c2c55414a1df454fbf9245bd0749ed8b
Diffstat (limited to 'engines/player')
-rw-r--r--engines/player/config/core/pv_player_node_registry_populator.cpp16
-rw-r--r--engines/player/src/pv_player_engine.cpp350
-rw-r--r--engines/player/src/pv_player_engine.h16
-rw-r--r--engines/player/src/pv_player_sdkinfo.h2
4 files changed, 292 insertions, 92 deletions
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 63467d79b..c2b26fcbc 100644
--- a/engines/player/config/core/pv_player_node_registry_populator.cpp
+++ b/engines/player/config/core/pv_player_node_registry_populator.cpp
@@ -65,6 +65,9 @@
#if BUILD_FLV_FF_PARSER_NODE
#include "pvmf_flvffparser_factory.h"
#endif
+#if BUILD_COMMON_PARSER_NODE
+#include "pvmf_parsernode_factory.h"
+#endif
// For recognizer registry
#if BUILD_MP4_FF_REC
#include "pvmp4ffrec_factory.h"
@@ -327,6 +330,19 @@ void PVPlayerRegistryPopulator::RegisterAllNodes(PVPlayerNodeRegistryInterface*
nodeinfo.iNodeReleaseFunc = PVMFFLVParserNodeFactory::DeletePVMFFLVParserNode;
aRegistry->RegisterNode(nodeinfo);
#endif
+#if BUILD_COMMON_PARSER_NODE
+ //For PVMFAMRFFParserNode
+ //For PVMFWAVFFParserNode
+ nodeinfo.iInputTypes.clear();
+ nodeinfo.iInputTypes.push_back(PVMF_MIME_AMRFF);
+ nodeinfo.iInputTypes.push_back(PVMF_MIME_WAVFF);
+ nodeinfo.iNodeUUID = KPVMFParserNodeUuid;
+ nodeinfo.iOutputType.clear();
+ nodeinfo.iOutputType.push_back(PVMF_MIME_FORMAT_UNKNOWN);
+ nodeinfo.iNodeCreateFunc = PVMFParserNodeFactory::CreatePVMFParserNode;
+ nodeinfo.iNodeReleaseFunc = PVMFParserNodeFactory::DeletePVMFParserNode;
+ aRegistry->RegisterNode(nodeinfo);
+#endif
}
void PVPlayerRegistryPopulator::UnregisterAllNodes(PVPlayerNodeRegistryInterface* aRegistry, OsclAny* aContext)
diff --git a/engines/player/src/pv_player_engine.cpp b/engines/player/src/pv_player_engine.cpp
index d79c5f783..9942e5055 100644
--- a/engines/player/src/pv_player_engine.cpp
+++ b/engines/player/src/pv_player_engine.cpp
@@ -75,7 +75,9 @@
#include "pvmf_recognizer_plugin.h"
-//
+#include "pvmi_data_stream.h"
+
+#include "oscl_utf8conv.h"
#define PVPLAYERENGINE_NUM_COMMANDS 10
@@ -1061,6 +1063,7 @@ PVPlayerEngine::PVPlayerEngine() :
iSourceFormatType(PVMF_MIME_FORMAT_UNKNOWN),
iSourceNode(NULL),
iSourceNodeSessionId(0),
+ iSourceNodeDataStreamIF(NULL),
iSourceNodeInitIF(NULL),
iSourceNodeTrackSelIF(NULL),
iSourceNodePBCtrlIF(NULL),
@@ -1070,6 +1073,7 @@ PVPlayerEngine::PVPlayerEngine() :
iSourceNodeCapConfigIF(NULL),
iSourceNodeRegInitIF(NULL),
iCPMLicenseIF(NULL),
+ iSourceNodePVInterfaceDataStream(NULL),
iSourceNodePVInterfaceInit(NULL),
iSourceNodePVInterfaceTrackSel(NULL),
iSourceNodePVInterfacePBCtrl(NULL),
@@ -1146,7 +1150,8 @@ PVPlayerEngine::PVPlayerEngine() :
iClipsCorrupted(0),
iCurrentPlaybackClipId(0xFFFFFFFF),
iNumClipsQueued(0),
- iStartIssuedOnEngine(false)
+ iStartIssuedOnEngine(false),
+ ipDataStream(NULL)
{
iCurrentBeginPosition.iIndeterminate = true;
iCurrentEndPosition.iIndeterminate = true;
@@ -2145,6 +2150,10 @@ void PVPlayerEngine::NodeCommandCompleted(const PVMFCmdResp& aResponse)
case PVP_ENGINE_STATE_IDLE:
switch (nodecontext->iCmdType)
{
+ case PVP_CMD_SourceNodeQueryDataStreamIF:
+ HandleSourceNodeQueryDataStreamIF(*nodecontext, aResponse);
+ break;
+
case PVP_CMD_SourceNodeQueryInitIF:
HandleSourceNodeQueryInitIF(*nodecontext, aResponse);
break;
@@ -4630,24 +4639,72 @@ PVMFStatus PVPlayerEngine::DoSetupSourceNode(PVCommandId aCmdId, OsclAny* aCmdCo
OSCL_ASSERT(false);
return PVMFFailure);
+ PVPlayerEngineContext* context = AllocateEngineContext(NULL, iSourceNode, NULL, aCmdId, aCmdContext, PVP_CMD_SourceNodeQueryDataStreamIF);
+
+ PVUuid sourceinituuid = PVMF_DATASTREAM_INIT_INTERFACE_UUID;
+ leavecode = 0;
+ PVMFCommandId cmdid = -1;
+ iSourceNodePVInterfaceDataStream = NULL;
+ OSCL_TRY(leavecode, cmdid = iSourceNode->QueryInterface(iSourceNodeSessionId, sourceinituuid, iSourceNodePVInterfaceDataStream, (OsclAny*)context));
+ OSCL_FIRST_CATCH_ANY(leavecode,
+ iSourceNodePVInterfaceDataStream = NULL;
+ FreeEngineContext(context);
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSetupSourceNode() QueryInterface for PVMF_DATASTREAM_INIT_INTERFACE_UUID did a leave!"))
+ );
+
+ if (0 != leavecode || -1 == cmdid)
+ {
+ // This would mean the PVMF_DATASTREAM_INIT_INTERFACE_UUID is not supported by the source node, in such a case
+ // query for PVMF_DATA_SOURCE_INIT_INTERFACE_UUID
+ PVPlayerEngineContext* context = AllocateEngineContext(NULL, iSourceNode, NULL, aCmdId, aCmdContext, PVP_CMD_SourceNodeQueryInitIF);
+
+ PVUuid sourceinituuid = PVMF_DATA_SOURCE_INIT_INTERFACE_UUID;
+ int32 leavecode = 0;
+ PVMFCommandId cmdid = -1;
+ iSourceNodePVInterfaceInit = NULL;
+ OSCL_TRY(leavecode, cmdid = iSourceNode->QueryInterface(iSourceNodeSessionId, sourceinituuid, iSourceNodePVInterfaceInit, (OsclAny*)context));
+ OSCL_FIRST_CATCH_ANY(leavecode,
+ iSourceNodePVInterfaceInit = NULL;
+ FreeEngineContext(context);
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSetupSourceNode QueryInterface on iSourceNode did a leave!"));
+ return PVMFFailure);
+ }
+
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "PVPlayerEngine::DoSetupSourceNode() Out"));
+ return PVMFSuccess;
+}
+
+PVMFStatus PVPlayerEngine::DoSourceNodeQueryInitIF(PVCommandId aCmdId, OsclAny* aCmdContext)
+{
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iPerfLogger, PVLOGMSG_STACK_TRACE,
+ (0, "PVPlayerEngine::DoSourceNodeQueryInitIF Tick=%d", OsclTickCount::TickCount()));
+
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "PVPlayerEngine::DoSourceNodeQueryInitIF In"));
+
+ if (iSourceNodeDataStreamIF)
+ {
+ // Valid Data Stream set the data stream here via Data stream IF
+ if (PVMFSuccess != SetDataStreamOrDataSource(true))
+ return PVMFFailure;
+ }
+
PVPlayerEngineContext* context = AllocateEngineContext(NULL, iSourceNode, NULL, aCmdId, aCmdContext, PVP_CMD_SourceNodeQueryInitIF);
PVUuid sourceinituuid = PVMF_DATA_SOURCE_INIT_INTERFACE_UUID;
- leavecode = 0;
+ int32 leavecode = 0;
PVMFCommandId cmdid = -1;
iSourceNodePVInterfaceInit = NULL;
OSCL_TRY(leavecode, cmdid = iSourceNode->QueryInterface(iSourceNodeSessionId, sourceinituuid, iSourceNodePVInterfaceInit, (OsclAny*)context));
OSCL_FIRST_CATCH_ANY(leavecode,
iSourceNodePVInterfaceInit = NULL;
FreeEngineContext(context);
- PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSetupSourceNode() QueryInterface on iSourceNode did a leave!"));
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSourceNodeQueryInitIF QueryInterface on iSourceNode did a leave!"));
return PVMFFailure);
- PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "PVPlayerEngine::DoSetupSourceNode() Out"));
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "PVPlayerEngine::DoSourceNodeQueryInitIF Out"));
return PVMFSuccess;
}
-
PVMFStatus PVPlayerEngine::DoSourceNodeQueryTrackSelIF(PVCommandId aCmdId, OsclAny* aCmdContext)
{
PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iPerfLogger, PVLOGMSG_STACK_TRACE,
@@ -4657,77 +4714,18 @@ PVMFStatus PVPlayerEngine::DoSourceNodeQueryTrackSelIF(PVCommandId aCmdId, OsclA
int32 leavecode = 0;
- if (iDataSource->GetDataSourceType() == PVP_DATASRCTYPE_URL)
+ if (NULL == iSourceNodeDataStreamIF)
{
- // Setup the source node via the initialization IF
- OSCL_ASSERT(iSourceFormatType != PVMF_MIME_FORMAT_UNKNOWN);
-
- for (uint32 clipIndex = 0; clipIndex < iDataSource->GetNumClips(); clipIndex++)
- {
-
- PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_DEBUG, (0, "PVPlayerEngine::DoSourceNodeQueryTrackSelIF() - Set index of current clip to %d", clipIndex));
- iDataSource->SetCurrentClip(clipIndex);
-
- OSCL_wHeapString<OsclMemAllocator> sourceURL;
- // In case the URL starts with file:// skip it
- OSCL_wStackString<8> fileScheme(_STRLIT_WCHAR("file"));
- OSCL_wStackString<8> schemeDelimiter(_STRLIT_WCHAR("://"));
- const oscl_wchar* actualURL = NULL;
-
- if (oscl_strncmp(fileScheme.get_cstr(), iDataSource->GetDataSourceURL().get_cstr(), 4) == 0)
- {
- actualURL = oscl_strstr(iDataSource->GetDataSourceURL().get_cstr(), schemeDelimiter.get_cstr());
- if (actualURL == NULL)
- {
- PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSourceNodeQueryTrackSelIF() Unable to skip over file://"));
- return PVMFErrArgument;
- }
- //skip over ://
- actualURL += schemeDelimiter.get_size();
- sourceURL += actualURL;
- }
- else
- {
- sourceURL += iDataSource->GetDataSourceURL().get_cstr();
- }
-
- PVMFStatus retval = PVMFFailure;
- if (clipIndex > 0)
- {
- PVMFFormatType srcFormatType = iDataSource->GetDataSourceFormatType();
- retval = iSourceNodeInitIF->SetSourceInitializationData(sourceURL, srcFormatType, iDataSource->GetDataSourceContextData(), clipIndex);
- }
- else
- {
- retval = iSourceNodeInitIF->SetSourceInitializationData(sourceURL, iSourceFormatType, iDataSource->GetDataSourceContextData(), clipIndex);
- }
-
- if (retval == PVMFSuccess || retval == PVMFErrAlreadyExists)
- {
- iNumClipsQueued++;
- }
- else
- {
- PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSourceNodeQueryTrackSelIF() SetSourceInitializationData failed errcode %d", retval));
- // dont ignore update failure for clips index == 0
- if (clipIndex == 0)
- {
- return PVMFFailure;
- }
- }
- }
- // Set Playback Clock
- PVMFStatus status = iSourceNodeInitIF->SetClientPlayBackClock(&iPlaybackClock);
- if (status != PVMFSuccess)
- {
- PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSourceNodeQueryTrackSelIF() SetClientPlayBackClock failed!"));
+ // We need the data source via data source IF
+ if (PVMFSuccess != SetDataStreamOrDataSource(false))
return PVMFFailure;
- }
}
- else
+
+ // Set Playback Clock
+ PVMFStatus status = iSourceNodeInitIF->SetClientPlayBackClock(&iPlaybackClock);
+ if (status != PVMFSuccess)
{
- PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSourceNodeQueryTrackSelIF() Data source type not supported yet so asserting"));
- OSCL_ASSERT(false);
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSourceNodeQueryTrackSelIF() SetClientPlayBackClock failed!"));
return PVMFFailure;
}
@@ -9787,6 +9785,14 @@ void PVPlayerEngine::DoSourceNodeCleanup(void)
if (iSourceNode)
{
+ // Remove reference to the parser node data stream interface if available
+ if (iSourceNodeDataStreamIF)
+ {
+ iSourceNodeDataStreamIF->removeRef();
+ iSourceNodeDataStreamIF = NULL;
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_INFO, (0, "PVPlayerEngine::DoSourceNodeCleanup() - iSourceNodeDataStreamIF Released"));
+ }
+
// Remove reference to the parser node init interface if available
if (iSourceNodeInitIF)
{
@@ -9908,6 +9914,13 @@ void PVPlayerEngine::DoSourceNodeCleanup(void)
}
}
+ // delete the datastream
+ if (ipDataStream)
+ {
+ OSCL_DELETE(ipDataStream);
+ ipDataStream = NULL;
+ }
+
// Cleanup the control varibles related to rate & direction changes.
iPlaybackDirection_New = iPlaybackDirection;
iOutsideTimebase_New = iOutsideTimebase;
@@ -11127,6 +11140,69 @@ void PVPlayerEngine::FreeEngineContext(PVPlayerEngineContext* aContext)
}
}
+void PVPlayerEngine::HandleSourceNodeQueryDataStreamIF(PVPlayerEngineContext& aNodeContext, const PVMFCmdResp& aNodeResp)
+{
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iPerfLogger, PVLOGMSG_STACK_TRACE,
+ (0, "PVPlayerEngine::HandleSourceNodeQueryDataStreamIF Tick=%d", OsclTickCount::TickCount()));
+
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "PVPlayerEngine::HandleSourceNodeQueryDataStreamIF In"));
+
+ PVMFStatus cmdstatus;
+ bool rescheduleAO = false;
+
+ switch (aNodeResp.GetCmdStatus())
+ {
+ case PVMFSuccess:
+ if (iSourceNodePVInterfaceDataStream)
+ {
+ iSourceNodeDataStreamIF = (PVMFDataStreamInitExtension*)iSourceNodePVInterfaceDataStream;
+ iSourceNodePVInterfaceDataStream = NULL;
+ }
+ break;
+ default:
+ break;
+ }
+ // Query for data source init interface
+ cmdstatus = DoSourceNodeQueryInitIF(aNodeContext.iCmdId, aNodeContext.iCmdContext);
+ if (cmdstatus != PVMFSuccess)
+ {
+ if ((CheckForSourceRollOver() == true) && (iRollOverState == RollOverStateInProgress))
+ {
+ iRollOverState = RollOverStateStart;
+ rescheduleAO = true;
+ }
+ else
+ {
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR,
+ (0, "PVPlayerEngine::HandleSourceNodeQueryDataStreamIF DoSourceNodeQueryInitIF failed, Add EH command"));
+ iCommandCompleteStatusInErrorHandling = cmdstatus;
+ iCommandCompleteErrMsgInErrorHandling = NULL;
+ if (iRollOverState == RollOverStateInProgress)
+ {
+ // Init is the current ongoing cmd so queue Init EH cmd
+ AddCommandToQueue(PVP_ENGINE_COMMAND_ERROR_HANDLING_INIT, NULL, NULL, NULL, false);
+ }
+ else
+ {
+ // AddDataSource cmd is Current Command, queue ADS EH cmd
+ AddCommandToQueue(PVP_ENGINE_COMMAND_ERROR_HANDLING_ADD_DATA_SOURCE, NULL, NULL, NULL, false);
+ }
+ iRollOverState = RollOverStateIdle;
+ }
+ }
+
+ if (rescheduleAO)
+ {
+ if (IsBusy())
+ {
+ Cancel();
+ }
+
+ RunIfNotReady();
+ }
+
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_STACK_TRACE, (0, "PVPlayerEngine::HandleSourceNodeQueryDataStreamIF Out"));
+}
void PVPlayerEngine::HandleSourceNodeQueryInitIF(PVPlayerEngineContext& aNodeContext, const PVMFCmdResp& aNodeResp)
{
@@ -14449,26 +14525,20 @@ void PVPlayerEngine::HandleDatapathResume(PVPlayerEngineContext& aDatapathContex
PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::HandleDatapathResume() Report command as completed"));
EngineCommandCompleted(aDatapathContext.iCmdId, aDatapathContext.iCmdContext, PVMFSuccess);
}
- if (!iPendingCmds.empty())
+ if (!iPendingCmds.empty() && (iPendingCmds.top().GetCmdType() == PVP_ENGINE_COMMAND_PAUSE_DUE_TO_SET_PLAYBACK_RANGE))
{
- if (iPendingCmds.top().GetCmdType() == PVP_ENGINE_COMMAND_PAUSE_DUE_TO_SET_PLAYBACK_RANGE)
- {
- // If we are here, it means that the HandleDatapathResume
- // was part of the SetPlaybackRange command, and the StartOfData
- // events have already reached the engine. So, pause the engine.
- RunIfNotReady();
- }
+ // If we are here, it means that the HandleDatapathResume
+ // was part of the SetPlaybackRange command, and the StartOfData
+ // events have already reached the engine. So, pause the engine.
+ RunIfNotReady();
}
- else if (!iCurrentCmd.empty())
+ else if (!iCurrentCmd.empty() && (iCurrentCmd[0].GetCmdType() == PVP_ENGINE_COMMAND_PAUSE_DUE_TO_SET_PLAYBACK_RANGE))
{
- if (iCurrentCmd[0].GetCmdType() == PVP_ENGINE_COMMAND_PAUSE_DUE_TO_SET_PLAYBACK_RANGE)
- {
- // If we are here, it means that the HandleDatapathResume
- // was part of the SetPlaybackRange command, and the StartOfData
- // events have already reached the engine. And, the command has already been
- // attempted to process before.
- RunIfNotReady();
- }
+ // If we are here, it means that the HandleDatapathResume
+ // was part of the SetPlaybackRange command, and the StartOfData
+ // events have already reached the engine. And, the command has already been
+ // attempted to process before.
+ RunIfNotReady();
}
}
else
@@ -16514,6 +16584,106 @@ PVMFStatus PVPlayerEngine::AddErrorHandlingCmd(int32 aCmdType, PVMFStatus aErrSt
return PVMFPending;
}
+PVMFStatus PVPlayerEngine::SetDataStreamOrDataSource(bool aValidDataStream)
+{
+ if (iDataSource->GetDataSourceType() == PVP_DATASRCTYPE_URL)
+ {
+ OSCL_ASSERT(iSourceFormatType != PVMF_MIME_FORMAT_UNKNOWN);
+
+ for (uint32 clipIndex = 0; clipIndex < iDataSource->GetNumClips(); clipIndex++)
+ {
+
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, iLogger, PVLOGMSG_DEBUG, (0, "PVPlayerEngine::DoSourceNodeQueryTrackSelIF() - Set index of current clip to %d", clipIndex));
+ iDataSource->SetCurrentClip(clipIndex);
+
+ OSCL_wHeapString<OsclMemAllocator> sourceURL;
+ // In case the URL starts with file:// skip it
+ OSCL_wStackString<8> fileScheme(_STRLIT_WCHAR("file"));
+ OSCL_wStackString<8> schemeDelimiter(_STRLIT_WCHAR("://"));
+ const oscl_wchar* actualURL = NULL;
+
+ if (oscl_strncmp(fileScheme.get_cstr(), iDataSource->GetDataSourceURL().get_cstr(), 4) == 0)
+ {
+ actualURL = oscl_strstr(iDataSource->GetDataSourceURL().get_cstr(), schemeDelimiter.get_cstr());
+ if (actualURL == NULL)
+ {
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSourceNodeQueryTrackSelIF() Unable to skip over file://"));
+ return PVMFErrArgument;
+ }
+ //skip over ://
+ actualURL += schemeDelimiter.get_size();
+ sourceURL += actualURL;
+ }
+ else
+ {
+ sourceURL += iDataSource->GetDataSourceURL().get_cstr();
+ }
+
+ if (aValidDataStream)
+ {
+ // Create the DataStream using filename
+ uint32 destSize = 128;
+ char filename[128];
+ oscl_UnicodeToUTF8(sourceURL.get_cstr(), sourceURL.get_size(), filename, destSize);
+ ipDataStream = OSCL_NEW(PvmiDataStream, (filename));
+ if (NULL == ipDataStream)
+ return PVMFErrNoMemory;
+ }
+
+ PVMFStatus retval = PVMFFailure;
+ if (clipIndex > 0)
+ {
+ PVMFFormatType srcFormatType = iDataSource->GetDataSourceFormatType();
+ if (aValidDataStream)
+ {
+ // Use DataStream IF
+ retval = iSourceNodeDataStreamIF->InitializeDataStreamData(ipDataStream, srcFormatType);
+ }
+ else
+ {
+ // Use DataSource IF
+ retval = iSourceNodeInitIF->SetSourceInitializationData(sourceURL, srcFormatType, iDataSource->GetDataSourceContextData(), clipIndex);
+ }
+ }
+ else
+ {
+ if (aValidDataStream)
+ {
+ // Use DataStream IF
+ retval = iSourceNodeDataStreamIF->InitializeDataStreamData(ipDataStream, iSourceFormatType);
+ }
+ else
+ {
+ // Use DataSource IF
+ retval = iSourceNodeInitIF->SetSourceInitializationData(sourceURL, iSourceFormatType, iDataSource->GetDataSourceContextData(), clipIndex);
+ }
+ }
+
+ if (retval == PVMFSuccess || retval == PVMFErrAlreadyExists)
+ {
+ iNumClipsQueued++;
+ }
+ else
+ {
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSourceNodeQueryTrackSelIF() SetSourceInitializationData failed errcode %d", retval));
+
+ // dont ignore update failure for clips index == 0
+ if (clipIndex == 0)
+ {
+ return PVMFFailure;
+ }
+ }
+ }
+ }
+ else
+ {
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_ERR, (0, "PVPlayerEngine::DoSourceNodeQueryTrackSelIF() Data source type not supported yet so asserting"));
+ OSCL_ASSERT(false);
+ return PVMFFailure;
+ }
+ return PVMFSuccess;
+}
+
// END FILE
diff --git a/engines/player/src/pv_player_engine.h b/engines/player/src/pv_player_engine.h
index f42aaeaf1..7f9a69b68 100644
--- a/engines/player/src/pv_player_engine.h
+++ b/engines/player/src/pv_player_engine.h
@@ -82,6 +82,10 @@
#include "pvmf_meta_data_extension.h"
#endif
+#ifndef PVMF_DATASTREAM_INIT_EXTENSION_H_INCLUDED
+#include "pvmf_datastream_init_extension.h"
+#endif
+
#ifndef PVMF_DATA_SOURCE_INIT_EXTENSION_H_INCLUDED
#include "pvmf_data_source_init_extension.h"
#endif
@@ -857,6 +861,7 @@ class PVPlayerWatchdogTimerObserver
virtual void PVPlayerWatchdogTimerEvent() = 0;
};
+class PvmiDataStream;
class PVPlayerEngine
: public OsclTimerObject
@@ -1081,6 +1086,7 @@ class PVPlayerEngine
PVMFStatus DoQuerySourceFormatType(PVCommandId aCmdId, OsclAny* aCmdContext);
PVMFStatus DoSetupSourceNode(PVCommandId aCmdId, OsclAny* aCmdContext);
PVMFStatus SetupDataSourceForUnknownURLAccess();
+ PVMFStatus DoSourceNodeQueryInitIF(PVCommandId aCmdId, OsclAny* aCmdContext);
PVMFStatus DoSourceNodeQueryTrackSelIF(PVCommandId aCmdId, OsclAny* aCmdContext);
PVMFStatus DoSourceNodeQueryInterfaceOptional(PVCommandId aCmdId, OsclAny* aCmdContext);
void DoSourceNodeQueryCPMLicenseInterface(PVCommandId aCmdId, OsclAny* aCmdContext);
@@ -1180,6 +1186,7 @@ class PVPlayerEngine
PVMFFormatType iSourceFormatType;
PVMFNodeInterface* iSourceNode;
PVMFSessionId iSourceNodeSessionId;
+ PVMFDataStreamInitExtension* iSourceNodeDataStreamIF;
PVMFDataSourceInitializationExtensionInterface* iSourceNodeInitIF;
PVMFTrackSelectionExtensionInterface* iSourceNodeTrackSelIF;
PvmfDataSourcePlaybackControlInterface* iSourceNodePBCtrlIF;
@@ -1189,6 +1196,7 @@ class PVPlayerEngine
PvmiCapabilityAndConfig* iSourceNodeCapConfigIF;
PVMFDataSourceNodeRegistryInitInterface* iSourceNodeRegInitIF;
PVMFCPMPluginLicenseInterface* iCPMLicenseIF;
+ PVInterface* iSourceNodePVInterfaceDataStream;
PVInterface* iSourceNodePVInterfaceInit;
PVInterface* iSourceNodePVInterfaceTrackSel;
PVInterface* iSourceNodePVInterfacePBCtrl;
@@ -1323,7 +1331,8 @@ class PVPlayerEngine
// Recognizer command
PVP_CMD_QUERYSOURCEFORMATTYPE,
// source roll over
- PVP_CMD_SourceNodeRollOver
+ PVP_CMD_SourceNodeRollOver,
+ PVP_CMD_SourceNodeQueryDataStreamIF
};
PVMFStatus DoSinkNodeChangeClockRate();
@@ -1333,6 +1342,7 @@ class PVPlayerEngine
void UpdateDirection(PVMFTimestamp, PVMFTimestamp, PVPPlaybackPosition&);
// Node command handling functions
+ void HandleSourceNodeQueryDataStreamIF(PVPlayerEngineContext& aNodeContext, const PVMFCmdResp& aNodeResp);
void HandleSourceNodeQueryInitIF(PVPlayerEngineContext& aNodeContext, const PVMFCmdResp& aNodeResp);
void HandleSourceNodeQueryTrackSelIF(PVPlayerEngineContext& aNodeContext, const PVMFCmdResp& aNodeResp);
void HandleSourceNodeQueryInterfaceOptional(PVPlayerEngineContext& aNodeContext, const PVMFCmdResp& aNodeResp);
@@ -1435,6 +1445,8 @@ class PVPlayerEngine
void UpdateCurrentClipSourceDuration();
PVMFStatus DoPauseDatapath(PVMFCommandId aCmdId, OsclAny* aCmdContext);
+ PVMFStatus SetDataStreamOrDataSource(bool aValidDataStream);
+
// Handle to the logger node
PVLogger* iLogger;
PVLogger* iReposLogger;
@@ -1588,6 +1600,8 @@ class PVPlayerEngine
//CPM related - As of today we use this instance of CPM in QueryInterface calls only
//outside of this engine has no interactions with CPM.
PVMFCPM* iCPM;
+
+ PvmiDataStream* ipDataStream;
};
/**
diff --git a/engines/player/src/pv_player_sdkinfo.h b/engines/player/src/pv_player_sdkinfo.h
index c9150e54d..098c48bcb 100644
--- a/engines/player/src/pv_player_sdkinfo.h
+++ b/engines/player/src/pv_player_sdkinfo.h
@@ -21,7 +21,7 @@
// This header file is automatically generated at build-time
// *** OFFICIAL RELEASE INFO -- Will not auto update
-#define PVPLAYER_ENGINE_SDKINFO_LABEL "1491425"
+#define PVPLAYER_ENGINE_SDKINFO_LABEL "1492590"
#define PVPLAYER_ENGINE_SDKINFO_DATE 0x20100611
#endif //PV_PLAYER_SDKINFO_H_INCLUDED