📄 intelcam.c
字号:
0, // DWORD biClrUsed;
0 // DWORD biClrImportant;
}
};
#undef D_X
#undef D_Y
#define D_X 176
#define D_Y 144
KS_DATARANGE_VIDEO INTELCAM_StillFormat_4 =
{
// 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_STILL, // 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
10000000/1, // MinFrameInterval, 100 nS units
10000000/1, // MaxFrameInterval, 100 nS units
12 * 1 * D_X * D_Y, // MinBitsPerSecond;
12 * 1 * 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 * 1, // DWORD dwBitRate;
0L, // DWORD dwBitErrorRate;
10000000 /1, // 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;
}
};
#undef D_X
#undef D_Y
#define D_X 320
#define D_Y 240
KS_DATARANGE_VIDEO INTELCAM_StillFormat_5 =
{
// 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_STILL, // 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
10000000/1, // MinFrameInterval, 100 nS units
10000000/1, // MaxFrameInterval, 100 nS units
12 * 1 * D_X * D_Y, // MinBitsPerSecond;
12 * 1 * 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 * 1, // DWORD dwBitRate;
0L, // DWORD dwBitErrorRate;
10000000 /1, // 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;
}
};
#undef D_X
#undef D_Y
PKSDATAFORMAT INTELCAM_StillStreamFormats[] =
{
(PKSDATAFORMAT) &INTELCAM_StillFormat_0,
(PKSDATAFORMAT) &INTELCAM_StillFormat_1,
(PKSDATAFORMAT) &INTELCAM_StillFormat_2,
(PKSDATAFORMAT) &INTELCAM_StillFormat_3,
(PKSDATAFORMAT) &INTELCAM_StillFormat_4,
(PKSDATAFORMAT) &INTELCAM_StillFormat_5
};
#define NUM_INTELCAM_STILL_STREAM_FORMATS \
(sizeof (INTELCAM_StillStreamFormats) / sizeof (PKSDATAFORMAT))
//---------------------------------------------------------------------------
// Create an array that holds the list of all of the streams supported
//---------------------------------------------------------------------------
HW_STREAM_INFORMATION Streams [] =
{
// -----------------------------------------------------------------
// INTELCAM_VideoStream
// -----------------------------------------------------------------
{
// HW_STREAM_INFORMATION -------------------------------------------
1, // NumberOfPossibleInstances
KSPIN_DATAFLOW_OUT, // DataFlow
TRUE, // DataAccessible
NUM_INTELCAM_VIDEO_STREAM_FORMATS, // NumberOfFormatArrayEntries
INTELCAM_VideoStreamFormats, // StreamFormatsArray
NULL, // ClassReserved[0]
NULL, // ClassReserved[1]
NULL, // ClassReserved[2]
NULL, // ClassReserved[3]
NUMBER_VIDEO_STREAM_PROPERTIES, // NumStreamPropArrayEntries
(PKSPROPERTY_SET) VideoStreamProperties,// StreamPropertiesArray
0, // NumStreamEventArrayEntries;
0, // StreamEventsArray;
(GUID *) &PINNAME_VIDEO_CAPTURE, // Category
(GUID *) &PINNAME_VIDEO_CAPTURE, // Name
0, // MediumsCount
&StandardMedium, // Mediums
FALSE, // BridgeStream
{0,0}
},
// -----------------------------------------------------------------
// INTELCAM_StillStream
// -----------------------------------------------------------------
{
// HW_STREAM_INFORMATION -------------------------------------------
1, // NumberOfPossibleInstances
KSPIN_DATAFLOW_OUT, // DataFlow
TRUE, // DataAccessible
NUM_INTELCAM_STILL_STREAM_FORMATS, // NumberOfFormatArrayEntries
INTELCAM_StillStreamFormats, // StreamFormatsArray
NULL, // ClassReserved[0]
NULL, // ClassReserved[1]
NULL, // ClassReserved[2]
NULL, // ClassReserved[3]
NUMBER_VIDEO_STREAM_PROPERTIES, // NumStreamPropArrayEntries
(PKSPROPERTY_SET) VideoStreamProperties,// StreamPropertiesArray
0, // NumStreamEventArrayEntries;
0, // StreamEventsArray;
(GUID *) &PINNAME_VIDEO_STILL, // Category
(GUID *) &PINNAME_VIDEO_STILL, // Name
0, // MediumsCount
&StandardMedium, // Mediums
FALSE, // BridgeStream
{0,0}
}
};
#define DRIVER_STREAM_COUNT (sizeof (Streams) / sizeof (HW_STREAM_INFORMATION))
/*
** AdapterCompareGUIDsAndFormatSize()
**
** Checks for a match on the three GUIDs and FormatSize
**
** Arguments:
**
** IN DataRange1
** IN DataRange2
**
** Returns:
**
** TRUE if all elements match
** FALSE if any are different
**
** Side Effects: none
*/
BOOLEAN
AdapterCompareGUIDsAndFormatSize(
IN PKSDATARANGE DataRange1,
IN PKSDATARANGE DataRange2)
{
return (
IsEqualGUID (
&DataRange1->MajorFormat,
&DataRange2->MajorFormat) &&
IsEqualGUID (
&DataRange1->SubFormat,
&DataRange2->SubFormat) &&
IsEqualGUID (
&DataRange1->Specifier,
&DataRange2->Specifier) &&
(DataRange1->FormatSize == DataRange2->FormatSize));
}
/*
** AdapterFormatFromRange()
**
** Returns a DATAFORMAT from a DATARANGE
**
** Arguments:
**
** IN PHW_STREAM_REQUEST_BLOCK pSrb
**
** Returns:
**
** STATUS_SUCCESS if format is supported
**
** Side Effects: none
*/
NTSTATUS
AdapterFormatFromRange(
IN PHW_STREAM_REQUEST_BLOCK Srb)
{
PSTREAM_DATA_INTERSECT_INFO intersectInfo;
PKSDATARANGE dataRange;
ULONG formatSize;
ULONG streamNumber;
ULONG j;
ULONG numberOfFormatArrayEntries;
PKSDATAFORMAT *availableFormats;
NTSTATUS ntStatus = STATUS_SUCCESS;
BOOL bMatchFound = FALSE;
intersectInfo = Srb->CommandData.IntersectInfo;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -