multimediacommscontroller/mmccamrpayloadformat/inc/amrpayloadheader.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 #ifndef AMRPAYLOADHEADER_H
       
    22 #define AMRPAYLOADHEADER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "amrpayloadformatter.h"
       
    26 
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class TStreamEncoder;
       
    30 class TStreamDecoder;
       
    31 
       
    32 // MACROS
       
    33 
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 * The Amr payload header in bandwidth efficient mode.
       
    39 *
       
    40 * @lib Mccamrplformat.dll
       
    41 * @since Series 60 3.1
       
    42 */
       
    43 class CAmrPayloadHeader : public CBase
       
    44     {
       
    45 
       
    46 public:  // Constructors and destructor
       
    47         
       
    48     public:  // Constructors and destructor
       
    49 
       
    50     /**
       
    51     * Two-phased constructor.
       
    52     */
       
    53     static CAmrPayloadHeader* NewL();
       
    54         
       
    55     /**
       
    56     * Destructor.
       
    57     */
       
    58     ~CAmrPayloadHeader();
       
    59 
       
    60 
       
    61 public: // New functions
       
    62 
       
    63     /**
       
    64     * Encode the payload header fields into a given buffer at the given
       
    65     * position. Values to encode are obtained from the corresponding 
       
    66     * header fields. Byte and bit positions are updated after encoding 
       
    67     * is done.
       
    68     * @since    Series 60 3.1
       
    69     * @param    aBuffer - [output] Buffer to store encoded data.
       
    70     * @param    aByteIndex - [input] Starting byte index ( starts from
       
    71     *           zero ).
       
    72     *           [output] Byte index updated after encoding.
       
    73     * @param    aBitIndex - [input] Starting bit index 
       
    74     *                        ( starts from zero ).
       
    75     *           [output] Bit index updated after encoding.
       
    76     */
       
    77     virtual void Encode( TUint8* aBuffer, TInt& aByteIndex,
       
    78         TInt& aBitIndex );
       
    79 
       
    80     /**
       
    81     * Decode the payload header from a given buffer at the given position.
       
    82     * Decoded values are returned in the corresponding header fields.
       
    83     * Byte and bit positions are updated after decoding is done.
       
    84     * @since    Series 60 3.1
       
    85     * @param    aBuffer - [input] Buffer to decode data from.
       
    86     * @param    aByteIndex - [input] Starting byte index ( starts from
       
    87     *           zero ).
       
    88     *           [output] Byte index updated after decoding.
       
    89     * @param    aBitIndex - [input] Starting bit index 
       
    90     *                         ( starts from zero ).
       
    91     *           [output] Bit index updated after decoding.
       
    92     */
       
    93     virtual void Decode( const TUint8* aBuffer, TInt& aByteIndex, 
       
    94             TInt& aBitIndex );
       
    95             
       
    96     
       
    97 protected: // Functions
       
    98 
       
    99     /**
       
   100     * Constructor.
       
   101     */
       
   102     CAmrPayloadHeader();
       
   103 
       
   104 public:     // Data. Payload header fields
       
   105 
       
   106     // Codec mode request ( CMR, 4 bits )
       
   107     TAmrModeRequest iCmr;  
       
   108 
       
   109     };
       
   110 
       
   111 #endif      // AMRPAYLOADHEADER_H