sl@0: // Copyright (c) 2003-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: #include "decoder.h" sl@0: #include "../TestDevVideoPlayTestData.h" sl@0: sl@0: _LIT(KDevVideoDecoderPanicCategory, "DevVideoDecoder"); sl@0: void DevVideoDecoderPanic(TInt aReason) sl@0: { sl@0: User::Panic(KDevVideoDecoderPanicCategory, aReason); sl@0: } sl@0: sl@0: CMMFVideoDecodeHwDevice* CMMFTestVideoDecodeHwDevice::NewL(TAny* /*aInitParams*/) sl@0: { sl@0: CMMFTestVideoDecodeHwDevice* s = new(ELeave) CMMFTestVideoDecodeHwDevice; sl@0: return (STATIC_CAST(CMMFVideoDecodeHwDevice*, s)); sl@0: } sl@0: sl@0: CMMFTestVideoDecodeHwDevice::CMMFTestVideoDecodeHwDevice() sl@0: :iExtensionUid(KUidDevVideoPlayHwDeviceExtensionScanCopy) sl@0: { sl@0: } sl@0: sl@0: CMMFTestVideoDecodeHwDevice::~CMMFTestVideoDecodeHwDevice() sl@0: { sl@0: // destroy objects in RArray sl@0: for (TInt i = 0; i < iVidFormats.Count(); i++) sl@0: { sl@0: delete iVidFormats[i]; sl@0: } sl@0: sl@0: iVidFormats.Reset(); sl@0: iVidFormats.Close(); sl@0: sl@0: iPictureRates.Reset(); sl@0: iPictureRates.Close(); sl@0: sl@0: iCombinations.Reset(); sl@0: iCombinations.Close(); sl@0: sl@0: iPostProcVidFormats.Reset(); sl@0: iPostProcVidFormats.Close(); sl@0: sl@0: iScaleFactors.Reset(); sl@0: iScaleFactors.Close(); sl@0: sl@0: delete iBufferDataArea; sl@0: } sl@0: sl@0: TAny* CMMFTestVideoDecodeHwDevice::CustomInterface(TUid aInterface) sl@0: { sl@0: if (aInterface == KUidCustomInterfaceOne) sl@0: { sl@0: return this;//just want to return something non-null! sl@0: } sl@0: else if (aInterface == iExtensionUid) sl@0: { sl@0: return static_cast(this); sl@0: } sl@0: else sl@0: { sl@0: return NULL; sl@0: } sl@0: } sl@0: sl@0: // post processor info may be obtained from this plugin or the post processor plugin sl@0: CPostProcessorInfo* CMMFTestVideoDecodeHwDevice::PostProcessorInfoLC() sl@0: { sl@0: // construct array of test types sl@0: for (TUint i = 0; i < KTestPostProcInfoCount; i++) sl@0: { sl@0: // append the video formats sl@0: TUncompressedVideoFormat vid = KTestPostProcInfoFormatArray[i]; sl@0: User::LeaveIfError(iPostProcVidFormats.Append(vid)); sl@0: sl@0: // append the combinations sl@0: TUint32 comb = KTestPostProcInfoCombsArray[i]; sl@0: User::LeaveIfError(iCombinations.Append(comb)); sl@0: sl@0: // append the scale factors sl@0: TScaleFactor scale = KTestPostProcInfoScaleFactorsArray[i]; sl@0: User::LeaveIfError(iScaleFactors.Append(scale)); sl@0: } sl@0: sl@0: // construct the video decoder info object sl@0: CPostProcessorInfo* info = CPostProcessorInfo::NewL( KUidDevVideoTestDecodeHwDevice, sl@0: KTestPostProcInfoManufacturer, sl@0: KTestPostProcInfoIdentifier, sl@0: TVersion(KTestPostProcInfoVersionMaj, sl@0: KTestPostProcInfoVersionMin, sl@0: KTestPostProcInfoVersionBuild), sl@0: iPostProcVidFormats.Array(), sl@0: iCombinations.Array(), sl@0: ETrue, // accelerated sl@0: ETrue, // direct display support sl@0: KTestPostProcInfoYuvToRgbCaps, sl@0: KTestPostProcInfoRotations, sl@0: ETrue, // scaling sl@0: iScaleFactors.Array(), sl@0: ETrue, // anti-aliasing sl@0: KTestDecoderInfoISInfo ); sl@0: CleanupStack::PushL(info); sl@0: sl@0: return info; sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::GetOutputFormatListL(RArray& aFormats) sl@0: { sl@0: // append in order 1, 2, 3 sl@0: User::LeaveIfError(aFormats.Append(KTestVidFormat1)); sl@0: User::LeaveIfError(aFormats.Append(KTestVidFormat2)); sl@0: User::LeaveIfError(aFormats.Append(KTestVidFormat3)); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetOutputFormatL(const TUncompressedVideoFormat &aFormat) sl@0: { sl@0: if (!(aFormat == KTestVidFormat1)) sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetPostProcessTypesL(TUint32 aPostProcCombination) sl@0: { sl@0: if (!(aPostProcCombination == KTestProcessType1)) sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetInputCropOptionsL(const TRect& aRect) sl@0: { sl@0: TRect testRect(KTestInputCropRectA, KTestInputCropRectB, KTestInputCropRectC, KTestInputCropRectD); sl@0: if (!(aRect == testRect)) sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions, const TYuvFormat& aYuvFormat, TRgbFormat aRgbFormat) sl@0: { sl@0: // check options first sl@0: if (!CompareYuvRgbOptions(aOptions, KTestYuvToRgb1)) sl@0: User::Leave(KErrCorrupt); sl@0: sl@0: // now check formats sl@0: if ( !(CompareYuvFormats(aYuvFormat, KTestYuvFormat1)) || sl@0: !(aRgbFormat == KTestRgbFormat1) ) sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions) sl@0: { sl@0: if (!CompareYuvRgbOptions(aOptions, KTestYuvToRgb1)) sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetRotateOptionsL(TRotationType aRotationType) sl@0: { sl@0: if (!(aRotationType == KTestRotate1)) sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetScaleOptionsL(const TSize& aTargetSize, TBool aAntiAliasFiltering) sl@0: { sl@0: TSize testScale(KTestScaleX, KTestScaleY); sl@0: if (!(aTargetSize == testScale) || !aAntiAliasFiltering) sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetOutputCropOptionsL(const TRect& aRect) sl@0: { sl@0: TRect testRect(KTestOutputCropRectA, KTestOutputCropRectB, KTestOutputCropRectC, KTestOutputCropRectD); sl@0: if (!(aRect == testRect)) sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetPostProcSpecificOptionsL(const TDesC8& aOptions) sl@0: { sl@0: if (!(aOptions == KTestPostProcOptions1)) sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetClockSource(MMMFClockSource* aClock) sl@0: { sl@0: __ASSERT_ALWAYS(aClock, DevVideoDecoderPanic(EDecoderPanicClockSource)); sl@0: sl@0: // call Time() to check that clock can be used sl@0: TTimeIntervalMicroSeconds currTime(0); // done this way to remove compiler warning sl@0: currTime = aClock->Time(); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetVideoDestScreenL(TBool /*aScreen*/) sl@0: { sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::Initialize() sl@0: { sl@0: iProxy->MdvppInitializeComplete(this, KErrNone); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::StartDirectScreenAccessL(const TRect& aVideoRect, CFbsScreenDevice& /*aScreenDevice*/, const TRegion& aClipRegion) sl@0: { sl@0: TRect dsaRect(KTestDSARectA, KTestDSARectB, KTestDSARectC, KTestDSARectD); sl@0: TRegionFix<1> dsaReg(dsaRect); sl@0: sl@0: // probably no need to check aScreenDevice sl@0: if ( /*!(&aScreenDevice) || */!(dsaRect == aVideoRect) || sl@0: !(dsaReg.BoundingRect() == aClipRegion.BoundingRect()) ) sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetScreenClipRegion(const TRegion& aRegion) sl@0: { sl@0: TRect dsaRect(KTestDSARectA, KTestDSARectB, KTestDSARectC, KTestDSARectD); sl@0: TRegionFix<1> dsaReg(dsaRect); sl@0: sl@0: __ASSERT_ALWAYS(dsaReg.BoundingRect() == aRegion.BoundingRect(), sl@0: DevVideoDecoderPanic(EDecoderPanicScreenClipRegion)); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetPauseOnClipFail(TBool aPause) sl@0: { sl@0: __ASSERT_ALWAYS(aPause, DevVideoDecoderPanic(EDecoderPanicPauseClipFail)); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::AbortDirectScreenAccess() sl@0: { sl@0: // do something here? sl@0: } sl@0: sl@0: TBool CMMFTestVideoDecodeHwDevice::IsPlaying() sl@0: { sl@0: return iIsPlaying; sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::Redraw() sl@0: { sl@0: // do something here? sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::Start() sl@0: { sl@0: iIsPlaying = ETrue; sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::Stop() sl@0: { sl@0: iIsPlaying = EFalse; sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::Pause() sl@0: { sl@0: iIsPlaying = EFalse; sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::Resume() sl@0: { sl@0: iIsPlaying = ETrue; sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetPosition(const TTimeIntervalMicroSeconds& aPlaybackPosition) sl@0: { sl@0: if (aPlaybackPosition == TTimeIntervalMicroSeconds(KTestPositionFatal)) sl@0: { sl@0: iProxy->MdvppFatalError(this, KErrDied); sl@0: } sl@0: else sl@0: { sl@0: __ASSERT_ALWAYS(aPlaybackPosition == TTimeIntervalMicroSeconds(KTestPosition), DevVideoDecoderPanic(EDecoderPanicSetPosition)); sl@0: } sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::FreezePicture(const TTimeIntervalMicroSeconds& aTimestamp) sl@0: { sl@0: __ASSERT_ALWAYS(aTimestamp == TTimeIntervalMicroSeconds(KTestPosition), DevVideoDecoderPanic(EDecoderPanicFreezePicture)); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::ReleaseFreeze(const TTimeIntervalMicroSeconds& aTimestamp) sl@0: { sl@0: __ASSERT_ALWAYS(aTimestamp == TTimeIntervalMicroSeconds(KTestPosition), DevVideoDecoderPanic(EDecoderPanicReleaseFreeze)); sl@0: } sl@0: sl@0: TTimeIntervalMicroSeconds CMMFTestVideoDecodeHwDevice::PlaybackPosition() sl@0: { sl@0: return TTimeIntervalMicroSeconds(KTestPlayPosition); sl@0: } sl@0: sl@0: TUint CMMFTestVideoDecodeHwDevice::PictureBufferBytes() sl@0: { sl@0: return KTestPictureBytes; sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::GetPictureCounters(CMMFDevVideoPlay::TPictureCounters& aCounters) sl@0: { sl@0: aCounters = GetTestPictureCounters(); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetComplexityLevel(TUint aLevel) sl@0: { sl@0: __ASSERT_ALWAYS(aLevel == KTestComplexityLevel1, DevVideoDecoderPanic(EDecoderPanicComplexityLevel)); sl@0: } sl@0: sl@0: TUint CMMFTestVideoDecodeHwDevice::NumComplexityLevels() sl@0: { sl@0: return KTestNumComplexityLevels1; sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::GetComplexityLevelInfo(TUint aLevel, CMMFDevVideoPlay::TComplexityLevelInfo& aInfo) sl@0: { sl@0: __ASSERT_ALWAYS(aLevel == KTestComplexityLevel1, DevVideoDecoderPanic(EDecoderPanicComplexityLevelInfo)); sl@0: sl@0: aInfo = GetTestLevelInfo(aLevel); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::ReturnPicture(TVideoPicture* /*aPicture*/) sl@0: { sl@0: } sl@0: sl@0: TBool CMMFTestVideoDecodeHwDevice::GetSnapshotL(TPictureData& /*aPictureData*/, const TUncompressedVideoFormat& /*aFormat*/) sl@0: { sl@0: return EFalse; sl@0: } sl@0: sl@0: // this method should be called on the post processor not on the decoder sl@0: // ending up here is a programming error and hence a PANIC condition sl@0: void CMMFTestVideoDecodeHwDevice::GetTimedSnapshotL(TPictureData* /*aPictureData*/, const TUncompressedVideoFormat& /*aFormat*/, const TTimeIntervalMicroSeconds& /*aPresentationTimestamp*/) sl@0: { sl@0: DevVideoDecoderPanic(EDecoderPanicTimedSnapshot); sl@0: } sl@0: sl@0: // this method should be called on the post processor not on the decoder sl@0: // ending up here is a programming error and hence a PANIC condition sl@0: void CMMFTestVideoDecodeHwDevice::GetTimedSnapshotL(TPictureData* /*aPictureData*/, const TUncompressedVideoFormat& /*aFormat*/, const TPictureId& /*aPictureId*/) sl@0: { sl@0: DevVideoDecoderPanic(EDecoderPanicTimedSnapshotId); sl@0: } sl@0: sl@0: // this method should be called on the post processor not on the decoder sl@0: // ending up here is a programming error and hence a PANIC condition sl@0: void CMMFTestVideoDecodeHwDevice::CancelTimedSnapshot() sl@0: { sl@0: DevVideoDecoderPanic(EDecoderPanicCancelTimedSnapshot); sl@0: } sl@0: sl@0: // this method should be called on the post processor not on the decoder sl@0: // ending up here is a programming error and hence a PANIC condition sl@0: void CMMFTestVideoDecodeHwDevice::GetSupportedSnapshotFormatsL(RArray& /*aFormats*/) sl@0: { sl@0: DevVideoDecoderPanic(EDecoderPanicSupportedSnapshotFormats); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::InputEnd() sl@0: { sl@0: iProxy->MdvppStreamEnd(); sl@0: } sl@0: sl@0: CVideoDecoderInfo* CMMFTestVideoDecodeHwDevice::VideoDecoderInfoLC() sl@0: { sl@0: // construct array of test types sl@0: for (TUint i = 0; i < KTestDecoderInfoCount; i++) sl@0: { sl@0: // construct the video types for iVidTypes sl@0: CCompressedVideoFormat* vid = NULL; sl@0: TPtrC8 mimeType = KTestDecoderInfoMimeArray[i]; sl@0: vid = GetTestCVFormatL(mimeType); sl@0: CleanupStack::PushL(vid); sl@0: User::LeaveIfError(iVidFormats.Append(vid)); sl@0: CleanupStack::Pop(vid); // CCompressedVideo object is destroyed in destructor sl@0: sl@0: // append the max picture rates sl@0: TPictureRateAndSize rate; sl@0: GetTestEncoderInfoRate(i, rate); sl@0: User::LeaveIfError(iPictureRates.Append(rate)); sl@0: } sl@0: sl@0: // construct the video decoder info object sl@0: CVideoDecoderInfo* vInfo = CVideoDecoderInfo::NewL( sl@0: KUidDevVideoTestDecodeHwDevice, sl@0: KTestDecoderInfoManufacturer, sl@0: KTestDecoderInfoIdentifier, sl@0: TVersion(KTestDecoderInfoVersionMaj, KTestDecoderInfoVersionMin, KTestDecoderInfoVersionBuild), sl@0: iVidFormats.Array(), sl@0: ETrue, // accelerated sl@0: ETrue, // supports direct display sl@0: TSize(KTestDecoderInfoMaxSizeX,KTestDecoderInfoMaxSizeY), sl@0: KMaxTUint, //aMaxBitrate sl@0: iPictureRates.Array(), sl@0: ETrue, // aSupportsPictureLoss sl@0: EFalse, // aSupportsSliceLoss sl@0: KTestDecoderInfoCSInfo, sl@0: KTestDecoderInfoISInfo ); sl@0: CleanupStack::PushL(vInfo); sl@0: #ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT sl@0: vInfo->AddSupportedScreenL(KDecoderDefaultScreenNumber); sl@0: vInfo->AddSupportedScreenL(KDecoderSecondaryScreenNumber); sl@0: #endif sl@0: vInfo->SetSupportsContentProtected(ETrue); sl@0: return vInfo; sl@0: } sl@0: sl@0: sl@0: TVideoPictureHeader* CMMFTestVideoDecodeHwDevice::GetHeaderInformationL(TVideoDataUnitType aDataUnitType, TVideoDataUnitEncapsulation aEncapsulation, TVideoInputBuffer* aDataUnit) sl@0: { sl@0: // check KTestDataUnitType, KTestDataUnitEncap sl@0: if ((aDataUnitType != KTestDataUnitType) || sl@0: (aEncapsulation != KTestDataUnitEncap) || sl@0: (aDataUnit->iOptions != KTestInputBufferOptions) ) sl@0: { sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: sl@0: // repackage picture header sl@0: iPictureHeader.iOptions = KTestPictureHeaderOptions; sl@0: iPictureHeader.iPresentationTimestamp = aDataUnit->iPresentationTimestamp; sl@0: iPictureHeader.iOptional = &(aDataUnit->iData); sl@0: return &iPictureHeader; sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::ConfigureDecoderL(const TVideoPictureHeader& aVideoPictureHeader) sl@0: { sl@0: TTimeIntervalMicroSeconds testTime(KTestInputBufferTimestamp); sl@0: sl@0: // check the picture header sl@0: if ( (aVideoPictureHeader.iOptions != KTestPictureHeaderOptions) sl@0: ||(!(aVideoPictureHeader.iPresentationTimestamp == testTime)) sl@0: ||(!(*(aVideoPictureHeader.iOptional) == KTestInputBufferData()))) sl@0: { sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: sl@0: iPictureHeader = aVideoPictureHeader; sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::ReturnHeader(TVideoPictureHeader* aHeader) sl@0: { sl@0: __ASSERT_ALWAYS(aHeader, DevVideoDecoderPanic(EDecoderPanicPictureHeader)); sl@0: __ASSERT_ALWAYS(aHeader->iOptions == KTestPictureHeaderOptions, DevVideoDecoderPanic(EDecoderPanicPictureHeaderOptions)); sl@0: __ASSERT_ALWAYS(aHeader->iPresentationTimestamp == TTimeIntervalMicroSeconds(KTestPictureHeaderTimestamp), DevVideoDecoderPanic(EDecoderPanicPictureHeaderTimestamp)); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetInputFormatL(const CCompressedVideoFormat& aFormat, TVideoDataUnitType aDataUnitType, TVideoDataUnitEncapsulation aEncapsulation, TBool aDataInOrder) sl@0: { sl@0: // check expected parameters - TClasses first sl@0: if (!((aDataUnitType == KTestUnitType1) && (aEncapsulation == KTestEncapType1) && (aDataInOrder))) sl@0: User::Leave(KErrCorrupt); sl@0: sl@0: // construct a temporary compressed video class [will leave on error] sl@0: CCompressedVideoFormat *compVideo = GetTestCVFormatL(KTestMimeType1); sl@0: CleanupStack::PushL(compVideo); sl@0: sl@0: // compare to received class sl@0: if (!(aFormat == *compVideo)) sl@0: User::Leave(KErrCorrupt); sl@0: sl@0: // destroy temporary class sl@0: CleanupStack::PopAndDestroy(compVideo); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SynchronizeDecoding(TBool aSynchronize) sl@0: { sl@0: __ASSERT_ALWAYS(aSynchronize, DevVideoDecoderPanic(EDecoderPanicSynchronizeDecoding)); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetBufferOptionsL(const CMMFDevVideoPlay::TBufferOptions& aOptions) sl@0: { sl@0: CMMFDevVideoPlay::TBufferOptions buffOptions = GetTestBufferOptions(); sl@0: sl@0: if (!CompareBufferOptions(aOptions, buffOptions)) sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::GetBufferOptions(CMMFDevVideoPlay::TBufferOptions& aOptions) sl@0: { sl@0: aOptions = GetTestBufferOptions(); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetHrdVbvSpec(THrdVbvSpecification aHrdVbvSpec, const TDesC8& aHrdVbvParams) sl@0: { sl@0: __ASSERT_ALWAYS(aHrdVbvSpec == KTestHrdVbvSpec, DevVideoDecoderPanic(EDecoderPanicHrdVbvSpec)); sl@0: __ASSERT_ALWAYS(aHrdVbvParams == KTestHrdVbvParams, DevVideoDecoderPanic(EDecoderPanicHrdVbvParams)); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetOutputDevice(CMMFVideoPostProcHwDevice* /*aDevice*/) sl@0: { sl@0: } sl@0: sl@0: TTimeIntervalMicroSeconds CMMFTestVideoDecodeHwDevice::DecodingPosition() sl@0: { sl@0: return TTimeIntervalMicroSeconds(KTestDecodePosition); sl@0: } sl@0: sl@0: TUint CMMFTestVideoDecodeHwDevice::PreDecoderBufferBytes() sl@0: { sl@0: return KTestPreDecoderBytes; sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::GetBitstreamCounters(CMMFDevVideoPlay::TBitstreamCounters& aCounters) sl@0: { sl@0: aCounters = GetTestBitstreamCounters(); sl@0: } sl@0: sl@0: TUint CMMFTestVideoDecodeHwDevice::NumFreeBuffers() sl@0: { sl@0: return KTestNumFreeBuffers; sl@0: } sl@0: sl@0: TVideoInputBuffer* CMMFTestVideoDecodeHwDevice::GetBufferL(TUint aBufferSize) sl@0: { sl@0: if (!iBufferDataArea) sl@0: { sl@0: TPtrC8 testBufferString(KTestBufferString); sl@0: iBufferDataArea = testBufferString.AllocL(); sl@0: } sl@0: sl@0: TPtr8 dataAreaPtr = iBufferDataArea->Des(); sl@0: TInt reqBufferSize = aBufferSize; sl@0: if (reqBufferSize > dataAreaPtr.MaxLength()) sl@0: User::Leave(KErrTooBig); sl@0: sl@0: // initialize iInputBuffer with test data sl@0: iInputBuffer.iOptions = KTestBufferOptions; sl@0: iInputBuffer.iDecodingTimestamp = aBufferSize; sl@0: iInputBuffer.iData.Set(dataAreaPtr); sl@0: sl@0: // call new buffer callback sl@0: iProxy->MdvppNewBuffers(); sl@0: sl@0: return &iInputBuffer; sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::WriteCodedDataL(TVideoInputBuffer* aBuffer) sl@0: { sl@0: TTimeIntervalMicroSeconds testTime(KTestBufferSize); sl@0: sl@0: // check received buffer against test data sl@0: if (!(aBuffer->iOptions == KTestBufferOptions) || sl@0: !(aBuffer->iDecodingTimestamp == testTime) || sl@0: !(aBuffer->iData == KTestBufferString)) sl@0: { sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::WriteCodedDataL(TVideoInputBuffer* aBuffer, TFramePortion aPortion) sl@0: { sl@0: TTimeIntervalMicroSeconds testTime(KTestBufferSize); sl@0: sl@0: // check received buffer against test data sl@0: if ((aPortion != EFramePortionEndFragment) || sl@0: !(aBuffer->iOptions == KTestBufferOptions) || sl@0: !(aBuffer->iDecodingTimestamp == testTime) || sl@0: !(aBuffer->iData == KTestBufferString)) sl@0: { sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::ScanAndCopyCodedDataL(TPtr8 aCodedData, TVideoInputBuffer* aBuffer, TInt& aConsumed, TFramePortion aPortion) sl@0: { sl@0: //compare ptr data to test data sl@0: if ((aPortion != EFramePortionEndFragment) || sl@0: (aCodedData != KTestBufferString)) sl@0: { sl@0: User::Leave(KErrCorrupt); sl@0: } sl@0: //copy data into buffer sl@0: aBuffer->iData.Set(aCodedData); sl@0: aConsumed = aBuffer->iData.Length(); sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::CommitL() sl@0: { sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::Revert() sl@0: { sl@0: } sl@0: sl@0: void CMMFTestVideoDecodeHwDevice::SetProxy(MMMFDevVideoPlayProxy& aProxy) sl@0: { sl@0: ASSERT(iProxy == NULL); sl@0: iProxy = &aProxy; sl@0: }