|
1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /* Copyright (c) 2004, Nokia. All rights reserved. */ |
|
21 |
|
22 #ifndef __VEDVIDEOCLIPINFOGENERATEDIMP_H__ |
|
23 #define __VEDVIDEOCLIPINFOGENERATEDIMP_H__ |
|
24 |
|
25 |
|
26 #include <e32base.h> |
|
27 |
|
28 #include "VedCommon.h" |
|
29 #include "VedVideoClipInfo.h" |
|
30 #include "VedVideoClipGenerator.h" |
|
31 |
|
32 /* |
|
33 * Forward declarations. |
|
34 */ |
|
35 class CVedVideoClipInfoGeneratedOperation; |
|
36 class CVedVideoClipGeneratedFrameToFrameAdapter; |
|
37 |
|
38 /** |
|
39 * Utility class for getting information about generated video clips. |
|
40 */ |
|
41 class CVedVideoClipInfoGeneratedImp : public CVedVideoClipInfo |
|
42 { |
|
43 public: |
|
44 CVedVideoClipInfoGeneratedImp(CVedVideoClipGenerator& aGenerator, TBool aOwnsGenerator); |
|
45 |
|
46 void ConstructL(MVedVideoClipInfoObserver& aObserver); |
|
47 |
|
48 /** |
|
49 * Destroys the object and releases all resources. |
|
50 */ |
|
51 ~CVedVideoClipInfoGeneratedImp(); |
|
52 |
|
53 |
|
54 /* General property methods. */ |
|
55 |
|
56 TPtrC DescriptiveName() const; |
|
57 |
|
58 TPtrC FileName() const; |
|
59 |
|
60 RFile* FileHandle() const; |
|
61 |
|
62 CVedVideoClipGenerator* Generator() const; |
|
63 |
|
64 TVedVideoClipClass Class() const; |
|
65 |
|
66 TVedVideoFormat Format() const; |
|
67 |
|
68 TVedVideoType VideoType() const; |
|
69 |
|
70 TSize Resolution() const; |
|
71 |
|
72 TBool HasAudio() const; |
|
73 |
|
74 TVedAudioType AudioType() const; |
|
75 |
|
76 TVedAudioChannelMode AudioChannelMode() const; |
|
77 |
|
78 TInt AudioSamplingRate() const; |
|
79 |
|
80 TTimeIntervalMicroSeconds Duration() const; |
|
81 |
|
82 |
|
83 /* Video frame property methods. */ |
|
84 |
|
85 TInt VideoFrameCount() const; |
|
86 |
|
87 TTimeIntervalMicroSeconds VideoFrameStartTimeL(TInt aIndex); |
|
88 |
|
89 TTimeIntervalMicroSeconds VideoFrameEndTimeL(TInt aIndex); |
|
90 |
|
91 TTimeIntervalMicroSeconds VideoFrameDurationL(TInt aIndex); |
|
92 |
|
93 TInt VideoFrameSizeL(TInt aIndex); |
|
94 |
|
95 TBool VideoFrameIsIntraL(TInt aIndex); |
|
96 |
|
97 TInt GetVideoFrameIndexL(TTimeIntervalMicroSeconds aTime); |
|
98 |
|
99 |
|
100 void SetTranscodeFactor(TVedTranscodeFactor aFactor); |
|
101 |
|
102 TVedTranscodeFactor TranscodeFactor(); |
|
103 |
|
104 TBool IsMMSCompatible(); |
|
105 |
|
106 /* Frame methods. */ |
|
107 |
|
108 void GetFrameL(MVedVideoClipFrameObserver& aObserver, |
|
109 TInt aIndex, |
|
110 TSize* const aResolution, |
|
111 TDisplayMode aDisplayMode, |
|
112 TBool aEnhance, |
|
113 TInt aPriority); |
|
114 |
|
115 void CancelFrame(); |
|
116 |
|
117 private: |
|
118 // Member variables |
|
119 |
|
120 // Get audio info operation. |
|
121 CVedVideoClipInfoGeneratedOperation* iInfoOperation; |
|
122 // Flag to indicate then info is available |
|
123 TBool iReady; |
|
124 // Frame generator |
|
125 CVedVideoClipGenerator* iGenerator; |
|
126 TBool iOwnsGenerator; |
|
127 |
|
128 CVedVideoClipGeneratedFrameToFrameAdapter* iAdapter; |
|
129 |
|
130 TVedTranscodeFactor iTFactor; |
|
131 friend class CVedVideoClipInfoGeneratedOperation; |
|
132 }; |
|
133 |
|
134 |
|
135 |
|
136 class CVedVideoClipGeneratedFrameToFrameAdapter : public CBase, public MVedVideoClipGeneratorFrameObserver |
|
137 { |
|
138 public: |
|
139 CVedVideoClipGeneratedFrameToFrameAdapter(CVedVideoClipInfo& aInfo); |
|
140 void NotifyVideoClipGeneratorFrameCompleted(CVedVideoClipGenerator& aInfo, |
|
141 TInt aError, |
|
142 CFbsBitmap* aFrame); |
|
143 private: |
|
144 MVedVideoClipFrameObserver* iFrameObserver; |
|
145 CVedVideoClipInfo& iInfo; |
|
146 |
|
147 friend class CVedVideoClipInfoGeneratedImp; |
|
148 }; |
|
149 |
|
150 |
|
151 /** |
|
152 * Internal class for asynchronous construction of info class. |
|
153 */ |
|
154 class CVedVideoClipInfoGeneratedOperation : public CActive |
|
155 { |
|
156 public: |
|
157 /* Static constructor */ |
|
158 static CVedVideoClipInfoGeneratedOperation* NewL(CVedVideoClipInfoGeneratedImp* aInfo, |
|
159 MVedVideoClipInfoObserver& aObserver); |
|
160 protected: |
|
161 /* |
|
162 * From CActive |
|
163 * Standard active object RunL |
|
164 */ |
|
165 void RunL(); |
|
166 |
|
167 /* |
|
168 * From CActive |
|
169 * Standard active object DoCancel |
|
170 */ |
|
171 void DoCancel(); |
|
172 |
|
173 private: |
|
174 /* Default constructor */ |
|
175 CVedVideoClipInfoGeneratedOperation(CVedVideoClipInfoGeneratedImp* aInfo, |
|
176 MVedVideoClipInfoObserver& aObserver); |
|
177 /* Standard Symbian OS two phased constructor */ |
|
178 void ConstructL(); |
|
179 /* Destructor */ |
|
180 ~CVedVideoClipInfoGeneratedOperation(); |
|
181 |
|
182 private: |
|
183 // Class to contain video clip info. |
|
184 CVedVideoClipInfoGeneratedImp* iInfo; |
|
185 // Observer of video clip info operation. |
|
186 MVedVideoClipInfoObserver* iObserver; |
|
187 |
|
188 friend class CVedVideoClipInfoGeneratedImp; |
|
189 }; |
|
190 |
|
191 |
|
192 #endif // __VEDVIDEOCLIPINFOGENERATEDIMP_H__ |
|
193 |