aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkszaq <kszaquitto@gmail.com>2016-11-28 22:24:27 +0100
committerkszaq <kszaquitto@gmail.com>2016-11-28 22:24:27 +0100
commite2b2a05db53f277561b3b183bdb8d601f88f97ab (patch)
treeaceaf741c5662cbd2e2489c8a9fbd197095394c8
parent4cb97be7dd25d9e7f236653f7d1f2d4541cce842 (diff)
aml: introduce speaking constants in H264 4K2K check
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp2
-rw-r--r--xbmc/utils/AMLUtils.cpp14
-rw-r--r--xbmc/utils/AMLUtils.h10
4 files changed, 18 insertions, 10 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
index 37b4fdbd3a..c38c22318d 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
@@ -1499,7 +1499,7 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints)
am_private->video_format = codecid_to_vformat(hints.codec);
if ((am_private->video_format == VFORMAT_H264)
&& (hints.width > 1920 || hints.height > 1088)
- && (aml_support_h264_4k2k() == 1))
+ && (aml_support_h264_4k2k() == AML_HAS_H264_4K2K))
{
am_private->video_format = VFORMAT_H264_4K2K;
}
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
index 5939f38dcc..a27d3e3a27 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
@@ -113,7 +113,7 @@ bool CDVDVideoCodecAmlogic::Open(CDVDStreamInfo &hints, CDVDCodecOptions &option
case FF_PROFILE_H264_CAVLC_444:
return false;
}
- if ((!aml_support_h264_4k2k()) && ((m_hints.width > 1920) || (m_hints.height > 1088)))
+ if ((aml_support_h264_4k2k() == AML_NO_H264_4K2K) && ((m_hints.width > 1920) || (m_hints.height > 1088)))
{
// 4K is supported only on Amlogic S802/S812 chip
return false;
diff --git a/xbmc/utils/AMLUtils.cpp b/xbmc/utils/AMLUtils.cpp
index a71624cf9d..cd19ec75cb 100644
--- a/xbmc/utils/AMLUtils.cpp
+++ b/xbmc/utils/AMLUtils.cpp
@@ -216,21 +216,21 @@ bool aml_support_hevc_10bit()
return (has_hevc_10bit == 1);
}
-int aml_support_h264_4k2k()
+AML_SUPPORT_H264_4K2K aml_support_h264_4k2k()
{
- static int has_h264_4k2k = -1;
+ static AML_SUPPORT_H264_4K2K has_h264_4k2k = AML_SUPPORT_H264_4K2K_UNINIT;
- if (has_h264_4k2k == -1)
+ if (has_h264_4k2k == AML_SUPPORT_H264_4K2K_UNINIT)
{
std::string valstr;
if (SysfsUtils::GetString("/sys/class/amstream/vcodec_profile", valstr) != 0)
- has_h264_4k2k = 0;
+ has_h264_4k2k = AML_NO_H264_4K2K;
else if (valstr.find("h264:4k") != std::string::npos)
- has_h264_4k2k = 2;
+ has_h264_4k2k = AML_HAS_H264_4K2K_SAME_PROFILE;
else if (valstr.find("h264_4k2k:") != std::string::npos)
- has_h264_4k2k = 1;
+ has_h264_4k2k = AML_HAS_H264_4K2K;
else
- has_h264_4k2k = 0;
+ has_h264_4k2k = AML_NO_H264_4K2K;
}
return has_h264_4k2k;
}
diff --git a/xbmc/utils/AMLUtils.h b/xbmc/utils/AMLUtils.h
index de1053f480..ba8b493574 100644
--- a/xbmc/utils/AMLUtils.h
+++ b/xbmc/utils/AMLUtils.h
@@ -41,6 +41,14 @@ enum AML_DISPLAY_AXIS_PARAM
AML_DISPLAY_AXIS_PARAM_HEIGHT
};
+enum AML_SUPPORT_H264_4K2K
+{
+ AML_SUPPORT_H264_4K2K_UNINIT = -1,
+ AML_NO_H264_4K2K,
+ AML_HAS_H264_4K2K,
+ AML_HAS_H264_4K2K_SAME_PROFILE
+};
+
bool aml_present();
bool aml_permissions();
bool aml_hw3d_present();
@@ -48,7 +56,7 @@ bool aml_wired_present();
bool aml_support_hevc();
bool aml_support_hevc_4k2k();
bool aml_support_hevc_10bit();
-int aml_support_h264_4k2k();
+AML_SUPPORT_H264_4K2K aml_support_h264_4k2k();
void aml_set_audio_passthrough(bool passthrough);
bool aml_IsHdmiConnected();
bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res);