Merge pull request #256 from kszaq/fix-wetek-core-kodi-17

projects/WeTek*: Fix build with Kodi 17
This commit is contained in:
Christian Hewitt 2016-04-29 08:50:57 +04:00
commit 10e2688d23
4 changed files with 4 additions and 334 deletions

View File

@ -97,99 +97,6 @@ index 21256ef..2103f0b 100644
m_nativeWindow = nativeWindow;
SetFramebufferResolution(nativeWindow->width, nativeWindow->height);
@@ -142,48 +157,78 @@ bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res)
}
#endif
- switch((int)(0.5 + res.fRefreshRate))
+ switch((int)(res.fRefreshRate*10))
{
default:
- case 60:
+ case 600:
switch(res.iScreenWidth)
{
default:
case 1280:
- SetDisplayResolution("720p");
+ return SetDisplayResolution("720p");
break;
case 1920:
if (res.dwFlags & D3DPRESENTFLAG_INTERLACED)
- SetDisplayResolution("1080i");
+ return SetDisplayResolution("1080i");
else
- SetDisplayResolution("1080p");
+ return SetDisplayResolution("1080p");
break;
}
break;
- case 50:
+ case 500:
switch(res.iScreenWidth)
{
default:
case 1280:
- SetDisplayResolution("720p50hz");
+ return SetDisplayResolution("720p50hz");
break;
case 1920:
if (res.dwFlags & D3DPRESENTFLAG_INTERLACED)
- SetDisplayResolution("1080i50hz");
+ return SetDisplayResolution("1080i50hz");
else
- SetDisplayResolution("1080p50hz");
+ return SetDisplayResolution("1080p50hz");
break;
}
break;
- case 30:
- SetDisplayResolution("1080p30hz");
+ case 300:
+ switch(res.iScreenWidth)
+ {
+ case 3840:
+ return SetDisplayResolution("4k2k30hz");
+ break;
+ default:
+ return SetDisplayResolution("1080p30hz");
+ break;
+ }
break;
- case 24:
- SetDisplayResolution("1080p24hz");
+ case 250:
+ switch(res.iScreenWidth)
+ {
+ case 3840:
+ return SetDisplayResolution("4k2k25hz");
+ break;
+ default:
+ return SetDisplayResolution("1080p25hz");
+ break;
+ }
+ break;
+ case 240:
+ switch(res.iScreenWidth)
+ {
+ case 3840:
+ return SetDisplayResolution("4k2k24hz");
+ break;
+ case 4096:
+ return SetDisplayResolution("4k2ksmpte");
+ break;
+ default:
+ return SetDisplayResolution("1080p24hz");
+ break;
+ }
break;
}
- return true;
+ return false;
}
bool CEGLNativeTypeAmlogic::ProbeResolutions(std::vector<RESOLUTION_INFO> &resolutions)
@@ -280,8 +325,8 @@ void CEGLNativeTypeAmlogic::SetFramebufferResolution(int width, int height) cons
{
vinfo.xres = width;

View File

@ -4,13 +4,13 @@ Date: Sat, 12 Dec 2015 02:15:15 +0100
Subject: [PATCH 5/6] [aml] Fix compiler badness when compiling with amcodec
---
xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in | 2 --
xbmc/cores/VideoPlayer/DVDCodecs/Video/Makefile.in | 2 --
1 file changed, 2 deletions(-)
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/Makefile.in b/xbmc/cores/VideoPlayer/DVDCodecs/Video/Makefile.in
index 56ec6a3..52fa07e 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/Makefile.in
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/Makefile.in
@@ -26,8 +26,6 @@ endif
ifeq (@USE_LIBAMCODEC@,1)
SRCS += AMLCodec.cpp

View File

@ -1,23 +0,0 @@
From 3e6754f46448b9718d57b62e8ca122e6217d0b22 Mon Sep 17 00:00:00 2001
From: Alex Deryskyba <alex@codesnake.com>
Date: Mon, 2 Mar 2015 09:48:14 +0100
Subject: [PATCH] [aml] Fix stuttering during a playback of a video with 23.976
FPS
---
xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
index 2103042..edf8f8a 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
@@ -1974,7 +1974,7 @@ void CAMLCodec::Process()
double error = app_pts - (double)pts_video/PTS_FREQ;
double abs_error = fabs(error);
- if (abs_error > 0.125)
+ if (abs_error > 0)
{
//CLog::Log(LOGDEBUG, "CAMLCodec::Process pts diff = %f", error);
if (abs_error > 0.150)

View File

@ -1,214 +0,0 @@
From c90b4c2ced393524e81c0ec321afa7ec94f3b806 Mon Sep 17 00:00:00 2001
From: Alex Deryskyba <alex@codesnake.com>
Date: Wed, 1 Jul 2015 23:37:11 +0200
Subject: [PATCH] [aml] Add support for 4k resolutions
---
xbmc/utils/AMLUtils.cpp | 16 +++---
xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | 81 ++++++++++++++++++++++-------
xbmc/windowing/egl/EGLNativeTypeAmlogic.h | 2 +
3 files changed, 73 insertions(+), 26 deletions(-)
diff --git a/xbmc/utils/AMLUtils.cpp b/xbmc/utils/AMLUtils.cpp
index 1b54435..05f2cd0 100644
--- a/xbmc/utils/AMLUtils.cpp
+++ b/xbmc/utils/AMLUtils.cpp
@@ -449,8 +449,8 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
}
else if (StringUtils::EqualsNoCase(fromMode, "4k2ksmpte") || StringUtils::EqualsNoCase(fromMode, "smpte24hz"))
{
- res->iWidth = 1920;
- res->iHeight= 1080;
+ res->iWidth = 4096;
+ res->iHeight= 2160;
res->iScreenWidth = 4096;
res->iScreenHeight= 2160;
res->fRefreshRate = 24;
@@ -467,8 +467,8 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
}
else if (StringUtils::EqualsNoCase(fromMode, "4k2k24hz") || StringUtils::EqualsNoCase(fromMode, "2160p24hz"))
{
- res->iWidth = 1920;
- res->iHeight= 1080;
+ res->iWidth = 3840;
+ res->iHeight= 2160;
res->iScreenWidth = 3840;
res->iScreenHeight= 2160;
res->fRefreshRate = 24;
@@ -476,8 +476,8 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
}
else if (StringUtils::EqualsNoCase(fromMode, "4k2k25hz") || StringUtils::EqualsNoCase(fromMode, "2160p25hz"))
{
- res->iWidth = 1920;
- res->iHeight= 1080;
+ res->iWidth = 3840;
+ res->iHeight= 2160;
res->iScreenWidth = 3840;
res->iScreenHeight= 2160;
res->fRefreshRate = 25;
@@ -494,8 +494,8 @@ bool aml_mode_to_resolution(const char *mode, RESOLUTION_INFO *res)
}
else if (StringUtils::EqualsNoCase(fromMode, "4k2k30hz") || StringUtils::EqualsNoCase(fromMode, "2160p30hz"))
{
- res->iWidth = 1920;
- res->iHeight= 1080;
+ res->iWidth = 3840;
+ res->iHeight= 2160;
res->iScreenWidth = 3840;
res->iScreenHeight= 2160;
res->fRefreshRate = 30;
diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
index 21256ef..2103f0b 100644
--- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
@@ -65,7 +65,22 @@ void CEGLNativeTypeAmlogic::Initialize()
{
aml_permissions();
DisableFreeScale();
+ GetMaxResolution(m_maxResolution);
}
+
+void CEGLNativeTypeAmlogic::GetMaxResolution(RESOLUTION_INFO &maxResolution)
+{
+ std::vector<RESOLUTION_INFO> resolutions;
+ ProbeResolutions(resolutions);
+
+ maxResolution = {0};
+ for (size_t i = 0; i < resolutions.size(); i++)
+ {
+ if (resolutions[i].iScreenWidth > maxResolution.iScreenWidth || resolutions[i].iScreenHeight > maxResolution.iScreenHeight)
+ maxResolution = resolutions[i];
+ }
+}
+
void CEGLNativeTypeAmlogic::Destroy()
{
return;
@@ -84,8 +99,8 @@ bool CEGLNativeTypeAmlogic::CreateNativeWindow()
if (!nativeWindow)
return false;
- nativeWindow->width = 1920;
- nativeWindow->height = 1080;
+ nativeWindow->width = m_maxResolution.iScreenWidth;
+ nativeWindow->height = m_maxResolution.iScreenHeight;
m_nativeWindow = nativeWindow;
SetFramebufferResolution(nativeWindow->width, nativeWindow->height);
@@ -142,48 +157,78 @@ bool CEGLNativeTypeAmlogic::SetNativeResolution(const RESOLUTION_INFO &res)
}
#endif
- switch((int)(0.5 + res.fRefreshRate))
+ switch((int)(res.fRefreshRate*10))
{
default:
- case 60:
+ case 600:
switch(res.iScreenWidth)
{
default:
case 1280:
- SetDisplayResolution("720p");
+ return SetDisplayResolution("720p");
break;
case 1920:
if (res.dwFlags & D3DPRESENTFLAG_INTERLACED)
- SetDisplayResolution("1080i");
+ return SetDisplayResolution("1080i");
else
- SetDisplayResolution("1080p");
+ return SetDisplayResolution("1080p");
break;
}
break;
- case 50:
+ case 500:
switch(res.iScreenWidth)
{
default:
case 1280:
- SetDisplayResolution("720p50hz");
+ return SetDisplayResolution("720p50hz");
break;
case 1920:
if (res.dwFlags & D3DPRESENTFLAG_INTERLACED)
- SetDisplayResolution("1080i50hz");
+ return SetDisplayResolution("1080i50hz");
else
- SetDisplayResolution("1080p50hz");
+ return SetDisplayResolution("1080p50hz");
break;
}
break;
- case 30:
- SetDisplayResolution("1080p30hz");
+ case 300:
+ switch(res.iScreenWidth)
+ {
+ case 3840:
+ return SetDisplayResolution("4k2k30hz");
+ break;
+ default:
+ return SetDisplayResolution("1080p30hz");
+ break;
+ }
break;
- case 24:
- SetDisplayResolution("1080p24hz");
+ case 250:
+ switch(res.iScreenWidth)
+ {
+ case 3840:
+ return SetDisplayResolution("4k2k25hz");
+ break;
+ default:
+ return SetDisplayResolution("1080p25hz");
+ break;
+ }
+ break;
+ case 240:
+ switch(res.iScreenWidth)
+ {
+ case 3840:
+ return SetDisplayResolution("4k2k24hz");
+ break;
+ case 4096:
+ return SetDisplayResolution("4k2ksmpte");
+ break;
+ default:
+ return SetDisplayResolution("1080p24hz");
+ break;
+ }
break;
}
- return true;
+ return false;
}
bool CEGLNativeTypeAmlogic::ProbeResolutions(std::vector<RESOLUTION_INFO> &resolutions)
@@ -280,8 +325,8 @@ void CEGLNativeTypeAmlogic::SetFramebufferResolution(int width, int height) cons
{
vinfo.xres = width;
vinfo.yres = height;
- vinfo.xres_virtual = 1920;
- vinfo.yres_virtual = 2160;
+ vinfo.xres_virtual = m_maxResolution.iScreenWidth;
+ vinfo.yres_virtual = m_maxResolution.iScreenHeight * 2;
vinfo.bits_per_pixel = 32;
vinfo.activate = FB_ACTIVATE_ALL;
ioctl(fd0, FBIOPUT_VSCREENINFO, &vinfo);
diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h
index 6867c38..9ca41d4 100644
--- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h
+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h
@@ -55,6 +55,8 @@ class CEGLNativeTypeAmlogic : public CEGLNativeType
private:
void SetFramebufferResolution(const RESOLUTION_INFO &res) const;
void SetFramebufferResolution(int width, int height) const;
+ void GetMaxResolution(RESOLUTION_INFO &maxResolution);
std::string m_framebuffer_name;
+ RESOLUTION_INFO m_maxResolution;
};