camerapdd.h

来自「该BSP是基于PXA270+WINCE的BSP」· C头文件 代码 · 共 245 行

H
245
字号
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
//
/****************************************************************************** 
** Copyright 2000-2003 Intel Corporation All Rights Reserved.
**
** Portions of the source code contained or described herein and all documents
** related to such source code (Material) are owned by Intel Corporation
** or its suppliers or licensors and is licensed by Microsoft Corporation for distribution.  
** Title to the Material remains with Intel Corporation or its suppliers and licensors. 
** Use of the Materials is subject to the terms of the Microsoft license agreement which accompanied the Materials.  
** No other license under any patent, copyright, trade secret or other intellectual
** property right is granted to or conferred upon you by disclosure or
** delivery of the Materials, either expressly, by implication, inducement,
** estoppel or otherwise 
** Some portion of the Materials may be copyrighted by Microsoft Corporation.
**
********************************************************************************/
#ifndef __CAMERA_PDD_H__
#define __CAMERA_PDD_H__

#include <camera.h>

// Camera sensor default settings (should be synchronize with "adapterprops.h")
// Sensor h/w - Agilent ADCM2650

#define DEFAULT_VIDEO_WIDTH         176
#define DEFAULT_VIDEO_HEIGHT        144
#define DEFAULT_STILL_WIDTH         176
#define DEFAULT_STILL_HEIGHT        144
//#define DEFAULT_STILL_WIDTH         480
//#define DEFAULT_STILL_HEIGHT        640

#define DEFAULT_CAMERA_INPUT_FORMAT     (XLLP_CAMERA_IMAGE_FORMAT_RGB888_PACKED)
#define DEFAULT_CAMERA_OUTPUT_FORMAT    (XLLP_CAMERA_IMAGE_FORMAT_RGB565)

// Defining the supported DCAM stream modes:

#define BITRATE    (DX * DY * DBITCOUNT * FRAMERATE)
#define SAMPLESIZE (DX * DY * DBITCOUNT / 8)

#define REFTIME_30FPS 333333
#define REFTIME_15FPS 666666

#define FRAMEINTERVAL_30FPS    333000
#define FRAMEINTERVAL_15FPS    666000
#define FRAMEINTERVAL_7_5FPS  1333333
#define FRAMEINTERVAL_3_75FPS 2666666

//
// FourCC of the YUV formats
// For information about FourCC, go to:
//     http://www.webartz.com/fourcc/indexyuv.htm
//     http://www.fourcc.org
//


#define FOURCC_Y444     MAKEFOURCC('Y', '4', '4', '4')  // TIYUV: 1394 conferencing camera 4:4:4 mode 0
#define FOURCC_UYVY     MAKEFOURCC('U', 'Y', 'V', 'Y')  // MSYUV: 1394 conferencing camera 4:4:4 mode 1 and 3
#define FOURCC_Y411     MAKEFOURCC('Y', '4', '1', '1')  // TIYUV: 1394 conferencing camera 4:1:1 mode 2
#define FOURCC_Y800     MAKEFOURCC('Y', '8', '0', '0')  // TIYUV: 1394 conferencing camera 4:1:1 mode 5
#define FOURCC_YUV422   MAKEFOURCC('U', 'Y', 'V', 'Y')
#define FOURCC_YV16     MAKEFOURCC('Y', 'V', '1', '6')


#define DX          176
#define DY          144
#define DBITCOUNT    16
#define FRAMERATE    30

