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: Interface for Common recording engine, the part of API* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCRDVRAPI_H |
|
21 #define CCRDVRAPI_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <ipvideo/CCRApiBase.h> |
|
25 #include <ipvideo/CRTypeDefs.h> |
|
26 #include <es_sock.h> |
|
27 |
|
28 // CONSTANTS |
|
29 const TReal KRealZero( 0.0 ); |
|
30 const TReal KRealMinusOne( -1.0 ); |
|
31 |
|
32 // MACROS |
|
33 // None |
|
34 |
|
35 // DATA TYPES |
|
36 // None |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 class CCRMsgQueueObserver; |
|
40 class MCREngineObserver; |
|
41 |
|
42 // CLASS DECLARATION |
|
43 |
|
44 /** |
|
45 * Ip-LiveTV-specific client api that manages service functionality. |
|
46 * |
|
47 * @lib CommonRecordingEngineClient.lib |
|
48 * @since Series 60 3.0 |
|
49 */ |
|
50 class CCRDvrApi : public CCRApiBase |
|
51 { |
|
52 |
|
53 public: // Constructors and destructor |
|
54 |
|
55 /** |
|
56 * Two-phased constructor. |
|
57 */ |
|
58 IMPORT_C static CCRDvrApi* NewL( MCREngineObserver *aObserver ); |
|
59 |
|
60 /** |
|
61 * Two-phased constructor. |
|
62 */ |
|
63 IMPORT_C static CCRDvrApi* NewL(); |
|
64 |
|
65 /** |
|
66 * Destructor. |
|
67 * @return None. |
|
68 */ |
|
69 IMPORT_C virtual ~CCRDvrApi(); |
|
70 |
|
71 public: // New methods |
|
72 |
|
73 /** |
|
74 * Tells receiving engine which IAP to use |
|
75 * @since Series 60 3.0 |
|
76 * @param aIapId is handle to RConnection that is already open. |
|
77 * @return KErrNone if ok, otherwise system-wide error codes. |
|
78 */ |
|
79 IMPORT_C TInt SetIap( const TSubConnectionUniqueId& aIapId ); |
|
80 |
|
81 /** |
|
82 * Tells receiving engine to cancel IAP selection. |
|
83 * @since Series 60 3.0 |
|
84 * @param none. |
|
85 * @return KErrNone if ok, otherwise system-wide error codes. |
|
86 */ |
|
87 IMPORT_C TInt CancelSetIap(); |
|
88 |
|
89 /** |
|
90 * Prepares RTSP stream for player. |
|
91 * @since Series 60 3.0 |
|
92 * @param aSessionChk a session definition checksum. |
|
93 * @param aRtspUrl is set of parameters required for rtsp. |
|
94 * @return KErrNone if ok, otherwise system-wide error codes. |
|
95 */ |
|
96 IMPORT_C TInt PlayRtspUrl( TUint& aSessionChk, |
|
97 const SCRRtspParams& aRtspUrl ); |
|
98 |
|
99 /** |
|
100 * Prepares DVB-H live stream for player. |
|
101 * @since Series 60 3.0 |
|
102 * @param aSessionChk a session definition checksum. |
|
103 * @param aLiveParams is set of parameters required for DVB-H. |
|
104 * @return KErrNone if ok, otherwise system-wide error codes. |
|
105 */ |
|
106 IMPORT_C TInt PlayDvbhStream( TUint& aSessionChk, |
|
107 const SCRLiveParams& aLiveParams ); |
|
108 |
|
109 /** |
|
110 * Changes DVB-H service of live streaming. |
|
111 * @since Series 60 3.0 |
|
112 * @param aSessionChk a session definition checksum. |
|
113 * @param aLiveParams is set of parameters required for DVB-H. |
|
114 * @return KErrNone if ok, otherwise system-wide error codes. |
|
115 */ |
|
116 IMPORT_C TInt ChangeDvbhService( TUint& aSessionChk, |
|
117 const SCRLiveParams& aLiveParams ); |
|
118 |
|
119 /** |
|
120 * Prepares RTP clip stream for player. |
|
121 * @since Series 60 3.0 |
|
122 * @param aSessionChk a session definition checksum. |
|
123 * @param aRtpFile is set of parameters required for rtsp. |
|
124 * @return KErrNone if ok, otherwise system-wide error codes. |
|
125 */ |
|
126 IMPORT_C TInt PlayRtpFile( TUint& aSessionChk, |
|
127 const SCRRtpPlayParams& aRtpFile ); |
|
128 |
|
129 /** |
|
130 * Prepares RTP clip stream for player. |
|
131 * @since Series 60 3.0 |
|
132 * @param aSessionChk a session definition checksum. |
|
133 * @param aRtpHandle a open file handle for RTP file. |
|
134 * @return KErrNone if ok, otherwise system-wide error codes. |
|
135 */ |
|
136 IMPORT_C TInt PlayRtpFile( TUint& aSessionChk, |
|
137 const RFile& aRtpHandle ); |
|
138 |
|
139 /** |
|
140 * Starts recording for currently active stream. |
|
141 * @since Series 60 3.0 |
|
142 * @param aSessionChk a session definition checksum. |
|
143 * @param aRecordParams a parameters for recording. |
|
144 * @return KErrNone if ok, otherwise system-wide error codes. |
|
145 */ |
|
146 IMPORT_C TInt RecordCurrentStream( const TUint aSessionChk, |
|
147 const SCRRecordParams& aRecordParams ); |
|
148 |
|
149 /** |
|
150 * Starts recording for RTSP live stream. |
|
151 * @since Series 60 3.0 |
|
152 * @param aSessionChk a session definition checksum. |
|
153 * @param aRtspUrl is set of parameters required for rtsp. |
|
154 * @param aRecordParams a parameters for recording. |
|
155 * @return KErrNone if ok, otherwise system-wide error codes. |
|
156 */ |
|
157 IMPORT_C TInt RecordRtspStream( TUint& aSessionChk, |
|
158 const SCRRtspParams& aRtspUrl, |
|
159 const SCRRecordParams& aRecordParams ); |
|
160 |
|
161 /** |
|
162 * Starts recording for DVB-H live stream. |
|
163 * @since Series 60 3.0 |
|
164 * @param aSessionChk a session definition checksum. |
|
165 * @param aLiveParams is set of parameters required for DVB-H. |
|
166 * @param aRecordParams a parameters for recording. |
|
167 * @return KErrNone if ok, otherwise system-wide error codes. |
|
168 */ |
|
169 IMPORT_C TInt RecordDvbhStream( TUint& aSessionChk, |
|
170 const SCRLiveParams& aLiveParams, |
|
171 const SCRRecordParams& aRecordParams ); |
|
172 |
|
173 /** |
|
174 * Pauses/Resumes recording of wanted stream. |
|
175 * @since Series 60 3.0 |
|
176 * @param aSessionChk a session definition checksum. |
|
177 * @param aStart a start or end pausing. |
|
178 * @return KErrNone if ok, otherwise system-wide error codes. |
|
179 */ |
|
180 IMPORT_C TInt PauseRecordStream( const TUint aSessionChk, |
|
181 const TBool& aStart ); |
|
182 |
|
183 /** |
|
184 * Stops recording of wanted stream. |
|
185 * @since Series 60 3.0 |
|
186 * @param aSessionChk a session definition checksum. |
|
187 * @return KErrNone if ok, otherwise system-wide error codes. |
|
188 */ |
|
189 IMPORT_C TInt StopRecordStream( const TUint aSessionChk ); |
|
190 |
|
191 /** |
|
192 * Starts time shifting for wanted stream. |
|
193 * @since Series 60 3.0 |
|
194 * @param aTimeShiftChk a session definition checksum. |
|
195 * @param aCurrentChk a session definition of existing session. |
|
196 * @return KErrNone if ok, otherwise system-wide error codes. |
|
197 */ |
|
198 IMPORT_C TInt StartTimeShift( TUint& aTimeShiftChk, |
|
199 const TUint aCurrentChk ); |
|
200 |
|
201 /** |
|
202 * Stops time shifting mode. |
|
203 * @since Series 60 3.0 |
|
204 * @param aTimeShiftChk a session definition checksum. |
|
205 * @param aCurrentChk a session definition of existing session. |
|
206 * @return KErrNone if ok, otherwise system-wide error codes. |
|
207 */ |
|
208 IMPORT_C TInt StopTimeShift( const TUint aTimeShiftChk, |
|
209 const TUint aCurrentChk ); |
|
210 |
|
211 /** |
|
212 * Method for ordering "play" for packet source. |
|
213 * @since Series 60 3.0 |
|
214 * @param aSessionChk a session definition checksum. |
|
215 * @param aStartPos is start position in seconds. |
|
216 * @param aEndPos is end position in seconds. |
|
217 * @return KErrNone if ok, otherwise system-wide error codes. |
|
218 */ |
|
219 IMPORT_C TInt PlayCommand( const TUint aSessionChk, |
|
220 const TReal aStartPos = KRealMinusOne, |
|
221 const TReal aEndPos = KRealMinusOne ); |
|
222 |
|
223 /** |
|
224 * Method for ordering "pause" for packet source. |
|
225 * @since Series 60 3.0 |
|
226 * @param aSessionChk a session definition checksum. |
|
227 * @return KErrNone if ok, otherwise system-wide error codes. |
|
228 */ |
|
229 IMPORT_C TInt PauseCommand( const TUint aSessionChk ); |
|
230 |
|
231 /** |
|
232 * Method for ordering "stop" for packet source. |
|
233 * @since Series 60 3.0 |
|
234 * @param aSessionChk a session definition checksum. |
|
235 * @return KErrNone if ok, otherwise system-wide error codes. |
|
236 */ |
|
237 IMPORT_C TInt StopCommand( const TUint aSessionChk ); |
|
238 |
|
239 /** |
|
240 * Setter for play position of packet source. |
|
241 * @since Series 60 3.0 |
|
242 * @param aSessionChk a session definition checksum. |
|
243 * @param aPosition a postion of RTP playback. |
|
244 * @return KErrNone if ok, otherwise system-wide error codes. |
|
245 */ |
|
246 IMPORT_C TInt SetPosition( const TUint aSessionChk, |
|
247 const TInt64 aPosition ); |
|
248 |
|
249 /** |
|
250 * Getter for play position of packet source. |
|
251 * @since Series 60 3.0 |
|
252 * @param aSessionChk a session definition checksum. |
|
253 * @param aPosition a postion of RTP playback. |
|
254 * @param aDuration a duration of RTP clip. |
|
255 * @return KErrNone if ok, otherwise system-wide error codes. |
|
256 */ |
|
257 IMPORT_C TInt GetPosition( const TUint aSessionChk, |
|
258 TInt64& aPosition, |
|
259 TInt64& aDuration ); |
|
260 |
|
261 /** |
|
262 * Method for ordering closing a source and all sinks. |
|
263 * @since Series 60 3.0 |
|
264 * @param aSessionChk a session definition checksum. |
|
265 * @return KErrNone if ok, otherwise system-wide error codes. |
|
266 */ |
|
267 IMPORT_C TInt CloseSession( const TUint aSessionChk ); |
|
268 |
|
269 /** |
|
270 * Prepares rtp file playing as a live source. |
|
271 * @since Series 60 3.0 |
|
272 * @param aSessionChk a session definition checksum. |
|
273 * @return KErrNone if ok, otherwise system-wide error codes. |
|
274 */ |
|
275 IMPORT_C TInt PlayNullSource( TUint& aSessionChk ); |
|
276 |
|
277 /** |
|
278 * Prepares rtsp stream for null sink. |
|
279 * @since Series 60 3.0 |
|
280 * @param aSessionChk a session definition checksum. |
|
281 * @param aRtspUrl is set of parameters required for rtsp |
|
282 * @return KErrNone if ok, otherwise system-wide error codes. |
|
283 */ |
|
284 IMPORT_C TInt PlayRtspUrlToNullSink( TUint& aSessionChk, |
|
285 const SCRRtspParams& aRtspUrl ); |
|
286 |
|
287 private: // Constructors and destructor |
|
288 |
|
289 /** |
|
290 * C++ default constructor. |
|
291 */ |
|
292 CCRDvrApi(); |
|
293 |
|
294 /** |
|
295 * Symbian 2nd phase constructor can leave. |
|
296 */ |
|
297 void ConstructL( MCREngineObserver *aObserver ); |
|
298 |
|
299 /** |
|
300 * Symbian 2nd phase constructor can leave. |
|
301 */ |
|
302 void ConstructL(); |
|
303 |
|
304 private: // Data |
|
305 |
|
306 /** |
|
307 * Queue observer. |
|
308 */ |
|
309 CCRMsgQueueObserver* iQueueObserver; |
|
310 |
|
311 }; |
|
312 |
|
313 #endif // CCRDVRAPI_H |
|
314 |
|
315 // End of File |
|