multimediacommscontroller/mmccamrpayloadformat/inc/amrpayloaddecoderoa.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:    Formatter classes for decoding of RTP payload format
       
    15 *                for AMR ( wide band ) audio codecs.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef AMRPAYLOADDECODEROA_H
       
    23 #define AMRPAYLOADDECODEROA_H
       
    24 
       
    25 // INCLUDES
       
    26 #include <e32std.h>
       
    27 #include "amrpayloaddecoder.h"
       
    28 #include "amrpayloadheaderoa.h"
       
    29 #include "amrtocentryoa.h"
       
    30 #include "amrframe.h"
       
    31 
       
    32 
       
    33 /**
       
    34 * The Amr payload decoder for octet aligned ( OA ) mode.
       
    35 *
       
    36 * @lib Mccamrplformat.dll
       
    37 * @since Series 60 3.1
       
    38 */
       
    39 class CAmrPayloadDecoderOA : public CAmrPayloadDecoder
       
    40     {
       
    41     
       
    42 public:  // Constructors and destructor
       
    43 
       
    44     /**
       
    45     * Two-phased constructor.
       
    46     */
       
    47     static CAmrPayloadDecoderOA* NewL( TBool aIsNb );
       
    48 
       
    49     /**
       
    50     * Destructor.
       
    51     */
       
    52     ~CAmrPayloadDecoderOA();
       
    53 
       
    54 public: // Functions
       
    55 
       
    56     /**
       
    57     * Decode payload data received in the payload buffer. If AMR FEC is 
       
    58     * used and redundant frames are discarded, time stamp is increased to
       
    59     * correspond start of remaining frames.
       
    60     * @since    Series 60 3.1
       
    61     * @param    aTimeStamp Time stamp from RTP header
       
    62     * @param    aTimeStampInc Unit for time stamp incrementing
       
    63     * @return   TInt - Number of AMR frames decoded
       
    64     */
       
    65     virtual TInt DecodePayload( TUint32& aTimeStamp, TUint32 aTimeStampInc );
       
    66 
       
    67 private:
       
    68 
       
    69     /**
       
    70     * Constructor.
       
    71     */
       
    72     CAmrPayloadDecoderOA( TBool aIsNb );
       
    73 
       
    74     /**
       
    75     * By default Symbian 2nd phase constructor is private.
       
    76     */
       
    77     void ConstructL();
       
    78 
       
    79 protected:
       
    80    
       
    81     /**
       
    82     * Calculate frames' starting Byte and Bit positions in a given payload
       
    83     * buffer and update `iFrames' array with the frames' positions.
       
    84     * @since    Series 60 3.1
       
    85     * @param    aBuffer - [input] Payload buffer.
       
    86     * @param    aFrameCount - [input] Number of frames included in the
       
    87     *           payload buffer.
       
    88     */
       
    89     virtual void CalculateFramePosition( const TUint8* aBuffer,
       
    90         TInt aFrameCount );
       
    91                
       
    92               
       
    93     };
       
    94 
       
    95 #endif  // AMRPAYLOADDECODEROA_H