;===============================================================================
; Elgato Game Capture 4K60 Pro MK.2
; Driver Install Script (64 bit)
; Copyright (c) 2019, Corsair Memory, Inc.
;-------------------------------------------------------------------------------
; History:
;-------------------------------------------------------------------------------
; 21-Jan-19 FMB 1.1.0.184.1  First customized INF file
; 11-Mar-19 MS  1.1.0.184.4 Support for HW version 1.1
; 15-Mar-19 MS	1.1.0.184.7 Add HDR to SDR tone mapping        
; 29-Mar-19 MS  1.1.0.184.9 Fix reading / writing EDID      
; 10-Apr-19 MS  1.1.0.185.0.1 Fix HDR detection   
; 24-Apr-19 MS  1.1.0.185.0.2 EDID mode selection, Fix interlaced support 
; 29-Apr-19 MS  1.1.0.185.2 Fix:Problems with color space        
; 08-May-19 TS  1.1.0.185.3 Show color range on property page. Fix EDID mode selection.
; 14-Jun-19 MS  1.1.0.185.5 Support for new FPGA firmware
; 18-Jun-19 MS  1.1.0.185.6 Support for new FPGA firmware
; 27-Jun-19 MS  1.1.0.185.7 Fix picture error
; 08-Jul-19 MS  1.1.0.185.8 Improve DS property page
; 18-Jul-19 MS  1.1.0.185.9 Add Infos to the DS proprty page
; 31-Jul-19 MS  1.1.0.186.1 Fix signal problem when recording HDR
; 13-Aug-19 MS	1.1.0.186.2 Fix HDR pixelation 
; 20-AUG-19 MS  1.1.0.186.3 Fix 1080p144
;------------------------------------------------------------------------------
; Notes:
;------------------------------------------------------------------------------
; VersionTag = 1.1.0.186.3
;==============================================================================

[Version]
Signature   = "$CHICAGO$"
Class       = Media
ClassGUID   = {4d36e96c-e325-11ce-bfc1-08002be10318}
Provider    = %Provider%
DriverVer   = 08/20/2019, 1.1.0.186
CatalogFile = GameCapture4K60ProMK2.cat


[SourceDisksNames]
1 = %DiskName%,,

[SourceDisksFiles]
SC0710.X64.SYS		 = 1
SC0710.X86.AX 		 = 1
SC0710.X64.AX 		 = 1
SC0710.C86.AX 		 = 1
SC0710.C64.AX 		 = 1
NO.SIGNAL.BMP  		 = 1
SC0710.BASE.FW.TXT 	 = 1	
SC0710.BASE.FW.HEX   = 1	


[DestinationDirs]
GameCapture.CopySys       = 12          ; driver files
GameCapture.CopyDll32     = 10,SysWow64 ; 32-bit DLLs
GameCapture.CopyDll64     = 11          ; 64-bit DLLs
GameCapture.CopyFirmwares = 10, SC0710	; C:\WINDOWS\SC0710



[ControlFlags]
ExcludeFromSelect = *


[Manufacturer]
%Provider% = Elgato, NTamd64

[Elgato.NTamd64]
%GameCapture.DeviceDesc% = GameCapture, PCI\VEN_12AB&DEV_0710&SUBSYS_0000 ; Game Capture 4K60 Pro MK.2 (prototype)
%GameCapture.DeviceDesc% = GameCapture, PCI\VEN_12AB&DEV_0710&SUBSYS_000E1CFA ; Game Capture 4K60 Pro MK.2

[GameCapture.NTamd64]
Include       = ks.inf, kscaptur.inf, ksfilter.inf, bda.inf, wdmaudio.inf
Needs         = KS.Registration, KSCAPTUR.Registration.NT, BDA.Installation.NT, WDMAUDIO.Registration.NT
AddReg        = GameCapture.AddReg, SC0710.AddReg
CopyFiles     = GameCapture.CopySys, GameCapture.CopyDll32, GameCapture.CopyDll64, GameCapture.CopyFirmwares

