1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 #ifndef TEST_PV_PLAYER_ENGINE_TESTSET9_H_INCLUDED 19 #define TEST_PV_PLAYER_ENGINE_TESTSET9_H_INCLUDED 20 21 /** 22 * @file test_pv_player_engine_testset9.h 23 * @brief This file contains the class definitions for the ninth set of 24 * test cases for PVPlayerEngine - Generic(local, PDL & streaming) reset tests 25 * 26 */ 27 28 #ifndef TEST_PV_PLAYER_ENGINE_H_INCLUDED 29 #include "test_pv_player_engine.h" 30 #endif 31 32 #ifndef TEST_PV_PLAYER_ENGINE_CONFIG_H_INCLUDED 33 #include "test_pv_player_engine_config.h" 34 #endif 35 36 #ifndef PVMF_STREAMING_DATA_SOURCE_H_INCLUDED 37 #include "pvmf_streaming_data_source.h" 38 #endif 39 40 #if RUN_FASTTRACK_TESTCASES 41 #ifndef PVPVXPARSER_H_INCLUDED 42 #include "pvpvxparser.h" 43 #endif 44 #endif 45 46 #ifndef PVMF_DOWNLOAD_DATA_SOURCE_H_INCLUDED 47 #include "pvmf_download_data_source.h" 48 #endif 49 50 #ifndef PVMF_SOURCE_CONTEXT_DATA_H_INCLUDED 51 #include "pvmf_source_context_data.h" 52 #endif 53 54 #define AMR_MPEG4_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv-amr-475_mpeg4-20.3gp" 55 #define AMR_MPEG4_RTSP_URL_2 "rtsp://pvserveroha.pv.com/public/metadata/pvmetadata.mp4" 56 #define H263_AMR_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv-amr-122_h263-64.3gp" 57 #define MPEG4_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv-mpeg4rdatapartr64.3gp" 58 #define MPEG4_SHRT_HDR_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv-mpeg4shorthdrr64.3gp" 59 #define AAC_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv-aac64_novisual.3gp" 60 #define MPEG4_AAC_RTSP_URL "rtsp://pvserveroha.pv.com/public/Interop/3GPP/pv2/pv2-aac64_mpeg4-rvlcs-64.3gp" 61 #define AMR_MPEG4_SDP_FILE "pv_amr_mpeg4.sdp" 62 63 class PVPlayerDataSourceURL; 64 class PVPlayerDataSink; 65 class PVPlayerDataSink; 66 class PVPlayerDataSinkFilename; 67 class PvmfFileOutputNodeConfigInterface; 68 class PvmiCapabilityAndConfig; 69 class PVMFDownloadDataSourcePVX; 70 71 72 /*! 73 * Test cases to test Reset() call (right after/while processing) each state while playing an local/PDL/rtsp url 74 * - Data Source: Specified by user of test case 75 * - Data Sink(s): Video[FileOutputNode-test_player_genericreset_video.dat]\n 76 * Audio[FileOutputNode-test_player_genericreset_audio.dat] 77 * - Sequence: 78 * -# CreatePlayer() 79 * -# Reset() is called after/in one of the following states based on the test case 80 * -# AddDataSource() 81 * -# Init() 82 * -# AddDataSink() (video) 83 * -# AddDataSink() (audio) 84 * -# Prepare() 85 * -# Start() 86 * -# Play 10 sec 87 * -# SetPlaybackRange() if seekEnable flag is made true 88 * -# Pause() if pauseresumeEnable flag is made true 89 * -# WAIT 10 sec 90 * -# Resume() 91 * -# Play until EOS 92 * -# Stop() 93 * -# RemoveDataSink() (video) 94 * -# RemoveDataSink() (audio) 95 * -# Reset() 96 * -# RemoveDataSource() 97 * -# DeletePlayer() 98 * 99 */ 100 class pvplayer_async_test_genericreset : public pvplayer_async_test_base 101 { 102 public: pvplayer_async_test_genericreset(PVPlayerAsyncTestParam aTestParam,PVMFFormatType aVideoSinkFormat,PVMFFormatType aAudioSinkFormat,uint32 aTestID,bool aPauseResumeEnable,bool aSeekEnable,bool aWaitForEOS,bool aCloaking,bool aCancelDuringPrepare,int lastState)103 pvplayer_async_test_genericreset(PVPlayerAsyncTestParam aTestParam, 104 PVMFFormatType aVideoSinkFormat, 105 PVMFFormatType aAudioSinkFormat, 106 uint32 aTestID, 107 bool aPauseResumeEnable, 108 bool aSeekEnable, 109 bool aWaitForEOS, 110 bool aCloaking, 111 bool aCancelDuringPrepare, 112 int lastState) 113 : pvplayer_async_test_base(aTestParam) 114 , iPlayer(NULL) 115 , iDataSource(NULL) 116 , iDataSinkVideo(NULL) 117 , iDataSinkAudio(NULL) 118 , iIONodeVideo(NULL) 119 , iIONodeAudio(NULL) 120 , iMIOFileOutVideo(NULL) 121 , iMIOFileOutAudio(NULL) 122 , iCurrentCmdId(0) 123 , iCancelAllCmdId(0) 124 , iSessionDuration(0) 125 , bcloaking(aCloaking) 126 , oLiveSession(false) 127 , iProtocolRollOver(false) 128 , iProtocolRollOverWithUnknownURLType(false) 129 , iPlayListURL(false) 130 , iStreamDataSource(NULL) 131 , iSourceContextData(NULL) 132 , iDownloadContextDataPVX(NULL) 133 , iPlayStarted(false) 134 , iSeekDone(false) 135 { 136 iVideoSinkFormatType = aVideoSinkFormat; 137 iAudioSinkFormatType = aAudioSinkFormat; 138 oPauseResumeEnable = aPauseResumeEnable; 139 oSeekEnable = aSeekEnable; 140 oWaitForEOS = aWaitForEOS; 141 oCancelDuringPrepare = aCancelDuringPrepare; 142 iTestID = aTestID; 143 iNumPlay = 0; 144 iTargetNumPlay = 1; 145 iNumBufferingStart = iNumBufferingComplete = iNumUnderflow = iNumDataReady = iNumEOS = 0; 146 iDownloadOnly = iDownloadThenPlay = false; 147 iEndState = (PVTestState)lastState; 148 } 149 ~pvplayer_async_test_genericreset()150 ~pvplayer_async_test_genericreset() {} 151 152 void StartTest(); 153 void Run(); 154 155 void CommandCompleted(const PVCmdResponse& aResponse); 156 void HandleErrorEvent(const PVAsyncErrorEvent& aEvent); 157 void HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent); 158 159 PVTestState iState; 160 PVTestState iEndState; 161 162 PVPlayerInterface* iPlayer; 163 PVPlayerDataSourceURL* iDataSource; 164 PVPlayerDataSink* iDataSinkVideo; 165 PVPlayerDataSink* iDataSinkAudio; 166 PVMFNodeInterface* iIONodeVideo; 167 PVMFNodeInterface* iIONodeAudio; 168 PvmiMIOControl* iMIOFileOutVideo; 169 PvmiMIOControl* iMIOFileOutAudio; 170 PVCommandId iCurrentCmdId; 171 PVCommandId iCancelAllCmdId; 172 173 setMultiplePlayMode(uint32 aNum)174 void setMultiplePlayMode(uint32 aNum) 175 { 176 iMultiplePlay = true; 177 iTargetNumPlay = aNum; 178 } 179 setProtocolRollOverMode()180 void setProtocolRollOverMode() 181 { 182 iProtocolRollOver = true; 183 } 184 setProtocolRollOverModeWithUnknownURL()185 void setProtocolRollOverModeWithUnknownURL() 186 { 187 iProtocolRollOverWithUnknownURLType = true; 188 } 189 setPlayListMode()190 void setPlayListMode() 191 { 192 iPlayListURL = true; 193 } 194 195 private: 196 void HandleSocketNodeErrors(int32 aErr); 197 void HandleRTSPNodeErrors(int32 aErr); 198 void HandleStreamingManagerNodeErrors(int32 aErr); 199 void HandleJitterBufferNodeErrors(int32 aErr); 200 void HandleMediaLayerNodeErrors(int32 aErr); 201 void HandleProtocolEngineNodeErrors(int32 aErr); 202 203 204 void PrintMetadataInfo(); 205 206 PVMFFormatType iVideoSinkFormatType; 207 PVMFFormatType iAudioSinkFormatType; 208 OSCL_wHeapString<OsclMemAllocator> wFileName; 209 oscl_wchar output[512]; 210 bool oPauseResumeEnable; 211 bool oSeekEnable; 212 bool oCancelDuringPrepare; 213 bool oWaitForEOS; 214 uint32 iTestID; 215 216 PVPMetadataList iMetadataKeyList; 217 Oscl_Vector<PvmiKvp, OsclMemAllocator> iMetadataValueList; 218 int32 iNumValues; 219 220 uint32 iSessionDuration; 221 bool bcloaking; 222 bool oLiveSession; 223 224 bool iMultiplePlay; 225 uint32 iNumPlay; 226 uint32 iTargetNumPlay; 227 228 bool iProtocolRollOver; 229 bool iProtocolRollOverWithUnknownURLType; 230 bool iPlayListURL; 231 232 PvmiCapabilityAndConfig* iPlayerCapConfigIF; 233 PvmiKvp* iErrorKVP; 234 PvmiKvp iKVPSetAsync; 235 OSCL_StackString<128> iKeyStringSetAsync; 236 237 PVMFStreamingDataSource* iStreamDataSource; 238 PVMFSourceContextData* iSourceContextData; 239 char iClipType[100]; 240 //FTDL 241 void CreateDownloadDataSource(); 242 uint8 iPVXFileBuf[4096]; 243 PVMFDownloadDataSourcePVX* iDownloadContextDataPVX; 244 PVMFDownloadDataSourceHTTP* iDownloadContextDataHTTP; 245 int32 iDownloadMaxfilesize; 246 #if RUN_FASTTRACK_TESTCASES 247 CPVXInfo iDownloadPvxInfo; 248 #endif 249 OSCL_wHeapString<OsclMemAllocator> iDownloadURL; 250 OSCL_wHeapString<OsclMemAllocator> iDownloadFilename; 251 OSCL_HeapString<OsclMemAllocator> iDownloadProxy; 252 OSCL_wHeapString<OsclMemAllocator> iDownloadConfigFilename; 253 int32 iNumBufferingStart, iNumBufferingComplete, iNumUnderflow, iNumDataReady, iNumEOS; 254 bool iDownloadOnly, iDownloadThenPlay; 255 bool iContentTooLarge; 256 bool iPlayStarted, iSeekDone; 257 }; 258 259 #endif 260