tsrc/musenginestub/src/musenglivesession.cpp
branchRCL_3
changeset 22 73a1feb507fb
parent 0 f0cf47e981f9
child 23 bc78a40cd63c
equal deleted inserted replaced
21:33a5d2bbf6fc 22:73a1feb507fb
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // USER
    19 // USER
    20 #include "musenglivesession.h"
    20 #include "musenglivesession.h"
       
    21 #include "musengsessionobserver.h"
    21 #include "musenglivesessionobserver.h"
    22 #include "musenglivesessionobserver.h"
    22 //#include "musunittesting.h"
    23 #include "musunittesting.h"
    23 //#include "musengmceutils.h"
    24 #include "musengmceutils.h"
       
    25 #include "musenglogger.h"
       
    26 #include "mussessionproperties.h"
    24 
    27 
    25 // SYSTEM
    28 // SYSTEM
    26 /*
    29 #include <mcemanager.h>
    27 #include <mcecamerasource.h>
    30 #include <mcecamerasource.h>
    28 #include <mcevideostream.h>
    31 #include <mcevideostream.h>
    29 #include <mcertpsink.h>
    32 #include <mcertpsink.h>
    30 #include <mcedisplaysink.h>
    33 #include <mcedisplaysink.h>
       
    34 #include <mcefilesink.h>
    31 #include <mcesession.h>
    35 #include <mcesession.h>
    32 #include <mcevideocodec.h>
    36 #include <mcevideocodec.h>
    33 */
    37 #include <mceh263codec.h>
    34 
    38 #include <mceavccodec.h>
    35 
    39 
    36 
    40 
    37 // -----------------------------------------------------------------------------
    41 // Names of AVC levels in string for config keys stored in CenRep 
    38 //
    42 _LIT8( KMusAvcBitrateLevel1, "AvcBrL1=" );
    39 // -----------------------------------------------------------------------------
    43 _LIT8( KMusAvcBitrateLevel1b, "AvcBrL1b=" );
    40 //
    44 _LIT8( KMusAvcBitrateLevel1_1, "AvcBrL1_1=" );
    41 EXPORT_C CMusEngLiveSession* CMusEngLiveSession::NewL(
    45 _LIT8( KMusAvcBitrateLevel1_2, "AvcBrL1_2=" );
    42                     const TDesC& /*aFileName*/,
    46 _LIT8( KMusAvcBitrateLevel1_3, "AvcBrL1_3=" );
    43                     const TRect& aRect,
    47 _LIT8( KMusAvcBitrateLevel2, "AvcBrL2=" );
    44                     MMusEngLiveSessionObserver* aSessionObserver,
    48 
    45                     TUint aSipProfileId )
    49 _LIT8( KMusEncoderInfoTokenizer, ";" );
    46     {
    50 
    47     CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession(
    51 
    48                                                     aSessionObserver,
    52 const TInt KMaxDispName = 512;
    49                                                     aRect,
    53 
    50                                                     aSipProfileId );
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 CMusEngLiveSession* CMusEngLiveSession::NewL(
       
    59                         const TDesC& aFileName,
       
    60                         const TRect& aRect )
       
    61     {
       
    62     CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession( aRect,
       
    63                                                                  aFileName );
    51     CleanupStack::PushL( self );
    64     CleanupStack::PushL( self );
    52     self->ConstructL();
    65     self->ConstructL();
    53     CleanupStack::Pop( self );
    66     CleanupStack::Pop( self );
    54     return self;
    67     return self;
    55     }
    68     }
    57 
    70 
    58 // -----------------------------------------------------------------------------
    71 // -----------------------------------------------------------------------------
    59 //
    72 //
    60 // -----------------------------------------------------------------------------
    73 // -----------------------------------------------------------------------------
    61 //
    74 //
    62 EXPORT_C CMusEngLiveSession* CMusEngLiveSession::NewL(
    75 CMusEngLiveSession* CMusEngLiveSession::NewL(
    63                         const TRect& aRect,
    76                         const TRect& aRect )
    64                         MMusEngLiveSessionObserver* aSessionObserver,
    77     {
    65                         TUint aSipProfileId )
    78     CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession( aRect );
    66     {
       
    67     CMusEngLiveSession* self = new( ELeave ) CMusEngLiveSession(
       
    68                                                     aSessionObserver,
       
    69                                                     aRect,
       
    70                                                     aSipProfileId);
       
    71     CleanupStack::PushL( self );
    79     CleanupStack::PushL( self );
    72     self->ConstructL();
    80     self->ConstructL();
    73     CleanupStack::Pop( self );
    81     CleanupStack::Pop( self );
    74     return self;
    82     return self;
    75     }
    83     }
    79 //
    87 //
    80 // -----------------------------------------------------------------------------
    88 // -----------------------------------------------------------------------------
    81 //
    89 //
    82 CMusEngLiveSession::~CMusEngLiveSession()
    90 CMusEngLiveSession::~CMusEngLiveSession()
    83     {
    91     {
    84     }
    92     delete iRemoteDisplayName;
    85 
    93     }
    86 
    94 
    87 // -----------------------------------------------------------------------------
    95 
    88 //
    96 
    89 // -----------------------------------------------------------------------------
    97 // -----------------------------------------------------------------------------
    90 //
    98 // From MLcSession
    91 EXPORT_C void CMusEngLiveSession::SetSessionObserver(
    99 // -----------------------------------------------------------------------------
    92                         MMusEngLiveSessionObserver* aSessionObserver )
   100 //
    93     {
   101 void CMusEngLiveSession::EstablishLcSessionL()
    94     }
   102     {
    95 
   103     }
    96 
   104 
    97 // -----------------------------------------------------------------------------
   105 // -----------------------------------------------------------------------------
    98 //
   106 // From MLcSession
    99 // -----------------------------------------------------------------------------
   107 // -----------------------------------------------------------------------------
   100 //
   108 //
   101 EXPORT_C TInt CMusEngLiveSession::CurrentZoomL() const
   109 MLcVideoPlayer* CMusEngLiveSession::LocalVideoPlayer()
       
   110     {
       
   111     return this;
       
   112     }
       
   113     
       
   114  
       
   115     
       
   116 // -----------------------------------------------------------------------------
       
   117 // From MLcSession
       
   118 // -----------------------------------------------------------------------------
       
   119 //
       
   120  
       
   121 const TDesC& CMusEngLiveSession::RemoteDisplayName()
       
   122  	{
       
   123     return *iRemoteDisplayName;
       
   124  	}
       
   125 
       
   126 
       
   127 
       
   128 
       
   129 // -----------------------------------------------------------------------------
       
   130 // From MLcVideoPlayer
       
   131 // -----------------------------------------------------------------------------
       
   132 //
       
   133 MLcVideoPlayer::TLcVideoPlayerState CMusEngLiveSession::LcVideoPlayerState() const
       
   134     {
       
   135     TLcVideoPlayerState vidPlayerState = MLcVideoPlayer::EUnavailable;
       
   136     return vidPlayerState;
       
   137     }
       
   138 
       
   139 // -----------------------------------------------------------------------------
       
   140 // From MLcVideoPlayer
       
   141 // -----------------------------------------------------------------------------
       
   142 //
       
   143 TBool CMusEngLiveSession::LcIsPlayingL()
       
   144     {
       
   145     return iPlaying;
       
   146     }
       
   147 
       
   148 // -----------------------------------------------------------------------------
       
   149 // From MLcVideoPlayer
       
   150 // -----------------------------------------------------------------------------
       
   151 //
       
   152 void CMusEngLiveSession::LcPlayL()
       
   153     {
       
   154     iPlaying = ETrue;
       
   155     }
       
   156 
       
   157 // -----------------------------------------------------------------------------
       
   158 // From MLcVideoPlayer
       
   159 // -----------------------------------------------------------------------------
       
   160 //
       
   161 void CMusEngLiveSession::LcPauseL()
       
   162     {
       
   163     iPlaying = EFalse;
       
   164     }
       
   165 
       
   166 // -----------------------------------------------------------------------------
       
   167 // From MLcVideoPlayer
       
   168 // -----------------------------------------------------------------------------
       
   169 //
       
   170 MLcWindow* CMusEngLiveSession::LcWindow()
       
   171     {
       
   172     return this;
       
   173     }
       
   174 
       
   175 // -----------------------------------------------------------------------------
       
   176 // From MLcVideoPlayer
       
   177 // -----------------------------------------------------------------------------
       
   178 //
       
   179 MLcCameraControl* CMusEngLiveSession::LcCameraControl()
       
   180     {
       
   181     return this;
       
   182     }
       
   183 
       
   184 // -----------------------------------------------------------------------------
       
   185 // From MLcVideoPlayer
       
   186 // -----------------------------------------------------------------------------
       
   187 //
       
   188 MLcFileControl* CMusEngLiveSession::LcSourceFile()
       
   189     {
       
   190     return NULL;
       
   191     }
       
   192 
       
   193 // -----------------------------------------------------------------------------
       
   194 // From MLcVideoPlayer
       
   195 // -----------------------------------------------------------------------------
       
   196 //
       
   197 MLcFileControl* CMusEngLiveSession::LcDestinationFile()
       
   198     {
       
   199     return this;
       
   200     }
       
   201 
       
   202 // -----------------------------------------------------------------------------
       
   203 // From MLcVideoPlayer
       
   204 // -----------------------------------------------------------------------------
       
   205 //
       
   206 MLcAudioControl* CMusEngLiveSession::LcAudioControl()
       
   207     {
       
   208     return this;
       
   209     }
       
   210 
       
   211 // -----------------------------------------------------------------------------
       
   212 // From MLcVideoPlayer
       
   213 // -----------------------------------------------------------------------------
       
   214 //
       
   215 MLcZoomControl* CMusEngLiveSession::LcZoomControl()
       
   216     {
       
   217     return this;
       
   218     }
       
   219 
       
   220 // -----------------------------------------------------------------------------
       
   221 // From MLcVideoPlayer
       
   222 // -----------------------------------------------------------------------------
       
   223 //
       
   224 MLcBrightnessControl* CMusEngLiveSession::LcBrightnessControl()
       
   225     {
       
   226     return this;
       
   227     }
       
   228 
       
   229 // -----------------------------------------------------------------------------
       
   230 // From MLcVideoPlayer
       
   231 // -----------------------------------------------------------------------------
       
   232 //
       
   233 RPointerArray< MLcValueControl >& CMusEngLiveSession::LcExtensionControls()
       
   234     {
       
   235     return iValueControls;
       
   236     }
       
   237 
       
   238 // -----------------------------------------------------------------------------
       
   239 // From MLcCameraControl
       
   240 // -----------------------------------------------------------------------------
       
   241 //
       
   242 TInt CMusEngLiveSession::LcCameraCountL()
       
   243     {
       
   244     return 1;
       
   245     }
       
   246 
       
   247 // -----------------------------------------------------------------------------
       
   248 // From MLcCameraControl
       
   249 // -----------------------------------------------------------------------------
       
   250 //
       
   251 void CMusEngLiveSession::ToggleLcCameraL()
       
   252     {
       
   253     }
       
   254 
       
   255 // -----------------------------------------------------------------------------
       
   256 // From MLcBrightnessControl
       
   257 // -----------------------------------------------------------------------------
       
   258 //
       
   259 TInt CMusEngLiveSession::MinLcBrightnessL()
       
   260     {
       
   261     return iCurrentBrighness;
       
   262     }
       
   263 
       
   264 // -----------------------------------------------------------------------------
       
   265 // From MLcBrightnessControl
       
   266 // -----------------------------------------------------------------------------
       
   267 //
       
   268 TInt CMusEngLiveSession::MaxLcBrightnessL()
       
   269     {
       
   270     return iCurrentBrighness;
       
   271     }
       
   272 
       
   273 // -----------------------------------------------------------------------------
       
   274 // From MLcBrightnessControl
       
   275 // -----------------------------------------------------------------------------
       
   276 //
       
   277 TInt CMusEngLiveSession::LcBrightnessL()
       
   278     {
       
   279     return iCurrentBrighness;
       
   280     }
       
   281 
       
   282 // -----------------------------------------------------------------------------
       
   283 // From MLcBrightnessControl
       
   284 // -----------------------------------------------------------------------------
       
   285 //
       
   286 void CMusEngLiveSession::SetLcBrightnessL( TInt aValue )
       
   287     {
       
   288     iCurrentBrighness = aValue;
       
   289     }
       
   290 
       
   291 // -----------------------------------------------------------------------------
       
   292 // From MLcBrightnessControl
       
   293 // -----------------------------------------------------------------------------
       
   294 //
       
   295 void CMusEngLiveSession::IncreaseLcBrightnessL()
       
   296     {
       
   297     iCurrentBrighness++;
       
   298     }
       
   299 
       
   300 // -----------------------------------------------------------------------------
       
   301 // From MLcBrightnessControl
       
   302 // -----------------------------------------------------------------------------
       
   303 //
       
   304 void CMusEngLiveSession::DecreaseLcBrightnessL()
       
   305     {
       
   306     iCurrentBrighness--;
       
   307     }
       
   308 
       
   309 // -----------------------------------------------------------------------------
       
   310 // From MLcZoomControl
       
   311 // -----------------------------------------------------------------------------
       
   312 //
       
   313 TInt CMusEngLiveSession::MinLcZoomL()
   102     {
   314     {
   103     return iCurrentZoom;
   315     return iCurrentZoom;
   104     }
   316     }
   105 
   317 
   106 
   318 // -----------------------------------------------------------------------------
   107 // -----------------------------------------------------------------------------
   319 // From MLcZoomControl
   108 //
   320 // -----------------------------------------------------------------------------
   109 // -----------------------------------------------------------------------------
   321 //
   110 //
   322 TInt CMusEngLiveSession::MaxLcZoomL()
   111 EXPORT_C TInt CMusEngLiveSession::MaxZoomL() const
       
   112     {
   323     {
   113     return iCurrentZoom;
   324     return iCurrentZoom;
   114     }
   325     }
   115 
   326 
   116 
   327 // -----------------------------------------------------------------------------
   117 // -----------------------------------------------------------------------------
   328 // From MLcZoomControl
   118 //
   329 // -----------------------------------------------------------------------------
   119 // -----------------------------------------------------------------------------
   330 //
   120 //
   331 TInt CMusEngLiveSession::LcZoomValueL()
   121 EXPORT_C TInt CMusEngLiveSession::MinZoomL() const
       
   122     {
   332     {
   123     return iCurrentZoom;
   333     return iCurrentZoom;
   124     }
   334     }
   125 
   335 
   126 
   336 // -----------------------------------------------------------------------------
   127 // -----------------------------------------------------------------------------
   337 // From MLcZoomControl
   128 //
   338 // -----------------------------------------------------------------------------
   129 // -----------------------------------------------------------------------------
   339 //
   130 //
   340 void CMusEngLiveSession::SetLcZoomValueL( TInt aValue )
   131 EXPORT_C void CMusEngLiveSession::ZoomInL()
   341     {
       
   342     iCurrentZoom = aValue;
       
   343     }
       
   344 
       
   345 // -----------------------------------------------------------------------------
       
   346 // From MLcZoomControl
       
   347 // -----------------------------------------------------------------------------
       
   348 //
       
   349 void CMusEngLiveSession::LcZoomInL()
   132     {
   350     {
   133     iCurrentZoom++;
   351     iCurrentZoom++;
   134     }
   352     }
   135 
   353 
   136 
   354 // -----------------------------------------------------------------------------
   137 // -----------------------------------------------------------------------------
   355 // From MLcZoomControl
   138 //
   356 // -----------------------------------------------------------------------------
   139 // -----------------------------------------------------------------------------
   357 //
   140 //
   358 void CMusEngLiveSession::LcZoomOutL()
   141 EXPORT_C void CMusEngLiveSession::ZoomOutL()
       
   142     {
   359     {
   143     iCurrentZoom--;
   360     iCurrentZoom--;
   144     }
   361     }
   145 
   362 
   146 
   363 // -----------------------------------------------------------------------------
   147 // -----------------------------------------------------------------------------
   364 // From MLcFileControl
   148 //
   365 // -----------------------------------------------------------------------------
   149 // -----------------------------------------------------------------------------
   366 //
   150 //
   367 void CMusEngLiveSession::EnableLcFileL( TBool aEnable )
   151 EXPORT_C void CMusEngLiveSession::ZoomDefaultL()
   368     {
   152     {
   369     iFileEnabled = aEnable;
   153     }
   370     }
   154 
   371 
   155 
   372 // -----------------------------------------------------------------------------
   156 // -----------------------------------------------------------------------------
   373 // From MLcFileControl
   157 // Enable camera
   374 // -----------------------------------------------------------------------------
   158 // -----------------------------------------------------------------------------
   375 //
   159 //
   376 TBool CMusEngLiveSession::IsLcFileEnabled()
   160 EXPORT_C void CMusEngLiveSession::PlayL()
   377     {
   161     {
   378     return iFileEnabled;
   162     iPlaying = ETrue;
   379     }
   163     }
   380 
   164 
   381 // -----------------------------------------------------------------------------
   165 
   382 // From MLcFileControl
   166 // -----------------------------------------------------------------------------
   383 // -----------------------------------------------------------------------------
   167 // Disable camera
   384 //
   168 // -----------------------------------------------------------------------------
   385 void CMusEngLiveSession::SetLcFileNameL( const TFileName& aFileName )
   169 //
   386     {
   170 EXPORT_C void CMusEngLiveSession::PauseL()
   387     iRecordedFile = aFileName;
   171     {
   388     }
   172     iPlaying = EFalse;
   389 
   173     }
   390 // -----------------------------------------------------------------------------
   174 
   391 // From MLcFileControl
   175 
   392 // -----------------------------------------------------------------------------
   176 // -----------------------------------------------------------------------------
   393 //
   177 //
   394 TFileName& CMusEngLiveSession::LcFileName()
   178 // -----------------------------------------------------------------------------
   395     {
   179 //
   396     return iRecordedFile;
   180 void CMusEngLiveSession::CompleteSessionStructureL()
   397     }
   181     {
       
   182     }
       
   183 
       
   184 
   398 
   185 // -----------------------------------------------------------------------------
   399 // -----------------------------------------------------------------------------
   186 //
   400 //
   187 // -----------------------------------------------------------------------------
   401 // -----------------------------------------------------------------------------
   188 //
   402 //
   189 CMusEngLiveSession::CMusEngLiveSession(
   403 CMusEngLiveSession::CMusEngLiveSession(
   190                         MMusEngLiveSessionObserver* aSessionObserver,
   404                         const TRect& aRect, 
   191                         const TRect& aRect,
   405                         const TDesC& aRecordedFile )
   192                         TUint aSipProfileId )
   406     : CMusEngMceOutSession( aRect ),
   193     :CMusEngMceOutSession( aRect, aSipProfileId ),
   407       iRecordedFile( aRecordedFile )
   194      iDefaultZoomFactor( -1 )
   408     {
   195     {
   409     }
   196     }
   410 
   197 
   411 
   198 
   412 // -----------------------------------------------------------------------------
   199 // -----------------------------------------------------------------------------
   413 //
   200 //
   414 // -----------------------------------------------------------------------------
   201 // -----------------------------------------------------------------------------
   415 //
   202 //
   416 void CMusEngLiveSession::ConstructL()
   203 void CMusEngLiveSession::ConstructL( /*const TDesC& aFileName*/ )
   417     {
   204     {
   418     MUS_LOG( "mus: [ENGINE]  -> CMusEngLiveSession::ConstructL()" )
   205     }
   419     
   206 
   420     CMusEngMceOutSession::ConstructL();
   207 
   421         
   208 
   422     iRemoteDisplayName = HBufC::NewL( KMaxDispName );
   209 
   423 
   210 
   424     MUS_LOG( "mus: [ENGINE]  <- CMusEngLiveSession::ConstructL()" )
   211 
   425     }