mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/mediamtpdataprovider/src/cmediamtpdataproviderdescriptionutility.cpp
changeset 25 d881023c13eb
child 32 edd273b3192a
equal deleted inserted replaced
21:a05c44bc3c61 25:d881023c13eb
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Media dp specific property description construction utility.
       
    15 *              Used by all request processors which related to property description
       
    16 *
       
    17 */
       
    18 
       
    19 #include <mtp/cmtptypeobjectpropdesc.h>
       
    20 #include <mtp/cmtptypestring.h>
       
    21 
       
    22 #include "cmediamtpdataproviderdescriptionutility.h"
       
    23 #include "mediamtpdataproviderconst.h"
       
    24 #include "tobjectdescription.h"
       
    25 #include "mmmtpdpconfig.h"
       
    26 #include "mmmtpdplogger.h"
       
    27 
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // CMediaMtpDataProviderDescriptionUtility::NewL
       
    31 //
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 CMediaMtpDataProviderDescriptionUtility* CMediaMtpDataProviderDescriptionUtility::NewL()
       
    35     {
       
    36     CMediaMtpDataProviderDescriptionUtility* self =
       
    37         new( ELeave ) CMediaMtpDataProviderDescriptionUtility();
       
    38 
       
    39     return self;
       
    40     }
       
    41 
       
    42 CMediaMtpDataProviderDescriptionUtility::CMediaMtpDataProviderDescriptionUtility()
       
    43     {
       
    44     // Do nothing
       
    45     }
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // CMediaMtpDataProviderDescriptionUtility::NewInterdepentPropDescL
       
    49 // Construct media dp specific interdependent property description.
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 CMTPTypeInterdependentPropDesc* CMediaMtpDataProviderDescriptionUtility::NewInterdepentPropDescL( MMmMtpDpConfig& aDpConfig, TUint aFormatCode )
       
    53     {
       
    54     PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewInterdepentPropDescL" ) );
       
    55 
       
    56     TBool audioWaveCodecSupported = EFalse;
       
    57     TBool audioBitRateSupported = EFalse;
       
    58     TBool videoFourCcCodecSupported = EFalse;
       
    59     TBool videoBitRateSupported = EFalse;
       
    60 
       
    61     const RArray<TUint>* properties = aDpConfig.GetSupportedPropertiesL( aFormatCode );
       
    62 
       
    63     TInt count = properties->Count();
       
    64     for ( TInt i = 0; i < count; i++ )
       
    65         {
       
    66         switch ( ( *properties )[i] )
       
    67             {
       
    68             case EMTPObjectPropCodeAudioWAVECodec:
       
    69                 audioWaveCodecSupported = ETrue;
       
    70                 break;
       
    71             case EMTPObjectPropCodeAudioBitRate:
       
    72                 audioBitRateSupported = ETrue;
       
    73                 break;
       
    74             case EMTPObjectPropCodeVideoFourCCCodec:
       
    75                 videoFourCcCodecSupported = ETrue;
       
    76                 break;
       
    77             case EMTPObjectPropCodeVideoBitRate:
       
    78                 videoBitRateSupported = ETrue;
       
    79                 break;
       
    80             default:
       
    81                 // do nothing
       
    82                 break;
       
    83             }
       
    84         }
       
    85 
       
    86     CMTPTypeInterdependentPropDesc* interdependentPropDesc = CMTPTypeInterdependentPropDesc::NewL();
       
    87 
       
    88     if ( audioWaveCodecSupported && audioBitRateSupported )
       
    89         {
       
    90         CMTPTypeInterdependentProperties* properties = CMTPTypeInterdependentProperties::NewL();
       
    91         properties->AppendL( NewAudioWaveCodecPropDescL( aFormatCode ) );
       
    92         properties->AppendL( NewAudioBitratePropDescL( aFormatCode ) );
       
    93         interdependentPropDesc->AppendL( properties );
       
    94         }
       
    95 
       
    96     if ( videoFourCcCodecSupported && videoBitRateSupported )
       
    97         {
       
    98         CMTPTypeInterdependentProperties* properties = CMTPTypeInterdependentProperties::NewL();
       
    99         properties->AppendL( NewVideoFourCCCodecPropDescL( aFormatCode ) );
       
   100         properties->AppendL( NewVideoBitratePropDescL( aFormatCode ) );
       
   101         interdependentPropDesc->AppendL( properties );
       
   102         }
       
   103 
       
   104     PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewInterdepentPropDescL" ) );
       
   105     return interdependentPropDesc;
       
   106     }
       
   107 
       
   108 // -----------------------------------------------------------------------------
       
   109 // CMediaMtpDataProviderDescriptionUtility::NewSpecificPropDescL
       
   110 // Construct media dp specific property description.
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewSpecificPropDescL( TUint aFormatCode, TUint16 aPropCode )
       
   114     {
       
   115     CMTPTypeObjectPropDesc* propertyDesc = NULL;
       
   116 
       
   117     switch ( aPropCode )
       
   118         {
       
   119         // format specific
       
   120         case EMTPObjectPropCodeArtist: // Artist
       
   121         case EMTPObjectPropCodeTrack: // Track
       
   122         case EMTPObjectPropCodeGenre: // Genre
       
   123         case EMTPObjectPropCodeAlbumName: // Album Name
       
   124         case EMTPObjectPropCodeAlbumArtist: // Album Artist
       
   125         case EMTPObjectPropCodeOriginalReleaseDate: // Original Release Date
       
   126         case EMTPObjectPropCodeComposer: // Composer
       
   127         case EMTPObjectPropCodeParentalRating:
       
   128             propertyDesc = CMTPTypeObjectPropDesc::NewL( aPropCode );
       
   129             break;
       
   130 
       
   131         // Number of Channels (m)
       
   132         case EMTPObjectPropCodeNumberOfChannels:
       
   133             propertyDesc = NewNumberOfChannelsPropDescL();
       
   134             break;
       
   135 
       
   136         // Sample Rate (HAS MINIMUM AND MAX VALUE)
       
   137         case EMTPObjectPropCodeSampleRate:
       
   138             propertyDesc = NewCodeSampleRatePropDescL();
       
   139             break;
       
   140 
       
   141         // Audio Wave Codec (MAY REQUIRED LIMITED NUMBER TO BE PRODUCED)
       
   142         case EMTPObjectPropCodeAudioWAVECodec:
       
   143             propertyDesc = NewAudioWaveCodecPropDescL( aFormatCode );
       
   144             break;
       
   145 
       
   146         // Audio Bit Rate (MAY REQUIRED LIMITED NUMBER TO BE PRODUCED)
       
   147         case EMTPObjectPropCodeAudioBitRate:
       
   148             propertyDesc = NewAudioBitratePropDescL( aFormatCode );
       
   149             break;
       
   150 
       
   151         // Duration
       
   152         case EMTPObjectPropCodeDuration:
       
   153             propertyDesc = NewRangeFormDescriptionL( aPropCode,
       
   154                 EMTPMinDuration,
       
   155                 EMTPMaxDuration,
       
   156                 EMTPDurationStep );
       
   157             break;
       
   158 
       
   159         // Description
       
   160         case EMTPObjectPropCodeDescription:
       
   161             propertyDesc = NewDescriptionPropDescL();
       
   162             break;
       
   163 
       
   164         case EMTPObjectPropCodeWidth:
       
   165             propertyDesc = NewRangeFormDescriptionL( aPropCode,
       
   166                 EMTPMinWidth,
       
   167                 EMTPMaxWidth,
       
   168                 EMTPStepWidth );
       
   169             break;
       
   170 
       
   171         case EMTPObjectPropCodeHeight:
       
   172             propertyDesc = NewRangeFormDescriptionL( aPropCode,
       
   173                 EMTPMinHeight,
       
   174                 EMTPMaxHeight,
       
   175                 EMTPStepHeight );
       
   176             break;
       
   177 
       
   178         case EMTPObjectPropCodeScanType:
       
   179             propertyDesc = NewScanTypeDescriptionPropDescL();
       
   180             break;
       
   181 
       
   182         case EMTPObjectPropCodeVideoFourCCCodec:
       
   183             propertyDesc = NewVideoFourCCCodecPropDescL( aFormatCode );
       
   184             break;
       
   185 
       
   186         case EMTPObjectPropCodeVideoBitRate:
       
   187             propertyDesc = NewVideoBitratePropDescL( aFormatCode );
       
   188             break;
       
   189 
       
   190         case EMTPObjectPropCodeFramesPerThousandSeconds:
       
   191             propertyDesc = NewRangeFormDescriptionL( aPropCode,
       
   192                 EMTPMinFramesPerThousandSeconds,
       
   193                 EMTPMaxFramesPerThousandSeconds,
       
   194                 EMTPStepFramesPerThousandSeconds );
       
   195             break;
       
   196 
       
   197         case EMTPObjectPropCodeKeyFrameDistance:
       
   198             propertyDesc = NewRangeFormDescriptionL( aPropCode,
       
   199                 EMTPMinKeyFrameDistance,
       
   200                 EMTPMaxKeyFrameDistance,
       
   201                 EMTPStepKeyFrameDistance );
       
   202             break;
       
   203 
       
   204         case EMTPObjectPropCodeEncodingProfile:
       
   205             propertyDesc = NewEncodingProfileDescriptionPropDescL();
       
   206             break;
       
   207 
       
   208         case EMTPObjectPropCodeDRMStatus:
       
   209             propertyDesc = NewDRMStatusPropDescL();
       
   210             break;
       
   211 
       
   212         case EMTPExtObjectPropCodeOmaDrmStatus:
       
   213             propertyDesc = NewOMADRMStatusPropDescL();
       
   214             break;
       
   215 
       
   216         default:
       
   217             // do nothing
       
   218             break;
       
   219         }
       
   220     return propertyDesc;
       
   221     }
       
   222 
       
   223 // -----------------------------------------------------------------------------
       
   224 // CMediaMtpDataProviderDescriptionUtility::NewAudioWaveCodecPropDescL
       
   225 // Construct audio wave codec property description.
       
   226 // -----------------------------------------------------------------------------
       
   227 //
       
   228 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewAudioWaveCodecPropDescL( TUint aFormatCode )
       
   229     {
       
   230     CMTPTypeObjectPropDescEnumerationForm* form =
       
   231         CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 );    // + form
       
   232 
       
   233     switch( aFormatCode )
       
   234         {
       
   235         case EMTPFormatCodeWMA:
       
   236         case EMTPFormatCodeWMV:
       
   237         case EMTPFormatCodeASF:
       
   238             form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecWMA ) );
       
   239             break;
       
   240 
       
   241         case EMTPFormatCodeMP3:
       
   242             form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecMP3 ) );
       
   243             break;
       
   244 
       
   245         case EMTPFormatCodeMP4Container:
       
   246         case EMTPFormatCode3GPContainer:
       
   247         case EMTPFormatCodeAAC:
       
   248             form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecAAC ) );
       
   249             break;
       
   250 
       
   251         case EMTPFormatCodeWAV:
       
   252             form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecPCM ) );
       
   253             break;
       
   254 
       
   255         default:
       
   256             User::Leave( KErrNotSupported );
       
   257             break;
       
   258         }
       
   259 
       
   260     CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeAudioWAVECodec, *form );
       
   261 
       
   262     CleanupStack::PopAndDestroy( form ); // - form
       
   263     PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewAudioWaveCodecPropDescL" ) );
       
   264 
       
   265     return propertyDesc;
       
   266     }
       
   267 
       
   268 // -----------------------------------------------------------------------------
       
   269 // CMediaMtpDataProviderDescriptionUtility::NewAudioBitratePropDescL
       
   270 // Construct audio bitrate property description.
       
   271 // -----------------------------------------------------------------------------
       
   272 //
       
   273 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewAudioBitratePropDescL( TUint aFormatCode )
       
   274     {
       
   275     PRINT1( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewAudioBitratePropDescL, iFormatCode = 0x%x" ), aFormatCode );
       
   276     CMTPTypeObjectPropDesc* propertyDesc = NULL;
       
   277     switch( aFormatCode )
       
   278         {
       
   279         case EMTPFormatCodeWMA:
       
   280         case EMTPFormatCodeWMV:
       
   281         case EMTPFormatCodeASF:
       
   282             propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate,
       
   283                 EMTPWMAMinBitrate,
       
   284                 EMTPWMAMaxBitrate,
       
   285                 EMTPAudioBitrateStep );
       
   286             break;
       
   287 
       
   288         case EMTPFormatCodeMP3:
       
   289             propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate,
       
   290                 EMTPMP3MinBitrate,
       
   291                 EMTPMP3MaxBitrate,
       
   292                 EMTPAudioBitrateStep );
       
   293             break;
       
   294 
       
   295         case EMTPFormatCodeAAC:
       
   296             propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate,
       
   297                 EMTPAACMinBitrate,
       
   298                 EMTPAACMaxBitrate,
       
   299                 EMTPAudioBitrateStep );
       
   300             break;
       
   301 
       
   302         case EMTPFormatCodeWAV:
       
   303             propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate,
       
   304                 EMTPPCMMinBitrate,
       
   305                 EMTPPCMMaxBitrate,
       
   306                 EMTPAudioBitrateStep );
       
   307             break;
       
   308 
       
   309         case EMTPFormatCodeMP4Container:
       
   310         case EMTPFormatCode3GPContainer:
       
   311             propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate,
       
   312                 EMTPAACPlusMinBitrate,
       
   313                 EMTPAACPlusMaxBitrate,
       
   314                 EMTPAudioBitrateStep );
       
   315             break;
       
   316 
       
   317         default:
       
   318             // do nothing
       
   319             break;
       
   320         }
       
   321     PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewAudioBitratePropDescL" ) );
       
   322 
       
   323     return propertyDesc;
       
   324     }
       
   325 
       
   326 // -----------------------------------------------------------------------------
       
   327 // CMediaMtpDataProviderDescriptionUtility::NewVideoFourCCCodecPropDescL
       
   328 // Construct property description of video fourCC codec.
       
   329 // -----------------------------------------------------------------------------
       
   330 //
       
   331 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewVideoFourCCCodecPropDescL( TUint aFormatCode )
       
   332     {
       
   333     PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewVideoFourCCCodecPropDescL" ) );
       
   334 
       
   335     CMTPTypeObjectPropDesc* propertyDesc = NULL;
       
   336 
       
   337     if ( ( EMTPFormatCodeWMV == aFormatCode )
       
   338         || ( EMTPFormatCodeASF == aFormatCode ) )
       
   339         {
       
   340         CMTPTypeObjectPropDescEnumerationForm* expectedForm =
       
   341             CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + expectedForm
       
   342 
       
   343         TUint32 values[] =
       
   344             {
       
   345             EMTPVideoFourCCCodecWMV3
       
   346             };
       
   347 
       
   348         TInt numValues = sizeof( values ) / sizeof( values[0] );
       
   349         for ( TInt i = 0; i < numValues; i++ )
       
   350             {
       
   351             TMTPTypeUint32 data( values[i] );
       
   352             expectedForm->AppendSupportedValueL( data );
       
   353             }
       
   354 
       
   355         propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeVideoFourCCCodec,
       
   356             *expectedForm );
       
   357 
       
   358         CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm
       
   359         }
       
   360 
       
   361     PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewVideoFourCCCodecPropDescL" ) );
       
   362     return propertyDesc;
       
   363     }
       
   364 
       
   365 // -----------------------------------------------------------------------------
       
   366 // CMediaMtpDataProviderDescriptionUtility::NewVideoBitratePropDescL
       
   367 // Construct property description of VideoBitrate.
       
   368 // -----------------------------------------------------------------------------
       
   369 //
       
   370 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewVideoBitratePropDescL( TUint aFormatCode )
       
   371     {
       
   372     PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewVideoBitratePropDescL" ) );
       
   373 
       
   374     CMTPTypeObjectPropDesc* propertyDesc = NULL;
       
   375 
       
   376     if ( ( EMTPFormatCodeWMV == aFormatCode )
       
   377         || ( EMTPFormatCodeASF == aFormatCode ) )
       
   378         {
       
   379         propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeVideoBitRate,
       
   380             EMTPWMVMinBitrate,
       
   381             EMTPWMVMaxBitrate,
       
   382             EMTPVideoBitrateStep,
       
   383             ETrue );
       
   384         }
       
   385 
       
   386     PRINT( _L( "MM MTP <= MmMtpDpDescriptionUtiliNewviceVideoBitratePropDescL" ) );
       
   387 
       
   388     return propertyDesc;
       
   389     }
       
   390 
       
   391 // -----------------------------------------------------------------------------
       
   392 // CMediaMtpDataProviderDescriptionUtility::NewNumberOfChannelsPropDescL()
       
   393 // Construct property description of number of channels.
       
   394 // -----------------------------------------------------------------------------
       
   395 //
       
   396 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewNumberOfChannelsPropDescL()
       
   397     {
       
   398     PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewNumberOfChannelsPropDescL" ) );
       
   399 
       
   400     CMTPTypeObjectPropDescEnumerationForm* expectedForm =
       
   401         CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm
       
   402 
       
   403     TUint16 values[] =
       
   404         {
       
   405         EMTPChannelMono,
       
   406         EMTPChannelStereo
       
   407         };
       
   408 
       
   409     TInt numValues = sizeof( values ) / sizeof( values[0] );
       
   410     for ( TInt i = 0; i < numValues; i++ )
       
   411         {
       
   412         TMTPTypeUint16 data( values[i] );
       
   413         expectedForm->AppendSupportedValueL( data );
       
   414         }
       
   415 
       
   416     CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeNumberOfChannels,
       
   417         *expectedForm );
       
   418 
       
   419     CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm
       
   420 
       
   421     PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewNumberOfChannelsPropDescL" ) );
       
   422 
       
   423     return propertyDesc;
       
   424     }
       
   425 
       
   426 // -----------------------------------------------------------------------------
       
   427 // CMediaMtpDataProviderDescriptionUtility::NewCodeSampleRatePropDescL
       
   428 // Construct property description of code sample rate.
       
   429 // -----------------------------------------------------------------------------
       
   430 //
       
   431 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewCodeSampleRatePropDescL()
       
   432     {
       
   433     PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewCodeSampleRatePropDescL" ) );
       
   434 
       
   435     CMTPTypeObjectPropDescEnumerationForm* expectedForm =
       
   436         CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + expectedForm
       
   437 
       
   438     TUint32 values[] =
       
   439         {
       
   440             EMTPSampleRate8K,
       
   441             EMTPSampleRate16K,
       
   442             EMTPSampleRate22_05K,
       
   443             EMTPSampleRate24K,
       
   444             EMTPSampleRate32K,
       
   445             EMTPSampleRate44_1K,
       
   446             EMTPSampleRate48K
       
   447         };
       
   448 
       
   449     TInt numValues = sizeof( values ) / sizeof( values[0] );
       
   450     for ( TInt i = 0; i < numValues; i++ )
       
   451         {
       
   452         TMTPTypeUint32 data( values[i] );
       
   453         expectedForm->AppendSupportedValueL( data );
       
   454         }
       
   455 
       
   456     CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeSampleRate,
       
   457         CMTPTypeObjectPropDesc::EEnumerationForm,
       
   458         expectedForm );
       
   459 
       
   460     CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm
       
   461 
       
   462     PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewCodeSampleRatePropDescL" ) );
       
   463 
       
   464     return propertyDesc;
       
   465     }
       
   466 
       
   467 // -----------------------------------------------------------------------------
       
   468 // CMediaMtpDataProviderDescriptionUtility::NewDescriptionPropDescL()
       
   469 // Construct property description of description.
       
   470 // -----------------------------------------------------------------------------
       
   471 //
       
   472 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewDescriptionPropDescL()
       
   473     {
       
   474     PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewDescriptionPropDescL" ) );
       
   475 
       
   476     TMTPTypeUint32 uint32Data( KMTPMaxDescriptionLen );
       
   477     CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeDescription,
       
   478         CMTPTypeObjectPropDesc::ELongStringForm,
       
   479         &uint32Data );
       
   480 
       
   481     PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewDescriptionPropDescL" ) );
       
   482 
       
   483     return propertyDesc;
       
   484     }
       
   485 
       
   486 // -----------------------------------------------------------------------------
       
   487 // CMediaMtpDataProviderDescriptionUtility::NewScanTypeDescriptionPropDescL
       
   488 // Construct property description of scan type description.
       
   489 // -----------------------------------------------------------------------------
       
   490 //
       
   491 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewScanTypeDescriptionPropDescL()
       
   492     {
       
   493     PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewScanTypeDescriptionPropDescL" ) );
       
   494 
       
   495     CMTPTypeObjectPropDescEnumerationForm* expectedForm =
       
   496         CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm
       
   497 
       
   498     TUint16 values[] =
       
   499         {
       
   500         EMTPScanTypeProgressive
       
   501         };
       
   502 
       
   503     TInt numValues = sizeof( values ) / sizeof( values[0] );
       
   504     for ( TInt i = 0; i < numValues; i++ )
       
   505         {
       
   506         TMTPTypeUint16 data( values[i] );
       
   507         expectedForm->AppendSupportedValueL( data );
       
   508         }
       
   509 
       
   510     CMTPTypeObjectPropDesc* propertyDesc = NULL;
       
   511     propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeScanType,
       
   512         *expectedForm );
       
   513 
       
   514     CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm
       
   515 
       
   516     PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewScanTypeDescriptionPropDescL" ) );
       
   517 
       
   518     return propertyDesc;
       
   519     }
       
   520 
       
   521 // -----------------------------------------------------------------------------
       
   522 // CMediaMtpDataProviderDescriptionUtility::NewEncodingProfileDescriptionPropDescL
       
   523 // Construct property description of encoding profile description.
       
   524 // -----------------------------------------------------------------------------
       
   525 //
       
   526 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewEncodingProfileDescriptionPropDescL()
       
   527     {
       
   528     PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewEncodingProfileDescriptionPropDescL" ) );
       
   529 
       
   530     CMTPTypeObjectPropDescEnumerationForm* expectedForm =
       
   531         CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeString ); // + expectedForm
       
   532 
       
   533     CMTPTypeString* string = CMTPTypeString::NewLC( _L( "SP@LL" ) );    // + string
       
   534     expectedForm->AppendSupportedValueL( *string );
       
   535     string->SetL( _L("SP@ML"));
       
   536     expectedForm->AppendSupportedValueL( *string );
       
   537     string->SetL( _L("MP@LL"));
       
   538     expectedForm->AppendSupportedValueL( *string );
       
   539 
       
   540     // newly added to support 720p content as suggested by Helix team
       
   541     string->SetL( _L("MP@ML"));
       
   542     expectedForm->AppendSupportedValueL( *string );
       
   543     string->SetL( _L("MP@HL"));
       
   544     expectedForm->AppendSupportedValueL( *string );
       
   545 
       
   546     CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo;
       
   547     propertyInfo.iDataType = EMTPTypeString;
       
   548     propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm;
       
   549     propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadWrite;
       
   550 
       
   551     CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeEncodingProfile,
       
   552             propertyInfo,
       
   553             expectedForm );
       
   554 
       
   555     CleanupStack::PopAndDestroy( string );       // - string
       
   556     CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm
       
   557 
       
   558     PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewEncodingProfileDescriptionPropDescL" ) );
       
   559 
       
   560     return propertyDesc;
       
   561     }
       
   562 
       
   563 // -----------------------------------------------------------------------------
       
   564 // CMediaMtpDataProviderDescriptionUtility::NewDRMStatusPropDescL
       
   565 // Construct property description of DRM status.
       
   566 // -----------------------------------------------------------------------------
       
   567 //
       
   568 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewDRMStatusPropDescL()
       
   569     {
       
   570     PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewDRMStatusPropDescL" ) );
       
   571 
       
   572     CMTPTypeObjectPropDescEnumerationForm* expectedForm =
       
   573         CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm
       
   574 
       
   575     TUint16 values[] =
       
   576         {
       
   577         EMTPDrmNoProtection,
       
   578         EMTPDrmProtection,
       
   579         EMTPDrmReserveForMTP,
       
   580         EMTPDrmVenderExtension
       
   581         };
       
   582 
       
   583     TInt numValues = sizeof( values ) / sizeof( values[0] );
       
   584     for ( TInt i = 0; i < numValues; i++ )
       
   585         {
       
   586         TMTPTypeUint16 data( values[i] );
       
   587         expectedForm->AppendSupportedValueL( data );
       
   588         }
       
   589 
       
   590     CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeDRMStatus,
       
   591         *expectedForm );
       
   592 
       
   593     CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm
       
   594 
       
   595     PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewDRMStatusPropDescL" ) );
       
   596 
       
   597     return propertyDesc;
       
   598     }
       
   599 
       
   600 // -----------------------------------------------------------------------------
       
   601 // CMediaMtpDataProviderDescriptionUtility::NewOMADRMStatusPropDescL
       
   602 // Construct property description of OMADRM status.
       
   603 // -----------------------------------------------------------------------------
       
   604 //
       
   605 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewOMADRMStatusPropDescL()
       
   606     {
       
   607     PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::NewOMADRMStatusPropDescL" ) );
       
   608 
       
   609     CMTPTypeObjectPropDescEnumerationForm* expectedForm =
       
   610         CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT8 );  // + expectedForm
       
   611 
       
   612     TUint8 values[] =
       
   613         {
       
   614         EMTPOMADrmNoProtection,
       
   615         EMTPOMADrmProtection,
       
   616         };
       
   617 
       
   618     TInt numValues = sizeof( values ) / sizeof( values[0] );
       
   619     for ( TInt i = 0; i < numValues; i++ )
       
   620         {
       
   621         TMTPTypeUint8 data( values[i] );
       
   622         expectedForm->AppendSupportedValueL( data );
       
   623         }
       
   624 
       
   625     CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo;
       
   626     propertyInfo.iDataType = EMTPTypeUINT8;
       
   627     propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm;
       
   628 
       
   629     CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPExtObjectPropCodeOmaDrmStatus,
       
   630         propertyInfo,
       
   631         expectedForm );
       
   632 
       
   633     CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm
       
   634 
       
   635     PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::NewOMADRMStatusPropDescL" ) );
       
   636 
       
   637     return propertyDesc;
       
   638     }
       
   639 
       
   640 // end of file