moonlight-qt/app/streaming/video/ffmpeg-renderers/renderer.h
2018-07-17 20:00:16 -07:00

34 lines
901 B
C++

#pragma once
#include <SDL.h>
extern "C" {
#include <libavcodec/avcodec.h>
}
class IFFmpegRenderer {
public:
virtual ~IFFmpegRenderer() {}
virtual bool initialize(SDL_Window* window,
int videoFormat,
int width,
int height) = 0;
virtual bool prepareDecoderContext(AVCodecContext* context) = 0;
virtual void renderFrame(AVFrame* frame) = 0;
};
class SdlRenderer : public IFFmpegRenderer {
public:
SdlRenderer();
virtual ~SdlRenderer();
virtual bool initialize(SDL_Window* window,
int videoFormat,
int width,
int height);
virtual bool prepareDecoderContext(AVCodecContext* context);
virtual void renderFrame(AVFrame* frame);
private:
SDL_Renderer* m_Renderer;
SDL_Texture* m_Texture;
};