KS-Camera
+ -

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

IRP_MJ_CLEANUP

IRP_MJ_CLEANUP

IRP_MJ_CLOSE

IRP_MJ_CLOSE

0 篇笔记 写笔记

作者信息
我爱内核
Windows驱动开发,网站开发
好好学习,天天向上。
取消
感谢您的支持,我会继续努力的!
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

您的支持,是我们前进的动力!