相機配置檔 V2) (範例設定檔宣告
我們採用支援新高幀速率配置檔的假設相機。 讓我們為裝置定義一些條件約束。
預覽釘選為 Pin 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"
每個設定檔都必須使用設定檔識別碼,設定為 [配置檔] 金鑰下的子機碼。 配置文件識別碼是由配置檔類型、配置檔索引所組成。
設定檔案類型可以是下列任何一個已知的設定檔類型或 {GUID} 字串:
KSCAMERAPROFILE_HighQualityPhoto
KSCAMERAPROFILE_BalancedVideoAndPhoto
KSCAMERAPROFILE_VideoConferencing
KSCAMERAPROFILE_PhotoSequence
KSCAMERAPROFILE_FaceAuth_Mode
KSCAMERAPROFILE_HighFrameRate
KSCAMERAPROFILE_HDRWithWCGVideo
KSCAMERAPROFILE_HDRWithWCGPhoto
KSCAMERAPROFILE_VariablePhotoSequence
KSCAMERAPROFILE_VideoHDR8
配置檔索引可以是任何 32 位無符號整數,但0xFFFFFFFF除外。 0xFFFFFFFF的索引值是保留的,不得由任何 IHV/OEM 宣告使用。
設定文件子機碼的 Constraint 專案宣告,表示我們有配置檔層級條件約束:
[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))"