Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -230,21 +230,19 @@ AS_IF([test "$BOXTYPE" == "vuzero"],[AC_DEFINE(HWVUZERO, 1,[vuzero])])
AS_IF([test "$BOXTYPE" == "vuzero4k"],[AC_DEFINE(HWVUZERO4K, 1,[vuzero4k])])

dnl Software HDR detection (HEVC bitstream parser + TS recorder tap).
dnl Enabled for VU+ 4K boxes and GigaBlue Quad 4K Pro, which have capable
dnl Enabled for VU+ 4K boxes and GigaBlue 4K boxes, which have capable
dnl enough SoCs and GStreamer stacks to support the detection pipeline.
if test "$BOXTYPE" == "vuduo4k" -o "$BOXTYPE" == "vuduo4kse" \
-o "$BOXTYPE" == "vuduo4klite" -o "$BOXTYPE" == "vusolo4k" \
-o "$BOXTYPE" == "vuultimo4k" -o "$BOXTYPE" == "vuuno4k" \
-o "$BOXTYPE" == "vuuno4kse" -o "$BOXTYPE" == "vuzero4k" \
-o "$BOXTYPE" == "gb7252"; then
dnl Not enabled for vuduo4klite, vuultimo4k and gbquad4kpro.
has_sw_hdr_detection=no
if test "$MACHINEBUILD" != "gbquad4kpro" -a "$MACHINEBUILD" != "vuduo4klite" -a "$MACHINEBUILD" != "vuultimo4k" \
-a \( "$BOXTYPE" == "vuduo4k" -o "$BOXTYPE" == "vuduo4kse" \
-o "$BOXTYPE" == "vusolo4k" -o "$BOXTYPE" == "vuuno4k" \
-o "$BOXTYPE" == "vuuno4kse" -o "$BOXTYPE" == "vuzero4k" \
-o "$BOXTYPE" == "gb7252" \); then
has_sw_hdr_detection=yes
AC_DEFINE(HAS_SOFTWARE_HDR_DETECTION, 1, [Enable software HDR detection via HEVC bitstream parsing])
fi
AM_CONDITIONAL(HAS_SOFTWARE_HDR_DETECTION, \
test "$BOXTYPE" == "vuduo4k" -o "$BOXTYPE" == "vuduo4kse" \
-o "$BOXTYPE" == "vuduo4klite" -o "$BOXTYPE" == "vusolo4k" \
-o "$BOXTYPE" == "vuultimo4k" -o "$BOXTYPE" == "vuuno4k" \
-o "$BOXTYPE" == "vuuno4kse" -o "$BOXTYPE" == "vuzero4k" \
-o "$BOXTYPE" == "gb7252")
AM_CONDITIONAL(HAS_SOFTWARE_HDR_DETECTION, test "x$has_sw_hdr_detection" = "xyes")

