os/mm/mmplugins/lib3gpunittest/inc/tsu_3gplibrary_parse_compose.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmplugins/lib3gpunittest/inc/tsu_3gplibrary_parse_compose.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,106 @@
     1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef TSU_3GPLIBRARY_PARSE_COMPOSER_H
    1.20 +#define TSU_3GPLIBRARY_PARSE_COMPOSER_H
    1.21 +
    1.22 +#include <test/testexecutestepbase.h>
    1.23 +#include <c3gplibrary.h>
    1.24 +
    1.25 +//
    1.26 +// C3GPLibParseComposeFile takes a directory path specified by the test configuration and 
    1.27 +// parses the video & audio data within the single file inside the directory.  Optionally,
    1.28 +// this class can parse then use the data retrieved to compose a copy of the original file.  
    1.29 +// The output files will reside in a user-specificed output directory, using the same name as the
    1.30 +// original file.  An extra option is to compare the input & output files' video & audio data.
    1.31 +// 
    1.32 +_LIT(K3GPParseComposeFile, "3GPParseComposeFile");
    1.33 +class C3GPLibParseComposeFile : public CTestStep
    1.34 +	{
    1.35 +	public:
    1.36 +		C3GPLibParseComposeFile();
    1.37 +		TVerdict doTestStepPreambleL();
    1.38 +		TVerdict doTestStepL();
    1.39 +		TVerdict doTestStepPostambleL();
    1.40 +		
    1.41 +	protected:
    1.42 +		TInt ReadVideoFrame(C3GPParse& aParser,
    1.43 +							RBuf8& aVideoBuffer, 
    1.44 +							TBool& aVideoKeyFrame, 
    1.45 +							TUint& aVideoTimestampInMS, 
    1.46 +							T3GPFrameDependencies& aDependencies);
    1.47 +		
    1.48 +		TInt ReadAudioFrames(C3GPParse& aParser,
    1.49 +							 RBuf8& aBuffer, 
    1.50 +							 TInt& aFramesInSample,
    1.51 +							 TUint& aTimestampInTS);
    1.52 +
    1.53 +		virtual void ParseFileL(const TDesC& aInputFile);
    1.54 +		
    1.55 +	private:
    1.56 +		
    1.57 +		// file properties
    1.58 +		TInt ParseVideoProperties(C3GPParse& aParser,
    1.59 +								  RBuf8& aDecoderSpecificInfo,				
    1.60 +								  T3GPVideoPropertiesBase*& aProperties,
    1.61 +								  TUint& aLengthInMs);
    1.62 +		TInt ParseAudioProperties(C3GPParse& aParser, 
    1.63 +								  RBuf8& aDecoderSpecificInfo,				
    1.64 +							      T3GPAudioPropertiesBase*& aProperties,
    1.65 +							      TUint& aLengthInMs);
    1.66 +		TInt GetAudioDecoderSpecificInfo(RBuf8& aBuffer);
    1.67 +		TInt GetVideoDecoderSpecificInfo(RBuf8& aBuffer);		
    1.68 +		
    1.69 +		// video / audio data
    1.70 +		void ReadWriteAudioVideoFramesL(const T3GPVideoPropertiesBase* aVideoProperties, 
    1.71 +									    const T3GPAudioPropertiesBase* aAudioProperties,
    1.72 +									    TUint aVideoLengthInMs, 
    1.73 +									    TUint aAudioLengthInMs);				
    1.74 +		
    1.75 +		TBool CompareInputOuputFileL(const TDesC& aInputFile);
    1.76 +		TBool CompareVideoPropertiesL(C3GPParse& aParser1, 
    1.77 +									  C3GPParse& aParser2);
    1.78 +		TBool CompareAudioPropertiesL(C3GPParse& aParser1, 
    1.79 +								      C3GPParse& aParser2);
    1.80 +		TBool CompareAudioVideoData(C3GPParse& aParser1, 
    1.81 +									C3GPParse& aParser2);
    1.82 +		TBool CompareAudioFrames(C3GPParse& aParser1, 
    1.83 +								 C3GPParse& aParser2);		
    1.84 +		TBool CompareVideoFrame(C3GPParse& aParser1, 
    1.85 +								C3GPParse& aParser2);
    1.86 +																		
    1.87 +	private:
    1.88 +		RBuf iOutputDir;		
    1.89 +		RBuf iInputDir;
    1.90 +		RBuf iComposedFile;
    1.91 +		
    1.92 +		TInt iFileFormat;				
    1.93 +		TInt iComposeFlag;
    1.94 +		TBool iCompareOriginal;		
    1.95 +		TInt iExpectedNumberOfFailure;
    1.96 +		
    1.97 +		CDir* iDirList;
    1.98 +		C3GPCompose* iComposer;
    1.99 +		C3GPParse* iParser;
   1.100 +		
   1.101 +		RFs	iFs;
   1.102 +		CActiveScheduler* iScheduler;
   1.103 +		
   1.104 +		TBool iLargeFile;
   1.105 +		RFile64 iParsedFileHandle64;		
   1.106 +		RFile64 iComposedFileHandle64;		
   1.107 +	};
   1.108 +
   1.109 +#endif	// TSU_3GPLIBRARY_PARSE_COMPOSER_H