;FMB NOTE: flag 0x00000004 = COPYFLG_NOVERSIONCHECK
[GameCapture.CopySys]
SC0710.X64.SYS  , , , 0x00000004

[GameCapture.CopyDll32]
SC0710.X86.AX   , , , 0x00000004
SC0710.C86.AX   , , , 0x00000004

[GameCapture.CopyDll64]
SC0710.X64.AX   , , , 0x00000004
SC0710.C64.AX   , , , 0x00000004

[GameCapture.CopyFirmwares]
NO.SIGNAL.BMP   , , , 0x00000004
SC0710.BASE.FW.TXT, , , 0x00000004
SC0710.BASE.FW.HEX, , , 0x00000004

;===============================================================
;                R e g i s t r y
;===============================================================

[GameCapture.AddReg]
HKR,,DevLoader,,*NTKERN
HKR,,NTMPDriver,,SC0710.X64.SYS
HKR,,HardwareConfig,1,1
HKR,,USDClass,,"{0527D1D0-88C2-11D2-82C7-00C04F8EC183}"
HKR,,PageOutWhenUnopened,3,01

; ICopyProtNotifyProperty
;
HKCR,Wow6432Node\CLSID\{868DE3D7-1ED1-4698-AF07-0A4B57662572}, , , %CPNOTIFY.PROPERTY.INTERFACE.NAME%
HKCR,Wow6432Node\CLSID\{868DE3D7-1ED1-4698-AF07-0A4B57662572}\InprocServer32, , , SC0710.C86.AX
HKCR,Wow6432Node\CLSID\{868DE3D7-1ED1-4698-AF07-0A4B57662572}\InprocServer32, ThreadingModel, , Both
HKCR,CLSID\{868DE3D7-1ED1-4698-AF07-0A4B57662572}, , , %CPNOTIFY.PROPERTY.INTERFACE.NAME%
HKCR,CLSID\{868DE3D7-1ED1-4698-AF07-0A4B57662572}\InprocServer32, , , SC0710.C64.AX
HKCR,CLSID\{868DE3D7-1ED1-4698-AF07-0A4B57662572}\InprocServer32, ThreadingModel, , Both
HKLM,System\CurrentControlSet\Control\MediaInterfaces\{868DE3D7-1ED1-4698-AF07-0A4B57662572}, , , %CPNOTIFY.PROPERTY.INTERFACE.NAME%
HKLM,System\CurrentControlSet\Control\MediaInterfaces\{868DE3D7-1ED1-4698-AF07-0A4B57662572}, IID, 1, 00,00,00,00, 00,00, 00,00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

; ICustomProperty
;
HKCR,Wow6432Node\CLSID\{D1E5209F-68FD-4529-BEE0-5E7A1F479226}, , , %CUSTOM.PROPERTY.INTERFACE.NAME%
HKCR,Wow6432Node\CLSID\{D1E5209F-68FD-4529-BEE0-5E7A1F479226}\InprocServer32, , , SC0710.X86.AX
HKCR,Wow6432Node\CLSID\{D1E5209F-68FD-4529-BEE0-5E7A1F479226}\InprocServer32, ThreadingModel, , Both
HKCR,CLSID\{D1E5209F-68FD-4529-BEE0-5E7A1F479226}, , , %CUSTOM.PROPERTY.INTERFACE.NAME%
HKCR,CLSID\{D1E5209F-68FD-4529-BEE0-5E7A1F479226}\InprocServer32, , , SC0710.X64.AX
HKCR,CLSID\{D1E5209F-68FD-4529-BEE0-5E7A1F479226}\InprocServer32, ThreadingModel, , Both
HKLM,System\CurrentControlSet\Control\MediaInterfaces\{D1E5209F-68FD-4529-BEE0-5E7A1F479226}, , , %CUSTOM.PROPERTY.INTERFACE.NAME%
HKLM,System\CurrentControlSet\Control\MediaInterfaces\{D1E5209F-68FD-4529-BEE0-5E7A1F479226}, IID, 1, 9F,20,E5,D1, FD,68, 29,45, 0xBE, 0xE0, 0x5E, 0x7A, 0x1F, 0x47, 0x92, 0x26

