⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adapterprops.h

📁 Microsoft WinCE 6.0 BSP FINAL release source code for use with the i.MX27ADS TO2 WCE600_FINAL_MX27_S
💻 H
📖 第 1 页 / 共 5 页
字号:
//
// 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 (C) 2003-2004, MOTOROLA, INC. All Rights Reserved
// THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
// BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
// MOTOROLA, INC.
//
//------------------------------------------------------------------------------
//
//  Copyright (C) 2004-2006, Freescale Semiconductor, Inc. All Rights Reserved.
//  THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS
//  AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT
//
//------------------------------------------------------------------------------
//
//  File:  CameraProps.h
//
//  Define video format and camera control capabilities
//
//------------------------------------------------------------------------------
 
#ifndef __ADAPTERPROPS_H
#define __ADAPTERPROPS_H

#ifndef mmioFOURCC    
#define mmioFOURCC( ch0, ch1, ch2, ch3 )          \
     ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) |  \
     ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
#endif  

#define BITRATE    (DX * abs(DY) * DBITCOUNT * FRAMERATE)
#define SAMPLESIZE (DX * abs(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     mmioFOURCC('Y', '4', '4', '4')  // TIYUV: 1394 conferencing camera 4:4:4 mode 0
#define FOURCC_UYVY     mmioFOURCC('U', 'Y', 'V', 'Y')  // MSYUV: 1394 conferencing camera 4:4:4 mode 1 and 3
#define FOURCC_Y411     mmioFOURCC('Y', '4', '1', '1')  // TIYUV: 1394 conferencing camera 4:1:1 mode 2
#define FOURCC_Y800     mmioFOURCC('Y', '8', '0', '0')  // TIYUV: 1394 conferencing camera 4:1:1 mode 5
#define FOURCC_YUV422   mmioFOURCC('U', 'Y', 'V', 'Y')

#ifdef EXTERN_PROP_VALUES
extern CS_DATARANGE_VIDEO DCAM_StreamMode_0;
extern CS_DATARANGE_VIDEO DCAM_StreamMode_1;
extern CS_DATARANGE_VIDEO DCAM_StreamMode_2;
extern CS_DATARANGE_VIDEO DCAM_StreamMode_3;
extern CS_DATARANGE_VIDEO DCAM_StreamMode_4;
extern CS_DATARANGE_VIDEO DCAM_StreamMode_6;
#else


#define DX          160
#define DY          120
#define DBITCOUNT    16
#define FRAMERATE    30

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, 
        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          176
#define DY          144
#define DBITCOUNT    16
#define FRAMERATE    30

CS_DATARANGE_VIDEO DCAM_StreamMode_1 = 
{
    // 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, 
        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          320
#define DY          240
#define DBITCOUNT    16
#define FRAMERATE    15

CS_DATARANGE_VIDEO DCAM_StreamMode_2 = 
{
    // 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, 
        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_15FPS,    // MinFrameInterval (10,000,000 / 15.00FPS), 100nS units
        FRAMEINTERVAL_3_75FPS,  // MaxFrameInterval (10,000,000 /  3.75FPS), 100nS units
        BITRATE / 4,            // (DX * DY * DBITCOUNT) * DFPS_MIN,    // MinBitsPerSecond (3.75 FPS);
        BITRATE,                // (DX * DY * DBITCOUNT) * DFPS_MAX     // MaxBitsPerSecond (15.0 FPS);
    }, 
        
    // CS_VIDEOINFOHEADER (default format)
    {
        0,0,0,0,                            // RECT  rcSource; 
        0,0,0,0,                            // RECT  rcTarget; 
        BITRATE,                            // DWORD dwBitRate; 153600 * 15FPS * 8 bit/Byte
        0L,                                 // DWORD dwBitErrorRate;   
        REFTIME_15FPS,                      // REFERENCE_TIME  AvgTimePerFrame (15 FPS); 
        sizeof (CS_BITMAPINFOHEADER),       // DWORD biSize;
        DX,                                 // LONG  biWidth;
        DY,                                 // LONG  biHeight;
        1,                        // WORD  biPlanes;
        DBITCOUNT,                // WORD  biBitCount;
        CS_BI_BITFIELDS | BI_SRCPREROTATE, // 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          320
#define DY          240
#define DBITCOUNT    16
#define FRAMERATE    15

// To support mode4, 320x240, RGB
CS_DATARANGE_VIDEO DCAM_StreamMode_3 = 
{
    // 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...)

⌨️ 快捷键说明

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