阅读:1164回复:0
摄像头驱动程序开发求救:
编写摄像头的驱动程序时,不可避免地涉及桢格式,下面是一个数据流帧,但我不是很理解其中的一些数字的算法,他们是如何计算出来的?
如以下这些数字: 300000, // MinFrameInterval, 100 nS units 1249999, // MaxFrameInterval, 100 nS units 12 * 8 * D_X * D_Y, // MinBitsPerSecond; 12 * 33 * D_X * D_Y // MaxBitsPerSecond; D_X * D_Y * 12 * 24, // DWORD 那位能帮忙说明一下?谢谢 #define D_X 160 #define D_Y 120 KS_DATARANGE_VIDEO INTELCAM_StreamFormat_4 = //??KS_DATARANGE_VIDEO INTELCAM_StreamFormat_0 = { // KSDATARANGE { sizeof (KS_DATARANGE_VIDEO), 0, // Flags (D_X * D_Y * 12)/8, // SampleSize 0, // Reserved //MEDIATYPE_Video STATIC_KSDATAFORMAT_TYPE_VIDEO, // MEDIASUBTYPE_I420 FCC_FORMAT_YUV12A, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71, STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO }, TRUE, // BOOL, bFixedSizeSamples (all samples same size?) TRUE, // BOOL, bTemporalCompression (all I frames?) KS_VIDEOSTREAM_CAPTURE, // StreamDescriptionFlags 0, // MemoryAllocationFlags (KS_VIDEO_ALLOC_*) // _KS_VIDEO_STREAM_CONFIG_CAPS { STATIC_KSDATAFORMAT_SPECIFIER_VIDEOINFO, KS_AnalogVideo_None, // VideoStandard D_X, D_Y, // InputSize, (the inherent size of the incoming signal // with every digitized pixel unique) D_X, D_Y, // MinCroppingSize, smallest rcSrc cropping rect allowed D_X, D_Y, // MaxCroppingSize, largest rcSrc cropping rect allowed 1, // CropGranularityX, granularity of cropping size 1, // CropGranularityY 1, // CropAlignX, alignment of cropping rect 1, // CropAlignY; D_X, D_Y, // MinOutputSize, smallest bitmap stream can produce D_X, D_Y, // MaxOutputSize, largest bitmap stream can produce 1, // OutputGranularityX, granularity of output bitmap size 1, // OutputGranularityY; 0, // StretchTapsX 0, // StretchTapsY 0, // ShrinkTapsX 0, // ShrinkTapsY 300000, // MinFrameInterval, 100 nS units 1249999, // MaxFrameInterval, 100 nS units 12 * 8 * D_X * D_Y, // MinBitsPerSecond; 12 * 33 * D_X * D_Y // MaxBitsPerSecond; }, // KS_VIDEOINFOHEADER (default format) { 0,0,0,0, // RECT rcSource; 0,0,0,0, // RECT rcTarget; D_X * D_Y * 12 * 24, // DWORD dwBitRate; 0L, // DWORD dwBitErrorRate; 416666, // REFERENCE_TIME AvgTimePerFrame; sizeof (KS_BITMAPINFOHEADER), // DWORD biSize; D_X, // LONG biWidth; D_Y, // LONG biHeight; 1, // WORD biPlanes; 12, // WORD biBitCount; FCC_FORMAT_YUV12A, // DWORD biCompression; (D_X * D_Y * 12)/8, // DWORD biSizeImage; 0, // LONG biXPelsPerMeter; 0, // LONG biYPelsPerMeter; 0, // DWORD biClrUsed; 0 // DWORD biClrImportant; } |
|