summaryrefslogtreecommitdiff
path: root/coreengine/viewelement.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreengine/viewelement.c')
-rw-r--r--coreengine/viewelement.c63
1 files changed, 53 insertions, 10 deletions
diff --git a/coreengine/viewelement.c b/coreengine/viewelement.c
index a9405cd..43fb8c3 100644
--- a/coreengine/viewelement.c
+++ b/coreengine/viewelement.c
@@ -587,18 +587,19 @@ void cViewElement::StopAnimation(void) {
/******************************************************************
* helper function (did not find any other common place)
******************************************************************/
-bool RecordingIsHD(const cEvent* event) {
+bool RecordingIsHD(const cEvent* event, const tChannelID channelID) {
// detect HD from 'info'
bool isHD = false;
- cComponents *Components = (cComponents *)event->Components();
- if (Components) {
+ int type = -1;
+
+ if (event) {
+ cComponents *Components = (cComponents *)event->Components();
+ if (Components) {
// detect HD (see also ETSI EN 300 468)
// Stream: 1 = MPEG2-Video, 2 = MPEG2 Audio, 3 = Untertitel, 4 = AC3-Audio, 5 = H.264-Video, 6 = HEAAC-Audio, 7 = DTS/DTS HD audio, 8 = SRM/CPCM data, 9 = HEVC Video, AC4 Audio
// Stream == Video(1|5): 01 = 05 = 4:3, 02 = 03 = 06 = 07 = 16:9, 04 = 08 = >16:9, 09 = 0D = HD 4:3, 0A = 0B = 0E = 0F = HD 16:9, 0C = 10 = HD >16:9
tComponent *Component;
- int type = -1;
-
// #1: HVEC (stream content: 9)
Component = Components->GetComponent(0, 9, 0); // recording info: "X 9 <type>"
if (Component) {
@@ -628,22 +629,45 @@ bool RecordingIsHD(const cEvent* event) {
case 0x10:
isHD = true;
};
+ };
};
+
+ if ((isHD == false) && (type == -1) && (!(channelID == tChannelID::InvalidID))) {
+ dsyslog("skindesigner: Title='%s' ShortText='%s' isHD=%d type=%d channelID=%s", event->Title(), event->ShortText(), isHD, type, *channelID.ToString());
+ // fallback to retrieve via channel (in case of EPG issues)
+#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
+ LOCK_CHANNELS_READ;
+ const cChannel *channel = Channels->GetByChannelID(channelID);
+#else
+ const cChannel *channel = Channels.GetByChannelID(channelID);
+#endif
+ if (channel) {
+ dsyslog("skindesigner: Title='%s' ShortText='%s' isHD=%d type=%d Channel='%s'", event->Title(), event->ShortText(), isHD, type, channel->Name());
+ switch (channel->Vtype()) {
+ case 0x1b: // H.264
+ case 0x24: // H.265
+ isHD = true;
+ break;
+ };
+ };
+ };
+
return isHD;
};
-bool RecordingIsUHD(const cEvent* event) {
+bool RecordingIsUHD(const cEvent* event, const tChannelID channelID) {
// detect UHD from 'info'
bool isUHD = false;
- cComponents *Components = (cComponents *)event->Components();
- if (Components) {
+ int type = -1;
+
+ if (event) {
+ cComponents *Components = (cComponents *)event->Components();
+ if (Components) {
// detect UHD (see also ETSI EN 300 468)
// Stream: 9 = HEVC Video, AC4 Audio
// Stream == Video(9): 00|01|02|03 = HD, 04|05|06|07 = UHD
tComponent *Component;
- int type = -1;
-
// HVEC (stream content: 9)
Component = Components->GetComponent(0, 9, 0); // recording info: "X 9 <type>"
if (Component) {
@@ -657,7 +681,26 @@ bool RecordingIsUHD(const cEvent* event) {
case 0x07:
isUHD = true;
};
+ };
};
+
+ if ((isUHD == false) && (type == -1) && (!(channelID == tChannelID::InvalidID))) {
+ // fallback to retrieve via channel (in case of EPG issues)
+#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
+ LOCK_CHANNELS_READ;
+ const cChannel *channel = Channels->GetByChannelID(channelID);
+#else
+ const cChannel *channel = Channels.GetByChannelID(channelID);
+#endif
+ if (channel) {
+ switch (channel->Vtype()) {
+ case 0x24: // H.265
+ isUHD = true;
+ break;
+ };
+ };
+ };
+
return isUHD;
};