tsrc/musenginestub/src/musenglivesession.cpp
branchRCL_3
changeset 22 73a1feb507fb
parent 0 f0cf47e981f9
child 23 bc78a40cd63c
--- a/tsrc/musenginestub/src/musenglivesession.cpp	Thu Aug 19 09:51:39 2010 +0300
+++ b/tsrc/musenginestub/src/musenglivesession.cpp	Tue Aug 31 15:12:07 2010 +0300
@@ -18,36 +18,49 @@
 
 // USER
 #include "musenglivesession.h"
+#include "musengsessionobserver.h"
 #include "musenglivesessionobserver.h"
-//#include "musunittesting.h"
-//#include "musengmceutils.h"
+#include "musunittesting.h"
+#include "musengmceutils.h"
+#include "musenglogger.h"
+#include "mussessionproperties.h"
 
 // SYSTEM
-/*
+#include <mcemanager.h>
 #include <mcecamerasource.h>
 #include <mcevideostream.h>
 #include <mcertpsink.h>
 #include <mcedisplaysink.h>
+#include <mcefilesink.h>
 #include <mcesession.h>
 #include <mcevideocodec.h>
-*/
+#include <mceh263codec.h>
+#include <mceavccodec.h>
 
 
+// Names of AVC levels in string for config keys stored in CenRep 
+_LIT8( KMusAvcBitrateLevel1, "AvcBrL1=" );
+_LIT8( KMusAvcBitrateLevel1b, "AvcBrL1b=" );
+_LIT8( KMusAvcBitrateLevel1_1, "AvcBrL1_1=" );
+_LIT8( KMusAvcBitrateLevel1_2, "AvcBrL1_2=" );
+_LIT8( KMusAvcBitrateLevel1_3, "AvcBrL1_3=" );
+_LIT8( KMusAvcBitrateLevel2, "AvcBrL2=" );
+
+_LIT8( KMusEncoderInfoTokenizer, ";" );
+
+
+const TInt KMaxDispName = 512;
 
 // -----------------------------------------------------------------------------
 //
 // -----------------------------------------------------------------------------
 //
-EXPORT_C CMusEngLiveSession* CMusEngLiveSession::NewL(
-                    const TDesC& /*aFileName*/,
-                    const TRect& aRect,
-                    MMusEngLiveSessionObserver* aSessionObserver,
-                    TUint aSipProfileId )
+CMusEngLiveSession* CMusEngLiveSession::NewL(
+                        const TDesC& aFileName,
+                        const TRect& aRect )
     {
-    CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession(
-                                                    aSessionObserver,
-                                                    aRect,
-                                                    aSipProfileId );
+    CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession( aRect,
+                                                                 aFileName );
     CleanupStack::PushL( self );
     self->ConstructL();
     CleanupStack::Pop( self );
@@ -59,15 +72,10 @@
 //
 // -----------------------------------------------------------------------------
 //
-EXPORT_C CMusEngLiveSession* CMusEngLiveSession::NewL(
-                        const TRect& aRect,
-                        MMusEngLiveSessionObserver* aSessionObserver,
-                        TUint aSipProfileId )
+CMusEngLiveSession* CMusEngLiveSession::NewL(
+                        const TRect& aRect )
     {
-    CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession(
-                                                    aSessionObserver,
-                                                    aRect,
-                                                    aSipProfileId);
+    CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession( aRect );
     CleanupStack::PushL( self );
     self->ConstructL();
     CleanupStack::Pop( self );
@@ -81,15 +89,322 @@
 //
 CMusEngLiveSession::~CMusEngLiveSession()
     {
+    delete iRemoteDisplayName;
+    }
+
+
+
+// -----------------------------------------------------------------------------
+// From MLcSession
+// -----------------------------------------------------------------------------
+//
+void CMusEngLiveSession::EstablishLcSessionL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcSession
+// -----------------------------------------------------------------------------
+//
+MLcVideoPlayer* CMusEngLiveSession::LocalVideoPlayer()
+    {
+    return this;
+    }
+    
+ 
+    
+// -----------------------------------------------------------------------------
+// From MLcSession
+// -----------------------------------------------------------------------------
+//
+ 
+const TDesC& CMusEngLiveSession::RemoteDisplayName()
+ 	{
+    return *iRemoteDisplayName;
+ 	}
+
+
+
+
+// -----------------------------------------------------------------------------
+// From MLcVideoPlayer
+// -----------------------------------------------------------------------------
+//
+MLcVideoPlayer::TLcVideoPlayerState CMusEngLiveSession::LcVideoPlayerState() const
+    {
+    TLcVideoPlayerState vidPlayerState = MLcVideoPlayer::EUnavailable;
+    return vidPlayerState;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcVideoPlayer
+// -----------------------------------------------------------------------------
+//
+TBool CMusEngLiveSession::LcIsPlayingL()
+    {
+    return iPlaying;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcVideoPlayer
+// -----------------------------------------------------------------------------
+//
+void CMusEngLiveSession::LcPlayL()
+    {
+    iPlaying = ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcVideoPlayer
+// -----------------------------------------------------------------------------
+//
+void CMusEngLiveSession::LcPauseL()
+    {
+    iPlaying = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcVideoPlayer
+// -----------------------------------------------------------------------------
+//
+MLcWindow* CMusEngLiveSession::LcWindow()
+    {
+    return this;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcVideoPlayer
+// -----------------------------------------------------------------------------
+//
+MLcCameraControl* CMusEngLiveSession::LcCameraControl()
+    {
+    return this;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcVideoPlayer
+// -----------------------------------------------------------------------------
+//
+MLcFileControl* CMusEngLiveSession::LcSourceFile()
+    {
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcVideoPlayer
+// -----------------------------------------------------------------------------
+//
+MLcFileControl* CMusEngLiveSession::LcDestinationFile()
+    {
+    return this;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcVideoPlayer
+// -----------------------------------------------------------------------------
+//
+MLcAudioControl* CMusEngLiveSession::LcAudioControl()
+    {
+    return this;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcVideoPlayer
+// -----------------------------------------------------------------------------
+//
+MLcZoomControl* CMusEngLiveSession::LcZoomControl()
+    {
+    return this;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcVideoPlayer
+// -----------------------------------------------------------------------------
+//
+MLcBrightnessControl* CMusEngLiveSession::LcBrightnessControl()
+    {
+    return this;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcVideoPlayer
+// -----------------------------------------------------------------------------
+//
+RPointerArray< MLcValueControl >& CMusEngLiveSession::LcExtensionControls()
+    {
+    return iValueControls;
     }
 
+// -----------------------------------------------------------------------------
+// From MLcCameraControl
+// -----------------------------------------------------------------------------
+//
+TInt CMusEngLiveSession::LcCameraCountL()
+    {
+    return 1;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcCameraControl
+// -----------------------------------------------------------------------------
+//
+void CMusEngLiveSession::ToggleLcCameraL()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcBrightnessControl
+// -----------------------------------------------------------------------------
+//
+TInt CMusEngLiveSession::MinLcBrightnessL()
+    {
+    return iCurrentBrighness;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcBrightnessControl
+// -----------------------------------------------------------------------------
+//
+TInt CMusEngLiveSession::MaxLcBrightnessL()
+    {
+    return iCurrentBrighness;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcBrightnessControl
+// -----------------------------------------------------------------------------
+//
+TInt CMusEngLiveSession::LcBrightnessL()
+    {
+    return iCurrentBrighness;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcBrightnessControl
+// -----------------------------------------------------------------------------
+//
+void CMusEngLiveSession::SetLcBrightnessL( TInt aValue )
+    {
+    iCurrentBrighness = aValue;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcBrightnessControl
+// -----------------------------------------------------------------------------
+//
+void CMusEngLiveSession::IncreaseLcBrightnessL()
+    {
+    iCurrentBrighness++;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcBrightnessControl
+// -----------------------------------------------------------------------------
+//
+void CMusEngLiveSession::DecreaseLcBrightnessL()
+    {
+    iCurrentBrighness--;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcZoomControl
+// -----------------------------------------------------------------------------
+//
+TInt CMusEngLiveSession::MinLcZoomL()
+    {
+    return iCurrentZoom;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcZoomControl
+// -----------------------------------------------------------------------------
+//
+TInt CMusEngLiveSession::MaxLcZoomL()
+    {
+    return iCurrentZoom;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcZoomControl
+// -----------------------------------------------------------------------------
+//
+TInt CMusEngLiveSession::LcZoomValueL()
+    {
+    return iCurrentZoom;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcZoomControl
+// -----------------------------------------------------------------------------
+//
+void CMusEngLiveSession::SetLcZoomValueL( TInt aValue )
+    {
+    iCurrentZoom = aValue;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcZoomControl
+// -----------------------------------------------------------------------------
+//
+void CMusEngLiveSession::LcZoomInL()
+    {
+    iCurrentZoom++;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcZoomControl
+// -----------------------------------------------------------------------------
+//
+void CMusEngLiveSession::LcZoomOutL()
+    {
+    iCurrentZoom--;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcFileControl
+// -----------------------------------------------------------------------------
+//
+void CMusEngLiveSession::EnableLcFileL( TBool aEnable )
+    {
+    iFileEnabled = aEnable;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcFileControl
+// -----------------------------------------------------------------------------
+//
+TBool CMusEngLiveSession::IsLcFileEnabled()
+    {
+    return iFileEnabled;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcFileControl
+// -----------------------------------------------------------------------------
+//
+void CMusEngLiveSession::SetLcFileNameL( const TFileName& aFileName )
+    {
+    iRecordedFile = aFileName;
+    }
+
+// -----------------------------------------------------------------------------
+// From MLcFileControl
+// -----------------------------------------------------------------------------
+//
+TFileName& CMusEngLiveSession::LcFileName()
+    {
+    return iRecordedFile;
+    }
 
 // -----------------------------------------------------------------------------
 //
 // -----------------------------------------------------------------------------
 //
-EXPORT_C void CMusEngLiveSession::SetSessionObserver(
-                        MMusEngLiveSessionObserver* aSessionObserver )
+CMusEngLiveSession::CMusEngLiveSession(
+                        const TRect& aRect, 
+                        const TDesC& aRecordedFile )
+    : CMusEngMceOutSession( aRect ),
+      iRecordedFile( aRecordedFile )
     {
     }
 
@@ -98,114 +413,13 @@
 //
 // -----------------------------------------------------------------------------
 //
-EXPORT_C TInt CMusEngLiveSession::CurrentZoomL() const
-    {
-    return iCurrentZoom;
-    }
-
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-EXPORT_C TInt CMusEngLiveSession::MaxZoomL() const
-    {
-    return iCurrentZoom;
-    }
-
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-EXPORT_C TInt CMusEngLiveSession::MinZoomL() const
+void CMusEngLiveSession::ConstructL()
     {
-    return iCurrentZoom;
-    }
-
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CMusEngLiveSession::ZoomInL()
-    {
-    iCurrentZoom++;
-    }
-
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CMusEngLiveSession::ZoomOutL()
-    {
-    iCurrentZoom--;
-    }
-
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CMusEngLiveSession::ZoomDefaultL()
-    {
-    }
-
+    MUS_LOG( "mus: [ENGINE]  -> CMusEngLiveSession::ConstructL()" )
+    
+    CMusEngMceOutSession::ConstructL();
+        
+    iRemoteDisplayName = HBufC::NewL( KMaxDispName );
 
-// -----------------------------------------------------------------------------
-// Enable camera
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CMusEngLiveSession::PlayL()
-    {
-    iPlaying = ETrue;
-    }
-
-
-// -----------------------------------------------------------------------------
-// Disable camera
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CMusEngLiveSession::PauseL()
-    {
-    iPlaying = EFalse;
-    }
-
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CMusEngLiveSession::CompleteSessionStructureL()
-    {
+    MUS_LOG( "mus: [ENGINE]  <- CMusEngLiveSession::ConstructL()" )
     }
-
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CMusEngLiveSession::CMusEngLiveSession(
-                        MMusEngLiveSessionObserver* aSessionObserver,
-                        const TRect& aRect,
-                        TUint aSipProfileId )
-    :CMusEngMceOutSession( aRect, aSipProfileId ),
-     iDefaultZoomFactor( -1 )
-    {
-    }
-
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CMusEngLiveSession::ConstructL( /*const TDesC& aFileName*/ )
-    {
-    }
-
-
-
-
-
-