|
1 /* |
|
2 * Copyright (c) 2006 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 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include "MccFileSink.h" |
|
23 #include "MmccInterfaceDef.h" |
|
24 #include "mmcccodecinformation.h" |
|
25 #include "mccfilesinklogs.h" |
|
26 #include "mccinternalevents.h" |
|
27 #include "mccinternaldef.h" |
|
28 |
|
29 // CONSTANTS |
|
30 |
|
31 const TInt KMccMaxNumTimestamps = 5; |
|
32 |
|
33 const TInt KMccTimestampDifferenceMultiplier = 10; |
|
34 |
|
35 // ============================ MEMBER FUNCTIONS =============================== |
|
36 |
|
37 // ----------------------------------------------------------------------------- |
|
38 // CMccFileSink::NewSinkL |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 MDataSink* CMccFileSink::NewSinkL( TUid /*aImplementationUid*/, |
|
42 const TDesC8& /*aInitData*/ ) |
|
43 { |
|
44 CMccFileSink* self = new ( ELeave ) CMccFileSink(); |
|
45 return static_cast<MDataSink*>( self ); |
|
46 } |
|
47 |
|
48 // ----------------------------------------------------------------------------- |
|
49 // CMccFileSink::ConstructSinkL |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 void CMccFileSink::ConstructSinkL( const TDesC8& /*aInitData*/ ) |
|
53 { |
|
54 } |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // CMccFileSink::CMccFileSink |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 CMccFileSink::CMccFileSink() : |
|
61 CMccDataSink( KMccFileSinkUid ) |
|
62 { |
|
63 iVideoCodec.iFourCC = TFourCC( KMccFourCCIdH263 ); |
|
64 iAudioFourCC = TFourCC( KMccFourCCIdAMRNB ); |
|
65 } |
|
66 |
|
67 // ----------------------------------------------------------------------------- |
|
68 // CMccFileSink::~CMccFileSink |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 CMccFileSink::~CMccFileSink() |
|
72 { |
|
73 } |
|
74 |
|
75 // ----------------------------------------------------------------------------- |
|
76 // CMccFileSink::SetCurrentUser |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 void CMccFileSink::SetCurrentUser( MAsyncEventHandler* /*aEventHandler*/ ) |
|
80 { |
|
81 } |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // CMccFileSink::SinkPrimeL |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 void CMccFileSink::SinkPrimeL() |
|
88 { |
|
89 } |
|
90 |
|
91 // ----------------------------------------------------------------------------- |
|
92 // CMccFileSink::SinkPlayL() |
|
93 // ----------------------------------------------------------------------------- |
|
94 // |
|
95 void CMccFileSink::SinkPlayL() |
|
96 { |
|
97 } |
|
98 |
|
99 // ----------------------------------------------------------------------------- |
|
100 // CMccFileSink::SinkPauseL() |
|
101 // |
|
102 // Pauses streaming by cancelling timers |
|
103 // ----------------------------------------------------------------------------- |
|
104 // |
|
105 void CMccFileSink::SinkPauseL() |
|
106 { |
|
107 } |
|
108 |
|
109 // ----------------------------------------------------------------------------- |
|
110 // CMccFileSink::SinkStopL() |
|
111 // |
|
112 // Stops streaming |
|
113 // ----------------------------------------------------------------------------- |
|
114 // |
|
115 void CMccFileSink::SinkStopL() |
|
116 { |
|
117 } |
|
118 |
|
119 // ----------------------------------------------------------------------------- |
|
120 // CMccFileSink::SinkDataTypeCode |
|
121 // ----------------------------------------------------------------------------- |
|
122 // |
|
123 TFourCC CMccFileSink::SinkDataTypeCode( TMediaId aMediaId ) |
|
124 { |
|
125 if ( KUidMediaTypeVideo == aMediaId.iMediaType ) |
|
126 { |
|
127 return iVideoCodec.iFourCC; |
|
128 } |
|
129 else if ( KUidMediaTypeAudio == aMediaId.iMediaType ) |
|
130 { |
|
131 return iAudioFourCC; |
|
132 } |
|
133 else |
|
134 { |
|
135 return TFourCC( KMMFFourCCCodeNULL ); |
|
136 } |
|
137 } |
|
138 |
|
139 // ----------------------------------------------------------------------------- |
|
140 // CMccFileSink::SetSinkDataTypeCode |
|
141 // ----------------------------------------------------------------------------- |
|
142 // |
|
143 TInt CMccFileSink::SetSinkDataTypeCode( TFourCC aCodec, |
|
144 TMediaId aMediaId ) |
|
145 { |
|
146 TInt retVal = KErrNone; |
|
147 if ( KUidMediaTypeVideo == aMediaId.iMediaType && |
|
148 aCodec == iVideoCodec.iFourCC ) |
|
149 { |
|
150 retVal = KErrNone; |
|
151 } |
|
152 else if ( KUidMediaTypeAudio == aMediaId.iMediaType && |
|
153 aCodec == iAudioFourCC ) |
|
154 { |
|
155 retVal = KErrNone; |
|
156 } |
|
157 else |
|
158 { |
|
159 retVal = KErrNotSupported; |
|
160 } |
|
161 |
|
162 return retVal; |
|
163 } |
|
164 |
|
165 // ----------------------------------------------------------------------------- |
|
166 // CMccFileSink::BufferEmptiedL |
|
167 // ----------------------------------------------------------------------------- |
|
168 // |
|
169 void CMccFileSink::BufferEmptiedL( CMMFBuffer* /*aBuffer*/ ) |
|
170 { |
|
171 } |
|
172 |
|
173 // ----------------------------------------------------------------------------- |
|
174 // CMccFileSink::CanCreateSinkBuffer |
|
175 // ----------------------------------------------------------------------------- |
|
176 // |
|
177 TBool CMccFileSink::CanCreateSinkBuffer() |
|
178 { |
|
179 return EFalse; |
|
180 } |
|
181 |
|
182 // ----------------------------------------------------------------------------- |
|
183 // CMccFileSink::CreateSinkBufferL |
|
184 // ----------------------------------------------------------------------------- |
|
185 // |
|
186 CMMFBuffer* CMccFileSink::CreateSinkBufferL( |
|
187 TMediaId /*aMediaId*/, |
|
188 TBool& /*aReference*/ ) |
|
189 { |
|
190 return NULL; |
|
191 } |
|
192 |
|
193 // ----------------------------------------------------------------------------- |
|
194 // CMccFileSink::SinkThreadLogon |
|
195 // ----------------------------------------------------------------------------- |
|
196 // |
|
197 TInt CMccFileSink::SinkThreadLogon( MAsyncEventHandler& /*aEventHandler*/ ) |
|
198 { |
|
199 return KErrNone; |
|
200 } |
|
201 |
|
202 // ----------------------------------------------------------------------------- |
|
203 // CMccFileSink::SinkThreadLogoff |
|
204 // ----------------------------------------------------------------------------- |
|
205 // |
|
206 void CMccFileSink::SinkThreadLogoff() |
|
207 { |
|
208 } |
|
209 |
|
210 // ----------------------------------------------------------------------------- |
|
211 // CMccFileSink::EmptyBufferL |
|
212 // ----------------------------------------------------------------------------- |
|
213 // |
|
214 void CMccFileSink::EmptyBufferL( CMMFBuffer* /*aBuffer*/, |
|
215 MDataSource* /*aProvider*/, |
|
216 TMediaId /*aMediaId*/ ) |
|
217 { |
|
218 } |
|
219 |
|
220 // ----------------------------------------------------------------------------- |
|
221 // CMccFileSink::BufferFilledL |
|
222 // ----------------------------------------------------------------------------- |
|
223 // |
|
224 void CMccFileSink::BufferFilledL( CMMFBuffer* /*aBuffer*/ ) |
|
225 { |
|
226 } |
|
227 |
|
228 // ----------------------------------------------------------------------------- |
|
229 // CMccFileSink::MfcoDiskFullL |
|
230 // ----------------------------------------------------------------------------- |
|
231 // |
|
232 void CMccFileSink::MfcoDiskFullL() |
|
233 { |
|
234 } |
|
235 |
|
236 // ----------------------------------------------------------------------------- |
|
237 // CMccFileSink::MfcoSizeLimitReachedL |
|
238 // ----------------------------------------------------------------------------- |
|
239 // |
|
240 void CMccFileSink::MfcoSizeLimitReachedL() |
|
241 { |
|
242 } |
|
243 |
|
244 // ----------------------------------------------------------------------------- |
|
245 // CMccFileSink::SetVideoCodecL |
|
246 // ----------------------------------------------------------------------------- |
|
247 // |
|
248 void CMccFileSink::SetVideoCodecL( const TMccCodecInfo& aVideoCodec ) |
|
249 { |
|
250 iVideoCodec.iFourCC = aVideoCodec.iFourCC; |
|
251 } |
|
252 |
|
253 // ----------------------------------------------------------------------------- |
|
254 // CMccFileSink::SetAudioCodecL |
|
255 // ----------------------------------------------------------------------------- |
|
256 // |
|
257 void CMccFileSink::SetAudioCodecL( const TMccCodecInfo& aAudioCodec ) |
|
258 { |
|
259 iAudioFourCC = aAudioCodec.iFourCC; |
|
260 } |
|
261 |
|
262 // ----------------------------------------------------------------------------- |
|
263 // CMccFileSink::RecordTimeAvailableL |
|
264 // ----------------------------------------------------------------------------- |
|
265 // |
|
266 void CMccFileSink::RecordTimeAvailableL( TTimeIntervalMicroSeconds& /*aTime*/ ) |
|
267 { |
|
268 } |
|
269 |
|
270 // ----------------------------------------------------------------------------- |
|
271 // CMccFileSink::SetFileNameL |
|
272 // ----------------------------------------------------------------------------- |
|
273 // |
|
274 void CMccFileSink::SetFileNameL( const TFileName /*aFileName*/ ) |
|
275 { |
|
276 } |
|
277 |
|
278 // ----------------------------------------------------------------------------- |
|
279 // CMccFileSink::SendStreamEventToClient |
|
280 // ----------------------------------------------------------------------------- |
|
281 // |
|
282 void CMccFileSink::SendStreamEventToClient( |
|
283 TMccEventType /*aEventType*/, |
|
284 TInt /*aError*/, |
|
285 TBool /*aToAllClients*/ ) |
|
286 { |
|
287 } |
|
288 |
|
289 // ----------------------------------------------------------------------------- |
|
290 // CMccFileSink::TimeToPlayL |
|
291 // ----------------------------------------------------------------------------- |
|
292 // |
|
293 TTimeIntervalMicroSeconds CMccFileSink::TimeToPlayL( |
|
294 TTimeIntervalMicroSeconds aCurrentTimestamp ) |
|
295 { |
|
296 return aCurrentTimestamp; |
|
297 } |
|
298 |
|
299 // ----------------------------------------------------------------------------- |
|
300 // CMccFileSink::ResetTimers |
|
301 // ----------------------------------------------------------------------------- |
|
302 // |
|
303 void CMccFileSink::ResetTimers() |
|
304 { |
|
305 |
|
306 } |
|
307 |
|
308 // ----------------------------------------------------------------------------- |
|
309 // CMccFileSink::SetPausedDuration |
|
310 // ----------------------------------------------------------------------------- |
|
311 // |
|
312 void CMccFileSink::SetPausedDuration( TTime /*aT1*/, TTime /*aT2*/ ) |
|
313 { |
|
314 } |
|
315 |
|
316 |
|
317 #ifndef EKA2 |
|
318 EXPORT_C TInt E32Dll( TDllReason ) |
|
319 { |
|
320 return KErrNone; |
|
321 } |
|
322 #endif |