multimediacommscontroller/mmccshared/inc/mccinternalevents.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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef MCCINTERNALEVENTS_H
       
    23 #define MCCINTERNALEVENTS_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include <e32std.h>
       
    27 #include <mmf/common/mmfcontrollerframeworkbase.h>
       
    28 #include "mmccevents.h"
       
    29 
       
    30 // CONSTANTS
       
    31 
       
    32 // To avoid the event type overlapping values defined in
       
    33 // interface, start from 20
       
    34 const TMccEventCategory KMccEventCategoryStreamControl = 20;
       
    35 
       
    36 // To avoid the event type overlapping values defined in
       
    37 // interface, start from 100
       
    38 const TMccEventType KMccStandbyInactivityEvent = 100;
       
    39 const TMccEventType KMccStandbyActivityEvent = 101;
       
    40 
       
    41 const TUint32 KMccAutomaticEvent = 300;
       
    42 const TUint32 KMccPayloadSpecificEvent = 301;
       
    43 
       
    44 // MACROS
       
    45 
       
    46 // DATA TYPES
       
    47 enum TMccInternalEventType
       
    48     {
       
    49     EMccInternalEventNone = 200, // Avoid clash with TMccEventType values
       
    50     EMccInternalJitterEventUndefined,
       
    51     EMccInternalJitterEventStatusReport,
       
    52     EMccInternalJitterEventMmfEvent,
       
    53     EMccInternalRtpSinkError,
       
    54     EMccInternalRtpSinkLastBuffer,
       
    55     EMccInternalRtpSrcJitterUpdate,
       
    56     KMccInternalRtpSrcMmfEvent,
       
    57     EMccInternalAmrEventUndefined,
       
    58     EMccInternalAmrEventCmr
       
    59     };
       
    60     
       
    61     
       
    62 // Disabling PC-lint warning 1554, for getting rid of it otherwise
       
    63 // might not be possible
       
    64 /*lint -e1554*/    
       
    65     
       
    66 /**
       
    67 *  AMR codec mode request ( narrow band and wide band).
       
    68 */
       
    69 enum TAmrModeRequest
       
    70     {
       
    71     EAmrModeReq0 = 0,
       
    72     EAmrModeReq1 = 1,
       
    73     EAmrModeReq2 = 2,
       
    74     EAmrModeReq3 = 3,
       
    75     EAmrModeReq4 = 4,
       
    76     EAmrModeReq5 = 5,
       
    77     EAmrModeReq6 = 6,
       
    78     EAmrModeReq7 = 7,      // Narrowband max
       
    79     EAmrModeReq8 = 8,      // Wideband max
       
    80     EAmrModeReqNone = 15   // No mode request
       
    81     };
       
    82     
       
    83 // FUNCTION PROTOTYPES
       
    84 
       
    85 // FORWARD DECLARATIONS
       
    86 class TMccEvent;
       
    87 
       
    88 // CLASS DECLARATION
       
    89 
       
    90 class TMccInternalEvent : public TMMFEvent
       
    91     {
       
    92     public:
       
    93     
       
    94         /**
       
    95         * Default constructor
       
    96         */
       
    97         inline TMccInternalEvent() : 
       
    98             TMMFEvent( KNullUid, KErrNone ), 
       
    99             iInternalEventType( EMccInternalEventNone ), 
       
   100             iMccEvent( NULL )
       
   101             {
       
   102             }
       
   103             
       
   104         /**
       
   105         * Parametrized constructor
       
   106         */
       
   107         inline TMccInternalEvent( TUid aEventOriginator, 
       
   108                                   TMccInternalEventType aInternalEventType, 
       
   109                                   TMccEvent& aMccEvent ) : 
       
   110             TMMFEvent( aEventOriginator, KErrNone ),
       
   111             iInternalEventType( aInternalEventType ),
       
   112             iMccEvent( &aMccEvent )
       
   113             {
       
   114             }
       
   115             
       
   116         /**
       
   117         * Copy constructor
       
   118         */
       
   119         inline TMccInternalEvent( const TMccInternalEvent& aEvent  ) : 
       
   120             TMMFEvent( aEvent.iEventType, aEvent.iErrorCode ),
       
   121             iInternalEventType( aEvent.iInternalEventType ),
       
   122             iMccEvent( aEvent.iMccEvent )
       
   123             {
       
   124             }
       
   125     
       
   126     public: // Data
       
   127     
       
   128         TMccInternalEventType iInternalEventType;
       
   129         
       
   130         TMccEvent* iMccEvent;
       
   131 
       
   132     };
       
   133 
       
   134 /**
       
   135 * Jitter buffer event data
       
   136 */
       
   137 class TMccJitterBufferEventData
       
   138     {
       
   139     public:
       
   140    
       
   141         /**
       
   142         * Default constructor
       
   143         */
       
   144         inline TMccJitterBufferEventData() : 
       
   145             iFramesPlayed( 0 ), iFramesReceived( 0 ), iFrameLoss( 0 ), iFramesRemoved( 0 ),
       
   146             iFramesInBuffer( 0 ), iBufferLength( 0 ), iLateFrames( 0 )
       
   147             {   
       
   148             }
       
   149             
       
   150         /**
       
   151         * Copy constructor
       
   152         */
       
   153         inline TMccJitterBufferEventData( const TMccJitterBufferEventData& aEvent ) :
       
   154             iFramesPlayed( aEvent.iFramesPlayed ),
       
   155             iFramesReceived( aEvent.iFramesReceived ), 
       
   156             iFrameLoss( aEvent.iFrameLoss ), 
       
   157             iFramesRemoved( aEvent.iFramesRemoved ), 
       
   158             iFramesInBuffer( aEvent.iFramesInBuffer ), 
       
   159             iBufferLength( aEvent.iBufferLength ), 
       
   160             iLateFrames( aEvent.iLateFrames )
       
   161             {   
       
   162             }
       
   163         
       
   164     public: // Data
       
   165 
       
   166         // Frames played
       
   167         TUint iFramesPlayed;
       
   168         // Frames received
       
   169         TUint iFramesReceived;
       
   170         // Frame loss
       
   171         TUint iFrameLoss;
       
   172         // Frames removed by adaptation control
       
   173         TUint iFramesRemoved;
       
   174         // Current frames in buffer
       
   175         TUint iFramesInBuffer;
       
   176         // Current buffer length
       
   177         TUint iBufferLength;
       
   178         // Frames late but not too late
       
   179         TUint iLateFrames;
       
   180     };
       
   181     
       
   182 typedef TPckgBuf<TMccJitterBufferEventData> TMccJitterBufferEventDataPackage;
       
   183 
       
   184 /**
       
   185 * AMR payload formatter event data
       
   186 */
       
   187 class TMccAmrEventData
       
   188     {
       
   189     public:
       
   190     
       
   191         /**
       
   192         * Default constructor
       
   193         */
       
   194         inline TMccAmrEventData() : 
       
   195             iModeRequestBitrate( 0 )
       
   196             {  
       
   197             }
       
   198 
       
   199         /**
       
   200         * Copy constructor
       
   201         */
       
   202         inline TMccAmrEventData( const TMccAmrEventData& aEvent ) : 
       
   203             iModeRequestBitrate( aEvent.iModeRequestBitrate )
       
   204             {   
       
   205             }
       
   206 
       
   207     public: // Data
       
   208 
       
   209         // AMR mode request bitrate
       
   210         TInt iModeRequestBitrate;
       
   211     };
       
   212     
       
   213 typedef TPckgBuf<TMccAmrEventData> TMccAmrEventDataPackage;
       
   214 
       
   215 /**
       
   216 * Rate adaptation event data
       
   217 */
       
   218 class TMccRateAdaptationEventData
       
   219     {
       
   220     public:
       
   221     
       
   222         /**
       
   223         * Default constructor
       
   224         */
       
   225         inline TMccRateAdaptationEventData() : 
       
   226             iRateAdaptationAdvice( 1 ),
       
   227             iFramerateOriginal( 0 ),
       
   228             iFramerateModified( 0 ),
       
   229             iBitrateOriginal( 0 ),
       
   230             iBitrateModified( 0 )
       
   231             {  
       
   232             }
       
   233 
       
   234         /**
       
   235         * Copy constructor
       
   236         */
       
   237         inline TMccRateAdaptationEventData( 
       
   238             const TMccRateAdaptationEventData& aEvent ) : 
       
   239             iRateAdaptationAdvice( aEvent.iRateAdaptationAdvice ),
       
   240             iFramerateOriginal( aEvent.iFramerateModified ),
       
   241             iFramerateModified( aEvent.iFramerateModified ),
       
   242             iBitrateOriginal( aEvent.iBitrateOriginal ),
       
   243             iBitrateModified( aEvent.iBitrateModified )
       
   244             {   
       
   245             }
       
   246 
       
   247     public: // Data
       
   248 
       
   249         // Rate adaptation amount (0.0 ... 1.0 scale)
       
   250         TReal iRateAdaptationAdvice;
       
   251         
       
   252         TReal iFramerateOriginal;
       
   253         
       
   254         TReal iFramerateModified;
       
   255         
       
   256         TUint iBitrateOriginal;
       
   257         
       
   258         TUint iBitrateModified;
       
   259     };
       
   260     
       
   261 typedef TPckgBuf<TMccRateAdaptationEventData> TMccRateAdaptationEventDataPackage;
       
   262       
       
   263 #endif      // MCCINTERNALEVENTS_H   
       
   264             
       
   265 // End of File