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

📄 adapterprops.h

📁 freescale i.mx31 BSP CE5.0全部源码
💻 H
📖 第 1 页 / 共 2 页
字号:
//-----------------------------------------------------------------------------
//
// 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, Freescale Semiconductor, Inc. All Rights Reserved
//  THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
//  BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
//  Freescale Semiconductor, Inc.
//
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
//
//  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  

//
// 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_YUYV     mmioFOURCC('Y', 'U', 'Y', 'V')


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


#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 ;
#else


// YUYV
CS_DATARANGE_VIDEO DCAM_StreamMode_0 = 
{
    // CSDATARANGE
    {   
        sizeof (CS_DATARANGE_VIDEO),     // Flags
        0,
        614400,                          // SampleSize
        0,                               // Reserved
        STATIC_CSDATAFORMAT_TYPE_VIDEO,  
        FOURCC_YUYV, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71,
        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;
        160, 120,   // 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
        333000,   // MinFrameInterval (10,000,000 / 30.00FPS), 100nS units
        1000000,  // MaxFrameInterval (10,000,000 /  10.00FPS), 100nS units
        3072000,  // (160 * 120 * DBITCOUNT) * DFPS_MIN,    // MinBitsPerSecond (10.00 FPS);
        147456000, // (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; 
        147456000,                           // DWORD dwBitRate; 614400 * 30FPS * 8 bit/Byte
        0L,                                 // DWORD dwBitErrorRate;   
        333333,                             // REFERENCE_TIME  AvgTimePerFrame (30 FPS); 
        sizeof (CS_BITMAPINFOHEADER),       // DWORD biSize;
        DX,                                 // LONG  biWidth;
        DY,                                 // LONG  biHeight;
        1,                                  // WORD  biPlanes;
        DBITCOUNT,                          // WORD  biBitCount;
        FOURCC_YUYV,                        // DWORD biCompression;
        614400,                              // DWORD biSizeImage;
        0,                                  // LONG  biXPelsPerMeter;
        0,                                  // LONG  biYPelsPerMeter;
        0,                                  // DWORD biClrUsed;
        0,                                  // DWORD biClrImportant;
        0,0,0                               // DWORD dwBitMasks
    }
}; 

#undef DX            
#undef DY            
#undef DBITCOUNT 


#define DX          160
#define DY          120
#define DBITCOUNT    32

//Y444
CS_DATARANGE_VIDEO DCAM_StreamMode_1 = 
{
    // CSDATARANGE
    {   
        sizeof (CS_DATARANGE_VIDEO),     // Flags
        0,
        76800,                          // SampleSize
        0,                               // Reserved
        STATIC_CSDATAFORMAT_TYPE_VIDEO,  
        FOURCC_Y444, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71,
        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
        640, 480,   // 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
        333000,   // MinFrameInterval (10,000,000 / 30.00FPS), 100nS units
        1000000,  // MaxFrameInterval (10,000,000 /  10.00FPS), 100nS units
        6144000,  // (DX * DY * DBITCOUNT) * DFPS_MIN,    // MinBitsPerSecond (10.0 FPS);
        294912000, // (640 * 480 * DBITCOUNT) * DFPS_MAX     // MaxBitsPerSecond (30.0 FPS);
    }, 
        
    // CS_VIDEOINFOHEADER (default format)
    {
        0,0,0,0,                            // RECT  rcSource; 
        0,0,0,0,                            // RECT  rcTarget; 
        18432000,                      // DWORD dwBitRate; 76800 * 30FPS * 8 bit/Byte
        0L,                                 // DWORD dwBitErrorRate;   
        333333,                             // REFERENCE_TIME  AvgTimePerFrame (30 FPS); 
        sizeof (CS_BITMAPINFOHEADER),       // DWORD biSize;
        DX,                                 // LONG  biWidth;
        DY,                                 // LONG  biHeight;
        1,                                  // WORD  biPlanes;
        DBITCOUNT,                          // WORD  biBitCount;
        FOURCC_Y444,                        // DWORD biCompression;
        76800,                              // DWORD biSizeImage;
        0,                                  // LONG  biXPelsPerMeter;
        0,                                  // LONG  biYPelsPerMeter;
        0,                                  // DWORD biClrUsed;
        0,                                  // DWORD biClrImportant;
        0,0,0                               // DWORD dwBitMasks
    }
}; 


#undef DX            
#undef DY            
#undef DBITCOUNT 

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

//UYVY
CS_DATARANGE_VIDEO DCAM_StreamMode_2 = 
{
    // CSDATARANGE
    {   
        sizeof (CS_DATARANGE_VIDEO),     // Flags
        0,
        614400,                          // SampleSize
        0,                               // Reserved
        STATIC_CSDATAFORMAT_TYPE_VIDEO,  
        FOURCC_UYVY, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71,
        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;
        160, 120,   // 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
        333000,   // MinFrameInterval (10,000,000 / 30.00FPS), 100nS units
        1000000,  // MaxFrameInterval (10,000,000 /  10.00FPS), 100nS units
        3072000,  // (160 * 120 * DBITCOUNT) * DFPS_MIN,    // MinBitsPerSecond (10.0 FPS);
        147456000, // (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; 
        147456000,                       // DWORD dwBitRate; 614400 * 30FPS * 8 bit/Byte
        0L,                                 // DWORD dwBitErrorRate;   
        333333,                             // REFERENCE_TIME  AvgTimePerFrame (30 FPS); 
        sizeof (CS_BITMAPINFOHEADER),       // DWORD biSize;
        DX,                                 // LONG  biWidth;
        DY,                                 // LONG  biHeight;
        1,                        // WORD  biPlanes;
        DBITCOUNT,                // WORD  biBitCount;
        FOURCC_UYVY,              // DWORD biCompression;
        614400,                   // DWORD biSizeImage;

⌨️ 快捷键说明

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