os/mm/mmapitest/devvideohaitest/inc/t_cmmfdevvideoplaydata.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
/*
sl@0
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description: 
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
sl@0
    20
#ifndef T_CMMFDEVVIDEODATA_H
sl@0
    21
#define T_CMMFDEVVIDEODATA_H
sl@0
    22
sl@0
    23
//Epoc includes
sl@0
    24
#include <e32base.h>
sl@0
    25
#include <e32std.h>
sl@0
    26
#include <f32file.h>
sl@0
    27
#include <videoplayhwdevice.h>
sl@0
    28
#include <devvideoplay.h>
sl@0
    29
#include <devvideobase.h> 
sl@0
    30
#include <bitdev.h>   // for display device 
sl@0
    31
#include <fbs.h>  
sl@0
    32
//User Includes
sl@0
    33
#include "datawrapperbase.h"
sl@0
    34
#include "t_devvideoconstants.h"
sl@0
    35
#include "H264DecTestEngine.h"
sl@0
    36
sl@0
    37
enum TVideoDecoderOutput 
sl@0
    38
	{
sl@0
    39
	EDecodedFile = 0,
sl@0
    40
	EScreenOutput
sl@0
    41
	};
sl@0
    42
sl@0
    43
//Forward declarations
sl@0
    44
class CT_CMMFDevVideoPlay;
sl@0
    45
sl@0
    46
//Engine observer handle Async request completeion and release waitclass of Test scriptor
sl@0
    47
sl@0
    48
class CEngineObserver:  public CBase, public MVDecEngineObserver
sl@0
    49
{
sl@0
    50
public:
sl@0
    51
    void MvdeStreamEndReached();
sl@0
    52
    void MvdeSetError(TInt aError);
sl@0
    53
    ~CEngineObserver() {}
sl@0
    54
    CEngineObserver(CT_CMMFDevVideoPlay& aTestClass);
sl@0
    55
      
sl@0
    56
private:
sl@0
    57
    CT_CMMFDevVideoPlay& iTestClass;
sl@0
    58
    
sl@0
    59
};
sl@0
    60
/**
sl@0
    61
 * Test Active Notification class
sl@0
    62
 *
sl@0
    63
 */
sl@0
    64
class CT_CMMFDevVideoPlay : public CDataWrapperBase, MMMFDevVideoPlayObserver 
sl@0
    65
	{
sl@0
    66
public:
sl@0
    67
	
sl@0
    68
	~CT_CMMFDevVideoPlay();
sl@0
    69
	virtual TAny*	GetObject();
sl@0
    70
	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
sl@0
    71
	static	CT_CMMFDevVideoPlay*	NewL();		
sl@0
    72
	void DestroyData();
sl@0
    73
	TInt ReadOneCodedPicture(TVideoInputBuffer* aCodedInBuffer, TInt aSize);
sl@0
    74
	TInt ReadOneCodedPicture(TVideoInputBuffer* aCodedInBuffer);
sl@0
    75
	TInt ReadRawPicture();
sl@0
    76
	void OpenFileL(TFileName& aInFileName);
sl@0
    77
	void OpenFileL(TFileName& aOutFileName, TFileName& aInFileName);
sl@0
    78
	void CloseFile();
sl@0
    79
	void ListFrameSizeL(TVideoCodec aCodec);
sl@0
    80
	void AbortDirectScreenAccess();
sl@0
    81
    void StartDirectScreenAccessL();
sl@0
    82
    void HandleRuntimeError(TInt aError);
sl@0
    83
    void SaveAndReturnPicture();
sl@0
    84
    void GetReturnedPicture();
sl@0
    85
    void FillAndSendBufferL();
sl@0
    86
    void GetInputBuffer();
sl@0
    87
    void HandleNewBufferL();  
sl@0
    88
    void SetWindowRect(TInt aX, TInt aY, TSize aSize);
sl@0
    89
    void CreateFiles(const TTEFSectionName& aSection);
sl@0
    90
    void InitializeParamsL(const TTEFSectionName& aSection);    
sl@0
    91
	void MdvpoNewBuffers();
sl@0
    92
    void MdvpoReturnPicture(TVideoPicture* aPicture);
sl@0
    93
    void MdvpoSupplementalInformation(const TDesC8& aData, const TTimeIntervalMicroSeconds& aTimestamp, const TPictureId& aPictureId);
sl@0
    94
    void MdvpoPictureLoss();
sl@0
    95
    void MdvpoPictureLoss(const TArray<TPictureId>& aPictures);
sl@0
    96
    void MdvpoSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture);
