|
1 /* |
|
2 * Copyright (c) 2005 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 #ifndef CMCEAUDIOCODEC_H |
|
20 #define CMCEAUDIOCODEC_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <mcedefs.h> |
|
25 #include <mcecodec.h> |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class RReadStream; |
|
29 class RWriteStream; |
|
30 class CMceComAudioCodec; |
|
31 class CMceMediaStream; |
|
32 class TMceIds; |
|
33 class TMceEvent; |
|
34 class TMceMediaId; |
|
35 class TMceFactory; |
|
36 class TMceAudioCodecFactory; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Container class for audio codecs. |
|
42 * |
|
43 * It defines attributes that can be set and get from audio codec. |
|
44 * These attributes are used in single audio stream and they |
|
45 * are negotiated with remote terminal. |
|
46 * |
|
47 * @lib mceclient.lib |
|
48 */ |
|
49 class CMceAudioCodec : public CMceCodec |
|
50 { |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CMceAudioCodec(); |
|
57 |
|
58 public: // New functions |
|
59 |
|
60 /** |
|
61 * Enable / Disable Voice Activity Detection. |
|
62 * @param aEnableVAD, Boolean indicating whether to enable Voice Activity Detection |
|
63 * @return KErrNotSupported if codec doesn't support VAD; otherwise KErrNone. |
|
64 */ |
|
65 virtual TInt EnableVAD(TBool aEnableVAD) = 0; |
|
66 |
|
67 /** |
|
68 * Sets the sampling frequency. |
|
69 * @param aSamplingFreq, Sampling frequency to be used |
|
70 * @return KErrNotSupported if codec doesn't support sampling frequency issued; otherwise KErrNone. |
|
71 */ |
|
72 virtual TInt SetSamplingFreq(TUint aSamplingFreq) = 0; |
|
73 |
|
74 /** |
|
75 * Sets the packetization rate. |
|
76 * @param aPTime, Packetization rate, must be multiple of audio frame size. |
|
77 * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone. |
|
78 */ |
|
79 virtual TInt SetPTime(TUint aPTime) = 0; |
|
80 |
|
81 /** |
|
82 * Sets the maximum packetization rate. |
|
83 * @param aMaxPTime, maximum allowed packetization rate, must be multiple of audio frame size. |
|
84 * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone. |
|
85 */ |
|
86 virtual TInt SetMaxPTime(TUint aMaxPTime) = 0; |
|
87 |
|
88 /** |
|
89 * Clones codec, ownership is transferred. |
|
90 * @return cloned codec |
|
91 */ |
|
92 virtual CMceAudioCodec* CloneL() const = 0; |
|
93 |
|
94 /** |
|
95 * Gets sampling frequency used currently. |
|
96 * @return Sampling frequency |
|
97 */ |
|
98 virtual TUint SamplingFreq() const; |
|
99 |
|
100 /** |
|
101 * Get VAD status. |
|
102 * @return Boolean indicating is VAD activated |
|
103 */ |
|
104 virtual TBool VAD() const; |
|
105 |
|
106 /** |
|
107 * Gets the packetization rate. |
|
108 * @return packetization rate. |
|
109 */ |
|
110 virtual TUint PTime() const; |
|
111 |
|
112 /** |
|
113 * Gets max packetization rate. |
|
114 * @return Max packetization rate. |
|
115 */ |
|
116 virtual TUint MaxPTime() const; |
|
117 |
|
118 public: |
|
119 |
|
120 /** |
|
121 * Initializes |
|
122 * @param aParent the parent |
|
123 */ |
|
124 virtual void InitializeL( CMceMediaStream& aParent ); |
|
125 |
|
126 |
|
127 protected: // New functions |
|
128 |
|
129 /** |
|
130 * C++ default constructor. |
|
131 */ |
|
132 CMceAudioCodec(); |
|
133 |
|
134 |
|
135 public: // stub data |
|
136 |
|
137 /** |
|
138 * Enables or disables VAD |
|
139 */ |
|
140 TBool iEnableVAD; |
|
141 |
|
142 /** |
|
143 * Sampling frequency used with codec |
|
144 */ |
|
145 TUint iSamplingFreq; |
|
146 |
|
147 /** |
|
148 * Stream's packet time |
|
149 */ |
|
150 TUint iPTime; |
|
151 |
|
152 /** |
|
153 * Stream's max packet time |
|
154 */ |
|
155 TUint iMaxPTime; |
|
156 }; |
|
157 |
|
158 |
|
159 #endif |
|
160 |
|
161 // End of File |