(CUDA , Desktop capture , Screen capture , windows ,VC ,GPU ...)
利用CUDA錄製windows桌面的方法是不存在的。至少目前我沒找到。
Added at 2013/10/11 :
Windows 8 only, IDXGIOutputDuplication 可以在GPU裏面獲取桌面surface,之後再用CUDA傳送到CPU。
參考例子下載:點擊打開鏈接
Windows8中:Windows 8 disables standard Windows 2000 Display Driver Model (XDDM) mirror drivers and offers the desktop duplication API instead
MS沒有開放在GPU中獲取桌面surface的接口,可能是爲了保證刷新率吧,獲取surface的函數是有加鎖的。
抓取windows桌面圖像主要有4種方法:
1,GDI
2,Direct 3D
3,Window Media Encoder API
4,mirror driver
後兩種沒用過,前兩種性能是差不多的,但是GDI允許多線程抓取,D3D可以多線程抓取,但是GetSurface會加鎖,因此多線程和單線程沒什麼區別。
so,如果想提升抓取的FPS的話,有兩種方法:
1,補幀
2,GDI 多線程
PS:值得注意的是WIN7 關掉桌面玻璃效果,FPS會大大提升。
PS2:寫了一個DEMO,VS2012的工程,代碼地址:OS_DesktopCapture