sl@0
    97
    void MdvpoReferencePictureSelection(const TDesC8& aSelectionData);
sl@0
    98
    void MdvpoTimedSnapshotComplete(TInt aError, TPictureData* aPictureData, const TTimeIntervalMicroSeconds& aPresentationTimestamp, const TPictureId& aPictureId);
sl@0
    99
    void MdvpoNewPictures();
sl@0
   100
    void MdvpoFatalError(TInt aError);
sl@0
   101
    void MdvpoInitComplete(TInt aError);    
sl@0
   102
    void MdvpoStreamEnd();   
sl@0
   103
protected:
sl@0
   104
	CT_CMMFDevVideoPlay();
sl@0
   105
	void ConstructL();
sl@0
   106
private:
sl@0
   107
	void DoCmdInitialize(const TInt aAsyncErrorIndex);
sl@0
   108
	void DoCmdStart(const TInt aAsyncErrorIndex);
sl@0
   109
	void DoCmdStop();
sl@0
   110
	void DoCmdPause();
sl@0
   111
	void DoCmdResume();
sl@0
   112
	void DoCmdSetRotateOptionsL(const TTEFSectionName& aSection);
sl@0
   113
	void DoCmdSetScaleOptionsL(const TTEFSectionName& aSection);
sl@0
   114
	void DoCmdSetPosition(const TTEFSectionName& aSection);
sl@0
   115
	void DoCmdSetClockSource(const TTEFSectionName& aSection);
sl@0
   116
	void DoCmdNewL(const TTEFSectionName& aSection);
sl@0
   117
	void DoCmdSelectDecoderL(const TTEFSectionName& aSection);
sl@0
   118
	void DoCmdSetInputFormatL(const TTEFSectionName& aSection);
sl@0
   119
	void DoCmdSelectPostProcessorL(const TTEFSectionName& aSection);
sl@0
   120
	void DoCmdGetOutputFormatListL(const TTEFSectionName& aSection);
sl@0
   121
	void DoCmdPostProcessorInfoLC();
sl@0
   122
	void DoCmdFindCommonFormat();
sl@0
   123
	void DoCmdSetOutputFormatL(const TTEFSectionName& aSection);
sl@0
   124
	void DoCmdGetHeaderInformationL(const TTEFSectionName& aSection);
sl@0
   125
	void DoCmdSetVideoDestScreenL();
sl@0
   126
	void DoCmdGetBufferOptions();
sl@0
   127
	void DoCmdSetBufferOptionsL();
sl@0
   128
	void DoCmdSetPostProcessTypesL(const TTEFSectionName& aSection);
sl@0
   129
	void DoCmdReturnHeader();
sl@0
   130
	void DoCmdDestructor();
sl@0
   131
	void DoCmdAbortDirectScreenAccess();
sl@0
   132
	void DoCmdStartDirectScreenAccessL(const TTEFSectionName& aSection);
sl@0
   133
	void DoCmdUtilityGetEnvironmentL();
sl@0
   134
sl@0
   135
	void DoCmdH264CreateDecTest(const TTEFSectionName& aSection);
sl@0
   136
	void DoCmdH264SelectPostProcessor(const TTEFSectionName& aSection);
sl@0
   137
	void DoCmdH264SetPostProcessTypes(const TTEFSectionName& aSection);
sl@0
   138
	void DoCmdH264SetInputFormatCompr(const TTEFSectionName& aSection);
sl@0
   139
	void DoCmdH264SetOutputFormat(const TTEFSectionName& aSection);
sl@0
   140
	void DoCmdH264SetBufferOptions(const TTEFSectionName& aSection);
sl@0
   141
	void DoCmdH264ListFrameSize();
sl@0
   142
	void DoCmdH264SetVideoDestScreen(const TTEFSectionName& aSection);
sl@0
   143
	void DoCmdH264SetWindowRect(const TTEFSectionName& aSection);
sl@0
   144
	void DoCmdH264Initialize();
sl@0
   145
	void DoCmdH264Start(const TTEFSectionName& aSection);
sl@0
   146
	void DoCmdH264Stop();
sl@0
   147
	void DoCmdH264Pause();
sl@0
   148
	void DoCmdH264Resume();
sl@0
   149
	void DoCmdH264IOFrameNumMatch();
sl@0
   150
	void DoCmdH264FindCommonFormats();
sl@0
   151
	void DoCmdH264GetHeaderInformation(const TTEFSectionName& aSection);
sl@0
   152
	void DoCmdH264EnableSynchronization(const TTEFSectionName& aSection);
