|
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 "mmmtpdpconfig.h" |
|
25 #include "mmmtpdplogger.h" |
|
26 |
|
27 const TUint32 KMTPDescriptionLen = 0x00000200; |
|
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 EMTPObjectPropCodeUseCount: // Use Count |
|
124 case EMTPObjectPropCodeAlbumName: // Album Name |
|
125 case EMTPObjectPropCodeAlbumArtist: // Album Artist |
|
126 case EMTPObjectPropCodeOriginalReleaseDate: // Original Release Date |
|
127 case EMTPObjectPropCodeComposer: // Composer |
|
128 case EMTPObjectPropCodeParentalRating: |
|
129 propertyDesc = CMTPTypeObjectPropDesc::NewL( aPropCode ); |
|
130 break; |
|
131 |
|
132 // Number of Channels (m) |
|
133 case EMTPObjectPropCodeNumberOfChannels: |
|
134 propertyDesc = NewNumberOfChannelsPropDescL(); |
|
135 break; |
|
136 |
|
137 // Sample Rate (HAS MINIMUM AND MAX VALUE) |
|
138 case EMTPObjectPropCodeSampleRate: |
|
139 propertyDesc = NewCodeSampleRatePropDescL(); |
|
140 break; |
|
141 |
|
142 // Audio Wave Codec (MAY REQUIRED LIMITED NUMBER TO BE PRODUCED) |
|
143 case EMTPObjectPropCodeAudioWAVECodec: |
|
144 propertyDesc = NewAudioWaveCodecPropDescL( aFormatCode ); |
|
145 break; |
|
146 |
|
147 // Audio Bit Rate (MAY REQUIRED LIMITED NUMBER TO BE PRODUCED) |
|
148 case EMTPObjectPropCodeAudioBitRate: |
|
149 propertyDesc = NewAudioBitratePropDescL( aFormatCode ); |
|
150 break; |
|
151 |
|
152 // Duration |
|
153 case EMTPObjectPropCodeDuration: |
|
154 propertyDesc = NewRangeFormDescriptionL( aPropCode, |
|
155 EMTPMinDuration, |
|
156 EMTPMaxDuration, |
|
157 EMTPDurationStep ); |
|
158 break; |
|
159 |
|
160 // Description |
|
161 case EMTPObjectPropCodeDescription: |
|
162 propertyDesc = NewDescriptionPropDescL(); |
|
163 break; |
|
164 |
|
165 case EMTPObjectPropCodeWidth: |
|
166 propertyDesc = NewRangeFormDescriptionL( aPropCode, |
|
167 EMTPMinWidth, |
|
168 EMTPMaxWidth, |
|
169 EMTPStepWidth ); |
|
170 break; |
|
171 |
|
172 case EMTPObjectPropCodeHeight: |
|
173 propertyDesc = NewRangeFormDescriptionL( aPropCode, |
|
174 EMTPMinHeight, |
|
175 EMTPMaxHeight, |
|
176 EMTPStepHeight ); |
|
177 break; |
|
178 |
|
179 case EMTPObjectPropCodeScanType: |
|
180 propertyDesc = NewScanTypeDescriptionPropDescL(); |
|
181 break; |
|
182 |
|
183 case EMTPObjectPropCodeVideoFourCCCodec: |
|
184 propertyDesc = NewVideoFourCCCodecPropDescL( aFormatCode ); |
|
185 break; |
|
186 |
|
187 case EMTPObjectPropCodeVideoBitRate: |
|
188 propertyDesc = NewVideoBitratePropDescL( aFormatCode ); |
|
189 break; |
|
190 |
|
191 case EMTPObjectPropCodeFramesPerThousandSeconds: |
|
192 propertyDesc = NewRangeFormDescriptionL( aPropCode, |
|
193 EMTPMinFramesPerThousandSeconds, |
|
194 EMTPMaxFramesPerThousandSeconds, |
|
195 EMTPStepFramesPerThousandSeconds ); |
|
196 break; |
|
197 |
|
198 case EMTPObjectPropCodeKeyFrameDistance: |
|
199 propertyDesc = NewRangeFormDescriptionL( aPropCode, |
|
200 EMTPMinKeyFrameDistance, |
|
201 EMTPMaxKeyFrameDistance, |
|
202 EMTPStepKeyFrameDistance ); |
|
203 break; |
|
204 |
|
205 case EMTPObjectPropCodeEncodingProfile: |
|
206 propertyDesc = NewEncodingProfileDescriptionPropDescL(); |
|
207 break; |
|
208 |
|
209 case EMTPObjectPropCodeDRMStatus: |
|
210 propertyDesc = NewDRMStatusPropDescL(); |
|
211 break; |
|
212 |
|
213 case EMTPExtObjectPropCodeOmaDrmStatus: |
|
214 propertyDesc = NewOMADRMStatusPropDescL(); |
|
215 break; |
|
216 |
|
217 default: |
|
218 // do nothing |
|
219 break; |
|
220 } |
|
221 return propertyDesc; |
|
222 } |
|
223 |
|
224 // ----------------------------------------------------------------------------- |
|
225 // CMediaMtpDataProviderDescriptionUtility::NewAudioWaveCodecPropDescL |
|
226 // Construct audio wave codec property description. |
|
227 // ----------------------------------------------------------------------------- |
|
228 // |
|
229 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewAudioWaveCodecPropDescL( TUint aFormatCode ) |
|
230 { |
|
231 CMTPTypeObjectPropDescEnumerationForm* form = |
|
232 CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + form |
|
233 |
|
234 switch( aFormatCode ) |
|
235 { |
|
236 case EMTPFormatCodeWMA: |
|
237 case EMTPFormatCodeWMV: |
|
238 case EMTPFormatCodeASF: |
|
239 form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecWMA ) ); |
|
240 break; |
|
241 |
|
242 case EMTPFormatCodeMP3: |
|
243 form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecMP3 ) ); |
|
244 break; |
|
245 |
|
246 case EMTPFormatCodeMP4Container: |
|
247 case EMTPFormatCode3GPContainer: |
|
248 case EMTPFormatCodeAAC: |
|
249 form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecAAC ) ); |
|
250 break; |
|
251 |
|
252 case EMTPFormatCodeWAV: |
|
253 form->AppendSupportedValueL( TMTPTypeUint32( EMTPAudioWAVECodecPCM ) ); |
|
254 break; |
|
255 |
|
256 default: |
|
257 User::Leave( KErrNotSupported ); |
|
258 break; |
|
259 } |
|
260 |
|
261 CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeAudioWAVECodec, *form ); |
|
262 |
|
263 CleanupStack::PopAndDestroy( form ); // - form |
|
264 PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewAudioWaveCodecPropDescL" ) ); |
|
265 |
|
266 return propertyDesc; |
|
267 } |
|
268 |
|
269 // ----------------------------------------------------------------------------- |
|
270 // CMediaMtpDataProviderDescriptionUtility::NewAudioBitratePropDescL |
|
271 // Construct audio bitrate property description. |
|
272 // ----------------------------------------------------------------------------- |
|
273 // |
|
274 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewAudioBitratePropDescL( TUint aFormatCode ) |
|
275 { |
|
276 PRINT1( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewAudioBitratePropDescL, iFormatCode = 0x%x" ), aFormatCode ); |
|
277 CMTPTypeObjectPropDesc* propertyDesc = NULL; |
|
278 switch( aFormatCode ) |
|
279 { |
|
280 case EMTPFormatCodeWMA: |
|
281 case EMTPFormatCodeWMV: |
|
282 case EMTPFormatCodeASF: |
|
283 propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, |
|
284 EMTPWMAMinBitrate, |
|
285 EMTPWMAMaxBitrate, |
|
286 EMTPAudioBitrateStep ); |
|
287 break; |
|
288 |
|
289 case EMTPFormatCodeMP3: |
|
290 propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, |
|
291 EMTPMP3MinBitrate, |
|
292 EMTPMP3MaxBitrate, |
|
293 EMTPAudioBitrateStep ); |
|
294 break; |
|
295 |
|
296 case EMTPFormatCodeAAC: |
|
297 propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, |
|
298 EMTPAACMinBitrate, |
|
299 EMTPAACMaxBitrate, |
|
300 EMTPAudioBitrateStep ); |
|
301 break; |
|
302 |
|
303 case EMTPFormatCodeWAV: |
|
304 propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, |
|
305 EMTPPCMMinBitrate, |
|
306 EMTPPCMMaxBitrate, |
|
307 EMTPAudioBitrateStep ); |
|
308 break; |
|
309 |
|
310 case EMTPFormatCodeMP4Container: |
|
311 case EMTPFormatCode3GPContainer: |
|
312 propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeAudioBitRate, |
|
313 EMTPAACPlusMinBitrate, |
|
314 EMTPAACPlusMaxBitrate, |
|
315 EMTPAudioBitrateStep ); |
|
316 break; |
|
317 |
|
318 default: |
|
319 // do nothing |
|
320 break; |
|
321 } |
|
322 PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewAudioBitratePropDescL" ) ); |
|
323 |
|
324 return propertyDesc; |
|
325 } |
|
326 |
|
327 // ----------------------------------------------------------------------------- |
|
328 // CMediaMtpDataProviderDescriptionUtility::NewVideoFourCCCodecPropDescL |
|
329 // Construct property description of video fourCC codec. |
|
330 // ----------------------------------------------------------------------------- |
|
331 // |
|
332 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewVideoFourCCCodecPropDescL( TUint aFormatCode ) |
|
333 { |
|
334 PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewVideoFourCCCodecPropDescL" ) ); |
|
335 |
|
336 CMTPTypeObjectPropDesc* propertyDesc = NULL; |
|
337 |
|
338 if ( ( EMTPFormatCodeWMV == aFormatCode ) |
|
339 || ( EMTPFormatCodeASF == aFormatCode ) ) |
|
340 { |
|
341 CMTPTypeObjectPropDescEnumerationForm* expectedForm = |
|
342 CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + expectedForm |
|
343 |
|
344 TUint32 values[] = |
|
345 { |
|
346 EMTPVideoFourCCCodecWMV3 |
|
347 }; |
|
348 |
|
349 TInt numValues = sizeof( values ) / sizeof( values[0] ); |
|
350 for ( TInt i = 0; i < numValues; i++ ) |
|
351 { |
|
352 TMTPTypeUint32 data( values[i] ); |
|
353 expectedForm->AppendSupportedValueL( data ); |
|
354 } |
|
355 |
|
356 propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeVideoFourCCCodec, |
|
357 *expectedForm ); |
|
358 |
|
359 CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm |
|
360 } |
|
361 |
|
362 PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewVideoFourCCCodecPropDescL" ) ); |
|
363 return propertyDesc; |
|
364 } |
|
365 |
|
366 // ----------------------------------------------------------------------------- |
|
367 // CMediaMtpDataProviderDescriptionUtility::NewVideoBitratePropDescL |
|
368 // Construct property description of VideoBitrate. |
|
369 // ----------------------------------------------------------------------------- |
|
370 // |
|
371 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewVideoBitratePropDescL( TUint aFormatCode ) |
|
372 { |
|
373 PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewVideoBitratePropDescL" ) ); |
|
374 |
|
375 CMTPTypeObjectPropDesc* propertyDesc = NULL; |
|
376 |
|
377 if ( ( EMTPFormatCodeWMV == aFormatCode ) |
|
378 || ( EMTPFormatCodeASF == aFormatCode ) ) |
|
379 { |
|
380 propertyDesc = NewRangeFormDescriptionL( EMTPObjectPropCodeVideoBitRate, |
|
381 EMTPWMVMinBitrate, |
|
382 EMTPWMVMaxBitrate, |
|
383 EMTPVideoBitrateStep, |
|
384 ETrue ); |
|
385 } |
|
386 |
|
387 PRINT( _L( "MM MTP <= MmMtpDpDescriptionUtiliNewviceVideoBitratePropDescL" ) ); |
|
388 |
|
389 return propertyDesc; |
|
390 } |
|
391 |
|
392 // ----------------------------------------------------------------------------- |
|
393 // CMediaMtpDataProviderDescriptionUtility::NewNumberOfChannelsPropDescL() |
|
394 // Construct property description of number of channels. |
|
395 // ----------------------------------------------------------------------------- |
|
396 // |
|
397 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewNumberOfChannelsPropDescL() |
|
398 { |
|
399 PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewNumberOfChannelsPropDescL" ) ); |
|
400 |
|
401 CMTPTypeObjectPropDescEnumerationForm* expectedForm = |
|
402 CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm |
|
403 |
|
404 TUint16 values[] = |
|
405 { |
|
406 EMTPChannelMono, |
|
407 EMTPChannelStereo |
|
408 }; |
|
409 |
|
410 TInt numValues = sizeof( values ) / sizeof( values[0] ); |
|
411 for ( TInt i = 0; i < numValues; i++ ) |
|
412 { |
|
413 TMTPTypeUint16 data( values[i] ); |
|
414 expectedForm->AppendSupportedValueL( data ); |
|
415 } |
|
416 |
|
417 CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeNumberOfChannels, |
|
418 *expectedForm ); |
|
419 |
|
420 CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm |
|
421 |
|
422 PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewNumberOfChannelsPropDescL" ) ); |
|
423 |
|
424 return propertyDesc; |
|
425 } |
|
426 |
|
427 // ----------------------------------------------------------------------------- |
|
428 // CMediaMtpDataProviderDescriptionUtility::NewCodeSampleRatePropDescL |
|
429 // Construct property description of code sample rate. |
|
430 // ----------------------------------------------------------------------------- |
|
431 // |
|
432 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewCodeSampleRatePropDescL() |
|
433 { |
|
434 PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewCodeSampleRatePropDescL" ) ); |
|
435 |
|
436 CMTPTypeObjectPropDescEnumerationForm* expectedForm = |
|
437 CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT32 ); // + expectedForm |
|
438 |
|
439 TUint32 values[] = |
|
440 { |
|
441 EMTPSampleRate8K, |
|
442 EMTPSampleRate16K, |
|
443 EMTPSampleRate22_05K, |
|
444 EMTPSampleRate24K, |
|
445 EMTPSampleRate32K, |
|
446 EMTPSampleRate44_1K, |
|
447 EMTPSampleRate48K |
|
448 }; |
|
449 |
|
450 TInt numValues = sizeof( values ) / sizeof( values[0] ); |
|
451 for ( TInt i = 0; i < numValues; i++ ) |
|
452 { |
|
453 TMTPTypeUint32 data( values[i] ); |
|
454 expectedForm->AppendSupportedValueL( data ); |
|
455 } |
|
456 |
|
457 CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeSampleRate, |
|
458 CMTPTypeObjectPropDesc::EEnumerationForm, |
|
459 expectedForm ); |
|
460 |
|
461 CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm |
|
462 |
|
463 PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewCodeSampleRatePropDescL" ) ); |
|
464 |
|
465 return propertyDesc; |
|
466 } |
|
467 |
|
468 // ----------------------------------------------------------------------------- |
|
469 // CMediaMtpDataProviderDescriptionUtility::NewDescriptionPropDescL() |
|
470 // Construct property description of description. |
|
471 // ----------------------------------------------------------------------------- |
|
472 // |
|
473 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewDescriptionPropDescL() |
|
474 { |
|
475 PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewDescriptionPropDescL" ) ); |
|
476 |
|
477 TMTPTypeUint32 uint32Data( KMTPDescriptionLen ); |
|
478 CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeDescription, |
|
479 CMTPTypeObjectPropDesc::ELongStringForm, |
|
480 &uint32Data ); |
|
481 |
|
482 PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewDescriptionPropDescL" ) ); |
|
483 |
|
484 return propertyDesc; |
|
485 } |
|
486 |
|
487 // ----------------------------------------------------------------------------- |
|
488 // CMediaMtpDataProviderDescriptionUtility::NewScanTypeDescriptionPropDescL |
|
489 // Construct property description of scan type description. |
|
490 // ----------------------------------------------------------------------------- |
|
491 // |
|
492 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewScanTypeDescriptionPropDescL() |
|
493 { |
|
494 PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewScanTypeDescriptionPropDescL" ) ); |
|
495 |
|
496 CMTPTypeObjectPropDescEnumerationForm* expectedForm = |
|
497 CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm |
|
498 |
|
499 TUint16 values[] = |
|
500 { |
|
501 EMTPScanTypeProgressive |
|
502 }; |
|
503 |
|
504 TInt numValues = sizeof( values ) / sizeof( values[0] ); |
|
505 for ( TInt i = 0; i < numValues; i++ ) |
|
506 { |
|
507 TMTPTypeUint16 data( values[i] ); |
|
508 expectedForm->AppendSupportedValueL( data ); |
|
509 } |
|
510 |
|
511 CMTPTypeObjectPropDesc* propertyDesc = NULL; |
|
512 propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeScanType, |
|
513 *expectedForm ); |
|
514 |
|
515 CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm |
|
516 |
|
517 PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewScanTypeDescriptionPropDescL" ) ); |
|
518 |
|
519 return propertyDesc; |
|
520 } |
|
521 |
|
522 // ----------------------------------------------------------------------------- |
|
523 // CMediaMtpDataProviderDescriptionUtility::NewEncodingProfileDescriptionPropDescL |
|
524 // Construct property description of encoding profile description. |
|
525 // ----------------------------------------------------------------------------- |
|
526 // |
|
527 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewEncodingProfileDescriptionPropDescL() |
|
528 { |
|
529 PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewEncodingProfileDescriptionPropDescL" ) ); |
|
530 |
|
531 CMTPTypeObjectPropDescEnumerationForm* expectedForm = |
|
532 CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeString ); // + expectedForm |
|
533 |
|
534 CMTPTypeString* string = CMTPTypeString::NewLC( _L( "SP@LL" ) ); // + string |
|
535 expectedForm->AppendSupportedValueL( *string ); |
|
536 string->SetL( _L("SP@ML")); |
|
537 expectedForm->AppendSupportedValueL( *string ); |
|
538 string->SetL( _L("MP@LL")); |
|
539 expectedForm->AppendSupportedValueL( *string ); |
|
540 |
|
541 CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; |
|
542 propertyInfo.iDataType = EMTPTypeString; |
|
543 propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm; |
|
544 propertyInfo.iGetSet = CMTPTypeObjectPropDesc::EReadWrite; |
|
545 |
|
546 CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeEncodingProfile, |
|
547 propertyInfo, |
|
548 expectedForm ); |
|
549 |
|
550 CleanupStack::PopAndDestroy( string ); // - string |
|
551 CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm |
|
552 |
|
553 PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewEncodingProfileDescriptionPropDescL" ) ); |
|
554 |
|
555 return propertyDesc; |
|
556 } |
|
557 |
|
558 // ----------------------------------------------------------------------------- |
|
559 // CMediaMtpDataProviderDescriptionUtility::NewDRMStatusPropDescL |
|
560 // Construct property description of DRM status. |
|
561 // ----------------------------------------------------------------------------- |
|
562 // |
|
563 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewDRMStatusPropDescL() |
|
564 { |
|
565 PRINT( _L( "MM MTP => CMediaMtpDataProviderDescriptionUtility::NewDRMStatusPropDescL" ) ); |
|
566 |
|
567 CMTPTypeObjectPropDescEnumerationForm* expectedForm = |
|
568 CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT16 ); // + expectedForm |
|
569 |
|
570 TUint16 values[] = |
|
571 { |
|
572 EMTPDrmNoProtection, |
|
573 EMTPDrmProtection, |
|
574 EMTPDrmReserveForMTP, |
|
575 EMTPDrmVenderExtension |
|
576 }; |
|
577 |
|
578 TInt numValues = sizeof( values ) / sizeof( values[0] ); |
|
579 for ( TInt i = 0; i < numValues; i++ ) |
|
580 { |
|
581 TMTPTypeUint16 data( values[i] ); |
|
582 expectedForm->AppendSupportedValueL( data ); |
|
583 } |
|
584 |
|
585 CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPObjectPropCodeDRMStatus, |
|
586 *expectedForm ); |
|
587 |
|
588 CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm |
|
589 |
|
590 PRINT( _L( "MM MTP <= CMediaMtpDataProviderDescriptionUtility::NewDRMStatusPropDescL" ) ); |
|
591 |
|
592 return propertyDesc; |
|
593 } |
|
594 |
|
595 // ----------------------------------------------------------------------------- |
|
596 // CMediaMtpDataProviderDescriptionUtility::NewOMADRMStatusPropDescL |
|
597 // Construct property description of OMADRM status. |
|
598 // ----------------------------------------------------------------------------- |
|
599 // |
|
600 CMTPTypeObjectPropDesc* CMediaMtpDataProviderDescriptionUtility::NewOMADRMStatusPropDescL() |
|
601 { |
|
602 PRINT( _L( "MM MTP => CMediaMtpDataProviderGetFormatCapabilities::NewOMADRMStatusPropDescL" ) ); |
|
603 |
|
604 CMTPTypeObjectPropDescEnumerationForm* expectedForm = |
|
605 CMTPTypeObjectPropDescEnumerationForm::NewLC( EMTPTypeUINT8 ); // + expectedForm |
|
606 |
|
607 TUint8 values[] = |
|
608 { |
|
609 EMTPOMADrmNoProtection, |
|
610 EMTPOMADrmProtection, |
|
611 }; |
|
612 |
|
613 TInt numValues = sizeof( values ) / sizeof( values[0] ); |
|
614 for ( TInt i = 0; i < numValues; i++ ) |
|
615 { |
|
616 TMTPTypeUint8 data( values[i] ); |
|
617 expectedForm->AppendSupportedValueL( data ); |
|
618 } |
|
619 |
|
620 CMTPTypeObjectPropDesc::TPropertyInfo propertyInfo; |
|
621 propertyInfo.iDataType = EMTPTypeUINT8; |
|
622 propertyInfo.iFormFlag = CMTPTypeObjectPropDesc::EEnumerationForm; |
|
623 |
|
624 CMTPTypeObjectPropDesc* propertyDesc = CMTPTypeObjectPropDesc::NewL( EMTPExtObjectPropCodeOmaDrmStatus, |
|
625 propertyInfo, |
|
626 expectedForm ); |
|
627 |
|
628 CleanupStack::PopAndDestroy( expectedForm ); // - expectedForm |
|
629 |
|
630 PRINT( _L( "MM MTP <= CMediaMtpDataProviderGetFormatCapabilities::NewOMADRMStatusPropDescL" ) ); |
|
631 |
|
632 return propertyDesc; |
|
633 } |
|
634 |
|
635 // end of file |