dear all,
I try to develop a usb 2.0 camera, but meet some problem.
it is fine to use amcap to play video of "RGB24" format, but
modify it to RGB565 made the amcap has error message(
IsEqualGUID(GetBitmapSubtype(&VidInfoHdr->bmiHeader), *pmt->Subtype()) )
I wonder the "KS_DATARANGE_VIDEO" define is not correct to cause this error
message. How do I to modify the definition of "KS_DATARANGE_VIDEO" ??
thanks.
My definition is list in below:
#define FCC_FORMAT_RGB565 0xe436eb7b
#define D_X 640
#define D_Y 480
KS_DATARANGE_VIDEO _StreamFormat_RGB565_640x480 =
{
// KSDATARANGE
{
sizeof (KS_DATARANGE_VIDEO),
0, // Flags
(D_X * D_Y * 16) / 8, // SampleSize
0, // Reserved
//MEDIATYPE_Video
STATIC_KSDATAFORMAT_TYPE_VIDEO,
//MEDIASUBTYPE_RGB565
FCC_FORMAT_RGB565, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf,
0x0b, 0xa7, 0x70,
//FORMAT_VideoInfo
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
333333, // MinFrameInterval, 100 nS units => 30 fps
5000000, // MaxFrameInterval, 100 nS units => 2 fps
16 * 2 * D_X * D_Y, // MinBitsPerSecond;
16 * 30 * 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 * 16 * 15, // DWORD dwBitRate;
0L, // DWORD dwBitErrorRate;
666666, // REFERENCE_TIME
AvgTimePerFrame;
sizeof (KS_BITMAPINFOHEADER), // DWORD biSize;
D_X, // LONG biWidth;
D_Y, // LONG biHeight;
1, // WORD biPlanes;
16, // WORD biBitCount;
0, // DWORD biCompression;
(D_X * D_Y * 16) / 8, // DWORD biSizeImage;
0, // LONG biXPelsPerMeter;
0, // LONG biYPelsPerMeter;
0, // DWORD biClrUsed;
0 // DWORD biClrImportant;
}
};
#undef D_X
#undef D_Y