sl@0
   153
	void DoCmdH264SetScaleOptions(const TTEFSectionName& aSection);
sl@0
   154
	void DoCmdH264SetRotateOptions(const TTEFSectionName& aSection);
sl@0
   155
	void DoCmdH264SynchronizeDecoding(const TTEFSectionName& aSection);
sl@0
   156
	void DoCmdH264Delete();
sl@0
   157
	void DoCmdH264SetPosition(const TTEFSectionName& aSection);
sl@0
   158
	void DoCmdH264AbortDirectScreenAccess();
sl@0
   159
private:
sl@0
   160
	/**
sl@0
   161
	 * Wrapped object
sl@0
   162
	 */
sl@0
   163
	CMMFDevVideoPlay* iDevvp; 
sl@0
   164
	/**
sl@0
   165
	 * For selected decoder
sl@0
   166
	 */
sl@0
   167
    THwDeviceId iDecHWDevId; 
sl@0
   168
    /**
sl@0
   169
	 * For selected Post processor
sl@0
   170
	 */
sl@0
   171
    THwDeviceId iPostProcId;
sl@0
   172
    /**
sl@0
   173
	 * Size of video buffer
sl@0
   174
	 */
sl@0
   175
    TInt	iInBuffSize; 
sl@0
   176
    /**
sl@0
   177
	 * Control the number of inputs
sl@0
   178
	 */
sl@0
   179
    TBool	iInputEnd;
sl@0
   180
    /**
sl@0
   181
	 * Direct Screen Access
sl@0
   182
	 */
sl@0
   183
    TBool	iDsaStarted;
sl@0
   184
    /**
sl@0
   185
	 * For synchronize the clock(fps)
sl@0
   186
	 */
sl@0
   187
    TBool	iSynchronized;
sl@0
   188
    /**
sl@0
   189
	 * Listed frames
sl@0
   190
	 */
sl@0
   191
    TBool	iFrameListed;
sl@0
   192
    /**
sl@0
   193
	 * The size of the picture
sl@0
   194
	 */
sl@0
   195
    TSize	iPictureSize;
sl@0
   196
    /**
sl@0
   197
	 * Async error
sl@0
   198
	 */
sl@0
   199
    TInt	iAsyncErrorIndex;
sl@0
   200
    /**
sl@0
   201
	 * Width and height of the video
sl@0
   202
	 */
sl@0
   203
    TRect	iDispRect;
sl@0
   204
    /**
sl@0
   205
	 * For management the Open files
sl@0
   206
	 */
sl@0
   207
	TBool	iFileOpen;
sl@0
   208
	/**
sl@0
   209
	 * for get the coded buffer
sl@0
   210
	 */
sl@0
   211
	TVideoInputBuffer* iCodedInBuffer;
sl@0
   212
	/**
sl@0
   213
	 * Output buffer
sl@0
   214
	 */
sl@0
   215
    TVideoPicture* iOutBuffer;
sl@0
   216
    /**
sl@0
   217
	 * 
sl@0
   218
	 */
sl@0
   219
    TVideoPicture* iRawInBuffer;
sl@0
   220
    /**
sl@0
   221
	 * For synch the time
sl@0
   222
	 */
sl@0
   223
    TInt64	iTimeStamp;
sl@0
   224
    /**
sl@0
   225
	 * Time interval in each frame
sl@0
   226
	 */
sl@0
   227
    TInt64	iFrameTimeInterval;
sl@0
   228
    /**
sl@0
   229
	 * Buffer control
sl@0
   230
	 */
sl@0
   231
    TInt	iSentBuffCount;
sl@0
   232
    /**
sl@0
   233
	 * Buffer control
sl@0
   234
	 */
sl@0
   235
    TInt	iReturnedBuffCount;
sl@0
   236
    /**
sl@0
   237
	 * Loss Pictures
sl@0
   238
	 */
sl@0
   239
    TInt	iPictureLoss;
sl@0
   240
    /**
sl@0
   241
	 * The end of the stream
sl@0
   242
	 */
sl@0
   243
    TBool	iStreamEnd;
sl@0
   244
    /**
sl@0
   245
	 * Type of codec
sl@0
   246
	 */
sl@0
   247
    TVideoCodec iCodecType;
sl@0
   248
    /**
sl@0
   249
	 * Management of the time between frames
sl@0
   250
	 */
sl@0
   251
    CSystemClockSource* iClock;
sl@0
   252
    /**
sl@0
   253
	 * Direct Access at the Screen
sl@0
   254
	 */
sl@0
   255
    TBool	iDirectScreenAccess;
sl@0
   256
    /**
sl@0
   257
	 * for handle the buffer
sl@0
   258
	 */
sl@0
   259
    TBool	iCIBuffMgmtOn;
sl@0
   260
    /**
sl@0
   261
	 * For measurement of the frame
sl@0
   262
	 */
sl@0
   263
    TBool	iFrameMeasurement;
sl@0
   264
    /**
sl@0
   265
	 * for H264
sl@0
   266
	 */
sl@0
   267
    RArray<TInt> iFrameSizeList;
sl@0
   268
    /**
sl@0
   269
	 * frame rate(fps)
sl@0
   270
	 */
sl@0
   271
    TInt iFramerate;
sl@0
   272
    /**
sl@0
   273
	 *  File Server
sl@0
   274
	 */
sl@0
   275
    RFs   iFs;  
sl@0
   276
    /**
sl@0
   277
	 * Input file
sl@0
   278
	 */
sl@0
   279
    RFile iInFile;
sl@0
   280
    /**
sl@0
   281
	 * Ouput file
sl@0
   282
	 */
sl@0
   283
    RFile iOutFile;	
sl@0
   284
    /**
sl@0
   285
	 *  Fbs
sl@0
   286
	 */
sl@0
   287
    CFbsScreenDevice* iScreenDevice;  
sl@0
   288
    /**
sl@0
   289
	 * Common format between Post processor and decoder
sl@0
   290
	 */
sl@0
   291
    TUncompressedVideoFormat iCommonFormat;
sl@0
   292
    /**
sl@0
   293
	 * Decoder read from the ini file
sl@0
   294
	 */
sl@0
   295
    TUid iSelectDecoder;
sl@0
   296
    /**
sl@0
   297
	 * Post processor read from the ini file
sl@0
   298
	 */
sl@0
   299
    TUid iSelectPostProcessor;
sl@0
   300
    /**
sl@0
   301
	 * Formats Decoder
sl@0
   302
	 */
sl@0
   303
    RArray<TUncompressedVideoFormat> iDecFormats;
sl@0
   304
    /**
sl@0
   305
	 * Post processor formats
sl@0
   306
	 */
sl@0
   307
    RArray<TUncompressedVideoFormat> iPPFormats;
sl@0
   308
    /**
sl@0
   309
	 * Information about the post processor
sl@0
   310
	 */
sl@0
   311
    CPostProcessorInfo* iInfo; 
sl@0
   312
    /**
sl@0
   313
	 * if exist information for header info
sl@0
   314
	 */
sl@0
   315
    TVideoPictureHeader* iHeaderInfo;
sl@0
   316
    /**
sl@0
   317
	 * Buffer options
sl@0
   318
	 */
sl@0
   319
    CMMFDevVideoPlay::TBufferOptions iBufferOptions;
sl@0
   320
    /**
sl@0
   321
	 * The common format
sl@0
   322
	 */
sl@0
   323
    TBool iCommonFormatFound;  
sl@0
   324
    /**
sl@0
   325
     * To Control the errors in GetInputBuffer
sl@0
   326
     */
sl@0
   327
    TBool iErrorInputBuffer;
sl@0
   328
    /**
sl@0
   329
	 * Enum for codecs
sl@0
   330
	 */   
sl@0
   331
    static const TEnumEntryTable iCodecs[];
sl@0
   332
    /**
sl@0
   333
	 * Enum for Display mode
sl@0
   334
	 */
sl@0
   335
    static const TEnumEntryTable iDisplayModes[];
sl@0
   336
    /**
sl@0
   337
	 * Enum for rotations
sl@0
   338
	 */
sl@0
   339
    static const TEnumEntryTable iRotations[];
sl@0
   340
    /**
sl@0
   341
	 * Enum for Video Data Unit Types
sl@0
   342
	 */
sl@0
   343
    static const TEnumEntryTable iTVideoDataUnitType[];
sl@0
   344
    /**
sl@0
   345
	 * Enum for Video Data Unit Encapsulation
sl@0
   346
	 */
sl@0
   347
    static const TEnumEntryTable iTVideoDataUnitEncapsulation[];
sl@0
   348
    
sl@0
   349
    /**
sl@0
   350
     * H264
sl@0
   351
     */
sl@0
   352
    CVDecTestEngine* iEngine;
sl@0
   353
    CEngineObserver* iObserver;
sl@0
   354
    TBool iUse264;
sl@0
   355
    TInt iFrameRate;
sl@0
   356
	};
sl@0
   357
	
sl@0
   358
	
sl@0
   359
#endif // T_CMMFDEVVIDEODATA_H
sl@0
   360