os/kernelhwsrv/kerneltest/e32test/multimedia/t_camera_display.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
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// e32test\multimedia\t_camera_display.h
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#if !defined(__T_CAMERA_DISPLAY_H__)
sl@0
    19
#define __T_CAMERA_DISPLAY_H__
sl@0
    20
sl@0
    21
#include <e32test.h>
sl@0
    22
#include <d32camerasc.h>
sl@0
    23
#include <pixelformats.h>
sl@0
    24
#include "d_mmcsc.h"
sl@0
    25
sl@0
    26
_LIT(KCaptureModeCapsTitle, "Capture modes: ");
sl@0
    27
_LIT(KCaptureModeImage, "Image ");
sl@0
    28
_LIT(KCaptureModeVideo, "Video ");
sl@0
    29
_LIT(KCaptureModeViewFinder, "ViewFinder ");
sl@0
    30
sl@0
    31
_LIT(KPixelFormatCapsTitle, "Pixel formats: ");
sl@0
    32
_LIT(KPixelFormatConfTitle, "Current pixel format: ");
sl@0
    33
_LIT(KPixelFormatUnknown, "Pixel Format Unknown (Other) ");
sl@0
    34
_LIT(KPixelFormatRGB_565, "RGB565 ");
sl@0
    35
_LIT(KPixelFormatYUV_422Interleaved, "YUV422 Interleaved ");
sl@0
    36
_LIT(KPixelFormatSpeedTaggedJPEG, "Speed Tagged JPEG ");
sl@0
    37
_LIT(KPixelFormatJPEG, "JPEG ");
sl@0
    38
sl@0
    39
class TCamDisplayHandler
sl@0
    40
	{
sl@0
    41
public:
sl@0
    42
	TCamDisplayHandler();
sl@0
    43
	TInt Init();
sl@0
    44
	TInt SetConfig(const SDevCamFrameSize& aSize,const SDevCamPixelFormat& aPixelFormat);
sl@0
    45
	TInt Process(TUint8* aImageBaseAddress);
sl@0
    46
private:
sl@0
    47
	TInt Min(TInt aA, TInt aB);
sl@0
    48
	TInt ProcessRGB565(TUint8* aImageBaseAddress);
sl@0
    49
	TInt ProcessYUV422(TUint8* aImageBaseAddress);
sl@0
    50
private:
sl@0
    51
	/** Pixel format of the data to be converted and displayed */
sl@0
    52
	SDevCamPixelFormat iPixelFormat;
sl@0
    53
	/** Address of the top left hand corner of screen memory */
sl@0
    54
	TUint8* iVideoAddress;
sl@0
    55
	/** Width of the frame to be displayed, in pixels */
sl@0
    56
	TUint iWidth;
sl@0
    57
	/** Height of the frame to be displayed, in pixels */
sl@0
    58
	TUint iHeight;
sl@0
    59
	/** Width of the screen, in pixels */
sl@0
    60
	TUint iScreenWidth;
sl@0
    61
	/** Height of the screen, in pixels */
sl@0
    62
	TUint iScreenHeight;
sl@0
    63
	/** Number of bits per pixel */
sl@0
    64
	TInt iBitsPerPixel;
sl@0
    65
	};
sl@0
    66
sl@0
    67
void AppendPixelFormat(TDes& aBuffer, TUidPixelFormat aPixelFormat);
sl@0
    68
void PrintCamModes(TCameraCapsV02* aCaps,RTest& aTest);
sl@0
    69
void PrintCamConf(TCameraConfigV02& aConf,RTest& aTest);
sl@0
    70
void PrintBufferConf(TMmSharedChunkBufConfig& aBufConf,RTest& aTest);
sl@0
    71
sl@0
    72
#endif // __T_CAMERA_DISPLAY_H__