mmserv/voipaudioservices/JitterBufferUtility/inc/CngGenerator.h
changeset 55 e267340986c9
parent 0 71ca22bcf22a
equal deleted inserted replaced
52:4ce423f34688 55:e267340986c9
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
     2  * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description:  Declares class for comfort noise generating utility (CNG)
    14  * Description:  Declares class for comfort noise generating utility (CNG)
    15 *
    15  *
    16 */
    16  */
    17 
       
    18 
    17 
    19 #ifndef CNGGENERATOR_H
    18 #ifndef CNGGENERATOR_H
    20 #define CNGGENERATOR_H
    19 #define CNGGENERATOR_H
    21 
    20 
    22 #include <mmfutilities.h>
    21 #include <mmfutilities.h>
    26 
    25 
    27 /**
    26 /**
    28  * Comfort noise generating utility
    27  * Comfort noise generating utility
    29  *
    28  *
    30  * @lib MMccJitterBuffer.lib
    29  * @lib MMccJitterBuffer.lib
    31  * @since Series 60 5.0
       
    32  */
    30  */
    33 NONSHARABLE_CLASS (CVoIPCNGenerator) : public CBase
    31 NONSHARABLE_CLASS (CVoIPCNGenerator) : public CBase
    34     {
    32     {
    35 public:  // Constructor and destructor
    33 public:
       
    34     // Constructor and destructor
    36 
    35 
    37     /**
    36     /**
    38      * Two phased constructor
    37      * Two phased constructor
    39      */
    38      */
    40     static CVoIPCNGenerator* NewL(MJitterBufferObserver* iObserver,
    39     static CVoIPCNGenerator* NewL(MJitterBufferObserver* iObserver,
    41                                   const TFourCC& aCodec);
    40             const TFourCC& aCodec);
    42 
    41 
    43     /**
    42     /**
    44      * Destructor
    43      * Destructor
    45      */
    44      */
    46     virtual ~CVoIPCNGenerator();
    45     virtual ~CVoIPCNGenerator();
    47 
    46 
    48 public: // New functions
    47 public:
       
    48     // New functions
    49 
    49 
    50     /**
    50     /**
    51      * Generates an SID packet to given buffer
    51      * Generates an SID packet to given buffer
    52      * @since Series 60 5.0
       
    53      * @param aPayload Buffer to be filled with SID data
    52      * @param aPayload Buffer to be filled with SID data
    54      * @param aRequestSize Amount of data to be generated to buffer.
    53      * @param aRequestSize Amount of data to be generated to buffer.
    55      * @return void
    54      * @return void
    56      */
    55      */
    57     void GenerateSidPacket(TDes8& aPayload, TInt aRequestSize);
    56     void GenerateSidPacket(TDes8& aPayload, TInt aRequestSize);
    58 
    57 
    59     /**
    58     /**
    60      * Requests error concealment for the next frame.
    59      * Requests error concealment for the next frame.
    61      * @since Series 60 5.0
       
    62      * @param None
    60      * @param None
    63      * @return void
    61      * @return void
    64      */
    62      */
    65     void ConcealErrorForNextFrame() const;
    63     void ConcealErrorForNextFrame() const;
    66 
    64 
       
    65 #ifdef __FEATURE_NOT_SUPPORTED__
    67     /**
    66     /**
    68      * Returns current DTX status
    67      * Returns current DTX status
    69      * @since Series 60 5.0
       
    70      * @param None
    68      * @param None
    71      * @return TBool ETrue if DTX period ongoing
    69      * @return TBool ETrue if DTX period ongoing
    72      */
    70      */
    73     TBool DtxPeriodStatus() const;
    71     TBool DtxPeriodStatus() const;
    74 
    72 
    75     /**
    73     /**
    76      * Decide whether we are in DTX period or in normal speech period
    74      * Decide whether we are in DTX period or in normal speech period
    77      * @since Series 60 5.0
       
    78      * @param const TDes8& - Buffer containing data
    75      * @param const TDes8& - Buffer containing data
    79      * @return TInt
    76      * @return TInt
    80      */
    77      */
    81     void DoDtxDecision(const TDes8& aPayload);
    78     void DoDtxDecision(const TDes8& aPayload);
    82 
    79 
    83     /**
    80     /**
    84      * Checks whether buffer contains SID frame.
    81      * Checks whether buffer contains SID frame.
    85      * @since Series 60 5.0
    82      *
    86      * @param const TDes8& - Buffer containing data
    83      * @param const TDes8& - Buffer containing data
    87      * @return TBool - ETrue if buffer contains SID frame
    84      * @return TBool - ETrue if buffer contains SID frame
    88      */
    85      */
    89     TBool IsSidBuffer(const TDes8& aData);
    86     TBool IsSidBuffer(const TDes8& aData);
    90         
    87 #endif //__FEATURE_NOT_SUPPORTED__
    91 private: // New functions
    88 
       
    89 private:
       
    90     // New functions
    92 
    91 
    93     /**
    92     /**
    94      * Generates an AMR CN packet into aPayload
    93      * Generates an AMR CN packet into aPayload
    95      * @since Series 60 5.0
    94      *
    96      * @param aPayload
    95      * @param aPayload
    97      * @return void
    96      * @return void
    98      */
    97      */
    99     void GenerateAmrNoDataPacket(TDes8& aPayload) const;
    98     void GenerateAmrNoDataPacket(TDes8& aPayload) const;
   100 
    99 
   101     /**
   100     /**
   102      * Generates an VoIP NO_DATA frame into aPayload
   101      * Generates an VoIP NO_DATA frame into aPayload
   103      * @since Series 60 5.0
   102      *
   104      * @param aPayload Buffer to be filled with VoIP NO_DATA information
   103      * @param aPayload Buffer to be filled with VoIP NO_DATA information
   105      * @param aRequestSize Amount of data to be generated to buffer.
   104      * @param aRequestSize Amount of data to be generated to buffer.
   106      * @return void
   105      * @return void
   107      */
   106      */
   108     void GenerateVoIPNoDataPacket(TDes8& aPayload, TInt aRequestSize) const;
   107     void GenerateVoIPNoDataPacket(TDes8& aPayload, TInt aRequestSize) const;
   109 
   108 
   110 private: //Constructors
   109 private:
       
   110     //Constructors
   111 
   111 
   112     /**
   112     /**
   113      * C++ default constructor.
   113      * C++ default constructor.
   114      */
   114      */
   115     CVoIPCNGenerator(MJitterBufferObserver* iObserver, const TFourCC& aCodec);
   115     CVoIPCNGenerator(MJitterBufferObserver* iObserver, const TFourCC& aCodec);
   117     /**
   117     /**
   118      * Symbian 2nd phase constructor.
   118      * Symbian 2nd phase constructor.
   119      */
   119      */
   120     void ConstructL();
   120     void ConstructL();
   121 
   121 
   122 private:    // Data
   122 private:
       
   123     // Data
   123 
   124 
   124     // Codec type
   125     // Codec type
   125     TFourCC iCodec;
   126     TFourCC iCodec;
   126 
   127 
   127     // For Error Concealment IF creation
   128     // For Error Concealment IF creation
   130     // Generated CN frames
   131     // Generated CN frames
   131     TInt iGeneratedCNFrames;
   132     TInt iGeneratedCNFrames;
   132 
   133 
   133     // DTX period started
   134     // DTX period started
   134     TBool iDtxPeriodStarted;
   135     TBool iDtxPeriodStarted;
   135 
       
   136     };
   136     };
   137 
   137 
   138 #endif  // CNGGENERATOR_H
   138 #endif  // CNGGENERATOR_H
   139 
   139 
   140 
       
   141 // End of file
   140 // End of file