os/mm/mm_plat/frametable_api/inc/FrameTable.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mm_plat/frametable_api/inc/FrameTable.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,138 @@
     1.4 +/*
     1.5 +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  Class definition for the frame table functions.
    1.18 + *
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef CFRAMETABLE_H
    1.23 +#define CFRAMETABLE_H
    1.24 +
    1.25 +//  INCLUDES
    1.26 +#include <e32base.h>
    1.27 +
    1.28 +// FORWARD DECLARATIONS
    1.29 +class MFrameTableEventObserver;
    1.30 +
    1.31 +// CLASS DEFINITIONS
    1.32 +
    1.33 +/**
    1.34 + *  This class provides AAC utility functions.
    1.35 + *
    1.36 + *  @lib AACAudioControllerUtility.lib
    1.37 + *  @since 3.0
    1.38 + */
    1.39 +class CFrameTable : public CBase
    1.40 +    {
    1.41 +public:
    1.42 +    // Constructors and destructor
    1.43 +
    1.44 +    enum TFrameTableEvent
    1.45 +        {
    1.46 +        EPosReached,
    1.47 +        EDecodeInterval,
    1.48 +        EPlayWindowEndPosReached
    1.49 +        };
    1.50 +
    1.51 +    /**
    1.52 +     * Two-phased constructor.
    1.53 +     */
    1.54 +    IMPORT_C static CFrameTable* NewL();
    1.55 +
    1.56 +    /**
    1.57 +     * Destructor.
    1.58 +     */
    1.59 +    IMPORT_C virtual ~CFrameTable();
    1.60 +
    1.61 +public:
    1.62 +    // New functions
    1.63 +
    1.64 +    IMPORT_C TInt InitFrameTable(TInt aSampleRate, TInt aSamplesPerFrame);
    1.65 +    IMPORT_C TInt SubmitTableEntry(TUint aPos);
    1.66 +
    1.67 +    IMPORT_C TInt FindFramePosFromTime(TUint& aTimeMs, TUint& aPos);
    1.68 +    IMPORT_C TInt FindFrameTimeFromPos(TUint& aTimeMs, TUint& aPos);
    1.69 +    IMPORT_C TInt LastFramePos(TUint& aPos);
    1.70 +    IMPORT_C TInt LastFrameTime(TUint& aTimeMs);
    1.71 +
    1.72 +    IMPORT_C void ShrinkTable();
    1.73 +    IMPORT_C void ResetTable();
    1.74 +
    1.75 +    IMPORT_C TInt SetSourceReference(TUint aTimeMs, TUint aPos);
    1.76 +
    1.77 +    IMPORT_C TInt RegisterForEvent(TFrameTableEvent aEvent,
    1.78 +            MFrameTableEventObserver* aObserver, TUint aParam);
    1.79 +    IMPORT_C TInt UnRegisterForEvent(TFrameTableEvent aEvent,
    1.80 +            MFrameTableEventObserver* aObserver);
    1.81 +    IMPORT_C TInt Bitrate();
    1.82 +    IMPORT_C TInt IsSeeking(TBool& aIsSeeking);
    1.83 +    IMPORT_C TInt GetLastPosEvent(TUint& aPos);
    1.84 +
    1.85 +private:
    1.86 +
    1.87 +    class TBufRefPosEntry
    1.88 +        {
    1.89 +public:
    1.90 +        TUint iPos;
    1.91 +        TUint iFrameNum;
    1.92 +        };
    1.93 +
    1.94 +    /**
    1.95 +     * C++ default constructor.
    1.96 +     */
    1.97 +    CFrameTable();
    1.98 +
    1.99 +    /**
   1.100 +     * By default Symbian 2nd phase constructor is private.
   1.101 +     */
   1.102 +    void ConstructL();
   1.103 +
   1.104 +    TUint CalcFrameFromTimeMs(TUint aTimeMs);
   1.105 +    TInt SubmitLowResTableEntry(TBufRefPosEntry& aEntry);
   1.106 +
   1.107 +private:
   1.108 +    // Data
   1.109 +
   1.110 +    RArray<TBufRefPosEntry> iFrameTable;
   1.111 +    RArray<TBufRefPosEntry> iLowResFrameTable;
   1.112 +    TUint iSampleRate;
   1.113 +    TUint iSamplesPerFrame;
   1.114 +    TUint iMsecPerFrame;
   1.115 +    TUint iLastBytePos;
   1.116 +    TUint iAvgBitrate;
   1.117 +    TUint iOffset;
   1.118 +    TUint iTimeRefMs;
   1.119 +    TUint iBufCnt;
   1.120 +    TUint iPosEventMs;
   1.121 +    TUint iPlayWindowEndPosEventMs;
   1.122 +    TInt iIntervalRef;
   1.123 +    TUint iIntervalEvent;
   1.124 +    MFrameTableEventObserver* iObserver;
   1.125 +    TUint iEventPos;
   1.126 +    TUint iCurrentFrameCount;
   1.127 +    TUint iFramesPerLowResInterval;
   1.128 +    TUint iLowResIntervalMs;
   1.129 +    TUint iFrameNum;
   1.130 +    TBool iOkToShrink;
   1.131 +    };
   1.132 +
   1.133 +class MFrameTableEventObserver
   1.134 +    {
   1.135 +public:
   1.136 +    virtual TInt
   1.137 +            HandleFrameTableEvent(CFrameTable::TFrameTableEvent aEvent) = 0;
   1.138 +    };
   1.139 +
   1.140 +#endif 		// CFRAMETABLE_H
   1.141 +// End of File