相机配置文件 V2) (配置文件声明示例
我们采用一个支持新的高帧速率配置文件的假设相机。 让我们为设备定义一些约束。
预览引脚为固定 0。 在相机驱动程序声明的KSFILTER_DESCRIPTOR中,定义KSPIN_DESCRIPTOR_EX数组时,第一个KSPIN_DESCRIPTOR_EX是预览引脚的描述符。 同样,引脚 1 是捕获引脚,引脚 2 是照片引脚。
由于硬件限制,有问题的设备无法处理帧速率为 60 fps 或更高的缩放。 因此,预览流和捕获流必须具有相同的分辨率。
同样,设备也无法处理 60 fps 或更高的颜色空间转换。
相机能够以 60 fps 的速度流式传输 4K 16x9 视频。 相机还能够以 60 fps) 3840x2880@60fps (4:3 视频。
以 60 fps 的速度运行时,相机无法提供任何照片操作。
我们还将声明视频录制配置文件,限制为 30 fps,但可能允许任何分辨率组合/子类型。
例如,对于视频录制个人资料照片序列不支持 (单个照片操作) 工作。
对于基于 INF 的声明,必须为每个 Pin 媒体类型筛选器分配一个注册表项名称。 此名称必须是 MTF# ,其中 # 表示整数值。
鉴于这些约束,我们可以声明以下配置文件:
[SampleDriver.CameraInterface.AddReg]
; Declare our schema version.
HKR,,"OEMCameraProfileVersion",0x00010001,2
;
; Declare our HighFrameRate profile with a lock resolution/subtype constraint.
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","Constraint",0,"LRS;LST"
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","MTF0",0,"Pin0:((RES==;FRT==;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","MTF1",0,"Pin1:((RES==;FRT>=60,1;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","MTF2",0,"Pin2:(!)"
;
; Declare our VideoRecording profile.
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","BlockedControls",0,"PHSEQ"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF0",0,"Pin0:((RES==;FRT==;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF1",0,"Pin1:((RES==;FRT<=30,1;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF2",0,"Pin2:((RES==;FRT==;SUT==ALL))"
通过将 OEMCameraProfileVersion 注册表项设置为 2,我们向捕获管道指示我们支持新的基于约束的配置文件架构。
[SampleDriver.CameraInterface.AddReg]
HKR,,"OEMCameraProfileVersion",0x00010001,2
声明后,所有配置文件都必须存储在“设备接口”节点下的“配置文件”注册表项下。
[SampleDriver.CameraInterface.AddReg]
HKR,,"OEMCameraProfileVersion",0x00010001,2
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","Constraint",0,"LRS;LST"
必须使用配置文件 ID 将每个配置文件配置为配置文件密钥下的子项。 配置文件 ID 由配置文件类型、配置文件索引组成。
配置文件类型可以是以下任何一种已知的配置文件类型或 {GUID} 字符串:
KSCAMERAPROFILE_HighQualityPhoto
KSCAMERAPROFILE_BalancedVideoAndPhoto
KSCAMERAPROFILE_VideoConferencing
KSCAMERAPROFILE_PhotoSequence
KSCAMERAPROFILE_FaceAuth_Mode
KSCAMERAPROFILE_HighFrameRate
KSCAMERAPROFILE_HDRWithWCGVideo
KSCAMERAPROFILE_HDRWithWCGPhoto
KSCAMERAPROFILE_VariablePhotoSequence
KSCAMERAPROFILE_VideoHDR8
配置文件索引可以是除0xFFFFFFFF之外的任何 32 位无符号整数。 0xFFFFFFFF 的索引值是保留的,不得由任何 IHV/OEM 声明使用。
配置文件子项的约束项的声明指示我们具有配置文件级约束:
[SampleDriver.CameraInterface.AddReg]
HKR,,"OEMCameraProfileVersion",0x00010001,2
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","Constraint",0,"LRS;LST"
对于高帧速率配置文件, LRS;LST
指示所有引脚的分辨率必须相同,子类型也必须相同, (捕获管道) 不允许缩放或颜色空间转换。
对于高帧速率配置文件的预览引脚,我们允许预览引脚上提供任何分辨率/帧速率。 对于我们假设的设备,预览引脚永远不会公开超过 30 fps。
[SampleDriver.CameraInterface.AddReg]
HKR,,"OEMCameraProfileVersion",0x00010001,2
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","Constraint",0,"LRS;LST"
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","MTF0",0,"Pin0:((RES==;FRT==;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","MTF1",0,"Pin1:((RES==;FRT>=60,1;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","MTF2",0,"Pin2:(!)"
对于捕获引脚,我们允许任何分辨率和任何帧速率 60 fps 或更高。
[SampleDriver.CameraInterface.AddReg]
HKR,,"OEMCameraProfileVersion",0x00010001,2
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","Constraint",0,"LRS;LST"
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","MTF0",0,"Pin0:((RES==;FRT==;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","MTF1",0,"Pin1:((RES==;FRT>=60,1;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","MTF2",0,"Pin2:(!)"
当照片固定不可用时:
[SampleDriver.CameraInterface.AddReg]
HKR,,"OEMCameraProfileVersion",0x00010001,2
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","Constraint",0,"LRS;LST"
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","MTF0",0,"Pin0:((RES==;FRT==;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","MTF1",0,"Pin1:((RES==;FRT>=60,1;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_HighFrameRate,0","MTF2",0,"Pin2:(!)"
除了高帧速率配置文件外,我们还提供标准视频录制配置文件。
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","BlockedControls",0,"PHSEQ"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF0",0,"Pin0:((RES==;FRT==;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF1",0,"Pin1:((RES==;FRT<=30,1;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF2",0,"Pin2:((RES==;FRT==;SUT==ALL))"
同样,我们对预览引脚没有限制,因为我们的假设相机只公开 30 fps 预览,只有保证在视频录制或高帧速率方案中并发的媒体类型。
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","BlockedControls",0,"PHSEQ"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF0",0,"Pin0:((RES==;FRT==;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF1",0,"Pin1:((RES==;FRT<=30,1;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF2",0,"Pin2:((RES==;FRT==;SUT==ALL))"
但对于捕获引脚,我们需要将其限制为 30 fps 媒体类型,因为我们不能在预览和捕获或照片操作之间支持更高分辨率的帧速率。
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","BlockedControls",0,"PHSEQ"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF0",0,"Pin0:((RES==;FRT==;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF1",0,"Pin1:((RES==;FRT<=30,1;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF2",0,"Pin2:((RES==;FRT==;SUT==ALL))"
对于照片固定,我们通过将此配置文件的“照片序列”控件声明为被阻止来声明无照片序列支持。
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","BlockedControls",0,"PHSEQ"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF0",0,"Pin0:((RES==;FRT==;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF1",0,"Pin1:((RES==;FRT<=30,1;SUT==ALL))"
HKR,"Profiles\KSCAMERAPROFILE_VideoRecording,0","MTF2",0,"Pin2:((RES==;FRT==;SUT==ALL))"