📄 adapterprops.h
字号:
{
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
}
}
};
#undef FRAMERATE
#undef DX
#undef DY
#undef DBITCOUNT
#define DX 640
#define DY 480
#define DBITCOUNT 16
#define FRAMERATE 15
// To support mode4, 640x480, RGB
CS_DATARANGE_VIDEO DCAM_StreamMode_4 =
{
// 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
}
}
};
#undef DX
#undef DY
#undef DBITCOUNT
#undef FRAMERATE
#define DX 176
#define DY -144
#define DBITCOUNT 12
#define FRAMERATE 15
#ifdef YV12DBITCOUNT
#undef YV12DBITCOUNT
#endif
#define YV12DBITCOUNT 12
#ifndef FOURCC_YV12
#define FOURCC_YV12 0x32315659
#endif
CS_DATARANGE_VIDEO DCAM_StreamMode_6 =
{
// CSDATARANGE
{
sizeof (CS_DATARANGE_VIDEO), // Flags
0,
SAMPLESIZE, // SampleSize
0, // Reserved
STATIC_CSDATAFORMAT_TYPE_VIDEO,
FOURCC_YV12, 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
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 / 30.00FPS), 100nS units
FRAMEINTERVAL_3_75FPS, // MaxFrameInterval (10,000,000 / 3.75FPS), 100nS units
BITRATE / 8, // (DX * DY * DBITCOUNT) * DFPS_MIN, // MinBitsPerSecond (3.75 FPS);
BITRATE, // (DX * DY * DBITCOUNT) * DFPS_MAX // MaxBitsPerSecond (30.0 FPS);
},
// CS_VIDEOINFOHEADER (default format)
{
0,0,DX,DY, // RECT rcSource;
0,0,DX,DY, // RECT rcTarget;
BITRATE, // DWORD dwBitRate;
0L, // DWORD dwBitErrorRate;
REFTIME_15FPS, // REFERENCE_TIME AvgTimePerFrame;
sizeof (CS_BITMAPINFOHEADER), // DWORD biSize;
DX, // LONG biWidth;
DY, // LONG biHeight;
3, // WORD biPlanes;
YV12DBITCOUNT, // WORD biBitCount;
FOURCC_YV12, // DWORD biCompression;
SAMPLESIZE, // DWORD biSizeImage;
0, // LONG biXPelsPerMeter;
0, // LONG biYPelsPerMeter;
0, // DWORD biClrUsed;
0, // DWORD biClrImportant;
0, 0, 0 // DWORD dwBitMasks[3]
}
};
///////////////////////////////////////////////////
//add new
#undef FRAMERATE
#undef DX
#undef DY
#undef DBITCOUNT
//QCIF for capture
/*
#define DX 176
#define DY -144
#define DBITCOUNT 12
#define FRAMERATE 30
*/
#undef FOURCC_YV12
#define BITRATE (DX * abs(DY) * DBITCOUNT * FRAMERATE)
#define SAMPLESIZE (DX * abs(DY) * DBITCOUNT / 8)
#define FOURCC_YV12 mmioFOURCC('Y', 'V', '1', '2')
#define DX 176
#define DY -144 // **** YUV is always negative ****
#define DBITCOUNT 12 // **** YV12 is 12 bits format ****
#define FRAMERATE 15
CS_DATARANGE_VIDEO DCAM_StreamMode_7 =
{
// CSDATARANGE
{
sizeof (CS_DATARANGE_VIDEO), // Flags
0,
SAMPLESIZE, // SampleSize
0, // Reserved
STATIC_CSDATAFORMAT_TYPE_VIDEO,
FOURCC_YV12, 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
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 / 30.00FPS), 100nS units
FRAMEINTERVAL_3_75FPS, // MaxFrameInterval (10,000,000 / 3.75FPS), 100nS units
BITRATE / 8, // (DX * DY * DBITCOUNT) * DFPS_MIN, // MinBitsPerSecond (3.75 FPS);
BITRATE, // (DX * DY * DBITCOUNT) * DFPS_MAX // MaxBitsPerSecond (30.0 FPS);
},
// CS_VIDEOINFOHEADER (default format)
{
0,0,DX,DY, // RECT rcSource;
0,0,DX,DY, // RECT rcTarget;
BITRATE, // DWORD dwBitRate;
0L, // DWORD dwBitErrorRate;
REFTIME_15FPS, // REFERENCE_TIME AvgTimePerFrame;
sizeof (CS_BITMAPINFOHEADER), // DWORD biSize;
DX, // LONG biWidth;
DY, // LONG biHeight;
3, // WORD biPlanes;
DBITCOUNT, // WORD biBitCount;
FOURCC_YV12, // DWORD biCompression;
SAMPLESIZE, // DWORD biSizeImage;
0, // LONG biXPelsPerMeter;
0, // LONG biYPelsPerMeter;
0, // DWORD biClrUsed;
0, // DWORD biClrImportant;
0, 0, 0 // DWORD dwBitMasks[3]
}
};
//CIF for capture
#undef FRAMERATE
#undef DX
#undef DY
#undef DBITCOUNT
#define DX 320
#define DY -240
#define DBITCOUNT 12
#define FRAMERATE 30
CS_DATARANGE_VIDEO DCAM_StreamMode_8 =
{
// CSDATARANGE
{
sizeof (CS_DATARANGE_VIDEO), // Flags
0,
SAMPLESIZE, // SampleSize
0, // Reserved
STATIC_CSDATAFORMAT_TYPE_VIDEO,
FOURCC_YV12, 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
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,DX,DY, // RECT rcSource;
0,0,DX,DY, // 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;
3, // WORD biPlanes;
DBITCOUNT, // WORD biBitCount;
FOURCC_YV12, // DWORD biCompression;
SAMPLESIZE, // DWORD biSizeImage;
0, // LONG biXPelsPerMeter;
0, // LONG biYPelsPerMeter;
0, // DWORD biClrUsed;
0, // DWORD biClrImportant;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -