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;
|
2019-02-13 03:58:36 +00:00
|
|
|
virtual bool initialize(SDL_Window* window,
|
|
|
|
int videoFormat,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
int maxFps,
|
2019-02-13 05:55:15 +00:00
|
|
|
bool enableVsync) override;
|
|
|
|
virtual bool prepareDecoderContext(AVCodecContext* context) override;
|
2019-02-16 03:31:01 +00:00
|
|
|
virtual void renderFrame(AVFrame* frame) override;
|
2019-02-13 05:55:15 +00:00
|
|
|
virtual bool needsTestFrame() override;
|
|
|
|
virtual int getDecoderCapabilities() override;
|
|
|
|
virtual FramePacingConstraint getFramePacingConstraint() override;
|
|
|
|
virtual void notifyOverlayUpdated(Overlay::OverlayType) override;
|
2019-04-10 04:46:14 +00:00
|
|
|
virtual bool isRenderThreadSupported() override;
|
2019-02-13 03:58:36 +00:00
|
|
|
|
|
|
|
private:
|
2019-03-17 22:08:21 +00:00
|
|
|
void renderOverlay(Overlay::OverlayType type);
|
|
|
|
|
2019-02-13 03:58:36 +00:00
|
|
|
SDL_Renderer* m_Renderer;
|
|
|
|
SDL_Texture* m_Texture;
|
2019-04-10 04:26:47 +00:00
|
|
|
QByteArray m_FontData;
|
2019-03-17 22:08:21 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
|