mmlibs/mmfw/Recogniser/src/mpeg4parser.cpp
changeset 54 b68f3e90dca1
parent 15 c1e808730d6c
equal deleted inserted replaced
51:613e4e943120 54:b68f3e90dca1
    69 #define KMPEG4TRAKBit			KBit0	// 00000001
    69 #define KMPEG4TRAKBit			KBit0	// 00000001
    70 #define KMPEG4MOOVBit			KBit1	// 00000010
    70 #define KMPEG4MOOVBit			KBit1	// 00000010
    71 #define KMPEG4VideoBit			KBit2	// 00000100
    71 #define KMPEG4VideoBit			KBit2	// 00000100
    72 
    72 
    73 static const TInt KMPEG4BoxIntroLen = 8;
    73 static const TInt KMPEG4BoxIntroLen = 8;
       
    74 static const TInt KMPEG4Box64BitIntroLen = 16;
    74 
    75 
    75 //
    76 //
    76 // In order to find out the type of MPEG4 file it is
    77 // In order to find out the type of MPEG4 file it is
    77 // we need to be able to map known extensions, expected
    78 // we need to be able to map known extensions, expected
    78 // ftyp expressions with MIME-types.
    79 // ftyp expressions with MIME-types.
   282 		{
   283 		{
   283 		// The current box extends to the end of file.
   284 		// The current box extends to the end of file.
   284 		iIsFinished = ETrue;
   285 		iIsFinished = ETrue;
   285 		return;
   286 		return;
   286 		}
   287 		}
   287 	
   288 	if(iSizeIn32bit)
   288 	iReader.SeekL(iSize - KMPEG4BoxIntroLen);
   289 	    {
       
   290         iReader.SeekL(iSize - KMPEG4BoxIntroLen);
       
   291 	    }
       
   292 	else
       
   293 	    {
       
   294         iReader.SeekL(iSize - KMPEG4Box64BitIntroLen);
       
   295 	    }
   289 	}
   296 	}
   290 
   297 
   291 
   298 
   292 //
   299 //
   293 // Parses the 'moov' box.
   300 // Parses the 'moov' box.
   520 			iSize = MAKE_TINT64(0, 0);
   527 			iSize = MAKE_TINT64(0, 0);
   521 			break;
   528 			break;
   522 			
   529 			
   523 		case 1:
   530 		case 1:
   524 			// Size is specified in a 64-bit field.
   531 			// Size is specified in a 64-bit field.
       
   532 		    iSizeIn32bit = EFalse;
   525 			iReader.Read64L(iSize);
   533 			iReader.Read64L(iSize);
   526 			break;
   534 			break;
   527 			
   535 			
   528 		default:
   536 		default:
   529 			// It's an actual 32-bit size.
   537 			// It's an actual 32-bit size.
       
   538 		    iSizeIn32bit = ETrue;
   530 			iSize = MAKE_TINT64(0, word1);
   539 			iSize = MAKE_TINT64(0, word1);
   531 		}
   540 		}
   532 		
   541 		
   533 	if (iTitle == KUuid)
   542 	if (iTitle == KUuid)
   534 		{
   543 		{