upnpavcontroller/upnpavcontrollerhelper/src/upnpdownloaditemresolver.cpp
branchnew development branch with rendering state machine and other goodies
changeset 38 5360b7ddc251
parent 0 7f85d04be362
equal deleted inserted replaced
32:3785f754ee62 38:5360b7ddc251
    23 // INCLUDE FILES
    23 // INCLUDE FILES
    24 // System
    24 // System
    25 #include <pathinfo.h>
    25 #include <pathinfo.h>
    26 #include <bautils.h>
    26 #include <bautils.h>
    27 
    27 
    28 // upnp stack api's
    28 // dlnasrv / mediaserver api
    29 #include <upnpobject.h>
    29 #include <upnpobject.h>
    30 #include <upnpitem.h>
    30 #include <upnpitem.h>
    31 #include <upnpelement.h>
    31 #include <upnpelement.h>
    32 #include <upnpattribute.h> // for getting resource protocol info
    32 #include <upnpattribute.h> // for getting resource protocol info
    33 #include <upnpdlnaprotocolinfo.h> // for resolving object mimetype
    33 #include <upnpdlnaprotocolinfo.h> // for resolving object mimetype
    34 
    34 
    35 // upnpframework / avcontroller api
    35 // dlnasrv / avcontroller api
    36 #include "upnpavcontroller.h" // avcontrol services
    36 #include "upnpavcontroller.h" // avcontrol services
    37 #include "upnpavdevice.h" // avcontroller device class
    37 #include "upnpavdevice.h" // avcontroller device class
    38 #include "upnpavbrowsingsession.h" // avcontrol browsing session
    38 #include "upnpavbrowsingsession.h" // avcontrol browsing session
    39 #include "upnpfiledownloadsession.h" // avcontrol download session
    39 #include "upnpfiledownloadsession.h" // avcontrol download session
    40 
    40 
    41 // upnpframework / avcontroller helper api
    41 // dlnasrv / avcontroller helper api
    42 #include "upnpconstantdefs.h" // for element names
    42 #include "upnpconstantdefs.h" // for element names
    43 #include "upnpitemutility.h" // for FindAttributeByName
    43 #include "upnpitemutility.h" // for FindAttributeByName
    44 #include "upnpresourceselector.h" // MUPnPResourceSelector
    44 #include "upnpresourceselector.h" // MUPnPResourceSelector
    45 #include "upnpitemresolverobserver.h" // observer for this class
    45 #include "upnpitemresolverobserver.h" // observer for this class
    46 #include "upnpdlnautility.h"  // IsSupportedDlnaProfile
    46 #include "upnpdlnautility.h"  // IsSupportedDlnaProfile
    47 
    47 
    48 // upnpframework / internal api's
    48 // dlnasrv / internal api's
    49 #include "upnpcommonutils.h" // for FileExtensionByMimeTypeL
    49 #include "upnpcommonutils.h" // for FileExtensionByMimeTypeL
    50 #include "upnpsettingsengine.h" // get selected download location
    50 #include "upnpsettingsengine.h" // get selected download location
    51 
    51 
    52 // avcontroller helper internal
    52 // dlnasrv / avcontroller helper internal
    53 #include "upnpremoteitemresolver.h" // remote item resolver impl.
    53 #include "upnpremoteitemresolver.h" // remote item resolver impl.
    54 #include "upnpdownloaditemresolver.h" // download item resolver impl.
    54 #include "upnpdownloaditemresolver.h" // download item resolver impl.
    55 
    55 
    56 _LIT( KComponentLogfile, "upnpavcontrollerhelper.txt");
    56 _LIT( KComponentLogfile, "upnpavcontrollerhelper.txt");
    57 #include "upnplog.h"
    57 #include "upnplog.h"
   132 
   132 
   133 // --------------------------------------------------------------------------
   133 // --------------------------------------------------------------------------
   134 // CUPnPDownloadItemResolver::ResolveL
   134 // CUPnPDownloadItemResolver::ResolveL
   135 //---------------------------------------------------------------------------
   135 //---------------------------------------------------------------------------
   136 void CUPnPDownloadItemResolver::ResolveL(
   136 void CUPnPDownloadItemResolver::ResolveL(
   137     MUPnPItemResolverObserver& aObserver )
   137     MUPnPItemResolverObserver& aObserver, CUpnpAVDevice* /*aDevice*/ )
   138     {
   138     {
   139     __LOG( "DownloadItemResolver:Resolve()" );
   139     __LOG( "DownloadItemResolver:Resolve()" );
   140     __ASSERTD( iState == EStateIdle, __FILE__, __LINE__ );
   140     __ASSERTD( iState == EStateIdle, __FILE__, __LINE__ );
   141 
   141 
   142     // change state
   142     // change state
   570                        &UPnPItemUtility::FindAttributeByNameL( 
   570                        &UPnPItemUtility::FindAttributeByNameL( 
   571                                               aRes, KAttributeProtocolInfo );
   571                                               aRes, KAttributeProtocolInfo );
   572     // parse protocol info
   572     // parse protocol info
   573     CUpnpDlnaProtocolInfo* pInfo = NULL;
   573     CUpnpDlnaProtocolInfo* pInfo = NULL;
   574     pInfo = CUpnpDlnaProtocolInfo::NewL( attr->Value() );
   574     pInfo = CUpnpDlnaProtocolInfo::NewL( attr->Value() );
       
   575     CleanupStack::PushL(pInfo);
   575     
   576     
   576     //if DLNA compliant item
   577     //if DLNA compliant item
   577     if ( pInfo->PnParameter() != KNullDesC8() )
   578     if ( pInfo->PnParameter() != KNullDesC8() )
   578         {
   579         {
   579         if( !UPnPDlnaUtility::IsSupportedDlnaProfile( 
   580         if( !UPnPDlnaUtility::IsSupportedDlnaProfile( 
   588             {
   589             {
   589             User::Leave(KErrNotSupported);
   590             User::Leave(KErrNotSupported);
   590             }
   591             }
   591         
   592         
   592         }
   593         }
   593     }
   594 		
   594 
   595     CleanupStack::PopAndDestroy(pInfo);
   595 
   596     }
   596 
   597 
       
   598 
       
   599