Allow renderers to apply size and display changes seamlessly

This commit is contained in:
Cameron Gutman
2022-04-24 15:42:08 -05:00
parent 6c339551eb
commit c989133d27
8 changed files with 106 additions and 15 deletions
@@ -16,13 +16,17 @@ public:
virtual bool isRenderThreadSupported() override;
virtual bool isPixelFormatSupported(int videoFormat, enum AVPixelFormat pixelFormat) override;
virtual bool testRenderFrame(AVFrame* frame) override;
virtual bool applyWindowChange(int width, int height, int flags) override;
private:
void renderOverlay(Overlay::OverlayType type);
bool initializeReadBackFormat(AVBufferRef* hwFrameCtxRef, AVFrame* testFrame);
AVFrame* getSwFrameFromHwFrame(AVFrame* hwFrame);
void updateViewport();
int m_VideoFormat;
int m_VideoWidth;
int m_VideoHeight;
SDL_Renderer* m_Renderer;
SDL_Texture* m_Texture;
enum AVPixelFormat m_SwPixelFormat;