24 #include <e32std.h> |
24 #include <e32std.h> |
25 |
25 |
26 #include <mtp/mtpprotocolconstants.h> |
26 #include <mtp/mtpprotocolconstants.h> |
27 #include <comms-infras/commsdebugutility.h> // for __FLOG debugging |
27 #include <comms-infras/commsdebugutility.h> // for __FLOG debugging |
28 |
28 |
29 // for thumb creation |
29 /* |
30 const TUint32 KThumbWidht=160; |
30 * [Thumbnail SIZE]: performance improvement |
31 const TUint32 KThumbHeigth=120; |
31 */ |
|
32 const TUint32 KThumbWidht=104;//avoid to scale width to 160 |
|
33 const TUint32 KThumbHeigth=74;//avoid to scale width to 120 |
32 const TUint32 KThumbCompressedSize=KThumbWidht * KThumbHeigth * 4; // from TNM |
34 const TUint32 KThumbCompressedSize=KThumbWidht * KThumbHeigth * 4; // from TNM |
33 const TUint32 KThumbFormatCode = 0x3801; |
35 const TUint32 KThumbFormatCode = 0x3801; |
34 const TUint32 KFileSizeMax = 10 * 1000 * 1000; |
36 const TUint32 KFileSizeMax = 10 * 1000 * 1000; |
35 |
37 const TUint32 KImageDpNotifyDelay = 1000000 * 15;// set delay time, in microseconds, default is 15s. |
36 _LIT(KJpegMimeType, "image/jpeg"); |
38 |
37 _LIT8(KPtpMimeJPEG, "image/jpeg"); |
39 _LIT8(KPtpMimeJPEG, "image/jpeg"); |
38 |
40 |
39 /** |
41 /** |
40 Define all the operations that are supported by the picture data provider |
42 Define all the operations that are supported by the picture data provider |
41 */ |
43 */ |
93 EMTPObjectPropCodeImageBitDepth, |
95 EMTPObjectPropCodeImageBitDepth, |
94 EMTPObjectPropCodeRepresentativeSampleFormat, |
96 EMTPObjectPropCodeRepresentativeSampleFormat, |
95 EMTPObjectPropCodeRepresentativeSampleSize, |
97 EMTPObjectPropCodeRepresentativeSampleSize, |
96 EMTPObjectPropCodeRepresentativeSampleHeight, |
98 EMTPObjectPropCodeRepresentativeSampleHeight, |
97 EMTPObjectPropCodeRepresentativeSampleWidth, |
99 EMTPObjectPropCodeRepresentativeSampleWidth, |
|
100 EMTPObjectPropCodeRepresentativeSampleData, |
98 EMTPObjectPropCodeNonConsumable |
101 EMTPObjectPropCodeNonConsumable |
99 }; |
102 }; |
100 |
103 |
101 /** |
104 /** |
102 Define the supported property group number . |
105 Define the supported property group number . |
128 EMTPObjectPropCodeHeight, |
131 EMTPObjectPropCodeHeight, |
129 EMTPObjectPropCodeImageBitDepth, |
132 EMTPObjectPropCodeImageBitDepth, |
130 EMTPObjectPropCodeRepresentativeSampleFormat, |
133 EMTPObjectPropCodeRepresentativeSampleFormat, |
131 EMTPObjectPropCodeRepresentativeSampleSize, |
134 EMTPObjectPropCodeRepresentativeSampleSize, |
132 EMTPObjectPropCodeRepresentativeSampleHeight, |
135 EMTPObjectPropCodeRepresentativeSampleHeight, |
133 EMTPObjectPropCodeRepresentativeSampleWidth |
136 EMTPObjectPropCodeRepresentativeSampleWidth, |
|
137 EMTPObjectPropCodeRepresentativeSampleData |
134 }; |
138 }; |
135 |
139 |
136 /** |
140 /** |
137 Define the group one supported property number. |
141 Define the group one supported property number. |
138 */ |
142 */ |
157 struct SMTPValidCodeExtensionMapping |
161 struct SMTPValidCodeExtensionMapping |
158 { |
162 { |
159 public: |
163 public: |
160 TMTPFormatCode iFormatCode; |
164 TMTPFormatCode iFormatCode; |
161 const TText* iExtension; |
165 const TText* iExtension; |
|
166 }; |
|
167 |
|
168 struct SMTPExtensionMimeTypeMapping |
|
169 { |
|
170 public: |
|
171 const TText* iExtension; |
|
172 const TText* iMimeType; |
162 }; |
173 }; |
163 |
174 |
164 // Note when adding extensions: |
175 // Note when adding extensions: |
165 // same value for iExtension can be in the file only once, |
176 // same value for iExtension can be in the file only once, |
166 // values for iFormatCode code can be multiple times |
177 // values for iFormatCode code can be multiple times |
171 #define CASTING(a) ((const TText*)(a)) |
182 #define CASTING(a) ((const TText*)(a)) |
172 #endif |
183 #endif |
173 |
184 |
174 static const SMTPValidCodeExtensionMapping KMTPValidCodeExtensionMappings[] = |
185 static const SMTPValidCodeExtensionMapping KMTPValidCodeExtensionMappings[] = |
175 { |
186 { |
176 {EMTPFormatCodeEXIFJPEG, CASTING("jpg")}, // jpeg |
187 {EMTPFormatCodeEXIFJPEG, CASTING("jpg")}, // jpeg |
177 {EMTPFormatCodeEXIFJPEG, CASTING("jpe")}, // jpeg |
188 {EMTPFormatCodeEXIFJPEG, CASTING("jpe")}, // jpeg |
178 {EMTPFormatCodeEXIFJPEG, CASTING("jpeg")} // jpeg |
189 {EMTPFormatCodeEXIFJPEG, CASTING("jpeg")}, // jpeg |
|
190 // {EMTPFormatCodeBMP, CASTING("bmp")}, // bmp |
|
191 // {EMTPFormatCodeGIF, CASTING("gif")}, // gif |
|
192 // {EMTPFormatCodePNG, CASTING("png")}, // png |
|
193 // {EMTPFormatCodeTIFF, CASTING("tif")}, // tiff, TNM does not support |
|
194 // {EMTPFormatCodeTIFF, CASTING("tiff")}, // tiff, TNM does not support |
|
195 }; |
|
196 |
|
197 static const SMTPExtensionMimeTypeMapping KMTPExtensionMimeTypeMappings[] = |
|
198 { |
|
199 {CASTING("jpg"), CASTING("image/jpeg")}, // jpeg |
|
200 {CASTING("jpe"), CASTING("image/jpeg")}, // jpeg |
|
201 {CASTING("jpeg"), CASTING("image/jpeg")}, // jpeg |
|
202 // {CASTING("bmp"), CASTING("image/bmp")}, // bmp |
|
203 // {CASTING("gif"), CASTING("image/gif")}, // gif |
|
204 // {CASTING("png"), CASTING("image/png")}, // png |
|
205 // {CASTING("tif"), CASTING("image/tiff")}, // tiff, TNM does not support |
|
206 // {CASTING("tiff"), CASTING("image/tiff")}, // tiff, TNM does not support |
179 }; |
207 }; |
180 |
208 |
181 /** |
209 /** |
182 Defines the image dp parameters. |
210 Defines the image dp parameters. |
183 */ |
211 */ |