Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include <videoframebuffer.h>
17 #include "testbuffer.h"
20 RTestVideoFrameBufferStep* RTestVideoFrameBufferStep::NewL()
22 RTestVideoFrameBufferStep* self = new (ELeave) RTestVideoFrameBufferStep();
26 RTestVideoFrameBufferStep::RTestVideoFrameBufferStep()
28 iTestStepName = _L("MM-MMF-VIDREND-U-0001");
31 TVerdict RTestVideoFrameBufferStep::DoTestStepL()
33 INFO_PRINTF1(_L("Check TVideoFrameBuffer"));
35 TVerdict result = EPass;
37 const TInt KStride = 8;
38 const TInt KBufferId = 2;
39 const TInt KOffsetInChunk = 4;
40 const TInt KChunkSize = 20;
41 const TInt KMaxChunkSize = 40;
43 TInt err = chunk.CreateLocal(KChunkSize, KMaxChunkSize);
46 ERR_PRINTF2(_L("Error - RChunk::CreateLocal returned %d"), err);
50 TUncompressedVideoFormat testFormat;
51 testFormat.iDataFormat = ERgbRawData;
52 testFormat.iRgbFormat = ERgb32bit888;
54 TVideoFrameBuffer buffer(testFormat, KStride, KBufferId, chunk, KOffsetInChunk);
56 if (buffer.Stride() != KStride)
58 ERR_PRINTF2(_L("Error - unexpected stride %d returned"), buffer.Stride());
61 else if (buffer.BufferId() != KBufferId)
63 ERR_PRINTF2(_L("Error - unexpected buffer id %d returned"), buffer.BufferId());
66 else if (buffer.Chunk().Handle() != chunk.Handle())
68 ERR_PRINTF1(_L("Error - unexpected chunk returned"));
71 else if (buffer.Buffer() != chunk.Base()+KOffsetInChunk)
73 ERR_PRINTF1(_L("Error - unexpected buffer"));
76 else if (!(buffer.Format() == testFormat))
78 ERR_PRINTF1(_L("Error - unexpected format returned"));