multimediacommscontroller/mmccsubcontroller/inc/mccdtmfulstream.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2006 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 DTMF support
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef MCCDTMFULSTREAM_H
       
    22 #define MCCDTMFULSTREAM_H
       
    23 
       
    24 #include "mccsymstreambase.h"
       
    25 
       
    26 class MAsyncEventHandler;
       
    27 class MMccResources;
       
    28 class CMccRtpManager;
       
    29 class CMMFFormatEncode;
       
    30 class CMMFFormatDecode;
       
    31 class TMccCodecInfo;
       
    32 
       
    33 /**
       
    34  *  This class provides DTMF sending support.
       
    35  *
       
    36  *  @lib mmccsubcontroller.dll
       
    37  *  @since S60 v4.0
       
    38  */
       
    39 NONSHARABLE_CLASS( CMccDtmfUlStream ) : public CMccSymStreamBase
       
    40     {
       
    41 
       
    42 public:
       
    43 
       
    44     static CMccDtmfUlStream* NewL( TUint32 aMccStreamId, 
       
    45         MAsyncEventHandler* aEventhandler, MMccResources* aMccResources,
       
    46         CMccRtpManager* aManager, TFourCC aFourCC, TInt aStreamType,
       
    47         CMccRtpMediaClock& aClock );
       
    48 
       
    49     static CMccDtmfUlStream* NewLC( TUint32 aMccStreamId, 
       
    50         MAsyncEventHandler* aEventhandler, MMccResources* aMccResources,
       
    51         CMccRtpManager* aManager, TFourCC aFourCC, TInt aStreamType,
       
    52         CMccRtpMediaClock& aClock );
       
    53 
       
    54     virtual ~CMccDtmfUlStream();
       
    55 
       
    56 // from base class CMccSymStreamBase
       
    57 
       
    58     /**
       
    59      * From CMccSymStreamBase.
       
    60      * Sets the priority settings for this stream.
       
    61      *
       
    62      * @since   S60 3.0
       
    63      * @param   aPriority       MMF Priority settings
       
    64      * @return  void
       
    65      */
       
    66     void SetPrioritySettingsL( const TMMFPrioritySettings& aPriority );
       
    67     
       
    68     /**
       
    69      * From CMccSymStreamBase.
       
    70      * Adds the sink and source to the stream.
       
    71      *
       
    72      * @since   S60 3.0
       
    73      * @param   aDatasink       MDataSink
       
    74      * @param   aDatasource     MDataSource
       
    75      * @return  void
       
    76      */
       
    77     void AddSinkAndSourceL( MDataSink* aDatasink, MDataSource* aDatasource );
       
    78 
       
    79     /**
       
    80      * From CMccSymStreamBase.
       
    81      * Loads a codec in the stream.
       
    82      *
       
    83      * @since   S60 3.0
       
    84      * @param   aCodecInfo      Contains mediaformat settings
       
    85      * @return  void
       
    86      */
       
    87     void LoadCodecL( const TMccCodecInfo& aCodecInfo, const TDesC8& aFmtp );
       
    88     
       
    89     /**
       
    90      * From CMccSymStreamBase.
       
    91      * Primes the audio stream ready.
       
    92      *
       
    93      * @since   S60 3.0
       
    94      * @param   aEndpointId     Endpoint to be primed
       
    95      * @return  void
       
    96      */
       
    97     void PrimeL( const TUint32 aEndpointId );
       
    98     
       
    99     /**
       
   100      * From CMccSymStreamBase.     
       
   101      * Starts the audio streaming.
       
   102      *
       
   103      * @since   S60 3.0
       
   104      * @param   aEndpointId     Endpoint to be played
       
   105      * @param   aStreamPaused   Whether to pause stream after play
       
   106      * @param   aEnableRtcp     Enable/disable RTCP
       
   107      * @return  void
       
   108      */
       
   109     void PlayL( const TUint32 aEndpointId, TBool aStreamPaused, 
       
   110         TBool aEnableRtcp );
       
   111     
       
   112     /**
       
   113      * From CMccSymStreamBase.    
       
   114      * Pauses the audio streaming.
       
   115      *
       
   116      * @since   S60 3.0
       
   117      * @param   aEndpointId     Endpoint to be paused
       
   118      * @param   aEnableRtcp     Enable/disable RTCP
       
   119      * @return  void
       
   120      */
       
   121     void PauseL( const TUint32 aEndpointId, TBool aEnableRtcp );
       
   122     
       
   123     /**
       
   124      * From CMccSymStreamBase.    
       
   125      * Resumes the audio streaming.
       
   126      *
       
   127      * @since   S60 3.0
       
   128      * @param   aEndpointId     Endpoint to be resumed
       
   129      * @param   aEnableRtcp     Enable/disable RTCP
       
   130      * @return  void
       
   131      */
       
   132     void ResumeL( const TUint32 aEndpointId, TBool aEnableRtcp );
       
   133     
       
   134     /**
       
   135      * From CMccSymStreamBase.
       
   136      * Stops the audio streaming.
       
   137      *
       
   138      * @since   S60 3.0
       
   139      * @param   aEndpointId     Endpoint to be stopped
       
   140      * @return  void
       
   141      */
       
   142     void StopL( const TUint32 aEndpointId );
       
   143     
       
   144     /**
       
   145      * From CMccSymStreamBase.
       
   146      * Resets Jitterbuffer.
       
   147      *
       
   148      * @since   S60 3.0
       
   149      * @return  void
       
   150      */
       
   151     void ResetCountersL();
       
   152     
       
   153     /**
       
   154      * From CMccSymStreamBase.
       
   155      * Sets the current record/play balance depending on the stream type.
       
   156      *
       
   157      * @since   S60 3.0
       
   158      * @param   aLeftbal    Left balance
       
   159      * @param   aRightbal   Right balance
       
   160      * @return  void
       
   161      */
       
   162     void SetBalanceL( TInt aLeftbal, TInt aRightbal );
       
   163     
       
   164     /**
       
   165      * From CMccSymStreamBase.
       
   166      * Returns the current record/play balance depending on the stream type.
       
   167      *
       
   168      * @since   S60 3.0
       
   169      * @param   aLeftbal    Left balance
       
   170      * @param   aRightbal   Right balance
       
   171      * @return  void
       
   172      */
       
   173     void GetBalanceL( TInt& aLeftbal, TInt& aRightbal );
       
   174 
       
   175     /**
       
   176      * From CMccSymStreamBase.
       
   177      * Sends a media event in a uplink stream.
       
   178      *
       
   179      * @since   S60 3.0
       
   180      * @param   aEvent      Event to be sent
       
   181      * @return  void
       
   182      */
       
   183     void SendMediaSignalL( const TMccEvent& aEvent );
       
   184     
       
   185     /**
       
   186      * From CMccSymStreamBase.
       
   187      * Starts inactivity timer for a stream in a given session.
       
   188      *
       
   189      * @since   S60 3.0
       
   190      * @param   aTimeoutTime     Time after which inactivity is reported
       
   191      * @return  void
       
   192      */
       
   193     void StartInactivityTimerL( TUint32 aTimeoutTime );
       
   194 
       
   195     /**
       
   196      * From CMccSymStreamBase.
       
   197      * Stops inactivity timer for a stream in a given session.
       
   198      *
       
   199      * @since   S60 3.0
       
   200      * @return  void
       
   201      */
       
   202     void StopInactivityTimerL();
       
   203     
       
   204     /**
       
   205      * From CMccSymStreamBase.
       
   206      * Gets synchronization source this stream is using.
       
   207      *
       
   208      * @since   S60 3.0
       
   209      * @param   aSSRCValue  Synchronization source
       
   210      * @return  void
       
   211      */
       
   212     void GetSSRCL( TUint32& aSSRCValue );
       
   213     
       
   214     /**
       
   215      * From CMccSymStreamBase.
       
   216      */
       
   217     TBool IsUplink();
       
   218     
       
   219     /**
       
   220      * From CMccSymStreamBase.
       
   221      */
       
   222     void StandByL();
       
   223     
       
   224 private:
       
   225 
       
   226     CMccDtmfUlStream( TUint32 aMccStreamId, 
       
   227         MAsyncEventHandler* aEventhandler, MMccResources* aMccResources,
       
   228         CMccRtpManager* aManager, TFourCC aFourCC, TInt aStreamType,
       
   229         CMccRtpMediaClock& aClock );
       
   230 
       
   231     void ConstructL();
       
   232     
       
   233     /**
       
   234      * Creates the payload format encoder.
       
   235      * @since   S60 3.0
       
   236      * @return  void
       
   237      */
       
   238     void CreatePayloadFormatEncoderL();
       
   239     
       
   240     /**
       
   241      * Updates codec information.
       
   242      * @since   S60 3.0
       
   243      * @param   aCodecInfo      Update parameters
       
   244      * @return  void
       
   245      */
       
   246     void UpdateCodecInformationL( TMccCodecInfo& aCodecInfo );
       
   247 
       
   248 private: // data
       
   249 
       
   250     /**
       
   251      * FourCC code identifying codec.
       
   252      */
       
   253     TFourCC	iFourCC;
       
   254     
       
   255     
       
   256     /**
       
   257      * Payload format encoder used to encode DTMF RTP payload.
       
   258      * Own.
       
   259      */
       
   260     CMMFFormatEncode* iFormatEncode;
       
   261     
       
   262     /**
       
   263      * Payload format decoder used to decode DTMF RTP payload.
       
   264      * Own.
       
   265      */
       
   266     CMMFFormatDecode* iFormatDecode;
       
   267     
       
   268     };
       
   269 
       
   270 
       
   271 #endif // MCCDTMFULSTREAM_H