Skip to content

Commit

Permalink
Merge pull request xbmc#3 from FernetMenta/merge
Browse files Browse the repository at this point in the history
Merge mainline
  • Loading branch information
FernetMenta committed Nov 6, 2016
2 parents 36df041 + 5a81df7 commit 0d5ee4d
Show file tree
Hide file tree
Showing 22 changed files with 226 additions and 75 deletions.
2 changes: 1 addition & 1 deletion addons/resource.language.en_gb/resources/strings.po
Expand Up @@ -6020,7 +6020,7 @@ msgstr ""
#: xbmc/windows/GUIWindowSystemInfo.cpp
#: addons/skin.estuary/1080i/SettingsSystemInfo.xml
msgctxt "#13271"
msgid "CPU usage:"
msgid "System CPU usage:"
msgstr ""

#empty strings from id 13272 to 13273
Expand Down
Expand Up @@ -179,7 +179,7 @@ msgstr ""
#empty strings from id 31304 to 31308

msgctxt "#31309"
msgid "Memory Used:"
msgid "System Memory Used:"
msgstr ""

#empty strings from id 31310 to 31319
Expand Down
Expand Up @@ -171,7 +171,7 @@ msgstr ""

#: /1080i/SettingsSystemInfo.xml
msgctxt "#31030"
msgid "Memory used"
msgid "System memory used"
msgstr ""

#: /1080i/SettingsSystemInfo.xml
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -240,7 +240,7 @@ AC_ARG_WITH([platform],

AC_ARG_ENABLE([optimizations],
[AS_HELP_STRING([--enable-optimizations],
[enable optimization (default is yes)])],
[enable passing -O2 to CFLAGS (default is yes)])],
[use_optimizations=$enableval],
[use_optimizations=yes])

Expand Down
2 changes: 1 addition & 1 deletion project/Win32BuildSetup/AppxManifest.xml.in
Expand Up @@ -8,7 +8,7 @@
<Logo>media\icon256x256.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.351" MaxVersionTested="10.0.14393.351"/>
<PackageDependency Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Name="Microsoft.VCLibs.140.00.UWPDesktop" MinVersion="14.0.23810.0"/>
</Dependencies>
<Resources>
Expand Down
8 changes: 2 additions & 6 deletions project/cmake/addons/CMakeLists.txt
Expand Up @@ -254,9 +254,7 @@ foreach(addon ${addons})

if(${platform_found})
# make sure the output directory is clean
if(EXISTS "${CMAKE_INSTALL_PREFIX}/${id}")
file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/${id}/")
endif()
file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/${id}/")

# get the URL and revision of the addon
list(LENGTH def deflength)
Expand Down Expand Up @@ -334,9 +332,7 @@ foreach(addon ${addons})
endif()

# remove any previously extracted version of the addon
if(EXISTS "${BUILD_DIR}/${id}")
file(REMOVE_RECURSE "${BUILD_DIR}/${id}")
endif()
file(REMOVE_RECURSE "${BUILD_DIR}/${id}")

# extract the addon from the archive
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${BUILD_DIR}/download/${archive_name}.tar.gz
Expand Down
39 changes: 16 additions & 23 deletions project/cmake/scripts/common/CheckTargetPlatform.cmake
Expand Up @@ -43,28 +43,21 @@ function(check_install_permissions install_dir have_perms)
# param[in] install_dir directory to check for write permissions
# param[out] have_perms wether we have permissions to install to install_dir

set(${have_perms} TRUE)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${install_dir}/lib/kodi
COMMAND ${CMAKE_COMMAND} -E make_directory ${install_dir}/share/kodi
COMMAND ${CMAKE_COMMAND} -E touch ${install_dir}/lib/kodi/.cmake-inst-test
COMMAND ${CMAKE_COMMAND} -E touch ${install_dir}/share/kodi/.cmake-inst-test
RESULT_VARIABLE permtest
OUTPUT_VARIABLE output
ERROR_VARIABLE output
)

message(STATUS "============ DEBUG ADDON PACKAGING ======")
message(STATUS "check_install_permissions ${install_dir}: ${permtest}")
message(STATUS "${output}")
execute_process(COMMAND find ${install_dir})
execute_process(COMMAND ls -laR ${install_dir})

