tsrc/musenginestub/inc/musengtwowayrecvsession.h
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MUSHENGTWOWAYRECVSESSION_H
       
    20 #define MUSHENGTWOWAYRECVSESSION_H
       
    21 
       
    22 // USER
       
    23 #include "musengreceivesession.h"
       
    24 #include "musunittesting.h"
       
    25 #include "mussettings.h"
       
    26 #include "musengcamerahandler.h"
       
    27 
       
    28 // SYSTEM
       
    29 #include <ecam.h>
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class MMusEngLiveSessionObserver;
       
    33 class CMceDisplaySink;
       
    34 class CMceStreamBundle;
       
    35 
       
    36 class CMusEngTwoWayRecvSession : public CMusEngReceiveSession
       
    37     {
       
    38     MUS_UNITTEST( UT_CMusEngTwoWayRecvSession )
       
    39 
       
    40     
       
    41     public:
       
    42         /**
       
    43         * Creates new MultimediaSharing two-way receive session.
       
    44         *
       
    45         * @param aRemoteRect UI drawing area for received video.
       
    46         * @param aLocalRect UI drawing area for camera viewfinder.
       
    47         * @param aSessionObserver Interface for session specific callbacks
       
    48         * @param aReceiveSessionObserver Interface for receivesession specific callbacks
       
    49         * @return CMusEngTwoWayRecvSession* New instanse of specified class
       
    50         */
       
    51         IMPORT_C static CMusEngTwoWayRecvSession* NewL( 
       
    52                             const TRect& aRemoteRect,
       
    53                             const TRect& aLocalRect,
       
    54                             MMusEngSessionObserver& aSessionObserver,
       
    55                             MMusEngReceiveSessionObserver& aReceiveSessionObserver );
       
    56 
       
    57 
       
    58     public:
       
    59 
       
    60         /**
       
    61         * Destructor
       
    62         */
       
    63         ~CMusEngTwoWayRecvSession();
       
    64 
       
    65     public:
       
    66         
       
    67         void EnableDisplayL( TBool aEnable );
       
    68 
       
    69         CMusEngMceSession::TDisplayOrientation OrientationL();
       
    70         
       
    71         void SetOrientationL( TDisplayOrientation aOrientation );
       
    72         
       
    73     public:
       
    74         
       
    75         /**
       
    76         * Sets both remote (receiving video) and local (viewfinder) rects.
       
    77         * 
       
    78         */
       
    79         IMPORT_C void SetRectsL( const TRect& aRemoteRect,
       
    80                                  const TRect& aLocalRect );
       
    81 
       
    82         /**
       
    83         * Sets local rect (viewfinder).
       
    84         * 
       
    85         */
       
    86         IMPORT_C void SetLocalRectL( const TRect& aLocalRect );
       
    87         
       
    88         /**
       
    89         * Gets local rect (viewfinder).
       
    90         * 
       
    91         */
       
    92         IMPORT_C TRect LocalRect() const;
       
    93    
       
    94         /**
       
    95         * Gets camera handler (can be used for zooming etc.) 
       
    96         */
       
    97         IMPORT_C TMusEngCameraHandler& Camera();
       
    98         
       
    99     protected: // From CMusEngReceiveSession
       
   100         
       
   101         void CompleteSessionStructureL();
       
   102         
       
   103         void RectChangedL();
       
   104 
       
   105    
       
   106     private: // from MMceStreamObserver, 
       
   107              // overrides the functions in ancestor classes
       
   108 
       
   109 
       
   110         void StreamStateChanged( CMceMediaStream& aStream,
       
   111                                  CMceMediaSink& aSink );   
       
   112         
       
   113         void StreamStateChanged( CMceMediaStream& aStream );
       
   114                                  
       
   115     private:
       
   116 
       
   117         /**
       
   118         * Constructor
       
   119         */
       
   120         CMusEngTwoWayRecvSession( MMusEngSessionObserver& aSessionObserver,
       
   121                             MMusEngReceiveSessionObserver& aReceiveSessionObserver,
       
   122                             const TRect& aRemoteRect,
       
   123                             const TRect& aLocalRect );
       
   124 
       
   125         /**
       
   126         * Second-phase constructor
       
   127         */
       
   128         void ConstructL();
       
   129         
       
   130     private:
       
   131         
       
   132         void CompleteSessionStructureAudioPartL( 
       
   133                    const RPointerArray<CMceMediaStream>& aStreams, 
       
   134                    CMceStreamBundle& aLocalBundle, 
       
   135                    CMceMediaStream* aVideoInStream,
       
   136                    CMceMediaStream* aVideoOutStream );
       
   137           
       
   138         void CompleteSessionStructureInStreamL( CMceMediaStream& aVideoInStream, 
       
   139                                                 CMceStreamBundle& aLocalBundle );
       
   140           
       
   141         void CompleteSessionStructureOutStreamL( CMceMediaStream& aVideoOutStream );
       
   142 
       
   143     private:
       
   144         
       
   145         TRect iLocalRect;
       
   146         
       
   147         TMusEngCameraHandler iCameraHandler;
       
   148     };
       
   149 
       
   150 #endif
       
   151