Warn when no hardware decoding is available

This commit is contained in:
Cameron Gutman
2018-07-26 00:41:46 -07:00
parent 42988e0dbf
commit f5499be215
4 changed files with 38 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
#include "streamingpreferences.h"
#include "streaming/session.hpp"
#include <QSettings>
@@ -57,6 +58,15 @@ void StreamingPreferences::save()
settings.setValue(SER_VIDEODEC, static_cast<int>(videoDecoderSelection));
}
bool StreamingPreferences::hasAnyHardwareAcceleration()
{
// Always use VDS_AUTO to avoid spamming the user with warnings
// if they've forced software decoding.
return Session::isHardwareDecodeAvailable(VDS_AUTO,
VIDEO_FORMAT_H264,
1920, 1080, 60);
}
int StreamingPreferences::getDefaultBitrate(int width, int height, int fps)
{
if (width * height * fps <= 1280 * 720 * 30) {