AC_ARG_WITH(accelerationthreshold,
AS_HELP_STRING([--with-accelerationthreshold=n], [use acceleration threshold of n bytes]),
Expand Down
37 changes: 32 additions & 5 deletions lib/gui/estack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

eStack::eStack(eWidget* parent, LayoutDirection dir) : eWidget(parent), m_direction(dir) {
m_spacing = 0;
setTransparent(1);
}

eStack::~eStack() {
/* children must not call back into a destroyed stack */
for (auto child : m_stackchilds)
child->setStack(nullptr);
}

void eStack::setSpacing(int spacing) {
m_spacing = spacing;
recalcLayout();
}

void eStack::show() {
eWidget::show();
recalcLayout();
}

void eStack::forgetStackChild(eWidget* child) {
if (auto it = std::ranges::find(m_stackchilds, child); it != m_stackchilds.end())
m_stackchilds.erase(it);
}

void eStack::setLayoutDirection(LayoutDirection dir) {
Expand Down Expand Up @@ -38,7 +60,10 @@ int eStack::event(int event, void* data, void* data2) {
if (event == evtPaint)
return 0;

return eWidget::event(event, data, data2);
int ret = eWidget::event(event, data, data2);
if (event == evtChangedSize)
recalcLayout();
return ret;
}

void eStack::recalcLayout() {
Expand All @@ -47,6 +72,8 @@ void eStack::recalcLayout() {

if (stack_w < 0 || stack_h < 0)
return;
if (!isVisible())
return;

int x = 0, y = 0;
int xr = stack_w;
Expand Down Expand Up @@ -78,8 +105,8 @@ void eStack::recalcLayout() {
lcount++;
} else if (child->align() & eStackAlignRight) {
cx = xr - cw;
xr -= cx;
if (lcount > 0) {
xr -= cw;
if (rcount > 0) {
cx -= m_spacing;
xr -= m_spacing;
}
Expand All @@ -91,15 +118,15 @@ void eStack::recalcLayout() {
} else {
if (child->align() & eStackAlignTop) {
cy = y;
y += cy;
y += ch;
if (tcount > 0) {
y += m_spacing;
cy += m_spacing;
}
tcount++;
} else if (child->align() & eStackAlignBottom) {
cy = yb - ch;
yb -= cy;
yb -= ch;
if (bcount > 0) {
cy -= m_spacing;
yb -= m_spacing;
Expand Down
10 changes: 7 additions & 3 deletions lib/gui/estack.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef __lib_gui_epanel_h
#define __lib_gui_epanel_h
#ifndef __lib_gui_estack_h
#define __lib_gui_estack_h

#include <algorithm>
#include <cstdint>
Expand All @@ -14,6 +14,7 @@ class eStack : public eWidget {
};

eStack(eWidget* parent = nullptr, LayoutDirection dir = Vertical);
~eStack();

void setLayoutDirection(LayoutDirection dir);
LayoutDirection layoutDirection() const { return m_direction; }
Expand All @@ -22,12 +23,15 @@ class eStack : public eWidget {
void removeChild(eWidget* child);

int getSpacing() const { return m_spacing; }
void setSpacing(int spacing) { m_spacing = spacing; }
void setSpacing(int spacing);

void show() override;

protected:
int event(int event, void* data = 0, void* data2 = 0) override;
void recalcLayout();
void invalidateChilds() override;
void forgetStackChild(eWidget* child) override;

private:
LayoutDirection m_direction;
Expand Down
5 changes: 5 additions & 0 deletions lib/gui/ewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ void eWidget::mayKillFocus()

eWidget::~eWidget()
{
if (m_stack)
{
m_stack->forgetStackChild(this);
m_stack = nullptr;
}
hide();
if (m_parent)
m_parent->m_childs.remove(this);
Expand Down
3 changes: 2 additions & 1 deletion lib/gui/ewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class eWidget

eWidget *getParent() { return m_parent; }

void show();
virtual void show();
void hide();

void raise();
Expand Down Expand Up @@ -162,6 +162,7 @@ class eWidget
bool m_alphaBlend = false;
uint8_t m_align = eStackAlignNone;
virtual void invalidateChilds() {} // This will be overwritten in subclass
virtual void forgetStackChild(eWidget*) {} // This will be overwritten in subclass

public:

Expand Down
2 changes: 1 addition & 1 deletion lib/gui/ewindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class eWindow: public eWidget
void setTitle(const std::string &string);
std::string getTitle() const;
eWidget *child() { return m_child; }
void show();
void show() override;
void hide();

enum {
Expand Down
36 changes: 6 additions & 30 deletions lib/python/Components/AVSwitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from enigma import eAVSwitch, eDVBVolumecontrol, getDesktop

from Components.config import ConfigEnableDisable, ConfigNothing, ConfigSelection, ConfigSelectionNumber, ConfigSlider, ConfigSubDict, ConfigSubsection, ConfigYesNo, NoSave, config
from Components.SystemInfo import SystemInfo
from Components.SystemInfo import BOXTYPE, SystemInfo
from Tools.CList import CList
from Tools.Directories import fileCheck, fileReadLine, fileWriteLine, isPluginInstalled

Expand Down Expand Up @@ -509,18 +509,18 @@ def setHDMIColorimetry(configElement):

if SystemInfo["havehdmicolordepth"]:
def setHdmiColordepth(configElement):
open(SystemInfo["havehdmicolordepth"], "w").write("12bit" if SystemInfo["needsVideoJudderDriverFix"] else configElement.value)
open(SystemInfo["havehdmicolordepth"], "w").write(configElement.value)
choices = [("auto", _("Auto")),
("8bit", _("8bit")),
("10bit", _("10bit")),
("12bit", _("12bit"))]
default = "auto"
if SystemInfo["needsVideoJudderDriverFix"]:
choices = [("10bit", "10bit"), ("12bit", "12bit")]
default = "12bit"
elif SystemInfo["havehdmicolordepthchoices"] and SystemInfo["CanProc"]:
if SystemInfo["havehdmicolordepthchoices"] and SystemInfo["CanProc"]:
f = "/proc/stb/video/hdmi_colordepth_choices"
(choices, default) = readChoices(f, choices, default)
if BOXTYPE in ("gbquad4kpro", "vuduo4klite"):
choices = [choice for choice in choices if choice[0] not in ("auto", "8bit")]
default = "10bit"
config.av.hdmicolordepth = ConfigSelection(choices=choices, default=default)
config.av.hdmicolordepth.addNotifier(setHdmiColordepth)
else:
Expand Down Expand Up @@ -916,27 +916,3 @@ def stopHotplug():

def InitiVideomodeHotplug(**kwargs):
startHotplug()


iVideoJudderDriverFixTask = None


class VideoJudderDriverFixTask:
def __init__(self):
self.onClose = []
from enigma import iPlayableService
from Components.ServiceEventTracker import ServiceEventTracker
self.inited = False
self.__event_tracker = ServiceEventTracker(screen=self, eventmap={iPlayableService.evVideoFramerateChanged: self.__evVideoFramerateChanged})

def __evVideoFramerateChanged(self):
if not self.inited:
with open("/proc/stb/video/hdmi_colordepth", "w") as fd:
fd.write("10bit")
self.inited = True


def startVideoJudderDriverFixTask():
global iVideoJudderDriverFixTask
if SystemInfo["needsVideoJudderDriverFix"]:
iVideoJudderDriverFixTask = VideoJudderDriverFixTask()
1 change: 0 additions & 1 deletion lib/python/Components/SystemInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ def hasInitCam():
SystemInfo["hasScart"] = SystemInfo["scart"]
SystemInfo["hasScartYUV"] = SystemInfo["scartyuv"]
SystemInfo["hasYUV"] = SystemInfo["yuv"]
SystemInfo["needsVideoJudderDriverFix"] = BOXTYPE in ("gbquad4kpro", "vuduo4klite")
SystemInfo["scalerSharpnessWorkaround"] = BOXTYPE in ("gbquad", "gbquadplus")
SystemInfo["dmVideoRates"] = MODEL in ("dm900", "dm920")

Expand Down
21 changes: 16 additions & 5 deletions lib/python/Screens/Screen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from os.path import isfile

from enigma import eRCInput, eTimer, eWindow, getDesktop
from enigma import eRCInput, eStack, eTimer, eWindow, getDesktop

from skin import GUI_SKIN_ID, DISPLAY_SKIN_ID, applyAllAttributes, menus, screens, setups # noqa: F401
from Components.config import config
Expand Down Expand Up @@ -146,6 +146,9 @@ def show(self):
for val in list(self.values()) + self.renderer:
if isinstance(val, GUIComponent) or isinstance(val, Source):
val.onShow()
for stack in getattr(self, "stacks", []):
if isinstance(stack.instance, eStack):
stack.instance.show()

def hide(self):
if not self.shown or not self.instance:
Expand All @@ -157,6 +160,9 @@ def hide(self):
for val in list(self.values()) + self.renderer:
if isinstance(val, GUIComponent) or isinstance(val, Source):
val.onHide()
for stack in getattr(self, "stacks", []):
if isinstance(stack.instance, eStack):
stack.instance.hide()

def getScreenPath(self):
return self.screenPath
Expand Down Expand Up @@ -277,21 +283,24 @@ def addToStack(widget):
stack = self.stacks[widget.stackIndex]
stack.instance.addChild(widget.instance)

for widget in self.stacks:
widget.instance = widget.widget(parent, widget.layout)
applyAllAttributes(widget.instance, desktop, widget.skinAttributes, self.scale)
addToStack(widget)
if not updateonly:
for widget in self.stacks:
widget.instance = widget.widget(parent, widget.layout)
applyAllAttributes(widget.instance, desktop, widget.skinAttributes, self.scale)
addToStack(widget)
for val in self.renderer:
if isinstance(val, GUIComponent):
if not updateonly:
val.GUIcreate(parent)
addToStack(val)
if not val.applySkin(desktop, self):
print("[Screen] Warning: Skin is missing renderer '%s' in %s." % (val, str(self)))
for key in self:
val = self[key]
if isinstance(val, GUIComponent):
if not updateonly:
val.GUIcreate(parent)
addToStack(val)
depr = val.deprecationInfo
if val.applySkin(desktop, self):
if depr:
Expand All @@ -304,6 +313,8 @@ def addToStack(widget):
w.instance = w.widget(parent)
# w.instance.thisown = 0
applyAllAttributes(w.instance, desktop, w.skinAttributes, self.scale)
if not updateonly:
addToStack(w)
if self.screenImage:
self["Image"].setPixmap(LoadPixmap(self.screenImage))
for f in self.onLayoutFinish:
Expand Down
3 changes: 1 addition & 2 deletions lib/python/Screens/VideoMode.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ def createSetup(self):
if SystemInfo["havecolorimetry"]:
self.list.append(getConfigListEntry(_("HDMI Colorimetry"), config.av.hdmicolorimetry, _("Change the Colorimetry for HDR - this may cause unexpected results or black screen")))
if SystemInfo["havehdmicolordepth"]:
if not SystemInfo["needsVideoJudderDriverFix"]:
self.list.append(getConfigListEntry(_("HDMI Color Depth"), config.av.hdmicolordepth, _("Change the Colordepth for UHD - this may cause unexpected results or black screen")))
self.list.append(getConfigListEntry(_("HDMI Color Depth"), config.av.hdmicolordepth, _("Change the Colordepth for UHD - this may cause unexpected results or black screen")))
if SystemInfo["havehdmihdrtype"]:
self.list.append(getConfigListEntry(_("HDMI HDR Type"), config.av.hdmihdrtype, _("Enable or disable to force HDR Modes for UHD")))
if SystemInfo["havehdmihdrosd"]:
Expand Down
4 changes: 0 additions & 4 deletions lib/python/StartEnigma.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,6 @@ def runScreenTest():
Tools.Trashcan.init(session)
if not VuRecovery:
CiHandler.setSession(session)
if SystemInfo["needsVideoJudderDriverFix"]:
profile("Init:Components.AVSwitch.VideoJudderDriverFixTask")
from Components.AVSwitch import startVideoJudderDriverFixTask
startVideoJudderDriverFixTask()

screensToRun = [p.fnc for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD)]
profile("wizards")
Expand Down
Loading
Loading