From jgordon at real.com Fri Jul 13 11:05:56 2007
From: jgordon at real.com (Jamie Gordon)
Date: Fri Jul 13 11:11:03 2007
Subject: [Filesystem-dev] [Fwd: CR:Fix for PR: 195696: CA on linux and HBF
on solaris when retrieving invalid HTTP URL
Message-ID: <4697BF04.80307@real.com>
Forwarding CR from Vijendra
Synopsis
---------
This CR includes fix for PR: 195696: Server gives CA on linux and HBF on
solaris when retrieving invalid HTTP URL
Branch: HEAD
Suggested Reviewer: Anyone
Description
------------
1. I send a setup request with x-wap-profile contain invalid URL.
It tries to connect to web server. But as URL is wrong it is not able to
connect. In solaris case in method hx_connect (netdrv.cpp) it returns
connection refused as error so returning -1 from hx_connect While in win
and on linux it return wouldblock, returning 1 from hx_connect.
This stack of hx_connect is : sockimp.cpp: AttempConnect
sockimp.cpp: ConnecToOne
netdrv.cpp:hx_connect
In case of failure ConnectToOne method returns an error to AttemptConnect.
AttempConnect method checks its return type. if error then it goes to
FinishEnumeration function passing status as HXR_OK to it. That?s wrong.
It should return the status got from hx_connect.
2. If I send a valid url in x-wap-porfile then too server is not sending
any response in case of solaris.
I found the problem is in _WriteRequestChunk method of httpfsys.cpp file.
There it was trying to find the total size of request which it was getting
zero.
Fix
-------
1. Assign the status return from ConnectToOne to status variable.
2. Move the line calculating the totalRequestSize in BeginGet function of
httpfsys.cpp.
Files Affected
-----------------
filesystem/http/httpfsys.cpp
common/netio/platform/posix/sockimp.cpp
Testing Performed
-------------------
Functional Tests:
------------------
- Verified by sending setup request with invalid url to x-wap-profile and
getting response back and server not giving HBF.
- Verified by sending setup request with valid url to x-wap-profile and
getting response back and server not giving HBF.
Integration Tests:
- None
Leak Tests:
- None
Performance Tests:
- None
Build Verified:
---------------
win32-i386-vc7
linux-rhel4-i686
sunos-5.10-sparc-server
Platform Tested:
----------------
sunos-5.10-sparc-server
QA hints
--------
- None.
Thanks
Vijendra.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: httpfsys.cpp.diff
Type: application/octet-stream
Size: 633 bytes
Desc: not available
Url : http://lists.helixcommunity.org/pipermail/filesystem-dev/attachments/20070713/0263ffb2/httpfsys.cpp-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sockimp.cpp.diff
Type: application/octet-stream
Size: 582 bytes
Desc: not available
Url : http://lists.helixcommunity.org/pipermail/filesystem-dev/attachments/20070713/0263ffb2/sockimp.cpp-0001.obj
From ehyche at real.com Mon Jul 16 07:22:13 2007
From: ehyche at real.com (Eric Hyche)
Date: Mon Jul 16 07:26:33 2007
Subject: [Filesystem-dev] RE: [Common-dev] [Fwd: CR:Fix for PR: 195696: CA
on linux and HBF on solaris when retrieving invalid HTTP URL
In-Reply-To: <4697BF04.80307@real.com>
References: <4697BF04.80307@real.com>
Message-ID: <004701c7c7b4$b5413a20$db68a8c0@EHYCHED620>
These changes look good.
=============================================
Eric Hyche (ehyche@real.com)
Technical Lead
RealNetworks, Inc.
> -----Original Message-----
> From: common-dev-bounces@helixcommunity.org
> [mailto:common-dev-bounces@helixcommunity.org] On Behalf Of
> Jamie Gordon
> Sent: Friday, July 13, 2007 2:06 PM
> To: common-dev@helixcommunity.org;
> filesystem-dev@helixcommunity.org; Vijendra
> Subject: [Common-dev] [Fwd: CR:Fix for PR: 195696: CA on
> linux and HBF on solaris when retrieving invalid HTTP URL
>
> Forwarding CR from Vijendra
>
>
>
> Synopsis
> ---------
>
>
> This CR includes fix for PR: 195696: Server gives CA on linux
> and HBF on
> solaris when retrieving invalid HTTP URL
>
> Branch: HEAD
>
> Suggested Reviewer: Anyone
>
> Description
> ------------
> 1. I send a setup request with x-wap-profile contain invalid URL.
>
> It tries to connect to web server. But as URL is wrong it is
> not able to
> connect. In solaris case in method hx_connect (netdrv.cpp) it returns
> connection refused as error so returning -1 from hx_connect
> While in win
> and on linux it return wouldblock, returning 1 from hx_connect.
>
> This stack of hx_connect is : sockimp.cpp: AttempConnect
> sockimp.cpp: ConnecToOne
> netdrv.cpp:hx_connect
>
> In case of failure ConnectToOne method returns an error to
> AttemptConnect.
> AttempConnect method checks its return type. if error then it goes to
> FinishEnumeration function passing status as HXR_OK to it.
> That?s wrong.
> It should return the status got from hx_connect.
>
>
> 2. If I send a valid url in x-wap-porfile then too server is
> not sending
> any response in case of solaris.
> I found the problem is in _WriteRequestChunk method of
> httpfsys.cpp file.
> There it was trying to find the total size of request which
> it was getting
> zero.
>
> Fix
> -------
>
> 1. Assign the status return from ConnectToOne to status variable.
> 2. Move the line calculating the totalRequestSize in BeginGet
> function of
> httpfsys.cpp.
>
> Files Affected
> -----------------
>
> filesystem/http/httpfsys.cpp
> common/netio/platform/posix/sockimp.cpp
>
>
> Testing Performed
> -------------------
>
>
> Functional Tests:
> ------------------
>
> - Verified by sending setup request with invalid url to
> x-wap-profile and
> getting response back and server not giving HBF.
>
> - Verified by sending setup request with valid url to
> x-wap-profile and
> getting response back and server not giving HBF.
>
> Integration Tests:
> - None
>
>
> Leak Tests:
> - None
>
> Performance Tests:
>
> - None
>
>
> Build Verified:
> ---------------
> win32-i386-vc7
> linux-rhel4-i686
> sunos-5.10-sparc-server
>
>
> Platform Tested:
> ----------------
> sunos-5.10-sparc-server
>
> QA hints
> --------
>
> - None.
>
> Thanks
>
> Vijendra.
>
>
>
From ehyche at real.com Wed Jul 18 07:42:00 2007
From: ehyche at real.com (Eric Hyche)
Date: Wed Jul 18 07:45:50 2007
Subject: [Filesystem-dev] RE: [Clientapps-dev] FW: CR: Enhanced Media Client
Support to Helixaudio controller
In-Reply-To: <2A15C07EF7DF6243A092FB438FD4B3663CF71D@daebe103.NOE.Nokia.com>
References: <2A15C07EF7DF6243A092FB438FD4B3663CF71D@daebe103.NOE.Nokia.com>
Message-ID: <003b01c7c949$ce43e4a0$db68a8c0@EHYCHED620>
These changes look good to me.
=============================================
Eric Hyche (ehyche@real.com)
Technical Lead
RealNetworks, Inc.
> -----Original Message-----
> From: clientapps-dev-bounces@helixcommunity.org
> [mailto:clientapps-dev-bounces@helixcommunity.org] On Behalf
> Of Praveen.Thimmashetty@nokia.com
> Sent: Tuesday, July 17, 2007 7:11 PM
> To: clientapps-dev@helixcommunity.org;
> filesystem-dev@helixcommunity.org; common-dev@helixcommunity.org
> Subject: [Clientapps-dev] FW: CR: Enhanced Media Client
> Support to Helixaudio controller
>
>
>
>
>
> "Nokia submits this code under the terms of a commercial
> contribution agreement with Real Networks, and I am
> authorized to contribute this code under said agreement."
>
> Modified by: praveen.thimmashetty@nokia.com
>
> Reviewed by:
>
> Date: 17-July-2007
>
> Project: SymbianMmf_Rel
>
> Req ID: 102-6041
>
> Synopsis: This requirement adds the support for handling a
> new data source ( CMultimediaDataSource ) to Helix Audio
> Controllers. This Multimedia data source is implemented by
> clients(Eg: Enhanced multimedia client) which provide buffers
> to helix for playback. For details refer to the attached document.
>
> Files Modified: clientapps/symbianMmf/hxmmfstatectrl.cpp
> clientapps/symbianMmf/hxmmfstatectrl.h
> clientapps/symbianMmf/hxmmfstatectrlobs.h
> clientapps/symbianMmf/hxmmfstatepaused.cpp
> clientapps/symbianMmf/hxmmfstateplaying.cpp
> clientapps/symbianMmf/audiocontroller/controllerdll
>
> clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.cpp
>
> clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.h
> clientapps/symbianMmf/common/hxmmfbasectrl.cpp
> clientapps/symbianMmf/common/hxmmfbasectrl.h
> clientapps/symbianMmf/videocontroller/MmfCtrlDll
> common/fileio/hxdatasource.cpp
> common/fileio/symbian.pcf
> common/fileio/pub/hxdatasource.h
> common/include/ihxmmfdatasource.h
> common/include/hxpiids.h
> filesystem/local/mini/minifileobj.cpp
> filesystem/local/mini/minifileobj.h
>
> Files Added:
>
> common\fileio\platform\symbian\HxMMDataSource.cpp
>
> common\fileio\pub\platform\symbian\HxMMDataSource.h
>
> ======================================================
> Image Size and Heap Use impact: minor
>
> Module Release testing (STIF) : Passed
>
> Test case(s) Added : None
>
> Memory leak check performed : Yes. No new leaks introduced.
>
> Platforms and Profiles Build Verified:
> helix-client-s60-32-mmf-mdf-arm
>
> Platforms and Profiles Functionality verified: armv5, winscw
>
> Branch: Head & 210CayS
>
> <> < Design-v0.1.doc>> <> <>
>
>
From Praveen.Thimmashetty at nokia.com Tue Jul 17 16:10:38 2007
From: Praveen.Thimmashetty at nokia.com (Praveen.Thimmashetty@nokia.com)
Date: Wed Jul 18 10:25:18 2007
Subject: [Filesystem-dev] FW: CR: Enhanced Media Client Support to Helix
audio controller
Message-ID: <2A15C07EF7DF6243A092FB438FD4B3663CF71D@daebe103.NOE.Nokia.com>
Skipped content of type multipart/alternative-------------- next part --------------
Index: clientapps/symbianMmf/hxmmfstatectrl.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/hxmmfstatectrl.cpp,v
retrieving revision 1.4.2.17
diff -w -u -b -r1.4.2.17 hxmmfstatectrl.cpp
--- clientapps/symbianMmf/hxmmfstatectrl.cpp 10 Apr 2007 22:29:44 -0000 1.4.2.17
+++ clientapps/symbianMmf/hxmmfstatectrl.cpp 17 Jul 2007 22:36:51 -0000
@@ -540,6 +540,20 @@
m_pObserver->OnPrepareComplete();
}
+void
+HXMMFStateCtrl::OnPlaying()
+{
+ if ( m_pObserver )
+ m_pObserver->OnPlaying();
+}
+
+void
+HXMMFStateCtrl::OnPaused()
+{
+ if ( m_pObserver )
+ m_pObserver->OnPaused();
+}
+
HX_RESULT HXMMFStateCtrl::OpenURL(const char *url)
{
HX_RESULT lError;
Index: clientapps/symbianMmf/hxmmfstatectrl.h
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/hxmmfstatectrl.h,v
retrieving revision 1.3.2.8
diff -w -u -b -r1.3.2.8 hxmmfstatectrl.h
--- clientapps/symbianMmf/hxmmfstatectrl.h 3 Nov 2006 20:58:22 -0000 1.3.2.8
+++ clientapps/symbianMmf/hxmmfstatectrl.h 17 Jul 2007 22:36:51 -0000
@@ -151,6 +151,8 @@
HX_RESULT Prepare(const char * url);
HX_RESULT Prepare(IHXRequest *pReqest);
void PrepareComplete();
+ void OnPlaying();
+ void OnPaused();
// called by owner to release all the resources.
void Close();
void SendLoadingStatus(void);
Index: clientapps/symbianMmf/hxmmfstatectrlobs.h
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/hxmmfstatectrlobs.h,v
retrieving revision 1.1.2.1
diff -w -u -b -r1.1.2.1 hxmmfstatectrlobs.h
--- clientapps/symbianMmf/hxmmfstatectrlobs.h 11 Sep 2006 21:22:58 -0000 1.1.2.1
+++ clientapps/symbianMmf/hxmmfstatectrlobs.h 17 Jul 2007 22:36:51 -0000
@@ -65,6 +65,8 @@
virtual void OnLoadingStarted() = 0;
virtual void OnLoadingComplete() = 0;
virtual void OnPrepareComplete() = 0;
+ virtual void OnPlaying() = 0;
+ virtual void OnPaused() = 0;
virtual void OnError( const UINT8 unSeverity,
const ULONG32 ulHXCode,
const ULONG32 ulUserCode,
Index: clientapps/symbianMmf/hxmmfstatepaused.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/hxmmfstatepaused.cpp,v
retrieving revision 1.3.2.9
diff -w -u -b -r1.3.2.9 hxmmfstatepaused.cpp
--- clientapps/symbianMmf/hxmmfstatepaused.cpp 10 Apr 2007 22:21:00 -0000 1.3.2.9
+++ clientapps/symbianMmf/hxmmfstatepaused.cpp 17 Jul 2007 22:36:51 -0000
@@ -125,7 +125,7 @@
m_pStateCtrl->ChangeState(STATE_PLAYING);
hr = m_pPlayerControl->Begin();
m_pStateCtrl->SendLoadingStatus();
-
+ m_pStateCtrl->OnPlaying();
return(hr);
}
Index: clientapps/symbianMmf/hxmmfstateplaying.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/hxmmfstateplaying.cpp,v
retrieving revision 1.2.2.4
diff -w -u -b -r1.2.2.4 hxmmfstateplaying.cpp
--- clientapps/symbianMmf/hxmmfstateplaying.cpp 10 Apr 2007 22:29:19 -0000 1.2.2.4
+++ clientapps/symbianMmf/hxmmfstateplaying.cpp 17 Jul 2007 22:36:51 -0000
@@ -86,6 +86,7 @@
HXLOGL2(HXLOG_SMMF, "HXMMFStatePlaying::Pause");
hr = m_pPlayerControl->Pause();
m_pStateCtrl->ChangeState(STATE_PAUSED);
+ m_pStateCtrl->OnPaused();
return(hr);
}
Index: clientapps/symbianMmf/audiocontroller/controllerdll
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/audiocontroller/controllerdll,v
retrieving revision 1.1.2.4
diff -w -u -b -r1.1.2.4 controllerdll
--- clientapps/symbianMmf/audiocontroller/controllerdll 3 Apr 2007 18:41:55 -0000 1.1.2.4
+++ clientapps/symbianMmf/audiocontroller/controllerdll 17 Jul 2007 22:36:51 -0000
@@ -122,7 +122,9 @@
"msgs.lib",
"eikctl.lib",
"DrmDcf.lib",
- "custominterfacebuilder.lib" )
+ "custominterfacebuilder.lib",
+ "MMDataSourceFactory.lib",
+ "StreamControlCustomCommands.lib" )
if (project.IsDefined('HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY')):
project.AddSystemLibraries("CENTRALREPOSITORY.LIB")
@@ -165,7 +167,9 @@
"field.lib(VtblExports.o)",
"msgs.lib(VtblExports.o)",
"eikctl.lib(VtblExports.o)",
- "custominterfacebuilder.lib(VtblExports.o)" )
+ "custominterfacebuilder.lib(VtblExports.o)",
+ "MMDataSourceFactory.lib(VtblExports.o)",
+ "StreamControlCustomCommands.lib(VtblExports.o)" )
#
# Resource File
Index: clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.cpp,v
retrieving revision 1.1.2.11
diff -w -u -b -r1.1.2.11 hxmmfaudioctrl.cpp
--- clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.cpp 18 Jun 2007 21:50:10 -0000 1.1.2.11
+++ clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.cpp 17 Jul 2007 22:36:52 -0000
@@ -162,6 +162,11 @@
CleanupStack::Pop(pAudPlayConParser);
_InitCustomCommandParsersL();
+
+ CStreamControlCustomCommandParser* scCCParser = CStreamControlCustomCommandParser::NewL(*this);
+ CleanupStack::PushL(scCCParser);
+ AddCustomCommandParserL(*scCCParser);
+ CleanupStack::Pop(scCCParser);
}
void
@@ -264,6 +269,37 @@
}
}
+void
+CHXAudioController::PrimeL()
+{
+ TInt lError = KErrNone;
+ HXLOGL1(HXLOG_SMMF, "CHXAudioController::PrimeL()");
+ if(m_bEMC)
+ {
+ HX_RESULT result = m_pStateCtrl->Prepare( m_pRequest );
+
+ if ( HXR_OK != result )
+ {
+ SendEvent(PrepareComplete, result);
+ // convert helix status to symbian status
+ MapToMMFStatus( result, lError);
+ }
+ else
+ {
+ m_nextEvent = PrepareComplete;
+ lError = KErrNone;
+ }
+
+ // Check for the error and leave
+ if(lError != KErrNone)
+ {
+ HXLOGL1( HXLOG_SMMF,
+ "CHXAudioController::PrimeL() Failed : %d", lError);
+ User::Leave(lError);
+ }
+ }
+}
+
//
// Custom Commands
//
@@ -812,7 +848,8 @@
{
HXLOGL1( HXLOG_SMMF,
"CHXAudioController::AddDataSourceL() Prepare Engine");
-
+ if(!m_bEMC)
+ {
result = m_pStateCtrl->Prepare( m_pRequest );
if ( HXR_OK != result )
@@ -828,6 +865,7 @@
lError = m_lAsyncWaitError;
}
}
+ }
else
{
// convert helix status to symbian status
@@ -935,10 +973,41 @@
{
HXLOGL2(HXLOG_SMMF, "CHXAudioController::SendEvent(%s,%lx)",
EventToName(event), status);
-
+ HXBOOL found = true;
TMMFEvent mmfEvent;
+ if(m_bEMC)
+ {
+ switch (event)
+ {
+ case OpenComplete:
+ mmfEvent.iEventType = KMMFEventCategoryVideoOpenComplete;
+ break;
+ case PrepareComplete:
+ mmfEvent.iEventType = KStreamControlEventStateChangedPrimed;
+ break;
+ case PlaybackComplete:
+ mmfEvent.iEventType = KStreamControlEventStateChangedStopped;
+ break;
+ case LoadingStarted:
+ mmfEvent.iEventType = KStreamControlEventStateChangedAutoPaused;
+ break;
+ case LoadingComplete:
+ mmfEvent.iEventType = KStreamControlEventStateChangedPlaying;
+ break;
+ case AudioDeviceTaken:
+ mmfEvent.iEventType = KMMFEventCategoryVideoPlayerGeneralError;
+ break;
+ default:
+ found = MapToMMFEvent(event, mmfEvent.iEventType);
+ break;
+ }
+ }
+ else
+ {
+ found = MapToMMFEvent(event, mmfEvent.iEventType);
+ }
- if ( MapToMMFEvent(event, mmfEvent.iEventType) )
+ if ( found )
{
MapToMMFStatus(status, mmfEvent.iErrorCode);
@@ -969,4 +1038,24 @@
m_ulLastError = HXR_OK;
}
+TInt
+CHXAudioController::MscEnableEvents(TBool aEnable)
+{
+ HXLOGL2(HXLOG_SMMF, "CHXAudioController::MscEnableEvents");
+ m_bEMC = aEnable;
+ return KErrNone;
+}
+
+TInt
+CHXAudioController::MscGetSeekingSupported(TBool& /*aSupported*/)
+{
+ return KErrNotSupported;
+}
+
+TInt
+CHXAudioController::MscGetRandomSeekingSupported(TBool& /*aSupported*/)
+{
+ return KErrNotSupported;
+}
+
// End of File
Index: clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.h
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.h,v
retrieving revision 1.1.2.5
diff -w -u -b -r1.1.2.5 hxmmfaudioctrl.h
--- clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.h 3 Apr 2007 18:41:55 -0000 1.1.2.5
+++ clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.h 17 Jul 2007 22:36:52 -0000
@@ -68,6 +68,8 @@
#include "hxmmfcustominterface.h"
#include
+#include
+
class CCustomInterfaceBuilder;
class MDataSource;
class MDataSink;
@@ -85,6 +87,7 @@
,public MMMFAudioPlayControllerCustomCommandImplementor
,public MMMFAudioControllerCustomCommandImplementor
,public MMMFDRMCustomCommandImplementor
+ ,public MStreamControlCustomCommandImplementor
{
public:
static CHXAudioController* NewL();
@@ -97,6 +100,7 @@
virtual void PlayL();
virtual void PauseL();
virtual void StopL();
+ virtual void PrimeL();
//
// MMMFAudioPlayControllerCustomCommandImplementor Methods
@@ -203,9 +207,11 @@
//
void GetPropertyL(MHXControllerProperties::EHXControllerProperty Property, CHXString &sValue);
+ // functions from MStreamControlCustomCommandImplementor
-
-
+ virtual TInt MscEnableEvents(TBool aEnable);
+ virtual TInt MscGetSeekingSupported(TBool& aSupported);
+ virtual TInt MscGetRandomSeekingSupported(TBool& aSupported);
CHXAudioController();
void ConstructL();
Index: clientapps/symbianMmf/common/hxmmfbasectrl.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/common/hxmmfbasectrl.cpp,v
retrieving revision 1.1.2.24
diff -w -u -b -r1.1.2.24 hxmmfbasectrl.cpp
--- clientapps/symbianMmf/common/hxmmfbasectrl.cpp 22 Jun 2007 15:06:00 -0000 1.1.2.24
+++ clientapps/symbianMmf/common/hxmmfbasectrl.cpp 17 Jul 2007 22:36:53 -0000
@@ -59,6 +59,7 @@
#include "hxmmfbasectrl.h"
#include "hxdatasourcemmfclip.h"
+#include "HxMMDataSource.h"
#include "rtsputil.h"
#include "hxmmfmemutil.h"
#include "chxminiccf.h"
@@ -217,6 +218,7 @@
, m_bEngineCreated(FALSE)
, m_bUpdatePrioritySettings(FALSE)
, m_pCustomInterfaceBuilder(NULL)
+ , m_bEMC(EFalse)
{
}
@@ -322,6 +324,12 @@
case VideoDeviceRestored:
name = "VideoDeviceRestored";
break;
+ case PlaybackStarted:
+ name = "PlaybackStarted";
+ break;
+ case PlaybackPaused:
+ name = "PlaybackPaused";
+ break;
default:
name = "Unknown";
break;
@@ -921,7 +929,22 @@
HXLOGL1(HXLOG_SMMF, "HXMMFBaseCtrl::_AddDataSourceL()");
- if ( aDataSource.DataSourceType() == KUidMmfFileSource )
+ if ( m_bEMC )
+ {
+ m_url = DESCRIPTOR_URL;
+ m_pDataSource = CHxMMDataSource::NewL(aDataSource);
+
+ if (!m_pDataSource)
+ {
+ result = HXR_OUTOFMEMORY;
+ }
+ else
+ {
+ HX_ADDREF(m_pDataSource);
+ result = HXR_OK;
+ }
+ }
+ else if ( aDataSource.DataSourceType() == KUidMmfFileSource )
{
TBuf fileName;
CMMFFile* pFileSource = (CMMFFile*)&aDataSource;
@@ -1171,6 +1194,60 @@
}
void
+HXMMFBaseCtrl::OnPlaying()
+{
+ HXLOGL1(HXLOG_SMMF, "HXMMFBaseCtrl::OnPlaying()");
+ if(m_bEMC)
+ {
+ Event event;
+ TMMFEvent mmfEvent;
+ mmfEvent.iEventType = KStreamControlEventStateChangedPlaying;
+ event = PlaybackStarted;
+ MapToMMFStatus(m_ulLastError, mmfEvent.iErrorCode);
+ DoSendEventToClient(mmfEvent);
+
+ //
+ // Log errors.
+ //
+ if ( mmfEvent.iErrorCode != KErrNone )
+ {
+ CHXString errText;
+ errText.Format(
+ "%d,%s (%lx)", mmfEvent.iErrorCode, EventToName(event), m_ulLastError );
+
+ m_pLogSink->LogMessage( KMMFROPErrorLogSendEvents, errText );
+ }
+ }
+}
+
+void
+HXMMFBaseCtrl::OnPaused()
+{
+ HXLOGL1(HXLOG_SMMF, "HXMMFBaseCtrl::OnPaused()");
+ if(m_bEMC)
+ {
+ Event event;
+ TMMFEvent mmfEvent;
+ mmfEvent.iEventType = KStreamControlEventStateChangedPaused;
+ event = PlaybackPaused;
+ MapToMMFStatus(m_ulLastError, mmfEvent.iErrorCode);
+ DoSendEventToClient(mmfEvent);
+
+ //
+ // Log errors.
+ //
+ if ( mmfEvent.iErrorCode != KErrNone )
+ {
+ CHXString errText;
+ errText.Format(
+ "%d,%s (%lx)", mmfEvent.iErrorCode, EventToName(event), m_ulLastError );
+
+ m_pLogSink->LogMessage( KMMFROPErrorLogSendEvents, errText );
+ }
+ }
+}
+
+void
HXMMFBaseCtrl::HandleEnvChange()
{
HX_ASSERT(m_pEnvChange);
Index: clientapps/symbianMmf/common/hxmmfbasectrl.h
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/common/hxmmfbasectrl.h,v
retrieving revision 1.1.2.7
diff -w -u -b -r1.1.2.7 hxmmfbasectrl.h
--- clientapps/symbianMmf/common/hxmmfbasectrl.h 3 Apr 2007 18:41:56 -0000 1.1.2.7
+++ clientapps/symbianMmf/common/hxmmfbasectrl.h 17 Jul 2007 22:36:53 -0000
@@ -61,6 +61,7 @@
#include
#include
#include
+#include
#include "hxstring.h"
@@ -136,6 +137,8 @@
const char* pUserString,
const char* pMoreInfoURL ) = 0;
virtual void OnPrepareComplete() = 0;
+ virtual void OnPlaying();
+ virtual void OnPaused();
virtual void OnLoadingStarted() = 0;
virtual void OnLoadingComplete() = 0;
virtual void OnPresentationClosed() = 0;
@@ -176,7 +179,9 @@
AudioDeviceTaken = 6,
ErrorEvent = 7,
VideoDeviceTaken = 8,
- VideoDeviceRestored = 9
+ VideoDeviceRestored = 9,
+ PlaybackStarted = 10,
+ PlaybackPaused = 11
};
static const char* EventToName(Event event);
@@ -227,6 +232,7 @@
TMMFPrioritySettings m_PrioritySettings;
HXBOOL m_bUpdatePrioritySettings;
CCustomInterfaceBuilder* m_pCustomInterfaceBuilder;
+ HXBOOL m_bEMC;
};
Index: clientapps/symbianMmf/videocontroller/MmfCtrlDll
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/videocontroller/MmfCtrlDll,v
retrieving revision 1.3.2.6
diff -w -u -b -r1.3.2.6 MmfCtrlDll
--- clientapps/symbianMmf/videocontroller/MmfCtrlDll 3 Apr 2007 18:41:56 -0000 1.3.2.6
+++ clientapps/symbianMmf/videocontroller/MmfCtrlDll 17 Jul 2007 22:36:53 -0000
@@ -122,7 +122,9 @@
"msgs.lib",
"eikctl.lib",
"DrmDcf.lib",
- "custominterfacebuilder.lib" )
+ "custominterfacebuilder.lib",
+ "MMDataSourceFactory.lib",
+ "StreamControlCustomCommands.lib" )
if (project.IsDefined('HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY')):
project.AddSystemLibraries("CENTRALREPOSITORY.LIB")
@@ -164,7 +166,9 @@
"etext.lib(VtblExports.o)",
"field.lib(VtblExports.o)",
"msgs.lib(VtblExports.o)",
- "eikctl.lib(VtblExports.o)" )
+ "eikctl.lib(VtblExports.o)",
+ "MMDataSourceFactory.lib(VtblExports.o)",
+ "StreamControlCustomCommands.lib(VtblExports.o)" )
Index: common/fileio/hxdatasource.cpp
===================================================================
RCS file: /cvsroot/common/fileio/hxdatasource.cpp,v
retrieving revision 1.1.2.3
diff -w -u -b -r1.1.2.3 hxdatasource.cpp
--- common/fileio/hxdatasource.cpp 28 Jun 2007 16:42:14 -0000 1.1.2.3
+++ common/fileio/hxdatasource.cpp 17 Jul 2007 22:36:56 -0000
@@ -104,7 +104,7 @@
}
STDMETHODIMP CHXDataSource::Open(IHXRequest *pRequest,
- const char *modeStr)
+ const char *modeStr, IHXMMFDataSourceObserver* pObserver)
{
HXLOGL4(HXLOG_FILE, "CHXDataSource::Open");
HX_RESULT hxr = HXR_OK;
@@ -198,13 +198,21 @@
TInt index( 0 );
if( FindFileObjectIndex( index, pFileObject ) != HXR_OK )
{
- retVal = Open( pRequest, mode );
+ IHXMMFDataSourceObserver* pObserver = NULL;
+
+ pFileObject->QueryInterface(IID_IHXMMFDataSourceObserver, (void **) &pObserver);
+
+ if(pObserver != NULL)
+ {
+ retVal = Open( pRequest, mode, pObserver );
if( retVal == HXR_OK )
{
m_lLastFileObjectIndex = m_FileObjectList.Count();
m_FileObjectList.Append( pFileObject );
m_FileObjectPosition.Append( 0 );
}
+ HX_RELEASE(pObserver);
+ }
}
else
{
@@ -349,4 +357,8 @@
}
return retVal;
}
+STDMETHODIMP CHXDataSource::AsyncReadSupported()
+{
+ return FALSE;
+}
Index: common/fileio/symbian.pcf
===================================================================
RCS file: /cvsroot/common/fileio/symbian.pcf,v
retrieving revision 1.10.2.1
diff -w -u -b -r1.10.2.1 symbian.pcf
--- common/fileio/symbian.pcf 19 Sep 2006 21:11:40 -0000 1.10.2.1
+++ common/fileio/symbian.pcf 17 Jul 2007 22:36:56 -0000
@@ -68,5 +68,6 @@
project.AddSources('platform/symbian/hxdatasource_factory.cpp',
'platform/symbian/hxdatasource_ccontent.cpp',
'platform/symbian/hxdatasource_descriptor.cpp',
- 'platform/symbian/hxdatasourcemmfclip.cpp')
+ 'platform/symbian/hxdatasourcemmfclip.cpp',
+ 'platform/symbian/HxMMDataSource.cpp')
Index: common/fileio/pub/hxdatasource.h
===================================================================
RCS file: /cvsroot/common/fileio/pub/hxdatasource.h,v
retrieving revision 1.1.2.3
diff -w -u -b -r1.1.2.3 hxdatasource.h
--- common/fileio/pub/hxdatasource.h 28 Jun 2007 16:42:15 -0000 1.1.2.3
+++ common/fileio/pub/hxdatasource.h 17 Jul 2007 22:36:56 -0000
@@ -71,7 +71,7 @@
STDMETHOD_(ULONG32,Release) (THIS);
- STDMETHOD(Open) (THIS_ IHXRequest *pRequest, const char *mode);
+ STDMETHOD(Open) (THIS_ IHXRequest *pRequest, const char *mode, IHXMMFDataSourceObserver* pObserver = NULL);
STDMETHOD(Seek) (THIS_ UINT32 offset, INT32 fromWhere);
STDMETHOD(Stat) (THIS_ struct stat *buf);
STDMETHOD(GetStringAttribute)(THIS_ UINT32 ulAttibute,
@@ -84,7 +84,7 @@
virtual UINT32 Write(THIS_ void *, ULONG32 size, ULONG32 count) PURE;
STDMETHOD(GetSize) (THIS_ UINT32 &ulSize) PURE;
STDMETHOD(GetLastError) (THIS_);
-
+ STDMETHOD(AsyncReadSupported) (THIS_);
public: //enable multi read/write
STDMETHOD(Open2) (THIS_ IHXRequest *pRequest, const char *mode, IHXFileObject* pFileObject);
STDMETHOD(Seek2) (THIS_ UINT32 offset, INT32 fromWhere, IHXFileObject* pFileObject);
Index: common/include/hxpiids.h
===================================================================
RCS file: /cvsroot/common/include/hxpiids.h,v
retrieving revision 1.47.2.1
diff -w -u -b -r1.47.2.1 hxpiids.h
--- common/include/hxpiids.h 24 Aug 2006 19:48:51 -0000 1.47.2.1
+++ common/include/hxpiids.h 17 Jul 2007 22:36:58 -0000
@@ -1110,6 +1110,15 @@
DEFINE_GUID_ENUM(IID_IHXDownloadEventObserver,
0x6d2f6c25, 0x9be1, 0x4ee1, 0x8d, 0xf5, 0xaa, 0xdf, 0xa7, 0x55, 0xd0, 0x40)
+/* File:
+ * ihxmmfdatasource.h
+ *
+ * Description:
+ * Interface for Asynchronous data reading from a source.
+ */
+
+DEFINE_GUID_ENUM(IID_IHXMMFDataSourceObserver,
+0x75887012, 0x4fa7, 0x473b, 0x97, 0x14, 0xb9, 0x8, 0xe4, 0xee, 0x9d, 0x99)
#endif /* _HXPRIVATEIIDS_H_ */
Index: common/include/ihxmmfdatasource.h
===================================================================
RCS file: /cvsroot/common/include/ihxmmfdatasource.h,v
retrieving revision 1.1.2.3
diff -w -u -b -r1.1.2.3 ihxmmfdatasource.h
--- common/include/ihxmmfdatasource.h 28 Jun 2007 16:43:19 -0000 1.1.2.3
+++ common/include/ihxmmfdatasource.h 17 Jul 2007 22:36:58 -0000
@@ -51,10 +51,51 @@
#define _IHXMMFDATASOURCE_H_
+/****************************************************************************
+ *
+ * Interface:
+ *
+ * IHXMMFDataSourceObserver
+ *
+ * Purpose:
+ *
+ * Data source observer interface. Used for asynchronous data transfer.
+ * object ownership is best managed through COM style reference
+ * counting.
+ *
+ * IID_IHXMMFDataSourceObserver:
+ *
+ * {75887012-4FA7-473b-9714-B908E4EE9D99}
+ */
+
+DEFINE_GUID(IID_IHXMMFDataSourceObserver, 0x75887012, 0x4fa7, 0x473b, 0x97, 0x14, 0xb9, 0x8, 0xe4, 0xee, 0x9d, 0x99);
+
+#undef INTERFACE
+#define INTERFACE IHXMMFDataSourceObserver
+
+DECLARE_INTERFACE_(IHXMMFDataSourceObserver, IUnknown)
+{
+ /*
+ * IUnknown methods
+ */
+ STDMETHOD(QueryInterface) (THIS_
+ REFIID riid,
+ void** ppvObj) PURE;
+
+ STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
+
+ STDMETHOD_(ULONG32,Release) (THIS) PURE;
+ /*
+ Informs datasource observer once read request is complete.
+ */
+ virtual void ReadDone(THIS_
+ void * pBuffer, ULONG32 ulCount
+ ) PURE;
+};
+
// warnning: This interface and related functionality is under development.
// IHXMMFDataSource API can change anytime.
-
/****************************************************************************
*
* Interface:
@@ -94,7 +135,7 @@
STDMETHOD(Open) (THIS_
- IHXRequest *pRequest, const char *mode
+ IHXRequest *pRequest, const char *mode, IHXMMFDataSourceObserver* pObserver = NULL
) PURE;
STDMETHOD(Close) (THIS_) PURE;
@@ -148,6 +189,9 @@
STDMETHOD(Seek2) (THIS_ UINT32, INT32 fromWhere, IHXFileObject* pFileObject) PURE;
+
+ STDMETHOD(AsyncReadSupported) (THIS_) PURE;
+
};
#endif // _IHXMMFDATASOURCE_H_
Index: filesystem/local/mini/minifileobj.cpp
===================================================================
RCS file: /cvsroot/filesystem/local/mini/minifileobj.cpp,v
retrieving revision 1.23.2.4
diff -w -u -b -r1.23.2.4 minifileobj.cpp
--- filesystem/local/mini/minifileobj.cpp 28 Jun 2007 16:44:51 -0000 1.23.2.4
+++ filesystem/local/mini/minifileobj.cpp 17 Jul 2007 22:38:05 -0000
@@ -111,6 +111,7 @@
,m_pContext (pContext)
#if defined(HELIX_FEATURE_MMF_DATASOURCE)
,m_pDataSource (NULL)
+ ,m_bAsyncReadSupported (FALSE)
#endif
{
DPRINTF(D_MINI_FO, ("CHXMiniFO::CHXMiniFileObject()\n"));
@@ -164,6 +165,11 @@
}
#if defined(HELIX_FEATURE_MMF_DATASOURCE)
HX_RELEASE(m_pDataSource);
+ HX_RELEASE(m_pPendingReadBuf);
+ if(m_bAsyncReadSupported)
+ {
+ HX_RELEASE(m_pPendingReadBufAsync);
+ }
#endif
}
@@ -211,6 +217,7 @@
HX_RELEASE(m_pDataSource);
m_pDataSource = pDataSource;
pDataSource = NULL;
+ m_bAsyncReadSupported = m_pDataSource->AsyncReadSupported();
result = m_pDataSource->Open2(m_pRequest, modeStr, this);
}
else
@@ -636,6 +643,10 @@
IHXBuffer* pBuffer)
{
HX_RESULT result = HXR_OK;
+ if(m_bAsyncReadSupported)
+ {
+ m_pPendingReadBufAsync = pBuffer;
+ }
UINT32 actualCount = DoRead(pBuffer);
@@ -645,20 +656,60 @@
ReadDoneError(HXR_READ_ERROR);
return HXR_READ_ERROR;
}
-
+ if(!m_bAsyncReadSupported)
+ {
result = pBuffer->SetSize(actualCount);
-
if(result == HXR_OK)
{
// Notify the caller that the read is done
HX_RESULT readResult = actualCount > 0 ? HXR_OK : HXR_FAILED;
result = DoReadDone(readResult, pBuffer);
}
+ }
return result;
}
+#if defined(HELIX_FEATURE_MMF_DATASOURCE)
+
+/****************************************************************************
+ * IHXMMFDataSourceObserver::ReadDone
+ *
+ * This routine is called by DataSource whenever there is a request for
+ * data from file object and requested amount of data available at Data
+ * source level.
+ */
+void CHXMiniFileObject::ReadDone(void* pBuffer, UINT32 byteCount)
+{
+ HX_RESULT result = HXR_OK;
+ if(m_pPendingReadBufAsync != NULL)
+ {
+ result = m_pPendingReadBufAsync->SetSize(byteCount);
+ if(result == HXR_OK)
+ {
+ HX_RESULT readResult = byteCount > 0 ? HXR_OK : HXR_FAILED;
+ result = DoReadDone(readResult, m_pPendingReadBufAsync);
+ if(result == HXR_OK)
+ {
+ m_pPendingReadBufAsync = NULL;
+
+ if(m_pPendingReadBuf != NULL )
+ {
+ DoReadLoop();
+ }
+ }
+ }
+
+ if(result != HXR_OK)
+ {
+ HX_RELEASE(m_pPendingReadBufAsync);
+ ReadDoneError(result);
+ }
+ }
+}
+
+#endif
/****************************************************************************
* IHXFileObject::DoRead
*
@@ -1101,6 +1152,7 @@
{ GET_IIDHANDLE(IID_IHXFileExists), (IHXFileExists*) this },
{ GET_IIDHANDLE(IID_IHXFileStat), (IHXFileStat*) this },
{ GET_IIDHANDLE(IID_IHXGetFileFromSamePool), (IHXGetFileFromSamePool*) this },
+ { GET_IIDHANDLE(IID_IHXMMFDataSourceObserver), (IHXMMFDataSourceObserver*) this },
};
return ::QIFind(qiList, QILISTSIZE(qiList), interfaceID, ppInterfaceObj);
}
Index: filesystem/local/mini/minifileobj.h
===================================================================
RCS file: /cvsroot/filesystem/local/mini/minifileobj.h,v
retrieving revision 1.6.2.2
diff -w -u -b -r1.6.2.2 minifileobj.h
--- filesystem/local/mini/minifileobj.h 22 May 2007 14:40:45 -0000 1.6.2.2
+++ filesystem/local/mini/minifileobj.h 17 Jul 2007 22:38:05 -0000
@@ -80,6 +80,9 @@
public IHXFileExists,
public IHXFileStat,
public IHXGetFileFromSamePool
+#if defined(HELIX_FEATURE_MMF_DATASOURCE)
+ ,public IHXMMFDataSourceObserver
+#endif
{
public:
@@ -151,6 +154,13 @@
*/
STDMETHOD(GetFileObjectFromPool) (THIS_ IHXGetFileFromSamePoolResponse* response);
+#if defined(HELIX_FEATURE_MMF_DATASOURCE)
+ /************************************************************************
+ * IHXMMFDataSourceObserver Interface Methods
+ */
+ void ReadDone(THIS_ void * pBuffer, ULONG32 ulCount);
+#endif
+
protected:
/****** Protected Class Variables ****************************************/
@@ -173,9 +183,13 @@
IUnknown* m_pContext;
#if defined(HELIX_FEATURE_MMF_DATASOURCE)
IHXMMFDataSource* m_pDataSource;
+ HXBOOL m_bAsyncReadSupported;
#endif
char* m_pProtocolString;
+#if defined(HELIX_FEATURE_MMF_DATASOURCE)
+ IHXBuffer* m_pPendingReadBufAsync;
+#endif
/****** Protected Class Methods ******************************************/
STDMETHOD(OpenFile ) (THIS_ UINT32 fileMode);
STDMETHOD(GetModeStr ) (THIS_ UINT32 fileAccessMode, char* modeStr);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EMC Support to Helix Audio Controller Design-v0.1.doc
Type: application/msword
Size: 138240 bytes
Desc: EMC Support to Helix Audio Controller Design-v0.1.doc
Url : http://lists.helixcommunity.org/pipermail/filesystem-dev/attachments/20070717/7a279b18/EMCSupporttoHelixAudioControllerDesign-v0.1-0001.doc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HxMMDataSource.h
Type: application/octet-stream
Size: 5275 bytes
Desc: HxMMDataSource.h
Url : http://lists.helixcommunity.org/pipermail/filesystem-dev/attachments/20070717/7a279b18/HxMMDataSource-0002.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HxMMDataSource.cpp
Type: application/octet-stream
Size: 8632 bytes
Desc: HxMMDataSource.cpp
Url : http://lists.helixcommunity.org/pipermail/filesystem-dev/attachments/20070717/7a279b18/HxMMDataSource-0003.obj
Copyright © 1995-2007 RealNetworks, Inc. All rights reserved.
RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.