KS-CAMERA相机工作流程
2024-08-08
25
0
IRP_MJ_CREATE
- FileName:\global
FileName:{146F1A80-4791-11D0-A5D6-28DB04C10000}\KSPIN_CONNECT\KSDATAFORMAT
KSPIN_CONNECT
typedef struct { KSPIN_INTERFACE Interface; KSPIN_MEDIUM Medium; ULONG PinId; HANDLE PinToHandle; KSPRIORITY Priority; } KSPIN_CONNECT, *PKSPIN_CONNECT;
KSDATAFORMAT
typedef struct { ULONG FormatSize; ULONG Flags; ULONG SampleSize; ULONG Reserved; GUID MajorFormat; GUID SubFormat; GUID Specifier; } KSDATAFORMAT, *PKSDATAFORMAT, KSDATARANGE, *PKSDATARANGE;
可扩展的结构体如下:
typedef struct tagKS_DATAFORMAT_VIDEOINFOHEADER {
KSDATAFORMAT DataFormat;
KS_VIDEOINFOHEADER VideoInfoHeader;
} KS_DATAFORMAT_VIDEOINFOHEADER, *PKS_DATAFORMAT_VIDEOINFOHEADER;
typedef struct tagKS_DATAFORMAT_VIDEOINFOHEADER2 {
KSDATAFORMAT DataFormat;
KS_VIDEOINFOHEADER2 VideoInfoHeader2;
} KS_DATAFORMAT_VIDEOINFOHEADER2, *PKS_DATAFORMAT_VIDEOINFOHEADER2;
typedef struct tagKS_DATAFORMAT_MPEGVIDEOINFO2 {
KSDATAFORMAT DataFormat;
KS_MPEGVIDEOINFO2 MpegVideoInfoHeader2;
} KS_DATAFORMAT_MPEGVIDEOINFO2, *PKS_DATAFORMAT_MPEGVIDEOINFO2;
typedef struct tagKS_DATAFORMAT_H264VIDEOINFO {
KSDATAFORMAT DataFormat;
KS_H264VIDEOINFO H264VideoInfoHeader;
} KS_DATAFORMAT_H264VIDEOINFO, *PKS_DATAFORMAT_H264VIDEOINFO;
typedef struct tagKS_DATAFORMAT_IMAGEINFO {
KSDATAFORMAT DataFormat;
KS_BITMAPINFOHEADER ImageInfoHeader;
} KS_DATAFORMAT_IMAGEINFO, *PKS_DATAFORMAT_IMAGEINFO;
typedef struct tagKS_DATAFORMAT_VIDEOINFO_PALETTE {
KSDATAFORMAT DataFormat;
KS_VIDEOINFO VideoInfo;
} KS_DATAFORMAT_VIDEOINFO_PALETTE, *PKS_DATAFORMAT_VIDEOINFO_PALETTE;
typedef struct tagKS_DATAFORMAT_VBIINFOHEADER {
KSDATAFORMAT DataFormat;
KS_VBIINFOHEADER VBIInfoHeader;
} KS_DATAFORMAT_VBIINFOHEADER, *PKS_DATAFORMAT_VBIINFOHEADER;
IRP_MJ_DEVICE_CONTROL
- ioctl: IOCTL_KS_PROPERTY
- request: Connection KSPROPERTY_CONNECTION_STATE
- set type: KSSTATE_ACQUIRE
- ioctl : IOCTL_KS_PROPERTY
- request: Connection KSPROPERTY_CONNECTION_STATE
- set type: KSSTATE_PAUSE
ioctl: IOCTL_KS_PROPERTY
- request: Connection KSPROPERTY_CONNECTION_STATE
- set type: KSSTATE_RUN
ioctl: IOCTL_KS_READ_STREAM
….- IOCTL_KS_PROPERTY
- request: Connection KSPROPERTY_CONNECTION_STATE
- set type: KSSTATE_STOP