1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmapitest/devvideohaitest/inc/t_cmmfdevvideoplaydata.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,360 @@
1.4 +/*
1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +#ifndef T_CMMFDEVVIDEODATA_H
1.24 +#define T_CMMFDEVVIDEODATA_H
1.25 +
1.26 +//Epoc includes
1.27 +#include <e32base.h>
1.28 +#include <e32std.h>
1.29 +#include <f32file.h>
1.30 +#include <videoplayhwdevice.h>
1.31 +#include <devvideoplay.h>
1.32 +#include <devvideobase.h>
1.33 +#include <bitdev.h> // for display device
1.34 +#include <fbs.h>
1.35 +//User Includes
1.36 +#include "datawrapperbase.h"
1.37 +#include "t_devvideoconstants.h"
1.38 +#include "H264DecTestEngine.h"
1.39 +
1.40 +enum TVideoDecoderOutput
1.41 + {
1.42 + EDecodedFile = 0,
1.43 + EScreenOutput
1.44 + };
1.45 +
1.46 +//Forward declarations
1.47 +class CT_CMMFDevVideoPlay;
1.48 +
1.49 +//Engine observer handle Async request completeion and release waitclass of Test scriptor
1.50 +
1.51 +class CEngineObserver: public CBase, public MVDecEngineObserver
1.52 +{
1.53 +public:
1.54 + void MvdeStreamEndReached();
1.55 + void MvdeSetError(TInt aError);
1.56 + ~CEngineObserver() {}
1.57 + CEngineObserver(CT_CMMFDevVideoPlay& aTestClass);
1.58 +
1.59 +private:
1.60 + CT_CMMFDevVideoPlay& iTestClass;
1.61 +
1.62 +};
1.63 +/**
1.64 + * Test Active Notification class
1.65 + *
1.66 + */
1.67 +class CT_CMMFDevVideoPlay : public CDataWrapperBase, MMMFDevVideoPlayObserver
1.68 + {
1.69 +public:
1.70 +
1.71 + ~CT_CMMFDevVideoPlay();
1.72 + virtual TAny* GetObject();
1.73 + virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
1.74 + static CT_CMMFDevVideoPlay* NewL();
1.75 + void DestroyData();
1.76 + TInt ReadOneCodedPicture(TVideoInputBuffer* aCodedInBuffer, TInt aSize);
1.77 + TInt ReadOneCodedPicture(TVideoInputBuffer* aCodedInBuffer);
1.78 + TInt ReadRawPicture();
1.79 + void OpenFileL(TFileName& aInFileName);
1.80 + void OpenFileL(TFileName& aOutFileName, TFileName& aInFileName);
1.81 + void CloseFile();
1.82 + void ListFrameSizeL(TVideoCodec aCodec);
1.83 + void AbortDirectScreenAccess();
1.84 + void StartDirectScreenAccessL();
1.85 + void HandleRuntimeError(TInt aError);
1.86 + void SaveAndReturnPicture();
1.87 + void GetReturnedPicture();
1.88 + void FillAndSendBufferL();
1.89 + void GetInputBuffer();
1.90 + void HandleNewBufferL();
1.91 + void SetWindowRect(TInt aX, TInt aY, TSize aSize);
1.92 + void CreateFiles(const TTEFSectionName& aSection);
1.93 + void InitializeParamsL(const TTEFSectionName& aSection);
1.94 + void MdvpoNewBuffers();
1.95 + void MdvpoReturnPicture(TVideoPicture* aPicture);
1.96 + void MdvpoSupplementalInformation(const TDesC8& aData, const TTimeIntervalMicroSeconds& aTimestamp, const TPictureId& aPictureId);
1.97 + void MdvpoPictureLoss();
1.98 + void MdvpoPictureLoss(const TArray<TPictureId>& aPictures);
1.99 + void MdvpoSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture);
1.100 + void MdvpoReferencePictureSelection(const TDesC8& aSelectionData);
1.101 + void MdvpoTimedSnapshotComplete(TInt aError, TPictureData* aPictureData, const TTimeIntervalMicroSeconds& aPresentationTimestamp, const TPictureId& aPictureId);
1.102 + void MdvpoNewPictures();
1.103 + void MdvpoFatalError(TInt aError);
1.104 + void MdvpoInitComplete(TInt aError);
1.105 + void MdvpoStreamEnd();
1.106 +protected:
1.107 + CT_CMMFDevVideoPlay();
1.108 + void ConstructL();
1.109 +private:
1.110 + void DoCmdInitialize(const TInt aAsyncErrorIndex);
1.111 + void DoCmdStart(const TInt aAsyncErrorIndex);
1.112 + void DoCmdStop();
1.113 + void DoCmdPause();
1.114 + void DoCmdResume();
1.115 + void DoCmdSetRotateOptionsL(const TTEFSectionName& aSection);
1.116 + void DoCmdSetScaleOptionsL(const TTEFSectionName& aSection);
1.117 + void DoCmdSetPosition(const TTEFSectionName& aSection);
1.118 + void DoCmdSetClockSource(const TTEFSectionName& aSection);
1.119 + void DoCmdNewL(const TTEFSectionName& aSection);
1.120 + void DoCmdSelectDecoderL(const TTEFSectionName& aSection);
1.121 + void DoCmdSetInputFormatL(const TTEFSectionName& aSection);
1.122 + void DoCmdSelectPostProcessorL(const TTEFSectionName& aSection);
1.123 + void DoCmdGetOutputFormatListL(const TTEFSectionName& aSection);
1.124 + void DoCmdPostProcessorInfoLC();
1.125 + void DoCmdFindCommonFormat();
1.126 + void DoCmdSetOutputFormatL(const TTEFSectionName& aSection);
1.127 + void DoCmdGetHeaderInformationL(const TTEFSectionName& aSection);
1.128 + void DoCmdSetVideoDestScreenL();
1.129 + void DoCmdGetBufferOptions();
1.130 + void DoCmdSetBufferOptionsL();
1.131 + void DoCmdSetPostProcessTypesL(const TTEFSectionName& aSection);
1.132 + void DoCmdReturnHeader();
1.133 + void DoCmdDestructor();
1.134 + void DoCmdAbortDirectScreenAccess();
1.135 + void DoCmdStartDirectScreenAccessL(const TTEFSectionName& aSection);
1.136 + void DoCmdUtilityGetEnvironmentL();
1.137 +
1.138 + void DoCmdH264CreateDecTest(const TTEFSectionName& aSection);
1.139 + void DoCmdH264SelectPostProcessor(const TTEFSectionName& aSection);
1.140 + void DoCmdH264SetPostProcessTypes(const TTEFSectionName& aSection);
1.141 + void DoCmdH264SetInputFormatCompr(const TTEFSectionName& aSection);
1.142 + void DoCmdH264SetOutputFormat(const TTEFSectionName& aSection);
1.143 + void DoCmdH264SetBufferOptions(const TTEFSectionName& aSection);
1.144 + void DoCmdH264ListFrameSize();
1.145 + void DoCmdH264SetVideoDestScreen(const TTEFSectionName& aSection);
1.146 + void DoCmdH264SetWindowRect(const TTEFSectionName& aSection);
1.147 + void DoCmdH264Initialize();
1.148 + void DoCmdH264Start(const TTEFSectionName& aSection);
1.149 + void DoCmdH264Stop();
1.150 + void DoCmdH264Pause();
1.151 + void DoCmdH264Resume();
1.152 + void DoCmdH264IOFrameNumMatch();
1.153 + void DoCmdH264FindCommonFormats();
1.154 + void DoCmdH264GetHeaderInformation(const TTEFSectionName& aSection);
1.155 + void DoCmdH264EnableSynchronization(const TTEFSectionName& aSection);
1.156 + void DoCmdH264SetScaleOptions(const TTEFSectionName& aSection);
1.157 + void DoCmdH264SetRotateOptions(const TTEFSectionName& aSection);
1.158 + void DoCmdH264SynchronizeDecoding(const TTEFSectionName& aSection);
1.159 + void DoCmdH264Delete();
1.160 + void DoCmdH264SetPosition(const TTEFSectionName& aSection);
1.161 + void DoCmdH264AbortDirectScreenAccess();
1.162 +private:
1.163 + /**
1.164 + * Wrapped object
1.165 + */
1.166 + CMMFDevVideoPlay* iDevvp;
1.167 + /**
1.168 + * For selected decoder
1.169 + */
1.170 + THwDeviceId iDecHWDevId;
1.171 + /**
1.172 + * For selected Post processor
1.173 + */
1.174 + THwDeviceId iPostProcId;
1.175 + /**
1.176 + * Size of video buffer
1.177 + */
1.178 + TInt iInBuffSize;
1.179 + /**
1.180 + * Control the number of inputs
1.181 + */
1.182 + TBool iInputEnd;
1.183 + /**
1.184 + * Direct Screen Access
1.185 + */
1.186 + TBool iDsaStarted;
1.187 + /**
1.188 + * For synchronize the clock(fps)
1.189 + */
1.190 + TBool iSynchronized;
1.191 + /**
1.192 + * Listed frames
1.193 + */
1.194 + TBool iFrameListed;
1.195 + /**
1.196 + * The size of the picture
1.197 + */
1.198 + TSize iPictureSize;
1.199 + /**
1.200 + * Async error
1.201 + */
1.202 + TInt iAsyncErrorIndex;
1.203 + /**
1.204 + * Width and height of the video
1.205 + */
1.206 + TRect iDispRect;
1.207 + /**
1.208 + * For management the Open files
1.209 + */
1.210 + TBool iFileOpen;
1.211 + /**
1.212 + * for get the coded buffer
1.213 + */
1.214 + TVideoInputBuffer* iCodedInBuffer;
1.215 + /**
1.216 + * Output buffer
1.217 + */
1.218 + TVideoPicture* iOutBuffer;
1.219 + /**
1.220 + *
1.221 + */
1.222 + TVideoPicture* iRawInBuffer;
1.223 + /**
1.224 + * For synch the time
1.225 + */
1.226 + TInt64 iTimeStamp;
1.227 + /**
1.228 + * Time interval in each frame
1.229 + */
1.230 + TInt64 iFrameTimeInterval;
1.231 + /**
1.232 + * Buffer control
1.233 + */
1.234 + TInt iSentBuffCount;
1.235 + /**
1.236 + * Buffer control
1.237 + */
1.238 + TInt iReturnedBuffCount;
1.239 + /**
1.240 + * Loss Pictures
1.241 + */
1.242 + TInt iPictureLoss;
1.243 + /**
1.244 + * The end of the stream
1.245 + */
1.246 + TBool iStreamEnd;
1.247 + /**
1.248 + * Type of codec
1.249 + */
1.250 + TVideoCodec iCodecType;
1.251 + /**
1.252 + * Management of the time between frames
1.253 + */
1.254 + CSystemClockSource* iClock;
1.255 + /**
1.256 + * Direct Access at the Screen
1.257 + */
1.258 + TBool iDirectScreenAccess;
1.259 + /**
1.260 + * for handle the buffer
1.261 + */
1.262 + TBool iCIBuffMgmtOn;
1.263 + /**
1.264 + * For measurement of the frame
1.265 + */
1.266 + TBool iFrameMeasurement;
1.267 + /**
1.268 + * for H264
1.269 + */
1.270 + RArray<TInt> iFrameSizeList;
1.271 + /**
1.272 + * frame rate(fps)
1.273 + */
1.274 + TInt iFramerate;
1.275 + /**
1.276 + * File Server
1.277 + */
1.278 + RFs iFs;
1.279 + /**
1.280 + * Input file
1.281 + */
1.282 + RFile iInFile;
1.283 + /**
1.284 + * Ouput file
1.285 + */
1.286 + RFile iOutFile;
1.287 + /**
1.288 + * Fbs
1.289 + */
1.290 + CFbsScreenDevice* iScreenDevice;
1.291 + /**
1.292 + * Common format between Post processor and decoder
1.293 + */
1.294 + TUncompressedVideoFormat iCommonFormat;
1.295 + /**
1.296 + * Decoder read from the ini file
1.297 + */
1.298 + TUid iSelectDecoder;
1.299 + /**
1.300 + * Post processor read from the ini file
1.301 + */
1.302 + TUid iSelectPostProcessor;
1.303 + /**
1.304 + * Formats Decoder
1.305 + */
1.306 + RArray<TUncompressedVideoFormat> iDecFormats;
1.307 + /**
1.308 + * Post processor formats
1.309 + */
1.310 + RArray<TUncompressedVideoFormat> iPPFormats;
1.311 + /**
1.312 + * Information about the post processor
1.313 + */
1.314 + CPostProcessorInfo* iInfo;
1.315 + /**
1.316 + * if exist information for header info
1.317 + */
1.318 + TVideoPictureHeader* iHeaderInfo;
1.319 + /**
1.320 + * Buffer options
1.321 + */
1.322 + CMMFDevVideoPlay::TBufferOptions iBufferOptions;
1.323 + /**
1.324 + * The common format
1.325 + */
1.326 + TBool iCommonFormatFound;
1.327 + /**
1.328 + * To Control the errors in GetInputBuffer
1.329 + */
1.330 + TBool iErrorInputBuffer;
1.331 + /**
1.332 + * Enum for codecs
1.333 + */
1.334 + static const TEnumEntryTable iCodecs[];
1.335 + /**
1.336 + * Enum for Display mode
1.337 + */
1.338 + static const TEnumEntryTable iDisplayModes[];
1.339 + /**
1.340 + * Enum for rotations
1.341 + */
1.342 + static const TEnumEntryTable iRotations[];
1.343 + /**
1.344 + * Enum for Video Data Unit Types
1.345 + */
1.346 + static const TEnumEntryTable iTVideoDataUnitType[];
1.347 + /**
1.348 + * Enum for Video Data Unit Encapsulation
1.349 + */
1.350 + static const TEnumEntryTable iTVideoDataUnitEncapsulation[];
1.351 +
1.352 + /**
1.353 + * H264
1.354 + */
1.355 + CVDecTestEngine* iEngine;
1.356 + CEngineObserver* iObserver;
1.357 + TBool iUse264;
1.358 + TInt iFrameRate;
1.359 + };
1.360 +
1.361 +
1.362 +#endif // T_CMMFDEVVIDEODATA_H
1.363 +