os/mm/mm_plat/frametable_api/inc/FrameTable.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description:  Class definition for the frame table functions.
sl@0
    15
 *
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
#ifndef CFRAMETABLE_H
sl@0
    20
#define CFRAMETABLE_H
sl@0
    21
sl@0
    22
//  INCLUDES
sl@0
    23
#include <e32base.h>
sl@0
    24
sl@0
    25
// FORWARD DECLARATIONS
sl@0
    26
class MFrameTableEventObserver;
sl@0
    27
sl@0
    28
// CLASS DEFINITIONS
sl@0
    29
sl@0
    30
/**
sl@0
    31
 *  This class provides AAC utility functions.
sl@0
    32
 *
sl@0
    33
 *  @lib AACAudioControllerUtility.lib
sl@0
    34
 *  @since 3.0
sl@0
    35
 */
sl@0
    36
class CFrameTable : public CBase
sl@0
    37
    {
sl@0
    38
public:
sl@0
    39
    // Constructors and destructor
sl@0
    40
sl@0
    41
    enum TFrameTableEvent
sl@0
    42
        {
sl@0
    43
        EPosReached,
sl@0
    44
        EDecodeInterval,
sl@0
    45
        EPlayWindowEndPosReached
sl@0
    46
        };
sl@0
    47
sl@0
    48
    /**
sl@0
    49
     * Two-phased constructor.
sl@0
    50
     */
sl@0
    51
    IMPORT_C static CFrameTable* NewL();
sl@0
    52
sl@0
    53
    /**
sl@0
    54
     * Destructor.
sl@0
    55
     */
sl@0
    56
    IMPORT_C virtual ~CFrameTable();
sl@0
    57
sl@0
    58
public:
sl@0
    59
    // New functions
sl@0
    60
sl@0
    61
    IMPORT_C TInt InitFrameTable(TInt aSampleRate, TInt aSamplesPerFrame);
sl@0
    62
    IMPORT_C TInt SubmitTableEntry(TUint aPos);
sl@0
    63
sl@0
    64
    IMPORT_C TInt FindFramePosFromTime(TUint& aTimeMs, TUint& aPos);
sl@0
    65
    IMPORT_C TInt FindFrameTimeFromPos(TUint& aTimeMs, TUint& aPos);
sl@0
    66
    IMPORT_C TInt LastFramePos(TUint& aPos);
sl@0
    67
    IMPORT_C TInt LastFrameTime(TUint& aTimeMs);
sl@0
    68
sl@0
    69
    IMPORT_C void ShrinkTable();
sl@0
    70
    IMPORT_C void ResetTable();
sl@0
    71
sl@0
    72
    IMPORT_C TInt SetSourceReference(TUint aTimeMs, TUint aPos);
sl@0
    73
sl@0
    74
    IMPORT_C TInt RegisterForEvent(TFrameTableEvent aEvent,
sl@0
    75
            MFrameTableEventObserver* aObserver, TUint aParam);
sl@0
    76
    IMPORT_C TInt UnRegisterForEvent(TFrameTableEvent aEvent,
sl@0
    77
            MFrameTableEventObserver* aObserver);
sl@0
    78
    IMPORT_C TInt Bitrate();
sl@0
    79
    IMPORT_C TInt IsSeeking(TBool& aIsSeeking);
sl@0
    80
    IMPORT_C TInt GetLastPosEvent(TUint& aPos);
sl@0
    81
sl@0
    82
private:
sl@0
    83
sl@0
    84
    class TBufRefPosEntry
sl@0
    85
        {
sl@0
    86
public:
sl@0
    87
        TUint iPos;
sl@0
    88
        TUint iFrameNum;
sl@0
    89
        };
sl@0
    90
sl@0
    91
    /**
sl@0
    92
     * C++ default constructor.
sl@0
    93
     */
sl@0
    94
    CFrameTable();
sl@0
    95
sl@0
    96
    /**
sl@0
    97
     * By default Symbian 2nd phase constructor is private.
sl@0
    98
     */
sl@0
    99
    void ConstructL();
sl@0
   100
sl@0
   101
    TUint CalcFrameFromTimeMs(TUint aTimeMs);
sl@0
   102
    TInt SubmitLowResTableEntry(TBufRefPosEntry& aEntry);
sl@0
   103
sl@0
   104
private:
sl@0
   105
    // Data
sl@0
   106
sl@0
   107
    RArray<TBufRefPosEntry> iFrameTable;
sl@0
   108
    RArray<TBufRefPosEntry> iLowResFrameTable;
sl@0
   109
    TUint iSampleRate;
sl@0
   110
    TUint iSamplesPerFrame;
sl@0
   111
    TUint iMsecPerFrame;
sl@0
   112
    TUint iLastBytePos;
sl@0
   113
    TUint iAvgBitrate;
sl@0
   114
    TUint iOffset;
sl@0
   115
    TUint iTimeRefMs;
sl@0
   116
    TUint iBufCnt;
sl@0
   117
    TUint iPosEventMs;
sl@0
   118
    TUint iPlayWindowEndPosEventMs;
sl@0
   119
    TInt iIntervalRef;
sl@0
   120
    TUint iIntervalEvent;
sl@0
   121
    MFrameTableEventObserver* iObserver;
sl@0
   122
    TUint iEventPos;
sl@0
   123
    TUint iCurrentFrameCount;
sl@0
   124
    TUint iFramesPerLowResInterval;
sl@0
   125
    TUint iLowResIntervalMs;
sl@0
   126
    TUint iFrameNum;
sl@0
   127
    TBool iOkToShrink;
sl@0
   128
    };
sl@0
   129
sl@0
   130
class MFrameTableEventObserver
sl@0
   131
    {
sl@0
   132
public:
sl@0
   133
    virtual TInt
sl@0
   134
            HandleFrameTableEvent(CFrameTable::TFrameTableEvent aEvent) = 0;
sl@0
   135
    };
sl@0
   136
sl@0
   137
#endif 		// CFRAMETABLE_H
sl@0
   138
// End of File