|
1 /* |
|
2 * Copyright (c) 2005-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: Base functionality common for redundancy RTP payload encoder |
|
15 * and decoder. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MCCREDENCDECBASE_H |
|
22 #define MCCREDENCDECBASE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 |
|
27 // CONSTANTS |
|
28 const TInt KMaxNumOfEncodings = 3; |
|
29 const TInt KPayloadNotDefined = 128; |
|
30 |
|
31 // DATA TYPES |
|
32 enum TMccRedEncoding |
|
33 { |
|
34 EMccPrimaryEncoding = 0, |
|
35 EMccSecondaryEncoding, |
|
36 EMccTertiaryEncoding, |
|
37 EMccRTPPayload |
|
38 }; |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 class CMMFDataBuffer; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * Base class for redundancy RTP payload format encoder/decoder. |
|
47 * |
|
48 * @lib mmccredplformat.dll |
|
49 * @since Series 60 3.0 |
|
50 */ |
|
51 class CMccRedEncDecBase : public CBase |
|
52 { |
|
53 public: // Constructors and destructor |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 virtual ~CMccRedEncDecBase(); |
|
59 |
|
60 public: // New functions |
|
61 |
|
62 /** |
|
63 * Set encoding, which is wanted to encode/decode. |
|
64 * @since Series 60 3.0 |
|
65 * @param aEncoding Identifies, which kind of encoding is set |
|
66 * @param aEncodingBuf Buffer holding encoding |
|
67 * @return void |
|
68 */ |
|
69 virtual void SetEncodingBlockL( TMccRedEncoding aEncoding, |
|
70 TDesC8& aEncodingBuf ); |
|
71 |
|
72 /** |
|
73 * Get encoding specified with parameter. |
|
74 * @since Series 60 3.0 |
|
75 * @param aEncoding Identifies, which kind of encoding is get |
|
76 * @param aToBuffer Buffer where to place data |
|
77 * @return void |
|
78 */ |
|
79 virtual void GetEncodingBlockL( TMccRedEncoding aEncoding, |
|
80 TDes8& aToBuffer ); |
|
81 |
|
82 /** |
|
83 * Initialize after enc/dec parameters are changed or stream is |
|
84 * started again after pause. |
|
85 * |
|
86 * @since Series 60 3.0 |
|
87 * @param aRedCount Number of redundant blocks to handle |
|
88 * @param aMaxPayloadSize Maximum size of the pure RTP payload |
|
89 * @param aNumOfEncodings Number of encodings to handle |
|
90 * @return void |
|
91 */ |
|
92 virtual void InitializeL( TInt aRedCount, TInt aMaxPayloadSize, |
|
93 TInt aNumOfEncodings ); |
|
94 |
|
95 /** |
|
96 * Set payload types to wait for. |
|
97 * @since Series 60 3.0 |
|
98 * @param aPayloadTypes Payload types |
|
99 * @return System wide error code |
|
100 */ |
|
101 virtual TInt SetPayloadTypes( RArray<TUint>& aPayloadTypes ); |
|
102 |
|
103 protected: // New functions |
|
104 |
|
105 /** |
|
106 * C++ default constructor. |
|
107 */ |
|
108 CMccRedEncDecBase(); |
|
109 |
|
110 private: |
|
111 |
|
112 virtual void DoInitializeL( TInt aRedCount, TInt aMaxPayloadSize, |
|
113 TInt aNumOfEncodings ) = 0; |
|
114 |
|
115 protected: // Data |
|
116 |
|
117 // Number of redundant data blocks included in one RTP payload |
|
118 TInt iRedBlockCount; |
|
119 |
|
120 // Maximum size of the RTP payload in bytes to handle |
|
121 TInt iMaxPayloadSize; |
|
122 |
|
123 // Buffer where to handle whole RTP payload including redundancy |
|
124 CMMFDataBuffer* iRTPPayload; |
|
125 |
|
126 // Payload types for all encodings |
|
127 TFixedArray< TUint8, KMaxNumOfEncodings > iPayloadTypes; |
|
128 |
|
129 // Encodings, which are included in RTP payload |
|
130 TFixedArray< CMMFDataBuffer*, KMaxNumOfEncodings > iEncodings; |
|
131 |
|
132 }; |
|
133 |
|
134 #endif // MCCREDENCDECBASE_H |
|
135 |
|
136 // End of File |