summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorPeter Bieringer <pb@bieringer.de>2021-01-21 07:49:35 +0100
committerPeter Bieringer <pb@bieringer.de>2021-01-21 07:49:35 +0100
commit66f090afdbc21750dfcfce73578b0f49d5980437 (patch)
tree1409c39d3645fabfb3328f5e0084e97921a05140 /extensions
parent4c4b9f78372eeabbd394041b63db71c76eec146d (diff)
downloadvdr-plugin-skindesigner-66f090afdbc21750dfcfce73578b0f49d5980437.tar.gz
vdr-plugin-skindesigner-66f090afdbc21750dfcfce73578b0f49d5980437.tar.bz2
add isUHD to screenresolution
change mechanism to detect video type using screen height instead of guessing height from width
Diffstat (limited to 'extensions')
-rw-r--r--extensions/extrecinfo.c2
-rw-r--r--extensions/extrecinfo.h3
-rw-r--r--extensions/helpers.c42
-rw-r--r--extensions/helpers.h2
4 files changed, 32 insertions, 17 deletions
diff --git a/extensions/extrecinfo.c b/extensions/extrecinfo.c
index 435d43b..f05dc79 100644
--- a/extensions/extrecinfo.c
+++ b/extensions/extrecinfo.c
@@ -19,7 +19,7 @@ bool cExtRecInfo::Parse(void) {
}
StripXmlTag(mediaInfoXml, resWidth, "res_width");
StripXmlTag(mediaInfoXml, resHeight, "res_height");
- resString = GetScreenResolutionString(resWidth, resHeight, &isHD);
+ resString = GetScreenResolutionString(resWidth, resHeight, &isHD, &isUHD);
StripXmlTag(mediaInfoXml, aspectratio, "aspectratio");
isWideScreen = !aspectratio.compare("16:9");
StripXmlTag(mediaInfoXml, codec, "codec");
diff --git a/extensions/extrecinfo.h b/extensions/extrecinfo.h
index 9fb5bab..3297094 100644
--- a/extensions/extrecinfo.h
+++ b/extensions/extrecinfo.h
@@ -23,6 +23,7 @@ public:
int resHeight;
string resString;
bool isHD;
+ bool isUHD;
string aspectratio;
bool isWideScreen;
string codec;
@@ -33,4 +34,4 @@ public:
vector< tAudioTrack > tracks;
};
-#endif // __EXTRECINFO_H \ No newline at end of file
+#endif // __EXTRECINFO_H
diff --git a/extensions/helpers.c b/extensions/helpers.c
index 5c84094..5e06d95 100644
--- a/extensions/helpers.c
+++ b/extensions/helpers.c
@@ -198,29 +198,43 @@ string GetTimeString(int seconds) {
//View Helpers
-string GetScreenResolutionString(int width, int height, bool *isHD) {
+string GetScreenResolutionString(int width, int height, bool *isHD, bool *isUHD) {
+ // TODO: try to get more information from information sources about interlace/progressive
+ // cDevice::PrimaryDevice()->GetVideoSize is NOT providing enough information
+ *isHD = false; // default
+ *isUHD = false; // default
string name = "";
- switch (width) {
- case 1920:
- case 1440:
- name = "hd1080i";
+ switch (height) {
+ case 4320: // 7680 x 4320 = 8K UHD
+ name = "uhd4320p";
*isHD = true;
+ *isUHD = true;
break;
- case 1280:
- if (height == 720)
- name = "hd720p";
- else
- name = "hd1080i";
+ case 2160: // 3840 x 2160 = 4K UHD
+ name = "uhd2160p";
+ *isHD = true;
+ *isUHD = true;
+ break;
+ case 1440: // 2560 x 1440 = QHD
+ name = "hd1440p";
+ *isHD = true;
+ break;
+ case 1080:
+ name = "hd1080i"; // 'i' is default, 'p' can't be detected currently
*isHD = true;
break;
case 720:
- name = "sd576i";
+ name = "hd720p"; // 'i' is not defined in standards
+ *isHD = true;
+ break;
+ case 576:
+ name = "sd576i"; // assumed 'i'
break;
- case 544:
- name = "sd480i";
+ case 480:
+ name = "sd480i"; // assumed 'i'
break;
default:
- name = "sd576i";
+ name = "unknown";
break;
}
return name;
diff --git a/extensions/helpers.h b/extensions/helpers.h
index b059a16..270d300 100644
--- a/extensions/helpers.h
+++ b/extensions/helpers.h
@@ -44,7 +44,7 @@ public:
string GetTimeString(int seconds);
-string GetScreenResolutionString(int width, int height, bool *isHD);
+string GetScreenResolutionString(int width, int height, bool *isHD, bool *isUHD);
string GetScreenAspectString(double aspect, bool *isWideScreen);
#endif // __HELPERS_H