sl@0: /* sl@0: * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #ifndef T_CMMFDEVVIDEODATA_H sl@0: #define T_CMMFDEVVIDEODATA_H sl@0: sl@0: //Epoc includes sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include // for display device sl@0: #include sl@0: //User Includes sl@0: #include "datawrapperbase.h" sl@0: #include "t_devvideoconstants.h" sl@0: #include "H264DecTestEngine.h" sl@0: sl@0: enum TVideoDecoderOutput sl@0: { sl@0: EDecodedFile = 0, sl@0: EScreenOutput sl@0: }; sl@0: sl@0: //Forward declarations sl@0: class CT_CMMFDevVideoPlay; sl@0: sl@0: //Engine observer handle Async request completeion and release waitclass of Test scriptor sl@0: sl@0: class CEngineObserver: public CBase, public MVDecEngineObserver sl@0: { sl@0: public: sl@0: void MvdeStreamEndReached(); sl@0: void MvdeSetError(TInt aError); sl@0: ~CEngineObserver() {} sl@0: CEngineObserver(CT_CMMFDevVideoPlay& aTestClass); sl@0: sl@0: private: sl@0: CT_CMMFDevVideoPlay& iTestClass; sl@0: sl@0: }; sl@0: /** sl@0: * Test Active Notification class sl@0: * sl@0: */ sl@0: class CT_CMMFDevVideoPlay : public CDataWrapperBase, MMMFDevVideoPlayObserver sl@0: { sl@0: public: sl@0: sl@0: ~CT_CMMFDevVideoPlay(); sl@0: virtual TAny* GetObject(); sl@0: virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); sl@0: static CT_CMMFDevVideoPlay* NewL(); sl@0: void DestroyData(); sl@0: TInt ReadOneCodedPicture(TVideoInputBuffer* aCodedInBuffer, TInt aSize); sl@0: TInt ReadOneCodedPicture(TVideoInputBuffer* aCodedInBuffer); sl@0: TInt ReadRawPicture(); sl@0: void OpenFileL(TFileName& aInFileName); sl@0: void OpenFileL(TFileName& aOutFileName, TFileName& aInFileName); sl@0: void CloseFile(); sl@0: void ListFrameSizeL(TVideoCodec aCodec); sl@0: void AbortDirectScreenAccess(); sl@0: void StartDirectScreenAccessL(); sl@0: void HandleRuntimeError(TInt aError); sl@0: void SaveAndReturnPicture(); sl@0: void GetReturnedPicture(); sl@0: void FillAndSendBufferL(); sl@0: void GetInputBuffer(); sl@0: void HandleNewBufferL(); sl@0: void SetWindowRect(TInt aX, TInt aY, TSize aSize); sl@0: void CreateFiles(const TTEFSectionName& aSection); sl@0: void InitializeParamsL(const TTEFSectionName& aSection); sl@0: void MdvpoNewBuffers(); sl@0: void MdvpoReturnPicture(TVideoPicture* aPicture); sl@0: void MdvpoSupplementalInformation(const TDesC8& aData, const TTimeIntervalMicroSeconds& aTimestamp, const TPictureId& aPictureId); sl@0: void MdvpoPictureLoss(); sl@0: void MdvpoPictureLoss(const TArray& aPictures); sl@0: void MdvpoSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture); sl@0: void MdvpoReferencePictureSelection(const TDesC8& aSelectionData); sl@0: void MdvpoTimedSnapshotComplete(TInt aError, TPictureData* aPictureData, const TTimeIntervalMicroSeconds& aPresentationTimestamp, const TPictureId& aPictureId); sl@0: void MdvpoNewPictures(); sl@0: void MdvpoFatalError(TInt aError); sl@0: void MdvpoInitComplete(TInt aError); sl@0: void MdvpoStreamEnd(); sl@0: protected: sl@0: CT_CMMFDevVideoPlay(); sl@0: void ConstructL(); sl@0: private: sl@0: void DoCmdInitialize(const TInt aAsyncErrorIndex); sl@0: void DoCmdStart(const TInt aAsyncErrorIndex); sl@0: void DoCmdStop(); sl@0: void DoCmdPause(); sl@0: void DoCmdResume(); sl@0: void DoCmdSetRotateOptionsL(const TTEFSectionName& aSection); sl@0: void DoCmdSetScaleOptionsL(const TTEFSectionName& aSection); sl@0: void DoCmdSetPosition(const TTEFSectionName& aSection); sl@0: void DoCmdSetClockSource(const TTEFSectionName& aSection); sl@0: void DoCmdNewL(const TTEFSectionName& aSection); sl@0: void DoCmdSelectDecoderL(const TTEFSectionName& aSection); sl@0: void DoCmdSetInputFormatL(const TTEFSectionName& aSection); sl@0: void DoCmdSelectPostProcessorL(const TTEFSectionName& aSection); sl@0: void DoCmdGetOutputFormatListL(const TTEFSectionName& aSection); sl@0: void DoCmdPostProcessorInfoLC(); sl@0: void DoCmdFindCommonFormat(); sl@0: void DoCmdSetOutputFormatL(const TTEFSectionName& aSection); sl@0: void DoCmdGetHeaderInformationL(const TTEFSectionName& aSection); sl@0: void DoCmdSetVideoDestScreenL(); sl@0: void DoCmdGetBufferOptions(); sl@0: void DoCmdSetBufferOptionsL(); sl@0: void DoCmdSetPostProcessTypesL(const TTEFSectionName& aSection); sl@0: void DoCmdReturnHeader(); sl@0: void DoCmdDestructor(); sl@0: void DoCmdAbortDirectScreenAccess(); sl@0: void DoCmdStartDirectScreenAccessL(const TTEFSectionName& aSection); sl@0: void DoCmdUtilityGetEnvironmentL(); sl@0: sl@0: void DoCmdH264CreateDecTest(const TTEFSectionName& aSection); sl@0: void DoCmdH264SelectPostProcessor(const TTEFSectionName& aSection); sl@0: void DoCmdH264SetPostProcessTypes(const TTEFSectionName& aSection); sl@0: void DoCmdH264SetInputFormatCompr(const TTEFSectionName& aSection); sl@0: void DoCmdH264SetOutputFormat(const TTEFSectionName& aSection); sl@0: void DoCmdH264SetBufferOptions(const TTEFSectionName& aSection); sl@0: void DoCmdH264ListFrameSize(); sl@0: void DoCmdH264SetVideoDestScreen(const TTEFSectionName& aSection); sl@0: void DoCmdH264SetWindowRect(const TTEFSectionName& aSection); sl@0: void DoCmdH264Initialize(); sl@0: void DoCmdH264Start(const TTEFSectionName& aSection); sl@0: void DoCmdH264Stop(); sl@0: void DoCmdH264Pause(); sl@0: void DoCmdH264Resume(); sl@0: void DoCmdH264IOFrameNumMatch(); sl@0: void DoCmdH264FindCommonFormats(); sl@0: void DoCmdH264GetHeaderInformation(const TTEFSectionName& aSection); sl@0: void DoCmdH264EnableSynchronization(const TTEFSectionName& aSection); sl@0: void DoCmdH264SetScaleOptions(const TTEFSectionName& aSection); sl@0: void DoCmdH264SetRotateOptions(const TTEFSectionName& aSection); sl@0: void DoCmdH264SynchronizeDecoding(const TTEFSectionName& aSection); sl@0: void DoCmdH264Delete(); sl@0: void DoCmdH264SetPosition(const TTEFSectionName& aSection); sl@0: void DoCmdH264AbortDirectScreenAccess(); sl@0: private: sl@0: /** sl@0: * Wrapped object sl@0: */ sl@0: CMMFDevVideoPlay* iDevvp; sl@0: /** sl@0: * For selected decoder sl@0: */ sl@0: THwDeviceId iDecHWDevId; sl@0: /** sl@0: * For selected Post processor sl@0: */ sl@0: THwDeviceId iPostProcId; sl@0: /** sl@0: * Size of video buffer sl@0: */ sl@0: TInt iInBuffSize; sl@0: /** sl@0: * Control the number of inputs sl@0: */ sl@0: TBool iInputEnd; sl@0: /** sl@0: * Direct Screen Access sl@0: */ sl@0: TBool iDsaStarted; sl@0: /** sl@0: * For synchronize the clock(fps) sl@0: */ sl@0: TBool iSynchronized; sl@0: /** sl@0: * Listed frames sl@0: */ sl@0: TBool iFrameListed; sl@0: /** sl@0: * The size of the picture sl@0: */ sl@0: TSize iPictureSize; sl@0: /** sl@0: * Async error sl@0: */ sl@0: TInt iAsyncErrorIndex; sl@0: /** sl@0: * Width and height of the video sl@0: */ sl@0: TRect iDispRect; sl@0: /** sl@0: * For management the Open files sl@0: */ sl@0: TBool iFileOpen; sl@0: /** sl@0: * for get the coded buffer sl@0: */ sl@0: TVideoInputBuffer* iCodedInBuffer; sl@0: /** sl@0: * Output buffer sl@0: */ sl@0: TVideoPicture* iOutBuffer; sl@0: /** sl@0: * sl@0: */ sl@0: TVideoPicture* iRawInBuffer; sl@0: /** sl@0: * For synch the time sl@0: */ sl@0: TInt64 iTimeStamp; sl@0: /** sl@0: * Time interval in each frame sl@0: */ sl@0: TInt64 iFrameTimeInterval; sl@0: /** sl@0: * Buffer control sl@0: */ sl@0: TInt iSentBuffCount; sl@0: /** sl@0: * Buffer control sl@0: */ sl@0: TInt iReturnedBuffCount; sl@0: /** sl@0: * Loss Pictures sl@0: */ sl@0: TInt iPictureLoss; sl@0: /** sl@0: * The end of the stream sl@0: */ sl@0: TBool iStreamEnd; sl@0: /** sl@0: * Type of codec sl@0: */ sl@0: TVideoCodec iCodecType; sl@0: /** sl@0: * Management of the time between frames sl@0: */ sl@0: CSystemClockSource* iClock; sl@0: /** sl@0: * Direct Access at the Screen sl@0: */ sl@0: TBool iDirectScreenAccess; sl@0: /** sl@0: * for handle the buffer sl@0: */ sl@0: TBool iCIBuffMgmtOn; sl@0: /** sl@0: * For measurement of the frame sl@0: */ sl@0: TBool iFrameMeasurement; sl@0: /** sl@0: * for H264 sl@0: */ sl@0: RArray iFrameSizeList; sl@0: /** sl@0: * frame rate(fps) sl@0: */ sl@0: TInt iFramerate; sl@0: /** sl@0: * File Server sl@0: */ sl@0: RFs iFs; sl@0: /** sl@0: * Input file sl@0: */ sl@0: RFile iInFile; sl@0: /** sl@0: * Ouput file sl@0: */ sl@0: RFile iOutFile; sl@0: /** sl@0: * Fbs sl@0: */ sl@0: CFbsScreenDevice* iScreenDevice; sl@0: /** sl@0: * Common format between Post processor and decoder sl@0: */ sl@0: TUncompressedVideoFormat iCommonFormat; sl@0: /** sl@0: * Decoder read from the ini file sl@0: */ sl@0: TUid iSelectDecoder; sl@0: /** sl@0: * Post processor read from the ini file sl@0: */ sl@0: TUid iSelectPostProcessor; sl@0: /** sl@0: * Formats Decoder sl@0: */ sl@0: RArray iDecFormats; sl@0: /** sl@0: * Post processor formats sl@0: */ sl@0: RArray iPPFormats; sl@0: /** sl@0: * Information about the post processor sl@0: */ sl@0: CPostProcessorInfo* iInfo; sl@0: /** sl@0: * if exist information for header info sl@0: */ sl@0: TVideoPictureHeader* iHeaderInfo; sl@0: /** sl@0: * Buffer options sl@0: */ sl@0: CMMFDevVideoPlay::TBufferOptions iBufferOptions; sl@0: /** sl@0: * The common format sl@0: */ sl@0: TBool iCommonFormatFound; sl@0: /** sl@0: * To Control the errors in GetInputBuffer sl@0: */ sl@0: TBool iErrorInputBuffer; sl@0: /** sl@0: * Enum for codecs sl@0: */ sl@0: static const TEnumEntryTable iCodecs[]; sl@0: /** sl@0: * Enum for Display mode sl@0: */ sl@0: static const TEnumEntryTable iDisplayModes[]; sl@0: /** sl@0: * Enum for rotations sl@0: */ sl@0: static const TEnumEntryTable iRotations[]; sl@0: /** sl@0: * Enum for Video Data Unit Types sl@0: */ sl@0: static const TEnumEntryTable iTVideoDataUnitType[]; sl@0: /** sl@0: * Enum for Video Data Unit Encapsulation sl@0: */ sl@0: static const TEnumEntryTable iTVideoDataUnitEncapsulation[]; sl@0: sl@0: /** sl@0: * H264 sl@0: */ sl@0: CVDecTestEngine* iEngine; sl@0: CEngineObserver* iObserver; sl@0: TBool iUse264; sl@0: TInt iFrameRate; sl@0: }; sl@0: sl@0: sl@0: #endif // T_CMMFDEVVIDEODATA_H sl@0: