aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Frühberger <Peter.Fruehberger@gmail.com>2015-04-11 14:20:48 +0200
committerPeter Frühberger <Peter.Fruehberger@gmail.com>2015-04-11 14:20:48 +0200
commit23ef019b4799a4b73aadbbd4fe8d066163dd365e (patch)
treee195c3a6506b36ad07fc01f978df208c2c3fc742
parent7c04112418eaf26fec2220ad66cc081cefcc6c90 (diff)
parent0ea0cef5605297e86fc281e37e757257cae740d3 (diff)
Merge pull request #6878 from fritsch/imx-fixes
IMX: Several fixes screenshot, deint of progressive, minors
-rw-r--r--xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp39
-rw-r--r--xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.h1
-rw-r--r--xbmc/windowing/egl/EGLNativeTypeIMX.cpp2
3 files changed, 36 insertions, 6 deletions
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp
index dee1ad41c6..41f1d6a546 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp
@@ -33,6 +33,7 @@
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
+#include <algorithm>
#define IMX_VDI_MAX_WIDTH 968
#define FRAME_ALIGN 16
@@ -420,6 +421,7 @@ CDVDVideoCodecIMX::CDVDVideoCodecIMX()
m_convert_bitstream = false;
m_bytesToBeConsumed = 0;
m_previousPts = DVD_NOPTS_VALUE;
+ m_warnOnce = true;
#ifdef DUMP_STREAM
m_dump = NULL;
#endif
@@ -437,6 +439,11 @@ bool CDVDVideoCodecIMX::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
CLog::Log(LOGNOTICE, "iMX VPU : software decoding requested.\n");
return false;
}
+ else if (hints.width > 1920)
+ {
+ CLog::Log(LOGNOTICE, "iMX VPU : software decoding forced - video dimensions out of spec: %d %d.", hints.width, hints.height);
+ return false;
+ }
g_IMXContext.RequireConfiguration();
@@ -514,9 +521,9 @@ bool CDVDVideoCodecIMX::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
{
// Test for VPU unsupported profiles to revert to sw decoding
if ((m_hints.profile == 110) || //hi10p
- (m_hints.profile == 578)) //quite uncommon h264 profile
+ (m_hints.profile == 578 && m_hints.level == 30)) //quite uncommon h264 profile with Main 3.0
{
- CLog::Log(LOGNOTICE, "i.MX6 VPU is not able to decode AVC profile %d", m_hints.profile);
+ CLog::Log(LOGNOTICE, "i.MX6 VPU is not able to decode AVC profile %d level %d", m_hints.profile, m_hints.level);
return false;
}
m_decOpenParam.CodecFormat = VPU_V_AVC;
@@ -1079,8 +1086,21 @@ bool CDVDVideoCodecIMX::GetPicture(DVDVideoPicture* pDvdVideoPicture)
else
pDvdVideoPicture->iFlags &= ~DVP_FLAG_INTERLACED;
- if (m_currentBuffer->GetFieldType() != VPU_FIELD_BOTTOM && m_currentBuffer->GetFieldType() != VPU_FIELD_BT)
- pDvdVideoPicture->iFlags |= DVP_FLAG_TOP_FIELD_FIRST;
+ // do a sanity check to not deinterlace progressive content
+ if ((pDvdVideoPicture->iFlags & DVP_FLAG_INTERLACED) && (m_currentBuffer->GetFieldType() == VPU_FIELD_NONE))
+ {
+ if (m_warnOnce)
+ {
+ m_warnOnce = false;
+ CLog::Log(LOGWARNING, "Interlaced content reported by VPU, but full frames detected - Please turn off deinterlacing manually.");
+ }
+ }
+
+ if (pDvdVideoPicture->iFlags & DVP_FLAG_INTERLACED)
+ {
+ if (m_currentBuffer->GetFieldType() != VPU_FIELD_BOTTOM && m_currentBuffer->GetFieldType() != VPU_FIELD_BT)
+ pDvdVideoPicture->iFlags |= DVP_FLAG_TOP_FIELD_FIRST;
+ }
else
pDvdVideoPicture->iFlags &= ~DVP_FLAG_TOP_FIELD_FIRST;
@@ -1278,6 +1298,7 @@ CIMXContext::CIMXContext()
, m_fbVirtAddr(NULL)
, m_ipuHandle(0)
, m_vsync(true)
+ , m_deInterlacing(false)
, m_pageCrops(NULL)
, m_g2dHandle(NULL)
, m_bufferCapture(NULL)
@@ -1637,8 +1658,16 @@ void CIMXContext::CaptureDisplay(unsigned char *buffer, int iWidth, int iHeight)
}
unsigned char *display = m_fbVirtAddr + m_fbCurrentPage*m_fbPageSize;
- if (m_fbVar.nonstd != _4CC('R', 'G', 'B', '4'))
+ if (m_fbVar.nonstd == _4CC('R', 'G', 'B', '4'))
+ {
memcpy(buffer, display, iWidth * iHeight * 4);
+ // BGRA is needed RGBA we get
+ unsigned int size = iWidth * iHeight * 4;
+ for (unsigned int i = 0; i < size; i += 4)
+ {
+ std::swap(buffer[i], buffer[i + 2]);
+ }
+ }
else //_4CC('U', 'Y', 'V', 'Y')))
{
int r,g,b,a;
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.h
index e414454b45..8a39dd8e91 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.h
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.h
@@ -341,6 +341,7 @@ protected:
int m_bytesToBeConsumed; // Remaining bytes in VPU
double m_previousPts; // Enable to keep pts when needed
bool m_frameReported; // State whether the frame consumed event will be reported by libfslvpu
+ bool m_warnOnce; // Track warning messages to only warn once
#ifdef DUMP_STREAM
FILE *m_dump;
#endif
diff --git a/xbmc/windowing/egl/EGLNativeTypeIMX.cpp b/xbmc/windowing/egl/EGLNativeTypeIMX.cpp
index c6eed8dc47..6ab42b1958 100644
--- a/xbmc/windowing/egl/EGLNativeTypeIMX.cpp
+++ b/xbmc/windowing/egl/EGLNativeTypeIMX.cpp
@@ -53,7 +53,7 @@ CEGLNativeTypeIMX::~CEGLNativeTypeIMX()
bool CEGLNativeTypeIMX::CheckCompatibility()
{
std::ifstream file("/sys/class/graphics/fb0/fsl_disp_dev_property");
- return file;
+ return file.is_open();
}
void CEGLNativeTypeIMX::Initialize()