os/mm/mmdevicefw/mdfunittest/codecapi/video/src/videoplayfile.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef VIDEOPLAYFILE_H
sl@0
    17
#define VIDEOPLAYFILE_H
sl@0
    18
sl@0
    19
#include "tsu_mdf_videocodecs_step.h"
sl@0
    20
#include <mmf/devvideo/devvideoplay.h>
sl@0
    21
sl@0
    22
sl@0
    23
class RTestStepVideoCodecs;
sl@0
    24
class CPlayVideoFile;
sl@0
    25
sl@0
    26
sl@0
    27
// For Play tests
sl@0
    28
class CPlayVideoFile : public CActive, public MMMFDevVideoPlayProxy
sl@0
    29
	{
sl@0
    30
public:
sl@0
    31
sl@0
    32
enum TPlayVideoFileState
sl@0
    33
	{
sl@0
    34
	EHwDeviceInit,
sl@0
    35
	EHwDeviceStartDecode,
sl@0
    36
	EHwDeviceAllowToComplete,
sl@0
    37
	EHwDeviceEncodeCheckData,		
sl@0
    38
	EHwDeviceDone,
sl@0
    39
	EHwDeviceError
sl@0
    40
	};	
sl@0
    41
	
sl@0
    42
public:
sl@0
    43
	static CPlayVideoFile* NewL(RTestStepVideoCodecs* aParent);
sl@0
    44
	~CPlayVideoFile();
sl@0
    45
sl@0
    46
	void LoadCodecL();
sl@0
    47
	void SetDSA(TBool aUseDSA);
sl@0
    48
	void StartPlaybackL();
sl@0
    49
	void SetState(TPlayVideoFileState aState);
sl@0
    50
	void CleanupAndSetDeviceError(TPtrC16 aText);	
sl@0
    51
	void StartDirectScreenAccessL();	
sl@0
    52
	
sl@0
    53
	// From CActive
sl@0
    54
	void RunL();
sl@0
    55
	void DoCancel();
sl@0
    56
    
sl@0
    57
    // From MMMFDevVideoPlayProxy	
sl@0
    58
	virtual void MdvppNewPicture(TVideoPicture* aPicture);
sl@0
    59
	virtual void MdvppNewBuffers();
sl@0
    60
	virtual void MdvppReturnPicture(TVideoPicture* aPicture);
sl@0
    61
	virtual void MdvppSupplementalInformation(const TDesC8& aData, 
sl@0
    62
		const TTimeIntervalMicroSeconds& aTimestamp, const TPictureId& aPictureId);
sl@0
    63
	virtual void MdvppPictureLoss();
sl@0
    64
	virtual void MdvppPictureLoss(const TArray<TPictureId>& aPictures);
sl@0
    65
	virtual void MdvppSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture);
sl@0
    66
	virtual void MdvppReferencePictureSelection(const TDesC8& aSelectionData);
sl@0
    67
	virtual void MdvppTimedSnapshotComplete(TInt aError, TPictureData* aPictureData, 
sl@0
    68
		const TTimeIntervalMicroSeconds& aPresentationTimestamp, const TPictureId& aPictureId);
sl@0
    69
	virtual void MdvppFatalError(CMMFVideoHwDevice* aDevice, TInt aError);
sl@0
    70
	virtual void MdvppInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError);
sl@0
    71
	virtual void MdvppStreamEnd();
sl@0
    72
	
sl@0
    73
private:
sl@0
    74
	CPlayVideoFile(RTestStepVideoCodecs* aParent);
sl@0
    75
	void ConstructL();	
sl@0
    76
	void StartDecodeL();
sl@0
    77
	void InitializeL();		
sl@0
    78
	void ReadNextBufferL();
sl@0
    79
	void OpenTestFileL();
sl@0
    80
    
sl@0
    81
private:
sl@0
    82
	//DevVideoPlay
sl@0
    83
	CMMFVideoDecodeHwDevice* iVideoHwDevice;
sl@0
    84
	
sl@0
    85
	TInt iError;
sl@0
    86
	
sl@0
    87
	// data section
sl@0
    88
	RFs iFs;
sl@0
    89
	RFile iFile;
sl@0
    90
	TPlayVideoFileState iState;	
sl@0
    91
	RTestStepVideoCodecs* iParent;
sl@0
    92
	TBool iStoppedReceived;
sl@0
    93
	TBool iUseDSA;
sl@0
    94
	
sl@0
    95
	TSize iFrameSize;
sl@0
    96
	CFbsScreenDevice* iScreenDevice;
sl@0
    97
	};
sl@0
    98
sl@0
    99
#endif // VIDEOPLAYFILE_H
sl@0
   100
sl@0
   101