Cap resolution options at 1080p on Steam Link and Raspberry Pi due to hardware limitations

This commit is contained in:
Cameron Gutman
2020-02-23 00:43:43 -08:00
parent 46bcbda972
commit 979de190dc
12 changed files with 42 additions and 5 deletions
+2 -1
View File
@@ -253,7 +253,7 @@ int Session::drSubmitDecodeUnit(PDECODE_UNIT du)
}
void Session::getDecoderInfo(SDL_Window* window,
bool& isHardwareAccelerated, bool& isFullScreenOnly)
bool& isHardwareAccelerated, bool& isFullScreenOnly, QSize& maxResolution)
{
IVideoDecoder* decoder;
@@ -266,6 +266,7 @@ void Session::getDecoderInfo(SDL_Window* window,
isHardwareAccelerated = decoder->isHardwareAccelerated();
isFullScreenOnly = decoder->isAlwaysFullScreen();
maxResolution = decoder->getDecoderMaxResolution();
delete decoder;
}
+1 -1
View File
@@ -26,7 +26,7 @@ public:
static
void getDecoderInfo(SDL_Window* window,
bool& isHardwareAccelerated, bool& isFullScreenOnly);
bool& isHardwareAccelerated, bool& isFullScreenOnly, QSize& maxResolution);
static Session* get()
{
+1
View File
@@ -46,6 +46,7 @@ public:
virtual bool isAlwaysFullScreen() = 0;
virtual int getDecoderCapabilities() = 0;
virtual int getDecoderColorspace() = 0;
virtual QSize getDecoderMaxResolution() = 0;
virtual int submitDecodeUnit(PDECODE_UNIT du) = 0;
virtual void renderFrameOnMainThread() = 0;
};
@@ -134,8 +134,8 @@ enum AVPixelFormat MmalRenderer::getPreferredPixelFormat(int videoFormat)
int MmalRenderer::getRendererAttributes()
{
// This renderer can only draw in full-screen
return RENDERER_ATTRIBUTE_FULLSCREEN_ONLY;
// This renderer can only draw in full-screen and maxes out at 1080p
return RENDERER_ATTRIBUTE_FULLSCREEN_ONLY | RENDERER_ATTRIBUTE_1080P_MAX;
}
bool MmalRenderer::needsTestFrame()
@@ -10,6 +10,7 @@ extern "C" {
}
#define RENDERER_ATTRIBUTE_FULLSCREEN_ONLY 0x01
#define RENDERER_ATTRIBUTE_1080P_MAX 0x02
class IFFmpegRenderer : public Overlay::IOverlayRenderer {
public:
+11
View File
@@ -71,6 +71,17 @@ int FFmpegVideoDecoder::getDecoderColorspace()
return m_FrontendRenderer->getDecoderColorspace();
}
QSize FFmpegVideoDecoder::getDecoderMaxResolution()
{
if (m_BackendRenderer->getRendererAttributes() & RENDERER_ATTRIBUTE_1080P_MAX) {
return QSize(1920, 1080);
}
else {
// No known maximum
return QSize(0, 0);
}
}
enum AVPixelFormat FFmpegVideoDecoder::ffGetFormat(AVCodecContext* context,
const enum AVPixelFormat* pixFmts)
{
+1
View File
@@ -19,6 +19,7 @@ public:
virtual bool isAlwaysFullScreen() override;
virtual int getDecoderCapabilities() override;
virtual int getDecoderColorspace() override;
virtual QSize getDecoderMaxResolution() override;
virtual int submitDecodeUnit(PDECODE_UNIT du) override;
virtual void renderFrameOnMainThread() override;
+5
View File
@@ -42,6 +42,11 @@ SLVideoDecoder::getDecoderColorspace()
return COLORSPACE_REC_709;
}
QSize SLVideoDecoder::getDecoderMaxResolution()
{
return QSize(1920, 1080);
}
bool
SLVideoDecoder::initialize(PDECODER_PARAMETERS params)
{
+1
View File
@@ -14,6 +14,7 @@ public:
virtual bool isAlwaysFullScreen();
virtual int getDecoderCapabilities();
virtual int getDecoderColorspace();
virtual QSize getDecoderMaxResolution();
virtual int submitDecodeUnit(PDECODE_UNIT du);
// Unused since rendering is done directly from the decode thread