[host] added initial framework for DXGI capture

This commit is contained in:
Geoffrey McRae
2017-11-02 17:55:25 +11:00
parent fc192c0016
commit 44d7e9e77c
6 changed files with 144 additions and 2 deletions

View File

@@ -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;
}
};