heaac_dec/ariheaacdecmmfcodec/inc/ariheaacdecmmfcodec.h
author Pat Downey <patd@symbian.org>
Fri, 23 Jul 2010 16:58:44 +0100
changeset 0 bb31fbe78861
permissions -rw-r--r--
Initial commit of Aricent codec contribution.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2009 Aricent and/or its subsidiary(-ies).
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Aricent - initial contribution.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description: 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
* Plugin class for HeAac decoder. This class inherits CMMFCodec 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
* class and implements the pure virtual functions of CMMFCodec.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
* The class also has a few private funtions.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
*
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
*/
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#ifndef ARIHEAACDECMMFCODEC_H
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#define ARIHEAACDECMMFCODEC_H
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include <mmfcodec.h>
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
/**
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
 * This is a T-Class that holds the configuration 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
 * information of an AAC frame.The class has 8 data members.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
 * The data members of this should be set to value of respective parameters 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
 * passed by the application.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
 */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
class TAacFrameInfo
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
public:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
    TInt    iOutFrameSize;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
    TInt    iNoOfSamples;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
    TInt    iSamplingFrequency;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
    TInt    iNoOfChannels;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
	TInt	iProfile;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
	TInt	iOutSamplingFrequency;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
	TInt	iExtObjectType;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
	TInt	iDownSampledMode;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
    };
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
//Forward Declaration
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
class CAriHeAacDecWrapper;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
// Class declaration
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
class CAriHeAacDecMmfCodec:public CMMFCodec
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
    {
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
public: //constructors and destructors
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
	/**
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
	 * Two-phased constructor.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
	 * @return pointer to an instance of CMMFCodec
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
	 */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
	static CMMFCodec* NewL();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
	/**> Destructor */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
	~CAriHeAacDecMmfCodec();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
public: // From CMMFCodec
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
    /**
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
     * From CMMFCodec
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
     * Sets codec configuration.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
     * The configuration data is passed in as a descriptor of type TDesC8.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
     * @param aConfigType
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
     * The UID of the configuration data. 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
     * @param aParam
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
     * Descriptor with frame info parameters in the form of RArray
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
     */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
    virtual void ConfigureL( TUid aConfigType, const TDesC8& aParam );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
    /**
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
     * From CMMFCodec
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
     * Codec reset function used to flush out status information when a 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
     *	reposition occurs. 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
     *	This is used if the codec requires resetting prior to use.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
     */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
    virtual void ResetL();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
    /**
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
     * From CMMFCodec
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
     * Processes the data in the specified source buffer and writes the 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
     * processed data to the specified destination buffer.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
     * This function is synchronous, when the function returns the data 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
     * has been processed. The source buffer is converted to the appropriate 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
     * coding type in the destination buffer. The buffers can be of any 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
     * size, therefore there is no guarantee that all the source buffer can 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
     * be processed to fill the destination buffer or that all the source 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
     * buffer may be processed before the destination is full. This function
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
     * therefore returns the number of source, and destination, bytes 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
     * processed along with a process result code indicating completion 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
     * status.This function is synchronous, when the function returns the 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
     * data has been processed. The source buffer is converted to the 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
     * appropriate coding type in the destination buffer. The buffers can be
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
     * of any size, therefore there is no guarantee that all the source 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
     * buffer can be processed to fill the destination buffer or that all 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
     * the source buffer may be processed before the destination is full. 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
     * This function therefore returns the number of source,and destination,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
     * bytes processed along with a process result code indicating completion
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
     * status.The aSource and aSink buffers passed in are derived from 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
     * CMMFBuffer. The buffer type (e.g. a CMMFDataBuffer) passed in should 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
     * be supported by the codec otherwise this function should leave with 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
     * KErrNotSupported. The position of the source buffer should be checked
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
     * by calling the source buffer's Position() member which indicates the 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
     * current source read position in bytes. The codec should start 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
     * processing from the current source buffer read position. The position
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
     * of the destination buffer should be checked by calling the destination
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
     * buffer's Position() method which indicates the current destination 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
     * write position in bytes. The codec should start writing to the 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
     * destination buffer at the current destination buffer write position.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
     * This is a virtual function that each derived class must implement.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
     * @see enum TCodecProcessResult 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
     * @param  aSource
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
     *         The source buffer containing data to encode or decode.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
     *	@param  aDestination 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
     *         The destination buffer to hold the data after encoding or 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
     *         decoding.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
     * @return The result of the processing.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
     * @pre    The function ConfigureL() should have been called.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
     */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
    virtual TCodecProcessResult ProcessL( const CMMFBuffer& aSource, 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
                                 CMMFBuffer& aDestination );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
private:
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
    /**
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
	 *  Default Constructor
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
	 */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
	CAriHeAacDecMmfCodec();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
	/**
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
	 *  Symbian 2nd phase constructor .
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
	 */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
	void ConstructL();
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
	
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
	/**
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
     * Update the result with result status, source bytes consumed
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
     * and destination bytes added.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
     * @param   aStatus
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
     *          status of the result like EProcessComplete
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
     * @param   aSrcBytesConsumed
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
     *          total bytes consumed from the source buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
     * @param   aDstBytesAdded
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
     *          total bytes added to the destination buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
     * @return  result of the processing
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
     */ 
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
    TCodecProcessResult Result(
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
            TCodecProcessResult::TCodecProcessResultStatus aStatus,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
            TInt aSrcBytesConsumed,TInt aDstBytesAdded);
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
    
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
    /**
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
     * Copy the bytes from internal output buffer to destination buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
     * @param   aDst
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
     *          pointer to the destination buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
     * @param   aDstBytesConsumed
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
     *          total bytes added to the destination buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
     * @return  number of bytes copied to the destination buffer.
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
     */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
    TInt CopyToDstBuffer( CMMFDataBuffer* aDst, TInt& aDstBytesConsumed);
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
    
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
    /**
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
     * Copy the bytes from the source buffer to the internal input burrer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
     * @param   aSrc
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
     *          pointer to the source buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
     * @param   aSrcBytesConsumed
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
     *          total bytes consumed from the source buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
     * @return  number bytes copied from the source buffer
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
     */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
    TInt CopyFromSrcBuffer(const CMMFDataBuffer* aSrc,
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
                        TInt& aSrcBytesConsumed);
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
    /**
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
     * Shifts the data in the input internal buffer to start position
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
     * @param   aFromPos
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
     *          position from where data has to shift
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
     * @param   aToPos
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
     *          position to where data has to shift
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
     */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
    void ShiftData( TInt aFromPos, TInt aToPos );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
    
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
    /**
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
     * Calls Decode with NULL as source
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
     * @param   aDstLen
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
     *          destination size in bytes
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
     */
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
    void DecodeLastFrame( TInt& aDstLen );
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
	
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
private: //Data
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
	
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
	// Handle to wrapper class
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
    CAriHeAacDecWrapper*    iCodec;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
	
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
    TBool                   iConfigured;	
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
	TInt			        iOutFrameSize;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
	TUint8* 		        iInternalBuffer;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
	TBool 			        iLastFrameDecoded;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
	TInt        			iSrcUsed;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
	TInt                    iFrameNum;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
	TAacFrameInfo          	iFrameInfo;
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
	TInt			        iInternalInputBufferResidueLen;		
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
	TInt			        iInternalOutputBufferResidueLen;		
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
	TUint8*                 iInternalInputBuffer;  	
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
	TUint8*                 iInternalOutputBuffer;  		
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
	TInt 			        iInternalOutputBufferPos;	
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
	
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
    };
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
bb31fbe78861 Initial commit of Aricent codec contribution.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
#endif /* ARIHEAACDECMMFCODEC_H */