mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
add isUHD to screenresolution
change mechanism to detect video type using screen height instead of guessing height from width
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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
|
||||
#endif // __EXTRECINFO_H
|
||||
|
||||
@@ -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 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 1280:
|
||||
if (height == 720)
|
||||
name = "hd720p";
|
||||
else
|
||||
name = "hd1080i";
|
||||
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 544:
|
||||
name = "sd480i";
|
||||
case 576:
|
||||
name = "sd576i"; // assumed 'i'
|
||||
break;
|
||||
case 480:
|
||||
name = "sd480i"; // assumed 'i'
|
||||
break;
|
||||
default:
|
||||
name = "sd576i";
|
||||
name = "unknown";
|
||||
break;
|
||||
}
|
||||
return name;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user