Add PoC VsyncSource for Windows using DwmFlush(). Soon to be replaced with D3DKMTWaitForVerticalBlankEvent().

This commit is contained in:
Cameron Gutman
2018-08-15 23:20:56 -07:00
parent e68a15c825
commit f6a451d6e7
8 changed files with 108 additions and 15 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
#pragma once
#include "renderer.h"
#include "pacer/pacer.h"
#include <d3d9.h>
#include <dxva2api.h>
@@ -9,7 +10,7 @@ extern "C" {
#include <libavcodec/dxva2.h>
}
class DXVA2Renderer : public IFFmpegRenderer
class DXVA2Renderer : public IFFmpegRenderer, public IVsyncRenderer
{
public:
DXVA2Renderer();
@@ -21,6 +22,7 @@ public:
int maxFps);
virtual bool prepareDecoderContext(AVCodecContext* context);
virtual void renderFrame(AVFrame* frame);
virtual void renderFrameAtVsync(AVFrame* frame);
private:
bool initializeDecoder();
@@ -44,6 +46,7 @@ private:
int m_DisplayHeight;
SDL_Renderer* m_SdlRenderer;
Pacer m_Pacer;
struct dxva_context m_DXVAContext;
IDirect3DSurface9* m_DecSurfaces[19];