multimediacommscontroller/mmccredpayloadformat/inc/mccreddecoder.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005-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:    Decoder capable to handle redundancy format RTP payload.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef MCCREDDECODER_H
       
    22 #define MCCREDDECODER_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include    "mccredencdecbase.h"
       
    26 
       
    27 /**
       
    28 *  Redundancy RTP payload format decoder.
       
    29 *
       
    30 *  @lib mmccredplformat.dll
       
    31 *  @since Series 60 3.0
       
    32 */
       
    33 class CMccRedDecoder : public CMccRedEncDecBase
       
    34     {
       
    35     public:  // Constructors and destructor
       
    36         
       
    37         /**
       
    38         * Two-phased constructor.
       
    39         */
       
    40         static CMccRedDecoder* NewL();
       
    41         
       
    42         /**
       
    43         * Destructor.
       
    44         */
       
    45         virtual ~CMccRedDecoder();
       
    46 
       
    47     public: // New functions
       
    48         
       
    49         /**
       
    50         * Decode encoding(s) from RTP payload given.
       
    51         * @since    Series 60 3.0
       
    52         * @param    aCurTimeStamp   Timestamp of the RTP packet under decoding
       
    53         * @return   Number of data blocks decoded or system wide error code.
       
    54         */
       
    55         TInt DecodePayload( TUint aCurTimeStamp );
       
    56 
       
    57     private:    // Functions from base classes
       
    58         
       
    59         /**
       
    60         * From CMccRedEncDecBase. Initializes decoder.
       
    61         */
       
    62         void DoInitializeL( TInt aRedBlockCount, TInt aMaxPayloadSize,
       
    63             TInt aNumOfEncodings );
       
    64             
       
    65     private:
       
    66 
       
    67         class TRedHeaderInfo
       
    68             {
       
    69             public:
       
    70                 TUint8 iBlockPT;
       
    71                 TUint iTimeStamp;
       
    72                 TUint iBlockLength;
       
    73                 TUint8* iBlockIndex;
       
    74             };
       
    75             
       
    76         /**
       
    77         * C++ default constructor.
       
    78         */
       
    79         CMccRedDecoder();
       
    80 
       
    81         /**
       
    82         * Get info about audio data blocks in a RTP payload buffer
       
    83         */
       
    84         TInt GetBlockInfos( RArray<TRedHeaderInfo>& aBlockInfos,
       
    85                             const TDesC8& aRTPPayload );
       
    86 
       
    87     private:    // Data
       
    88          
       
    89          // Time stamp from the RTP header
       
    90          TUint iCurTimeStamp;
       
    91          
       
    92          // Contains primary data blocks timestamp from previous RTP payload
       
    93          TInt iLatestTimeStamp;
       
    94          
       
    95          // Used to carry block indexes, block lengths etc.
       
    96          RArray<TRedHeaderInfo> iRedHeaderInfo;
       
    97 
       
    98     };
       
    99 
       
   100 #endif      // MCCREDDECODER_H   
       
   101             
       
   102 // End of File