if(${permtest} GREATER 0)
set(${have_perms} FALSE)
endif()
set(${have_perms} "${${have_perms}}" PARENT_SCOPE)

if(EXISTS ${install_dir}/lib/kodi/.cmake-inst-test OR EXISTS ${install_dir}/share/kodi/.cmake-inst-test)
file(REMOVE ${install_dir}/lib/kodi/.cmake-inst-test ${install_dir}/share/kodi/.cmake-inst-test)
set(testfile_lib ${install_dir}/lib/kodi/.cmake-inst-test)
set(testfile_share ${install_dir}/share/kodi/.cmake-inst-test)
get_filename_component(testdir_lib ${testfile_lib} DIRECTORY)
get_filename_component(testdir_share ${testfile_share} DIRECTORY)

execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${testdir_lib})
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${testdir_share})
execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${testfile_lib})
execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${testfile_share})

if(EXISTS ${testfile_lib} AND EXISTS ${testfile_share})
set(${have_perms} True PARENT_SCOPE)
else()
message(STATUS "check_install_permissions ${install_dir}: failed to create files")
set(${have_perms} False PARENT_SCOPE)
endif()
file(REMOVE ${testfile_lib} ${testfile_share})
endfunction()
4 changes: 1 addition & 3 deletions project/cmake/scripts/common/HandleDepends.cmake
Expand Up @@ -78,9 +78,7 @@ function(add_addon_depends addon searchpath)

# prepare patchfile. ensure we have a clean file after reconfiguring
set(PATCH_FILE ${BUILD_DIR}/${id}/tmp/patch.cmake)
if(EXISTS ${PATCH_FILE})
file(REMOVE ${PATCH_FILE})
endif()
file(REMOVE ${PATCH_FILE})

# if there's a CMakeLists.txt use it to prepare the build
if(EXISTS ${dir}/CMakeLists.txt)
Expand Down
1 change: 1 addition & 0 deletions tools/depends/target/alsa-lib/Makefile
Expand Up @@ -39,6 +39,7 @@ ifeq ($(OS),android)
cd $(PLATFORM); patch -p0 < ../removeshm-3.patch
cd $(PLATFORM); patch -p0 < ../timeval.patch
endif
cd $(PLATFORM); patch -p0 < ../host-os.patch
cd $(PLATFORM); $(CONFIGURE)

$(LIBDYLIB): $(PLATFORM)
Expand Down
11 changes: 11 additions & 0 deletions tools/depends/target/alsa-lib/host-os.patch
@@ -0,0 +1,11 @@
--- configure.in 2010-04-16 12:11:05.000000000 +0100
+++ configure.in 2016-11-01 15:15:21.645908396 +0000
@@ -31,7 +31,7 @@

which ${program_prefix}gcc >/dev/null 2>&1 && CC=${program_prefix}gcc
which ${host_cpu}-${host_os}-gcc >/dev/null 2>&1 \
- && CC=${host_cpu}-${host-os}-gcc
+ && CC=${host_cpu}-${host_os}-gcc
which ${host_cpu}-${host_vendor}-${host_os}-gcc >/dev/null 2>&1 \
&& CC=${host_cpu}-${host_vendor}-${host_os}-gcc

Expand Up @@ -243,7 +243,7 @@ enum AVPixelFormat CDVDVideoCodecFFmpeg::GetFormat(struct AVCodecContext * avctx
#ifdef HAS_MMAL
if (*cur == AV_PIX_FMT_YUV420P)
{
MMAL::CDecoder* dec = new MMAL::CDecoder(ctx->m_processInfo);
MMAL::CDecoder* dec = new MMAL::CDecoder(ctx->m_processInfo, ctx->m_hints);
if(dec->Open(avctx, ctx->m_pCodecContext, *cur, ctx->m_uSurfacesCount))
{
ctx->m_processInfo.SetVideoPixelFormat(pixFmtName ? pixFmtName : "");
Expand Down
12 changes: 7 additions & 5 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
Expand Up @@ -53,9 +53,10 @@ using namespace KODI::MESSAGING;

#define VERBOSE 0

void CMMALBuffer::SetVideoDeintMethod(std::string method) { if (m_pool) m_pool->SetVideoDeintMethod(method); }

CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv, std::shared_ptr<CMMALPool> pool)
: m_omv(omv), m_pool(pool)
: CMMALBuffer(pool), m_omv(omv)
{
if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO))
CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this);
Expand All @@ -67,6 +68,7 @@ CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv, std::shared_ptr<CMMALPool> p
m_encoding = MMAL_ENCODING_UNKNOWN;
m_aspect_ratio = 0.0f;
m_rendered = false;
m_stills = false;
}

CMMALVideoBuffer::~CMMALVideoBuffer()
Expand Down Expand Up @@ -254,8 +256,6 @@ void CMMALVideo::dec_output_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf
omvb->m_aligned_width = m_decoded_aligned_width;
omvb->m_aligned_height = m_decoded_aligned_height;
omvb->m_aspect_ratio = m_aspect_ratio;
if (m_hints.stills) // disable interlace in dvd stills mode
omvb->mmal_buffer->flags &= ~MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED;
omvb->m_encoding = m_dec_output->format->encoding;
{
CSingleLock lock(m_output_mutex);
Expand Down Expand Up @@ -368,8 +368,6 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
if (!CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMMAL) || hints.software)
return false;

m_processInfo.SetVideoDeintMethod("none");

std::list<EINTERLACEMETHOD> deintMethods;
deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_AUTO);
deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_MMAL_ADVANCED);
Expand Down Expand Up @@ -469,6 +467,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
return false;
}
m_pool->SetDecoder(this);
m_pool->SetProcessInfo(&m_processInfo);
m_dec = m_pool->GetComponent();

m_dec->control->userdata = (struct MMAL_PORT_USERDATA_T *)this;
Expand Down Expand Up @@ -585,6 +584,8 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
m_speed = DVD_PLAYSPEED_NORMAL;

m_processInfo.SetVideoDecoderName(m_pFormatName, true);
m_processInfo.SetVideoDimensions(m_decoded_width, m_decoded_height);
m_processInfo.SetVideoDAR(m_aspect_ratio);

return true;
}
Expand Down Expand Up @@ -826,6 +827,7 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture)
pDvdVideoPicture->iFlags, buffer->mmal_buffer->flags, pDvdVideoPicture->MMALBuffer, pDvdVideoPicture->MMALBuffer->mmal_buffer);
assert(!(buffer->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_DECODEONLY));
buffer->mmal_buffer->flags &= ~MMAL_BUFFER_HEADER_FLAG_USER3;
buffer->m_stills = m_hints.stills;
}
else
{
Expand Down
13 changes: 8 additions & 5 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h
Expand Up @@ -45,10 +45,15 @@

enum MMALState { MMALStateNone, MMALStateHWDec, MMALStateFFDec, MMALStateDeint, };

class CMMALVideo;
class CMMALRenderer;
class CMMALPool;

// a mmal video frame
class CMMALBuffer : public IDVDResourceCounted<CMMALBuffer>
{
public:
CMMALBuffer(std::shared_ptr<CMMALPool> pool) : m_pool(pool) {}
virtual ~CMMALBuffer() {}
MMAL_BUFFER_HEADER_T *mmal_buffer;
unsigned int m_width;
Expand All @@ -59,6 +64,9 @@ class CMMALBuffer : public IDVDResourceCounted<CMMALBuffer>
float m_aspect_ratio;
MMALState m_state;
bool m_rendered;
bool m_stills;
std::shared_ptr<CMMALPool> m_pool;
void SetVideoDeintMethod(std::string method);
const char *GetStateName() {
static const char *names[] = { "MMALStateNone", "MMALStateHWDec", "MMALStateFFDec", "MMALStateDeint", };
if ((size_t)m_state < vcos_countof(names))
Expand All @@ -68,10 +76,6 @@ class CMMALBuffer : public IDVDResourceCounted<CMMALBuffer>
}
};

class CMMALVideo;
class CMMALRenderer;
class CMMALPool;

// a mmal video frame
class CMMALVideoBuffer : public CMMALBuffer
{
Expand All @@ -80,7 +84,6 @@ class CMMALVideoBuffer : public CMMALBuffer
virtual ~CMMALVideoBuffer();
CMMALVideo *m_omv;
protected:
std::shared_ptr<CMMALPool> m_pool;
};

class CMMALVideo : public CDVDVideoCodec
Expand Down
10 changes: 7 additions & 3 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp
Expand Up @@ -42,8 +42,8 @@ using namespace MMAL;

#define CLASSNAME "CMMALYUVBuffer"

CMMALYUVBuffer::CMMALYUVBuffer(std::shared_ptr<CMMALPool> pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size)
: m_pool(pool)
CMMALYUVBuffer::CMMALYUVBuffer(CDecoder *omv, std::shared_ptr<CMMALPool> pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size)
: CMMALBuffer(pool), m_omv(omv)
{
uint32_t size_pic = 0;
m_width = width;
Expand All @@ -54,6 +54,7 @@ CMMALYUVBuffer::CMMALYUVBuffer(std::shared_ptr<CMMALPool> pool, uint32_t mmal_en
m_aspect_ratio = 0.0f;
mmal_buffer = nullptr;
m_rendered = false;
m_stills = false;
if (m_encoding == MMAL_ENCODING_I420)
size_pic = (m_aligned_width * m_aligned_height * 3) >> 1;
else if (m_encoding == MMAL_ENCODING_YUVUV128)
Expand Down Expand Up @@ -93,7 +94,7 @@ CMMALYUVBuffer::~CMMALYUVBuffer()
#undef CLASSNAME
#define CLASSNAME "CDecoder"

CDecoder::CDecoder(CProcessInfo &processInfo) : m_processInfo(processInfo)
CDecoder::CDecoder(CProcessInfo &processInfo, CDVDStreamInfo &hints) : m_processInfo(processInfo), m_hints(hints)
{
if (g_advancedSettings.CanLogComponent(LOGVIDEO))
CLog::Log(LOGDEBUG, "%s::%s - create %p", CLASSNAME, __FUNCTION__, this);
Expand Down Expand Up @@ -243,6 +244,8 @@ bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixel
CLog::Log(LOGERROR, "%s::%s Failed to create pool for decoder output", CLASSNAME, __func__);
return false;
}
m_pool->SetDecoder(this);
m_pool->SetProcessInfo(&m_processInfo);

std::list<EINTERLACEMETHOD> deintMethods;
deintMethods.push_back(EINTERLACEMETHOD::VS_INTERLACEMETHOD_AUTO);
Expand Down Expand Up @@ -289,6 +292,7 @@ bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture
assert(picture->MMALBuffer->mmal_buffer);
picture->MMALBuffer->mmal_buffer->data = (uint8_t *)gmem->m_vc_handle;
picture->MMALBuffer->mmal_buffer->alloc_size = picture->MMALBuffer->mmal_buffer->length = gmem->m_numbytes;
picture->MMALBuffer->m_stills = m_hints.stills;

// need to flush ARM cache so GPU can see it
gmem->Flush();
Expand Down
7 changes: 4 additions & 3 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h
Expand Up @@ -40,19 +40,19 @@ class CGPUPool;
class CMMALYUVBuffer : public CMMALBuffer
{
public:
CMMALYUVBuffer(std::shared_ptr<CMMALPool> pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size);
CMMALYUVBuffer(CDecoder *dec, std::shared_ptr<CMMALPool> pool, uint32_t mmal_encoding, uint32_t width, uint32_t height, uint32_t aligned_width, uint32_t aligned_height, uint32_t size);
virtual ~CMMALYUVBuffer();

CGPUMEM *gmem;
CDecoder *m_omv;
private:
std::shared_ptr<CMMALPool> m_pool;
};

class CDecoder
: public CDVDVideoCodecFFmpeg::IHardwareDecoder
{
public:
CDecoder(CProcessInfo& processInfo);
CDecoder(CProcessInfo& processInfo, CDVDStreamInfo &hints);
virtual ~CDecoder();
virtual bool Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum AVPixelFormat, unsigned int surfaces);
virtual int Decode(AVCodecContext* avctx, AVFrame* frame);
Expand All @@ -73,6 +73,7 @@ class CDecoder
CCriticalSection m_section;
std::shared_ptr<CMMALPool> m_pool;
enum AVPixelFormat m_fmt;
CDVDStreamInfo m_hints;
};

};

0 comments on commit 0d5ee4d

Please sign in to comment.