mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[host] added initial framework for DXGI capture
This commit is contained in:
@@ -21,14 +21,37 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#define W32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
|
||||
#include "common\debug.h"
|
||||
#include "ICapture.h"
|
||||
#include "Capture\NvFBC.h"
|
||||
#include "Capture\DXGI.h"
|
||||
|
||||
class CaptureFactory
|
||||
{
|
||||
public:
|
||||
static ICapture * GetCaptureDevice()
|
||||
{
|
||||
return new Capture::NvFBC();
|
||||
ICapture *dev;
|
||||
|
||||
dev = new Capture::NvFBC();
|
||||
if (dev->Initialize())
|
||||
{
|
||||
DEBUG_INFO("Using NvFBC");
|
||||
return dev;
|
||||
}
|
||||
dev->DeInitialize();
|
||||
delete dev;
|
||||
|
||||
dev = new Capture::DXGI();
|
||||
if (dev->Initialize())
|
||||
{
|
||||
DEBUG_INFO("Using DXGI");
|
||||
return dev;
|
||||
}
|
||||
dev->DeInitialize();
|
||||
delete dev;
|
||||
|
||||
DEBUG_ERROR("Failed to initialize a compatible capture device");
|
||||
return NULL;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user