mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Merge pull request #1315 from lrusak/kodi-17-libreelec-8.0
backport of #1176 (remove and rework kodi patches)
This commit is contained in:
commit
599d041a28
@ -1,26 +0,0 @@
|
||||
From 993c50a689feee190557a98a34f76683cf46c589 Mon Sep 17 00:00:00 2001
|
||||
From: Stephan Raue <stephan@openelec.tv>
|
||||
Date: Mon, 1 Sep 2014 03:16:37 +0200
|
||||
Subject: [PATCH 11/13] add support to read frequency output if using intel's
|
||||
pstate driver
|
||||
|
||||
---
|
||||
xbmc/utils/CPUInfo.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/xbmc/utils/CPUInfo.cpp b/xbmc/utils/CPUInfo.cpp
|
||||
index 9e709e7..9b5279f 100644
|
||||
--- a/xbmc/utils/CPUInfo.cpp
|
||||
+++ b/xbmc/utils/CPUInfo.cpp
|
||||
@@ -271,6 +271,8 @@ CCPUInfo::CCPUInfo(void)
|
||||
m_fProcTemperature = fopen("/sys/class/thermal/thermal_zone0/temp", "r"); // On Raspberry PIs
|
||||
|
||||
m_fCPUFreq = fopen ("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r");
|
||||
+ if (m_fCPUFreq == NULL)
|
||||
+ m_fCPUFreq = fopen ("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq", "r");
|
||||
if (!m_fCPUFreq)
|
||||
{
|
||||
m_cpuInfoForFreq = true;
|
||||
--
|
||||
2.5.0
|
||||
|
@ -1,75 +0,0 @@
|
||||
From aabc63419df8aa69f156afdafb28820c3c9ccdc7 Mon Sep 17 00:00:00 2001
|
||||
From: fritsch <Peter.Fruehberger@gmail.com>
|
||||
Date: Sat, 1 Nov 2014 12:44:54 +0100
|
||||
Subject: [PATCH] AdvancedSettings: Add minimalSampleRate to ActiveAE cause of
|
||||
broken AVRs out there
|
||||
|
||||
---
|
||||
xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 8 ++++++++
|
||||
xbmc/settings/AdvancedSettings.cpp | 3 +++
|
||||
xbmc/settings/AdvancedSettings.h | 2 ++
|
||||
3 files changed, 13 insertions(+)
|
||||
|
||||
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
|
||||
index bf7e439..1687bad 100644
|
||||
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
|
||||
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
|
||||
@@ -28,6 +28,7 @@ using namespace ActiveAE;
|
||||
#include "cores/AudioEngine/Encoders/AEEncoderFFmpeg.h"
|
||||
|
||||
#include "settings/Settings.h"
|
||||
+#include "settings/AdvancedSettings.h"
|
||||
#include "windowing/WindowingFactory.h"
|
||||
|
||||
#define MAX_CACHE_LEVEL 0.5 // total cache time of stream in seconds
|
||||
@@ -1504,6 +1505,13 @@ void CActiveAE::ApplySettingsToFormat(AEAudioFormat &format, AudioSettings &sett
|
||||
format.m_channelLayout = AE_CH_LAYOUT_2_0;
|
||||
}
|
||||
|
||||
+ // OpenELEC workaround to define a minimum sample Rate for broken AVRs
|
||||
+ if (format.m_sampleRate < g_advancedSettings.m_minimumSampleRate)
|
||||
+ {
|
||||
+ format.m_sampleRate = g_advancedSettings.m_minimumSampleRate;
|
||||
+ CLog::Log(LOGDEBUG, "CActiveAE::MinimumSampleRate - Forced by use to samplerate %d", format.m_sampleRate);
|
||||
+ }
|
||||
+
|
||||
if (m_settings.config == AE_CONFIG_FIXED)
|
||||
{
|
||||
format.m_sampleRate = m_settings.samplerate;
|
||||
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp
|
||||
index c4fa298..35728e4 100644
|
||||
--- a/xbmc/settings/AdvancedSettings.cpp
|
||||
+++ b/xbmc/settings/AdvancedSettings.cpp
|
||||
@@ -108,6 +108,8 @@ void CAdvancedSettings::Initialize()
|
||||
return;
|
||||
|
||||
m_audioHeadRoom = 0;
|
||||
+ // OpenELEC workaround for broken AVRs
|
||||
+ m_minimumSampleRate = 8000;
|
||||
m_ac3Gain = 12.0f;
|
||||
m_audioApplyDrc = -1.0f;
|
||||
m_dvdplayerIgnoreDTSinWAV = false;
|
||||
@@ -464,6 +466,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file)
|
||||
{
|
||||
XMLUtils::GetFloat(pElement, "ac3downmixgain", m_ac3Gain, -96.0f, 96.0f);
|
||||
XMLUtils::GetInt(pElement, "headroom", m_audioHeadRoom, 0, 12);
|
||||
+ XMLUtils::GetInt(pElement, "minimumsamplerate", m_minimumSampleRate, 8000, 192000);
|
||||
XMLUtils::GetString(pElement, "defaultplayer", m_audioDefaultPlayer);
|
||||
// 101 on purpose - can be used to never automark as watched
|
||||
XMLUtils::GetFloat(pElement, "playcountminimumpercent", m_audioPlayCountMinimumPercent, 0.0f, 101.0f);
|
||||
diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h
|
||||
index b0b4df1..7137614 100644
|
||||
--- a/xbmc/settings/AdvancedSettings.h
|
||||
+++ b/xbmc/settings/AdvancedSettings.h
|
||||
@@ -140,6 +140,8 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler
|
||||
static void SettingOptionsLoggingComponentsFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int ¤t, void *data);
|
||||
|
||||
int m_audioHeadRoom;
|
||||
+ // OpenELEC workaround for minimum sample Rate
|
||||
+ int m_minimumSampleRate;
|
||||
float m_ac3Gain;
|
||||
std::string m_audioDefaultPlayer;
|
||||
float m_audioPlayCountMinimumPercent;
|
||||
--
|
||||
2.1.4
|
||||
|
@ -1,75 +1,39 @@
|
||||
From b2db330176ca1115ae9a4bc31af082b80b87ecdb Mon Sep 17 00:00:00 2001
|
||||
From: MilhouseVH <milhouseVH.github@nmacleod.com>
|
||||
Date: Thu, 11 Aug 2016 07:32:48 +0100
|
||||
Subject: [PATCH] LibreELEC: Detect intel gpus and use limited range by default
|
||||
From f040af300925c03a1547ff02d71921bde9893330 Mon Sep 17 00:00:00 2001
|
||||
From: fritsch <Peter.Fruehberger@gmail.com>
|
||||
Date: Sat, 14 Jan 2017 10:23:11 +0100
|
||||
Subject: [PATCH] VAAPI/VDPAU: Integration specific to LibreELEC
|
||||
|
||||
---
|
||||
xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp | 11 +++++++++++
|
||||
xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h | 5 +++++
|
||||
xbmc/settings/Settings.cpp | 9 +++++++++
|
||||
3 files changed, 25 insertions(+)
|
||||
xbmc/settings/Settings.cpp | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp
|
||||
index e8071bd..83db224 100644
|
||||
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp
|
||||
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.cpp
|
||||
@@ -22,6 +22,8 @@
|
||||
#include "settings/Settings.h"
|
||||
#include "settings/lib/Setting.h"
|
||||
#include "windowing/WindowingFactory.h"
|
||||
+#include "utils/SysfsUtils.h"
|
||||
+#include "utils/StringUtils.h"
|
||||
|
||||
bool CDVDVideoCodec::IsSettingVisible(const std::string &condition, const std::string &value, const CSetting *setting, void *data)
|
||||
{
|
||||
@@ -72,3 +74,12 @@ bool CDVDVideoCodec::IsCodecDisabled(const std::map<AVCodecID, std::string> &map
|
||||
}
|
||||
return false; // don't disable what we don't have
|
||||
}
|
||||
+
|
||||
+bool CDVDVideoCodec::IsIntel()
|
||||
+{
|
||||
+ // check if we are running on intel hardware
|
||||
+ std::string gpuvendor;
|
||||
+ SysfsUtils::GetString("/proc/fb", gpuvendor);
|
||||
+
|
||||
+ return StringUtils::EndsWith(gpuvendor, "inteldrmfb");
|
||||
+}
|
||||
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h
|
||||
index a2da9de..cc8a574 100644
|
||||
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h
|
||||
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h
|
||||
@@ -257,6 +257,11 @@ public:
|
||||
static bool IsSettingVisible(const std::string &condition, const std::string &value, const CSetting *setting, void *data);
|
||||
|
||||
/**
|
||||
+ * Check if we are using an Intel GPU
|
||||
+ */
|
||||
+ static bool IsIntel();
|
||||
+
|
||||
+ /**
|
||||
* Interact with user settings so that user disabled codecs are disabled
|
||||
*/
|
||||
static bool IsCodecDisabled(const std::map<AVCodecID, std::string> &map, AVCodecID id);
|
||||
diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp
|
||||
index 0e429f3..7052391 100644
|
||||
index 9940b6a..d7575f0 100644
|
||||
--- a/xbmc/settings/Settings.cpp
|
||||
+++ b/xbmc/settings/Settings.cpp
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "cores/AudioEngine/AEFactory.h"
|
||||
#include "cores/playercorefactory/PlayerCoreFactory.h"
|
||||
#include "cores/VideoPlayer/VideoRenderers/BaseRenderer.h"
|
||||
+#include "cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h"
|
||||
#include "filesystem/File.h"
|
||||
#include "guilib/GraphicContext.h"
|
||||
#include "guilib/GUIAudioManager.h"
|
||||
@@ -911,6 +912,14 @@ void CSettings::InitializeDefaults()
|
||||
@@ -77,6 +77,7 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/RssManager.h"
|
||||
#include "utils/StringUtils.h"
|
||||
+#include "utils/SysfsUtils.h"
|
||||
#include "utils/SystemInfo.h"
|
||||
#include "utils/Weather.h"
|
||||
#include "utils/XBMCTinyXML.h"
|
||||
@@ -914,6 +915,22 @@ void CSettings::InitializeDefaults()
|
||||
|
||||
if (g_application.IsStandAlone())
|
||||
((CSettingInt*)m_settingsManager->GetSetting(CSettings::SETTING_POWERMANAGEMENT_SHUTDOWNSTATE))->SetDefault(POWERSTATE_SHUTDOWN);
|
||||
+
|
||||
+
|
||||
+// LibreELEC integration patch. We ship a special limited range intel kernel patch
|
||||
+// that enables us to control the full / limited / clamping with just altering
|
||||
+// the kodi limitedrange setting.
|
||||
+// For intel we use Limited Range, for nvidia we use full range
|
||||
+// that setting is also used to enable vdpau on nvidia only, vaapi on intel only
|
||||
+#if ((defined(HAVE_LIBVA) || defined(HAVE_LIBVDPAU)))
|
||||
+ bool isIntel = CDVDVideoCodec::IsIntel();
|
||||
+ std::string gpuvendor;
|
||||
+ SysfsUtils::GetString("/proc/fb", gpuvendor);
|
||||
+ bool isIntel = StringUtils::EndsWith(gpuvendor, "inteldrmfb");
|
||||
+ // Intel driver is operating in passthrough mode so use limited range by default
|
||||
+ ((CSettingBool*)GetSetting(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE))->SetDefault(isIntel);
|
||||
+ ((CSettingBool*)GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVAAPI))->SetDefault(isIntel);
|
||||
@ -78,6 +42,3 @@ index 0e429f3..7052391 100644
|
||||
}
|
||||
|
||||
void CSettings::InitializeOptionFillers()
|
||||
--
|
||||
2.7.4
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user