upnpavcontroller/upnpavcontrollerhelper/src/upnpdlnautility.cpp
author Sampo Huttunen <sampo.huttunen@nokia.com>
Fri, 05 Nov 2010 18:31:17 +0200
branchIOP_Improvements
changeset 43 9b689d9d3a1c
parent 38 5360b7ddc251
permissions -rw-r--r--
Added signed SIS. Also updated package definition file and did some capitalization corrections to few mmp files.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
     1
/*
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
     2
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
     3
* All rights reserved.
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
     4
* This component and the accompanying materials are made available
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
     6
* which accompanies this distribution, and is available
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
     8
*
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
     9
* Initial Contributors:
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    10
* Nokia Corporation - initial contribution.
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    11
*
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    12
* Contributors:
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    13
*
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    14
* Description:      Utility for working with files in upnp context
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    15
*
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    16
*/
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    17
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    18
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    19
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    20
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    21
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    22
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    23
// INCLUDE FILES
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    24
#include <e32std.h>
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    25
#include <e32des8.h> 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    26
#include "upnpdlnautility.h"
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    27
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    28
// CONSTANTS
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    29
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    30
#define CHARTOVOID(chr) (const void*)chr
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    31
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    32
/**
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    33
 * pointer array for mime types 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    34
 */
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    35
const void* const KMimeTypes[]=
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    36
    {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    37
    CHARTOVOID("video/mp4"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    38
    CHARTOVOID("video/3gpp"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    39
    CHARTOVOID("audio/mpeg"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    40
    CHARTOVOID("audio/x-ms-wma"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    41
    CHARTOVOID("audio/3gpp"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    42
    CHARTOVOID("audio/mp4"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    43
    CHARTOVOID("audio/vnd.dlna.adts"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    44
    CHARTOVOID("audio/x-wav"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    45
    CHARTOVOID("audio/x-aac"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    46
    CHARTOVOID("audio/aac"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    47
    CHARTOVOID("audio/x-m4a"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    48
    CHARTOVOID("image/jpeg"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    49
    CHARTOVOID("image/png"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    50
    CHARTOVOID("image/gif"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    51
    CHARTOVOID("image/bmp")
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    52
    };
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    53
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    54
/**
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    55
 * pointer array for dlna types 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    56
 */
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    57
const void* const KDlnaTypes[]=
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    58
    {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    59
    CHARTOVOID( "AVC_MP4_BL_CIF15_AAC_520" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    60
    CHARTOVOID( "MPEG4_H263_3GPP_P3_L10_AMR" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    61
    CHARTOVOID( "MPEG4_P2_3GPP_SP_L0B_AMR" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    62
    CHARTOVOID( "MPEG4_P2_MP4_ASP_AAC" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    63
    CHARTOVOID( "MPEG4_P2_MP4_ASP_HEAAC" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    64
    CHARTOVOID( "MPEG4_P2_MP4_ASP_L4_SO_AAC" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    65
    CHARTOVOID( "MPEG4_P2_MP4_ASP_L4_SO_HEAAC" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    66
    CHARTOVOID( "MPEG4_P2_MP4_SP_VGA_AAC" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    67
    CHARTOVOID( "MPEG4_P2_MP4_SP_VGA_HEAAC" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    68
    CHARTOVOID( "MPEG4_P2_MP4_SP_L2_AAC" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    69
    CHARTOVOID( "MPEG4_P2_MP4_SP_AAC" ),    
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    70
    CHARTOVOID( "MPEG4_P2_3GPP_SP_L0B_AAC"),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    71
    CHARTOVOID( "AVC_MP4_BL_CIF15_AAC" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    72
    CHARTOVOID( "AVC_MP4_BL_CIF15_AAC_LTP" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    73
    CHARTOVOID( "AVC_MP4_BL_CIF15_AAC_LTP_520" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    74
    CHARTOVOID( "AVC_MP4_BL_CIF30_AAC_940" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    75
    CHARTOVOID( "AVC_MP4_BL_L12_CIF15_HEAAC" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    76
    CHARTOVOID( "AVC_TS_BL_CIF15_AAC" ),   
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    77
    CHARTOVOID( "AVC_MP4_MP_HD_720p_AAC" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    78
    CHARTOVOID( "AVC_MP4_HP_HD_AAC" ),    
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    79
    // Audio profiles that can be played on device 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    80
    CHARTOVOID( "AAC_ISO" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    81
    CHARTOVOID( "AAC_ISO_320" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    82
    CHARTOVOID( "AAC_ADTS" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    83
    CHARTOVOID( "AAC_ADTS_320" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    84
    CHARTOVOID( "AAC_MULT5_ISO" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    85
    CHARTOVOID( "HEAAC_L2_ISO" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    86
    CHARTOVOID( "HEAAC_L2_ISO_320" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    87
    CHARTOVOID( "HEAAC_L2_ADTS" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    88
    CHARTOVOID( "HEAAC_L2_ADTS_320" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    89
    CHARTOVOID( "HEAAC_MULT5_ISO" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    90
    CHARTOVOID( "HEAAC_L3_ADTS" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    91
    CHARTOVOID( "AMR_3GPP" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    92
    CHARTOVOID( "AMR_WBplus" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    93
    CHARTOVOID( "MP3" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    94
    CHARTOVOID( "MP3X" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    95
    CHARTOVOID( "WMABASE" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    96
    CHARTOVOID( "WMAFULL" ),    
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    97
    // Image profiles that can be played on device 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    98
    CHARTOVOID( "JPEG_LRG" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
    99
    CHARTOVOID( "JPEG_MED" ), 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   100
    CHARTOVOID( "JPEG_SM" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   101
    CHARTOVOID( "PNG_LRG" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   102
    CHARTOVOID( "JPEG_LRG_ICO" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   103
    CHARTOVOID( "JPEG_SM_ICO" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   104
    CHARTOVOID( "JPEG_TN" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   105
    CHARTOVOID( "PNG_TN" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   106
    CHARTOVOID( "PNG_SM_ICO" ),
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   107
    CHARTOVOID( "PNG_LRG_ICO" )
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   108
    };
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   109
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   110
const TStringTable UPnPDlnaUtility::iMimeTypes = 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   111
    {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   112
    15, 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   113
    KMimeTypes, 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   114
    EFalse
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   115
    };
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   116
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   117
const TStringTable UPnPDlnaUtility::iDlnaTypes = 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   118
    {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   119
    47, 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   120
    KDlnaTypes, 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   121
    EFalse
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   122
    };
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   123
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   124
// ============================ LOCAL FUNCTIONS =============================
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   125
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   126
// --------------------------------------------------------------------------
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   127
// UPnPDlnaUtility::GetSupportedProfilesL
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   128
// Returns Supported dlna profiles, Only player mode supported.
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   129
// --------------------------------------------------------------------------
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   130
EXPORT_C CDesC8Array& UPnPDlnaUtility::GetSupportedProfilesL( 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   131
    const TDlnaMode aMode )
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   132
    {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   133
    CDesC8Array* array = new (ELeave) CDesC8ArrayFlat( 10 );
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   134
    CleanupStack::PushL( array );
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   135
    // At the m
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   136
    switch( aMode )
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   137
        {         
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   138
        case EDMPMode:
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   139
            {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   140
            // Video profiles that can be played on device
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   141
            
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   142
            for ( TInt i(0) ; i < UPnPDlnaUtility::iDlnaTypes.iCount ; ++i )
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   143
                {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   144
                array->AppendL( TPtrC8( 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   145
                (const TUint8*)(UPnPDlnaUtility::iDlnaTypes.iTable[i]) ) );
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   146
                }
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   147
            break;
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   148
            }
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   149
        case EDMSMode:
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   150
        case EDMUMode:      
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   151
        case EDMDMode:    
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   152
        default:            
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   153
            {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   154
            User::Leave( KErrNotSupported );
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   155
            break;
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   156
            }             
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   157
        }
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   158
    CleanupStack::Pop( array );        
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   159
    return *array;        
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   160
    }
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   161
    
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   162
// --------------------------------------------------------------------------
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   163
// UPnPDlnaUtility::IsSupportedMimeType
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   164
// Returns ETrue if aMime is such a mime type for which playback on device 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   165
// might be supported.
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   166
// -------------------------------------------------------------------------- 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   167
EXPORT_C TBool UPnPDlnaUtility::IsSupportedMimeType( const TDesC8& aMime ) 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   168
    {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   169
    return UPnPDlnaUtility::IsSupported(iMimeTypes,aMime);
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   170
    }
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   171
    
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   172
// --------------------------------------------------------------------------
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   173
// UPnPDlnaUtility::IsSupportedDlnaProfile
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   174
// Returns ETrue if aProfile is such a DLNA profile for which playback on 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   175
// device might be supported.
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   176
// -------------------------------------------------------------------------- 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   177
EXPORT_C TBool UPnPDlnaUtility::IsSupportedDlnaProfile( 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   178
    const TDesC8& aProfile ) 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   179
    {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   180
    return UPnPDlnaUtility::IsSupported(iDlnaTypes,aProfile);  
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   181
    }
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   182
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   183
//---------------------------------------------------------------------------
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   184
// IsSupported
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   185
//---------------------------------------------------------------------------
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   186
TBool UPnPDlnaUtility::IsSupported( const TStringTable& aTable 
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   187
                                  , const TDesC8& aType )
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   188
    {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   189
    TBool ret( EFalse );
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   190
    for ( TInt i(0) ; i < aTable.iCount ; ++i )
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   191
        {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   192
        if ( aType == TPtrC8( (const TUint8*)(aTable.iTable[i]) ) )
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   193
            {
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   194
            ret = ETrue;
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   195
            i = aTable.iCount;
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   196
            }
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   197
        }
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   198
    return ret;
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   199
    }
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   200
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   201
// End of file
5360b7ddc251 New development branch with e.g. rendering state machine and a simple Qt example application using it.
samhuttu
parents: 0
diff changeset
   202