os/mm/mmplugins/lib3gpunittest/inc/tsu_3gplibrary_parse_compose.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef TSU_3GPLIBRARY_PARSE_COMPOSER_H
    17 #define TSU_3GPLIBRARY_PARSE_COMPOSER_H
    18 
    19 #include <test/testexecutestepbase.h>
    20 #include <c3gplibrary.h>
    21 
    22 //
    23 // C3GPLibParseComposeFile takes a directory path specified by the test configuration and 
    24 // parses the video & audio data within the single file inside the directory.  Optionally,
    25 // this class can parse then use the data retrieved to compose a copy of the original file.  
    26 // The output files will reside in a user-specificed output directory, using the same name as the
    27 // original file.  An extra option is to compare the input & output files' video & audio data.
    28 // 
    29 _LIT(K3GPParseComposeFile, "3GPParseComposeFile");
    30 class C3GPLibParseComposeFile : public CTestStep
    31 	{
    32 	public:
    33 		C3GPLibParseComposeFile();
    34 		TVerdict doTestStepPreambleL();
    35 		TVerdict doTestStepL();
    36 		TVerdict doTestStepPostambleL();
    37 		
    38 	protected:
    39 		TInt ReadVideoFrame(C3GPParse& aParser,
    40 							RBuf8& aVideoBuffer, 
    41 							TBool& aVideoKeyFrame, 
    42 							TUint& aVideoTimestampInMS, 
    43 							T3GPFrameDependencies& aDependencies);
    44 		
    45 		TInt ReadAudioFrames(C3GPParse& aParser,
    46 							 RBuf8& aBuffer, 
    47 							 TInt& aFramesInSample,
    48 							 TUint& aTimestampInTS);
    49 
    50 		virtual void ParseFileL(const TDesC& aInputFile);
    51 		
    52 	private:
    53 		
    54 		// file properties
    55 		TInt ParseVideoProperties(C3GPParse& aParser,
    56 								  RBuf8& aDecoderSpecificInfo,				
    57 								  T3GPVideoPropertiesBase*& aProperties,
    58 								  TUint& aLengthInMs);
    59 		TInt ParseAudioProperties(C3GPParse& aParser, 
    60 								  RBuf8& aDecoderSpecificInfo,				
    61 							      T3GPAudioPropertiesBase*& aProperties,
    62 							      TUint& aLengthInMs);
    63 		TInt GetAudioDecoderSpecificInfo(RBuf8& aBuffer);
    64 		TInt GetVideoDecoderSpecificInfo(RBuf8& aBuffer);		
    65 		
    66 		// video / audio data
    67 		void ReadWriteAudioVideoFramesL(const T3GPVideoPropertiesBase* aVideoProperties, 
    68 									    const T3GPAudioPropertiesBase* aAudioProperties,
    69 									    TUint aVideoLengthInMs, 
    70 									    TUint aAudioLengthInMs);				
    71 		
    72 		TBool CompareInputOuputFileL(const TDesC& aInputFile);
    73 		TBool CompareVideoPropertiesL(C3GPParse& aParser1, 
    74 									  C3GPParse& aParser2);
    75 		TBool CompareAudioPropertiesL(C3GPParse& aParser1, 
    76 								      C3GPParse& aParser2);
    77 		TBool CompareAudioVideoData(C3GPParse& aParser1, 
    78 									C3GPParse& aParser2);
    79 		TBool CompareAudioFrames(C3GPParse& aParser1, 
    80 								 C3GPParse& aParser2);		
    81 		TBool CompareVideoFrame(C3GPParse& aParser1, 
    82 								C3GPParse& aParser2);
    83 																		
    84 	private:
    85 		RBuf iOutputDir;		
    86 		RBuf iInputDir;
    87 		RBuf iComposedFile;
    88 		
    89 		TInt iFileFormat;				
    90 		TInt iComposeFlag;
    91 		TBool iCompareOriginal;		
    92 		TInt iExpectedNumberOfFailure;
    93 		
    94 		CDir* iDirList;
    95 		C3GPCompose* iComposer;
    96 		C3GPParse* iParser;
    97 		
    98 		RFs	iFs;
    99 		CActiveScheduler* iScheduler;
   100 		
   101 		TBool iLargeFile;
   102 		RFile64 iParsedFileHandle64;		
   103 		RFile64 iComposedFileHandle64;		
   104 	};
   105 
   106 #endif	// TSU_3GPLIBRARY_PARSE_COMPOSER_H