[Datatype-cvs] xps/fileformat CXPSFileformat.cpp, 1.1.1.1.2.21, 1.1.1.1.2.22 CXPSClient.cpp, 1.1.1.1.2.7, 1.1.1.1.2.8
yuryrp at helixcommunity.org yuryrp at helixcommunity.orgUpdate of /cvsroot/datatype/xps/fileformat
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv10498
Modified Files:
Tag: hxclient_2_1_0_cayennes
CXPSFileformat.cpp CXPSClient.cpp
Log Message:
Modified by: yury.ramanovich at nokia.com
Reviewed by: rajesh.rathinasamy at nokia.com
Date: 09/14/2010
Project: symbianMmf_wm
ErrorId: ou1cimx1#555949
Synopsis: MTV 2.0: ISMA channel can't stream well after launching MTV sometimes.
Overview: due to the fact that audioadaptation currently doesnt support setting of restrictedaudiooutput on-the-fly ( in Playing state), MobileTV now sets restrictedaudiooutput only at initialization phase. This however triggers yet another CHXAudioOutputConfigUtil::ConfigureOutputRestrictions() call with the same value of CXPSSession::m_ulSecureOutBitMask by CXPSSession::Enqueue() due to fact that CXPSSession::m_bSecureOutputSet flag set to Etrue in CXPSSession::SetSecureoutputMode() during the init phase above. Sometimes this generates the error, because m_uSecureOutputChangeTime > ulCurrentTime in CHXAudioDevice::GetCurrentAudioTime() and by the time this additional CHXAudioOutputConfigUtil::ConfigureOutputRestrictions() is called, the devsound already in in Playing state.
Solution: since the value of CXPSSession::m_ulSecureOutBitMask didnt change in the init phase and CHXAudioOutputConfigUtil::ConfigureOutputRestrictions() was already done, there is no need to do it again until the next CXPSSession::SetSecureoutputMode() call. Therefore, we can set CXPSSession::m_bSecureOutputSet to Efalse in CXPSSession::HandleGetSecureOutputMode() since HandleGetSecureOutputMode() only called during CXPSFileFormat::InitFileFormat(). CXPSSession::m_ulSecureOutBitMask will be set to Etrue next time CXPSSession::SetSecureoutputMode() will be called by MobileTV.
Note, MobileTV has to relink with updated XPSPacketSink.lib for this change to take effect.
Also added a few logs.
Files Added:
None.
Files Modified:
datatype/xps/PacketSink/CXPSSession.cpp
datatype/xps/fileformat/CXPSFileformat.cpp
datatype/xps/fileformat/CXPSClient.cpp
Image Size and Heap Use impact: minor
Module Release testing : XPSTestApp.
Test case(s) Added : No.
Memory leak check performed : Yes. No new leaks introduced
Platforms and Profiles Build Verified:
helix-client-s60-52-mmf-mdf-dsp
Platforms and Profiles Functionality verified: armv5, winscw
Branch: 210Cays, 420Brizo, HEAD.
Index: CXPSClient.cpp
===================================================================
RCS file: /cvsroot/datatype/xps/fileformat/CXPSClient.cpp,v
retrieving revision 1.1.1.1.2.7
retrieving revision 1.1.1.1.2.8
diff -u -d -r1.1.1.1.2.7 -r1.1.1.1.2.8
--- CXPSClient.cpp 13 Aug 2009 18:42:23 -0000 1.1.1.1.2.7
+++ CXPSClient.cpp 14 Sep 2010 20:10:00 -0000 1.1.1.1.2.8
@@ -241,7 +241,7 @@
Parser.Val(ulSecureOutBitMask,EHex);
}
- HXLOGL1(HXLOG_SXPS, "CXPSClient::GetSecureOutputMode ulSecureOutBitMask=%u, retval=%d", ulSecureOutBitMask, lRetval);
+ HXLOGL1(HXLOG_SXPS, "CXPSClient::GetSecureOutputMode ulSecureOutBitMask(0x%08x), retval(%d)", ulSecureOutBitMask, lRetval);
return lRetval;
}
Index: CXPSFileformat.cpp
===================================================================
RCS file: /cvsroot/datatype/xps/fileformat/CXPSFileformat.cpp,v
retrieving revision 1.1.1.1.2.21
retrieving revision 1.1.1.1.2.22
diff -u -d -r1.1.1.1.2.21 -r1.1.1.1.2.22
--- CXPSFileformat.cpp 9 Aug 2010 04:47:24 -0000 1.1.1.1.2.21
+++ CXPSFileformat.cpp 14 Sep 2010 20:10:00 -0000 1.1.1.1.2.22
@@ -133,13 +133,13 @@
,m_bTSOffsetSet(FALSE)
,m_ulStreamSyncOffsetInMsec(SYNC_STREAM_TIME_OFFSET)
,CHXBaseCountingObject()
- ,m_bSecureOutputChanged(FALSE)
+ ,m_bSecureOutputChanged(FALSE)
#if defined(HELIX_FEATURE_SYMBIAN_ADVANCED_SECURE_OUTPUT)
- ,m_ulSecureOutBitMask(EDrmAllowAll)
-#else
- ,m_ulSecureOutBitMask(0)
-#endif
- ,m_pRegistry(NULL)
+ ,m_ulSecureOutBitMask(EDrmAllowAll)
+#else
+ ,m_ulSecureOutBitMask(0)
+#endif
+ ,m_pRegistry(NULL)
{
}
@@ -152,7 +152,7 @@
HXLOGL2(HXLOG_SXPS, "CXPSFileFormat::~CXPSFileFormat");
Close();
- HX_RELEASE(m_pRegistry);
+ HX_RELEASE(m_pRegistry);
HX_RELEASE(m_pClassFactory);
HX_RELEASE(m_pContext);
@@ -197,26 +197,26 @@
// IHXPlugin::GetPluginInfo
// Returns the basic information about this plugin. Including:
//
-// bLoadMultiple whether or not this plugin DLL can be loaded
-// multiple times. All File Formats must set
-// this value to TRUE.
-// pDescription which is used in about UIs (can be NULL)
-// pCopyright which is used in about UIs (can be NULL)
-// pMoreInfoURL which is used in about UIs (can be NULL)
+// bLoadMultiple whether or not this plugin DLL can be loaded
+// multiple times. All File Formats must set
+// this value to TRUE.
+// pDescription which is used in about UIs (can be NULL)
+// pCopyright which is used in about UIs (can be NULL)
+// pMoreInfoURL which is used in about UIs (can be NULL)
//
STDMETHODIMP CXPSFileFormat::GetPluginInfo
(
- REF(HXBOOL) bLoadMultiple,
- REF(const char*) pDescription,
- REF(const char*) pCopyright,
- REF(const char*) pMoreInfoURL,
- REF(ULONG32) ulVersionNumber
+ REF(HXBOOL) bLoadMultiple,
+ REF(const char*) pDescription,
+ REF(const char*) pCopyright,
+ REF(const char*) pMoreInfoURL,
+ REF(ULONG32) ulVersionNumber
)
{
bLoadMultiple = TRUE; // Must be true for file formats.
pDescription = (const char*) zm_pDescription;
- pCopyright = (const char*) zm_pCopyright;
+ pCopyright = (const char*) zm_pCopyright;
pMoreInfoURL = (const char*) zm_pMoreInfoURL;
ulVersionNumber = 1;
@@ -253,9 +253,9 @@
//
STDMETHODIMP CXPSFileFormat::InitFileFormat
(
- IHXRequest* /*IN*/ pRequest,
- IHXFormatResponse* /*IN*/ pFileFormatResponse,
- IHXFileObject* /*IN*/ pFileObject
+ IHXRequest* /*IN*/ pRequest,
+ IHXFormatResponse* /*IN*/ pFileFormatResponse,
+ IHXFileObject* /*IN*/ pFileObject
)
{
HX_RESULT rv = HXR_OK;
@@ -287,14 +287,14 @@
}
// Extract the Server name
- /*
- If "IgnoreURLOptions " is enabled CHXURL will ignore any options present in the URL.
- XPS server name is send as an option in URL. if "IgnoreURLOptions" is enable
- CHXURL will ignore the options and XPS server name will be returned as NULL. To avoid this,
- instead of PXUtilities::GetURLParam, HXURLUtil::GetOptions() is used to extract server name.
- */
+ /*
+ If "IgnoreURLOptions " is enabled CHXURL will ignore any options present in the URL.
+ XPS server name is send as an option in URL. if "IgnoreURLOptions" is enable
+ CHXURL will ignore the options and XPS server name will be returned as NULL. To avoid this,
+ instead of PXUtilities::GetURLParam, HXURLUtil::GetOptions() is used to extract server name.
+ */
rv = ExtractXPSServerName(pNameBuffer);
-
+
if(pNameBuffer != NULL)
{
strXPSServer = (char*)(pNameBuffer->GetBuffer());
@@ -316,6 +316,7 @@
if(retval == KErrNone)
{
retval = m_pXPSClient->GetSecureOutputMode(m_ulSecureOutBitMask);
+
if(retval==KErrNone)
{
//retval is reset at every function below in order to make sure securemode
@@ -333,8 +334,9 @@
//otherwise, it returns 0
retval = HXR_OK;
}
+
}
-#else
+#else
//Each of 32 bits in ulSecureOutBitMask retrived from XPS server
//representing the secure output mode. Bit 0 means BLOCKING of unsecure
//output devices, while bit 1 means unBLOCKING.
@@ -352,7 +354,9 @@
retval = HXR_OK;
}
}
-#endif
+#endif
+ HXLOGL1(HXLOG_SXPS, "CXPSFileFormat::InitFileFormat() m_ulSecureOutBitMask(0x%08x)",
+ m_ulSecureOutBitMask);
}
}
}
@@ -512,7 +516,7 @@
HXLOGL1(HXLOG_SXPS, "CXPSFileFormat::Seek :%lu", ulOffset);
//reset Secure Output Settings
- m_bSecureOutputChanged = FALSE;
+ m_bSecureOutputChanged = FALSE;
ResetStreams();
@@ -606,7 +610,7 @@
//
-// CXPSClientResponse::PacketReady
+// CXPSClientResponse::PacketReady
// Called when a packet is read from XPS Server
//
TInt CXPSFileFormat::PacketReady(const CXPSPacketHdr& aXPSPktHdr, const TAny* pPyld)
@@ -676,25 +680,25 @@
(UINT16)(aXPSPktHdr.m_uMarker ? 1 : 0));
rv1 = m_parrStreams[aXPSPktHdr.m_uStreamNumber].AddPacket(aXPSPktHdr.m_uSeqNo, pPacket);
- if(m_bSecureOutputChanged && m_SecureOutputInfo.m_uStreamNumber==uStreamNumber)
- {
- //Check if the packet with secure change has arrived
- if( aXPSPktHdr.m_uSeqNo >= m_SecureOutputInfo.m_uSeqNo
- || ( m_SecureOutputInfo.m_uSeqNo>(WRAP_SEQ_NO - WRAP_SEQ_DIFF_TOLERANCE)
- && aXPSPktHdr.m_uSeqNo<WRAP_SEQ_DIFF_TOLERANCE))
- {
- //write the secure output settings and the presentation time to the registry
- m_pRegistry->SetIntByName("MMF.SecureOutputTime", ulTime - m_ulSeekOffset);
+ if(m_bSecureOutputChanged && m_SecureOutputInfo.m_uStreamNumber==uStreamNumber)
+ {
+ //Check if the packet with secure change has arrived
+ if( aXPSPktHdr.m_uSeqNo >= m_SecureOutputInfo.m_uSeqNo
+ || ( m_SecureOutputInfo.m_uSeqNo>(WRAP_SEQ_NO - WRAP_SEQ_DIFF_TOLERANCE)
+ && aXPSPktHdr.m_uSeqNo<WRAP_SEQ_DIFF_TOLERANCE))
+ {
+ //write the secure output settings and the presentation time to the registry
+ m_pRegistry->SetIntByName("MMF.SecureOutputTime", ulTime - m_ulSeekOffset);
#if defined(HELIX_FEATURE_SYMBIAN_ADVANCED_SECURE_OUTPUT)
- m_pRegistry->SetIntByName("MMF.SecureOutput", m_ulSecureOutBitMask);
-#else
- m_pRegistry->SetIntByName("MMF.SecureOutput", ~m_ulSecureOutBitMask);
-#endif
- m_bSecureOutputChanged = FALSE;
- HXLOGL2(HXLOG_SXPS, "CXPSFileFormat::PacketReady SecureOutputChanged m_ulSecureOutBitMask:%lu hxtime:%lu",
- m_ulSecureOutBitMask, ulTime);
- }
- }
+ m_pRegistry->SetIntByName("MMF.SecureOutput", m_ulSecureOutBitMask);
+#else
+ m_pRegistry->SetIntByName("MMF.SecureOutput", ~m_ulSecureOutBitMask);
+#endif
+ m_bSecureOutputChanged = FALSE;
+ HXLOGL2(HXLOG_SXPS, "CXPSFileFormat::PacketReady SecureOutputChanged m_ulSecureOutBitMask:0x%08x hxtime:%lu",
+ m_ulSecureOutBitMask, ulTime);
+ }
+ }
} // End of if(SUCCEEDED(rv1))
HX_RELEASE(pBuffer);
@@ -727,7 +731,7 @@
}
//
-// CXPSClientResponse::PacketReady
+// CXPSClientResponse::PacketReady
// Called on read error case
//
void CXPSFileFormat::PacketReady(TUint uStreamNumber, TInt lStatus)
@@ -747,7 +751,7 @@
}
//
-// CXPSClientResponse::EndStream
+// CXPSClientResponse::EndStream
// Indication for end of stream
//
void CXPSFileFormat::EndStream(TUint uStreamNumber)
@@ -759,9 +763,9 @@
{
m_pFFResponse->StreamDone(uStreamNumber);
}
-
- // Dispatch if there is any outstanding packet requests.
- DispatchPkt(0);
+
+ // Dispatch if there is any outstanding packet requests.
+ DispatchPkt(0);
}
//
@@ -796,49 +800,49 @@
// override default stream sync value
m_ppSDPValues[0]->GetPropertyULONG32("XpsStreamSyncOffset", m_ulStreamSyncOffsetInMsec);
- // Find the number of streams
+ // Find the number of streams
rv = m_ppSDPValues[0]->GetPropertyULONG32("StreamCount", m_ulStreamCount);
- UINT32 ulIndex = 0;
- for(ulIndex = 1; ulIndex <= m_ulStreamCount; ulIndex++)
- {
- IHXBuffer* pMimeType = NULL;
- IHXAudioPushdown2* pAudioPushdown2 = NULL;
- UINT32 ulPushdownValue = 0;
- UINT32 maxPushdownValue = 0;
- IHXValues* pValues = NULL;
+ UINT32 ulIndex = 0;
+ for(ulIndex = 1; ulIndex <= m_ulStreamCount; ulIndex++)
+ {
+ IHXBuffer* pMimeType = NULL;
+ IHXAudioPushdown2* pAudioPushdown2 = NULL;
+ UINT32 ulPushdownValue = 0;
+ UINT32 maxPushdownValue = 0;
+ IHXValues* pValues = NULL;
- // no addd ref addeds
- pValues = m_ppSDPValues[ulIndex];
- HXLOGL1(HXLOG_SXPS, "CXPSFileFormat::SDPReady StreamIdx:%lu", ulIndex );
+ // no addd ref addeds
+ pValues = m_ppSDPValues[ulIndex];
+ HXLOGL1(HXLOG_SXPS, "CXPSFileFormat::SDPReady StreamIdx:%lu", ulIndex );
-
- // Check to see if this is an audio stream
- if (HXR_OK == pValues->GetPropertyCString("MimeType", pMimeType) &&
- !strncasecmp("audio/", (char*)pMimeType->GetBuffer(), 6))
- {
+
+ // Check to see if this is an audio stream
+ if (HXR_OK == pValues->GetPropertyCString("MimeType", pMimeType) &&
+ !strncasecmp("audio/", (char*)pMimeType->GetBuffer(), 6))
+ {
- pValues->GetPropertyULONG32("XpsStreamPushdownValue", ulPushdownValue);
- HXLOGL1(HXLOG_SXPS, "CXPSFileFormat::SDPReady XpsStreamPushdownValue:%lu", ulPushdownValue );
- if(ulPushdownValue > maxPushdownValue)
- {
- m_pContext->QueryInterface(IID_IHXAudioPushdown2, (void**) &pAudioPushdown2);
- if( pAudioPushdown2 )
- {
- pAudioPushdown2->SetAudioPushdown( ulPushdownValue );
- maxPushdownValue = ulPushdownValue;
- HX_RELEASE(pAudioPushdown2);
- }
- }
- }
- else
- {
- // Ignored for other streams
- }
- HX_RELEASE(pMimeType);
- } // End of for(ulIndex = 1; ulIndex <= m_ulStreamCount; ulIndex++)
+ pValues->GetPropertyULONG32("XpsStreamPushdownValue", ulPushdownValue);
+ HXLOGL1(HXLOG_SXPS, "CXPSFileFormat::SDPReady XpsStreamPushdownValue:%lu", ulPushdownValue );
+ if(ulPushdownValue > maxPushdownValue)
+ {
+ m_pContext->QueryInterface(IID_IHXAudioPushdown2, (void**) &pAudioPushdown2);
+ if( pAudioPushdown2 )
+ {
+ pAudioPushdown2->SetAudioPushdown( ulPushdownValue );
+ maxPushdownValue = ulPushdownValue;
+ HX_RELEASE(pAudioPushdown2);
+ }
+ }
+ }
+ else
+ {
+ // Ignored for other streams
+ }
+ HX_RELEASE(pMimeType);
+ } // End of for(ulIndex = 1; ulIndex <= m_ulStreamCount; ulIndex++)
- HXLOGL1(HXLOG_SXPS, "CXPSFileFormat::SDPReady StrmCnt=%lu StreamSync:%lu",
+ HXLOGL1(HXLOG_SXPS, "CXPSFileFormat::SDPReady StrmCnt=%lu StreamSync:%lu",
m_ulStreamCount, m_ulStreamSyncOffsetInMsec);
}
@@ -991,15 +995,15 @@
}
//
-// CXPSClientResponse::SecureOutputModeChanged
+// CXPSClientResponse::SecureOutputModeChanged
// Called when secure output mode has changed from XPS Server
//
void CXPSFileFormat::SecureOutputModeChanged(TUint ulSecureOutBitMask, const SecureOutputInfo& aInfo)
{
- HXLOGL2(HXLOG_SXPS, "CXPSFileFormat::SecureOutputModeChanged ulSecureOutBitMask=%x", ulSecureOutBitMask);
- m_ulSecureOutBitMask = ulSecureOutBitMask;
- m_SecureOutputInfo = aInfo;
- m_bSecureOutputChanged = TRUE;
+ HXLOGL2(HXLOG_SXPS, "CXPSFileFormat::SecureOutputModeChanged ulSecureOutBitMask(0x%08x)", ulSecureOutBitMask);
+ m_ulSecureOutBitMask = ulSecureOutBitMask;
+ m_SecureOutputInfo = aInfo;
+ m_bSecureOutputChanged = TRUE;
}
//
@@ -1013,7 +1017,7 @@
IHXValues* pOptions = NULL;
const char* pURL = NULL;
retVal = m_pRequest->GetURL(pURL);
-
+
if(SUCCEEDED(retVal))
{
CHXString strURL(pURL);
@@ -1041,8 +1045,8 @@
m_pContext);
}
}
-
- HX_RELEASE(pOptions);
+
+ HX_RELEASE(pOptions);
}
}