mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[host] dxgi: move the backend interface into a separate header
This commit is contained in:
parent
748c9c177e
commit
eb2796d40b
60
host/platform/Windows/capture/DXGI/src/backend.h
Normal file
60
host/platform/Windows/capture/DXGI/src/backend.h
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
/**
|
||||||
|
* Looking Glass
|
||||||
|
* Copyright © 2017-2023 The Looking Glass Authors
|
||||||
|
* https://looking-glass.io
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation; either version 2 of the License, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc., 59
|
||||||
|
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _H_DXGI_BACKEND_
|
||||||
|
#define _H_DXGI_BACKEND_
|
||||||
|
|
||||||
|
#include "dxgi_capture.h"
|
||||||
|
|
||||||
|
struct DXGIInterface;
|
||||||
|
struct Texture;
|
||||||
|
|
||||||
|
struct DXGICopyBackend
|
||||||
|
{
|
||||||
|
// friendly name
|
||||||
|
const char * name;
|
||||||
|
|
||||||
|
// internal code name
|
||||||
|
const char * code;
|
||||||
|
|
||||||
|
// create the copy backend
|
||||||
|
bool (*create)(struct DXGIInterface * intf);
|
||||||
|
|
||||||
|
// configure the copy backend with the specified format
|
||||||
|
bool (*configure)(unsigned width, unsigned height,
|
||||||
|
DXGI_FORMAT format, unsigned * pitch);
|
||||||
|
|
||||||
|
// free the copy backend
|
||||||
|
void (*free)(void);
|
||||||
|
|
||||||
|
// called each captured frame after post processing to copy the frame
|
||||||
|
bool (*copyFrame)(struct Texture * tex, ID3D11Texture2D * src);
|
||||||
|
|
||||||
|
// maps the copied frame into memory
|
||||||
|
CaptureResult (*mapTexture)(struct Texture * tex);
|
||||||
|
|
||||||
|
// unmaps the copied frame from memory
|
||||||
|
void (*unmapTexture)(struct Texture * tex);
|
||||||
|
|
||||||
|
// called just before the frame is released by the frontend
|
||||||
|
void (*preRelease)(void);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -18,7 +18,7 @@
|
|||||||
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dxgi_capture.h"
|
#include "backend.h"
|
||||||
#include "com_ref.h"
|
#include "com_ref.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dxgi_capture.h"
|
#include "backend.h"
|
||||||
#include "com_ref.h"
|
#include "com_ref.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef _H_DXGI_CAPTURE_
|
||||||
|
#define _H_DXGI_CAPTURE_
|
||||||
|
|
||||||
#include "pp.h"
|
#include "pp.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -33,6 +36,8 @@
|
|||||||
#include "common/vector.h"
|
#include "common/vector.h"
|
||||||
#include "interface/capture.h"
|
#include "interface/capture.h"
|
||||||
|
|
||||||
|
#include "backend.h"
|
||||||
|
|
||||||
enum TextureState
|
enum TextureState
|
||||||
{
|
{
|
||||||
TEXTURE_STATE_UNUSED,
|
TEXTURE_STATE_UNUSED,
|
||||||
@ -64,8 +69,6 @@ struct FrameDamage
|
|||||||
FrameDamageRect rects[KVMFR_MAX_DAMAGE_RECTS];
|
FrameDamageRect rects[KVMFR_MAX_DAMAGE_RECTS];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DXGICopyBackend;
|
|
||||||
|
|
||||||
struct DXGIInterface
|
struct DXGIInterface
|
||||||
{
|
{
|
||||||
bool initialized;
|
bool initialized;
|
||||||
@ -119,16 +122,4 @@ struct DXGIInterface
|
|||||||
struct FrameDamage frameDamage[LGMP_Q_FRAME_LEN];
|
struct FrameDamage frameDamage[LGMP_Q_FRAME_LEN];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DXGICopyBackend
|
#endif
|
||||||
{
|
|
||||||
const char * name;
|
|
||||||
const char * code;
|
|
||||||
bool (*create)(struct DXGIInterface * intf);
|
|
||||||
bool (*configure)(unsigned width, unsigned height,
|
|
||||||
DXGI_FORMAT format, unsigned * pitch);
|
|
||||||
void (*free)(void);
|
|
||||||
bool (*copyFrame)(Texture * tex, ID3D11Texture2D * src);
|
|
||||||
CaptureResult (*mapTexture)(Texture * tex);
|
|
||||||
void (*unmapTexture)(Texture * tex);
|
|
||||||
void (*preRelease)(void);
|
|
||||||
};
|
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef _H_DXGI_PP_
|
||||||
|
#define _H_DXGI_PP_
|
||||||
|
|
||||||
#include <d3d11.h>
|
#include <d3d11.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
@ -58,3 +61,5 @@ typedef struct
|
|||||||
void (*finish)(void);
|
void (*finish)(void);
|
||||||
}
|
}
|
||||||
DXGIPostProcess;
|
DXGIPostProcess;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user