; CCustomPropertyPage
;
HKCR,Wow6432Node\CLSID\{15E3F6CE-F3DD-454A-8DEA-E4A380FCCB26}, , , %CUSTOM.PROPERTY.PAGE.NAME%
HKCR,Wow6432Node\CLSID\{15E3F6CE-F3DD-454A-8DEA-E4A380FCCB26}\InprocServer32, , , SC0710.X86.AX
HKCR,Wow6432Node\CLSID\{15E3F6CE-F3DD-454A-8DEA-E4A380FCCB26}\InprocServer32, ThreadingModel, , Both
HKCR,CLSID\{15E3F6CE-F3DD-454A-8DEA-E4A380FCCB26}, , , %CUSTOM.PROPERTY.PAGE.NAME%
HKCR,CLSID\{15E3F6CE-F3DD-454A-8DEA-E4A380FCCB26}\InprocServer32, , , SC0710.X64.AX
HKCR,CLSID\{15E3F6CE-F3DD-454A-8DEA-E4A380FCCB26}\InprocServer32, ThreadingModel, , Both
HKLM,System\CurrentControlSet\Control\MediaSets\{D1E5209F-68FD-4529-BEE0-5E7A1F479226}\PropertyPages\{15E3F6CE-F3DD-454A-8DEA-E4A380FCCB26}, , , %CUSTOM.PROPERTY.PAGE.NAME%

[SC0710.AddReg]
HKLM,SYSTEM\CurrentControlSet\Control\MediaCategories\{6F814BE9-9AF6-43CF-9249-C0345A010026},Name,0,"Video Capture"
HKLM,SYSTEM\CurrentControlSet\Control\MediaCategories\{6F814BE9-9AF6-43CF-9249-C0345A010026},Display,1,00,00,00,00
HKLM,SYSTEM\CurrentControlSet\Control\MediaCategories\{6F814BE9-9AF6-43CF-9249-C0345A010126},Name,0,"Audio Capture"
HKLM,SYSTEM\CurrentControlSet\Control\MediaCategories\{6F814BE9-9AF6-43CF-9249-C0345A010126},Display,1,00,00,00,00
HKLM,SYSTEM\CurrentControlSet\Control\MediaCategories\{6F814BE9-9AF6-43CF-9249-C0345A010526},Name,0,"Video Preivew"
HKLM,SYSTEM\CurrentControlSet\Control\MediaCategories\{6F814BE9-9AF6-43CF-9249-C0345A010526},Display,1,00,00,00,00
HKLM,SYSTEM\CurrentControlSet\Control\MediaCategories\{6F814BE9-9AF6-43CF-9249-C0345A010626},Name,0,"Audio Preivew"
HKLM,SYSTEM\CurrentControlSet\Control\MediaCategories\{6F814BE9-9AF6-43CF-9249-C0345A010626},Display,1,00,00,00,00

HKR,,CustomAnalogVideoDeinterlaceTypePropertyA,        0x00010001,0x00000001 ; 0 = BOB / 1 = WEAVE / 2 = HYBRID / 3 = BLEND
HKR,,CustomAnalogVideoDeinterlaceTypePropertyB,        0x00010001,0x00000001 ; 0 = BOB / 1 = WEAVE / 2 = HYBRID / 3 = BLEND
HKR,,CustomAnalogVideoDeinterlaceTypePropertyC,        0x00010001,0x00000001 ; 0 = BOB / 1 = WEAVE / 2 = HYBRID / 3 = BLEND
HKR,,CustomAnalogVideoDeinterlaceTypePropertyD,        0x00010001,0x00000001 ; 0 = BOB / 1 = WEAVE / 2 = HYBRID / 3 = BLEND

