1 /* |
|
2 * Copyright (c) 2007 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 the License "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: Finds access objects (SDP file) and ESG related names.* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CRTPCLIPMANAGER_H |
|
21 #define CRTPCLIPMANAGER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <ipvideo/MRtpClipRepairObserver.h> |
|
25 #include <ipvideo/MRtpFileWriteObserver.h> |
|
26 #include <ipvideo/CRtpMetaHeader.h> |
|
27 #include <ipvideo/CRTypeDefs.h> |
|
28 #include <f32file.h> |
|
29 |
|
30 // CONSTANTS |
|
31 // None |
|
32 |
|
33 // MACROS |
|
34 // None |
|
35 |
|
36 // DATA TYPES |
|
37 // None |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class CRtpMetaHeader; |
|
41 class CRtpClipRepairer; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * Handles DVB-H RTP clip related functions. |
|
47 * |
|
48 * @lib DvrRtpClipHandler.lib |
|
49 * @since Series 60 3.0 |
|
50 */ |
|
51 class CRtpClipManager : public CBase |
|
52 { |
|
53 |
|
54 public: // Data types |
|
55 |
|
56 /** |
|
57 * Defines Clip details. |
|
58 */ |
|
59 class SRtpClipDetails |
|
60 { |
|
61 |
|
62 public: // Data |
|
63 |
|
64 /** |
|
65 * Service name. |
|
66 */ |
|
67 TName iService; |
|
68 |
|
69 /** |
|
70 * Program name. |
|
71 */ |
|
72 TName iProgram; |
|
73 |
|
74 /** |
|
75 * Recording start time. |
|
76 */ |
|
77 TTime iStartTime; |
|
78 |
|
79 /** |
|
80 * Recording end time. |
|
81 */ |
|
82 TTime iEndTime; |
|
83 |
|
84 /** |
|
85 * Recording duration. |
|
86 */ |
|
87 TInt iDuration; |
|
88 |
|
89 /** |
|
90 * Recording currently ongoing state. |
|
91 */ |
|
92 TBool iRecOngoing; |
|
93 |
|
94 /** |
|
95 * Recording completed status. |
|
96 */ |
|
97 TBool iCompleted; |
|
98 |
|
99 /** |
|
100 * Clip protected state. |
|
101 */ |
|
102 TBool iProtected; |
|
103 |
|
104 /** |
|
105 * Recording failed status. |
|
106 */ |
|
107 TBool iFailed; |
|
108 |
|
109 /** |
|
110 * Clip's quality. |
|
111 */ |
|
112 TUint8 iQuality; |
|
113 |
|
114 /** |
|
115 * Clip watched counter. |
|
116 */ |
|
117 TInt iPlayCount; |
|
118 |
|
119 /* |
|
120 * Point where last watch were stopped. |
|
121 */ |
|
122 TInt iPlaySpot; |
|
123 |
|
124 /** |
|
125 * Post acquisition rule ok with this device. |
|
126 */ |
|
127 TBool iPostRuleOk; |
|
128 |
|
129 /** |
|
130 * Parental rate of the clip. |
|
131 */ |
|
132 TInt iParental; |
|
133 }; |
|
134 |
|
135 public: // Constructors and destructor |
|
136 |
|
137 /** |
|
138 * Two-phased constructor. |
|
139 */ |
|
140 IMPORT_C static CRtpClipManager* NewL(); |
|
141 |
|
142 /** |
|
143 * Two-phased constructor. |
|
144 */ |
|
145 IMPORT_C static CRtpClipManager* NewLC(); |
|
146 |
|
147 /** |
|
148 * Destructor. |
|
149 * @return None. |
|
150 */ |
|
151 IMPORT_C virtual ~CRtpClipManager(); |
|
152 |
|
153 public: // New methods |
|
154 |
|
155 /** |
|
156 * Getter for recorded clip details. |
|
157 * @since Series 60 3.0 |
|
158 * @param aClipPath a full path of the clip. |
|
159 * @param aDetails a struct for details. |
|
160 * @return None. |
|
161 */ |
|
162 IMPORT_C void GetClipDetailsL( const TDesC& aClipPath, |
|
163 SRtpClipDetails& aDetails ); |
|
164 |
|
165 /** |
|
166 * Getter for recorded clip details. |
|
167 * @since Series 60 3.0 |
|
168 * @param aFile File handle to the clip. |
|
169 * @param aDetails a struct for details. |
|
170 * @return None. |
|
171 */ |
|
172 IMPORT_C void GetClipDetailsL( RFile& aFile, |
|
173 SRtpClipDetails& aDetails ); |
|
174 |
|
175 /** |
|
176 * Setter for protected state of the clip. |
|
177 * @since Series 60 3.0 |
|
178 * @param aClipPath a full path of the clip. |
|
179 * @param aProtected a protected state. |
|
180 * @return None. |
|
181 */ |
|
182 IMPORT_C void ProtectClipL( const TDesC& aClipPath, |
|
183 const TBool aProtected ); |
|
184 |
|
185 /** |
|
186 * Asyncronous fix for clip's meta header if possible. |
|
187 * @since Series 60 3.0 |
|
188 * @param aClipPath a full path of the clip. |
|
189 * @param aObs a file repairer observer. |
|
190 * @return None. |
|
191 */ |
|
192 IMPORT_C void FixMetaHeaderL( MRtpClipRepairObserver* aObs, |
|
193 const TDesC& aClipPath ); |
|
194 |
|
195 /** |
|
196 * Syncronous fix for clip's meta header if possible. |
|
197 * @since Series 60 3.0 |
|
198 * @param aClipPath a full path of the clip. |
|
199 * @return None. |
|
200 */ |
|
201 IMPORT_C void FixMetaHeaderL( const TDesC& aClipPath ); |
|
202 |
|
203 /** |
|
204 * Deletes asyncronous clip fixer. |
|
205 * @since Series 60 3.0 |
|
206 * @param aObs a file repairer observer. |
|
207 * @return None. |
|
208 */ |
|
209 IMPORT_C void DeleteRtpRepairer( MRtpClipRepairObserver* aObs ); |
|
210 |
|
211 /** |
|
212 * Verifies post acquisition rule of clip. |
|
213 * @since Series 60 3.0 |
|
214 * @param aPostRule a post acquisition rule of clip. |
|
215 * @param aMetaHeader a pointer to meat header. |
|
216 * @return KErrNone if rule ok, |
|
217 * otherwise another of the system-wide error codes. |
|
218 */ |
|
219 TInt VerifyPostRuleL( const TUint8 aPostRule, |
|
220 CRtpMetaHeader* aMetaHeader ); |
|
221 |
|
222 private: // Constructors and destructor |
|
223 |
|
224 /** |
|
225 * C++ default constructor. |
|
226 */ |
|
227 CRtpClipManager(); |
|
228 |
|
229 /** |
|
230 * Symbian 2nd phase constructor can leave. |
|
231 */ |
|
232 void ConstructL(); |
|
233 |
|
234 private: // New methods |
|
235 |
|
236 /** |
|
237 * Updates details from meta header attributes. |
|
238 * @since Series 60 3.0 |
|
239 * @param aAttributes a meta header attributes. |
|
240 * @param aDetails a struct for details. |
|
241 * @return None |
|
242 */ |
|
243 void GetDetailsL( const CRtpMetaHeader::SAttributes& aAttributes, |
|
244 SRtpClipDetails& aDetails, |
|
245 CRtpMetaHeader* aMetaHeader ); |
|
246 |
|
247 /** |
|
248 * Provides root path of clip base on memory setting. |
|
249 * @since Series 60 3.0 |
|
250 * @param aClipPath a path of the clip as return value. |
|
251 * @param aDrive a drive number where to store. |
|
252 * @return None |
|
253 */ |
|
254 void NewClipRootL( TDes& aClipPath, |
|
255 const TDriveNumber aDrive ); |
|
256 |
|
257 /** |
|
258 * Generates new clip name from service/program names. |
|
259 * Adds index number to the end if file exist. |
|
260 * @since Series 60 3.0 |
|
261 * @param aClipPath a path of the clip. |
|
262 * @param aProgram a program name of recorded channel. |
|
263 * @return none. |
|
264 */ |
|
265 void NewIndexNameL( TDes& aClipPath, |
|
266 const TDesC& aProgram ); |
|
267 |
|
268 /** |
|
269 * Adds clip to the repairing queue. |
|
270 * @since Series 60 3.0 |
|
271 * @param aClipPath a full path of the clip. |
|
272 * @return None |
|
273 */ |
|
274 void AddClipToRepairQueueL( const TDesC& aClipPath ); |
|
275 |
|
276 private: // Data |
|
277 |
|
278 /** |
|
279 * File server. |
|
280 */ |
|
281 RFs iFs; |
|
282 |
|
283 /** |
|
284 * File operations. |
|
285 */ |
|
286 RFile iFile; |
|
287 |
|
288 /** |
|
289 * Devices IMEI. |
|
290 */ |
|
291 HBufC* iImei; |
|
292 |
|
293 /** |
|
294 * RTP clip repairer. |
|
295 */ |
|
296 CRtpClipRepairer* iClipRepairer; |
|
297 |
|
298 /** |
|
299 * RTP file repairer queue. |
|
300 */ |
|
301 RPointerArray<HBufC> iRepairQueue; |
|
302 |
|
303 }; |
|
304 |
|
305 #endif // CRTPCLIPMANAGER_H |
|
306 |
|
307 // End of File |
|