|
1 /* |
|
2 * Copyright (c) 2006-2009 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: .rtp to .3gp file converter* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CIPTVRTPTO3GPCONVERTER_H |
|
21 #define CIPTVRTPTO3GPCONVERTER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 |
|
25 class RFs; |
|
26 class MIptvRtpTo3gpObserver; |
|
27 |
|
28 /** |
|
29 * .rtp to .3gp file converter |
|
30 * |
|
31 * @lib IptvUtil.lib |
|
32 * @since Video Center 1.0 |
|
33 */ |
|
34 class CIptvRtpTo3gpConverter : public CBase |
|
35 { |
|
36 public: // Public constructors and destructors |
|
37 |
|
38 /** |
|
39 * Two-phased constructor |
|
40 * |
|
41 * @param aFs |
|
42 * @param aObserver Observer to receive conversion notifications |
|
43 * @param aPriority |
|
44 */ |
|
45 static CIptvRtpTo3gpConverter* NewL( RFs& aFs, MIptvRtpTo3gpObserver& aObserver, TInt aPriority ); |
|
46 |
|
47 /** |
|
48 * C++ destructor |
|
49 */ |
|
50 virtual ~CIptvRtpTo3gpConverter(); |
|
51 |
|
52 private: // private constructors |
|
53 |
|
54 /** |
|
55 * C++ default constructor |
|
56 * |
|
57 * @param aFs |
|
58 * @param aObserver |
|
59 */ |
|
60 CIptvRtpTo3gpConverter( RFs& aFs, MIptvRtpTo3gpObserver& aObserver ); |
|
61 |
|
62 /** |
|
63 * 2nd phase constructor |
|
64 * |
|
65 * @param aPriority |
|
66 */ |
|
67 void ConstructL( TInt aPriority ); |
|
68 |
|
69 public: // public user API |
|
70 |
|
71 /** |
|
72 * Requests conversion generation |
|
73 * |
|
74 * Conversion completation and failures are notified by the registered observer |
|
75 * |
|
76 * @param aSrcRtpFilename Filename for source .rtp clip |
|
77 * @param aDst3gpFilename Filename for destination .3gp clip |
|
78 */ |
|
79 void ConvertL( const TDesC& aSrcRtpFilename, const TDesC& aDst3gpFilename ); |
|
80 |
|
81 /** |
|
82 * Cancels ongoing file conversion |
|
83 */ |
|
84 void CancelConverstion(); |
|
85 |
|
86 private: // implementation, own methods |
|
87 |
|
88 /** |
|
89 * Actual cleanup for internal data/state |
|
90 * |
|
91 * @param aStatus status for conversion operation. If different than KErrNone, output |
|
92 * file is removed |
|
93 */ |
|
94 void DoCleanup( TInt aStatus ); |
|
95 |
|
96 /** |
|
97 * Launches idle cleanup and notification |
|
98 * |
|
99 * @param aStatus convertion status, passed to DoCleanup |
|
100 */ |
|
101 void DoIdleCleanupAndNotify( TInt aStatus ); |
|
102 |
|
103 /** |
|
104 * Callback to cleanup up and notify |
|
105 * |
|
106 * @param aSelf wrapped 'this' pointer |
|
107 */ |
|
108 static TInt CleanupAndNotifyCallback( TAny* aSelf ); |
|
109 |
|
110 private: // implementation, own data |
|
111 |
|
112 /** |
|
113 * Reference to file system server. |
|
114 */ |
|
115 RFs& iFs; |
|
116 |
|
117 /** |
|
118 * Conversion observer |
|
119 */ |
|
120 MIptvRtpTo3gpObserver& iObserver; |
|
121 |
|
122 /** |
|
123 * Cache for 3gp file name |
|
124 * Own. |
|
125 */ |
|
126 HBufC* i3gpFilename; |
|
127 |
|
128 /** |
|
129 * Idle callback cleanup and notify |
|
130 * Own. |
|
131 */ |
|
132 CIdle* iIdle; |
|
133 |
|
134 /** |
|
135 * Status for converstion, passed through idle cleanup |
|
136 */ |
|
137 TInt iIdleStatus; |
|
138 |
|
139 /** |
|
140 * Signals that a first keyframe has been written to file |
|
141 */ |
|
142 TBool iKeyframeWritten; |
|
143 }; |
|
144 |
|
145 #endif // CIPTVRTPTO3GPCONVERTER_H |