kerneltest/e32test/multimedia/t_camera_display.h
changeset 199 189ece41fa29
parent 189 a5496987b1da
child 202 9aca3be14c27
equal deleted inserted replaced
189:a5496987b1da 199:189ece41fa29
     1 // Copyright (c) 2006-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 the License "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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32test\multimedia\t_camera_display.h
       
    15 // 
       
    16 //
       
    17 
       
    18 #if !defined(__T_CAMERA_DISPLAY_H__)
       
    19 #define __T_CAMERA_DISPLAY_H__
       
    20 
       
    21 #include <e32test.h>
       
    22 #include <d32camerasc.h>
       
    23 #include <pixelformats.h>
       
    24 #include "d_mmcsc.h"
       
    25 
       
    26 _LIT(KCaptureModeCapsTitle, "Capture modes: ");
       
    27 _LIT(KCaptureModeImage, "Image ");
       
    28 _LIT(KCaptureModeVideo, "Video ");
       
    29 _LIT(KCaptureModeViewFinder, "ViewFinder ");
       
    30 
       
    31 _LIT(KPixelFormatCapsTitle, "Pixel formats: ");
       
    32 _LIT(KPixelFormatConfTitle, "Current pixel format: ");
       
    33 _LIT(KPixelFormatUnknown, "Pixel Format Unknown (Other) ");
       
    34 _LIT(KPixelFormatRGB_565, "RGB565 ");
       
    35 _LIT(KPixelFormatYUV_422Interleaved, "YUV422 Interleaved ");
       
    36 _LIT(KPixelFormatSpeedTaggedJPEG, "Speed Tagged JPEG ");
       
    37 _LIT(KPixelFormatJPEG, "JPEG ");
       
    38 
       
    39 class TCamDisplayHandler
       
    40 	{
       
    41 public:
       
    42 	TCamDisplayHandler();
       
    43 	TInt Init();
       
    44 	TInt SetConfig(const SDevCamFrameSize& aSize,const SDevCamPixelFormat& aPixelFormat);
       
    45 	TInt Process(TUint8* aImageBaseAddress);
       
    46 private:
       
    47 	TInt Min(TInt aA, TInt aB);
       
    48 	TInt ProcessRGB565(TUint8* aImageBaseAddress);
       
    49 	TInt ProcessYUV422(TUint8* aImageBaseAddress);
       
    50 private:
       
    51 	/** Pixel format of the data to be converted and displayed */
       
    52 	SDevCamPixelFormat iPixelFormat;
       
    53 	/** Address of the top left hand corner of screen memory */
       
    54 	TUint8* iVideoAddress;
       
    55 	/** Width of the frame to be displayed, in pixels */
       
    56 	TUint iWidth;
       
    57 	/** Height of the frame to be displayed, in pixels */
       
    58 	TUint iHeight;
       
    59 	/** Width of the screen, in pixels */
       
    60 	TUint iScreenWidth;
       
    61 	/** Height of the screen, in pixels */
       
    62 	TUint iScreenHeight;
       
    63 	/** Number of bits per pixel */
       
    64 	TInt iBitsPerPixel;
       
    65 	};
       
    66 
       
    67 void AppendPixelFormat(TDes& aBuffer, TUidPixelFormat aPixelFormat);
       
    68 void PrintCamModes(TCameraCapsV02* aCaps,RTest& aTest);
       
    69 void PrintCamConf(TCameraConfigV02& aConf,RTest& aTest);
       
    70 void PrintBufferConf(TMmSharedChunkBufConfig& aBufConf,RTest& aTest);
       
    71 
       
    72 #endif // __T_CAMERA_DISPLAY_H__