|
1 /* |
|
2 * Copyright (c) 2008 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: server impl. of session against media server |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 // INCLUDE FILES |
|
24 // System |
|
25 #include <f32file.h> |
|
26 |
|
27 // upnp stack api |
|
28 #include <upnpmediaserversettings.h> |
|
29 #include <upnpstring.h> |
|
30 #include <upnpdlnaprotocolinfo.h> |
|
31 #include <upnpdlnaprotocolinfocons.h> |
|
32 |
|
33 // upnpframework / avcontroller helper api |
|
34 #include "upnpconstantdefs.h" // for upnp-specific stuff |
|
35 |
|
36 // upnpframework / internal api's |
|
37 #include "upnpcommonutils.h" |
|
38 #include "httpdownloader.h" |
|
39 |
|
40 // avcontroller internal |
|
41 #include "upnpdownloadsession.h" |
|
42 #include "upnpavdeviceextended.h" |
|
43 #include "upnpfiletransferitem.h" |
|
44 #include "upnpavcontrollerserver.h" |
|
45 #include "upnpaverrorhandler.h" |
|
46 |
|
47 _LIT( KComponentLogfile, "upnpavcontrollerserver.txt"); |
|
48 #include "upnplog.h" |
|
49 |
|
50 // CONSTANTS |
|
51 const TUint32 KBufferSize = 0x40000; // 256K |
|
52 const TInt KParallerTransfers = 1; |
|
53 |
|
54 // ======== MEMBER FUNCTIONS ======== |
|
55 |
|
56 // -------------------------------------------------------------------------- |
|
57 // CUPnPDownloadSession::NewL |
|
58 // See upnpdownloadsession.h |
|
59 // -------------------------------------------------------------------------- |
|
60 CUPnPDownloadSession* CUPnPDownloadSession::NewL( CUpnpAVControllerServer& |
|
61 aServer, TInt aSessionId, const TDesC8& aUuid ) |
|
62 { |
|
63 __LOG( "CUPnPDownloadSession::NewL" ); |
|
64 |
|
65 CUPnPDownloadSession* self = new (ELeave) CUPnPDownloadSession( |
|
66 aServer, aSessionId ); |
|
67 CleanupStack::PushL( self ); |
|
68 self->ConstructL( aUuid ); |
|
69 CleanupStack::Pop( self ); |
|
70 return self; |
|
71 } |
|
72 |
|
73 // -------------------------------------------------------------------------- |
|
74 // CUPnPDownloadSession::CUPnPDownloadSession |
|
75 // See upnpdownloadsession.h |
|
76 // -------------------------------------------------------------------------- |
|
77 CUPnPDownloadSession::CUPnPDownloadSession( CUpnpAVControllerServer& |
|
78 aServer, TInt aSessionId ) : |
|
79 CUPnPFileTransferSessionBase( aServer, aSessionId ) |
|
80 { |
|
81 __LOG( "CUPnPDownloadSession::CUPnPDownloadSession" ); |
|
82 |
|
83 } |
|
84 |
|
85 // -------------------------------------------------------------------------- |
|
86 // CUPnPDownloadSession::~CUPnPDownloadSession |
|
87 // See upnpdownloadsession.h |
|
88 // -------------------------------------------------------------------------- |
|
89 CUPnPDownloadSession::~CUPnPDownloadSession() |
|
90 { |
|
91 __LOG( "CUPnPDownloadSession::~CUPnPDownloadSession" ); |
|
92 |
|
93 delete iDownloader; |
|
94 |
|
95 __LOG( "CUPnPDownloadSession::~CUPnPDownloadSession - end" ); |
|
96 } |
|
97 |
|
98 // -------------------------------------------------------------------------- |
|
99 // CUPnPDownloadSession::ConstructL |
|
100 // See upnpdownloadsession.h |
|
101 // -------------------------------------------------------------------------- |
|
102 void CUPnPDownloadSession::ConstructL( const TDesC8& aUuid ) |
|
103 { |
|
104 __LOG( "CUPnPDownloadSession::ConstructL" ); |
|
105 |
|
106 CUPnPFileTransferSessionBase::ConstructL( aUuid ); |
|
107 |
|
108 iDownloader = CHttpDownloader::NewL( *this, (TUint32)iServer.IAP(), |
|
109 KBufferSize, KParallerTransfers ); |
|
110 } |
|
111 |
|
112 // -------------------------------------------------------------------------- |
|
113 // CUPnPDownloadSession::TransferProgress |
|
114 // See upnpdownloadsession.h |
|
115 // -------------------------------------------------------------------------- |
|
116 void CUPnPDownloadSession::TransferProgress( TAny* aKey, TInt aBytes, |
|
117 TInt aTotalBytes ) |
|
118 { |
|
119 __LOG( "CUPnPDownloadSession::TransferProgress" ); |
|
120 |
|
121 if( iProgressTrackingEnabled ) |
|
122 { |
|
123 TUpnpFileTransferEvent item; |
|
124 TInt err = FindItemByKey( item, (TInt)aKey ); |
|
125 if( err == KErrNone ) |
|
126 { |
|
127 item.iStatus = KErrNone; |
|
128 item.iParam2 = aTotalBytes; |
|
129 item.iParam1 = aBytes; |
|
130 item.iEvent = TUpnpFileTransferEvent::ETransferProgress; |
|
131 |
|
132 Complete( item ); |
|
133 } |
|
134 else |
|
135 { |
|
136 __LOG( "TransferProgress - Not enabled!" ); |
|
137 } |
|
138 } |
|
139 } |
|
140 |
|
141 // -------------------------------------------------------------------------- |
|
142 // CUPnPDownloadSession::ReadyForTransfer |
|
143 // See upnpdownloadsession.h |
|
144 // -------------------------------------------------------------------------- |
|
145 void CUPnPDownloadSession::ReadyForTransferL( TAny* aKey ) |
|
146 { |
|
147 __LOG( "CUPnPDownloadSession::ReadyForTransfer" ); |
|
148 |
|
149 TUpnpFileTransferEvent item; |
|
150 TInt err = FindItemByKey( item, (TInt)aKey ); |
|
151 if( err == KErrNone ) |
|
152 { |
|
153 iDownloader->StartTransferL( aKey ); |
|
154 |
|
155 item.iEvent = TUpnpFileTransferEvent::ETransferStarted; |
|
156 Complete( item ); |
|
157 } |
|
158 else |
|
159 { |
|
160 __LOG( "ReadyForTransfer - key not found" ); |
|
161 |
|
162 // Not found |
|
163 item.iStatus = KErrGeneral; |
|
164 item.iParam2 = 0; |
|
165 item.iEvent = TUpnpFileTransferEvent::ETransferCompleted; |
|
166 |
|
167 Complete( item ); |
|
168 } |
|
169 } |
|
170 |
|
171 // -------------------------------------------------------------------------- |
|
172 // CUPnPDownloadSession::TransferCompleted |
|
173 // See upnpdownloadsession.h |
|
174 // -------------------------------------------------------------------------- |
|
175 void CUPnPDownloadSession::TransferCompleted( TAny* aKey, TInt aStatus ) |
|
176 { |
|
177 __LOG( "CUPnPDownloadSession::TransferCompleted" ); |
|
178 |
|
179 TUpnpFileTransferEvent item; |
|
180 TInt index; |
|
181 TInt err = FindItemByKey( item, (TInt)aKey, index ); |
|
182 if( err == KErrNone ) |
|
183 { |
|
184 item.iStatus = UPnPAVErrorHandler::ConvertToSymbianErrorCode( |
|
185 aStatus, |
|
186 EUPnPHTTPError ); |
|
187 item.iEvent = TUpnpFileTransferEvent::ETransferCompleted; |
|
188 item.iParam3 = 0; |
|
189 |
|
190 const HBufC* path = NULL; |
|
191 TRAPD( err, path = iDownloader->GetPropertyL( aKey, |
|
192 CHttpTransferBase::ETargetPath ) ); |
|
193 |
|
194 if( iEventMsg ) |
|
195 { |
|
196 if( err == KErrNone && path ) |
|
197 { |
|
198 // Write path using slot 2 |
|
199 iEventMsg->Write( 2, *path ); |
|
200 } |
|
201 else |
|
202 { |
|
203 __LOG( "Error in path handling" ); |
|
204 } |
|
205 } |
|
206 else |
|
207 { |
|
208 if( err == KErrNone && path ) |
|
209 { |
|
210 HBufC* buf = HBufC::New( path->Length() ); |
|
211 if( buf ) |
|
212 { |
|
213 buf->Des().Copy( *path ); |
|
214 item.iParam3 = (TAny*)buf; |
|
215 } |
|
216 else |
|
217 { |
|
218 __LOG( "Error in path handling" ); |
|
219 } |
|
220 } |
|
221 } |
|
222 Complete( item ); |
|
223 |
|
224 iTransferItems.Remove( index ); |
|
225 } |
|
226 else |
|
227 { |
|
228 // Corresponding key was not found! |
|
229 __LOG( "TransferCompleted - key not found" ); |
|
230 |
|
231 // Not found |
|
232 item.iStatus = KErrGeneral; |
|
233 item.iParam2 = 0; |
|
234 item.iEvent = TUpnpFileTransferEvent::ETransferCompleted; |
|
235 |
|
236 Complete( item ); |
|
237 } |
|
238 |
|
239 if( aStatus == KErrDisconnected ) |
|
240 { |
|
241 __LOG( "TransferCompleted - Target device lost" ); |
|
242 |
|
243 TInt count = iTransferItems.Count(); |
|
244 for( TInt i = 0; i < count; i++ ) |
|
245 { |
|
246 iDownloader->CancelTransfer( (TAny*)iTransferItems[i].iKey ); |
|
247 } |
|
248 iTransferItems.Reset(); |
|
249 iEventQueu.Reset(); |
|
250 } |
|
251 } |
|
252 |
|
253 // -------------------------------------------------------------------------- |
|
254 // CUPnPDownloadSession::StartDownloadL |
|
255 // See upnpdownloadsession.h |
|
256 // -------------------------------------------------------------------------- |
|
257 void CUPnPDownloadSession::StartDownloadL( const RMessage2& aMessage ) |
|
258 { |
|
259 __LOG( "CUPnPDownloadSession::StartDownloadL" ); |
|
260 |
|
261 CUpnpFileTransferItem* tmpTransferItem = CUpnpFileTransferItem::NewLC(); |
|
262 |
|
263 ReadTransferItemFromMessageL( aMessage, 1 ,tmpTransferItem ); |
|
264 |
|
265 TUpnpFileTransferEvent transferItem; |
|
266 |
|
267 if( CheckIfKeyExists( tmpTransferItem->Key() ) ) |
|
268 { |
|
269 User::Leave( KErrInUse ); |
|
270 } |
|
271 |
|
272 transferItem.iKey = tmpTransferItem->Key(); |
|
273 |
|
274 HBufC* path = HBufC::NewLC( KMaxPath ); |
|
275 if( tmpTransferItem->Path() == KNullDesC ) |
|
276 { |
|
277 // Read path from the settings |
|
278 CUpnpMediaServerSettings* msSettings = |
|
279 CUpnpMediaServerSettings::NewL(); |
|
280 CleanupStack::PushL( msSettings ); |
|
281 |
|
282 HBufC8* buf = msSettings->GetL( |
|
283 UpnpMediaServerSettings::EUploadDirectory ); |
|
284 |
|
285 CleanupStack::PopAndDestroy( msSettings ); |
|
286 |
|
287 path->Des().Copy( *buf ); |
|
288 delete buf; |
|
289 } |
|
290 else |
|
291 { |
|
292 // Get path from the transfer item |
|
293 path->Des().Copy( tmpTransferItem->Path() ); |
|
294 } |
|
295 |
|
296 __LOG8( tmpTransferItem->Title() ); |
|
297 |
|
298 HBufC* title16 = UpnpString::ToUnicodeL( tmpTransferItem->Title() ); |
|
299 CleanupStack::PushL( title16 ); |
|
300 |
|
301 HBufC* title16checked = |
|
302 UPnPCommonUtils::ReplaceIllegalFilenameCharactersL( *title16 ); |
|
303 CleanupStack::PopAndDestroy( title16 ); |
|
304 CleanupStack::PushL( title16checked ); |
|
305 |
|
306 CUpnpDlnaProtocolInfo* tmpInfo = CUpnpDlnaProtocolInfo::NewL( |
|
307 tmpTransferItem->ProtocolInfo() ); |
|
308 CleanupStack::PushL( tmpInfo ); |
|
309 HBufC* fileExt = UPnPCommonUtils::FileExtensionByMimeTypeL( |
|
310 tmpInfo->ThirdField() ); |
|
311 path->Des().Append( *title16checked ); |
|
312 |
|
313 if( fileExt ) |
|
314 { |
|
315 path->Des().Append( *fileExt ); |
|
316 delete fileExt; |
|
317 } |
|
318 |
|
319 iDownloader->InsertFileIntoWaitQueueL( (TAny*)transferItem.iKey, |
|
320 *path, tmpTransferItem->Uri() ); |
|
321 |
|
322 SetHeadersL( *tmpInfo, (TAny*)transferItem.iKey ); |
|
323 CleanupStack::PopAndDestroy( tmpInfo ); |
|
324 CleanupStack::PopAndDestroy( title16checked ); |
|
325 |
|
326 iTransferItems.Append( transferItem ); |
|
327 |
|
328 iDownloader->MoveToTransferQueueL( (TAny*)transferItem.iKey ); |
|
329 |
|
330 CleanupStack::PopAndDestroy( path ); |
|
331 |
|
332 CleanupStack::PopAndDestroy( tmpTransferItem ); |
|
333 |
|
334 aMessage.Complete( KErrNone ); |
|
335 } |
|
336 |
|
337 // -------------------------------------------------------------------------- |
|
338 // CUPnPDownloadSession::StartDownloadFHL |
|
339 // See upnpdownloadsession.h |
|
340 // -------------------------------------------------------------------------- |
|
341 void CUPnPDownloadSession::StartDownloadFHL( const RMessage2& aMessage ) |
|
342 { |
|
343 __LOG( "CUPnPDownloadSession::StartDownloadFHL" ); |
|
344 |
|
345 RFile fHandle; |
|
346 // handle is stored in slots 2 and 3 |
|
347 User::LeaveIfError( fHandle.AdoptFromClient( aMessage, 2, 3 ) ); |
|
348 CleanupClosePushL( fHandle ); |
|
349 |
|
350 CUpnpFileTransferItem* tmpTransferItem = CUpnpFileTransferItem::NewLC(); |
|
351 |
|
352 ReadTransferItemFromMessageL( aMessage, 1 ,tmpTransferItem ); |
|
353 |
|
354 TUpnpFileTransferEvent transferItem; |
|
355 transferItem.iKey = tmpTransferItem->Key(); |
|
356 |
|
357 if( CheckIfKeyExists( tmpTransferItem->Key() ) ) |
|
358 { |
|
359 User::Leave( KErrInUse ); |
|
360 } |
|
361 |
|
362 CUpnpDlnaProtocolInfo* tmpInfo = CUpnpDlnaProtocolInfo::NewL( |
|
363 tmpTransferItem->ProtocolInfo() ); |
|
364 CleanupStack::PushL( tmpInfo ); |
|
365 |
|
366 iDownloader->InsertFileIntoWaitQueueL( (TAny*)transferItem.iKey, fHandle, |
|
367 tmpTransferItem->Uri() ); |
|
368 |
|
369 SetHeadersL( *tmpInfo, (TAny*)transferItem.iKey ); |
|
370 |
|
371 CleanupStack::PopAndDestroy( tmpInfo ); |
|
372 |
|
373 iTransferItems.Append( transferItem ); |
|
374 |
|
375 iDownloader->MoveToTransferQueueL( (TAny*)transferItem.iKey ); |
|
376 |
|
377 CleanupStack::PopAndDestroy( tmpTransferItem ); |
|
378 |
|
379 CleanupStack::PopAndDestroy( &fHandle ); |
|
380 |
|
381 aMessage.Complete( KErrNone ); |
|
382 } |
|
383 |
|
384 // -------------------------------------------------------------------------- |
|
385 // CUPnPDownloadSession::CancelDownloadL |
|
386 // See upnpdownloadsession.h |
|
387 // -------------------------------------------------------------------------- |
|
388 void CUPnPDownloadSession::CancelDownloadL( const RMessage2& aMessage ) |
|
389 { |
|
390 __LOG( "CUPnPDownloadSession::CancelDownloadL" ); |
|
391 |
|
392 TInt key = aMessage.Int1(); |
|
393 |
|
394 TInt index; |
|
395 if( CheckIfKeyExists( key, index ) ) |
|
396 { |
|
397 iDownloader->CancelTransfer( (TAny*)key ); |
|
398 aMessage.Complete( KErrNone ); |
|
399 iTransferItems.Remove( index ); |
|
400 } |
|
401 else |
|
402 { |
|
403 aMessage.Complete( KErrNotFound ); |
|
404 } |
|
405 |
|
406 } |
|
407 |
|
408 // -------------------------------------------------------------------------- |
|
409 // CUPnPDownloadSession::CancelAllDownloadsL |
|
410 // See upnpdownloadsession.h |
|
411 // -------------------------------------------------------------------------- |
|
412 void CUPnPDownloadSession::CancelAllDownloadsL( const RMessage2& aMessage ) |
|
413 { |
|
414 __LOG( "CUPnPDownloadSession::CancelAllDownloadsL" ); |
|
415 |
|
416 TInt count = iTransferItems.Count(); |
|
417 for( TInt i = 0; i < count; i++ ) |
|
418 { |
|
419 iDownloader->CancelTransfer( (TAny*)iTransferItems[i].iKey ); |
|
420 } |
|
421 iTransferItems.Reset(); |
|
422 iEventQueu.Reset(); |
|
423 aMessage.Complete( KErrNone ); |
|
424 } |
|
425 |
|
426 // -------------------------------------------------------------------------- |
|
427 // CUPnPDownloadSession::StartTrackingDownloadProgressL |
|
428 // See upnpdownloadsession.h |
|
429 // -------------------------------------------------------------------------- |
|
430 void CUPnPDownloadSession::StartTrackingDownloadProgressL( |
|
431 const RMessage2& aMessage ) |
|
432 { |
|
433 __LOG( "CUPnPDownloadSession::StartTrackingDownloadProgressL" ); |
|
434 |
|
435 TInt key = aMessage.Int1(); |
|
436 if( CheckIfKeyExists( key ) ) |
|
437 { |
|
438 iDownloader->TrackProgress( (TAny*)key, ETrue ); |
|
439 iProgressTrackingEnabled = ETrue; |
|
440 aMessage.Complete( KErrNone ); |
|
441 } |
|
442 else |
|
443 { |
|
444 aMessage.Complete( KErrNotFound ); |
|
445 } |
|
446 } |
|
447 |
|
448 // -------------------------------------------------------------------------- |
|
449 // CUPnPDownloadSession::StopTrackingDownloadProgressL |
|
450 // See upnpdownloadsession.h |
|
451 // -------------------------------------------------------------------------- |
|
452 void CUPnPDownloadSession::StopTrackingDownloadProgressL( |
|
453 const RMessage2& aMessage ) |
|
454 { |
|
455 __LOG( "CUPnPDownloadSession::StopTrackingDownloadProgressL" ); |
|
456 |
|
457 TInt key = aMessage.Int1(); |
|
458 if( CheckIfKeyExists( key ) ) |
|
459 { |
|
460 iDownloader->TrackProgress( (TAny*)key, EFalse ); |
|
461 iProgressTrackingEnabled = EFalse; |
|
462 aMessage.Complete( KErrNone ); |
|
463 } |
|
464 else |
|
465 { |
|
466 aMessage.Complete( KErrNotFound ); |
|
467 } |
|
468 } |
|
469 |
|
470 // -------------------------------------------------------------------------- |
|
471 // CUPnPDownloadSession::GetDownloadEventL |
|
472 // See upnpdownloadsession.h |
|
473 // -------------------------------------------------------------------------- |
|
474 void CUPnPDownloadSession::GetDownloadEventL( const RMessage2& aMessage ) |
|
475 { |
|
476 __LOG( "CUPnPDownloadSession::GetDownloadEventL" ); |
|
477 |
|
478 if( iEventQueu.Count() ) |
|
479 { |
|
480 __LOG1( "GetDownloadEventL, events in queu: %d", |
|
481 iEventQueu.Count() ); |
|
482 |
|
483 // There are events in the queu, write the first queued event back |
|
484 // to client |
|
485 TUpnpFileTransferEvent event = iEventQueu[0]; |
|
486 iEventQueu.Remove( 0 ); |
|
487 TPckg<TUpnpFileTransferEvent> resp1( event ); |
|
488 |
|
489 if( event.iEvent == |
|
490 TUpnpFileTransferEvent::ETransferCompleted && |
|
491 event.iParam3 ) |
|
492 { |
|
493 // Write path using slot 2 |
|
494 __LOG16( *( (HBufC*)event.iParam3 ) ); |
|
495 aMessage.Write( 2, *( (HBufC*)event.iParam3 ) ); |
|
496 delete (HBufC*)event.iParam3; |
|
497 } |
|
498 aMessage.Write( 1, resp1 ); // Write event using slot 1 |
|
499 aMessage.Complete( KErrNone ); |
|
500 } |
|
501 else |
|
502 { |
|
503 iEventMsg = new (ELeave) RMessage2( aMessage ); |
|
504 } |
|
505 __LOG( "CUPnPDownloadSession::GetDownloadEventL - end" ); |
|
506 } |
|
507 |
|
508 // -------------------------------------------------------------------------- |
|
509 // CUPnPDownloadSession::CancelGetDownloadEventL |
|
510 // See upnpdownloadsession.h |
|
511 // -------------------------------------------------------------------------- |
|
512 void CUPnPDownloadSession::CancelGetDownloadEventL( |
|
513 const RMessage2& aMessage ) |
|
514 { |
|
515 __LOG( "CUPnPDownloadSession::CancelGetDownloadEventL" ); |
|
516 |
|
517 if( iEventMsg ) |
|
518 { |
|
519 iEventMsg->Complete( KErrCancel ); |
|
520 delete iEventMsg; iEventMsg = NULL; |
|
521 } |
|
522 aMessage.Complete( KErrNone ); |
|
523 } |
|
524 |
|
525 void CUPnPDownloadSession::DeviceDisappearedL( |
|
526 CUpnpAVDeviceExtended& aDevice ) |
|
527 { |
|
528 __LOG( "CUPnPDownloadSession::DeviceDisappearedL" ); |
|
529 |
|
530 if( aDevice.Uuid().Compare( iDevice->Uuid() ) == 0 ) |
|
531 { |
|
532 TUpnpFileTransferEvent event; |
|
533 event.iEvent = TUpnpFileTransferEvent::EDeviceDisconnected; |
|
534 |
|
535 Complete( event ); |
|
536 } |
|
537 } |
|
538 |
|
539 // -------------------------------------------------------------------------- |
|
540 // CUPnPDownloadSession::SetHeadersL |
|
541 // See upnpdownloadsession.h |
|
542 // -------------------------------------------------------------------------- |
|
543 void CUPnPDownloadSession::SetHeadersL( CUpnpDlnaProtocolInfo& aInfo, |
|
544 TAny* aKey ) |
|
545 { |
|
546 __LOG( "CUPnPDownloadSession::SetHeadersL" ); |
|
547 |
|
548 // Check supported transfermodes |
|
549 // We MUST use background, if it's supported |
|
550 if( aInfo.DlnaFlag( UpnpDlnaProtocolInfo::TM_B_FLAG ) ) |
|
551 { |
|
552 iDownloader->SetHeaderL( aKey, KTransferMode, KBackgroundMode ); |
|
553 } |
|
554 else if( aInfo.DlnaFlag( UpnpDlnaProtocolInfo::TM_S_FLAG ) ) |
|
555 { |
|
556 iDownloader->SetHeaderL( aKey, KTransferMode, KStreamingMode ); |
|
557 } |
|
558 else if( aInfo.DlnaFlag( UpnpDlnaProtocolInfo::TM_I_FLAG ) ) |
|
559 { |
|
560 iDownloader->SetHeaderL( aKey, KTransferMode, KInteractiveMode ); |
|
561 } |
|
562 else |
|
563 { |
|
564 __LOG( "SetHeadersL - No DLNA flags" ); |
|
565 |
|
566 // Transfermode is not defined by any flag |
|
567 // Correction for HALA-7B6FA5 |
|
568 if( UPnPCommonUtils::IsImageSupported( aInfo.ProtocolInfoL() ) ) |
|
569 { |
|
570 __LOG( "SetHeadersL - Image -> Interactive" ); |
|
571 // It's an image, we should use Interactive-mode |
|
572 iDownloader->SetHeaderL( aKey, KTransferMode, KInteractiveMode ); |
|
573 } |
|
574 else if( |
|
575 UPnPCommonUtils::IsAudioSupported( aInfo.ProtocolInfoL() ) || |
|
576 UPnPCommonUtils::IsVideoSupported( aInfo.ProtocolInfoL() ) ) |
|
577 { |
|
578 __LOG( "SetHeadersL - A/V -> Streaming" ); |
|
579 iDownloader->SetHeaderL( aKey, KTransferMode, KStreamingMode ); |
|
580 } |
|
581 else |
|
582 { |
|
583 __LOG( "SetHeadersL - Unknown type -> No mode" ); |
|
584 // It' something other |
|
585 } |
|
586 } |
|
587 } |
|
588 |
|
589 // End of file |