mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-10 13:44:17 +00:00
Split SdlRenderer from renderer.h
This commit is contained in:
parent
4499ed3878
commit
d077c6450f
5 changed files with 29 additions and 23 deletions
|
@ -166,10 +166,10 @@ ffmpeg {
|
||||||
streaming/video/ffmpeg-renderers/pacer/pacer.cpp \
|
streaming/video/ffmpeg-renderers/pacer/pacer.cpp \
|
||||||
streaming/video/ffmpeg-renderers/pacer/nullthreadedvsyncsource.cpp
|
streaming/video/ffmpeg-renderers/pacer/nullthreadedvsyncsource.cpp
|
||||||
|
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
streaming/video/ffmpeg.h \
|
streaming/video/ffmpeg.h \
|
||||||
streaming/video/ffmpeg-renderers/renderer.h \
|
streaming/video/ffmpeg-renderers/renderer.h \
|
||||||
|
streaming/video/ffmpeg-renderers/sdlvid.h \
|
||||||
streaming/video/ffmpeg-renderers/pacer/pacer.h \
|
streaming/video/ffmpeg-renderers/pacer/pacer.h \
|
||||||
streaming/video/ffmpeg-renderers/pacer/nullthreadedvsyncsource.h
|
streaming/video/ffmpeg-renderers/pacer/nullthreadedvsyncsource.h
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,24 +33,3 @@ public:
|
||||||
// Nothing
|
// Nothing
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SdlRenderer : public IFFmpegRenderer {
|
|
||||||
public:
|
|
||||||
SdlRenderer();
|
|
||||||
virtual ~SdlRenderer();
|
|
||||||
virtual bool initialize(SDL_Window* window,
|
|
||||||
int videoFormat,
|
|
||||||
int width,
|
|
||||||
int height,
|
|
||||||
int maxFps,
|
|
||||||
bool enableVsync);
|
|
||||||
virtual bool prepareDecoderContext(AVCodecContext* context);
|
|
||||||
virtual void renderFrameAtVsync(AVFrame* frame);
|
|
||||||
virtual bool needsTestFrame();
|
|
||||||
virtual int getDecoderCapabilities();
|
|
||||||
virtual FramePacingConstraint getFramePacingConstraint();
|
|
||||||
|
|
||||||
private:
|
|
||||||
SDL_Renderer* m_Renderer;
|
|
||||||
SDL_Texture* m_Texture;
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "renderer.h"
|
#include "sdlvid.h"
|
||||||
|
|
||||||
#include <Limelight.h>
|
#include <Limelight.h>
|
||||||
|
|
||||||
|
|
25
app/streaming/video/ffmpeg-renderers/sdlvid.h
Normal file
25
app/streaming/video/ffmpeg-renderers/sdlvid.h
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "renderer.h"
|
||||||
|
|
||||||
|
class SdlRenderer : public IFFmpegRenderer {
|
||||||
|
public:
|
||||||
|
SdlRenderer();
|
||||||
|
virtual ~SdlRenderer();
|
||||||
|
virtual bool initialize(SDL_Window* window,
|
||||||
|
int videoFormat,
|
||||||
|
int width,
|
||||||
|
int height,
|
||||||
|
int maxFps,
|
||||||
|
bool enableVsync);
|
||||||
|
virtual bool prepareDecoderContext(AVCodecContext* context);
|
||||||
|
virtual void renderFrameAtVsync(AVFrame* frame);
|
||||||
|
virtual bool needsTestFrame();
|
||||||
|
virtual int getDecoderCapabilities();
|
||||||
|
virtual FramePacingConstraint getFramePacingConstraint();
|
||||||
|
|
||||||
|
private:
|
||||||
|
SDL_Renderer* m_Renderer;
|
||||||
|
SDL_Texture* m_Texture;
|
||||||
|
};
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
#include <h264_stream.h>
|
#include <h264_stream.h>
|
||||||
|
|
||||||
|
#include "ffmpeg-renderers/sdlvid.h"
|
||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
#include "ffmpeg-renderers/dxva2.h"
|
#include "ffmpeg-renderers/dxva2.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue