mmlibs/mmfw/Recogniser/src/mpeg4parser.cpp
branchRCL_3
changeset 11 d5f04de580b7
parent 0 40261b775718
child 54 b68f3e90dca1
equal deleted inserted replaced
8:bc06d8566074 11:d5f04de580b7
    26 static const TUint32 KMP4Brand = MAKE_INT32('m', 'p', '4', 0);
    26 static const TUint32 KMP4Brand = MAKE_INT32('m', 'p', '4', 0);
    27 static const TUint32 K3GPBrand = MAKE_INT32('3', 'g', 'p', 0);
    27 static const TUint32 K3GPBrand = MAKE_INT32('3', 'g', 'p', 0);
    28 static const TUint32 K3G2Brand = MAKE_INT32('3', 'g', '2', 0);
    28 static const TUint32 K3G2Brand = MAKE_INT32('3', 'g', '2', 0);
    29 static const TUint32 K3GSBrand = MAKE_INT32('3', 'g', 's', 0);	// Streaming servers.
    29 static const TUint32 K3GSBrand = MAKE_INT32('3', 'g', 's', 0);	// Streaming servers.
    30 static const TUint32 K3GRBrand = MAKE_INT32('3', 'g', 'r', 0);	// Progresive download and MMS.
    30 static const TUint32 K3GRBrand = MAKE_INT32('3', 'g', 'r', 0);	// Progresive download and MMS.
    31 
    31 static const TUint32 KQTBrand  = MAKE_INT32('q', 't', ' ', ' '); // for quicktime
    32 //
    32 //
    33 // Box identifiers.
    33 // Box identifiers.
    34 //
    34 //
    35 static const TUint32 KFtyp = MAKE_INT32('f', 't', 'y', 'p');
    35 static const TUint32 KFtyp = MAKE_INT32('f', 't', 'y', 'p');
    36 static const TUint32 KMoov = MAKE_INT32('m', 'o', 'o', 'v');
    36 static const TUint32 KMoov = MAKE_INT32('m', 'o', 'o', 'v');
   101 		{KExt3GP,	K3GPBrand,	KMime3GP_A,	KMime3GP_V},
   101 		{KExt3GP,	K3GPBrand,	KMime3GP_A,	KMime3GP_V},
   102 		{KExtM4A,	KMP4Brand,	KMimeMP4_A,	NULL},
   102 		{KExtM4A,	KMP4Brand,	KMimeMP4_A,	NULL},
   103 		{KExt3G2,	K3G2Brand,	KMime3G2_A,	KMime3G2_V},
   103 		{KExt3G2,	K3G2Brand,	KMime3G2_A,	KMime3G2_V},
   104 		{KExt3GP,	K3GSBrand,	KMime3GP_A,	KMime3GP_V},
   104 		{KExt3GP,	K3GSBrand,	KMime3GP_A,	KMime3GP_V},
   105 		{KExt3GP,	K3GRBrand,	KMime3GP_A,	KMime3GP_V},
   105 		{KExt3GP,	K3GRBrand,	KMime3GP_A,	KMime3GP_V},
   106 		{KExt3GA,	K3GPBrand,	KMime3GA,	NULL}
   106 		{KExt3GA,	K3GPBrand,	KMime3GA,	NULL},
       
   107 		{KExtMOV,   KQTBrand,   NULL, KMimeQuickV} // this entry is for .mov files
   107 	};
   108 	};
   108 
   109 
   109 static const TInt KMPEG4FileTypeCount = sizeof(KMPEG4Files) / sizeof(TMPEG4File);
   110 static const TInt KMPEG4FileTypeCount = sizeof(KMPEG4Files) / sizeof(TMPEG4File);
   110 
   111 
   111 
   112 
   463 	TUint32 brand;
   464 	TUint32 brand;
   464 	
   465 	
   465 	// If the majorBrand isn't recognised we should also
   466 	// If the majorBrand isn't recognised we should also
   466 	// search the compatible brand list.
   467 	// search the compatible brand list.
   467 	TInt64 bytesRemaining = iSize - KMPEG4FtypIntroLen;
   468 	TInt64 bytesRemaining = iSize - KMPEG4FtypIntroLen;
       
   469 	//here there should be bytes remaining. Otherwise we cant read.
       
   470 	if( bytesRemaining <0 )
       
   471 	{
       
   472 	    User::Leave(KErrCorrupt);    
       
   473 	}
   468 	
   474 	
   469 	iReader.Read32L(brand);
   475 	iReader.Read32L(brand);
   470 	iBrandIndex = TMPEG4Parser::IsCompatibleBrand(brand);
   476 	iBrandIndex = TMPEG4Parser::IsCompatibleBrand(brand);
   471 	if (iBrandIndex != KErrNotFound)
   477 	if (iBrandIndex != KErrNotFound)
   472 		{
   478 		{