1 /* |
1 /* |
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
20 |
20 |
21 |
21 |
22 |
22 |
23 // INCLUDES |
23 // INCLUDES |
24 // upnp stack api |
24 // upnp stack api |
|
25 #include <upnpstring.h> |
|
26 |
|
27 // dlnasrv / mediaserver api |
25 #include <upnpcontainer.h> |
28 #include <upnpcontainer.h> |
26 #include <upnpobjectlist.h> |
29 #include <upnpobjectlist.h> |
27 #include <upnpitem.h> |
30 #include <upnpitem.h> |
28 #include <upnpstring.h> |
31 |
29 |
32 // dlnasrv / avcontroller api |
30 // upnpframework / avcontroller api |
|
31 #include "upnpavdevice.h" |
33 #include "upnpavdevice.h" |
32 #include "upnpavbrowsingsessionobserver.h" |
34 #include "upnpavbrowsingsessionobserver.h" |
33 |
35 |
34 // avcontroller internal |
36 // avcontroller internal |
35 #include "upnpavcontrollerclient.h" |
37 #include "upnpavcontrollerclient.h" |
271 // Returns used device |
257 // Returns used device |
272 // -------------------------------------------------------------------------- |
258 // -------------------------------------------------------------------------- |
273 const CUpnpAVDevice& CUPnPAVBrowsingSessionImpl::Device() const |
259 const CUpnpAVDevice& CUPnPAVBrowsingSessionImpl::Device() const |
274 { |
260 { |
275 return *iDevice; |
261 return *iDevice; |
276 } |
|
277 |
|
278 // -------------------------------------------------------------------------- |
|
279 // CUPnPAVBrowsingSessionImpl::ReserveLocalMSServicesL |
|
280 // Reserves local media server |
|
281 // -------------------------------------------------------------------------- |
|
282 void CUPnPAVBrowsingSessionImpl::ReserveLocalMSServicesL() |
|
283 { |
|
284 __LOG( "CUPnPAVBrowsingSessionImpl::ReserveLocalMSServicesL" ); |
|
285 |
|
286 ResetL(); |
|
287 |
|
288 if( iMediaServerResourceReserved ) |
|
289 { |
|
290 if( iObserver ) |
|
291 { |
|
292 iObserver->ReserveLocalMSServicesCompleted( KErrNone ); |
|
293 } |
|
294 } |
|
295 else |
|
296 { |
|
297 iPendingOperation = EStartMediaServer; |
|
298 iServer.ReserveMediaServer( (TInt)this, iStatus ); |
|
299 SetActive(); |
|
300 } |
|
301 } |
|
302 |
|
303 // -------------------------------------------------------------------------- |
|
304 // CUPnPAVBrowsingSessionImpl::CancelReserveLocalMSServicesL |
|
305 // Cancel reserve local media server |
|
306 // -------------------------------------------------------------------------- |
|
307 void CUPnPAVBrowsingSessionImpl::CancelReserveLocalMSServicesL() |
|
308 { |
|
309 __LOG( "CUPnPAVBrowsingSessionImpl::CancelReserveLocalMSServicesL" ); |
|
310 |
|
311 if( iPendingOperation == EStartMediaServer ) |
|
312 { |
|
313 Cancel(); |
|
314 } |
|
315 } |
|
316 |
|
317 // -------------------------------------------------------------------------- |
|
318 // CUPnPAVBrowsingSessionImpl::ReleaseLocalMSServicesL |
|
319 // Release local media server |
|
320 // -------------------------------------------------------------------------- |
|
321 void CUPnPAVBrowsingSessionImpl::ReleaseLocalMSServicesL() |
|
322 { |
|
323 __LOG( "CUPnPAVBrowsingSessionImpl::ReleaseLocalMSServicesL" ); |
|
324 |
|
325 ResetL(); |
|
326 |
|
327 if( iMediaServerResourceReserved ) |
|
328 { |
|
329 iMediaServerResourceReserved = EFalse; |
|
330 |
|
331 User::LeaveIfError( iServer.ReleaseMediaServer( (TInt)this ) ); |
|
332 } |
|
333 } |
262 } |
334 |
263 |
335 // -------------------------------------------------------------------------- |
264 // -------------------------------------------------------------------------- |
336 // CUPnPAVBrowsingSessionImpl::BrowseL |
265 // CUPnPAVBrowsingSessionImpl::BrowseL |
337 // Browse |
266 // Browse |
764 iBuffer3 = NULL; |
693 iBuffer3 = NULL; |
765 |
694 |
766 iPendingOperation = ENone; |
695 iPendingOperation = ENone; |
767 } |
696 } |
768 |
697 |
769 // -------------------------------------------------------------------------- |
|
770 // CUPnPAVBrowsingSessionImpl::StartMediaServerCompleteL |
|
771 // Handle start media server |
|
772 // -------------------------------------------------------------------------- |
|
773 void CUPnPAVBrowsingSessionImpl::StartMediaServerCompleteL() |
|
774 { |
|
775 __LOG( "CUPnPAVBrowsingSessionImpl::StartMediaServerCompleteL" ); |
|
776 |
|
777 if( iObserver ) |
|
778 { |
|
779 |
|
780 if( iStatus.Int() == EAVControllerStartMediaServerCompleted ) |
|
781 { |
|
782 iMediaServerResourceReserved = ETrue; |
|
783 iObserver->ReserveLocalMSServicesCompleted( KErrNone ); |
|
784 } |
|
785 else |
|
786 { |
|
787 iObserver->ReserveLocalMSServicesCompleted( iStatus.Int() ); |
|
788 } |
|
789 |
|
790 } |
|
791 } |
|
792 |
|
793 // end of file |
698 // end of file |