|
1 /* |
|
2 * Copyright (c) 2002-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 MCC_TRANSCODER_IMPL_H |
|
20 #define MCC_TRANSCODER_IMPL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <e32std.h> |
|
25 #include <vedmovie.h> |
|
26 |
|
27 #include "mmccevents.h" |
|
28 #include "mmcctranscoder.h" |
|
29 #include "transcodersessioninfo.h" |
|
30 |
|
31 // CLASS DECLARATION |
|
32 class MMccEventHandler; |
|
33 |
|
34 |
|
35 /** |
|
36 * class CMccTranscoderImpl |
|
37 */ |
|
38 class CMccTranscoderImpl : public CBase, |
|
39 public MVedMovieObserver, |
|
40 public MVedMovieProcessingObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CMccTranscoderImpl* NewL(); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual ~CMccTranscoderImpl(); |
|
52 |
|
53 public: // New functions |
|
54 |
|
55 void RegisterEventObserver( MMccTranscoderObserver& aObserver ); |
|
56 |
|
57 void UnregisterEventObserver(); |
|
58 |
|
59 void TranscodeFileL( TUint32& aSessionId, const TDesC8& aVal ); |
|
60 /** |
|
61 * Cancels transcoding of media file. |
|
62 * @param aSessionId session identifier for transcoding |
|
63 * @return KErrNone if successful |
|
64 */ |
|
65 void CancelTranscodeFileL( TUint32 aSessionId ); |
|
66 |
|
67 public: // MVedMovieObserver functions |
|
68 |
|
69 void NotifyVideoClipAdded(CVedMovie& aMovie, TInt aIndex); |
|
70 |
|
71 void NotifyVideoClipAddingFailed(CVedMovie& aMovie, TInt aError); |
|
72 |
|
73 |
|
74 void NotifyVideoClipRemoved(CVedMovie& aMovie, TInt aIndex); |
|
75 |
|
76 void NotifyMovieQualityChanged(CVedMovie& aMovie); |
|
77 |
|
78 void NotifyMovieOutputParametersChanged(CVedMovie& aMovie); |
|
79 |
|
80 |
|
81 inline void NotifyVideoClipIndicesChanged( |
|
82 CVedMovie& aMovie, |
|
83 TInt aOldIndex, |
|
84 TInt aNewIndex); |
|
85 |
|
86 |
|
87 inline void NotifyVideoClipTimingsChanged( |
|
88 CVedMovie& aMovie, |
|
89 TInt aIndex); |
|
90 |
|
91 inline void NotifyVideoClipColorEffectChanged( |
|
92 CVedMovie& aMovie, |
|
93 TInt aIndex); |
|
94 |
|
95 |
|
96 inline void NotifyVideoClipAudioSettingsChanged( |
|
97 CVedMovie& aMovie, |
|
98 TInt aIndex); |
|
99 |
|
100 |
|
101 inline void NotifyVideoClipGeneratorSettingsChanged( |
|
102 CVedMovie& aMovie, |
|
103 TInt aIndex); |
|
104 |
|
105 inline void NotifyVideoClipDescriptiveNameChanged( |
|
106 CVedMovie& aMovie, |
|
107 TInt aIndex); |
|
108 |
|
109 inline void NotifyStartTransitionEffectChanged( |
|
110 CVedMovie& aMovie); |
|
111 |
|
112 inline void NotifyMiddleTransitionEffectChanged( |
|
113 CVedMovie& aMovie, |
|
114 TInt aIndex); |
|
115 |
|
116 inline void NotifyEndTransitionEffectChanged( |
|
117 CVedMovie& aMovie); |
|
118 |
|
119 inline void NotifyAudioClipAdded( |
|
120 CVedMovie& aMovie, TInt aIndex ); |
|
121 |
|
122 inline void NotifyAudioClipAddingFailed( |
|
123 CVedMovie& aMovie, TInt aError); |
|
124 |
|
125 inline void NotifyAudioClipRemoved( |
|
126 CVedMovie& aMovie, TInt aIndex); |
|
127 |
|
128 inline void NotifyAudioClipIndicesChanged( |
|
129 CVedMovie& aMovie, |
|
130 TInt aOldIndex, |
|
131 TInt aNewIndex); |
|
132 |
|
133 inline void NotifyAudioClipTimingsChanged( |
|
134 CVedMovie& aMovie, TInt aIndex); |
|
135 |
|
136 inline void NotifyMovieReseted(CVedMovie& aMovie); |
|
137 |
|
138 inline void NotifyAudioClipDynamicLevelMarkInserted(CVedMovie& aMovie, |
|
139 TInt aClipIndex, |
|
140 TInt aMarkIndex); |
|
141 |
|
142 inline void NotifyAudioClipDynamicLevelMarkRemoved(CVedMovie& aMovie, |
|
143 TInt aClipIndex, |
|
144 TInt aMarkIndex); |
|
145 |
|
146 inline void NotifyVideoClipDynamicLevelMarkInserted(CVedMovie& aMovie, |
|
147 TInt aClipIndex, |
|
148 TInt aMarkIndex); |
|
149 |
|
150 inline void NotifyVideoClipDynamicLevelMarkRemoved(CVedMovie& aMovie, |
|
151 TInt aClipIndex, |
|
152 TInt aMarkIndex); |
|
153 |
|
154 |
|
155 public: // MVedMovieProcessingObserver |
|
156 |
|
157 void NotifyMovieProcessingStartedL(CVedMovie& aMovie); |
|
158 |
|
159 void NotifyMovieProcessingProgressed( CVedMovie& aMovie, TInt aPercentage ); |
|
160 |
|
161 void NotifyMovieProcessingCompleted(CVedMovie& aMovie, |
|
162 TInt aError); |
|
163 |
|
164 protected: // Functions from base classes |
|
165 |
|
166 private: |
|
167 /** |
|
168 * C++ default constructor. |
|
169 */ |
|
170 CMccTranscoderImpl(); |
|
171 |
|
172 /** |
|
173 * By default Symbian 2nd phase constructor is private. |
|
174 * |
|
175 * @param aSource Source of the data for the payload format plugin |
|
176 */ |
|
177 void ConstructL(); |
|
178 |
|
179 private: |
|
180 |
|
181 /** |
|
182 * @param aSessionId find session by ID |
|
183 * @return KErrNotFound if can not found, otherwise |
|
184 * return session index. |
|
185 */ |
|
186 TInt FindSession( TUint32 aSessionId ); |
|
187 |
|
188 /** |
|
189 * @param aMovie find session by CVedMovie object |
|
190 * @return KErrNotFound if can not found, otherwise |
|
191 * return session index. |
|
192 */ |
|
193 TInt FindSession( CVedMovie& aMovie ); |
|
194 |
|
195 void RemoveSession( const TInt aIndex ); |
|
196 |
|
197 void SendTranscodeEventToClient( TMccEventType aEventType, |
|
198 TInt aError, |
|
199 TUint32 aSessionId, |
|
200 TUint32 aData = 0 ); |
|
201 |
|
202 void Cleanup(); |
|
203 |
|
204 void InitiateCleanup(); |
|
205 |
|
206 static TInt AsyncTimerExpired( TAny* aPtr ); |
|
207 |
|
208 void SetOutputParameters( CVedMovie& aMovie ); |
|
209 |
|
210 private: // data |
|
211 |
|
212 RPointerArray<CMccTranscoderSessionInfo> iSessionArray; |
|
213 |
|
214 MMccTranscoderObserver* iEventObserver; |
|
215 |
|
216 CDeltaTimer* iDeltaTimer; |
|
217 TCallBack iDeltaTimerCallBack; |
|
218 TDeltaTimerEntry iDeltaTimerEntry; |
|
219 |
|
220 private: // Friend classes |
|
221 |
|
222 #ifdef EUNIT_TEST |
|
223 friend class UT_CMccTranscoderImpl; |
|
224 #endif |
|
225 }; |
|
226 |
|
227 #include "transcoderimpl.inl" |
|
228 |
|
229 #endif // end of MCC_TRANSCODER_IMPL_H |