// Preview/capture mode: RGR565 176x144
CS_DATARANGE_VIDEO DCAM_StreamMode_0 = 
{
    // CSDATARANGE
    {   
        sizeof (CS_DATARANGE_VIDEO),     // Flags
        0,
        SAMPLESIZE,                      // SampleSize
        0,                               // Reserved
        STATIC_CSDATAFORMAT_TYPE_VIDEO,          
        0xe436eb7b, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70, // MEDIASUBTYPE_RGB565
        STATIC_CSDATAFORMAT_SPECIFIER_VIDEOINFO
    },

    TRUE,                   // BOOL,  bFixedSizeSamples (all samples same size?)
    TRUE,                   // BOOL,  bTemporalCompression (all I frames?)
    CS_VIDEOSTREAM_CAPTURE, // StreamDescriptionFlags  (CS_VIDEO_DESC_*)
    0,                      // MemoryAllocationFlags   (CS_VIDEO_ALLOC_*)

    // _CS_VIDEO_STREAM_CONFIG_CAPS  
    {
        STATIC_CSDATAFORMAT_SPECIFIER_VIDEOINFO, 
        CS_AnalogVideo_None, // AnalogVideoStandard
        DX,DY,    // InputSize, (the inherent size of the incoming signal
                  //             with every digitized pixel unique)
        DX,DY,    // MinCroppingSize, smallest rcSrc cropping rect allowed
        DX,DY,    // MaxCroppingSize, largest  rcSrc cropping rect allowed
        1,        // CropGranularityX, granularity of cropping size
        1,        // CropGranularityY
        1,        // CropAlignX, alignment of cropping rect 
        1,        // CropAlignY;
        DX, DY,   // MinOutputSize, smallest bitmap stream can produce
        DX, DY,   // MaxOutputSize, largest  bitmap stream can produce
        DX,       // OutputGranularityX, granularity of output bitmap size
        DY,       // OutputGranularityY;
        0,        // StretchTapsX  (0 no stretch, 1 pix dup, 2 interp...)
        0,        // StretchTapsY
        0,        // ShrinkTapsX 
        0,        // ShrinkTapsY 
        // Allow 1% difference
        FRAMEINTERVAL_30FPS,   // MinFrameInterval (10,000,000 / 30.00FPS), 100nS units
        FRAMEINTERVAL_7_5FPS,  // MaxFrameInterval (10,000,000 /  7.50FPS), 100nS units
        BITRATE / 4,           // (DX * DY * DBITCOUNT) * DFPS_MIN,    // MinBitsPerSecond (7.50 FPS);
        BITRATE,               // (DX * DY * DBITCOUNT) * DFPS_MAX     // MaxBitsPerSecond (30.0 FPS);
    }, 
        
    // CS_VIDEOINFOHEADER (default format)
    {
        0,0,0,0,                            // RECT  rcSource; 
        0,0,0,0,                            // RECT  rcTarget; 
        BITRATE,                            // DWORD dwBitRate; 57600 * 30FPS * 8 bit/Byte
        0L,                                 // DWORD dwBitErrorRate;   
        REFTIME_30FPS,                      // REFERENCE_TIME  AvgTimePerFrame (30 FPS); 
        sizeof (CS_BITMAPINFOHEADER),       // DWORD biSize;
        DX,                                 // LONG  biWidth;
        DY,                                 // LONG  biHeight;
        1,                                  // WORD  biPlanes;
        DBITCOUNT,                          // WORD  biBitCount;
        CS_BI_BITFIELDS | BI_SRCPREROTATE,  // DWORD biCompression;
        SAMPLESIZE,                         // DWORD biSizeImage;
        0,                                  // LONG  biXPelsPerMeter;
        0,                                  // LONG  biYPelsPerMeter;
        0,                                  // DWORD biClrUsed;
        0,                                  // DWORD biClrImportant;
        0xF800,                             // DWORD dwBitMasks[CS_iMASK_COLORS];
        0x07E0, 
        0x001F
    }
}; 


#undef FRAMERATE
#undef DX            
#undef DY            
#undef DBITCOUNT 
   

#define DX          480
#define DY          640
#define DBITCOUNT    16
#define FRAMERATE    15