HKR,,CustomAnalogVideoFlexibleResolutionPatchProperty, 0x00010001,0x00000001 ; 0 = DISABLE / 1 = ENABLE
HKR,,CustomAnalogVideoFlexibleFpsPatchProperty,        0x00010001,0x00000000 ; 0 = DISABLE / 1 = ENABLE
HKR,,CustomOsdTextEnableProperty,                      0x00010001,0x00000000 ; 0 = DISABLE / 1 = ENABLE
HKR,,CustomInstancesPossibleProperty,                  0x00010001,0x00000001 ; 0 = DISABLE / 1 = ENABLE
HKR,,AnalogVideoDecoderStandardProperty,               0x00010001,0x00000001 ; 1 = NTSC M / 16 = PAL B
HKR,,AnalogCrossbarVideoInputProperty,                 0x00010001,0x00000000 ; 0 = HDMI / 1 = DVI-D / 2 = COMPONENT / 3 = DVI-A / 4 = SDI
HKR,,AnalogCrossbarAudioInputProperty,                 0x00010001,0x00000000 ; 0 = EMBEDDED AUDIO / 1 = LINE IN
HKR,,CustomSoftwareLockProperty,                       0x00010001,0x00000001 ; 0 = DISABLE / 1 = ENABLE
HKR,,CustomSoftwareUIProperty,                         0x00010001,0x00000001 ; 0 = HIDE / 1 = SIMPLE / 2 = FULL
HKR,,CustomCompanyMedicalProperty,                     0x00010001,0x00000001 ; 0 = DISABLE / 1 = ENABLE
HKR,,CustomCompanyPowerCreatorProperty,                0x00010001,0x00000001 ; 0 = DISABLE / 1 = ENABLE
HKR,,CustomCompanyElgatoProperty,                      0x00010001,0x00000001 ; 0 = DISABLE / 1 = ENABLE
HKR,,CustomAnalogVideoNativeColorSpaceProperty,        0x00010001,0x00000002 ; 0 = 4:2:2 / 1 = 4:4:4 / 2 = AUTO
HKR,,CustomAnalogVideoNativeColorDeepProperty,         0x00010001,0x00000002 ; 0 = 8 BITS / 1 = 10 BITS / 2 = AUTO
HKR,,CustomDeviceInfoDirectoryProperty, ,              "\??\%10%\SC0710\"

;===============================================================
;                I n t e r f a c e s
;===============================================================

[GameCapture.NTamd64.Interfaces]
; Registration as CLSID_InputAudio required for OBS
AddInterface = %CLSID_InputAudio%       , %REFGUID_AUDIO%        , Audio_Interface
AddInterface = %KSCATEGORY_AUDIO%       , %REFGUID_AUDIO%        , Audio_Interface
AddInterface = %KSCATEGORY_CAPTURE%     , %REFGUID_AUDIO%        , Audio_Interface

AddInterface = %KSCATEGORY_VIDEO%       , %REFGUID_CAPTURE%      , AnalogCapture_Interface
AddInterface = %KSCATEGORY_CAPTURE%     , %REFGUID_CAPTURE%      , AnalogCapture_Interface

AddInterface = %CLSID_InputAudio%       , %REFGUID_AUDIO.01%     , Audio_Interface.01
AddInterface = %KSCATEGORY_AUDIO%       , %REFGUID_AUDIO.01%     , Audio_Interface.01
AddInterface = %KSCATEGORY_CAPTURE%     , %REFGUID_AUDIO.01%     , Audio_Interface.01

AddInterface = %KSCATEGORY_VIDEO%       , %REFGUID_CAPTURE.01%   , AnalogCapture_Interface.01
AddInterface = %KSCATEGORY_CAPTURE%     , %REFGUID_CAPTURE.01%   , AnalogCapture_Interface.01

AddInterface = %CLSID_InputAudio%       , %REFGUID_AUDIO.02%     , Audio_Interface.02
AddInterface = %KSCATEGORY_AUDIO%       , %REFGUID_AUDIO.02%     , Audio_Interface.02
AddInterface = %KSCATEGORY_CAPTURE%     , %REFGUID_AUDIO.02%     , Audio_Interface.02

