Commit 505ae0d7 authored by Philippe Gorley's avatar Philippe Gorley Committed by Sébastien Blin

accel: get/set directly in video prefs

Declutters Manager a tiny bit.

Change-Id: I322685b865f71e96f85bb00117486053cf483d08
Reviewed-by: Sébastien Blin's avatarSébastien Blin <sebastien.blin@savoirfairelinux.com>
parent 5421633d
......@@ -3069,25 +3069,6 @@ Manager::getSinkClient(const std::string& id)
return sink;
return nullptr;
}
bool
Manager::getDecodingAccelerated() const
{
#ifdef RING_ACCEL
return videoPreferences.getDecodingAccelerated();
#else
return false;
#endif
}
void
Manager::setDecodingAccelerated(bool isAccelerated)
{
#ifdef RING_ACCEL
videoPreferences.setDecodingAccelerated(isAccelerated);
saveConfig();
#endif
}
#endif // RING_VIDEO
RingBufferPool&
......
......@@ -878,10 +878,6 @@ class Manager {
std::shared_ptr<video::SinkClient> getSinkClient(const std::string& id);
VideoManager& getVideoManager() const;
bool getDecodingAccelerated() const;
void setDecodingAccelerated(bool isAccelerated);
#endif // RING_VIDEO
std::atomic<unsigned> dhtLogLevel {0}; // default = disable
......
......@@ -115,7 +115,7 @@ int MediaDecoder::openInput(const DeviceParams& params)
#ifdef RING_ACCEL
// if there was a fallback to software decoding, do not enable accel
// it has been disabled already by the video_receive_thread/video_input
enableAccel_ &= Manager::instance().getDecodingAccelerated();
enableAccel_ &= Manager::instance().videoPreferences.getDecodingAccelerated();
#endif
int ret = avformat_open_input(
......@@ -217,7 +217,7 @@ MediaDecoder::setupStream(AVMediaType mediaType)
if (enableAccel_) {
accel_ = video::setupHardwareDecoding(decoderCtx_);
decoderCtx_->opaque = &accel_;
} else if (Manager::instance().getDecodingAccelerated()) {
} else if (Manager::instance().videoPreferences.getDecodingAccelerated()) {
RING_WARN() << "Hardware accelerated decoding disabled because of previous failure";
} else {
RING_WARN() << "Hardware accelerated decoding disabled by user preference";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment