|
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 AMRTOCENTRY_H |
|
22 #define AMRTOCENTRY_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <e32std.h> |
|
26 #include "amrframe.h" |
|
27 |
|
28 // MACROS |
|
29 |
|
30 |
|
31 /** |
|
32 * The Amr payload `table of contents' ( TOC ) entry in bandwidth efficient |
|
33 * mode. |
|
34 * |
|
35 * @lib Mccamrplformat.dll |
|
36 * @since Series 60 3.1 |
|
37 */ |
|
38 class CAmrTocEntry : public CBase |
|
39 { |
|
40 |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CAmrTocEntry* NewL(); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual ~CAmrTocEntry( ); |
|
52 |
|
53 public: // New functions |
|
54 |
|
55 /** |
|
56 * Encode the `table of contents' ( TOC ) entry fields into a given |
|
57 * buffer at the given position. Values to encode are obtained from the |
|
58 * corresponding fields. Byte and bit positions are updated after |
|
59 * encoding is done. |
|
60 * @since Series 60 3.1 |
|
61 * @param aBuffer - [output] Buffer to store encoded data. |
|
62 * @param aByteIndex - [input] Starting byte index ( starts from |
|
63 * zero ). |
|
64 * [output] Byte index updated after encoding. |
|
65 * @param aBitIndex - [input] Starting bit index |
|
66 * ( starts from zero ). |
|
67 * [output] Bit index updated after encoding. |
|
68 */ |
|
69 virtual void Encode( TUint8* aBuffer, TInt& aByteIndex, TInt& aBitIndex ); |
|
70 |
|
71 /** |
|
72 * Decode the `table of contents' ( TOC ) entry fields from a given |
|
73 * buffer at the given position. Decoded values are returned in the |
|
74 * corresponding fields. Byte and bit positions are updated after |
|
75 * decoding is done. |
|
76 * @since Series 60 3.1 |
|
77 * @param aBuffer - [input] Buffer to decode data from. |
|
78 * @param aByteIndex - [input] Starting byte index ( starts from |
|
79 * zero ). |
|
80 * [output] Byte index updated after decoding. |
|
81 * @param aBitIndex - [input] Starting bit index |
|
82 * ( starts from zero ). |
|
83 * [output] Bit index updated after decoding. |
|
84 */ |
|
85 virtual void Decode( const TUint8* aBuffer, TInt& aByteIndex, |
|
86 TInt& aBitIndex ); |
|
87 |
|
88 protected: // Functions |
|
89 |
|
90 /** |
|
91 * Constructor. |
|
92 */ |
|
93 CAmrTocEntry(); |
|
94 |
|
95 public: // Data. Payload `table of contents' ( TOC ) entry fields |
|
96 |
|
97 // F flag ( 1 bit ); 1 if frame followed; 0 if last frame |
|
98 TUint8 iFrameFollowed; |
|
99 |
|
100 // Frame type ( FT, 4 bits ) |
|
101 TAmrFrameType iFrameType; |
|
102 |
|
103 // Frame quality indicator ( Q, 1 bit ); 1 if frame OK if 0 damaged |
|
104 TUint8 iFrameQualityInd; |
|
105 |
|
106 }; |
|
107 |
|
108 #endif // AMRTOCENTRY_H |