AddInterface = %KSCATEGORY_VIDEO%       , %REFGUID_CAPTURE.02%   , AnalogCapture_Interface.02
AddInterface = %KSCATEGORY_CAPTURE%     , %REFGUID_CAPTURE.02%   , AnalogCapture_Interface.02

;---------------------------------------------------------------
; WDM streaming interfaces (audio)
;---------------------------------------------------------------

[Audio_Interface]
AddReg = Audio_Interface.AddReg

[Audio_Interface.AddReg]
HKR,,CLSID,,%PROXY_CAPTURE%
HKR,,FriendlyName,,%DShow.AudioCapture%

;---------------------------------------------------------------
; WDM streaming interfaces (analog TV/capture)
;---------------------------------------------------------------

[AnalogCapture_Interface]
AddReg = AnalogCapture_Interface.AddReg

[AnalogCapture_Interface.AddReg]
HKR,,CLSID,,%PROXY_CAPTURE%
HKR,,FriendlyName,,%DShow.AnalogCapture%

;---------------------------------------------------------------
; WDM streaming interfaces (audio)
;---------------------------------------------------------------

[Audio_Interface.01]
AddReg = Audio_Interface.AddReg.01

[Audio_Interface.AddReg.01]
HKR,,CLSID,,%PROXY_CAPTURE%
HKR,,FriendlyName,,%DShow.AudioCapture.01%

;---------------------------------------------------------------
; WDM streaming interfaces (analog TV/capture)
;---------------------------------------------------------------

[AnalogCapture_Interface.01]
AddReg = AnalogCapture_Interface.AddReg.01

[AnalogCapture_Interface.AddReg.01]
HKR,,CLSID,,%PROXY_CAPTURE%
HKR,,FriendlyName,,%DShow.AnalogCapture.01%

;---------------------------------------------------------------
; WDM streaming interfaces (audio)
;---------------------------------------------------------------

[Audio_Interface.02]
AddReg = Audio_Interface.AddReg.02

[Audio_Interface.AddReg.02]
HKR,,CLSID,,%PROXY_CAPTURE%
HKR,,FriendlyName,,%DShow.AudioCapture.02%

;---------------------------------------------------------------
; WDM streaming interfaces (analog TV/capture)
;---------------------------------------------------------------

[AnalogCapture_Interface.02]
AddReg = AnalogCapture_Interface.AddReg.02

[AnalogCapture_Interface.AddReg.02]
HKR,,CLSID,,%PROXY_CAPTURE%
HKR,,FriendlyName,,%DShow.AnalogCapture.02%


;===============================================================
;                S e r v i c e s
;===============================================================

[GameCapture.NTamd64.Services] 
;TODO: Rename service key (=1st param): use same service key as in the original driver
AddService = SC0710.X64, 0x00000002, GameCapture.ServiceInstall

[GameCapture.ServiceInstall]
DisplayName   = %Service.FriendlyName%
ServiceType   = %SERVICE_KERNEL_DRIVER%
StartType     = %SERVICE_DEMAND_START%
ErrorControl  = %SERVICE_ERROR_NORMAL%
ServiceBinary = %12%\SC0710.X64.SYS


;===============================================================
;                S t r i n g s
;===============================================================

[Strings]
;---------------------------------------------------------------
; Non-customizable (Windows)
;---------------------------------------------------------------
; Registry types
REG_SZ                           = 0x00000000
REG_MULTI_SZ                     = 0x00010000
REG_EXPAND_SZ                    = 0x00020000
REG_DWORD                        = 0x00010001

; Service: ServiceType values
SERVICE_KERNEL_DRIVER            = 0x00000001
SERVICE_FILE_SYSTEM_DRIVER       = 0x00000002
SERVICE_ADAPTER                  = 0x00000004
SERVICE_RECOGNIZER_DRIVER        = 0x00000008
SERVICE_WIN32_OWN_PROCESS        = 0x00000010
SERVICE_WIN32_SHARE_PROCESS      = 0x00000020
SERVICE_INTERACTIVE_PROCESS      = 0x00000100
SERVICE_INTERACTIVE_SHARE_PROCESS= 0x00000120

