videoeditorengine/audioeditorengine/inc/ProcProcessAO.h
branchRCL_3
changeset 3 e0b5df5c0969
parent 0 951a5db380a0
child 5 4c409de21d23
equal deleted inserted replaced
0:951a5db380a0 3:e0b5df5c0969
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "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 * Ixonos Plc
       
    14 *
       
    15 * Description:  
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __CPROCPROCESSAO_H__
       
    22 #define __CPROCPROCESSAO_H__
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "AudCommon.h"
       
    26 #include "AudSong.h"
       
    27 
       
    28 #include "AudProcessor.h"
       
    29 
       
    30 #include "AudProcessorImpl.h"
       
    31 
       
    32 #include "ProcEncoder.h"
       
    33 
       
    34 class MProcProcessObserver;
       
    35 class CAudProcessorImpl;
       
    36 class CAudProcessor;
       
    37 
       
    38 class CProcProcess : public CBase
       
    39     {
       
    40 
       
    41 public:
       
    42 
       
    43     /**
       
    44     *
       
    45     * Constructor & destructor
       
    46     *
       
    47     */
       
    48     static CProcProcess* NewL();
       
    49 
       
    50     ~CProcProcess();
       
    51 
       
    52     /**
       
    53     * Starts a syncronous song processing operation
       
    54     *
       
    55     * @param    aSong        song
       
    56     * 
       
    57     */
       
    58     TBool StartSyncProcessingL(const CAudSong* aSong, TBool aGetTimeEstimation = EFalse);
       
    59 
       
    60     /**
       
    61     * Processes one piece syncronously
       
    62     *
       
    63     * @param    aFrame        audio frame in output
       
    64     * @param    aProgerss    current progress (0-100)
       
    65     * @param    aDuration    duration of aFrame
       
    66     * 
       
    67     */
       
    68     TBool ProcessSyncPieceL(HBufC8*& aFrame, TInt& aProgress,
       
    69                                        TTimeIntervalMicroSeconds& aDuration);
       
    70 
       
    71     /**
       
    72     *
       
    73     * Gets time estimate once the time estimate has been calculated
       
    74     *
       
    75     * If time estimation has not been processed, returns 0
       
    76     *
       
    77     * @return processing time estimate in microseconds
       
    78     */
       
    79 
       
    80     TInt64 GetFinalTimeEstimate() const;
       
    81     
       
    82     
       
    83 protected:
       
    84 
       
    85 private:
       
    86     
       
    87     // constructL
       
    88     void ConstructL();
       
    89     
       
    90     // C++ constructor
       
    91     CProcProcess();
       
    92     
       
    93 private:
       
    94     
       
    95     // observer for callbacks
       
    96     MProcProcessObserver* iObserver;
       
    97     
       
    98     // processorImpl owned by this
       
    99     CAudProcessorImpl* iProcessorImpl;
       
   100     
       
   101     // song
       
   102     const CAudSong* iSong;
       
   103     
       
   104     
       
   105     // encoder
       
   106     CProcEncoder* iEncoder;
       
   107     
       
   108     // buffer for getting data from encoder
       
   109     HBufC8* iDecBuffer;
       
   110     
       
   111     // sometimes the encoder returns more than one AMR frame at a time
       
   112     // still we need to return only one frame to the higher level
       
   113     // this buffer is a temporary storage for extra AMR frames
       
   114     
       
   115     HBufC8* iAMRBuf;
       
   116     
       
   117     // progress
       
   118     TInt iProgress;
       
   119     
       
   120     HBufC8* iAACBuf;
       
   121     
       
   122     // buffer for feeding the encoder
       
   123     CMMFDataBuffer* iEncFeedBuffer;
       
   124     
       
   125     TInt64 iTimeEstimate;
       
   126     
       
   127     };
       
   128 
       
   129 
       
   130 #endif