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

49 lines
1.1 KiB
C
Raw Normal View History

2018-07-13 09:28:10 +00:00
#pragma once
#include <SDL.h>
#include "streaming/video/decoder.h"
#include "streaming/video/overlaymanager.h"
2018-07-13 09:28:10 +00:00
extern "C" {
#include <libavcodec/avcodec.h>
}
class IFFmpegRenderer : public Overlay::IOverlayRenderer {
2018-07-13 09:28:10 +00:00
public:
2018-12-25 20:57:00 +00:00
enum FramePacingConstraint {
PACING_FORCE_OFF,
PACING_FORCE_ON,
PACING_ANY
};
virtual bool initialize(PDECODER_PARAMETERS params) = 0;
2018-07-13 09:28:10 +00:00
virtual bool prepareDecoderContext(AVCodecContext* context) = 0;
virtual void renderFrame(AVFrame* frame) = 0;
2019-04-13 05:12:53 +00:00
virtual bool needsTestFrame() {
// No test frame required by default
return false;
}
virtual int getDecoderCapabilities() {
// No special capabilities by default
return 0;
}
virtual FramePacingConstraint getFramePacingConstraint() {
// No pacing preference
return PACING_ANY;
}
virtual bool isRenderThreadSupported() {
// Render thread is supported by default
return true;
}
// IOverlayRenderer
virtual void notifyOverlayUpdated(Overlay::OverlayType) override {
// Nothing
}
2018-07-13 09:28:10 +00:00
};