// Still image mode: RGB565 480x640
CS_DATARANGE_VIDEO DCAM_StreamMode_1 = 
{
    // CSDATARANGE
    {   
        sizeof (CS_DATARANGE_VIDEO),
        0,                  // Flags
        SAMPLESIZE,         // SampleSize
        0,                  // Reserved
        STATIC_CSDATAFORMAT_TYPE_VIDEO,
        0xe436eb7b, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70, 
        STATIC_CSDATAFORMAT_SPECIFIER_VIDEOINFO
    },

    TRUE,                   // BOOL, bFixedSizeSamples (all samples same size?)
    TRUE,                   // BOOL, bTemporalCompression (all I frames?)
    CS_VIDEOSTREAM_CAPTURE, // StreamDescriptionFlags  (CS_VIDEO_DESC_*)
    0,                      // MemoryAllocationFlags   (CS_VIDEO_ALLOC_*)

    // _CS_VIDEO_STREAM_CONFIG_CAPS  
    {
        STATIC_CSDATAFORMAT_SPECIFIER_VIDEOINFO, 
        CS_AnalogVideo_None, // AnalogVideoStandard
        DX,DY,     // InputSize, (the inherent size of the incoming signal
                   //             with every digitized pixel unique)
        DX,DY,     // MinCroppingSize, smallest rcSrc cropping rect allowed
        DX,DY,     // MaxCroppingSize, largest  rcSrc cropping rect allowed
        1,         // CropGranularityX, granularity of cropping size
        1,         // CropGranularityY
        1,         // CropAlignX, alignment of cropping rect 
        1,         // CropAlignY;
        DX, DY,    // MinOutputSize, smallest bitmap stream can produce
        DX, DY,    // MaxOutputSize, largest  bitmap stream can produce
        DX,        // OutputGranularityX, granularity of output bitmap size
        DY,        // OutputGranularityY;
        0,         // StretchTapsX  (0 no stretch, 1 pix dup, 2 interp...)
        0,         // StretchTapsY
        0,         // ShrinkTapsX 
        0,         // ShrinkTapsY 
        FRAMEINTERVAL_15FPS,     // MinFrameInterval (10,000,000 / 15.00FPS), 100nS units
        FRAMEINTERVAL_7_5FPS,    // MaxFrameInterval (10,000,000 /  7.50FPS), 100nS units
        BITRATE / 2,             // MinBitsPerSecond ( 7.50 FPS);
        BITRATE                  // MaxBitsPerSecond (15.00 FPS);
    }, 
        
    // CS_VIDEOINFOHEADER (default format)
    {
        0,0,0,0,                            // RECT  rcSource; 
        0,0,0,0,                            // RECT  rcTarget; 
        BITRATE,                            // DWORD dwBitRate;
        0L,                                 // DWORD dwBitErrorRate;   
        REFTIME_15FPS,                      // REFERENCE_TIME  AvgTimePerFrame. For (15 FPS) use 666666.
        {
            sizeof (CS_BITMAPINFOHEADER),       // DWORD biSize;
            DX,                                 // LONG  biWidth;
            DY,                                 // LONG  biHeight; -biHeight indicate TopDown for RGB
            1,                                  // WORD  biPlanes;
            DBITCOUNT,                          // WORD  biBitCount;
            CS_BI_BITFIELDS | BI_SRCPREROTATE,  // DWORD biCompression;
            SAMPLESIZE,                         // DWORD biSizeImage;
            0,                                  // LONG  biXPelsPerMeter;
            0,                                  // LONG  biYPelsPerMeter;
            0,                                  // DWORD biClrUsed;
            0                                   // DWORD biClrImportant;
        },
        {
            0xF800,                             // DWORD dwBitMasks[CS_iMASK_COLORS];
            0x07E0, 
            0x001F
        }    
    }
};


// ----------------------------------------------------------------------------
// Default Video Control Caps 
// ----------------------------------------------------------------------------
ULONG DefaultVideoControlCaps[] = {
    CS_VideoControlFlag_ExternalTriggerEnable                               /*CAPTURE*/,
    CS_VideoControlFlag_ExternalTriggerEnable | CS_VideoControlFlag_Trigger /*STILL*/,
    CS_VideoControlFlag_FlipHorizontal | CS_VideoControlFlag_FlipVertical   /*PREVIEW*/
    };

#endif // __CAMERA_PDD_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?