; Service: StartType values
SERVICE_BOOT_START               = 0x00000000
SERVICE_SYSTEM_START             = 0x00000001
SERVICE_AUTO_START               = 0x00000002
SERVICE_DEMAND_START             = 0x00000003
SERVICE_DISABLED                 = 0x00000004

; Service: ErrorControl values
SERVICE_ERROR_IGNORE             = 0x00000000
SERVICE_ERROR_NORMAL             = 0x00000001
SERVICE_ERROR_SEVERE             = 0x00000002
SERVICE_ERROR_CRITICAL           = 0x00000003

; DirectShow filter categories                                                DirectShow category name
CLSID_InputAudio                 = "{33D9A762-90C8-11D0-BD43-00A0C911CE86}"
KSCATEGORY_AUDIO                 = "{6994AD04-93EF-11D0-A3CC-00A0C9223196}"

KSCATEGORY_VIDEO                 = "{6994AD05-93EF-11D0-A3CC-00A0C9223196}"

KSCATEGORY_CAPTURE               = "{65E8773D-8F56-11D0-A3B9-00A0C9223196}" ; WDM Streaming capture Devices (audio & video)


; Proxy CLSIDs (KsProxy.ax)
PROXY_CAPTURE                    = "{17CCA71B-ECD7-11D0-B908-00A0C9223196}"
PROXY_TVTUNER                    = "{266EEE40-6C63-11cf-8A03-00AA006ECB65}"
PROXY_CROSSBAR                   = "{71F96460-78F3-11D0-A18C-00A0C9118956}"
PROXY_TVAUDIO                    = "{71F96462-78F3-11D0-A18C-00A0C9118956}"


;---------------------------------------------------------------
; Non-customizable (this driver)
;---------------------------------------------------------------
; Reference guids
REFGUID_AUDIO                    = "{6F814BE9-9AF6-43CF-9249-C0345A000326}"
REFGUID_AUDIO.01                 = "{6F814BE9-9AF6-43CF-9249-C03401000326}"
REFGUID_AUDIO.02                 = "{6F814BE9-9AF6-43CF-9249-C03402000326}"

REFGUID_CAPTURE                  = "{6F814BE9-9AF6-43CF-9249-C0345A000226}"
REFGUID_CAPTURE.01               = "{6F814BE9-9AF6-43CF-9249-C03401000226}"
REFGUID_CAPTURE.02               = "{6F814BE9-9AF6-43CF-9249-C03402000226}"


;---------------------------------------------------------------
; Customizable
;---------------------------------------------------------------

Provider                 = "Elgato "
DiskName                 = "Elgato Driver Disk"

; Service strings
Service.FriendlyName     = "Game Capture 4K60 Pro MK.2 Service"

; Device Manager
GameCapture.DeviceDesc   = "Game Capture 4K60 Pro MK.2"
GameCapture.DeviceDesc2  = "Game Capture 4K60 Pro MK.2 (Prototype)

; DirectShow filter names
DShow.AudioCapture       = "Game Capture 4K60 Pro MK.2 Audio (0)"
DShow.AudioCapture.01    = "Game Capture 4K60 Pro MK.2 Audio"
DShow.AudioCapture.02    = "Game Capture 4K60 Pro MK.2 Audio (2)"

DShow.AnalogCapture      = "Game Capture 4K60 Pro MK.2 Video (0)"
DShow.AnalogCapture.01   = "Game Capture 4K60 Pro MK.2 Video"
DShow.AnalogCapture.02   = "Game Capture 4K60 Pro MK.2 Video (2)"

CPNOTIFY.PROPERTY.INTERFACE.NAME = "Game Capture 4K60 Pro MK.2 (CopyProtNotify Property Interface)"
CUSTOM.PROPERTY.INTERFACE.NAME   = "Game Capture 4K60 Pro MK.2 (Custom Property Interface)"
CUSTOM.PROPERTY.PAGE.NAME        = "Game Capture 4K60 Pro MK.2 (Custom Property Page)"

