;******************************************************************************
;
;   File:           XIStream.inf
;
;   Copyright (C) 2012 Magewell Electronics Co., Ltd. (Nanjing, China).
;
;******************************************************************************/

[Version]
signature = "$Windows NT$"
Class     = Media
ClassGUID = {4d36e96c-e325-11ce-bfc1-08002be10318}
Provider  = %MAGEWELL%
CatalogFile = XI102XE.cat
DriverVer = 05/21/2014,1.1.0.818

[SourceDisksNames]
1="Install disk",,,,disk1
2="Install disk",,,\x86,disk2

[SourceDisksNames.amd64]
1="Install disk",,,,disk1
2="Install disk",,,\x64,disk2

[SourceDisksFiles]
XI102XE.sys   = 2
XIStreamFirmware.dll = 1
XIStreamHDCapture.dll = 1
XIStreamCVBS.dll = 1
XIStreamConfig.dll=1
XIStreamFirmware_x64.dll = 1
XIStreamHDCapture_x64.dll = 1
XIStreamCVBS_x64.dll = 1
XIStreamConfig_x64.dll=1

[DestinationDirs]
XI102XE.Drivers		= 12
XI102XE.PropPages32	= 11
XI102XE.PropPages64	= 11
XI102XE.PropPagesWOW= 10,SysWOW64

[XI102XE.Drivers]
XI102XE.sys

[XI102XE.PropPages32]
XIStreamFirmware.dll
XIStreamHDCapture.dll
XIStreamCVBS.dll
XIStreamConfig.dll

[XI102XE.PropPages64]
XIStreamFirmware_x64.dll
XIStreamHDCapture_x64.dll
XIStreamCVBS_x64.dll
XIStreamConfig_x64.dll

[XI102XE.PropPagesWOW]
XIStreamFirmware.dll
XIStreamHDCapture.dll
XIStreamCVBS.dll
XIStreamConfig.dll

[XI102XE.KnownFiles]
XI102XE.sys=force
XIStreamFirmware.dll=force
XIStreamHDCapture.dll=force
XIStreamCVBS.dll=force
XIStreamConfig.dll=force
XIStreamFirmware_x64.dll=force
XIStreamHDCapture_x64.dll=force
XIStreamCVBS_x64.dll=force
XIStreamConfig_x64.dll=force

[Manufacturer]
%MAGEWELL% = MAGEWELL,ntx86,ntamd64

[MAGEWELL.ntx86]
%XI102XE.DeviceDesc% = XI102XE.Device, PCI\VEN_1172&DEV_E102&SUBSYS_00000000

[MAGEWELL.ntamd64]
%XI102XE.DeviceDesc% = XI102XE.Device, PCI\VEN_1172&DEV_E102&SUBSYS_00000000

;---------------------------------------------------------------
;                DDInstall
;---------------------------------------------------------------

[XI102XE.Device.ntx86]
Include    = ks.inf, kscaptur.inf, ksfilter.inf, wdmaudio.inf
Needs      = KS.Registration,KSCAPTUR.Registration.NT, WDMAUDIO.Registration
AddReg	   = XI102XE.AddReg
CopyFiles  = XI102XE.Drivers,XI102XE.PropPages32
KnownFiles = XI102XE.KnownFiles
RegisterDlls= XI102XE.RegSvr

[XI102XE.Device.ntamd64]
Include    = ks.inf, kscaptur.inf, ksfilter.inf, wdmaudio.inf
Needs      = KS.Registration,KSCAPTUR.Registration.NT, WDMAUDIO.Registration
AddReg	   = XI102XE.AddReg, XI102XE.AddReg64
CopyFiles  = XI102XE.Drivers,XI102XE.PropPages64,XI102XE.PropPagesWOW
KnownFiles = XI102XE.KnownFiles
RegisterDlls= XI102XE.RegSvr64

[XI102XE.RegSvr]
11,,XIStreamFirmware.dll,1
11,,XIStreamHDCapture.dll,1
11,,XIStreamCVBS.dll,1
11,,XIStreamConfig.dll,1

[XI102XE.RegSvr64]
11,,XIStreamFirmware_x64.dll,1
11,,XIStreamHDCapture_x64.dll,1
11,,XIStreamCVBS_x64.dll,1
11,,XIStreamConfig_x64.dll,1
10,SysWOW64,XIStreamFirmware.dll,1
10,SysWOW64,XIStreamHDCapture.dll,1
10,SysWOW64,XIStreamCVBS.dll,1
10,SysWOW64,XIStreamConfig.dll,1

