moonlight-qt/app/streaming/video/ffmpeg-renderers/sdlvid.h

36 lines
1 KiB
C
Raw Normal View History

2019-02-13 03:58:36 +00:00
#pragma once
#include "renderer.h"
#ifdef HAVE_CUDA
#include "cuda.h"
#endif
2019-02-13 03:58:36 +00:00
class SdlRenderer : public IFFmpegRenderer {
public:
SdlRenderer();
2019-02-13 05:55:15 +00:00
virtual ~SdlRenderer() override;
virtual bool initialize(PDECODER_PARAMETERS params) override;
virtual bool prepareDecoderContext(AVCodecContext* context, AVDictionary** options) override;
virtual void renderFrame(AVFrame* frame) override;
virtual bool isRenderThreadSupported() override;
virtual bool isPixelFormatSupported(int videoFormat, enum AVPixelFormat pixelFormat) override;
2021-03-23 04:32:00 +00:00
virtual bool testRenderFrame(AVFrame* frame) override;
2019-02-13 03:58:36 +00:00
private:
void renderOverlay(Overlay::OverlayType type);
enum AVPixelFormat getReadBackFormat(AVBufferRef* hwFrameCtxRef);
int m_VideoFormat;
2019-02-13 03:58:36 +00:00
SDL_Renderer* m_Renderer;
SDL_Texture* m_Texture;
enum AVPixelFormat m_SwPixelFormat;
SDL_Texture* m_OverlayTextures[Overlay::OverlayMax];
SDL_Rect m_OverlayRects[Overlay::OverlayMax];
#ifdef HAVE_CUDA
CUDAGLInteropHelper* m_CudaGLHelper;
#endif
2019-02-13 03:58:36 +00:00
};