mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/3gpaudioplaycontroller/Src/3GPAudioPlayControllerRecognizer.cpp
equal
deleted
inserted
replaced
28 const TUid KUidMime3gpRecognizer = {0x101FAFAD}; |
28 const TUid KUidMime3gpRecognizer = {0x101FAFAD}; |
29 const TInt KExtLength = 4; |
29 const TInt KExtLength = 4; |
30 _LIT(KDot, "."); |
30 _LIT(KDot, "."); |
31 _LIT(KDot3gp, ".3gp"); |
31 _LIT(KDot3gp, ".3gp"); |
32 _LIT(KDot3ga, ".3ga"); |
32 _LIT(KDot3ga, ".3ga"); |
|
33 _LIT(KDot3gpp, ".3gpp"); |
33 _LIT8(K3gpAudioMimeType, "audio/3gpp"); |
34 _LIT8(K3gpAudioMimeType, "audio/3gpp"); |
34 _LIT8(K3gpVideoMimeType, "video/3gpp"); |
35 _LIT8(K3gpVideoMimeType, "video/3gpp"); |
35 |
36 |
36 _LIT(KDotMp4, ".mp4"); |
37 _LIT(KDotMp4, ".mp4"); |
37 _LIT(KDotM4a, ".m4a"); |
38 _LIT(KDotM4a, ".m4a"); |
200 return; |
201 return; |
201 } |
202 } |
202 } |
203 } |
203 } |
204 } |
204 |
205 |
205 TPtrC ext(aName.Right(KExtLength)); |
206 // TPtrC ext(aName.Right(KExtLength)); |
|
207 TInt num=aName.LocateReverse('.'); |
|
208 if(num < 0) |
|
209 { |
|
210 num = 0; |
|
211 } |
|
212 TPtrC ext(aName.Right(aName.Length()-num)); |
|
213 |
206 DP0(_L("C3GPAudioPlayControllerRecognizer::DoRecognizeL: Extension:")); |
214 DP0(_L("C3GPAudioPlayControllerRecognizer::DoRecognizeL: Extension:")); |
207 #ifdef _DEBUG |
215 #ifdef _DEBUG |
208 RDebug::RawPrint(ext); |
216 RDebug::RawPrint(ext); |
209 #endif |
217 #endif |
210 DP0(_L(" ")); |
218 DP0(_L(" ")); |
211 |
219 |
212 if ( (ext.CompareF(KDot3gp) == 0) || (ext.CompareF(KDotMp4) == 0) || |
220 if ( (ext.CompareF(KDot3gp) == 0) || (ext.CompareF(KDotMp4) == 0) || |
213 (ext.CompareF(KDotM4a) == 0) || (ext.CompareF(KDot3g2) == 0) || |
221 (ext.CompareF(KDotM4a) == 0) || (ext.CompareF(KDot3g2) == 0) || |
214 (ext.CompareF(KDot3ga) == 0) || headerMatch) |
222 (ext.CompareF(KDot3ga) == 0) || (ext.CompareF(KDot3gpp) == 0) || headerMatch) |
215 { |
223 { |
216 RFile* fileHandle= NULL; |
224 RFile* fileHandle= NULL; |
217 TRAPD(handleErr, fileHandle = FilePassedByHandleL()); |
225 TRAPD(handleErr, fileHandle = FilePassedByHandleL()); |
218 |
226 |
219 if (handleErr != KErrNone) |
227 if (handleErr != KErrNone) |
275 (header.FindF(K3gp6Header) == 0) || |
283 (header.FindF(K3gp6Header) == 0) || |
276 (header.FindF(K3gr6Header) == 0) || |
284 (header.FindF(K3gr6Header) == 0) || |
277 (header.FindF(K3gs6Header) == 0) || |
285 (header.FindF(K3gs6Header) == 0) || |
278 (header.FindF(KMmp4Header) == 0) || |
286 (header.FindF(KMmp4Header) == 0) || |
279 (ext.CompareF(KDot3gp) == 0) || |
287 (ext.CompareF(KDot3gp) == 0) || |
280 (ext.CompareF(KDot3ga) == 0) ) |
288 (ext.CompareF(KDot3ga) == 0)||(ext.CompareF(KDot3gpp) == 0) ) |
281 { |
289 { |
282 iDataType = TDataType(K3gpAudioMimeType); |
290 iDataType = TDataType(K3gpAudioMimeType); |
283 iConfidence = ECertain; |
291 iConfidence = ECertain; |
284 DP0(_L("C3GPAudioPlayControllerRecognizer::DoRecognizeL [3gp audio]")); |
292 DP0(_L("C3GPAudioPlayControllerRecognizer::DoRecognizeL [3gp audio]")); |
285 } |
293 } |
306 if ( (header.FindF(K3gpHeader) == 0) || |
314 if ( (header.FindF(K3gpHeader) == 0) || |
307 (header.FindF(K3gp6Header) == 0) || |
315 (header.FindF(K3gp6Header) == 0) || |
308 (header.FindF(K3gr6Header) == 0) || |
316 (header.FindF(K3gr6Header) == 0) || |
309 (header.FindF(K3gs6Header) == 0) || |
317 (header.FindF(K3gs6Header) == 0) || |
310 (header.FindF(KMmp4Header) == 0) || |
318 (header.FindF(KMmp4Header) == 0) || |
311 (ext.CompareF(KDot3gp) == 0) ) |
319 (ext.CompareF(KDot3gp) == 0) || (ext.CompareF(KDot3gpp) == 0)) |
312 { |
320 { |
313 iDataType = TDataType(K3gpVideoMimeType); |
321 iDataType = TDataType(K3gpVideoMimeType); |
314 iConfidence = ECertain; |
322 iConfidence = ECertain; |
315 DP0(_L("C3GPAudioPlayControllerRecognizer::DoRecognizeL [3gp video]")); |
323 DP0(_L("C3GPAudioPlayControllerRecognizer::DoRecognizeL [3gp video]")); |
316 } |
324 } |