;---------------------------------------------------------------
;                Interfaces
;---------------------------------------------------------------

[XI102XE.Device.ntx86.Interfaces]
AddInterface = %KSCATEGORY_CAPTURE%,"HDVideo",HDVideo,
AddInterface = %KSCATEGORY_VIDEO%,"HDVideo",HDVideo,
AddInterface = %KSCATEGORY_CAPTURE%,"Video1",Video1,
AddInterface = %KSCATEGORY_VIDEO%,"Video1",Video1,
AddInterface = %KSCATEGORY_CAPTURE%,"Video2",Video2,
AddInterface = %KSCATEGORY_VIDEO%,"Video2",Video2,
AddInterface = %KSCATEGORY_CAPTURE%,"HDMIAudio",HDMIAudio,
AddInterface = %KSCATEGORY_AUDIO%,"HDMIAudio",HDMIAudio,
AddInterface = %KSCATEGORY_CAPTURE%,"AnalogAudio",AnalogAudio,
AddInterface = %KSCATEGORY_AUDIO%,"AnalogAudio",AnalogAudio,

[XI102XE.Device.ntamd64.Interfaces]
AddInterface = %KSCATEGORY_CAPTURE%,"HDVideo",HDVideo,
AddInterface = %KSCATEGORY_VIDEO%,"HDVideo",HDVideo,
AddInterface = %KSCATEGORY_CAPTURE%,"Video1",Video1,
AddInterface = %KSCATEGORY_VIDEO%,"Video1",Video1,
AddInterface = %KSCATEGORY_CAPTURE%,"Video2",Video2,
AddInterface = %KSCATEGORY_VIDEO%,"Video2",Video2,
AddInterface = %KSCATEGORY_CAPTURE%,"HDMIAudio",HDMIAudio,
AddInterface = %KSCATEGORY_AUDIO%,"HDMIAudio",HDMIAudio,
AddInterface = %KSCATEGORY_CAPTURE%,"AnalogAudio",AnalogAudio,
AddInterface = %KSCATEGORY_AUDIO%,"AnalogAudio",AnalogAudio,

[HDVideo]
AddReg = HDVideo.AddReg

[Video1]
AddReg = Video1.AddReg

[Video2]
AddReg = Video2.AddReg

[HDMIAudio]
AddReg = HDMIAudio.AddReg

[AnalogAudio]
AddReg = AnalogAudio.AddReg

[XI102XE.AddReg]
HKR,,AssociatedFilters,,"wdmaud,swmidi,redbook"
HKR,,Driver,,XI102XE.sys
HKR,Drivers,SubClasses,,"wave,mixer"
HKR,Drivers\wave\wdmaud.drv,Driver,,wdmaud.drv
HKR,Drivers\mixer\wdmaud.drv,Driver,,wdmaud.drv
HKR,Drivers\wave\wdmaud.drv,Description,,%XI102XE.AudioCapture%
HKR,Drivers\mixer\wdmaud.drv,Description,,%XI102XE.AudioCapture%

HKLM, %MediaCategories%\{929AC461-E76D-44fa-90B5-ED4EE33157B0},Name,,"Line In"
HKLM, %MediaCategories%\{929AC461-E76D-44fa-90B5-ED4EE33157B1},Name,,"HDMI In"

; 0 - HDMI/DVI, 1 - RGB (VGA), 2 - YPbPr (Component), 3 - CVBS/S-Video
HKLM, System\CurrentControlSet\Services\XI102XE,HDCaptureMode,0x00010001,1
; 0 - No Deinterlace, 1 - Blend Detinerlace, 2 - Motion Adaptive Deinterlace
HKLM, System\CurrentControlSet\Services\XI102XE,HDDeinterlace,0x00010001,1
; 0 - Do not keep aspect ratio, 1 - Add black border to keep aspect ratio, 2 - Clip border to keep aspect ratio
HKLM, System\CurrentControlSet\Services\XI102XE,HDScale,0x00010001,1
; 0 - Color bar, 1 - Blue screen, 2 - Black screen
HKLM, System\CurrentControlSet\Services\XI102XE,HDStatusImageMode,0x00010001,0
; 0 - Single stream, 1 - SimuStream with same video format, 2 - SimuStream with arbitrary video format
HKLM, System\CurrentControlSet\Services\XI102XE,HDSimuStreamType,0x00010001,1

HKLM, System\CurrentControlSet\Services\XI102XE,StatusImageMode,0x00010001,0

; NTSC: 	0x01 
; PAL: 		0x10 
; SECAM:	0x1000
HKLM, System\CurrentControlSet\Services\XI102XE,VideoStandard,0x00010001,0x00000010
HKLM, System\CurrentControlSet\Services\XI102XE,Sharpness,0x00010001,50
HKLM, System\CurrentControlSet\Services\XI102XE,Deinterlace,0x00010001,1
HKLM, System\CurrentControlSet\Services\XI102XE,AutoLumaGain,0x00010001,0
HKLM, System\CurrentControlSet\Services\XI102XE,LumaGain,0x00010001,1600
HKLM, System\CurrentControlSet\Services\XI102XE,AutoChromaGain,0x00010001,0
HKLM, System\CurrentControlSet\Services\XI102XE,ChromaGain,0x00010001,910
HKLM, System\CurrentControlSet\Services\XI102XE,DenoiseStrength,0x00010001,4
HKLM, System\CurrentControlSet\Services\XI102XE,EnableSquareMode,0x00010001,1
; 0 - Do not keep aspect ratio, 1 - Add black border to keep aspect ratio, 2 - Clip border to keep aspect ratio
HKLM, System\CurrentControlSet\Services\XI102XE,ScaleMode,0x00010001,0

; Full video size for square pixel mode is 768x576 (4:3 Mode), otherwise 720x576
HKLM, System\CurrentControlSet\Services\XI102XE,ClipLeftPAL,0x00010001,0
HKLM, System\CurrentControlSet\Services\XI102XE,ClipRightPAL,0x00010001,0
HKLM, System\CurrentControlSet\Services\XI102XE,ClipTopPAL,0x00010001,0
HKLM, System\CurrentControlSet\Services\XI102XE,ClipBottomPAL,0x00010001,0

; Full video size for square pixel mode is 640x480 (4:3 Mode), otherwise 720x480
HKLM, System\CurrentControlSet\Services\XI102XE,ClipLeftNTSC,0x00010001,0
HKLM, System\CurrentControlSet\Services\XI102XE,ClipRightNTSC,0x00010001,0
HKLM, System\CurrentControlSet\Services\XI102XE,ClipTopNTSC,0x00010001,0
HKLM, System\CurrentControlSet\Services\XI102XE,ClipBottomNTSC,0x00010001,0

HKLM, System\CurrentControlSet\Services\XI102XE,ActivePixelThreshold,0x00010001,64
HKLM, System\CurrentControlSet\Services\XI102XE,SOGTriLevel,0x00010001,0

; Disable extra formats with different size: 1
HKLM, System\CurrentControlSet\Services\XI102XE,DisableExtraFormats,0x00010001,0
; Disable color space outputs: RGB24/0x04, RGB32/0x08, YUY2/0x60, UYVY/0x100, I420/0x1400, NV12/0x4000
HKLM, System\CurrentControlSet\Services\XI102XE,DisableColorSpaceMasks,0x00010001,0
HKLM, System\CurrentControlSet\Services\XI102XE,EnablePreviewPin,0x00010001,0

; 0 - Auto 601/709, 1 - Force 709, 2 - Force 601
HKLM, System\CurrentControlSet\Services\XI102XE,YUVMode,0x00010001,0

[XI102XE.AddReg64]
HKLM, %RunOnce%, "XIStreamFirmware.dll",,"%11%\regsvr32.exe /s %10%\SysWOW64\XIStreamFirmware.dll"
HKLM, %RunOnce%, "XIStreamHDCapture.dll",,"%11%\regsvr32.exe /s %10%\SysWOW64\XIStreamHDCapture.dll"
HKLM, %RunOnce%, "XIStreamCVBS.dll",,"%11%\regsvr32.exe /s %10%\SysWOW64\XIStreamCVBS.dll"
HKLM, %RunOnce%, "XIStreamConfig.dll",,"%11%\regsvr32.exe /s %10%\SysWOW64\XIStreamConfig.dll"

[HDVideo.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%XI102XE.HDVideo%
HKR,PageAliases,%VideoStreamConfigPropertyPage.CLSID%,1,0xDD, 0x6E, 0x32, 0x8B, 0x4F, 0xA8, 0xB8, 0x41, 0x8E, 0x1E, 0x5B, 0x4A, 0xD1, 0xBC, 0xE5, 0xAB

[Video1.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%XI102XE.Video1%
HKR,PageAliases,%VideoStreamConfigPropertyPage.CLSID%,1,0xDD, 0x6E, 0x32, 0x8B, 0x4F, 0xA8, 0xB8, 0x41, 0x8E, 0x1E, 0x5B, 0x4A, 0xD1, 0xBC, 0xE5, 0xAB

[Video2.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%XI102XE.Video2%
HKR,PageAliases,%VideoStreamConfigPropertyPage.CLSID%,1,0xDD, 0x6E, 0x32, 0x8B, 0x4F, 0xA8, 0xB8, 0x41, 0x8E, 0x1E, 0x5B, 0x4A, 0xD1, 0xBC, 0xE5, 0xAB

[HDMIAudio.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%XI102XE.HDMIAudio%

[AnalogAudio.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%XI102XE.AnalogAudio%

;---------------------------------------------------------------
;                Services
;---------------------------------------------------------------

[XI102XE.Device.ntx86.Services]
AddService = XI102XE,0x00000002,XI102XE.ServiceInstall

[XI102XE.Device.ntamd64.Services]
AddService = XI102XE,0x00000002,XI102XE.ServiceInstall

[XI102XE.ServiceInstall]
DisplayName   = %XI102XE.ServiceDesc%
ServiceType   = %SERVICE_KERNEL_DRIVER%
StartType     = %SERVICE_DEMAND_START%
ErrorControl  = %SERVICE_ERROR_NORMAL%
ServiceBinary = %12%\XI102XE.sys

;---------------------------------------------------------------
;                Services
;---------------------------------------------------------------

[Strings]
SERVICE_KERNEL_DRIVER 	= 1
SERVICE_DEMAND_START   	= 3
SERVICE_ERROR_NORMAL  	= 1
MAGEWELL           			= "Magewell Electronics Co., Ltd. (Nanjing, China)"
XI102XE.ServiceDesc		= "XI102XE Card Driver"
XI102XE.DeviceDesc 		= "XI102XE Card"
KSCATEGORY_CAPTURE		= "{65E8773D-8F56-11D0-A3B9-00A0C9223196}"
KSCATEGORY_VIDEO		= "{6994AD05-93EF-11D0-A3CC-00A0C9223196}"
KSCATEGORY_AUDIO		= "{6994AD04-93EF-11D0-A3CC-00A0C9223196}"
Proxy.CLSID				= "{17CCA71B-ECD7-11D0-B908-00A0C9223196}"
XI102XE.AudioCapture	= "XI102XE Audio Capture"
XI102XE.HDVideo      		= "HD Video (XI102XE Card)"
XI102XE.Video1      		= "Video 1 (XI102XE Card)"
XI102XE.Video2      		= "Video 2 (XI102XE Card)"
XI102XE.HDMIAudio		= "HDMI In (XI102XE Card)"
XI102XE.AnalogAudio		= "Line In (XI102XE Card)"
MediaCategories			= "SYSTEM\CurrentControlSet\Control\MediaCategories"
VideoStreamConfigPropertyPage.CLSID="{71F96467-78F3-11d0-A18C-00A0C9118956}"
RunOnce                 = "Software\Microsoft\Windows\CurrentVersion\RunOnce"

[Templates]
TemplateCount = 6
TemplateString1 = Strings, XI102XE.DeviceDesc, XI102XE Card %d
TemplateString2 = Strings, XI102XE.HDVideo, HD Video (XI102XE Card %d)
TemplateString3 = Strings, XI102XE.Video1, Video 1 (XI102XE Card %d)
TemplateString4 = Strings, XI102XE.Video2, Video 2 (XI102XE Card %d)
TemplateString5 = Strings, XI102XE.HDMIAudio, HDMI In (XI102XE Card %d)
TemplateString6 = Strings, XI102XE.AnalogAudio, Line In (XI102XE Card %d)
