multimediacommscontroller/mmccsubcontroller/inc/mccsymdlstream.h
changeset 0 1bce908db942
child 32 f2ed1fc4c163
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2004-2008 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:    Provides a downlink stream for symmetric subthread
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MCCSYMDLSTREAM_H
       
    21 #define MCCSYMDLSTREAM_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "mccsymstreambase.h"
       
    25 #include "mccrtpdatasource.h"
       
    26 #include "mccjitterbufferobserver.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CMccJitterBuffer;
       
    30 class CMMFFormatDecode;
       
    31 class CMccAudioRouter;
       
    32 class MMccResources;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 *  Mcc Symmetric subthread downlink stream
       
    38 *
       
    39 *  @lib Mccsubthreads.lib
       
    40 *  @since Series 60 3.0
       
    41 */
       
    42 NONSHARABLE_CLASS( CMccSymDlStream ) : public CMccSymStreamBase, public MJitterBufferObserver
       
    43     {
       
    44     public:  // Constructors and destructor
       
    45         
       
    46         /**
       
    47         * Static constructor
       
    48         */
       
    49         static CMccSymDlStream* NewLC( TUint32 aMccStreamId, 
       
    50                 MAsyncEventHandler* aEventhandler,  
       
    51                 MMccResources* aMccResources, 
       
    52                 CMccRtpManager* aManager,
       
    53                 TInt aStreamType );
       
    54         
       
    55         /**
       
    56         * Destructor.
       
    57         */
       
    58         virtual ~CMccSymDlStream();
       
    59 
       
    60     public: // Functions from base classes
       
    61     
       
    62         /**
       
    63         * From CMccSymStreamBase
       
    64         */
       
    65         void SetPrioritySettingsL( const TMMFPrioritySettings& aPriority );
       
    66         
       
    67         /**
       
    68         * From CMccSymStreamBase
       
    69         */
       
    70         void AddSinkAndSourceL( MDataSink* aDatasink, 
       
    71                 MDataSource* aDatasource );
       
    72         
       
    73         /**
       
    74         * From CMccSymStreamBase
       
    75         */      
       
    76         void LoadCodecL( const TMccCodecInfo& aCodecInfo,
       
    77                          const TDesC8& aFmtp );
       
    78 
       
    79         /**
       
    80         * From CMccSymStreamBase
       
    81         */
       
    82         void PrimeL( const TUint32 aEndpointId );
       
    83         
       
    84         /**
       
    85         * From CMccSymStreamBase
       
    86         */
       
    87         void PlayL( const TUint32 aEndpointId,
       
    88         			TBool aStreamPaused, 
       
    89                     TBool aEnableRtcp );
       
    90         
       
    91         /**
       
    92         * From CMccSymStreamBase
       
    93         */
       
    94         void PauseL( const TUint32 aEndpointId,
       
    95         			 TBool aEnableRtcp );
       
    96         
       
    97         /**
       
    98         * From CMccSymStreamBase
       
    99         */
       
   100         void ResumeL( const TUint32 aEndpointId,
       
   101         			  TBool aEnableRtcp );
       
   102         
       
   103         /**
       
   104         * From CMccSymStreamBase
       
   105         */
       
   106         void StopL( const TUint32 aEndpointId );
       
   107 
       
   108         /**
       
   109         * From CMccSymStreamBase
       
   110         */
       
   111         void SetBalanceL( TInt aLeftbal, TInt aRightbal );
       
   112         
       
   113         /**
       
   114         * From CMccSymStreamBase
       
   115         */
       
   116         void GetBalanceL( TInt& aLeftbal, TInt& aRightbal );
       
   117         
       
   118         /**
       
   119         * From CMccSymStreamBase
       
   120         */ 
       
   121         void GetSSRCL( TUint32& aSSRCValue );
       
   122 
       
   123         /**
       
   124         * From CMccSymStreamBase
       
   125         */
       
   126         void ResetCountersL();
       
   127         
       
   128         /**
       
   129         * From CMccSymStreamBase
       
   130         */
       
   131         void SendMediaSignalL( const TMccEvent& aEvent );
       
   132         
       
   133         /**
       
   134         * Sends RTCP receiver report.
       
   135         * @param none
       
   136         * @return One of the standard system-wide error codes.
       
   137         */
       
   138         void SendRTCPReceiverReportL();
       
   139         
       
   140         /** 
       
   141         * Starts inactivity timer for a stream
       
   142         * @param aTimeoutTime - [input] timeout value in milliseconds
       
   143         * @return One of the standard system-wide error codes.
       
   144         */
       
   145         void StartInactivityTimerL( TUint32 aTimeoutTime );
       
   146 
       
   147         /**
       
   148         * Stops inactivity timer for a stream 
       
   149         * @return One of the standard system-wide error codes.
       
   150         */
       
   151         void StopInactivityTimerL();
       
   152         
       
   153         /**
       
   154         * Checks if stream is uplink 
       
   155         * @return EFalse for downlink stream.
       
   156         */
       
   157         TBool IsUplink();
       
   158 
       
   159         /**
       
   160         * Sets stream to standby mode. 
       
   161         */
       
   162         void StandByL();
       
   163         
       
   164         /**
       
   165         * Set audio routing.
       
   166         */
       
   167         void SetAudioRouteL( TUint32 aRoutingDestination );
       
   168         
       
   169         /**
       
   170         * Get current audio routing destination.
       
   171         */
       
   172         void GetAudioRouteL( TUint32& aRoutingDestination );
       
   173         
       
   174     	/**
       
   175          * From MJitterBufferObserver
       
   176          */
       
   177         void JitterBufferError( TInt aError );
       
   178         
       
   179         /**
       
   180          * From MJitterBufferObserver
       
   181          */
       
   182         void DynamicBufferChangeRequest( TInt aBufferSize );
       
   183         
       
   184         /**
       
   185          * Bind context into stream.
       
   186          * @since Series 60 3.2
       
   187          * @param aEndpointId The endpoint id
       
   188          * @param aContextParams Crypto context
       
   189          * @return void
       
   190          */
       
   191         void BindContextIntoStreamL( TUint32 aEndpointId,
       
   192                                      const TMccCryptoContext& aContextParams );
       
   193         
       
   194     private:
       
   195         
       
   196         /**
       
   197         * C++ default constructor.
       
   198         */
       
   199         CMccSymDlStream( TUint32 aMccStreamId, 
       
   200                          MAsyncEventHandler* aEventhandler, 
       
   201                          MMccResources* aMccResources, 
       
   202                          CMccRtpManager* aManager, 
       
   203                          TInt aStreamType );
       
   204         
       
   205         /**
       
   206         * 2nd phase constructor
       
   207         */
       
   208         void ConstructL();
       
   209 
       
   210     protected: // Functions from base classes
       
   211     
       
   212         MDataSink* MultiplexerSink();
       
   213 
       
   214     private:    // New functions
       
   215     
       
   216         /**
       
   217         * Creates the payload format decoder
       
   218         * @since Series 60 3.0
       
   219         * @param None
       
   220         * @return void
       
   221         */
       
   222         void CreatePayloadFormatDecoderL();
       
   223         
       
   224         /**
       
   225          * Worker function for G.711 dynamic buffering
       
   226          * @since S60 v3.2
       
   227          * @param aFrameSize New frametime in milliseconds
       
   228          * @return void
       
   229          */
       
   230         void DoDynamicFrameSizeChangeL( TInt aFrameTime );
       
   231         
       
   232         /**
       
   233          * Worker function for updating codec parameters
       
   234          * @since S60 v3.2
       
   235          * @param aOriginal Original codec settings
       
   236          * @param aNew New codec settings
       
   237          * @return void
       
   238          */
       
   239         void UpdateCodecInformationL( const TMccCodecInfo& aOriginal,
       
   240             const TMccCodecInfo& aNew );
       
   241                 
       
   242     private:    // Data
       
   243     
       
   244         // Jitterbuffer
       
   245         CMccJitterBuffer* iJitterBuffer;
       
   246         
       
   247         // Payload format decoder
       
   248         CMMFFormatDecode* iFormatDecode;
       
   249 
       
   250         // Payload format decoder for redundancy format
       
   251         CMMFFormatDecode* iRedFormatDecode;
       
   252         
       
   253         // Audio router
       
   254         CMccAudioRouter* iAudioRouter;
       
   255         
       
   256         TBool iFirstResumeDone;
       
   257         
       
   258     private:
       
   259         #ifdef EUNIT_TEST
       
   260             friend class UT_CMccSymDlStream;
       
   261         #endif
       
   262 
       
   263     };
       
   264 
       
   265 #endif      // MCCSYMDLSTREAM_H
       
   266 
       
   267 // End of File