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

31 lines
976 B
C
Raw Normal View History

2019-02-13 03:58:36 +00:00
#pragma once
#include "renderer.h"
2019-02-13 05:55:15 +00:00
#include <SDL_ttf.h>
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;
2019-02-13 05:55:15 +00:00
virtual bool prepareDecoderContext(AVCodecContext* context) override;
virtual void renderFrame(AVFrame* frame) override;
2019-02-13 05:55:15 +00:00
virtual void notifyOverlayUpdated(Overlay::OverlayType) override;
virtual bool isRenderThreadSupported() override;
virtual bool isPixelFormatSupported(int videoFormat, enum AVPixelFormat pixelFormat) override;
2019-02-13 03:58:36 +00:00
private:
void renderOverlay(Overlay::OverlayType type);
2019-02-13 03:58:36 +00:00
SDL_Renderer* m_Renderer;
SDL_Texture* m_Texture;
int m_SwPixelFormat;
QByteArray m_FontData;
TTF_Font* m_OverlayFonts[Overlay::OverlayMax];
SDL_Surface* m_OverlaySurfaces[Overlay::OverlayMax];
SDL_Texture* m_OverlayTextures[Overlay::OverlayMax];
SDL_Rect m_OverlayRects[Overlay::OverlayMax];
2019-02-13 03:58:36 +00:00
};