The branch, xbmc-buildroot has been created
at bd02dec5f7f4be609e8a7504713c4a28c7540f46 (commit)
- Log -----------------------------------------------------------------
https://github.com/xbmc/xbmc/commit/bd02dec5f7f4be609e8a7504713c4a28c7540f46
commit bd02dec5f7f4be609e8a7504713c4a28c7540f46
Author: theuni <theuni-nospam-@...>
Date: Mon Feb 27 15:01:01 2012 -0500
[smp] revert unrelated part of the last commit.
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index b656c90..9f8a747 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -74,12 +74,6 @@ CSMPPlayer::CSMPPlayer(IPlayerCallback &callback)
m_StopPlaying = false;
m_subtitle_params = (SLPBCmd_SubsParameters*)calloc(1, sizeof(SLPBCmd_SubsParameters));
- CStdString test;
- std::vector<unsigned int> caps;
- for(unsigned int i = 0; i < caps.size(); i++)
- {
- test.AppendFormat("%i,",caps[i]);
- }
}
CSMPPlayer::~CSMPPlayer()
https://github.com/xbmc/xbmc/commit/00766a9eda271c8a429ba52b7dabd6f1ce65ae55
commit 00766a9eda271c8a429ba52b7dabd6f1ce65ae55
Author: theuni <theuni-nospam-@...>
Date: Mon Feb 27 14:02:04 2012 -0500
[smp] Final cleanup of out-of-tree makefile.
- Pull as much from buildroot as possible.
- Split build targets
- Don't export where it's not necessary
- Fail if BUILDROOT isn't properly set
diff --git a/tools/sigma/Makefile b/tools/sigma/Makefile
index 9b0f044..7a1d30a 100644
--- a/tools/sigma/Makefile
+++ b/tools/sigma/Makefile
@@ -1,21 +1,20 @@
include sigma-buildroot-sdk.mk
-SOURCE=../../
-# configuration settings
-export PYTHON_VERSION=2.7
-export PYTHON_LDFLAGS=-L$(BUILDPREFIX)/lib -lpython$(PYTHON_VERSION) -lpthread -ldl -lutil -lm
-export PYTHON_CPPFLAGS=-I$(BUILDPREFIX)/include/python$(PYTHON_VERSION)
-export PYTHON_SITE_PKG=$(BUILDPREFIX)/lib/python$(PYTHON_VERSION)/site-packages
-export PYTHON_NOVERSIONCHECK=no-check
+SOURCE=../..
-CONFIGURE=./configure --build=$(BUILD) --host=$(HOST) --prefix=/usr \
- --enable-gles --disable-optical-drive --disable-dvdcss --enable-optimizations \
- --disable-x11 --disable-libbluray --disable-sdl --enable-directfb --disable-ffmpeg \
- --disable-dvdread --disable-non-free
-all: configure
+all: $(SOURCE)/xbmc.bin
-configure:
+$(SOURCE)/xbmc.bin: $(SOURCE)/Makefile
+ cd $(SOURCE); make -j$(BR2_JLEVEL)
+
+$(SOURCE)/Makefile: $(SOURCE)/configure
+ cd $(SOURCE); $(XBMC_CONF_ENV) ./configure --build=$(BUILD) --host=$(HOST) --prefix=/usr $(XBMC_CONF_OPT)
+
+$(SOURCE)/configure: $(BUILDROOT)/package/multimedia/xbmc/xbmc.mk $(CROSSBIN)gcc
cd $(SOURCE); ./bootstrap
- cd $(SOURCE); $(CONFIGURE)
- cd $(SOURCE); make -j8
- #cd $(SOURCE); make install
+
+$(CROSSBIN)gcc:
+ $(error $(CROSSBIN)gcc does not exist. Have you built Buildroot?)
+
+$(BUILDROOT)/package/multimedia/xbmc/xbmc.mk:
+ $(error BUILDROOT must be defined in sigma-buildroot-sdk.mk)
diff --git a/tools/sigma/sigma-buildroot-sdk.mk b/tools/sigma/sigma-buildroot-sdk.mk
index 0bd2820..623b03c 100644
--- a/tools/sigma/sigma-buildroot-sdk.mk
+++ b/tools/sigma/sigma-buildroot-sdk.mk
@@ -1,23 +1,30 @@
#Specify path to buildroot here
BUILDROOT=
-export XBMCSTAGE=$(BUILDROOT)/output/staging
-export SYSROOT=$(BUILDROOT)/output/host/usr/mipsel-unknown-linux-gnu/sysroot
-export BUILD=$(shell uname -m)-unknown-linux-gnu
-export BUILDPREFIX=$(XBMCSTAGE)/usr
+qstrip=$(strip $(subst ",,$(1)))#"))
+BASE_DIR=$(BUILDROOT)/output
+-include $(BUILDROOT)/.config
+
+HOST=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
+TUNE=$(call qstrip,$(BR2_GCC_TARGET_TUNE))
+BUILD=$(shell uname -m)-unknown-linux-gnu
+TOOLCHAIN=$(BASE_DIR)/external-toolchain/bin
+CROSSBIN=$(TOOLCHAIN)/$(HOST)-
+STAGING_DIR=$(BASE_DIR)/staging
+TARGET_PATH:=$(TOOLCHAIN):$(BR2_HOST_DIR)/usr/bin:$(PATH)
+
export CFLAGS=
export CXXFLAGS=${CFLAGS}
export CPPFLAGS=${CFLAGS}
export LDFLAGS=-Wl,--unresolved-symbols=ignore-in-shared-libs
-export CROSSBIN=$(BUILDROOT)/output/external-toolchain/bin/mips-linux-gnu-
-export CC=${CROSSBIN}gcc -EL --sysroot=$(SYSROOT) -march=mips32r2 -mtune=24kf
-export CXX=${CROSSBIN}g++ -EL --sysroot=$(SYSROOT) -march=mips32r2 -mtune=24kf
-export LD=${CROSSBIN}ld -EL --sysroot=$(SYSROOT)
+export CC=${CROSSBIN}gcc -EL --sysroot=$(STAGING_DIR) -mtune=$(TUNE)
+export CXX=${CROSSBIN}g++ -EL --sysroot=$(STAGING_DIR) -mtune=$(TUNE)
+export LD=${CROSSBIN}ld -EL --sysroot=$(STAGING_DIR)
export AR=${CROSSBIN}ar
export RANLIB=${CROSSBIN}ranlib
export STRIP=${CROSSBIN}strip
export OBJDUMP=${CROSSBIN}objdump
-export HOST=mips-linux-gnu
export CXXCPP=${CXX} -E
-export PATH:=$(SYSROOT)/usr/bin:$(PATH)
-export PATH:=$(BUILDROOT)/output/external-toolchain/bin:$(BUILDROOT)/output/host/usr/bin:$(PATH)
+
+-include $(BUILDROOT)/package/python/python.mk
+-include $(BUILDROOT)/package/multimedia/xbmc/xbmc.mk
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 9f8a747..b656c90 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -74,6 +74,12 @@ CSMPPlayer::CSMPPlayer(IPlayerCallback &callback)
m_StopPlaying = false;
m_subtitle_params = (SLPBCmd_SubsParameters*)calloc(1, sizeof(SLPBCmd_SubsParameters));
+ CStdString test;
+ std::vector<unsigned int> caps;
+ for(unsigned int i = 0; i < caps.size(); i++)
+ {
+ test.AppendFormat("%i,",caps[i]);
+ }
}
CSMPPlayer::~CSMPPlayer()
https://github.com/xbmc/xbmc/commit/e5fd6914e773b223c9bc3d3d8f10f824f002621c
commit e5fd6914e773b223c9bc3d3d8f10f824f002621c
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 24 13:41:21 2012 -0500
[smp] Hack: Ignore requested player from plugin
diff --git a/xbmc/interfaces/python/xbmcmodule/player.cpp b/xbmc/interfaces/python/xbmcmodule/player.cpp
index e71d00a..f38c438 100644
--- a/xbmc/interfaces/python/xbmcmodule/player.cpp
+++ b/xbmc/interfaces/python/xbmcmodule/player.cpp
@@ -64,12 +64,14 @@ namespace PYXBMC
self->pPlayer->SetCallback(PyThreadState_Get(), (PyObject*)self);
self->playerCore = EPC_NONE;
+#if !defined(HAS_SIGMASMP)
if (playerCore == EPC_DVDPLAYER ||
playerCore == EPC_MPLAYER ||
playerCore == EPC_PAPLAYER)
{
self->playerCore = (EPLAYERCORES)playerCore;
}
+#endif
return (PyObject*)self;
}
https://github.com/xbmc/xbmc/commit/ce4992831bf2f06ccbeb1a52fe5721125cc36418
commit ce4992831bf2f06ccbeb1a52fe5721125cc36418
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 24 13:05:41 2012 -0500
[smp] Sigma can't use vis, so don't build them
diff --git a/Makefile.in b/Makefile.in
index 7713c4b..370bfa7 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -149,8 +149,10 @@ ifneq (@DISABLE_RSXS@...)
SS_DIRS+= xbmc/screensavers/rsxs-0.9/xbmc
endif
+ifneq (@USE_DIRECTFB@...)
VIS_DIRS=xbmc/visualizations/OpenGLSpectrum \
xbmc/visualizations/WaveForm
+endif
ifneq (@DISABLE_PROJECTM@...)
VIS_DIRS+= xbmc/visualizations/XBMCProjectM
https://github.com/xbmc/xbmc/commit/2e2c37ff512dc8be6fd7a04bf47a74ff8be0dcde
commit 2e2c37ff512dc8be6fd7a04bf47a74ff8be0dcde
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 24 12:59:46 2012 -0500
[smp] fix typo that broke build
diff --git a/xbmc/cores/paplayer/Makefile.in b/xbmc/cores/paplayer/Makefile.in
index fe6c67b..3b1d851 100644
--- a/xbmc/cores/paplayer/Makefile.in
+++ b/xbmc/cores/paplayer/Makefile.in
@@ -24,7 +24,7 @@ SRCS=ADPCMCodec.cpp \
YMCodec.cpp \
ifeq (@USE_LIBMAD@...)
- SRCS+=MP3codec \
+ SRCS+=MP3codec.cpp \
endif
ifeq (@USE_ASAP_CODEC@...)
https://github.com/xbmc/xbmc/commit/21cc9390bcf8804382359038d638294b02b769d7
commit 21cc9390bcf8804382359038d638294b02b769d7
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 24 01:08:13 2012 -0500
[smp] specify more folders to avoid during export
diff --git a/.gitattributes b/.gitattributes
index 4bf7075..4df0add 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,23 @@
lib/ffmpeg export-ignore
+lib/libdvd export-ignore
+addons/visualization.glspectrum export-ignore
+addons/visualization.waveform export-ignore
+lib/enca export-ignore
+lib/ffmpeg export-ignore
+lib/freetype export-ignore
+lib/libass export-ignore
+lib/libbluray export-ignore
+lib/libdvd export-ignore
+lib/liblame export-ignore
+lib/libmad export-ignore
+lib/libmicrohttpd export-ignore
+lib/libmodplug export-ignore
+lib/libmpeg2 export-ignore
+lib/librtmp export-ignore
+lib/UnrarXLib export-ignore
+lib/win32 export-ignore
+tools/arm export-ignore
+tools/buildbot export-ignore
+tools/darwin export-ignore
+tools/Translator export-ignore
+tools/win32buildtools export-ignore
https://github.com/xbmc/xbmc/commit/7892872fe7e5fe65f2f7c3b56926ee69f9efb231
commit 7892872fe7e5fe65f2f7c3b56926ee69f9efb231
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 24 00:55:51 2012 -0500
[smp] disable rar support
diff --git a/tools/sigma/Makefile b/tools/sigma/Makefile
index 5f700e4..9b0f044 100644
--- a/tools/sigma/Makefile
+++ b/tools/sigma/Makefile
@@ -11,7 +11,7 @@ export PYTHON_NOVERSIONCHECK=no-check
CONFIGURE=./configure --build=$(BUILD) --host=$(HOST) --prefix=/usr \
--enable-gles --disable-optical-drive --disable-dvdcss --enable-optimizations \
--disable-x11 --disable-libbluray --disable-sdl --enable-directfb --disable-ffmpeg \
- --disable-dvdread
+ --disable-dvdread --disable-non-free
all: configure
configure:
https://github.com/xbmc/xbmc/commit/10ab89687db8886abe222c0b9d907b0a175a05b4
commit 10ab89687db8886abe222c0b9d907b0a175a05b4
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 24 00:36:24 2012 -0500
[smp] don't bootstrap what doesn't exist. this does not go upstream.
diff --git a/bootstrap b/bootstrap
index fb16f95..3fc5c9c 100755
--- a/bootstrap
+++ b/bootstrap
@@ -4,15 +4,8 @@ set -e
autoreconf -vif
autoreconf -vif lib/libid3tag/libid3tag
-autoreconf -vif xbmc/screensavers/rsxs-0.9
-autoreconf -vif xbmc/visualizations/Goom/goom2k4-0
autoreconf -vif lib/libapetag
autoreconf -vif lib/cpluff
-# order matters with libdvd and friends
-[ -d lib/libdvd/libdvdcss ] && \
- autoreconf -vif lib/libdvd/libdvdcss
-autoreconf -vif lib/libdvd/libdvdread
-autoreconf -vif lib/libdvd/libdvdnav
# Clean the generated files
find . -depth -type d -name "autom4te.cache" -exec rm -rf {} \;
https://github.com/xbmc/xbmc/commit/465b07f641ac67cc4f6610c4e1160191de3779dc
commit 465b07f641ac67cc4f6610c4e1160191de3779dc
Author: theuni <theuni-nospam-@...>
Date: Thu Feb 23 15:36:05 2012 -0500
[smp] fixup addons so that gl-only addons don't show in linux-gles
diff --git a/addons/screensaver.rsxs.euphoria/addon.xml b/addons/screensaver.rsxs.euphoria/addon.xml
index c1cae0f..e4b75b9 100644
--- a/addons/screensaver.rsxs.euphoria/addon.xml
+++ b/addons/screensaver.rsxs.euphoria/addon.xml
@@ -38,6 +38,6 @@
<description lang="ru">Это настолько психаделично, насколько такой может быть заставка. mogumbo думал, что его хранитель экрана Plasma был недосягаем, но этот ещё более тошнотворный. Лучше найдите себе гигиенический пакет, перед тем как вы будете слишком долго смотреть на этот хранитель экрана.</description>
<description lang="se">Det här är ungefär så psykedelisk skärmsläckare kan bli. mogumbo trodde hans plasma-skärmsläckare var toppen på skalan, men denna är till och med ännu mer kväljande. Du gör bäst i att leta upp en åksjukepåse innan du stirrar på denna för länge.</description>
<description lang="zh">这大概是最具迷幻效果的屏幕保护程序了。mogumbo以为他的Plasma屏保已经是数一数二了,但这个更令人作犯晕。如果你要长时间盯视它最好先准备一个晕机袋。</description>
- <platform>linux osx</platform>
+ <platform>linuxgl osx</platform>
</extension>
</addon>
diff --git a/addons/screensaver.rsxs.plasma/addon.xml b/addons/screensaver.rsxs.plasma/addon.xml
index 815522a..32e9f80 100644
--- a/addons/screensaver.rsxs.plasma/addon.xml
+++ b/addons/screensaver.rsxs.plasma/addon.xml
@@ -36,6 +36,6 @@
<description lang="pt">Provavelmente a segunda mais psicadélica protecção de ecrã de sempre. Experimente-a para ver todas as cores moverem-se livremente.</description>
<description lang="se">Förmodligen den näst psykedeliska skärmsläckaren som finns. Försök bara att uppfatta alla färger som rör sig runt och runt.</description>
<description lang="zh">也许是排名第二的迷幻效果屏幕保护程序。你将看到所有颜色满处乱飞。</description>
- <platform>linux osx</platform>
+ <platform>linuxgl osx</platform>
</extension>
</addon>
diff --git a/addons/screensaver.rsxs.solarwinds/addon.xml b/addons/screensaver.rsxs.solarwinds/addon.xml
index 88b6ab5..1e79009 100644
--- a/addons/screensaver.rsxs.solarwinds/addon.xml
+++ b/addons/screensaver.rsxs.solarwinds/addon.xml
@@ -38,6 +38,6 @@
<description lang="ru">Это - очень завораживающий хранитель экрана. Доступно огромное количество вариаций эффектов.</description>
<description lang="se">Detta är en mycket fascinerande partikeleffektsskärmsläckare. Du kommer att upptäcka att du kan uppnå ett otroligt antal olika mönster.</description>
<description lang="zh">这是一个非常迷人的粒子效果屏幕保护程序。你会发现你能看到惊人数量的不同图案。</description>
- <platform>linux osx</platform>
+ <platform>linuxgl osx</platform>
</extension>
</addon>
diff --git a/addons/visualization.glspectrum/addon.xml b/addons/visualization.glspectrum/addon.xml
index 856989d..f4fd726 100644
--- a/addons/visualization.glspectrum/addon.xml
+++ b/addons/visualization.glspectrum/addon.xml
@@ -48,6 +48,6 @@ Det har också inställningar för att justera spektrumhöjden, hastigheten och
<description lang="zh">Opengl Spectrum可视化效果是Opengl渲染的一个旋转的三维频谱分析图像,频谱矩阵随着音乐节拍而象波浪起伏。
你还可以设置频谱棒的高度、变换速度、以及呈现效果(固体、点、框架)。这是一个不错的轻量级,低CPU使用率的可视化效果。</description>
<disclaimer></disclaimer>
- <platform>linux osx ios</platform>
+ <platform>linuxgl linuxgles osx ios</platform>
</extension>
</addon>
diff --git a/addons/visualization.projectm/addon.xml b/addons/visualization.projectm/addon.xml
index a9ae857..5c093c6 100644
--- a/addons/visualization.projectm/addon.xml
+++ b/addons/visualization.projectm/addon.xml
@@ -60,6 +60,6 @@ Alla projectM kräver ett grafikkort med 3D-acceleration och din favoritmusik.</
<description lang="zh">projectM是一个音乐可视化效果。它是Unix世界中最好的。它的伟大来自于社区的辛苦工作。使用者可以创建预设参数把音乐和难以置信的可视化效果连接起来。试试吧!
projectM可视化效果是用OpenGL按照LGPL协议对Milkdrop的重新实现
projectM所要求的仅是一块有3D加速功能的显卡和你喜爱的音乐。</description>
- <platform>linux osx wingl</platform>
+ <platform>linuxgl osx wingl</platform>
</extension>
</addon>
diff --git a/xbmc/addons/AddonManager.cpp b/xbmc/addons/AddonManager.cpp
index 4a61c7e..4fa796e 100644
--- a/xbmc/addons/AddonManager.cpp
+++ b/xbmc/addons/AddonManager.cpp
@@ -581,8 +581,10 @@ bool CAddonMgr::PlatformSupportsAddon(const cp_plugin_info_t *plugin) const
{
if (platforms[i] == "all")
return true;
-#if defined(_LINUX) && !defined(__APPLE__)
- if (platforms[i] == "linux")
+#if defined(_LINUX) && !defined(__APPLE__) && !defined(HAS_GLES)
+ if (platforms[i] == "linuxgl")
+#elif defined(_LINUX) && !defined(__APPLE__) && defined(HAS_GLES)
+ if (platforms[i] == "linuxgles")
#elif defined(_WIN32) && defined(HAS_SDL_OPENGL)
if (platforms[i] == "wingl")
#elif defined(_WIN32) && defined(HAS_DX)
diff --git a/xbmc/visualizations/Goom/visualization.goom/addon.xml b/xbmc/visualizations/Goom/visualization.goom/addon.xml
index 4e6d20a..3932175 100644
--- a/xbmc/visualizations/Goom/visualization.goom/addon.xml
+++ b/xbmc/visualizations/Goom/visualization.goom/addon.xml
@@ -10,6 +10,6 @@
<extension point="xbmc.addon.metadata">
<summary lang="en">Goom 2k4 Visualization</summary>
<description lang="en">The Goom 2k4 visualization supports effects like Tentacles, Flash, Stars, Fireworks, Waves, Blurs and Glows and includes a large number of trippy hypnotic effects that dance, swirl and pop with the music</description>
- <platform>linux</platform>
+ <platform>linuxgl</platform>
</extension>
</addon>
https://github.com/xbmc/xbmc/commit/52bedd5f7e3d4bfb84e280bdeb821b49cd3f6079
commit 52bedd5f7e3d4bfb84e280bdeb821b49cd3f6079
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 24 01:07:28 2012 -0500
[smp] allow building without libdvd* support
diff --git a/Makefile.in b/Makefile.in
index 122af68..7713c4b 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -5,9 +5,12 @@ EC_DIRS= \
XBMCTEX_DIRS= \
tools/TexturePacker
-DVDPCODECS_DIRS= \
- lib \
- lib/libdvd
+DVDPCODECS_DIRS= lib \
+
+ifeq (@USE_DVDREAD@...)
+DVDPCODECS_DIRS+= lib/libdvd \
+
+endif
DVDPLAYER_ARCHIVES=xbmc/cores/dvdplayer/DVDPlayer.a \
xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.a \
@@ -258,7 +261,9 @@ libpython: dllloader
$(MAKE) -C xbmc/interfaces/python/xbmcmodule
dvdpcodecs: dllloader
$(MAKE) -C lib
+ifeq (@USE_DVDREAD@...)
$(MAKE) -C lib/libdvd
+endif
eventclients:
ifeq ($(findstring osx,@ARCH@), osx)
ifneq ($(findstring arm,@ARCH@), arm)
diff --git a/configure.in b/configure.in
index 2eb5ad9..713d4fb 100755
--- a/configure.in
+++ b/configure.in
@@ -88,6 +88,8 @@ directfb_disabled="== directfb disabled. =="
windowing_error="Could not enable directfb and X11 support simultaneously. Please disable one."
pulse_not_found="== Could not find libpulse. PulseAudio support disabled. =="
pulse_disabled="== PulseAudio support manually disabled. =="
+dvdread_enabled="== DVD Playback support enabled. =="
+dvdread_disabled="== DVD Playback support disabled. =="
dvdcss_enabled="== DVDCSS support enabled. =="
dvdcss_disabled="== DVDCSS support disabled. =="
hal_not_found="== Could not find hal. HAL support disabled. =="
@@ -341,6 +343,12 @@ AC_ARG_ENABLE([ffmpeg_libvorbis],
[use_ffmpeg_libvorbis=$enableval],
[use_ffmpeg_libvorbis=no])
+AC_ARG_ENABLE([dvdread],
+ [AS_HELP_STRING([--enable-dvdread],
+ [enable dvd image playback (default is yes)])],
+ [use_dvdread=$enableval],
+ [use_dvdread=yes])
+
AC_ARG_ENABLE([dvdcss],
[AS_HELP_STRING([--enable-dvdcss],
[enable DVDCSS support (default is yes)])],
@@ -1797,8 +1805,20 @@ else
final_message="$final_message\n HAL Support:\tNo"
fi
+if test "$use_dvdread" = "yes"; then
+ AC_MSG_NOTICE($dvdread_enabled)
+ final_message="$final_message\n DVD Playback:\tYes"
+ USE_DVDREAD=1
+ SKIP_CONFIG_DVDREAD=0
+else
+ AC_MSG_NOTICE($dvdread_disabled)
+ final_message="$final_message\n DVD Playback:\tNo"
+ USE_DVDREAD=0
+ SKIP_CONFIG_DVDREAD=1
+fi
+
# DVDCSS
-if test "$use_dvdcss" = "yes"; then
+if test "$use_dvdcss" = "yes" && "$use_dvdread" = "yes"; then
AC_MSG_NOTICE($dvdcss_enabled)
final_message="$final_message\n DVDCSS:\tYes"
BUILD_DVDCSS=1
@@ -1942,7 +1962,6 @@ OUTPUT_FILES="Makefile \
xbmc/cores/VideoRenderers/Makefile \
xbmc/cores/dvdplayer/Makefile \
lib/Makefile \
- lib/libdvd/Makefile \
xbmc/cores/DllLoader/Makefile \
xbmc/cores/dvdplayer/DVDCodecs/Makefile \
xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile \
@@ -2001,6 +2020,10 @@ if test "$use_skin_touched" = "yes"; then
OUTPUT_FILES="$OUTPUT_FILES addons/skin.touched/media/Makefile"
fi
+if test "$use_dvdread" = "yes"; then
+OUTPUT_FILES="$OUTPUT_FILES lib/libdvd/Makefile"
+fi
+
# Line below is used so we can use AM_INIT_AUTOMAKE. The corresponding
# .dummy.am does nothing.
AC_CONFIG_FILES([.dummy])
@@ -2061,6 +2084,7 @@ AC_SUBST(USE_FFMPEG)
AC_SUBST(USE_LIBASS)
AC_SUBST(USE_LIBMAD)
AC_SUBST(USE_LIBMPEG2)
+AC_SUBST(USE_DVDREAD)
# pushd and popd are not available in other shells besides bash, so implement
# our own pushd/popd functions
@@ -2226,7 +2250,7 @@ XB_CONFIG_MODULE([lib/libdvd/libdvdread], [
$MAKE dvdread-config &&
mkdir -p `pwd`/../includes/dvdread
cp `pwd`/../libdvdread/src/*.h `pwd`/../includes/dvdread
-], [0])
+], [$SKIP_CONFIG_DVDREAD])
XB_CONFIG_MODULE([lib/libdvd/libdvdnav], [
./configure2 \
@@ -2240,7 +2264,7 @@ XB_CONFIG_MODULE([lib/libdvd/libdvdnav], [
--enable-static \
--disable-shared \
--cc="$CC"
-], [0])
+], [$SKIP_CONFIG_DVDREAD])
XB_CONFIG_MODULE([lib/libid3tag/libid3tag],[
./configure \
diff --git a/tools/sigma/Makefile b/tools/sigma/Makefile
index 082c0aa..5f700e4 100644
--- a/tools/sigma/Makefile
+++ b/tools/sigma/Makefile
@@ -10,7 +10,8 @@ export PYTHON_NOVERSIONCHECK=no-check
CONFIGURE=./configure --build=$(BUILD) --host=$(HOST) --prefix=/usr \
--enable-gles --disable-optical-drive --disable-dvdcss --enable-optimizations \
- --disable-x11 --disable-libbluray --disable-sdl --enable-directfb --disable-ffmpeg
+ --disable-x11 --disable-libbluray --disable-sdl --enable-directfb --disable-ffmpeg \
+ --disable-dvdread
all: configure
configure:
https://github.com/xbmc/xbmc/commit/976f3e582d5a336b3badc48f37d409af208a53da
commit 976f3e582d5a336b3badc48f37d409af208a53da
Author: theuni <theuni-nospam-@...>
Date: Thu Feb 23 22:02:13 2012 -0500
[smp] allow building without libmad
diff --git a/configure.in b/configure.in
index f755d04..2eb5ad9 100755
--- a/configure.in
+++ b/configure.in
@@ -746,7 +746,14 @@ AC_CHECK_HEADER([mpeg2dec/mpeg2convert.h],
USE_LIBMPEG2=0],
AC_INCLUDES_DEFAULT()
[#include <mpeg2dec/mpeg2.h>])
-AC_CHECK_HEADER([mad.h],, AC_MSG_ERROR($missing_library))
+
+AC_CHECK_HEADER([mad.h],
+ [AC_DEFINE([HAVE_LIBMAD], [1], [Whether to use libass library.])
+ USE_LIBMAD=1
+ XB_FIND_SONAME([MAD],[mad])],
+ [AC_MSG_NOTICE($missing_library)
+ USE_LIBMAD=0])
+
AC_CHECK_HEADER([jpeglib.h],, AC_MSG_ERROR($missing_library))
AC_CHECK_HEADER([samplerate.h],, AC_MSG_ERROR($missing_library))
AC_CHECK_HEADER([ogg/ogg.h],, AC_MSG_ERROR($missing_library))
@@ -889,7 +896,6 @@ else
fi
fi
-XB_FIND_SONAME([MAD], [mad])
XB_FIND_SONAME([OGG], [ogg])
XB_FIND_SONAME([CURL], [curl])
XB_FIND_SONAME([FLAC], [FLAC])
@@ -2053,6 +2059,7 @@ AC_SUBST(USE_LIBUSB)
AC_SUBST(USE_LIBCEC)
AC_SUBST(USE_FFMPEG)
AC_SUBST(USE_LIBASS)
+AC_SUBST(USE_LIBMAD)
AC_SUBST(USE_LIBMPEG2)
# pushd and popd are not available in other shells besides bash, so implement
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLibMad.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLibMad.h
index 314246e..64633aa 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLibMad.h
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecLibMad.h
@@ -21,6 +21,8 @@
*
*/
+#include "system.h"
+#if defined(HAS_LIBMAD)
#include "DVDAudioCodec.h"
#include "DllLibMad.h"
@@ -64,3 +66,4 @@ private:
DllLibMad m_dll;
};
+#endif
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DllLibMad.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DllLibMad.h
index d49d801..d9c0028 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DllLibMad.h
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DllLibMad.h
@@ -20,9 +20,8 @@
* http://www.gnu.org/copyleft/gpl.html
*
*/
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
- #include "config.h"
-#endif
+#include "system.h"
+#if defined(HAS_LIBMAD)
/* undefine byte from PlatformDefs.h since it's used in mad.h */
#undef byte
#if defined(_LINUX) || defined(__APPLE__)
@@ -86,4 +85,4 @@ class DllLibMad : public DllDynamic, DllLibMadInterface
RESOLVE_METHOD(mad_timer_zero)
END_METHOD_RESOLVE()
};
-
+#endif
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in
index 59ca452..bf18b21 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in
@@ -2,8 +2,7 @@ INCLUDES+=-I@...
CXXFLAGS+=-DHAVE_MMX
-SRCS= DVDAudioCodecLibMad.cpp \
- DVDAudioCodecLPcm.cpp \
+SRCS= DVDAudioCodecLPcm.cpp \
DVDAudioCodecPcm.cpp \
ifeq (@USE_FFMPEG@...)
@@ -13,6 +12,11 @@ SRCS+= DVDAudioCodecFFmpeg.cpp \
endif
+ifeq (@USE_LIBMAD@...)
+SRCS+= DVDAudioCodecLibMad.cpp \
+
+endif
+
LIB=Audio.a
include @abs_top_srcdir@...
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
index e764d90..b3b43dc 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
@@ -281,6 +281,7 @@ CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodec( CDVDStreamInfo &hint, bool p
switch (hint.codec)
{
+#if defined(HAS_LIBMAD)
case CODEC_ID_MP2:
case CODEC_ID_MP3:
{
@@ -288,6 +289,7 @@ CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodec( CDVDStreamInfo &hint, bool p
if( pCodec ) return pCodec;
break;
}
+#endif
case CODEC_ID_PCM_S32LE:
case CODEC_ID_PCM_S32BE:
case CODEC_ID_PCM_U32LE:
diff --git a/xbmc/cores/paplayer/CodecFactory.cpp b/xbmc/cores/paplayer/CodecFactory.cpp
index 8b3ca68..9988605 100644
--- a/xbmc/cores/paplayer/CodecFactory.cpp
+++ b/xbmc/cores/paplayer/CodecFactory.cpp
@@ -45,10 +45,12 @@
ICodec* CodecFactory::CreateCodec(const CStdString& strFileType)
{
- if (strFileType.Equals("mp3") || strFileType.Equals("mp2"))
- return new MP3Codec();
- else if (strFileType.Equals("ape") || strFileType.Equals("mac"))
+ if (strFileType.Equals("ape") || strFileType.Equals("mac"))
return new DVDPlayerCodec();
+#if defined(HAS_LIBMAD)
+ else if (strFileType.Equals("mp3") || strFileType.Equals("mp2"))
+ return new MP3Codec();
+#endif
else if (strFileType.Equals("cdda"))
return new CDDACodec();
else if (strFileType.Equals("mpc") || strFileType.Equals("mp+") || strFileType.Equals("mpp"))
@@ -114,10 +116,7 @@ ICodec* CodecFactory::CreateCodec(const CStdString& strFileType)
ICodec* CodecFactory::CreateCodecDemux(const CStdString& strFile, const CStdString& strContent, unsigned int filecache)
{
CURL urlFile(strFile);
- if( strContent.Equals("audio/mpeg")
- || strContent.Equals("audio/mp3") )
- return new MP3Codec();
- else if( strContent.Equals("audio/aac")
+ if( strContent.Equals("audio/aac")
|| strContent.Equals("audio/aacp") )
{
DVDPlayerCodec *pCodec = new DVDPlayerCodec;
@@ -125,6 +124,11 @@ ICodec* CodecFactory::CreateCodecDemux(const CStdString& strFile, const CStdStri
pCodec->SetContentType(strContent);
return pCodec;
}
+#if defined(HAS_LIBMAD)
+ else if( strContent.Equals("audio/mpeg")
+ || strContent.Equals("audio/mp3") )
+ return new MP3Codec();
+#endif
else if( strContent.Equals("audio/x-ms-wma") )
return new DVDPlayerCodec();
else if( strContent.Equals("application/ogg") || strContent.Equals("audio/ogg"))
@@ -134,10 +138,12 @@ ICodec* CodecFactory::CreateCodecDemux(const CStdString& strFile, const CStdStri
else if (strContent.Equals("audio/flac") || strContent.Equals("audio/x-flac") || strContent.Equals("application/x-flac"))
return new FLACCodec();
+#if defined(HAS_LIBMAD)
if (urlFile.GetProtocol() == "lastfm" || urlFile.GetProtocol() == "shout")
{
return new MP3Codec(); // if we got this far with internet radio - content-type was wrong. gamble on mp3.
}
+#endif
if (urlFile.GetFileType().Equals("wav"))
{
diff --git a/xbmc/cores/paplayer/MP3codec.h b/xbmc/cores/paplayer/MP3codec.h
index 268b4a9..c7ab4e6 100644
--- a/xbmc/cores/paplayer/MP3codec.h
+++ b/xbmc/cores/paplayer/MP3codec.h
@@ -21,6 +21,8 @@
*
*/
+#include "system.h"
+#if defined(HAS_LIBMAD)
#include "CachingCodec.h"
#include "music/tags/MusicInfoTagLoaderMP3.h"
#include "../dvdplayer/DVDCodecs/Audio/DllLibMad.h"
@@ -122,4 +124,4 @@ private:
DllLibMad m_dll;
};
-
+#endif
diff --git a/xbmc/cores/paplayer/Makefile.in b/xbmc/cores/paplayer/Makefile.in
index 3a7adaa..fe6c67b 100644
--- a/xbmc/cores/paplayer/Makefile.in
+++ b/xbmc/cores/paplayer/Makefile.in
@@ -12,7 +12,6 @@ SRCS=ADPCMCodec.cpp \
DVDPlayerCodec.cpp \
FLACcodec.cpp \
ModplugCodec.cpp \
- MP3codec.cpp \
NSFCodec.cpp \
OggCallback.cpp \
OGGcodec.cpp \
@@ -24,6 +23,10 @@ SRCS=ADPCMCodec.cpp \
WAVcodec.cpp \
YMCodec.cpp \
+ifeq (@USE_LIBMAD@...)
+ SRCS+=MP3codec \
+
+endif
ifeq (@USE_ASAP_CODEC@...)
SRCS+=ASAPCodec.cpp
endif
diff --git a/xbmc/system.h b/xbmc/system.h
index a495d28..e65e8ca 100644
--- a/xbmc/system.h
+++ b/xbmc/system.h
@@ -92,6 +92,10 @@
#define HAS_LIBMPEG2
#endif
+#ifdef HAVE_LIBMAD
+ #define HAS_LIBMAD
+#endif
+
/**********************
* Non-free Components
**********************/
@@ -130,6 +134,7 @@
#define HAVE_LIBCEC
#define HAS_LIBASS
#define HAS_LIBMPEG2
+#define HAS_LIBMAD
#define DECLARE_UNUSED(a,b) a b;
#endif
https://github.com/xbmc/xbmc/commit/c45d25e67549d4e53838c677417967451367308b
commit c45d25e67549d4e53838c677417967451367308b
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 24 00:02:11 2012 -0500
[smp] allow building without libass
diff --git a/configure.in b/configure.in
index 99d0303..f755d04 100755
--- a/configure.in
+++ b/configure.in
@@ -730,7 +730,14 @@ if test $MYSQL_CONFIG = "yes"; then
else
AC_MSG_ERROR($missing_program)
fi
-AC_CHECK_HEADER([ass/ass.h],, AC_MSG_ERROR($missing_library))
+
+AC_CHECK_HEADER([ass/ass.h],
+ [AC_DEFINE([HAVE_LIBASS], [1], [Whether to use libass library.])
+ USE_LIBASS=1
+ XB_FIND_SONAME([ASS],[ass])],
+ [AC_MSG_NOTICE($missing_library)]
+ USE_LIBASS=0)
+
AC_CHECK_HEADER([mpeg2dec/mpeg2convert.h],
[AC_DEFINE([HAVE_LIBMPEG2], [1], [Whether to use libmpeg2 library.])
USE_LIBMPEG2=1
@@ -890,7 +897,6 @@ XB_FIND_SONAME([VORBIS], [vorbis])
XB_FIND_SONAME([VORBISENC], [vorbisenc])
XB_FIND_SONAME([VORBISFILE], [vorbisfile])
XB_FIND_SONAME([MODPLUG], [modplug])
-XB_FIND_SONAME([ASS], [ass])
# WebServer
if test "$use_webserver" = "yes"; then
@@ -2046,6 +2052,7 @@ AC_SUBST(USE_LIBUDEV)
AC_SUBST(USE_LIBUSB)
AC_SUBST(USE_LIBCEC)
AC_SUBST(USE_FFMPEG)
+AC_SUBST(USE_LIBASS)
AC_SUBST(USE_LIBMPEG2)
# pushd and popd are not available in other shells besides bash, so implement
diff --git a/xbmc/cores/VideoRenderers/OverlayRendererUtil.cpp b/xbmc/cores/VideoRenderers/OverlayRendererUtil.cpp
index 3014901..1e1207b 100644
--- a/xbmc/cores/VideoRenderers/OverlayRendererUtil.cpp
+++ b/xbmc/cores/VideoRenderers/OverlayRendererUtil.cpp
@@ -184,6 +184,7 @@ uint32_t* convert_rgba(CDVDOverlaySpu* o, bool mergealpha
bool convert_quad(CDVDOverlaySSA* o, double pts, int width, int height, SQuads& quads)
{
+#if defined(HAS_LIBASS)
ASS_Image* images = o->m_libass->RenderImage(width, height, pts);
ASS_Image* img;
@@ -295,6 +296,9 @@ bool convert_quad(CDVDOverlaySSA* o, double pts, int width, int height, SQuads&
data += img->w + 1;
}
return true;
+#else
+return false;
+#endif
}
}
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
index 543960d..e764d90 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
@@ -344,11 +344,11 @@ CDVDOverlayCodec* CDVDFactoryCodec::CreateOverlayCodec( CDVDStreamInfo &hint )
case CODEC_ID_TEXT:
pCodec = OpenCodec(new CDVDOverlayCodecText(), hint, options);
if( pCodec ) return pCodec;
-
+#if defined(HAS_LIBASS)
case CODEC_ID_SSA:
pCodec = OpenCodec(new CDVDOverlayCodecSSA(), hint, options);
if( pCodec ) return pCodec;
-
+#endif
pCodec = OpenCodec(new CDVDOverlayCodecText(), hint, options);
if( pCodec ) return pCodec;
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.h b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.h
index 0c973bb..e4c8f69 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.h
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecSSA.h
@@ -21,6 +21,8 @@
*
*/
+#include "system.h"
+#if defined(HAS_LIBASS)
#include "DVDOverlayCodec.h"
#include "DVDSubtitles/DVDSubtitlesLibass.h"
#include "DVDStreamInfo.h"
@@ -45,3 +47,4 @@ private:
CDVDStreamInfo m_hints;
int m_order;
};
+#endif
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlaySSA.h b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlaySSA.h
index 4aafbd6..fa68780 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlaySSA.h
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlaySSA.h
@@ -22,6 +22,7 @@
*/
#include "system.h" // for SAFE_RELEASE
+#if defined(HAS_LIBASS)
#include "DVDOverlay.h"
#include "../../DVDSubtitles/DVDSubtitlesLibass.h"
@@ -44,3 +45,4 @@ public:
}
};
+#endif
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/Makefile.in
index 02e6484..1e8e496 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/Makefile.in
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/Makefile.in
@@ -1,11 +1,15 @@
INCLUDES+=-I@... \
SRCS= DVDOverlayCodecCC.cpp \
- DVDOverlayCodecSSA.cpp \
DVDOverlayCodecText.cpp \
DVDOverlayCodecTX3G.cpp \
libspucc/cc_decoder.c \
+ifeq (@USE_LIBASS@...)
+SRCS+= DVDOverlayCodecSSA.cpp \
+
+endif
+
ifeq (@USE_FFMPEG@...)
SRCS+= DVDOverlayCodecFFmpeg.cpp
diff --git a/xbmc/cores/dvdplayer/DVDOverlayRenderer.cpp b/xbmc/cores/dvdplayer/DVDOverlayRenderer.cpp
index 6f88e3e..0dac720 100644
--- a/xbmc/cores/dvdplayer/DVDOverlayRenderer.cpp
+++ b/xbmc/cores/dvdplayer/DVDOverlayRenderer.cpp
@@ -19,12 +19,15 @@
*
*/
+#include "system.h"
#include "utils/log.h"
#include "DVDOverlayRenderer.h"
#include "DVDCodecs/Overlay/DVDOverlaySpu.h"
#include "DVDCodecs/Overlay/DVDOverlayText.h"
#include "DVDCodecs/Overlay/DVDOverlayImage.h"
+#if defined(HAS_LIBASS)
#include "DVDCodecs/Overlay/DVDOverlaySSA.h"
+#endif
#define CLAMP(a, min, max) ((a) > (max) ? (max) : ( (a) < (min) ? (min) : a ))
@@ -40,10 +43,12 @@ void CDVDOverlayRenderer::Render(DVDPictureRenderer* pPicture, CDVDOverlay* pOve
{
Render(pPicture, (CDVDOverlayImage*)pOverlay);
}
+#if defined(HAS_LIBASS)
else if (pOverlay->IsOverlayType(DVDOVERLAY_TYPE_SSA))
{
Render(pPicture, (CDVDOverlaySSA*)pOverlay, pts);
}
+#endif
else if (false && pOverlay->IsOverlayType(DVDOVERLAY_TYPE_TEXT))
{
CDVDOverlayText* pOverlayText = (CDVDOverlayText*)pOverlay;
@@ -66,7 +71,7 @@ void CDVDOverlayRenderer::Render(DVDPictureRenderer* pPicture, CDVDOverlay* pOve
void CDVDOverlayRenderer::Render(DVDPictureRenderer* pPicture, CDVDOverlaySSA* pOverlay, double pts)
{
-
+#if defined(HAS_LIBASS)
int height, width;
height = pPicture->height;
width = pPicture->width;
@@ -128,6 +133,7 @@ void CDVDOverlayRenderer::Render(DVDPictureRenderer* pPicture, CDVDOverlaySSA* p
}
img = img->next;
}
+#endif
}
void CDVDOverlayRenderer::Render(DVDPictureRenderer* pPicture, CDVDOverlayImage* pOverlay)
diff --git a/xbmc/cores/dvdplayer/DVDSubtitles/DVDFactorySubtitle.cpp b/xbmc/cores/dvdplayer/DVDSubtitles/DVDFactorySubtitle.cpp
index 7b057ab..2fe8bba 100644
--- a/xbmc/cores/dvdplayer/DVDSubtitles/DVDFactorySubtitle.cpp
+++ b/xbmc/cores/dvdplayer/DVDSubtitles/DVDFactorySubtitle.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "system.h"
#include "DVDFactorySubtitle.h"
#include "DVDSubtitleStream.h"
@@ -73,11 +74,13 @@ CDVDSubtitleParser* CDVDFactorySubtitle::CreateParser(string& strFile)
pParser = new CDVDSubtitleParserVplayer(pStream, strFile.c_str());
pStream = NULL;
}
+#if defined(HAS_LIBASS)
else if ((!memcmp(line, "Dialogue: Marked", 16)) || (!memcmp(line, "Dialogue: ", 10)))
{
pParser = new CDVDSubtitleParserSSA(pStream, strFile.c_str());
pStream = NULL;
}
+#endif
// if (sscanf (line, "%d:%d:%d.%d,%d:%d:%d.%d", &i, &i, &i, &i, &i, &i, &i, &i)==8){
// this->uses_time=1;
// xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subviewer subtitle format detected\n");
diff --git a/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitleParserSSA.h b/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitleParserSSA.h
index 6d9551c..f3e0a9e 100644
--- a/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitleParserSSA.h
+++ b/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitleParserSSA.h
@@ -21,6 +21,8 @@
*
*/
+#include "system.h"
+#if defined(HAS_LIBASS)
#include "DVDSubtitleParser.h"
#include "DVDSubtitleLineCollection.h"
#include "DVDSubtitlesLibass.h"
@@ -38,3 +40,4 @@ public:
private:
CDVDSubtitlesLibass* m_libass;
};
+#endif
diff --git a/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.h b/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.h
index 6c7db59..49c1430 100644
--- a/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.h
+++ b/xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.h
@@ -20,7 +20,8 @@
* http://www.gnu.org/copyleft/gpl.html
*
*/
-
+#include "system.h"
+#if defined(HAS_LIBASS)
#include "DllLibass.h"
#include "DVDResource.h"
#include "threads/CriticalSection.h"
@@ -50,4 +51,4 @@ private:
ASS_Renderer* m_renderer;
CCriticalSection m_section;
};
-
+#endif
diff --git a/xbmc/cores/dvdplayer/DVDSubtitles/DllLibass.h b/xbmc/cores/dvdplayer/DVDSubtitles/DllLibass.h
index 4f7428a..b7c2df7 100644
--- a/xbmc/cores/dvdplayer/DVDSubtitles/DllLibass.h
+++ b/xbmc/cores/dvdplayer/DVDSubtitles/DllLibass.h
@@ -21,9 +21,8 @@
*
*/
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
- #include "config.h"
-#endif
+#include "system.h"
+#if defined(HAS_LIBASS)
extern "C" {
#if defined(WIN32)
#include "lib/libass/libass/ass.h"
@@ -115,3 +114,4 @@ class DllLibass : public DllDynamic, DllLibassInterface
RESOLVE_METHOD(ass_set_message_cb)
END_METHOD_RESOLVE()
};
+#endif
diff --git a/xbmc/cores/dvdplayer/DVDSubtitles/Makefile.in b/xbmc/cores/dvdplayer/DVDSubtitles/Makefile.in
index 8a4ebc4..ef465db 100644
--- a/xbmc/cores/dvdplayer/DVDSubtitles/Makefile.in
+++ b/xbmc/cores/dvdplayer/DVDSubtitles/Makefile.in
@@ -5,14 +5,18 @@ SRCS= DVDFactorySubtitle.cpp \
DVDSubtitleParserMicroDVD.cpp \
DVDSubtitleParserMPL2.cpp \
DVDSubtitleParserSami.cpp \
- DVDSubtitleParserSSA.cpp \
DVDSubtitleParserSubrip.cpp \
DVDSubtitleParserVplayer.cpp \
DVDSubtitleTagMicroDVD.cpp \
DVDSubtitleTagSami.cpp \
- DVDSubtitlesLibass.cpp \
DVDSubtitleStream.cpp \
+ifeq (@USE_LIBASS@...)
+SRCS+= DVDSubtitleParserSSA.cpp \
+ DVDSubtitlesLibass.cpp \
+
+endif
+
LIB= DVDSubtitles.a
include @abs_top_srcdir@...
diff --git a/xbmc/system.h b/xbmc/system.h
index c1b4c48..a495d28 100644
--- a/xbmc/system.h
+++ b/xbmc/system.h
@@ -84,6 +84,10 @@
#define HAS_FFMPEG
#endif
+#ifdef HAVE_LIBASS
+ #define HAS_LIBASS
+#endif
+
#ifdef HAVE_LIBMPEG2
#define HAS_LIBMPEG2
#endif
@@ -124,6 +128,7 @@
#define HAS_ZEROCONF
#define HAS_AIRPLAY
#define HAVE_LIBCEC
+#define HAS_LIBASS
#define HAS_LIBMPEG2
#define DECLARE_UNUSED(a,b) a b;
https://github.com/xbmc/xbmc/commit/6a18f5a741883b5109750c4602fb71cc902bfd50
commit 6a18f5a741883b5109750c4602fb71cc902bfd50
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 24 00:01:16 2012 -0500
[smp] enable building without libmpeg2
diff --git a/configure.in b/configure.in
index 8290913..99d0303 100755
--- a/configure.in
+++ b/configure.in
@@ -731,8 +731,12 @@ else
AC_MSG_ERROR($missing_program)
fi
AC_CHECK_HEADER([ass/ass.h],, AC_MSG_ERROR($missing_library))
-AC_CHECK_HEADER([mpeg2dec/mpeg2.h],, AC_MSG_ERROR($missing_library))
-AC_CHECK_HEADER([mpeg2dec/mpeg2convert.h],, AC_MSG_ERROR($missing_library),
+AC_CHECK_HEADER([mpeg2dec/mpeg2convert.h],
+ [AC_DEFINE([HAVE_LIBMPEG2], [1], [Whether to use libmpeg2 library.])
+ USE_LIBMPEG2=1
+ XB_FIND_SONAME([MPEG2],[mpeg2])],
+ [AC_MSG_NOTICE($missing_library)
+ USE_LIBMPEG2=0],
AC_INCLUDES_DEFAULT()
[#include <mpeg2dec/mpeg2.h>])
AC_CHECK_HEADER([mad.h],, AC_MSG_ERROR($missing_library))
@@ -887,7 +891,6 @@ XB_FIND_SONAME([VORBISENC], [vorbisenc])
XB_FIND_SONAME([VORBISFILE], [vorbisfile])
XB_FIND_SONAME([MODPLUG], [modplug])
XB_FIND_SONAME([ASS], [ass])
-XB_FIND_SONAME([MPEG2], [mpeg2])
# WebServer
if test "$use_webserver" = "yes"; then
@@ -2043,6 +2046,7 @@ AC_SUBST(USE_LIBUDEV)
AC_SUBST(USE_LIBUSB)
AC_SUBST(USE_LIBCEC)
AC_SUBST(USE_FFMPEG)
+AC_SUBST(USE_LIBMPEG2)
# pushd and popd are not available in other shells besides bash, so implement
# our own pushd/popd functions
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
index e45e6d8..543960d 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
@@ -170,10 +170,12 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne
CLog::Log(LOGDEBUG, "CDVDFactoryCodec: compiled in hardware support: %s", hwSupport.c_str());
// dvd's have weird still-frames in it, which is not fully supported in ffmpeg
+#if defined(HAS_LIBMPEG2)
if(hint.stills && (hint.codec == CODEC_ID_MPEG2VIDEO || hint.codec == CODEC_ID_MPEG1VIDEO))
{
if( (pCodec = OpenCodec(new CDVDVideoCodecLibMpeg2(), hint, options)) ) return pCodec;
}
+#endif
#if defined(HAVE_LIBVDADECODER)
if (!hint.software && g_guiSettings.GetBool("videoplayer.usevda"))
{
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecLibMpeg2.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecLibMpeg2.h
index 76be08f..ebadada 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecLibMpeg2.h
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecLibMpeg2.h
@@ -21,6 +21,8 @@
*
*/
+#include "system.h"
+#if defined(HAS_LIBMPEG2)
#include "DVDVideoCodec.h"
#include "DllLibMpeg2.h"
@@ -61,3 +63,4 @@ protected:
DVDVideoPicture m_pVideoBuffer[3];
DVDVideoPicture* m_pCurrentBuffer;
};
+#endif
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
index a88fc07..5ee451f 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
@@ -1,6 +1,11 @@
INCLUDES+=-I@... \
-SRCS= DVDVideoCodecLibMpeg2.cpp \
+SRCS=
+
+ifeq (@USE_LIBMPEG2@...)
+SRCS+= DVDVideoCodecLibMpeg2.cpp \
+
+endif
ifeq (@USE_FFMPEG@...)
SRCS+= DVDVideoCodecFFmpeg.cpp \
diff --git a/xbmc/system.h b/xbmc/system.h
index d4f5b5f..c1b4c48 100644
--- a/xbmc/system.h
+++ b/xbmc/system.h
@@ -84,6 +84,9 @@
#define HAS_FFMPEG
#endif
+#ifdef HAVE_LIBMPEG2
+ #define HAS_LIBMPEG2
+#endif
/**********************
* Non-free Components
@@ -121,6 +124,7 @@
#define HAS_ZEROCONF
#define HAS_AIRPLAY
#define HAVE_LIBCEC
+#define HAS_LIBMPEG2
#define DECLARE_UNUSED(a,b) a b;
#endif
https://github.com/xbmc/xbmc/commit/166b9e635c9517984e7f095ab8c6a10f71cb0d94
commit 166b9e635c9517984e7f095ab8c6a10f71cb0d94
Author: theuni <theuni-nospam-@...>
Date: Thu Feb 23 21:28:16 2012 -0500
[smp] fix output configure status messages for projectm/rsxs
diff --git a/configure.in b/configure.in
index 86b0707..8290913 100755
--- a/configure.in
+++ b/configure.in
@@ -1011,6 +1011,7 @@ fi
if test "$use_rsxs" = "no" || test "$use_gl" = "no"; then
AC_MSG_NOTICE($rsxs_disabled)
DISABLE_RSXS=1
+ use_rsxs=no
else
AC_MSG_NOTICE($rsxs_enabled)
DISABLE_RSXS=0
@@ -1029,6 +1030,7 @@ fi
if test "$use_projectm" = "no" || test "$use_gl" = "no"; then
AC_MSG_NOTICE($projectm_disabled)
DISABLE_PROJECTM=1
+ use_projectm=no
else
AC_MSG_NOTICE($projectm_enabled)
DISABLE_PROJECTM=0
https://github.com/xbmc/xbmc/commit/255ab12d6823213bc5afbb71328fcf5d9a2fb8e6
commit 255ab12d6823213bc5afbb71328fcf5d9a2fb8e6
Author: theuni <theuni-nospam-@...>
Date: Thu Feb 23 19:59:49 2012 -0500
[smp] cleanup the ffmpeg removal
Should be ok on all platforms now
diff --git a/configure.in b/configure.in
index 7565574..86b0707 100755
--- a/configure.in
+++ b/configure.in
@@ -1339,7 +1339,7 @@ fi
if test "x$use_ffmpeg" != "xno"; then
USE_FFMPEG=1
SKIP_CONFIG_FFMPEG=0
- AC_DEFINE([USE_FFMPEG], [1], [Whether to use FFmpeg libraries.])
+ AC_DEFINE([HAVE_FFMPEG], [1], [Whether to use FFmpeg libraries.])
else
use_vdpau=no
USE_FFMPEG=0
diff --git a/xbmc/ThumbLoader.cpp b/xbmc/ThumbLoader.cpp
index 3a3c852..5559f5d 100755
--- a/xbmc/ThumbLoader.cpp
+++ b/xbmc/ThumbLoader.cpp
@@ -39,7 +39,7 @@
#include "video/VideoInfoTag.h"
#include "video/VideoDatabase.h"
-#if defined (USE_FFMPEG)
+#if defined (HAS_FFMPEG)
#include "cores/dvdplayer/DVDFileInfo.h"
#elif defined (HAS_SIGMASMP)
#include "cores/smpplayer/SMPFileInfo.h"
@@ -146,7 +146,7 @@ bool CThumbExtractor::DoWork()
if (m_thumb)
{
CLog::Log(LOGDEBUG,"%s - trying to extract thumb from video file %s", __FUNCTION__, m_path.c_str());
-#if defined (USE_FFMPEG)
+#if defined (HAS_FFMPEG)
result = CDVDFileInfo::ExtractThumb(m_path, m_target, &m_item.GetVideoInfoTag()->m_streamDetails);
#elif defined (HAS_SIGMASMP)
result = CSMPFileInfo::ExtractThumb(m_path, m_target, &m_item.GetVideoInfoTag()->m_streamDetails);
@@ -163,7 +163,7 @@ bool CThumbExtractor::DoWork()
else if (m_item.HasVideoInfoTag() && !m_item.GetVideoInfoTag()->HasStreamDetails())
{
CLog::Log(LOGDEBUG,"%s - trying to extract filestream details from video file %s", __FUNCTION__, m_path.c_str());
-#if defined (USE_FFMPEG)
+#if defined (HAS_FFMPEG)
result = CDVDFileInfo::GetFileStreamDetails(&m_item);
#elif defined (HAS_SIGMASMP)
result = CSMPFileInfo::GetFileStreamDetails(&m_item);
diff --git a/xbmc/cdrip/CDDARipper.cpp b/xbmc/cdrip/CDDARipper.cpp
index 54d2720..fdac782 100644
--- a/xbmc/cdrip/CDDARipper.cpp
+++ b/xbmc/cdrip/CDDARipper.cpp
@@ -31,7 +31,7 @@
#include "EncoderLame.h"
#include "EncoderWav.h"
#include "EncoderVorbis.h"
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
#include "EncoderFFmpeg.h"
#endif
#include "EncoderFlac.h"
diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
index cd08073..c7ebabe 100755
--- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -52,7 +52,7 @@
#include "DVDCodecs/Video/DVDVideoCodecVideoToolBox.h"
#include <CoreVideo/CoreVideo.h>
#endif
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
#include "lib/DllSwScale.h"
#endif
@@ -104,7 +104,7 @@ CLinuxRendererGLES::CLinuxRendererGLES()
m_rgbBuffer = NULL;
m_rgbBufferSize = 0;
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
m_dllSwScale = new DllSwScale;
#endif
m_sw_context = NULL;
@@ -128,7 +128,7 @@ CLinuxRendererGLES::~CLinuxRendererGLES()
m_pYUVShader = NULL;
}
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
delete m_dllSwScale;
#endif
}
@@ -513,7 +513,7 @@ unsigned int CLinuxRendererGLES::PreInit()
// setup the background colour
m_clearColour = (float)(g_advancedSettings.m_videoBlackBarColour & 0xff) / 0xff;
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
if (!m_dllSwScale->Load())
CLog::Log(LOGERROR,"CLinuxRendererGL::PreInit - failed to load rescale libraries!");
#endif
@@ -706,7 +706,7 @@ void CLinuxRendererGLES::UnInit()
for (int i = 0; i < NUM_BUFFERS; ++i)
(this->*m_textureDelete)(i);
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
if (m_dllSwScale && m_sw_context)
{
m_dllSwScale->sws_freeContext(m_sw_context);
@@ -772,7 +772,7 @@ void CLinuxRendererGLES::Render(DWORD flags, int index)
}
else
{
-#if defined(USE_FFMPEG) || defined(__ARM_NEON__)
+#if defined(HAS_FFMPEG) || defined(__ARM_NEON__)
RenderSoftware(index, m_currentField);
VerifyGLState();
#endif
@@ -1341,7 +1341,7 @@ void CLinuxRendererGLES::UploadYV12Texture(int source)
#if defined(__ARM_NEON__)
yuv420_2_rgb8888_neon(m_rgbBuffer, im->plane[0], im->plane[2], im->plane[1],
m_sourceWidth, m_sourceHeight, im->stride[0], im->stride[1], m_sourceWidth * 4);
-#elif defined(USE_FFMPEG)
+#elif defined(HAS_FFMPEG)
m_sw_context = m_dllSwScale->sws_getCachedContext(m_sw_context,
im->width, im->height, PIX_FMT_YUV420P,
im->width, im->height, PIX_FMT_RGBA,
diff --git a/xbmc/cores/dvdplayer/DVDAudio.h b/xbmc/cores/dvdplayer/DVDAudio.h
index af45eaa..9a58744 100644
--- a/xbmc/cores/dvdplayer/DVDAudio.h
+++ b/xbmc/cores/dvdplayer/DVDAudio.h
@@ -21,9 +21,7 @@
*
*/
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
- #include "config.h"
-#endif
+#include "system.h"
#include "cores/AudioRenderers/IAudioRenderer.h"
#include "cores/IAudioCallback.h"
#include "threads/CriticalSection.h"
@@ -32,7 +30,7 @@
#ifndef _LINUX
enum CodecID;
#else
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
@@ -46,7 +44,7 @@ extern "C" {
}
#else
#include "FFMpegInternals.h"
-#endif //USE_FFMPEG
+#endif //HAS_FFMPEG
#endif
typedef struct stDVDAudioFrame DVDAudioFrame;
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
index 2d170bd..7a776b6 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
@@ -28,7 +28,7 @@
#include "config.h"
#endif
#include <vector>
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
#include "DllAvCodec.h"
#else
#include "FFMpegInternals.h"
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
index 19510d1..098f019 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "system.h"
#include "DVDCodecUtils.h"
#include "DVDClock.h"
#include "cores/VideoRenderers/RenderManager.h"
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h b/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h
index 2859ab1..4983eb2 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h
+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h
@@ -21,9 +21,7 @@
*
*/
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
- #include "config.h"
-#endif
+#include "system.h"
// enum CodecID
#include <string>
@@ -42,7 +40,7 @@ extern "C" {
#ifndef __GNUC__
#pragma warning(disable:4244)
#endif
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
#include <libavcodec/avcodec.h>
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
index f45e568..a88fc07 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
@@ -3,8 +3,8 @@ INCLUDES+=-I@... \
SRCS= DVDVideoCodecLibMpeg2.cpp \
ifeq (@USE_FFMPEG@...)
-SRCS= DVDVideoCodecFFmpeg.cpp \
- DVDVideoPPFFmpeg.cpp \
+SRCS+= DVDVideoCodecFFmpeg.cpp \
+ DVDVideoPPFFmpeg.cpp \
endif
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
index 20104dd..1e75112 100644
--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
@@ -38,7 +38,7 @@ class CDVDInputStream;
enum CodecID;
#include <libavcodec/avcodec.h>
#else
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp
index 96235ca..3b98e5a 100644
--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp
+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp
@@ -19,13 +19,11 @@
*
*/
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
- #include "config.h"
-#endif
+#include "system.h"
#include "DVDDemuxUtils.h"
#include "DVDClock.h"
#include "utils/log.h"
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp
index 4276d55..cd97880 100644
--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp
+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "system.h"
#include "DVDDemuxVobsub.h"
#include "DVDInputStreams/DVDFactoryInputStream.h"
#include "DVDInputStreams/DVDInputStream.h"
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp
index f0e27f2..a2cc07d 100644
--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp
+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp
@@ -25,7 +25,7 @@
#include "DVDInputStreams/DVDInputStream.h"
#include "DVDInputStreams/DVDInputStreamHttp.h"
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
#include "DVDDemuxFFmpeg.h"
#endif
#include "DVDDemuxShoutcast.h"
@@ -63,7 +63,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream)
return NULL;
}
#endif
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
auto_ptr<CDVDDemuxFFmpeg> demuxer(new CDVDDemuxFFmpeg());
if(demuxer->Open(pInputStream))
return demuxer.release();
diff --git a/xbmc/cores/dvdplayer/DVDFileInfo.cpp b/xbmc/cores/dvdplayer/DVDFileInfo.cpp
index 3c31c12..7474f3b 100644
--- a/xbmc/cores/dvdplayer/DVDFileInfo.cpp
+++ b/xbmc/cores/dvdplayer/DVDFileInfo.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "system.h"
#include "threads/SystemClock.h"
#include "DVDFileInfo.h"
#include "FileItem.h"
@@ -38,7 +39,7 @@
#include "DVDDemuxers/DVDDemux.h"
#include "DVDDemuxers/DVDDemuxUtils.h"
#include "DVDDemuxers/DVDFactoryDemuxer.h"
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
#include "DVDDemuxers/DVDDemuxFFmpeg.h"
#include "DllAvCodec.h"
#include "DllSwScale.h"
@@ -78,7 +79,7 @@ bool CDVDFileInfo::GetFileDuration(const CStdString &path, int& duration)
bool CDVDFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &strTarget, CStreamDetails *pStreamDetails)
{
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
unsigned int nTime = XbmcThreads::SystemClockMillis();
CDVDInputStream *pInputStream = CDVDFactoryInputStream::CreateInputStream(NULL, strPath, "");
if (!pInputStream)
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp
index a577832..dfa234f 100644
--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -33,7 +33,7 @@
#include "DVDDemuxers/DVDDemuxUtils.h"
#include "DVDDemuxers/DVDDemuxVobsub.h"
#include "DVDDemuxers/DVDFactoryDemuxer.h"
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
#include "DVDDemuxers/DVDDemuxFFmpeg.h"
#include "DllSwScale.h"
#endif
@@ -2783,7 +2783,7 @@ bool CDVDPlayer::OpenVideoStream(int iStream, int source)
bool CDVDPlayer::OpenSubtitleStream(int iStream, int source)
{
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
CLog::Log(LOGNOTICE, "Opening Subtitle stream: %i source: %i", iStream, source);
CDemuxStream* pStream = NULL;
@@ -3599,7 +3599,7 @@ int CDVDPlayer::AddSubtitleFile(const std::string& filename, const std::string&
std::string vobsubfile = subfilename;
if(ext == ".idx")
{
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
if (vobsubfile.empty())
vobsubfile = URIUtils::ReplaceExtension(filename, ".sub");
diff --git a/xbmc/cores/dvdplayer/DVDPlayerTeletext.cpp b/xbmc/cores/dvdplayer/DVDPlayerTeletext.cpp
index 8f8f5df..eb60c40 100644
--- a/xbmc/cores/dvdplayer/DVDPlayerTeletext.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayerTeletext.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "system.h"
#include "DVDPlayerTeletext.h"
#include "settings/Settings.h"
#include "DVDPlayer.h"
@@ -116,7 +117,7 @@ CDVDTeletextData::~CDVDTeletextData()
bool CDVDTeletextData::CheckStream(CDVDStreamInfo &hints)
{
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,38,1)
if (hints.codec == CODEC_ID_DVB_TELETEXT)
return true;
@@ -129,7 +130,7 @@ bool CDVDTeletextData::CheckStream(CDVDStreamInfo &hints)
bool CDVDTeletextData::OpenStream(CDVDStreamInfo &hints)
{
m_messageQueue.Init();
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,38,1)
if (hints.codec == CODEC_ID_DVB_TELETEXT)
{
diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
index fe6f39b..b3bd4cb 100644
--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
@@ -30,7 +30,7 @@
#include "DVDPlayerVideo.h"
#include "DVDCodecs/DVDFactoryCodec.h"
#include "DVDCodecs/DVDCodecUtils.h"
-#if #defined(USE_FFMPEG)
+#if #defined(HAS_FFMPEG)
#include "DVDCodecs/Video/DVDVideoPPFFmpeg.h"
#include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h"
#endif
@@ -299,7 +299,7 @@ void CDVDPlayerVideo::Process()
DVDVideoPicture picture;
CPulldownCorrection pulldown;
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
CDVDVideoPPFFmpeg mPostProcess("");
CStdString sPostProcessType;
bool bPostProcessDeint = false;
@@ -580,7 +580,7 @@ void CDVDPlayerVideo::Process()
m_pVideoCodec->ClearPicture(&picture);
if (m_pVideoCodec->GetPicture(&picture))
{
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
sPostProcessType.clear();
#endif
@@ -616,7 +616,7 @@ void CDVDPlayerVideo::Process()
{
if(mInt == VS_INTERLACEMETHOD_SW_BLEND)
{
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
if (!sPostProcessType.empty())
sPostProcessType += ",";
sPostProcessType += g_advancedSettings.m_videoPPFFmpegDeint;
@@ -624,7 +624,7 @@ void CDVDPlayerVideo::Process()
#endif
}
}
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
if (g_settings.m_currentVideoSettings.m_PostProcess)
{
if (!sPostProcessType.empty())
diff --git a/xbmc/cores/dvdplayer/DVDStreamInfo.h b/xbmc/cores/dvdplayer/DVDStreamInfo.h
index ad541a5..1a4b667 100644
--- a/xbmc/cores/dvdplayer/DVDStreamInfo.h
+++ b/xbmc/cores/dvdplayer/DVDStreamInfo.h
@@ -21,15 +21,13 @@
#pragma once
-#if (defined HAVE_CONFIG_H) && (!defined WIN32)
- #include "config.h"
-#endif
+#include "system.h"
#ifndef _LINUX
enum StreamType;
enum CodecID;
#else
#include "DVDDemuxers/DVDDemux.h"
-#if defined(USE_FFMPEG)
+#if defined(HAS_FFMPEG)
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
diff --git a/xbmc/system.h b/xbmc/system.h
index bff0d88..d4f5b5f 100644
--- a/xbmc/system.h
+++ b/xbmc/system.h
@@ -80,6 +80,11 @@
#define HAS_AIRTUNES
#endif
+#ifdef HAVE_FFMPEG
+ #define HAS_FFMPEG
+#endif
+
+
/**********************
* Non-free Components
**********************/
https://github.com/xbmc/xbmc/commit/f578518bedc5208ee5f1f5a40fce6f674445786a
commit f578518bedc5208ee5f1f5a40fce6f674445786a
Author: theuni <theuni-nospam-@...>
Date: Thu Feb 23 18:26:23 2012 -0500
[smp] don't render outside of our window if we've calibrated the screen.
Playback rect needs to be fixed as well.
diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp
index 477449a..44e16f3 100644
--- a/xbmc/guilib/GUIWindowManager.cpp
+++ b/xbmc/guilib/GUIWindowManager.cpp
@@ -546,7 +546,7 @@ bool CGUIWindowManager::Render()
CSingleLock lock(g_graphicsContext);
CDirtyRegionList dirtyRegions = m_tracker.GetDirtyRegions();
-
+ g_graphicsContext.SetScissors(g_graphicsContext.GetViewWindow());
bool hasRendered = false;
// If we visualize the regions we will always render the entire viewport
if (g_advancedSettings.m_guiVisualizeDirtyRegions || g_advancedSettings.m_guiAlgorithmDirtyRegions == DIRTYREGION_SOLVER_FILL_VIEWPORT_ALWAYS)
diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp
index 20c7201..68068a8 100644
--- a/xbmc/guilib/GraphicContext.cpp
+++ b/xbmc/guilib/GraphicContext.cpp
@@ -240,6 +240,7 @@ void CGraphicContext::SetScissors(const CRect &rect)
{
m_scissors = rect;
m_scissors.Intersect(CRect(0,0,(float)m_iScreenWidth, (float)m_iScreenHeight));
+// m_scissors.Intersect(GetViewWindow());
g_Windowing.SetScissors(m_scissors);
}
@@ -251,16 +252,12 @@ void CGraphicContext::ResetScissors()
const CRect CGraphicContext::GetViewWindow() const
{
- if (m_bCalibrating || m_bFullScreenVideo)
- {
CRect rect;
rect.x1 = (float)g_settings.m_ResInfo[m_Resolution].Overscan.left;
rect.y1 = (float)g_settings.m_ResInfo[m_Resolution].Overscan.top;
rect.x2 = (float)g_settings.m_ResInfo[m_Resolution].Overscan.right;
rect.y2 = (float)g_settings.m_ResInfo[m_Resolution].Overscan.bottom;
return rect;
- }
- return m_videoRect;
}
void CGraphicContext::SetViewWindow(float left, float top, float right, float bottom)
https://github.com/xbmc/xbmc/commit/25bc2eec73b113e72cd71d55cdad81e574dae161
commit 25bc2eec73b113e72cd71d55cdad81e574dae161
Author: theuni <theuni-nospam-@...>
Date: Wed Feb 22 23:05:55 2012 -0500
[smp] frame-limit during fullscreen playback to avoid running at 100fps
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index a21e12b..81c62db 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -2030,6 +2030,12 @@ void CApplication::Render()
decrement = m_bPresentFrame;
hasRendered = true;
}
+ else if(!extPlayerActive && g_graphicsContext.IsFullScreenVideo() && !g_renderManager.RendererHandlesPresent())
+ {
+ //Whether we're paused or not, if the renderer isn't in charge of presenting and we're fullscreen, we limit
+ singleFrameTime = 30;
+ limitFrames = true;
+ }
else
{
// engage the frame limiter as needed
https://github.com/xbmc/xbmc/commit/b10225dfe03e8af1ba57d41c582aed4a6d677084
commit b10225dfe03e8af1ba57d41c582aed4a6d677084
Author: theuni <theuni-nospam-@...>
Date: Tue Feb 21 21:48:01 2012 -0500
[smp] allow our wrapped protocols to work.
Disable seeking for live sources. Some others may need to go on this list.
diff --git a/xbmc/cores/smpplayer/FileIDataSource.cpp b/xbmc/cores/smpplayer/FileIDataSource.cpp
index 9cfe562..20e767f 100755
--- a/xbmc/cores/smpplayer/FileIDataSource.cpp
+++ b/xbmc/cores/smpplayer/FileIDataSource.cpp
@@ -23,6 +23,7 @@
#include "filesystem/File.h"
#include "utils/log.h"
#include "FileItem.h"
+#include "utils/URIUtils.h"
//========================================================================
CFileIDataSource::CFileIDataSource(const char *url)
@@ -50,7 +51,7 @@ void* CFileIDataSource::Open(char* url, enum EDSResult *pRes)
unsigned int flags = READ_BITRATE;
XFILE::CFile *cfile = new XFILE::CFile();
- if (CFileItem(m_url, false).IsInternetStream())
+ if (CFileItem(m_url, false).IsInternetStream() || URIUtils::IsLiveTV(url))
flags |= READ_CACHED;
// open file in binary mode
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index c438b63..9f8a747 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -225,7 +225,10 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
else if (extension.Equals(".aac"))
format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_AAC | MTYPE_CONT_UNKNOWN;
else
- return false;
+ {
+ format.mediaType = MTYPE_APP_NONE;
+ m_dvd_mediatype = false;
+ }
}
m_amp_media = new CSMPMediaSpace(m_amp, format.mediaType);
@@ -282,6 +285,9 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
// some param :)
parameters.tsSkip = ts_skip;
+ if(URIUtils::IsLiveTV(itempath))
+ parameters.sourceSeekSupport = SLPBOpenParams::LPBSourceSeekSupport_Disabled;
+
// find any available external subtitles
// SRT, SSA, ASS, SUB, SMI or binary SUB/IDX
std::vector<CStdString> filenames;
https://github.com/xbmc/xbmc/commit/8a147df5bc73d1daae8e4a668f98f449ed32e3c8
commit 8a147df5bc73d1daae8e4a668f98f449ed32e3c8
Merge: 4755e3e e65f867
Author: davilla <davilla@...>
Date: Tue Feb 21 06:52:40 2012 -0800
Merge pull request #23 from SigmaDesigns/xbmc-buildroot
Fixed initial seek
https://github.com/xbmc/xbmc/commit/e65f867cdac67aadb6c60f86bb6d71d17c55851b
commit e65f867cdac67aadb6c60f86bb6d71d17c55851b
Author: Gilles Vieira <gilles_vieira@...>
Date: Tue Feb 21 15:40:23 2012 +0100
Fixed initial seek
diff --git a/xbmc/cores/smpplayer/SMPFileInfo.cpp b/xbmc/cores/smpplayer/SMPFileInfo.cpp
index e97535f..8b4afbd 100755
--- a/xbmc/cores/smpplayer/SMPFileInfo.cpp
+++ b/xbmc/cores/smpplayer/SMPFileInfo.cpp
@@ -147,7 +147,7 @@ bool CSMPFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &str
parameters.videoOnly = true;
- if (format.mediaType & MTYPE_CONT_M2TS)
+ if ((format.mediaType & MTYPE_CONT_M2TS) == MTYPE_CONT_M2TS)
parameters.tsStartOffset = 1024*1024;
else
{
https://github.com/xbmc/xbmc/commit/4755e3ecacdee16a0a8ee1919812682dc8b713e1
commit 4755e3ecacdee16a0a8ee1919812682dc8b713e1
Author: theuni <theuni-nospam-@...>
Date: Mon Feb 20 19:46:39 2012 -0500
[smp] fix blending between layers
diff --git a/xbmc/rendering/gles/RenderSystemGLES.cpp b/xbmc/rendering/gles/RenderSystemGLES.cpp
index be5449b..84ffe83 100644
--- a/xbmc/rendering/gles/RenderSystemGLES.cpp
+++ b/xbmc/rendering/gles/RenderSystemGLES.cpp
@@ -191,7 +191,11 @@ bool CRenderSystemGLES::ResetRenderSystem(int width, int height, bool fullScreen
g_matrices.MatrixMode(MM_MODELVIEW);
g_matrices.LoadIdentity();
+#if defined(HAS_SIGMASMP)
+ glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_ONE);
+#else
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+#endif
glEnable(GL_BLEND); // Turn Blending On
m_blending = true;
https://github.com/xbmc/xbmc/commit/e452166f69c59ddb7de735c9d3ec58106ee7d95d
commit e452166f69c59ddb7de735c9d3ec58106ee7d95d
Author: theuni <theuni-nospam-@...>
Date: Sun Feb 19 02:29:55 2012 -0500
[smp] fix corrupted images (bad stride) when skipping upload
diff --git a/xbmc/guilib/Texture.cpp b/xbmc/guilib/Texture.cpp
index e05d218..ccaa38e 100644
--- a/xbmc/guilib/Texture.cpp
+++ b/xbmc/guilib/Texture.cpp
@@ -556,7 +556,10 @@ bool CBaseTexture::LoadHWAccelerated(const CStdString& texturePath)
dsc.width = PadPow2(img_width);
dsc.height = PadPow2(img_height);
}
-
+
+ // PVR only seems happy with textures with a width divisible by 4
+ dsc.width = (((int)img_width + 3) / 4) * 4;
+
// set caps to DSCAPS_VIDEOONLY so we get hw decode.
dsc.caps = (DFBSurfaceCapabilities)(dsc.caps | DSCAPS_VIDEOONLY | DSCAPS_PAGE_ALIGNED);
dsc.caps = (DFBSurfaceCapabilities)(dsc.caps &~DSCAPS_SYSTEMONLY);
https://github.com/xbmc/xbmc/commit/8ec7c3d2ebcefaa7e40ff428aa6460b7b058b7b8
commit 8ec7c3d2ebcefaa7e40ff428aa6460b7b058b7b8
Merge: 21fbdb0 47f90e2
Author: davilla <davilla@...>
Date: Fri Feb 17 08:35:11 2012 -0800
Merge pull request #22 from SigmaDesigns/xbmc-buildroot
2 changes...
https://github.com/xbmc/xbmc/commit/47f90e276e4bdf15120fdf82e806769154ce05b9
commit 47f90e276e4bdf15120fdf82e806769154ce05b9
Merge: 4951d2d 21fbdb0
Author: Gilles Vieira <gilles_vieira@...>
Date: Fri Feb 17 14:17:45 2012 +0100
Merge remote branch 'atlastech/xbmc-buildroot' into xbmc-buildroot
https://github.com/xbmc/xbmc/commit/21fbdb0dfc73c30134b8748c9f1ba8743f2c6524
commit 21fbdb0dfc73c30134b8748c9f1ba8743f2c6524
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 17 00:58:36 2012 -0500
[smp] allow disabling of categories in as.xml
Use a dummy for value.
diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp
index 8667dda..6a7c567 100644
--- a/xbmc/settings/GUISettings.cpp
+++ b/xbmc/settings/GUISettings.cpp
@@ -878,6 +878,17 @@ void CGUISettings::AddGroup(int groupID, int labelID)
CSettingsCategory* CGUISettings::AddCategory(int groupID, const char *strSetting, int labelID)
{
+
+ for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
+ i != g_advancedSettings.m_settingsOverride.end(); i++)
+ {
+ if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0)
+ {
+ if (i->hidden)
+ return NULL;
+ }
+ }
+
for (unsigned int i = 0; i < settingsGroups.size(); i++)
{
if (settingsGroups[i]->GetGroupID() == groupID)
https://github.com/xbmc/xbmc/commit/b62a299f7145e8f25dd20f2e914800230640877b
commit b62a299f7145e8f25dd20f2e914800230640877b
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 17 00:52:18 2012 -0500
[smp] make all Add* implementations the same for easier factorization later
diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp
index b560673..8667dda 100644
--- a/xbmc/settings/GUISettings.cpp
+++ b/xbmc/settings/GUISettings.cpp
@@ -910,6 +910,8 @@ void CGUISettings::AddSeparator(CSettingsCategory* cat, const char *strSetting)
void CGUISettings::AddBool(CSettingsCategory* cat, const char *strSetting, int iLabel, bool bData, int iControlType)
{
int iOrder = cat?++cat->m_entries:0;
+ CSettingBool* pSetting = new CSettingBool(iOrder, CStdString(strSetting).ToLower(), iLabel, bData, iControlType);
+ if (!pSetting) return ;
for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
i != g_advancedSettings.m_settingsOverride.end(); i++)
@@ -917,20 +919,16 @@ void CGUISettings::AddBool(CSettingsCategory* cat, const char *strSetting, int i
if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0)
{
if (i->hidden)
- iOrder = 0;
- bool override = false;
- if (i->value.Equals("true") || i->value.Equals("0"))
- override = true;
- CSettingBool* pSetting = new CSettingBool(iOrder, CStdString(strSetting).ToLower(), iLabel, override, iControlType);
- if (!pSetting) return ;
+ pSetting->SetOrder(0);
+ if (pSetting)
+ {
+ pSetting->FromString(i->value.c_str());
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
- return;
+ return;
+ }
}
}
-
- CSettingBool* pSetting = new CSettingBool(iOrder, CStdString(strSetting).ToLower(), iLabel, bData, iControlType);
- if (!pSetting) return ;
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
}
bool CGUISettings::GetBool(const char *strSetting) const
@@ -980,21 +978,25 @@ void CGUISettings::ToggleBool(const char *strSetting)
void CGUISettings::AddFloat(CSettingsCategory* cat, const char *strSetting, int iLabel, float fData, float fMin, float fStep, float fMax, int iControlType)
{
int iOrder = cat?++cat->m_entries:0;
+ CSettingFloat* pSetting = new CSettingFloat(iOrder, CStdString(strSetting).ToLower(), iLabel, fData, fMin, fStep, fMax, iControlType);
+ if (!pSetting) return ;
+
for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
i != g_advancedSettings.m_settingsOverride.end(); i++)
{
if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0)
{
if (i->hidden)
- iOrder = 0;
- CSettingFloat* pSetting = new CSettingFloat(iOrder, CStdString(strSetting).ToLower(), iLabel, (float)atof((i->value.c_str())), fMin, fStep, fMax, iControlType);
- if (!pSetting) return ;
+ pSetting->SetOrder(0);
+ if (pSetting)
+ {
+ pSetting->FromString(i->value.c_str());
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
- return;
+ return;
+ }
}
}
- CSettingFloat* pSetting = new CSettingFloat(iOrder, CStdString(strSetting).ToLower(), iLabel, fData, fMin, fStep, fMax, iControlType);
- if (!pSetting) return ;
+
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
}
@@ -1040,6 +1042,7 @@ void CGUISettings::AddInt(CSettingsCategory* cat, const char *strSetting, int iL
{
int iOrder = cat?++cat->m_entries:0;
CSettingInt* pSetting = new CSettingInt(iOrder, CStdString(strSetting).ToLower(), iLabel, iData, iMin, iStep, iMax, iControlType, strFormat);
+ if (!pSetting) return ;
for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
i != g_advancedSettings.m_settingsOverride.end(); i++)
@@ -1057,7 +1060,6 @@ void CGUISettings::AddInt(CSettingsCategory* cat, const char *strSetting, int iL
}
}
- if (!pSetting) return ;
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
}
@@ -1120,6 +1122,7 @@ void CGUISettings::AddHex(CSettingsCategory* cat, const char *strSetting, int iL
int iOrder = cat?++cat->m_entries:0;
CSettingHex* pSetting = new CSettingHex(iOrder, CStdString(strSetting).ToLower(), iLabel, iData, iMin, iStep, iMax, iControlType, strFormat);
if (!pSetting) return ;
+
for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
i != g_advancedSettings.m_settingsOverride.end(); i++)
{
@@ -1171,6 +1174,7 @@ void CGUISettings::AddString(CSettingsCategory* cat, const char *strSetting, int
int iOrder = cat?++cat->m_entries:0;
CSettingString* pSetting = new CSettingString(iOrder, CStdString(strSetting).ToLower(), iLabel, strData, iControlType, bAllowEmpty, iHeadingString);
if (!pSetting) return ;
+
for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
i != g_advancedSettings.m_settingsOverride.end(); i++)
{
@@ -1217,6 +1221,7 @@ void CGUISettings::AddDefaultAddon(CSettingsCategory* cat, const char *strSettin
int iOrder = cat?++cat->m_entries:0;
CSettingAddon* pSetting = new CSettingAddon(iOrder, CStdString(strSetting).ToLower(), iLabel, strData, type);
if (!pSetting) return ;
+
for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
i != g_advancedSettings.m_settingsOverride.end(); i++)
{
https://github.com/xbmc/xbmc/commit/fa728be427b33e8fbeca4c3e2a92f53b4caf57ea
commit fa728be427b33e8fbeca4c3e2a92f53b4caf57ea
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 17 00:34:43 2012 -0500
[smp] we don't control sigma's upscaling
diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
index 2939991..cd08073 100755
--- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -1866,6 +1866,9 @@ bool CLinuxRendererGLES::Supports(EINTERLACEMETHOD method)
bool CLinuxRendererGLES::Supports(ESCALINGMETHOD method)
{
+#if defined(HAS_SIGMASMP)
+ return false;
+#endif
if(method == VS_SCALINGMETHOD_NEAREST
|| method == VS_SCALINGMETHOD_LINEAR)
return true;
https://github.com/xbmc/xbmc/commit/558563db0317302dca42a37557917bca7d1e065c
commit 558563db0317302dca42a37557917bca7d1e065c
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 17 00:33:28 2012 -0500
[smp] disable features that smpplayer can't use
diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
index 8796380..2939991 100755
--- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -1798,6 +1798,7 @@ bool CLinuxRendererGLES::Supports(ERENDERFEATURE feature)
if (feature == RENDERFEATURE_NONLINSTRETCH)
return false;
+#if !defined(HAS_SIGMASMP)
if (feature == RENDERFEATURE_CROP ||
feature == RENDERFEATURE_ZOOM ||
feature == RENDERFEATURE_VERTICAL_SHIFT ||
@@ -1805,6 +1806,7 @@ bool CLinuxRendererGLES::Supports(ERENDERFEATURE feature)
feature == RENDERFEATURE_POSTPROCESS ||
feature == RENDERFEATURE_ZOOM)
return true;
+#endif
return false;
}
https://github.com/xbmc/xbmc/commit/314a543d160a619eda112caef75af1b1717e2174
commit 314a543d160a619eda112caef75af1b1717e2174
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 17 00:31:52 2012 -0500
[smp] Make some render features optional.
Particularly, players using bypass mode may need these as XBMC does not render them.
diff --git a/xbmc/cores/VideoRenderers/BaseRenderer.h b/xbmc/cores/VideoRenderers/BaseRenderer.h
index af51852..c1b0f26 100644
--- a/xbmc/cores/VideoRenderers/BaseRenderer.h
+++ b/xbmc/cores/VideoRenderers/BaseRenderer.h
@@ -47,7 +47,12 @@ enum ERENDERFEATURE
RENDERFEATURE_CONTRAST,
RENDERFEATURE_NOISE,
RENDERFEATURE_SHARPNESS,
- RENDERFEATURE_NONLINSTRETCH
+ RENDERFEATURE_NONLINSTRETCH,
+ RENDERFEATURE_CROP,
+ RENDERFEATURE_ZOOM,
+ RENDERFEATURE_VERTICAL_SHIFT,
+ RENDERFEATURE_PIXEL_RATIO,
+ RENDERFEATURE_POSTPROCESS
};
struct DVDVideoPicture;
diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
index b4ecc84..71ba625 100644
--- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
+++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
@@ -2974,6 +2974,13 @@ bool CLinuxRendererGL::Supports(ERENDERFEATURE feature)
return true;
}
+ if (feature == RENDERFEATURE_CROP ||
+ feature == RENDERFEATURE_ZOOM ||
+ feature == RENDERFEATURE_VERTICAL_SHIFT ||
+ feature == RENDERFEATURE_PIXEL_RATIO ||
+ feature == RENDERFEATURE_POSTPROCESS ||
+ feature == RENDERFEATURE_ZOOM)
+ return true;
return false;
}
diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
index 8bf9c22..8796380 100755
--- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -1798,6 +1798,13 @@ bool CLinuxRendererGLES::Supports(ERENDERFEATURE feature)
if (feature == RENDERFEATURE_NONLINSTRETCH)
return false;
+ if (feature == RENDERFEATURE_CROP ||
+ feature == RENDERFEATURE_ZOOM ||
+ feature == RENDERFEATURE_VERTICAL_SHIFT ||
+ feature == RENDERFEATURE_PIXEL_RATIO ||
+ feature == RENDERFEATURE_POSTPROCESS ||
+ feature == RENDERFEATURE_ZOOM)
+ return true;
return false;
}
diff --git a/xbmc/cores/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoRenderers/WinRenderer.cpp
index 2bca5e3..4ec96cf 100644
--- a/xbmc/cores/VideoRenderers/WinRenderer.cpp
+++ b/xbmc/cores/VideoRenderers/WinRenderer.cpp
@@ -1053,6 +1053,13 @@ bool CWinRenderer::Supports(ERENDERFEATURE feature)
if(feature == RENDERFEATURE_CONTRAST)
return true;
+ if (feature == RENDERFEATURE_CROP ||
+ feature == RENDERFEATURE_ZOOM ||
+ feature == RENDERFEATURE_VERTICAL_SHIFT ||
+ feature == RENDERFEATURE_PIXEL_RATIO ||
+ feature == RENDERFEATURE_POSTPROCESS ||
+ feature == RENDERFEATURE_ZOOM)
+ return true;
return false;
}
diff --git a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp
index 3c35e66..4a80f76 100644
--- a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp
@@ -155,15 +155,20 @@ void CGUIDialogVideoSettings::CreateSettings()
AddSpin(VIDEO_SETTINGS_SCALINGMETHOD, 16300, (int*)&g_settings.m_currentVideoSettings.m_ScalingMethod, entries);
}
- AddBool(VIDEO_SETTINGS_CROP, 644, &g_settings.m_currentVideoSettings.m_Crop);
+ if (g_renderManager.Supports(RENDERFEATURE_CROP))
+ AddBool(VIDEO_SETTINGS_CROP, 644, &g_settings.m_currentVideoSettings.m_Crop);
{
const int entries[] = {630, 631, 632, 633, 634, 635, 636 };
AddSpin(VIDEO_SETTINGS_VIEW_MODE, 629, &g_settings.m_currentVideoSettings.m_ViewMode, 7, entries);
}
- AddSlider(VIDEO_SETTINGS_ZOOM, 216, &g_settings.m_currentVideoSettings.m_CustomZoomAmount, 0.5f, 0.01f, 2.0f, FormatFloat);
- AddSlider(VIDEO_SETTINGS_VERTICAL_SHIFT, 225, &g_settings.m_currentVideoSettings.m_CustomVerticalShift, -2.0f, 0.01f, 2.0f, FormatFloat);
- AddSlider(VIDEO_SETTINGS_PIXEL_RATIO, 217, &g_settings.m_currentVideoSettings.m_CustomPixelRatio, 0.5f, 0.01f, 2.0f, FormatFloat);
- AddBool(VIDEO_SETTINGS_POSTPROCESS, 16400, &g_settings.m_currentVideoSettings.m_PostProcess);
+ if (g_renderManager.Supports(RENDERFEATURE_ZOOM))
+ AddSlider(VIDEO_SETTINGS_ZOOM, 216, &g_settings.m_currentVideoSettings.m_CustomZoomAmount, 0.5f, 0.01f, 2.0f, FormatFloat);
+ if (g_renderManager.Supports(RENDERFEATURE_VERTICAL_SHIFT))
+ AddSlider(VIDEO_SETTINGS_VERTICAL_SHIFT, 225, &g_settings.m_currentVideoSettings.m_CustomVerticalShift, -2.0f, 0.01f, 2.0f, FormatFloat);
+ if (g_renderManager.Supports(RENDERFEATURE_PIXEL_RATIO))
+ AddSlider(VIDEO_SETTINGS_PIXEL_RATIO, 217, &g_settings.m_currentVideoSettings.m_CustomPixelRatio, 0.5f, 0.01f, 2.0f, FormatFloat);
+ if (g_renderManager.Supports(RENDERFEATURE_POSTPROCESS))
+ AddBool(VIDEO_SETTINGS_POSTPROCESS, 16400, &g_settings.m_currentVideoSettings.m_PostProcess);
#ifdef HAS_VIDEO_PLAYBACK
if (g_renderManager.Supports(RENDERFEATURE_BRIGHTNESS))
https://github.com/xbmc/xbmc/commit/777ff940c6a18177b693fb30170f327b08f3f74a
commit 777ff940c6a18177b693fb30170f327b08f3f74a
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 17 00:27:58 2012 -0500
[smp] disable spin controls with only one entry
diff --git a/xbmc/settings/GUIDialogSettings.cpp b/xbmc/settings/GUIDialogSettings.cpp
index f2180a5..ff4f3c8 100644
--- a/xbmc/settings/GUIDialogSettings.cpp
+++ b/xbmc/settings/GUIDialogSettings.cpp
@@ -435,6 +435,8 @@ void CGUIDialogSettings::AddSpin(unsigned int id, int label, int *current, vecto
setting.type = SettingInfo::SPIN;
setting.data = current;
setting.entry = values;
+ if (values.size() <= 1)
+ setting.enabled = false;
m_settings.push_back(setting);
}
https://github.com/xbmc/xbmc/commit/7b9d01896d4bd6183e885b58e90db9b8e7a4bde7
commit 7b9d01896d4bd6183e885b58e90db9b8e7a4bde7
Author: theuni <theuni-nospam-@...>
Date: Fri Feb 17 00:27:26 2012 -0500
[smp] set focus to the first non-disabled control
diff --git a/xbmc/settings/GUIDialogSettings.cpp b/xbmc/settings/GUIDialogSettings.cpp
index 609a299..f2180a5 100644
--- a/xbmc/settings/GUIDialogSettings.cpp
+++ b/xbmc/settings/GUIDialogSettings.cpp
@@ -481,6 +481,14 @@ void CGUIDialogSettings::OnInitWindow()
SetupPage();
// set the default focus control
m_lastControlID = CONTROL_START;
+ for (unsigned int i = 0; i < m_settings.size(); i++)
+ {
+ if (m_settings.at(i).enabled)
+ {
+ m_lastControlID = CONTROL_START + i;
+ break;
+ }
+ }
CGUIDialog::OnInitWindow();
}
https://github.com/xbmc/xbmc/commit/a6ba5598a95a9d9f3beef69d0332c1d1e68d076a
commit a6ba5598a95a9d9f3beef69d0332c1d1e68d076a
Author: theuni <theuni-nospam-@...>
Date: Thu Feb 16 19:11:56 2012 -0500
[smp] fix a missed ffmpeg include
diff --git a/xbmc/cdrip/CDDARipper.cpp b/xbmc/cdrip/CDDARipper.cpp
index 6b75961..54d2720 100644
--- a/xbmc/cdrip/CDDARipper.cpp
+++ b/xbmc/cdrip/CDDARipper.cpp
@@ -31,7 +31,9 @@
#include "EncoderLame.h"
#include "EncoderWav.h"
#include "EncoderVorbis.h"
+#if defined(USE_FFMPEG)
#include "EncoderFFmpeg.h"
+#endif
#include "EncoderFlac.h"
#include "filesystem/CDDADirectory.h"
#include "music/tags/MusicInfoTagLoaderFactory.h"
https://github.com/xbmc/xbmc/commit/a9b02d4e9c36e3d422e167d7f30aae5626a5dc56
commit a9b02d4e9c36e3d422e167d7f30aae5626a5dc56
Author: theuni <theuni-nospam-@...>
Date: Thu Feb 16 15:34:23 2012 -0500
[smp] Fix slow gui during fullscreen playback
If we're using bypass mode for playback, we aren't rendering ourselves, so
don't try to wait for render events.
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 238c16d..a21e12b 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -2019,7 +2019,7 @@ void CApplication::Render()
bool extPlayerActive = m_eCurrentPlayer >= EPC_EXTPLAYER && IsPlaying() && !m_AppFocused;
m_bPresentFrame = false;
- if (!extPlayerActive && g_graphicsContext.IsFullScreenVideo() && !IsPaused())
+ if (!extPlayerActive && g_graphicsContext.IsFullScreenVideo() && !IsPaused() && g_renderManager.RendererHandlesPresent())
{
CSingleLock lock(m_frameMutex);
diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp
index 7da5eab..5de565a 100644
--- a/xbmc/cores/VideoRenderers/RenderManager.cpp
+++ b/xbmc/cores/VideoRenderers/RenderManager.cpp
@@ -240,6 +240,9 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi
g_application.getApplicationMessenger().SwitchToFullscreen();
lock.Enter();
}
+ if( flags & CONF_FLAGS_FORMAT_BYPASS )
+ m_presentmethod = PRESENT_METHOD_BYPASS;
+
m_pRenderer->Update(false);
m_bIsStarted = true;
m_bReconfigured = true;
@@ -250,6 +253,11 @@ bool CXBMCRenderManager::Configure(unsigned int width, unsigned int height, unsi
return result;
}
+bool CXBMCRenderManager::RendererHandlesPresent()
+{
+ return IsConfigured() && m_presentmethod != PRESENT_METHOD_BYPASS;
+}
+
bool CXBMCRenderManager::IsConfigured()
{
if (!m_pRenderer)
diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h
index 961b19f..c1e6e14 100644
--- a/xbmc/cores/VideoRenderers/RenderManager.h
+++ b/xbmc/cores/VideoRenderers/RenderManager.h
@@ -158,6 +158,8 @@ public:
void UpdateResolution();
+ bool RendererHandlesPresent();
+
unsigned int GetProcessorSize()
{
CSharedLock lock(m_sharedSection);
@@ -214,6 +216,7 @@ protected:
PRESENT_METHOD_BLEND,
PRESENT_METHOD_WEAVE,
PRESENT_METHOD_BOB,
+ PRESENT_METHOD_BYPASS,
};
https://github.com/xbmc/xbmc/commit/88cf4a45b88ffbc50b1d8afd444b77ed707f7917
commit 88cf4a45b88ffbc50b1d8afd444b77ed707f7917
Author: theuni <theuni-nospam-@...>
Date: Thu Feb 16 13:11:05 2012 -0500
[smp] Fallback to sw upload for failed hw jpeg decode
diff --git a/xbmc/guilib/TextureGL.cpp b/xbmc/guilib/TextureGL.cpp
index f2a7791..95beae7 100644
--- a/xbmc/guilib/TextureGL.cpp
+++ b/xbmc/guilib/TextureGL.cpp
@@ -88,7 +88,10 @@ void CGLTexture::DestroyTextureObject()
glDeleteTextures(1, (GLuint*) &m_texture);
#ifdef HAS_EGL
if (m_textureImage && eglDestroyImageKHR)
+ {
eglDestroyImageKHR((EGLDisplay)g_Windowing.GetDisplay(), m_textureImage);
+ m_textureImage = NULL;
+ }
#endif
}
@@ -182,10 +185,25 @@ void CGLTexture::LoadToGPU()
#endif
#if defined (HAS_DIRECTFB)
#if defined (HAS_EGL)
+ m_textureImage = NULL;
+ int imgpitch = 0;
+ void *imgsrc = NULL;
if (m_dfbSurface && eglCreateImageKHR)
{
- m_textureImage = eglCreateImageKHR((EGLDisplay)g_Windowing.GetDisplay(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer)m_dfbSurface, NULL);
- if (m_textureImage != EGL_NO_IMAGE_KHR && glEGLImageTargetTexture2DOES)
+ DFBResult dfb_status;
+ int phyAddr;
+ m_dfbSurface->Lock(m_dfbSurface, DSLF_READ , &imgsrc, &imgpitch);
+ dfb_status = m_dfbSurface->GetFramebufferOffset(m_dfbSurface, &phyAddr);
+ if (dfb_status == DFB_OK)
+ {
+ m_dfbSurface->Unlock(m_dfbSurface);
+ m_textureImage = eglCreateImageKHR((EGLDisplay)g_Windowing.GetDisplay(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer)m_dfbSurface, NULL);
+ }
+ else
+ {
+ CLog::Log(LOGDEBUG, "Hardware decode failed. Falling back to software upload.");
+ }
+ if (m_textureImage && m_textureImage != EGL_NO_IMAGE_KHR && glEGLImageTargetTexture2DOES)
{
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, m_textureImage);
CLog::Log(LOGDEBUG, "Uploading texture using an EGLImage.");
@@ -196,9 +214,6 @@ void CGLTexture::LoadToGPU()
#endif
if (m_format & XB_FMT_DFBSURFACE)
{
- int imgpitch = 0;
- void *imgsrc = NULL;
- m_dfbSurface->Lock(m_dfbSurface, DSLF_READ , &imgsrc, &imgpitch);
glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, m_textureWidth, m_textureHeight, 0,
GL_BGRA_EXT, GL_UNSIGNED_BYTE, imgsrc);
VerifyGLState();
https://github.com/xbmc/xbmc/commit/354527e3007687f2877a0c54239da06bca7b49f3
commit 354527e3007687f2877a0c54239da06bca7b49f3
Author: theuni <theuni-nospam-@...>
Date: Thu Feb 16 10:56:29 2012 -0500
[smp] only hw decode jpegs that are 256x256 or bigger
diff --git a/xbmc/guilib/Texture.cpp b/xbmc/guilib/Texture.cpp
index 2ba2e2b..e05d218 100644
--- a/xbmc/guilib/Texture.cpp
+++ b/xbmc/guilib/Texture.cpp
@@ -212,20 +212,19 @@ bool CBaseTexture::LoadFromFile(const CStdString& texturePath, unsigned int maxW
return false;
}
-#if defined (HAS_DIRECTFB)
- if (URIUtils::GetExtension(texturePath).Equals(".jpg") || URIUtils::GetExtension(texturePath).Equals(".tbn"))
- {
- if (LoadHWAccelerated(texturePath))
- return true;
- }
-#endif
-
//ImageLib is sooo sloow for jpegs. Try our own decoder first. If it fails, fall back to ImageLib.
if (URIUtils::GetExtension(texturePath).Equals(".jpg") || URIUtils::GetExtension(texturePath).Equals(".tbn"))
{
CJpegIO jpegfile;
if (jpegfile.Open(texturePath))
{
+#if defined (HAS_DIRECTFB)
+ if (jpegfile.Width() >= 256 && jpegfile.Height() >= 256)
+ {
+ if (LoadHWAccelerated(texturePath))
+ return true;
+ }
+#endif
if (jpegfile.Width() > 0 && jpegfile.Height() > 0)
{
Allocate(jpegfile.Width(), jpegfile.Height(), XB_FMT_A8R8G8B8);
https://github.com/xbmc/xbmc/commit/4951d2de08eb4c3f2c72320aad3682d3664d5f09
commit 4951d2de08eb4c3f2c72320aad3682d3664d5f09
Merge: 312e24d e069ef3
Author: Gilles Vieira <gilles_vieira@...>
Date: Wed Feb 15 18:23:55 2012 +0100
Merge remote branch 'atlastech/xbmc-buildroot' into xbmc-buildroot
https://github.com/xbmc/xbmc/commit/20e1f4af74563ef35e3a5fea716418e8e8a45c05
commit 20e1f4af74563ef35e3a5fea716418e8e8a45c05
Author: theuni <theuni-nospam-@...>
Date: Wed Feb 15 12:06:18 2012 -0500
[smp] make this look like before, split was for testing
diff --git a/xbmc/music/tags/Makefile.in b/xbmc/music/tags/Makefile.in
index 2229391..d1e84aa 100644
--- a/xbmc/music/tags/Makefile.in
+++ b/xbmc/music/tags/Makefile.in
@@ -13,20 +13,18 @@ SRCS=APEv2Tag.cpp \
MusicInfoTagLoaderMod.cpp \
MusicInfoTagLoaderMP3.cpp \
MusicInfoTagLoaderMP4.cpp \
+ MusicInfoTagLoaderMPC.cpp \
MusicInfoTagLoaderNSF.cpp \
+ MusicInfoTagLoaderOgg.cpp \
MusicInfoTagLoaderShn.cpp \
MusicInfoTagLoaderSPC.cpp \
+ MusicInfoTagLoaderWav.cpp \
+ MusicInfoTagLoaderWavPack.cpp \
MusicInfoTagLoaderWMA.cpp \
MusicInfoTagLoaderYM.cpp \
+ OggTag.cpp \
VorbisTag.cpp \
-SRCS+=\
- MusicInfoTagLoaderMPC.cpp \
- MusicInfoTagLoaderOgg.cpp \
- MusicInfoTagLoaderWav.cpp \
- MusicInfoTagLoaderWavPack.cpp \
- OggTag.cpp
-
LIB=musictags.a
include ../../../Makefile.include
https://github.com/xbmc/xbmc/commit/e069ef314518d403554f0d1f3401541b34d5035f
commit e069ef314518d403554f0d1f3401541b34d5035f
Author: theuni <theuni-nospam-@...>
Date: Wed Feb 15 11:51:57 2012 -0500
[smp] disable ffmpeg and exclude it from export
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..4bf7075
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+lib/ffmpeg export-ignore
diff --git a/tools/sigma/Makefile b/tools/sigma/Makefile
index e5be496..082c0aa 100644
--- a/tools/sigma/Makefile
+++ b/tools/sigma/Makefile
@@ -10,7 +10,7 @@ export PYTHON_NOVERSIONCHECK=no-check
CONFIGURE=./configure --build=$(BUILD) --host=$(HOST) --prefix=/usr \
--enable-gles --disable-optical-drive --disable-dvdcss --enable-optimizations \
- --disable-x11 --disable-libbluray --disable-sdl --enable-directfb
+ --disable-x11 --disable-libbluray --disable-sdl --enable-directfb --disable-ffmpeg
all: configure
configure:
https://github.com/xbmc/xbmc/commit/5523d559415e45706b65d247363e16b5e0878acf
commit 5523d559415e45706b65d247363e16b5e0878acf
Author: theuni <theuni-nospam-@...>
Date: Wed Feb 15 11:48:12 2012 -0500
[smp] add --disable-ffmpeg flag.
diff --git a/.gitignore b/.gitignore
index 940ba34..87a25a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -997,6 +997,9 @@ xbmc/cores/smpplayer/Makefile
# /xbmc/music/karaoke/
/xbmc/music/karaoke/Makefile
+# /xbmc/music/tags/
+/xbmc/music/tags/Makefile
+
# /lib/libapetag/
/lib/libapetag/Makefile
/lib/libapetag/libtool
diff --git a/configure.in b/configure.in
index f63b780..7565574 100755
--- a/configure.in
+++ b/configure.in
@@ -130,6 +130,7 @@ libusb_disabled_udev_found="== libusb disabled. =="
libcec_enabled="== libcec enabled. =="
libcec_disabled="== libcec disabled. CEC adapter support will not be available. =="
libcec_disabled_missing_libs="== libcec disabled because both libudev and libusb are not available. CEC adapter support will not be available. =="
+ffmpeg_disabled="== FFmpeg support manually disabled. =="
# External library message strings
external_libraries_enabled="== Use of all supported external libraries enabled. =="
@@ -328,6 +329,12 @@ AC_ARG_ENABLE([airtunes],
[use_airtunes=$enableval],
[use_airtunes=auto])
+AC_ARG_ENABLE([ffmpeg],
+ [AS_HELP_STRING([--enable-ffmpeg],
+ [enable internal FFmpeg libraries (default is yes)])],
+ [use_ffmpeg=$enableval],
+ [use_ffmpeg=yes])
+
AC_ARG_ENABLE([ffmpeg_libvorbis],
[AS_HELP_STRING([--enable-ffmpeg-libvorbis],
[enable FFmpeg vorbis encoding (default is no)])],
@@ -1286,6 +1293,7 @@ if test "$use_external_ffmpeg" = "yes"; then
[[#include <libavfilter/avfilter.h>]])
AC_MSG_NOTICE($external_ffmpeg_enabled)
+ SKIP_CONFIG_FFMPEG=1
USE_EXTERNAL_FFMPEG=1
AC_DEFINE([USE_EXTERNAL_FFMPEG], [1], [Whether to use external FFmpeg libraries.])
@@ -1312,6 +1320,7 @@ if test "$use_external_ffmpeg" = "yes"; then
else
AC_MSG_NOTICE($external_ffmpeg_disabled)
USE_EXTERNAL_FFMPEG=0
+ SKIP_CONFIG_FFMPEG=0
AC_DEFINE([PIX_FMT_VDPAU_MPEG4_IN_AVUTIL], [1], [Whether AVUtil defines PIX_FMT_VDPAU_MPEG4.])
fi
@@ -1327,6 +1336,17 @@ else
AC_MSG_NOTICE([Using Python $PYTHON_VERSION])
fi
+if test "x$use_ffmpeg" != "xno"; then
+ USE_FFMPEG=1
+ SKIP_CONFIG_FFMPEG=0
+ AC_DEFINE([USE_FFMPEG], [1], [Whether to use FFmpeg libraries.])
+else
+ use_vdpau=no
+ USE_FFMPEG=0
+ SKIP_CONFIG_FFMPEG=1
+ AC_MSG_NOTICE($ffmpeg_disabled)
+fi
+
# VDPAU
if test "x$use_vdpau" != "xno"; then
if test "$host_vendor" = "apple" ; then
@@ -1602,6 +1622,12 @@ else
final_message="$final_message\n DBUS:\t\tNo"
fi
+if test "x$use_ffmpeg" != "xno"; then
+ final_message="$final_message\n FFmpeg:\tYes"
+else
+ final_message="$final_message\n FFmpeg:\tNo"
+fi
+
if test "x$use_vdpau" != "xno"; then
final_message="$final_message\n VDPAU:\tYes"
else
@@ -1919,6 +1945,7 @@ OUTPUT_FILES="Makefile \
lib/snesapu/SNES/SNESAPU/Makefile \
lib/stsound/StSoundLibrary/Makefile \
xbmc/cores/playercorefactory/Makefile \
+ xbmc/music/tags/Makefile \
xbmc/music/karaoke/Makefile \
xbmc/osx/Makefile \
xbmc/guilib/Makefile \
@@ -2013,7 +2040,7 @@ AC_SUBST(USE_AIRTUNES)
AC_SUBST(USE_LIBUDEV)
AC_SUBST(USE_LIBUSB)
AC_SUBST(USE_LIBCEC)
-
+AC_SUBST(USE_FFMPEG)
# pushd and popd are not available in other shells besides bash, so implement
# our own pushd/popd functions
@@ -2148,7 +2175,7 @@ XB_CONFIG_MODULE([lib/ffmpeg], [
sed -i -e "s#define HAVE_SYMVER 1#define HAVE_SYMVER 0#" config.h &&
sed -i -e "s#define HAVE_SYMVER_GNU_ASM 1#define HAVE_SYMVER_GNU_ASM 0#" config.h
fi
-], [$USE_EXTERNAL_FFMPEG])
+], [$SKIP_CONFIG_FFMPEG])
XB_CONFIG_MODULE([lib/libdvd/libdvdcss], [
./configure \
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 3550582..ed59b73 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -18,12 +18,12 @@ WRAPPER=@abs_top_srcdir@...
WRAPPER_MACH_ALIAS=@abs_top_srcdir@...
DIRS=
-ifneq (@USE_EXTERNAL_FFMPEG@...)
+ifneq ($(or $(findstring 1,@USE_EXTERNAL_FFMPEG@... 0,@USE_FFMPEG@)),)
DIRS+=ffmpeg
endif
LIBS=
-ifneq (@USE_EXTERNAL_FFMPEG@...)
+ifeq ($(or $(findstring 1,@USE_EXTERNAL_FFMPEG@... 0,@USE_FFMPEG@)),)
LIBS+=avutil-50-$(ARCH).so \
avcodec-52-$(ARCH).so \
avcore-0-$(ARCH).so \
diff --git a/xbmc/cdrip/Makefile.in b/xbmc/cdrip/Makefile.in
index fcce72e..b681bb6 100644
--- a/xbmc/cdrip/Makefile.in
+++ b/xbmc/cdrip/Makefile.in
@@ -1,12 +1,15 @@
SRCS=CDDARipper.cpp \
CDDAReader.cpp \
Encoder.cpp \
- EncoderFFmpeg.cpp \
EncoderFlac.cpp \
EncoderLame.cpp \
EncoderVorbis.cpp \
EncoderWav.cpp \
+ifeq (@USE_FFMPEG@...)
+SRCS += EncoderFFmpeg.cpp
+endif
+
LIB=cdrip.a
include @abs_top_srcdir@...
diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
index 3082b3b..8bf9c22 100755
--- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -41,10 +41,10 @@
#include "windowing/WindowingFactory.h"
#include "dialogs/GUIDialogKaiToast.h"
#include "guilib/Texture.h"
-#include "lib/DllSwScale.h"
#include "../dvdplayer/DVDCodecs/Video/OpenMaxVideo.h"
#include "threads/SingleLock.h"
#include "RenderCapture.h"
+#include "utils/log.h"
#if defined(__ARM_NEON__)
#include "yuv2rgb.neon.h"
#endif
@@ -52,6 +52,9 @@
#include "DVDCodecs/Video/DVDVideoCodecVideoToolBox.h"
#include <CoreVideo/CoreVideo.h>
#endif
+#if defined(USE_FFMPEG)
+#include "lib/DllSwScale.h"
+#endif
using namespace Shaders;
@@ -101,7 +104,9 @@ CLinuxRendererGLES::CLinuxRendererGLES()
m_rgbBuffer = NULL;
m_rgbBufferSize = 0;
+#if defined(USE_FFMPEG)
m_dllSwScale = new DllSwScale;
+#endif
m_sw_context = NULL;
}
@@ -123,7 +128,9 @@ CLinuxRendererGLES::~CLinuxRendererGLES()
m_pYUVShader = NULL;
}
+#if defined(USE_FFMPEG)
delete m_dllSwScale;
+#endif
}
void CLinuxRendererGLES::ManageTextures()
@@ -506,8 +513,10 @@ unsigned int CLinuxRendererGLES::PreInit()
// setup the background colour
m_clearColour = (float)(g_advancedSettings.m_videoBlackBarColour & 0xff) / 0xff;
+#if defined(USE_FFMPEG)
if (!m_dllSwScale->Load())
CLog::Log(LOGERROR,"CLinuxRendererGL::PreInit - failed to load rescale libraries!");
+#endif
return true;
}
@@ -697,11 +706,13 @@ void CLinuxRendererGLES::UnInit()
for (int i = 0; i < NUM_BUFFERS; ++i)
(this->*m_textureDelete)(i);
+#if defined(USE_FFMPEG)
if (m_dllSwScale && m_sw_context)
{
m_dllSwScale->sws_freeContext(m_sw_context);
m_sw_context = NULL;
}
+#endif
// cleanup framebuffer object if it was in use
m_fbo.Cleanup();
m_bValidated = false;
@@ -761,8 +772,10 @@ void CLinuxRendererGLES::Render(DWORD flags, int index)
}
else
{
+#if defined(USE_FFMPEG) || defined(__ARM_NEON__)
RenderSoftware(index, m_currentField);
VerifyGLState();
+#endif
}
}
@@ -1328,7 +1341,7 @@ void CLinuxRendererGLES::UploadYV12Texture(int source)
#if defined(__ARM_NEON__)
yuv420_2_rgb8888_neon(m_rgbBuffer, im->plane[0], im->plane[2], im->plane[1],
m_sourceWidth, m_sourceHeight, im->stride[0], im->stride[1], m_sourceWidth * 4);
-#else
+#elif defined(USE_FFMPEG)
m_sw_context = m_dllSwScale->sws_getCachedContext(m_sw_context,
im->width, im->height, PIX_FMT_YUV420P,
im->width, im->height, PIX_FMT_RGBA,
@@ -1338,7 +1351,11 @@ void CLinuxRendererGLES::UploadYV12Texture(int source)
int srcStride[] = { im->stride[0], im->stride[1], im->stride[2], 0 };
uint8_t *dst[] = { m_rgbBuffer, 0, 0, 0 };
int dstStride[] = { m_sourceWidth*4, 0, 0, 0 };
+
m_dllSwScale->sws_scale(m_sw_context, src, srcStride, 0, im->height, dst, dstStride);
+#else
+ //We should add our own sw implementation here.
+ CLog::Log(LOGDEBUG, "No YUV->RGB implementation available.");
#endif
}
diff --git a/xbmc/cores/dvdplayer/DVDAudio.h b/xbmc/cores/dvdplayer/DVDAudio.h
index 1f1393d..af45eaa 100644
--- a/xbmc/cores/dvdplayer/DVDAudio.h
+++ b/xbmc/cores/dvdplayer/DVDAudio.h
@@ -32,6 +32,7 @@
#ifndef _LINUX
enum CodecID;
#else
+#if defined(USE_FFMPEG)
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
@@ -43,6 +44,9 @@ extern "C" {
#include "libavcodec/avcodec.h"
#endif
}
+#else
+#include "FFMpegInternals.h"
+#endif //USE_FFMPEG
#endif
typedef struct stDVDAudioFrame DVDAudioFrame;
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
index ed999f1..2d170bd 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodec.h
@@ -28,7 +28,11 @@
#include "config.h"
#endif
#include <vector>
+#if defined(USE_FFMPEG)
#include "DllAvCodec.h"
+#else
+#include "FFMpegInternals.h"
+#endif
struct AVStream;
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in
index c40ee33..59ca452 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Makefile.in
@@ -2,12 +2,16 @@ INCLUDES+=-I@...
CXXFLAGS+=-DHAVE_MMX
-SRCS= DVDAudioCodecFFmpeg.cpp \
- DVDAudioCodecLibMad.cpp \
- DVDAudioCodecLPcm.cpp \
- DVDAudioCodecPassthroughFFmpeg.cpp \
- DVDAudioCodecPcm.cpp \
- Encoders/DVDAudioEncoderFFmpeg.cpp
+SRCS= DVDAudioCodecLibMad.cpp \
+ DVDAudioCodecLPcm.cpp \
+ DVDAudioCodecPcm.cpp \
+
+ifeq (@USE_FFMPEG@...)
+SRCS+= DVDAudioCodecFFmpeg.cpp \
+ DVDAudioCodecPassthroughFFmpeg.cpp \
+ Encoders/DVDAudioEncoderFFmpeg.cpp \
+
+endif
LIB=Audio.a
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
index 7897d1d..19510d1 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecUtils.cpp
@@ -24,7 +24,9 @@
#include "cores/VideoRenderers/RenderManager.h"
#include "utils/log.h"
#include "utils/fastmemcpy.h"
+#if defined(HAS_FFMPEG)
#include "DllSwScale.h"
+#endif
// allocate a new picture (PIX_FMT_YUV420P)
DVDVideoPicture* CDVDCodecUtils::AllocatePicture(int iWidth, int iHeight)
@@ -220,6 +222,7 @@ DVDVideoPicture* CDVDCodecUtils::ConvertToNV12Picture(DVDVideoPicture *pSrc)
DVDVideoPicture* CDVDCodecUtils::ConvertToYUV422PackedPicture(DVDVideoPicture *pSrc, DVDVideoPicture::EFormat format)
{
+#if defined(HAS_FFMPEG)
// Clone a YV12 picture to new YUY2 or UYVY picture.
DVDVideoPicture* pPicture = new DVDVideoPicture;
if (pPicture)
@@ -277,6 +280,9 @@ DVDVideoPicture* CDVDCodecUtils::ConvertToYUV422PackedPicture(DVDVideoPicture *p
}
}
return pPicture;
+#else
+ return NULL;
+#endif
}
bool CDVDCodecUtils::CopyNV12Picture(YV12Image* pImage, DVDVideoPicture *pSrc)
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h b/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h
index f2e18e5..2859ab1 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h
+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDCodecs.h
@@ -42,6 +42,7 @@ extern "C" {
#ifndef __GNUC__
#pragma warning(disable:4244)
#endif
+#if defined(USE_FFMPEG)
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
#include <libavcodec/avcodec.h>
@@ -51,6 +52,7 @@ extern "C" {
#else
#include "libavcodec/avcodec.h"
#endif
+#endif
}
// 0x100000 is the video starting range
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
index 5cdc226..e45e6d8 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
@@ -31,21 +31,25 @@
#if defined(HAVE_VIDEOTOOLBOXDECODER)
#include "Video/DVDVideoCodecVideoToolBox.h"
#endif
+#if defined(HAS_FFMPEG)
#include "Video/DVDVideoCodecFFmpeg.h"
+#include "Audio/DVDAudioCodecFFmpeg.h"
+#include "Overlay/DVDOverlayCodecFFmpeg.h"
+#include "Audio/DVDAudioCodecPassthroughFFmpeg.h"
+#else
+#include "FFMpegInternals.h"
+#endif
#include "Video/DVDVideoCodecOpenMax.h"
#include "Video/DVDVideoCodecLibMpeg2.h"
#if defined(HAVE_LIBCRYSTALHD)
#include "Video/DVDVideoCodecCrystalHD.h"
#endif
-#include "Audio/DVDAudioCodecFFmpeg.h"
#include "Audio/DVDAudioCodecLibMad.h"
#include "Audio/DVDAudioCodecPcm.h"
#include "Audio/DVDAudioCodecLPcm.h"
-#include "Audio/DVDAudioCodecPassthroughFFmpeg.h"
#include "Overlay/DVDOverlayCodecSSA.h"
#include "Overlay/DVDOverlayCodecText.h"
#include "Overlay/DVDOverlayCodecTX3G.h"
-#include "Overlay/DVDOverlayCodecFFmpeg.h"
#include "DVDStreamInfo.h"
@@ -250,10 +254,12 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne
}
#endif
+#if defined(HAS_FFMPEG)
CStdString value;
value.Format("%d", surfaces);
options.push_back(CDVDCodecOption("surfaces", value));
if( (pCodec = OpenCodec(new CDVDVideoCodecFFmpeg(), hint, options)) ) return pCodec;
+#endif
return NULL;
}
@@ -265,8 +271,10 @@ CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodec( CDVDStreamInfo &hint, bool p
if (passthrough)
{
+#if defined(HAS_FFMPEG)
pCodec = OpenCodec( new CDVDAudioCodecPassthroughFFmpeg(), hint, options);
if ( pCodec ) return pCodec;
+#endif
}
switch (hint.codec)
@@ -316,9 +324,10 @@ CDVDAudioCodec* CDVDFactoryCodec::CreateAudioCodec( CDVDStreamInfo &hint, bool p
break;
}
}
-
+#if defined(HAS_FFMPEG)
pCodec = OpenCodec( new CDVDAudioCodecFFmpeg(), hint, options );
if( pCodec ) return pCodec;
+#endif
return NULL;
}
@@ -346,8 +355,11 @@ CDVDOverlayCodec* CDVDFactoryCodec::CreateOverlayCodec( CDVDStreamInfo &hint )
if( pCodec ) return pCodec;
default:
+#if defined(HAS_FFMPEG)
pCodec = OpenCodec(new CDVDOverlayCodecFFmpeg(), hint, options);
if( pCodec ) return pCodec;
+#endif
+ return NULL;
}
return NULL;
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/Makefile.in
index 341fa38..02e6484 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/Makefile.in
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/Makefile.in
@@ -1,12 +1,16 @@
INCLUDES+=-I@... \
SRCS= DVDOverlayCodecCC.cpp \
- DVDOverlayCodecFFmpeg.cpp \
DVDOverlayCodecSSA.cpp \
DVDOverlayCodecText.cpp \
DVDOverlayCodecTX3G.cpp \
libspucc/cc_decoder.c \
+ifeq (@USE_FFMPEG@...)
+SRCS+= DVDOverlayCodecFFmpeg.cpp
+
+endif
+
LIB= Overlay.a
include @abs_top_srcdir@...
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
index 1dce256..f45e568 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
@@ -1,9 +1,13 @@
INCLUDES+=-I@... \
-SRCS= DVDVideoCodecFFmpeg.cpp \
- DVDVideoCodecLibMpeg2.cpp \
+SRCS= DVDVideoCodecLibMpeg2.cpp \
+
+ifeq (@USE_FFMPEG@...)
+SRCS= DVDVideoCodecFFmpeg.cpp \
DVDVideoPPFFmpeg.cpp \
+endif
+
ifeq (@USE_VDPAU@...)
SRCS+= VDPAU.cpp \
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
index d717d48..20104dd 100644
--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h
@@ -38,6 +38,7 @@ class CDVDInputStream;
enum CodecID;
#include <libavcodec/avcodec.h>
#else
+#if defined(USE_FFMPEG)
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
@@ -49,8 +50,12 @@ extern "C" {
#include "libavcodec/avcodec.h"
#endif
}
+#else
+#include "FFMpegInternals.h"
+#endif
#endif
+
#ifndef __GNUC__
#pragma warning(pop)
#endif
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp
index cd794dd..96235ca 100644
--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp
+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.cpp
@@ -25,6 +25,7 @@
#include "DVDDemuxUtils.h"
#include "DVDClock.h"
#include "utils/log.h"
+#if defined(USE_FFMPEG)
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
@@ -36,6 +37,7 @@ extern "C" {
#include "libavcodec/avcodec.h"
#endif
}
+#endif
void CDVDDemuxUtils::FreeDemuxPacket(DemuxPacket* pPacket)
{
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp
index 2b93b28..4276d55 100644
--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp
+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp
@@ -48,6 +48,7 @@ CDVDDemuxVobsub::~CDVDDemuxVobsub()
bool CDVDDemuxVobsub::Open(const string& filename, const string& subfilename)
{
+#if defined(HAS_FFMPEG)
m_Filename = filename;
auto_ptr<CDVDSubtitleStream> pStream(new CDVDSubtitleStream());
@@ -144,6 +145,9 @@ bool CDVDDemuxVobsub::SeekTime(int time, bool backwords, double* startpts)
if(m_Timestamps.begin() != m_Timestamp)
m_Timestamp--;
return true;
+#else
+ return false;
+#endif
}
DemuxPacket* CDVDDemuxVobsub::Read()
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp
index 7021661..f0e27f2 100644
--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp
+++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp
@@ -25,7 +25,9 @@
#include "DVDInputStreams/DVDInputStream.h"
#include "DVDInputStreams/DVDInputStreamHttp.h"
+#if defined(USE_FFMPEG)
#include "DVDDemuxFFmpeg.h"
+#endif
#include "DVDDemuxShoutcast.h"
#ifdef HAS_FILESYSTEM_HTSP
#include "DVDDemuxHTSP.h"
@@ -61,11 +63,13 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream)
return NULL;
}
#endif
-
+#if defined(USE_FFMPEG)
auto_ptr<CDVDDemuxFFmpeg> demuxer(new CDVDDemuxFFmpeg());
if(demuxer->Open(pInputStream))
return demuxer.release();
else
return NULL;
+#endif
+ return NULL;
}
diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/Makefile.in b/xbmc/cores/dvdplayer/DVDDemuxers/Makefile.in
index dc6f959..bb455b2 100644
--- a/xbmc/cores/dvdplayer/DVDDemuxers/Makefile.in
+++ b/xbmc/cores/dvdplayer/DVDDemuxers/Makefile.in
@@ -1,13 +1,17 @@
INCLUDES+=-I@...
SRCS= DVDDemux.cpp \
- DVDDemuxFFmpeg.cpp \
DVDDemuxHTSP.cpp \
DVDDemuxShoutcast.cpp \
DVDDemuxUtils.cpp \
- DVDDemuxVobsub.cpp \
DVDFactoryDemuxer.cpp \
+ifeq (@USE_FFMPEG@...)
+SRCS+= DVDDemuxFFmpeg.cpp \
+ DVDDemuxVobsub.cpp \
+
+endif
+
LIB= DVDDemuxers.a
include @abs_top_srcdir@...
diff --git a/xbmc/cores/dvdplayer/DVDFileInfo.cpp b/xbmc/cores/dvdplayer/DVDFileInfo.cpp
index 8cc4898..3c31c12 100644
--- a/xbmc/cores/dvdplayer/DVDFileInfo.cpp
+++ b/xbmc/cores/dvdplayer/DVDFileInfo.cpp
@@ -38,14 +38,18 @@
#include "DVDDemuxers/DVDDemux.h"
#include "DVDDemuxers/DVDDemuxUtils.h"
#include "DVDDemuxers/DVDFactoryDemuxer.h"
+#if defined(USE_FFMPEG)
#include "DVDDemuxers/DVDDemuxFFmpeg.h"
+#include "DllAvCodec.h"
+#include "DllSwScale.h"
+#include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h"
+#else
+#include "FFMpegInternals.h"
+#endif
#include "DVDCodecs/DVDCodecs.h"
#include "DVDCodecs/DVDFactoryCodec.h"
#include "DVDCodecs/Video/DVDVideoCodec.h"
-#include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h"
-#include "DllAvCodec.h"
-#include "DllSwScale.h"
#include "filesystem/File.h"
@@ -74,6 +78,7 @@ bool CDVDFileInfo::GetFileDuration(const CStdString &path, int& duration)
bool CDVDFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &strTarget, CStreamDetails *pStreamDetails)
{
+#if defined(USE_FFMPEG)
unsigned int nTime = XbmcThreads::SystemClockMillis();
CDVDInputStream *pInputStream = CDVDFactoryInputStream::CreateInputStream(NULL, strPath, "");
if (!pInputStream)
@@ -253,6 +258,8 @@ bool CDVDFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &str
unsigned int nTotalTime = XbmcThreads::SystemClockMillis() - nTime;
CLog::Log(LOGDEBUG,"%s - measured %u ms to extract thumb from file <%s> ", __FUNCTION__, nTotalTime, strPath.c_str());
return bOk;
+#endif
+ return false;
}
/**
diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp
index f00e5e5..a577832 100644
--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp
@@ -33,7 +33,10 @@
#include "DVDDemuxers/DVDDemuxUtils.h"
#include "DVDDemuxers/DVDDemuxVobsub.h"
#include "DVDDemuxers/DVDFactoryDemuxer.h"
+#if defined(USE_FFMPEG)
#include "DVDDemuxers/DVDDemuxFFmpeg.h"
+#include "DllSwScale.h"
+#endif
#include "DVDCodecs/DVDCodecs.h"
#include "DVDCodecs/DVDFactoryCodec.h"
@@ -50,7 +53,6 @@
#include "DVDPerformanceCounter.h"
#include "filesystem/File.h"
#include "pictures/Picture.h"
-#include "DllSwScale.h"
#ifdef HAS_VIDEO_PLAYBACK
#include "cores/VideoRenderers/RenderManager.h"
#endif
@@ -2781,6 +2783,7 @@ bool CDVDPlayer::OpenVideoStream(int iStream, int source)
bool CDVDPlayer::OpenSubtitleStream(int iStream, int source)
{
+#if defined(USE_FFMPEG)
CLog::Log(LOGNOTICE, "Opening Subtitle stream: %i source: %i", iStream, source);
CDemuxStream* pStream = NULL;
@@ -2872,6 +2875,8 @@ bool CDVDPlayer::OpenSubtitleStream(int iStream, int source)
m_CurrentSubtitle.started = false;
return true;
+#endif
+ return false;
}
bool CDVDPlayer::OpenTeletextStream(int iStream, int source)
@@ -3594,9 +3599,10 @@ int CDVDPlayer::AddSubtitleFile(const std::string& filename, const std::string&
std::string vobsubfile = subfilename;
if(ext == ".idx")
{
+#if defined(USE_FFMPEG)
if (vobsubfile.empty())
vobsubfile = URIUtils::ReplaceExtension(filename, ".sub");
-
+
CDVDDemuxVobsub v;
if(!v.Open(filename, vobsubfile))
return -1;
@@ -3610,6 +3616,8 @@ int CDVDPlayer::AddSubtitleFile(const std::string& filename, const std::string&
CStdString strReplace(URIUtils::ReplaceExtension(filename,".idx"));
if (XFILE::CFile::Exists(strReplace))
return -1;
+#endif
+ return -1;
}
SelectionStream s;
s.source = m_SelectionStreams.Source(STREAM_SOURCE_TEXT, filename);
diff --git a/xbmc/cores/dvdplayer/DVDPlayerTeletext.cpp b/xbmc/cores/dvdplayer/DVDPlayerTeletext.cpp
index 7037dfa..8f8f5df 100644
--- a/xbmc/cores/dvdplayer/DVDPlayerTeletext.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayerTeletext.cpp
@@ -116,10 +116,12 @@ CDVDTeletextData::~CDVDTeletextData()
bool CDVDTeletextData::CheckStream(CDVDStreamInfo &hints)
{
+#if defined(USE_FFMPEG)
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,38,1)
if (hints.codec == CODEC_ID_DVB_TELETEXT)
return true;
#endif
+#endif
return false;
}
@@ -127,7 +129,7 @@ bool CDVDTeletextData::CheckStream(CDVDStreamInfo &hints)
bool CDVDTeletextData::OpenStream(CDVDStreamInfo &hints)
{
m_messageQueue.Init();
-
+#if defined(USE_FFMPEG)
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,38,1)
if (hints.codec == CODEC_ID_DVB_TELETEXT)
{
@@ -136,6 +138,7 @@ bool CDVDTeletextData::OpenStream(CDVDStreamInfo &hints)
return true;
}
#endif
+#endif
return false;
}
diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
index 9ee4d5b..fe6f39b 100644
--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
@@ -30,8 +30,10 @@
#include "DVDPlayerVideo.h"
#include "DVDCodecs/DVDFactoryCodec.h"
#include "DVDCodecs/DVDCodecUtils.h"
+#if #defined(USE_FFMPEG)
#include "DVDCodecs/Video/DVDVideoPPFFmpeg.h"
#include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h"
+#endif
#include "DVDDemuxers/DVDDemux.h"
#include "DVDDemuxers/DVDDemuxUtils.h"
#include "../../Util.h"
@@ -297,9 +299,11 @@ void CDVDPlayerVideo::Process()
DVDVideoPicture picture;
CPulldownCorrection pulldown;
+#if defined(USE_FFMPEG)
CDVDVideoPPFFmpeg mPostProcess("");
CStdString sPostProcessType;
bool bPostProcessDeint = false;
+#endif
memset(&picture, 0, sizeof(DVDVideoPicture));
@@ -576,7 +580,9 @@ void CDVDPlayerVideo::Process()
m_pVideoCodec->ClearPicture(&picture);
if (m_pVideoCodec->GetPicture(&picture))
{
+#if defined(USE_FFMPEG)
sPostProcessType.clear();
+#endif
picture.iGroupId = pPacket->iGroupId;
@@ -610,13 +616,15 @@ void CDVDPlayerVideo::Process()
{
if(mInt == VS_INTERLACEMETHOD_SW_BLEND)
{
+#if defined(USE_FFMPEG)
if (!sPostProcessType.empty())
sPostProcessType += ",";
sPostProcessType += g_advancedSettings.m_videoPPFFmpegDeint;
bPostProcessDeint = true;
+#endif
}
}
-
+#if defined(USE_FFMPEG)
if (g_settings.m_currentVideoSettings.m_PostProcess)
{
if (!sPostProcessType.empty())
@@ -631,7 +639,7 @@ void CDVDPlayerVideo::Process()
if (mPostProcess.Process(&picture))
mPostProcess.GetPicture(&picture);
}
-
+#endif
/* if frame has a pts (usually originiating from demux packet), use that */
if(picture.pts != DVD_NOPTS_VALUE)
{
diff --git a/xbmc/cores/dvdplayer/DVDStreamInfo.h b/xbmc/cores/dvdplayer/DVDStreamInfo.h
index afbf563..ad541a5 100644
--- a/xbmc/cores/dvdplayer/DVDStreamInfo.h
+++ b/xbmc/cores/dvdplayer/DVDStreamInfo.h
@@ -29,6 +29,7 @@ enum StreamType;
enum CodecID;
#else
#include "DVDDemuxers/DVDDemux.h"
+#if defined(USE_FFMPEG)
extern "C" {
#if (defined USE_EXTERNAL_FFMPEG)
#if (defined HAVE_LIBAVCODEC_AVCODEC_H)
@@ -40,6 +41,9 @@ extern "C" {
#include "libavcodec/avcodec.h"
#endif
}
+#else
+#include "FFMpegInternals.h"
+#endif
#endif
class CDemuxStream;
diff --git a/xbmc/cores/dvdplayer/FFMpegInternals.h b/xbmc/cores/dvdplayer/FFMpegInternals.h
new file mode 100644
index 0000000..79b5d59
--- /dev/null
+++ b/xbmc/cores/dvdplayer/FFMpegInternals.h
@@ -0,0 +1,342 @@
+#pragma once
+/*
+
+ * Copyright (C) 2005-2008 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+/*This file is one big hack. It was added because we use FFMpeg codec IDs
+ internally, so we cannot compile dvdplayer without ffmpeg includes. */
+
+enum CodecID {
+ CODEC_ID_NONE,
+
+ /* video codecs */
+ CODEC_ID_MPEG1VIDEO,
+ CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
+ CODEC_ID_MPEG2VIDEO_XVMC,
+ CODEC_ID_H261,
+ CODEC_ID_H263,
+ CODEC_ID_RV10,
+ CODEC_ID_RV20,
+ CODEC_ID_MJPEG,
+ CODEC_ID_MJPEGB,
+ CODEC_ID_LJPEG,
+ CODEC_ID_SP5X,
+ CODEC_ID_JPEGLS,
+ CODEC_ID_MPEG4,
+ CODEC_ID_RAWVIDEO,
+ CODEC_ID_MSMPEG4V1,
+ CODEC_ID_MSMPEG4V2,
+ CODEC_ID_MSMPEG4V3,
+ CODEC_ID_WMV1,
+ CODEC_ID_WMV2,
+ CODEC_ID_H263P,
+ CODEC_ID_H263I,
+ CODEC_ID_FLV1,
+ CODEC_ID_SVQ1,
+ CODEC_ID_SVQ3,
+ CODEC_ID_DVVIDEO,
+ CODEC_ID_HUFFYUV,
+ CODEC_ID_CYUV,
+ CODEC_ID_H264,
+ CODEC_ID_INDEO3,
+ CODEC_ID_VP3,
+ CODEC_ID_THEORA,
+ CODEC_ID_ASV1,
+ CODEC_ID_ASV2,
+ CODEC_ID_FFV1,
+ CODEC_ID_4XM,
+ CODEC_ID_VCR1,
+ CODEC_ID_CLJR,
+ CODEC_ID_MDEC,
+ CODEC_ID_ROQ,
+ CODEC_ID_INTERPLAY_VIDEO,
+ CODEC_ID_XAN_WC3,
+ CODEC_ID_XAN_WC4,
+ CODEC_ID_RPZA,
+ CODEC_ID_CINEPAK,
+ CODEC_ID_WS_VQA,
+ CODEC_ID_MSRLE,
+ CODEC_ID_MSVIDEO1,
+ CODEC_ID_IDCIN,
+ CODEC_ID_8BPS,
+ CODEC_ID_SMC,
+ CODEC_ID_FLIC,
+ CODEC_ID_TRUEMOTION1,
+ CODEC_ID_VMDVIDEO,
+ CODEC_ID_MSZH,
+ CODEC_ID_ZLIB,
+ CODEC_ID_QTRLE,
+ CODEC_ID_SNOW,
+ CODEC_ID_TSCC,
+ CODEC_ID_ULTI,
+ CODEC_ID_QDRAW,
+ CODEC_ID_VIXL,
+ CODEC_ID_QPEG,
+#if LIBAVCODEC_VERSION_MAJOR < 53
+ CODEC_ID_XVID,
+#endif
+ CODEC_ID_PNG,
+ CODEC_ID_PPM,
+ CODEC_ID_PBM,
+ CODEC_ID_PGM,
+ CODEC_ID_PGMYUV,
+ CODEC_ID_PAM,
+ CODEC_ID_FFVHUFF,
+ CODEC_ID_RV30,
+ CODEC_ID_RV40,
+ CODEC_ID_VC1,
+ CODEC_ID_WMV3,
+ CODEC_ID_LOCO,
+ CODEC_ID_WNV1,
+ CODEC_ID_AASC,
+ CODEC_ID_INDEO2,
+ CODEC_ID_FRAPS,
+ CODEC_ID_TRUEMOTION2,
+ CODEC_ID_BMP,
+ CODEC_ID_CSCD,
+ CODEC_ID_MMVIDEO,
+ CODEC_ID_ZMBV,
+ CODEC_ID_AVS,
+ CODEC_ID_SMACKVIDEO,
+ CODEC_ID_NUV,
+ CODEC_ID_KMVC,
+ CODEC_ID_FLASHSV,
+ CODEC_ID_CAVS,
+ CODEC_ID_JPEG2000,
+ CODEC_ID_VMNC,
+ CODEC_ID_VP5,
+ CODEC_ID_VP6,
+ CODEC_ID_VP6F,
+ CODEC_ID_TARGA,
+ CODEC_ID_DSICINVIDEO,
+ CODEC_ID_TIERTEXSEQVIDEO,
+ CODEC_ID_TIFF,
+ CODEC_ID_GIF,
+ CODEC_ID_FFH264,
+ CODEC_ID_DXA,
+ CODEC_ID_DNXHD,
+ CODEC_ID_THP,
+ CODEC_ID_SGI,
+ CODEC_ID_C93,
+ CODEC_ID_BETHSOFTVID,
+ CODEC_ID_PTX,
+ CODEC_ID_TXD,
+ CODEC_ID_VP6A,
+ CODEC_ID_AMV,
+ CODEC_ID_VB,
+ CODEC_ID_PCX,
+ CODEC_ID_SUNRAST,
+ CODEC_ID_INDEO4,
+ CODEC_ID_INDEO5,
+ CODEC_ID_MIMIC,
+ CODEC_ID_RL2,
+ CODEC_ID_8SVX_EXP,
+ CODEC_ID_8SVX_FIB,
+ CODEC_ID_ESCAPE124,
+ CODEC_ID_DIRAC,
+ CODEC_ID_BFI,
+ CODEC_ID_CMV,
+ CODEC_ID_MOTIONPIXELS,
+ CODEC_ID_TGV,
+ CODEC_ID_TGQ,
+ CODEC_ID_TQI,
+ CODEC_ID_AURA,
+ CODEC_ID_AURA2,
+ CODEC_ID_V210X,
+ CODEC_ID_TMV,
+ CODEC_ID_V210,
+ CODEC_ID_DPX,
+ CODEC_ID_MAD,
+ CODEC_ID_FRWU,
+ CODEC_ID_FLASHSV2,
+ CODEC_ID_CDGRAPHICS,
+ CODEC_ID_R210,
+ CODEC_ID_ANM,
+ CODEC_ID_BINKVIDEO,
+ CODEC_ID_IFF_ILBM,
+ CODEC_ID_IFF_BYTERUN1,
+ CODEC_ID_KGV1,
+ CODEC_ID_YOP,
+ CODEC_ID_VP8,
+ CODEC_ID_PICTOR,
+ CODEC_ID_ANSI,
+ CODEC_ID_A64_MULTI,
+ CODEC_ID_A64_MULTI5,
+ CODEC_ID_R10K,
+ CODEC_ID_MXPEG,
+ CODEC_ID_LAGARITH,
+
+ /* various PCM "codecs" */
+ CODEC_ID_PCM_S16LE= 0x10000,
+ CODEC_ID_PCM_S16BE,
+ CODEC_ID_PCM_U16LE,
+ CODEC_ID_PCM_U16BE,
+ CODEC_ID_PCM_S8,
+ CODEC_ID_PCM_U8,
+ CODEC_ID_PCM_MULAW,
+ CODEC_ID_PCM_ALAW,
+ CODEC_ID_PCM_S32LE,
+ CODEC_ID_PCM_S32BE,
+ CODEC_ID_PCM_U32LE,
+ CODEC_ID_PCM_U32BE,
+ CODEC_ID_PCM_S24LE,
+ CODEC_ID_PCM_S24BE,
+ CODEC_ID_PCM_U24LE,
+ CODEC_ID_PCM_U24BE,
+ CODEC_ID_PCM_S24DAUD,
+ CODEC_ID_PCM_ZORK,
+ CODEC_ID_PCM_S16LE_PLANAR,
+ CODEC_ID_PCM_DVD,
+ CODEC_ID_PCM_F32BE,
+ CODEC_ID_PCM_F32LE,
+ CODEC_ID_PCM_F64BE,
+ CODEC_ID_PCM_F64LE,
+ CODEC_ID_PCM_BLURAY,
+ CODEC_ID_PCM_LXF,
+
+ /* various ADPCM codecs */
+ CODEC_ID_ADPCM_IMA_QT= 0x11000,
+ CODEC_ID_ADPCM_IMA_WAV,
+ CODEC_ID_ADPCM_IMA_DK3,
+ CODEC_ID_ADPCM_IMA_DK4,
+ CODEC_ID_ADPCM_IMA_WS,
+ CODEC_ID_ADPCM_IMA_SMJPEG,
+ CODEC_ID_ADPCM_MS,
+ CODEC_ID_ADPCM_4XM,
+ CODEC_ID_ADPCM_XA,
+ CODEC_ID_ADPCM_ADX,
+ CODEC_ID_ADPCM_EA,
+ CODEC_ID_ADPCM_G726,
+ CODEC_ID_ADPCM_CT,
+ CODEC_ID_ADPCM_SWF,
+ CODEC_ID_ADPCM_YAMAHA,
+ CODEC_ID_ADPCM_SBPRO_4,
+ CODEC_ID_ADPCM_SBPRO_3,
+ CODEC_ID_ADPCM_SBPRO_2,
+ CODEC_ID_ADPCM_THP,
+ CODEC_ID_ADPCM_IMA_AMV,
+ CODEC_ID_ADPCM_EA_R1,
+ CODEC_ID_ADPCM_EA_R3,
+ CODEC_ID_ADPCM_EA_R2,
+ CODEC_ID_ADPCM_IMA_EA_SEAD,
+ CODEC_ID_ADPCM_IMA_EA_EACS,
+ CODEC_ID_ADPCM_EA_XAS,
+ CODEC_ID_ADPCM_EA_MAXIS_XA,
+ CODEC_ID_ADPCM_IMA_ISS,
+ CODEC_ID_ADPCM_G722,
+
+ /* AMR */
+ CODEC_ID_AMR_NB= 0x12000,
+ CODEC_ID_AMR_WB,
+
+ /* RealAudio codecs*/
+ CODEC_ID_RA_144= 0x13000,
+ CODEC_ID_RA_288,
+
+ /* various DPCM codecs */
+ CODEC_ID_ROQ_DPCM= 0x14000,
+ CODEC_ID_INTERPLAY_DPCM,
+ CODEC_ID_XAN_DPCM,
+ CODEC_ID_SOL_DPCM,
+
+ /* audio codecs */
+ CODEC_ID_MP2= 0x15000,
+ CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
+ CODEC_ID_AAC,
+ CODEC_ID_AC3,
+ CODEC_ID_DTS,
+ CODEC_ID_VORBIS,
+ CODEC_ID_DVAUDIO,
+ CODEC_ID_WMAV1,
+ CODEC_ID_WMAV2,
+ CODEC_ID_MACE3,
+ CODEC_ID_MACE6,
+ CODEC_ID_VMDAUDIO,
+ CODEC_ID_SONIC,
+ CODEC_ID_SONIC_LS,
+ CODEC_ID_FLAC,
+ CODEC_ID_MP3ADU,
+ CODEC_ID_MP3ON4,
+ CODEC_ID_SHORTEN,
+ CODEC_ID_ALAC,
+ CODEC_ID_WESTWOOD_SND1,
+ CODEC_ID_GSM, ///< as in Berlin toast format
+ CODEC_ID_QDM2,
+ CODEC_ID_COOK,
+ CODEC_ID_TRUESPEECH,
+ CODEC_ID_TTA,
+ CODEC_ID_SMACKAUDIO,
+ CODEC_ID_QCELP,
+ CODEC_ID_WAVPACK,
+ CODEC_ID_DSICINAUDIO,
+ CODEC_ID_IMC,
+ CODEC_ID_MUSEPACK7,
+ CODEC_ID_MLP,
+ CODEC_ID_GSM_MS, /* as found in WAV */
+ CODEC_ID_ATRAC3,
+ CODEC_ID_VOXWARE,
+ CODEC_ID_APE,
+ CODEC_ID_NELLYMOSER,
+ CODEC_ID_MUSEPACK8,
+ CODEC_ID_SPEEX,
+ CODEC_ID_WMAVOICE,
+ CODEC_ID_WMAPRO,
+ CODEC_ID_WMALOSSLESS,
+ CODEC_ID_ATRAC3P,
+ CODEC_ID_EAC3,
+ CODEC_ID_SIPR,
+ CODEC_ID_MP1,
+ CODEC_ID_TWINVQ,
+ CODEC_ID_TRUEHD,
+ CODEC_ID_MP4ALS,
+ CODEC_ID_ATRAC1,
+ CODEC_ID_BINKAUDIO_RDFT,
+ CODEC_ID_BINKAUDIO_DCT,
+ CODEC_ID_AAC_LATM,
+
+ /* subtitle codecs */
+ CODEC_ID_DVD_SUBTITLE= 0x17000,
+ CODEC_ID_DVB_SUBTITLE,
+ CODEC_ID_TEXT, ///< raw UTF-8 text
+ CODEC_ID_XSUB,
+ CODEC_ID_SSA,
+ CODEC_ID_MOV_TEXT,
+ CODEC_ID_HDMV_PGS_SUBTITLE,
+ CODEC_ID_DVB_TELETEXT,
+ CODEC_ID_SRT,
+
+ /* data codecs */
+ CODEC_ID_VBI_DATA= 0x17500,
+ CODEC_ID_VBI_TELETEXT,
+
+ /* other specific kind of codecs (generally used for attachments) */
+ CODEC_ID_TTF= 0x18000,
+
+ CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
+
+ CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
+ * stream (only used by libavformat) */
+ CODEC_ID_FFMETADATA=0x21000, ///< Dummy codec for streams containing only metadata information.
+};
+enum AVDiscard{AVDISCARD_NONE=-16,AVDISCARD_ALL=48};
+#define FF_PROFILE_UNKNOWN -99
+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
+#define FF_INPUT_BUFFER_PADDING_SIZE 8
diff --git a/xbmc/music/tags/Makefile b/xbmc/music/tags/Makefile.in
similarity index 97%
rename from xbmc/music/tags/Makefile
rename to xbmc/music/tags/Makefile.in
index d1e84aa..2229391 100644
--- a/xbmc/music/tags/Makefile
+++ b/xbmc/music/tags/Makefile.in
@@ -13,18 +13,20 @@ SRCS=APEv2Tag.cpp \
MusicInfoTagLoaderMod.cpp \
MusicInfoTagLoaderMP3.cpp \
MusicInfoTagLoaderMP4.cpp \
- MusicInfoTagLoaderMPC.cpp \
MusicInfoTagLoaderNSF.cpp \
- MusicInfoTagLoaderOgg.cpp \
MusicInfoTagLoaderShn.cpp \
MusicInfoTagLoaderSPC.cpp \
- MusicInfoTagLoaderWav.cpp \
- MusicInfoTagLoaderWavPack.cpp \
MusicInfoTagLoaderWMA.cpp \
MusicInfoTagLoaderYM.cpp \
- OggTag.cpp \
VorbisTag.cpp \
+SRCS+=\
+ MusicInfoTagLoaderMPC.cpp \
+ MusicInfoTagLoaderOgg.cpp \
+ MusicInfoTagLoaderWav.cpp \
+ MusicInfoTagLoaderWavPack.cpp \
+ OggTag.cpp
+
LIB=musictags.a
include ../../../Makefile.include
https://github.com/xbmc/xbmc/commit/312e24d1d69a5d787cd18a20ab433d7af9732959
commit 312e24d1d69a5d787cd18a20ab433d7af9732959
Author: Gilles Vieira <gilles_vieira@...>
Date: Wed Feb 15 17:20:42 2012 +0100
Added udp:// support for TS files (new DCCHD needed)
Added rstp:// support for WMV files (new DCCHD needed)
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 72e3f7b..c438b63 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -174,6 +174,24 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
m_dvd_mediatype = false;
format.mediaType = MTYPE_APP_NONE;
}
+ else if (itempath.Left(strlen("udp://")).Equals("udp://"))
+ {
+ // Only Transport files are supported with multicast protocol
+ m_dvd_mediatype = false;
+ format.mediaType = MTYPE_APP_NONE;
+
+ // Protocol is handled by SMP
+ ids_url = itempath;
+ }
+ else if (itempath.Left(strlen("rtsp://")).Equals("rtsp://"))
+ {
+ // Only ASF files are supported for now with RTSP protocol
+ m_dvd_mediatype = false;
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_ASF;
+
+ // Protocol is handled by SMP
+ ids_url = itempath;
+ }
else
{
m_dvd_mediatype = false;
@@ -1803,6 +1821,12 @@ bool CSMPPlayer::WaitForAmpFormatValid(int timeout_ms)
bool rtn = false;
bool isvideo = m_item.IsVideo();
bool isaudio = m_item.IsAudio();
+
+ // Hack for UDP
+ CStdString itempath(m_item.GetPath());
+ if (itempath.Left(strlen("udp://")).Equals("udp://") || itempath.Left(strlen("rtsp://")).Equals("rtsp://"))
+ isvideo = isaudio = true;
+
while (!m_bStop && !rtn && (timeout_ms > 0))
{
Sleep(100);
https://github.com/xbmc/xbmc/commit/3d9fc5671ce82100468ef1decc92816fd9a206d6
commit 3d9fc5671ce82100468ef1decc92816fd9a206d6
Merge: dc73c18 aa4e819
Author: Gilles Vieira <gilles_vieira@...>
Date: Tue Feb 14 12:18:03 2012 +0100
Merge remote branch 'atlastech/xbmc-buildroot' into xbmc-buildroot
https://github.com/xbmc/xbmc/commit/aa4e8193529b2b026b515317ca592dd3b9bc6d1e
commit aa4e8193529b2b026b515317ca592dd3b9bc6d1e
Author: theuni <theuni-nospam-@...>
Date: Tue Feb 14 03:51:36 2012 -0500
[smp] fix my stupid in last commit
diff --git a/xbmc/guilib/TextureGL.cpp b/xbmc/guilib/TextureGL.cpp
index 27bb94c..f2a7791 100644
--- a/xbmc/guilib/TextureGL.cpp
+++ b/xbmc/guilib/TextureGL.cpp
@@ -181,7 +181,7 @@ void CGLTexture::LoadToGPU()
#define GL_BGRA_EXT 0x80E1
#endif
#if defined (HAS_DIRECTFB)
-#if defined (USE_EGL)
+#if defined (HAS_EGL)
if (m_dfbSurface && eglCreateImageKHR)
{
m_textureImage = eglCreateImageKHR((EGLDisplay)g_Windowing.GetDisplay(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer)m_dfbSurface, NULL);
https://github.com/xbmc/xbmc/commit/dc73c18d23a9e451bc9ddae6a8fe63eb63479779
commit dc73c18d23a9e451bc9ddae6a8fe63eb63479779
Author: Gilles Vieira <gilles_vieira@...>
Date: Tue Feb 14 01:04:12 2012 +0100
Now change opacity to hide a layer instead of disabling the scaler (Needs new DFB version to work)
Give inital start time instead of seeking afterward (New DCCHD option)
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 3d784f4..72e3f7b 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -386,6 +386,10 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
snprintf(fontC_str, sizeof(fontC_str)/sizeof(char), "ids://0x%08lx", (long unsigned int)fontIdsdata);
parameters.DefaultFontFileUrl = fontC_str;
+ // Initial seek time
+ parameters.StartTimeMs = m_options.starttime*1000;
+ parameters.StartTimeMsAccurate = TRUE;
+
// open the media using the IAdvancedMediaProvider
res = m_amp->OpenMedia(m_amp, (char*)ids_url.c_str(), &format, ¶meters);
}
@@ -1479,11 +1483,6 @@ void CSMPPlayer::Process()
if (m_options.identify == false)
m_callback.OnPlayBackStarted();
- // starttime has units of seconds, if we try to do this
- // too early, it confuses amp.
- if (m_options.starttime > 1)
- SeekTime(m_options.starttime * 1000);
-
while (!m_bStop && !m_StopPlaying)
{
// AMP monitoring loop for automatic playback termination (250ms wait)
@@ -1820,21 +1819,14 @@ void CSMPPlayer::ShowMainVideo(bool show)
if (m_show_mainvideo == show)
return;
- DFBScreenMixerConfig mixcfg;
- IDirectFBScreen *screen = g_Windowing.GetIDirectFBScreen();
- screen->GetMixerConfiguration(screen, 0, &mixcfg);
+ IDirectFB *dfb = g_Windowing.GetIDirectFB();
+ IDirectFBDisplayLayer *dfb_layer;
+ dfb->GetDisplayLayer(dfb, XBMC_MAINVIDEO, &dfb_layer);
+ dfb_layer->SetCooperativeLevel(dfb_layer, DLSCL_EXCLUSIVE);
if (show)
- {
- if (!DFB_DISPLAYLAYER_IDS_HAVE(mixcfg.layers, XBMC_MAINVIDEO))
- DFB_DISPLAYLAYER_IDS_ADD(mixcfg.layers, XBMC_MAINVIDEO);
- }
+ dfb_layer->SetOpacity(dfb_layer, 255);
else
- {
- if (DFB_DISPLAYLAYER_IDS_HAVE(mixcfg.layers, XBMC_MAINVIDEO))
- DFB_DISPLAYLAYER_IDS_REMOVE(mixcfg.layers, XBMC_MAINVIDEO);
- }
- mixcfg.flags = (DFBScreenMixerConfigFlags)(mixcfg.flags | DSMCONF_LAYERS);
- screen->SetMixerConfiguration(screen, 0, &mixcfg);
+ dfb_layer->SetOpacity(dfb_layer, 0);
m_show_mainvideo = show;
}
https://github.com/xbmc/xbmc/commit/71549b41983b029fce9a732fbace01bdeefd0bba
commit 71549b41983b029fce9a732fbace01bdeefd0bba
Author: theuni <theuni-nospam-@...>
Date: Mon Feb 13 11:14:36 2012 -0500
[smp] Support uploading textures via EGLImage
diff --git a/xbmc/guilib/Texture.cpp b/xbmc/guilib/Texture.cpp
index 7b952fb..2ba2e2b 100644
--- a/xbmc/guilib/Texture.cpp
+++ b/xbmc/guilib/Texture.cpp
@@ -559,7 +559,7 @@ bool CBaseTexture::LoadHWAccelerated(const CStdString& texturePath)
}
// set caps to DSCAPS_VIDEOONLY so we get hw decode.
- dsc.caps = (DFBSurfaceCapabilities)(dsc.caps | DSCAPS_VIDEOONLY);
+ dsc.caps = (DFBSurfaceCapabilities)(dsc.caps | DSCAPS_VIDEOONLY | DSCAPS_PAGE_ALIGNED);
dsc.caps = (DFBSurfaceCapabilities)(dsc.caps &~DSCAPS_SYSTEMONLY);
dsc.pixelformat = DSPF_ARGB;
diff --git a/xbmc/guilib/TextureGL.cpp b/xbmc/guilib/TextureGL.cpp
index f2d0039..27bb94c 100644
--- a/xbmc/guilib/TextureGL.cpp
+++ b/xbmc/guilib/TextureGL.cpp
@@ -36,6 +36,12 @@
#endif
using namespace std;
+#ifdef HAS_EGL
+static PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR = NULL;
+static PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR = NULL;
+static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES = NULL;
+#endif
+
/************************************************************************/
/* CGLTexture */
@@ -43,6 +49,27 @@ using namespace std;
CGLTexture::CGLTexture(unsigned int width, unsigned int height, unsigned int format)
: CBaseTexture(width, height, format)
{
+#ifdef HAS_EGL
+ if (!eglCreateImageKHR)
+ {
+ eglCreateImageKHR =
+ (PFNEGLCREATEIMAGEKHRPROC)eglGetProcAddress("eglCreateImageKHR");
+ }
+
+ if (!eglDestroyImageKHR)
+ {
+ eglDestroyImageKHR =
+ (PFNEGLDESTROYIMAGEKHRPROC)eglGetProcAddress("eglDestroyImageKHR");
+ }
+
+ if (!glEGLImageTargetTexture2DOES)
+ {
+ glEGLImageTargetTexture2DOES =
+ (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)eglGetProcAddress(
+ "glEGLImageTargetTexture2DOES");
+ }
+#endif
+
}
CGLTexture::~CGLTexture()
@@ -59,6 +86,10 @@ void CGLTexture::DestroyTextureObject()
{
if (m_texture)
glDeleteTextures(1, (GLuint*) &m_texture);
+#ifdef HAS_EGL
+ if (m_textureImage && eglDestroyImageKHR)
+ eglDestroyImageKHR((EGLDisplay)g_Windowing.GetDisplay(), m_textureImage);
+#endif
}
void CGLTexture::LoadToGPU()
@@ -68,6 +99,8 @@ void CGLTexture::LoadToGPU()
// nothing to load - probably same image (no change)
return;
}
+ if (m_loadedToGPU)
+ return;
if (m_texture == 0)
{
// Have OpenGL generate a texture object handle for us
@@ -148,6 +181,19 @@ void CGLTexture::LoadToGPU()
#define GL_BGRA_EXT 0x80E1
#endif
#if defined (HAS_DIRECTFB)
+#if defined (USE_EGL)
+ if (m_dfbSurface && eglCreateImageKHR)
+ {
+ m_textureImage = eglCreateImageKHR((EGLDisplay)g_Windowing.GetDisplay(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer)m_dfbSurface, NULL);
+ if (m_textureImage != EGL_NO_IMAGE_KHR && glEGLImageTargetTexture2DOES)
+ {
+ glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, m_textureImage);
+ CLog::Log(LOGDEBUG, "Uploading texture using an EGLImage.");
+ m_loadedToGPU = true;
+ return;
+ }
+ }
+#endif
if (m_format & XB_FMT_DFBSURFACE)
{
int imgpitch = 0;
diff --git a/xbmc/guilib/TextureGL.h b/xbmc/guilib/TextureGL.h
index e208c72..7e7a329 100644
--- a/xbmc/guilib/TextureGL.h
+++ b/xbmc/guilib/TextureGL.h
@@ -32,6 +32,10 @@
#pragma once
#if defined(HAS_GL) || defined(HAS_GLES)
+#ifdef HAS_EGL
+#include "EGL/egl.h"
+#include "EGL/eglext.h"
+#endif
/************************************************************************/
/* CGLTexture */
@@ -45,6 +49,9 @@ public:
void CreateTextureObject();
virtual void DestroyTextureObject();
void LoadToGPU();
+#ifdef HAS_EGL
+ EGLImageKHR m_textureImage;
+#endif
};
#endif
diff --git a/xbmc/windowing/dfb/WinSystemDFB.cpp b/xbmc/windowing/dfb/WinSystemDFB.cpp
index b47b7eb..cbd8b61 100755
--- a/xbmc/windowing/dfb/WinSystemDFB.cpp
+++ b/xbmc/windowing/dfb/WinSystemDFB.cpp
@@ -471,6 +471,11 @@ IDirectFBScreen* CWinSystemDFB::GetIDirectFBScreen() const
return m_dfb_screen;
}
+void* CWinSystemDFB::GetDisplay() const
+{
+ return m_eglBinding->GetDisplay();
+}
+
bool CWinSystemDFB::CreateImageProvider(IDirectFBDataBuffer *buffer, IDirectFBImageProvider **provider, bool retain1st)
{
// some hardware accelerated dfb image provider implementations have
diff --git a/xbmc/windowing/dfb/WinSystemDFB.h b/xbmc/windowing/dfb/WinSystemDFB.h
index 4d456aa..efc77ad 100644
--- a/xbmc/windowing/dfb/WinSystemDFB.h
+++ b/xbmc/windowing/dfb/WinSystemDFB.h
@@ -72,6 +72,7 @@ public:
virtual bool Restore() ;
virtual bool Hide();
virtual bool Show(bool raise = true);
+ virtual void* GetDisplay() const;
IDirectFB* GetIDirectFB() const;
IDirectFBScreen* GetIDirectFBScreen() const;
https://github.com/xbmc/xbmc/commit/671ca10b45b9d4ed194e3340534e0888777db3dc
commit 671ca10b45b9d4ed194e3340534e0888777db3dc
Merge: a9f4f85 08ce88c
Author: Gilles VIEIRA <gilles_vieira@...>
Date: Mon Feb 13 09:05:22 2012 -0800
Merge pull request #21 from SigmaDesigns/xbmc-buildroot
Thumbnails creation patch
https://github.com/xbmc/xbmc/commit/08ce88cc1ab0434a6209915f00813ed033a5922c
commit 08ce88cc1ab0434a6209915f00813ed033a5922c
Author: Gilles Vieira <gilles_vieira@...>
Date: Mon Feb 13 17:59:22 2012 +0100
Fixed Layer hidding (using alpha, need a DFB fix)
Don't seek anymore, ask to start at an offset (need new dcchd)
For now, we seek a 3mins or 1MB, this needs to be fixed depending of the file
diff --git a/xbmc/cores/smpplayer/SMPFileInfo.cpp b/xbmc/cores/smpplayer/SMPFileInfo.cpp
index a76a290..e97535f 100755
--- a/xbmc/cores/smpplayer/SMPFileInfo.cpp
+++ b/xbmc/cores/smpplayer/SMPFileInfo.cpp
@@ -120,17 +120,6 @@ bool CSMPFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &str
return false;
}
- // disable secondary video display (comment this out to see the sequence :)
- /* TODO: Cannot disable the secondary video display ?
- DFBScreenMixerConfig mixcfg;
- IDirectFBScreen *screen = g_Windowing.GetIDirectFBScreen();
- screen->GetMixerConfiguration(screen, 0, &mixcfg);
- mixcfg.flags = (DFBScreenMixerConfigFlags)(DSMCONF_LAYERS);
- if (DFB_DISPLAYLAYER_IDS_HAVE(mixcfg.layers, EM86LAYER_SECVIDEO))
- DFB_DISPLAYLAYER_IDS_REMOVE(mixcfg.layers, EM86LAYER_SECVIDEO);
- screen->SetMixerConfiguration(screen, 0, &mixcfg);
- */
-
m_amp_media = new CSMPMediaSpace(m_amp, format.mediaType);
// This must stay in the stack until open
char ids_c_str[64];
@@ -156,6 +145,16 @@ bool CSMPFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &str
// some param :)
parameters.tsSkip = ts_skip;
+ parameters.videoOnly = true;
+
+ if (format.mediaType & MTYPE_CONT_M2TS)
+ parameters.tsStartOffset = 1024*1024;
+ else
+ {
+ parameters.StartTimeMs = 300000;
+ parameters.StartTimeMsAccurate = false;
+ }
+
// open the media using the IAdvancedMediaProvider
res = m_amp->OpenMedia(m_amp, (char*)ids_url.c_str(), &format, ¶meters);
CLog::Log(LOGDEBUG, "CSMPFileInfo::ExtractThumb: Opening: %s", ids_url.c_str());
@@ -163,7 +162,6 @@ bool CSMPFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &str
throw "CSMPFileInfo::ExtractThumb:OpenMedia() failed";
// wait for media to open.
- printf("CSMPFileInfo::ExtractThumb wait for media to open\n");
bool checkpoint = false;
int timeout_ms = 40000;
while (timeout_ms > 0)
@@ -189,9 +187,14 @@ bool CSMPFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &str
printf("CSMPFileInfo::ExtractThumb start the playback\n");
res = m_amp->StartPresentation(m_amp, DFB_TRUE);
+ // Hide secondary video display (MUST be done after play, when the VCR scaler exists)
+ IDirectFBDisplayLayer *dfb_layer;
+ dfb->GetDisplayLayer(dfb, XBMC_SECVIDEO, &dfb_layer);
+ dfb_layer->SetCooperativeLevel(dfb_layer, DLSCL_EXCLUSIVE);
+ dfb_layer->SetOpacity(dfb_layer, 0);
+
checkpoint = false;
// wait until playback starts.
- printf("CSMPFileInfo::ExtractThumb wait until playback starts\n");
timeout_ms = 10000;
while (timeout_ms > 0)
{
@@ -212,7 +215,6 @@ bool CSMPFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &str
if (!checkpoint)
throw "CSMPFileInfo::ExtractThumb:StartPresentation timeout";
- printf("CSMPFileInfo::ExtractThumb wait for media format is valid\n");
// wait for media format is valid.
checkpoint = false;
timeout_ms = 10000;
@@ -230,55 +232,11 @@ bool CSMPFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &str
if (!checkpoint)
throw "CSMPFileInfo::ExtractThumb:wait for media format timeout";
- int64_t video_duration_ms = 0, video_elapsed_ms = 0;
- m_amp_media->GetStatusTime(video_elapsed_ms, video_duration_ms);
int video_width, video_height, video_viewmode;
float video_fps_numerator, video_fps_denominator;
m_amp_media->GetStatusVideo(video_width, video_height, video_viewmode, video_fps_numerator, video_fps_denominator);
- // seek to 60 seconds into video.
- if (video_duration_ms > 0)
- {
- printf("CSMPFileInfo::ExtractThumb seek to 60 seconds into video\n");
- UMSCommand cmd;
- UMSResult res;
- UMSParams params;
- params.seektime_ms = video_duration_ms/4;
- if (m_amp_media)
- m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
- if (m_amp && m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
- CLog::Log(LOGERROR, "CSMPFileInfo::ExtractThumb::SeekTime:AMP command failed!");
- }
- else
- {
- // cannot seek so next best thing is to wait a few seconds
- // and hope we get an interesting thumb
- Sleep(2000);
- }
-
- printf("CSMPFileInfo::ExtractThumb SMP_PLAYING\n");
- // wait until playback starts again.
- timeout_ms = 10000;
- while (timeout_ms > 0)
- {
- if (m_amp_event->WaitForEventWithTimeout(m_amp_event, 0, 100) == DFB_OK)
- {
- // eat the event
- DFBEvent event;
- m_amp_event->GetEvent(m_amp_event, &event);
- m_amp_media->StatusUpdate();
- if (m_amp_media->GetStatusState() == SMP_PLAYING)
- break;
- }
- timeout_ms -= 100;
- }
- m_amp_media->StatusUpdate();
- if (m_amp_media->GetStatusState() != SMP_PLAYING)
- throw "CSMPFileInfo::ExtractThumb: overseek to end.";
-
-
// snatch a thumbnail from playback surface.
- printf("CSMPFileInfo::ExtractThumb snatch a thumbnail from playback surface\n");
IDirectFBSurface *capture_surface;
DFBSurfaceDescription dsc_surface;
// scale output down to thumbsize size
@@ -295,18 +253,19 @@ bool CSMPFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &str
dsc_surface.pixelformat = DSPF_ARGB;
dfb->CreateSurface(dfb, &dsc_surface, &capture_surface);
capture_surface->Clear(capture_surface, 0xff, 0, 0, 0x80);
- // capture a frame
- //TODO: amp CaptureTo is broke.
- //m_amp->CaptureTo(m_amp, capture_surface);
- // extract the captured frame to a thumbnail
- int imgpitch = 0;
- void *src = NULL;
- capture_surface->Lock(capture_surface, DSLF_READ, &src, &imgpitch);
- CPicture::CreateThumbnailFromSurface((const unsigned char*)src, capture_width, capture_height, imgpitch, strTarget);
- capture_surface->Unlock(capture_surface);
- capture_surface->Release(capture_surface);
- printf("CSMPFileInfo::ExtractThumb SMP_STOP\n");
+ // capture a frame
+ if (m_amp->CaptureTo(m_amp, capture_surface) == DFB_OK)
+ {
+ // extract the captured frame to a thumbnail
+ int imgpitch = 0;
+ void *src = NULL;
+ capture_surface->Lock(capture_surface, DSLF_READ, &src, &imgpitch);
+ CPicture::CreateThumbnailFromSurface((const unsigned char*)src, capture_width, capture_height, imgpitch, strTarget);
+ capture_surface->Unlock(capture_surface);
+ }
+
+ capture_surface->Release(capture_surface);
// Stop playing before CloseMedia or bad things happen.
m_amp_media->StatusUpdate();
if (m_amp_media->GetStatusState() != SMP_STOPPED)
https://github.com/xbmc/xbmc/commit/d092a908d697352d984618c73372059a71105e5f
commit d092a908d697352d984618c73372059a71105e5f
Merge: 05e6894 a9f4f85
Author: Gilles Vieira <gilles_vieira@...>
Date: Mon Feb 13 17:59:10 2012 +0100
Merge remote branch 'atlastech/xbmc-buildroot' into xbmc-buildroot
https://github.com/xbmc/xbmc/commit/a9f4f85e0e5875ac39a406f8911f76776ce631d3
commit a9f4f85e0e5875ac39a406f8911f76776ce631d3
Author: davilla <davilla@...>
Date: Fri Feb 10 12:53:13 2012 -0500
[smp] added smp based thumbgen, not working yet
diff --git a/xbmc/ThumbLoader.cpp b/xbmc/ThumbLoader.cpp
old mode 100644
new mode 100755
index 8e32592..3a3c852
--- a/xbmc/ThumbLoader.cpp
+++ b/xbmc/ThumbLoader.cpp
@@ -19,6 +19,8 @@
*
*/
+#include "system.h"
+
#include "filesystem/StackDirectory.h"
#include "ThumbLoader.h"
#include "utils/URIUtils.h"
@@ -36,7 +38,12 @@
#include "programs/Shortcut.h"
#include "video/VideoInfoTag.h"
#include "video/VideoDatabase.h"
+
+#if defined (USE_FFMPEG)
#include "cores/dvdplayer/DVDFileInfo.h"
+#elif defined (HAS_SIGMASMP)
+#include "cores/smpplayer/SMPFileInfo.h"
+#endif
using namespace XFILE;
using namespace std;
@@ -139,7 +146,13 @@ bool CThumbExtractor::DoWork()
if (m_thumb)
{
CLog::Log(LOGDEBUG,"%s - trying to extract thumb from video file %s", __FUNCTION__, m_path.c_str());
+#if defined (USE_FFMPEG)
result = CDVDFileInfo::ExtractThumb(m_path, m_target, &m_item.GetVideoInfoTag()->m_streamDetails);
+#elif defined (HAS_SIGMASMP)
+ result = CSMPFileInfo::ExtractThumb(m_path, m_target, &m_item.GetVideoInfoTag()->m_streamDetails);
+#else
+ result = false;
+#endif
if(result)
{
m_item.SetProperty("HasAutoThumb", true);
@@ -150,7 +163,13 @@ bool CThumbExtractor::DoWork()
else if (m_item.HasVideoInfoTag() && !m_item.GetVideoInfoTag()->HasStreamDetails())
{
CLog::Log(LOGDEBUG,"%s - trying to extract filestream details from video file %s", __FUNCTION__, m_path.c_str());
+#if defined (USE_FFMPEG)
result = CDVDFileInfo::GetFileStreamDetails(&m_item);
+#elif defined (HAS_SIGMASMP)
+ result = CSMPFileInfo::GetFileStreamDetails(&m_item);
+#else
+ result = false;
+#endif
}
return result;
diff --git a/xbmc/cores/smpplayer/Makefile.in b/xbmc/cores/smpplayer/Makefile.in
index e179513..0427aad 100755
--- a/xbmc/cores/smpplayer/Makefile.in
+++ b/xbmc/cores/smpplayer/Makefile.in
@@ -4,6 +4,7 @@ CXXFLAGS+= \
SRCS= \
FileIDataSource.cpp \
SMPMediaSpace.cpp \
+ SMPFileInfo.cpp \
SMPPlayer.cpp
LIB= SMPPlayer.a
diff --git a/xbmc/cores/smpplayer/SMPFileInfo.cpp b/xbmc/cores/smpplayer/SMPFileInfo.cpp
new file mode 100755
index 0000000..a76a290
--- /dev/null
+++ b/xbmc/cores/smpplayer/SMPFileInfo.cpp
@@ -0,0 +1,388 @@
+/*
+ * Copyright (C) 2005-2008 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "system.h"
+
+#include "SMPFileInfo.h"
+#include "FileItem.h"
+#include "filesystem/File.h"
+#include "filesystem/StackDirectory.h"
+#include "threads/Event.h"
+#include "threads/SystemClock.h"
+#include "pictures/Picture.h"
+#include "settings/AdvancedSettings.h"
+#include "windowing/WindowingFactory.h"
+#include "utils/log.h"
+#include "utils/URIUtils.h"
+#include "video/VideoInfoTag.h"
+
+#include "FileIDataSource.h"
+#include "SMPMediaSpace.h"
+
+#include <directfb.h>
+#include <directfb_version.h>
+#include <iadvancedmediaprovider.h>
+
+struct SIdsData
+{
+ CFileIDataSource *src;
+ void *ch;
+};
+
+// we need this to serialize access to hw image decoder.
+static CCriticalSection gThumbGenSection;
+
+// ****************************************************************
+bool CSMPFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &strTarget, CStreamDetails *pStreamDetails)
+{
+ CSingleLock lock(gThumbGenSection);
+
+ CLog::Log(LOGDEBUG, "CSMPFileInfo::ExtractThumb: enter");
+ int m_ampID = SECONDARY_VIDEO_AMP_ID;
+ IAdvancedMediaProvider *m_amp = NULL;
+ IDirectFBEventBuffer *m_amp_event= NULL;
+ CSMPMediaSpace *m_amp_media = NULL;
+
+ bool rtn = false;
+ int bgn_time = XbmcThreads::SystemClockMillis();
+
+ int ts_skip = 0;
+ std::string ids_url;
+ SMediaFormat format = { 0 };
+ // default to hinting container type
+ CStdString extension;
+ extension = URIUtils::GetExtension(strPath);
+
+ if (extension.Equals(".wmv"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_ASF;
+ else if (extension.Equals(".avi"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_AVI;
+ else if (extension.Equals(".flv"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_FLV;
+ else if (extension.Equals(".mkv"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MKV;
+ else if (extension.Equals(".mp4"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
+ else if (extension.Equals(".mov"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
+ else if (extension.Equals(".mpg"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".m2ts"))
+ {
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ ts_skip = 4;
+ }
+ else if (extension.Equals(".m2t"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".ts"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".vob"))
+ format.mediaType = MTYPE_APP_NONE; // Force autodetection
+ else if (extension.Equals(".mp3"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_MP3 | MTYPE_CONT_UNKNOWN;
+ else if (extension.Equals(".aac"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_AAC | MTYPE_CONT_UNKNOWN;
+ else
+ return false;
+
+ try
+ {
+ IDirectFB *dfb = g_Windowing.GetIDirectFB();
+ DFBResult res = dfb->GetInterface(dfb, "IAdvancedMediaProvider", "EM8630", (void*)m_ampID, (void **)&m_amp);
+ if (res != DFB_OK)
+ {
+ CLog::Log(LOGDEBUG, "CSMPFileInfo::ExtractThumb:Could not get IAdvancedMediaProvider");
+ return false;
+ }
+ // The event buffer must be retrieved BEFORE the OpenMedia() call
+ res = m_amp->GetEventBuffer(m_amp, &m_amp_event);
+ if (res != DFB_OK)
+ {
+ CLog::Log(LOGDEBUG, "CSMPFileInfo::ExtractThumb:Could not retrieve the AMP event buffer!!!");
+ return false;
+ }
+
+ // disable secondary video display (comment this out to see the sequence :)
+ /* TODO: Cannot disable the secondary video display ?
+ DFBScreenMixerConfig mixcfg;
+ IDirectFBScreen *screen = g_Windowing.GetIDirectFBScreen();
+ screen->GetMixerConfiguration(screen, 0, &mixcfg);
+ mixcfg.flags = (DFBScreenMixerConfigFlags)(DSMCONF_LAYERS);
+ if (DFB_DISPLAYLAYER_IDS_HAVE(mixcfg.layers, EM86LAYER_SECVIDEO))
+ DFB_DISPLAYLAYER_IDS_REMOVE(mixcfg.layers, EM86LAYER_SECVIDEO);
+ screen->SetMixerConfiguration(screen, 0, &mixcfg);
+ */
+
+ m_amp_media = new CSMPMediaSpace(m_amp, format.mediaType);
+ // This must stay in the stack until open
+ char ids_c_str[64];
+ if (ids_url.empty())
+ {
+ // use amp ids method to handle xbmc's vfs
+ SIdsData ids;
+ // setup the IDataSource cookie, CloseMedia will delete it
+ ids.src = new CFileIDataSource(strPath);
+ snprintf(ids_c_str, sizeof(ids_c_str)/sizeof(char), "ids://0x%08lx", (long unsigned int)&ids);
+ ids_url = ids_c_str;
+ }
+ // Setup open parameters
+ struct SLPBOpenParams parameters = {0, };
+ parameters.zero = 0;
+ // magic cookie to indicate this is binary params
+ parameters.a1b2c3d4 = 0xa1b2c3d4;
+ // system time clock offset in milliseconds.
+ // negative values will delay start of presentation.
+ parameters.stcOffset = -200;
+ // max prebuffersize in bytes, 0 for default
+ parameters.maxPrebufferSize = 100 * 1024;
+ // some param :)
+ parameters.tsSkip = ts_skip;
+
+ // open the media using the IAdvancedMediaProvider
+ res = m_amp->OpenMedia(m_amp, (char*)ids_url.c_str(), &format, ¶meters);
+ CLog::Log(LOGDEBUG, "CSMPFileInfo::ExtractThumb: Opening: %s", ids_url.c_str());
+ if (res != DFB_OK)
+ throw "CSMPFileInfo::ExtractThumb:OpenMedia() failed";
+
+ // wait for media to open.
+ printf("CSMPFileInfo::ExtractThumb wait for media to open\n");
+ bool checkpoint = false;
+ int timeout_ms = 40000;
+ while (timeout_ms > 0)
+ {
+ if (m_amp_event->WaitForEventWithTimeout(m_amp_event, 0, 100) == DFB_OK)
+ {
+ // eat the event
+ DFBEvent event;
+ m_amp_event->GetEvent(m_amp_event, &event);
+ m_amp_media->StatusUpdate();
+ if (m_amp_media->GetStatusState(true) != SMP_ERROR)
+ {
+ checkpoint = true;
+ break;
+ }
+ }
+ timeout_ms -= 100;
+ }
+ if (!checkpoint)
+ throw "CSMPFileInfo::ExtractThumb:OpenMedia timeout";
+
+ // start the playback.
+ printf("CSMPFileInfo::ExtractThumb start the playback\n");
+ res = m_amp->StartPresentation(m_amp, DFB_TRUE);
+
+ checkpoint = false;
+ // wait until playback starts.
+ printf("CSMPFileInfo::ExtractThumb wait until playback starts\n");
+ timeout_ms = 10000;
+ while (timeout_ms > 0)
+ {
+ if (m_amp_event->WaitForEventWithTimeout(m_amp_event, 0, 100) == DFB_OK)
+ {
+ // eat the event
+ DFBEvent event;
+ m_amp_event->GetEvent(m_amp_event, &event);
+ m_amp_media->StatusUpdate();
+ if (m_amp_media->GetStatusState() == SMP_PLAYING)
+ {
+ checkpoint = true;
+ break;
+ }
+ }
+ timeout_ms -= 100;
+ }
+ if (!checkpoint)
+ throw "CSMPFileInfo::ExtractThumb:StartPresentation timeout";
+
+ printf("CSMPFileInfo::ExtractThumb wait for media format is valid\n");
+ // wait for media format is valid.
+ checkpoint = false;
+ timeout_ms = 10000;
+ while (timeout_ms > 0)
+ {
+ Sleep(100);
+ m_amp_media->StatusUpdate();
+ if (m_amp_media->GetStatusFormatValid(true, false))
+ {
+ checkpoint = true;
+ break;
+ }
+ timeout_ms -= 100;
+ }
+ if (!checkpoint)
+ throw "CSMPFileInfo::ExtractThumb:wait for media format timeout";
+
+ int64_t video_duration_ms = 0, video_elapsed_ms = 0;
+ m_amp_media->GetStatusTime(video_elapsed_ms, video_duration_ms);
+ int video_width, video_height, video_viewmode;
+ float video_fps_numerator, video_fps_denominator;
+ m_amp_media->GetStatusVideo(video_width, video_height, video_viewmode, video_fps_numerator, video_fps_denominator);
+
+ // seek to 60 seconds into video.
+ if (video_duration_ms > 0)
+ {
+ printf("CSMPFileInfo::ExtractThumb seek to 60 seconds into video\n");
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.seektime_ms = video_duration_ms/4;
+ if (m_amp_media)
+ m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
+ if (m_amp && m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPFileInfo::ExtractThumb::SeekTime:AMP command failed!");
+ }
+ else
+ {
+ // cannot seek so next best thing is to wait a few seconds
+ // and hope we get an interesting thumb
+ Sleep(2000);
+ }
+
+ printf("CSMPFileInfo::ExtractThumb SMP_PLAYING\n");
+ // wait until playback starts again.
+ timeout_ms = 10000;
+ while (timeout_ms > 0)
+ {
+ if (m_amp_event->WaitForEventWithTimeout(m_amp_event, 0, 100) == DFB_OK)
+ {
+ // eat the event
+ DFBEvent event;
+ m_amp_event->GetEvent(m_amp_event, &event);
+ m_amp_media->StatusUpdate();
+ if (m_amp_media->GetStatusState() == SMP_PLAYING)
+ break;
+ }
+ timeout_ms -= 100;
+ }
+ m_amp_media->StatusUpdate();
+ if (m_amp_media->GetStatusState() != SMP_PLAYING)
+ throw "CSMPFileInfo::ExtractThumb: overseek to end.";
+
+
+ // snatch a thumbnail from playback surface.
+ printf("CSMPFileInfo::ExtractThumb snatch a thumbnail from playback surface\n");
+ IDirectFBSurface *capture_surface;
+ DFBSurfaceDescription dsc_surface;
+ // scale output down to thumbsize size
+ int capture_width = g_advancedSettings.m_thumbSize;
+ double w_scaler = (float) capture_width / video_width;
+ int capture_height = video_height * w_scaler;
+ // setup capture surface
+ dsc_surface.flags = (DFBSurfaceDescriptionFlags)(DSDESC_WIDTH|DSDESC_HEIGHT|DSDESC_CAPS|DSDESC_PIXELFORMAT);
+ dsc_surface.width = capture_width;
+ dsc_surface.height = capture_height;
+ // force the surface into the video memory
+ dsc_surface.caps = (DFBSurfaceCapabilities)(DSCAPS_VIDEOONLY);
+ dsc_surface.caps = (DFBSurfaceCapabilities)(dsc_surface.caps &~DSCAPS_SYSTEMONLY);
+ dsc_surface.pixelformat = DSPF_ARGB;
+ dfb->CreateSurface(dfb, &dsc_surface, &capture_surface);
+ capture_surface->Clear(capture_surface, 0xff, 0, 0, 0x80);
+ // capture a frame
+ //TODO: amp CaptureTo is broke.
+ //m_amp->CaptureTo(m_amp, capture_surface);
+ // extract the captured frame to a thumbnail
+ int imgpitch = 0;
+ void *src = NULL;
+ capture_surface->Lock(capture_surface, DSLF_READ, &src, &imgpitch);
+ CPicture::CreateThumbnailFromSurface((const unsigned char*)src, capture_width, capture_height, imgpitch, strTarget);
+ capture_surface->Unlock(capture_surface);
+ capture_surface->Release(capture_surface);
+
+ printf("CSMPFileInfo::ExtractThumb SMP_STOP\n");
+ // Stop playing before CloseMedia or bad things happen.
+ m_amp_media->StatusUpdate();
+ if (m_amp_media->GetStatusState() != SMP_STOPPED)
+ {
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ if (m_amp && m_amp_media)
+ {
+ m_amp_media->SetupCommand(SMP_STOP, cmd, params, res);
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPFileInfo::ExtractThumb:AMP stop command failed!");
+ if (!IS_SUCCESS( ((SResult*)&res)->value ))
+ CLog::Log(LOGERROR, "CSMPFileInfo::ExtractThumb:AMP stop SResult(%d)", ((SResult*)&res)->value);
+ }
+ }
+ rtn = true;
+ }
+ catch(char* error)
+ {
+ printf("CSMPFileInfo::ExtractThumb %s\n", error);
+ CLog::Log(LOGERROR, "%s", error);
+ }
+ catch(...)
+ {
+ printf("CSMPFileInfo::ExtractThumb Exception thrown\n");
+ CLog::Log(LOGERROR, "CSMPFileInfo::ExtractThumb Exception thrown");
+ }
+
+ // cleanup and exit
+ if (m_amp_media)
+ {
+ delete m_amp_media;
+ m_amp_media = NULL;
+ }
+ if (m_amp)
+ {
+ m_amp->CloseMedia(m_amp);
+ m_amp->Release(m_amp);
+ m_amp = NULL;
+ }
+ // The event buffer must be released after the amp Release call
+ if (m_amp_event)
+ {
+ m_amp_event->Release(m_amp_event);
+ m_amp_event = NULL;
+ }
+
+ if(!rtn)
+ {
+ XFILE::CFile file;
+ if (file.OpenForWrite(strTarget))
+ file.Close();
+ }
+
+ CLog::Log(LOGDEBUG,"%s - measured %d ms to extract thumb from file <%s> ",
+ __FUNCTION__, (XbmcThreads::SystemClockMillis() - bgn_time), strPath.c_str());
+
+ CLog::Log(LOGDEBUG, "CSMPFileInfo::ExtractThumb: exit");
+ return rtn;
+}
+
+bool CSMPFileInfo::ExtractSnapshot(void)
+{
+ return false;
+}
+
+// ****************************************************************
+bool CSMPFileInfo::GetFileDuration(const CStdString &path, int& duration)
+{
+ return false;
+}
+
+// ****************************************************************
+bool CSMPFileInfo::GetFileStreamDetails(CFileItem *pItem)
+{
+ return false;
+}
+
diff --git a/xbmc/cores/smpplayer/SMPFileInfo.h b/xbmc/cores/smpplayer/SMPFileInfo.h
new file mode 100755
index 0000000..293f71f
--- /dev/null
+++ b/xbmc/cores/smpplayer/SMPFileInfo.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2005-2009 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+#pragma once
+
+#include "utils/StdString.h"
+
+class CFileItem;
+class CStreamDetails;
+class CDVDInputStream;
+
+class CSMPFileInfo
+{
+public:
+ static bool GetFileDuration(const CStdString &strPath, int &duration_ms);
+
+ // Probe the files streams and store the info in the VideoInfoTag
+ static bool GetFileStreamDetails(CFileItem *pItem);
+
+ // Extract a thumbnail immage from the media at strPath an image file in strTarget, optionally populating a streamdetails class with the data
+ static bool ExtractThumb(const CStdString &strPath, const CStdString &strTarget, CStreamDetails *pStreamDetails);
+
+ static bool ExtractSnapshot(void);
+};
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index e737e95..3d784f4 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1480,7 +1480,7 @@ void CSMPPlayer::Process()
m_callback.OnPlayBackStarted();
// starttime has units of seconds, if we try to do this
- // to early, it confuses amp.
+ // too early, it confuses amp.
if (m_options.starttime > 1)
SeekTime(m_options.starttime * 1000);
https://github.com/xbmc/xbmc/commit/05e689459789d7772a99381ca49c47911e0fcb3e
commit 05e689459789d7772a99381ca49c47911e0fcb3e
Merge: 497dc3a 04dbb26
Author: Gilles Vieira <gilles_vieira@...>
Date: Wed Feb 8 17:46:45 2012 +0100
Merge remote branch 'atlastech/xbmc-buildroot' into xbmc-buildroot
https://github.com/xbmc/xbmc/commit/497dc3ab2e4a08a28001dc4f694f5577f37aabee
commit 497dc3ab2e4a08a28001dc4f694f5577f37aabee
Merge: 55db658 c4f92b8
Author: Gilles VIEIRA <gilles_vieira@...>
Date: Wed Feb 8 03:12:45 2012 -0800
Merge pull request #2 from SigmaDesigns/c4f92b86997f513c09bb6ea19e64808155eb6fd6
DVD fix
https://github.com/xbmc/xbmc/commit/04dbb269299707f8d8aa6c5186484d3e759f64a3
commit 04dbb269299707f8d8aa6c5186484d3e759f64a3
Merge: 55db658 c4f92b8
Author: davilla <davilla@...>
Date: Fri Feb 3 08:47:37 2012 -0800
Merge pull request #20 from SigmaDesigns/wip
Readding the fix for DVD on Sigma
https://github.com/xbmc/xbmc/commit/c4f92b86997f513c09bb6ea19e64808155eb6fd6
commit c4f92b86997f513c09bb6ea19e64808155eb6fd6
Author: Gilles Vieira <gilles_vieira@...>
Date: Fri Feb 3 17:27:25 2012 +0100
Readding the fix for DVD on Sigma
diff --git a/xbmc/storage/DetectDVDType.cpp b/xbmc/storage/DetectDVDType.cpp
index 79f2bed..5f39bd3 100644
--- a/xbmc/storage/DetectDVDType.cpp
+++ b/xbmc/storage/DetectDVDType.cpp
@@ -428,7 +428,10 @@ DWORD CDetectDVDMedia::GetTrayState()
m_cdio->cdio_destroy(cdio);
}
else
+ {
+ m_dwLastTrayState = DRIVE_NOT_READY;
return DRIVE_NOT_READY;
+ }
#endif // USING_CDIO78
#endif // _LINUX
diff --git a/xbmc/storage/MediaManager.cpp b/xbmc/storage/MediaManager.cpp
index fe91884..c9027f9 100644
--- a/xbmc/storage/MediaManager.cpp
+++ b/xbmc/storage/MediaManager.cpp
@@ -501,6 +501,11 @@ bool CMediaManager::HashDVD(const CStdString& dvdpath, uint32_t& crc)
CFileItemList vecItemsTS;
bool success = false;
+#if defined(HAS_SIGMASMP)
+ // On sigmal, this breaks DVDs with CSS
+ return false;
+#endif
+
// first try to open the VIDEO_TS folder of the DVD
if (!CDirectory::GetDirectory( dvdpath, vecItemsTS, ".ifo" ))
{
diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp
index b32ab10..05f9fb4 100644
--- a/xbmc/utils/URIUtils.cpp
+++ b/xbmc/utils/URIUtils.cpp
@@ -519,7 +519,12 @@ bool URIUtils::IsDVD(const CStdString& strFile)
if(GetDriveType(strFile.c_str()) == DRIVE_CDROM)
return true;
#else
- if (strFileLow == "iso9660://" || strFileLow == "udf://" || strFileLow == "dvd://1" )
+ if (strFileLow == "udf://" ||
+ strFileLow == "iso9660://" ||
+#if defined(HAS_SIGMASMP)
+ strFileLow == "iso9660://video_ts/video_ts.ifo" ||
+#endif
+ strFileLow == "dvd://1" )
return true;
#endif
https://github.com/xbmc/xbmc/commit/55db658008fa5a6555322889100b114e6279f2df
commit 55db658008fa5a6555322889100b114e6279f2df
Author: davilla <davilla@...>
Date: Wed Feb 1 15:23:45 2012 -0500
[smp] fixed, let us try that again to hook the deinterlace methods
diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
index e72fc77..3082b3b 100755
--- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -1855,7 +1855,7 @@ EINTERLACEMETHOD CLinuxRendererGLES::AutoInterlaceMethod()
if(m_renderMethod & RENDER_CVREF)
return VS_INTERLACEMETHOD_NONE;
#if defined(HAS_SIGMASMP)
- return VS_INTERLACEMETHOD_INVERSE_TELECINE;
+ return VS_INTERLACEMETHOD_DEINTERLACE;
#else
#if defined(__i386__) || defined(__x86_64__)
return VS_INTERLACEMETHOD_DEINTERLACE_HALF;
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 9e15471..e737e95 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1013,15 +1013,17 @@ void CSMPPlayer::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
{
default:
case VS_INTERLACEMETHOD_AUTO:
+ case VS_INTERLACEMETHOD_DEINTERLACE:
dlcfg.deint_mode = DDM_PROGRESSIVE;
break;
case VS_INTERLACEMETHOD_RENDER_BOB:
+ dlcfg.deint_mode = DDM_NONE;
break;
case VS_INTERLACEMETHOD_RENDER_WEAVE:
- break;
- case VS_INTERLACEMETHOD_DEINTERLACE:
+ dlcfg.deint_mode = DDM_WEAVE;
break;
case VS_INTERLACEMETHOD_INVERSE_TELECINE:
+ dlcfg.deint_mode = DDM_IVTC;
break;
}
}
https://github.com/xbmc/xbmc/commit/d86b6b085fd5669cc246ca80abac01e4d068ecb2
commit d86b6b085fd5669cc246ca80abac01e4d068ecb2
Author: davilla <davilla@...>
Date: Wed Feb 1 14:58:26 2012 -0500
[smp] hook deinterlace methods
diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
index 36a5db2..e72fc77 100755
--- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -1791,15 +1791,15 @@ bool CLinuxRendererGLES::SupportsMultiPassRendering()
bool CLinuxRendererGLES::Supports(EDEINTERLACEMODE mode)
{
- if (mode == VS_DEINTERLACEMODE_OFF)
- return true;
-
if(m_renderMethod & RENDER_OMXEGL)
return false;
if(m_renderMethod & RENDER_CVREF)
return false;
+ if (mode == VS_DEINTERLACEMODE_OFF)
+ return true;
+
if(mode == VS_DEINTERLACEMODE_AUTO
|| mode == VS_DEINTERLACEMODE_FORCE)
return true;
@@ -1818,6 +1818,13 @@ bool CLinuxRendererGLES::Supports(EINTERLACEMETHOD method)
if(method == VS_INTERLACEMETHOD_AUTO)
return true;
+#if defined(HAS_SIGMASMP)
+ if(method == VS_INTERLACEMETHOD_RENDER_BOB
+ || method == VS_INTERLACEMETHOD_RENDER_WEAVE
+ || method == VS_INTERLACEMETHOD_DEINTERLACE
+ || method == VS_INTERLACEMETHOD_INVERSE_TELECINE)
+ return true;
+#else
#if defined(__i386__) || defined(__x86_64__)
if(method == VS_INTERLACEMETHOD_DEINTERLACE
|| method == VS_INTERLACEMETHOD_DEINTERLACE_HALF
@@ -1826,6 +1833,7 @@ bool CLinuxRendererGLES::Supports(EINTERLACEMETHOD method)
if(method == VS_INTERLACEMETHOD_SW_BLEND)
#endif
return true;
+#endif
return false;
}
@@ -1846,12 +1854,15 @@ EINTERLACEMETHOD CLinuxRendererGLES::AutoInterlaceMethod()
if(m_renderMethod & RENDER_CVREF)
return VS_INTERLACEMETHOD_NONE;
-
+#if defined(HAS_SIGMASMP)
+ return VS_INTERLACEMETHOD_INVERSE_TELECINE;
+#else
#if defined(__i386__) || defined(__x86_64__)
return VS_INTERLACEMETHOD_DEINTERLACE_HALF;
#else
return VS_INTERLACEMETHOD_SW_BLEND;
#endif
+#endif
}
#ifdef HAVE_LIBOPENMAX
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 2941df9..9e15471 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -127,6 +127,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
m_show_mainvideo = -1;
m_dst_rect.SetRect(0, 0, 0, 0);
m_deinterlace_mode = VS_DEINTERLACEMODE_INVALID;
+ m_deinterlace_method = VS_INTERLACEMETHOD_INVALID;
IDirectFB *dfb = g_Windowing.GetIDirectFB();
DFBResult res = dfb->GetInterface(dfb, "IAdvancedMediaProvider", "EM8630", (void*)m_ampID, (void **)&m_amp);
@@ -977,9 +978,11 @@ void CSMPPlayer::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
}
// check if deinterlace settings change changed
EDEINTERLACEMODE deinterlace_mode = g_settings.m_currentVideoSettings.m_DeinterlaceMode;
- if (m_deinterlace_mode != deinterlace_mode)
+ EINTERLACEMETHOD deinterlace_method = g_renderManager.AutoInterlaceMethod(g_settings.m_currentVideoSettings.m_InterlaceMethod);
+ if (m_deinterlace_mode != deinterlace_mode || m_deinterlace_method != deinterlace_method)
{
m_deinterlace_mode = deinterlace_mode;
+ m_deinterlace_method= deinterlace_method;
deinterlace_changed = true;
}
@@ -1006,7 +1009,21 @@ void CSMPPlayer::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
else
{
dlcfg.options = (DFBDisplayLayerOptions)(dlcfg.options | DLOP_DEINTERLACING);
- dlcfg.deint_mode = DDM_PROGRESSIVE;
+ switch(m_deinterlace_method)
+ {
+ default:
+ case VS_INTERLACEMETHOD_AUTO:
+ dlcfg.deint_mode = DDM_PROGRESSIVE;
+ break;
+ case VS_INTERLACEMETHOD_RENDER_BOB:
+ break;
+ case VS_INTERLACEMETHOD_RENDER_WEAVE:
+ break;
+ case VS_INTERLACEMETHOD_DEINTERLACE:
+ break;
+ case VS_INTERLACEMETHOD_INVERSE_TELECINE:
+ break;
+ }
}
dfb_layer->SetConfiguration(dfb_layer, &dlcfg);
//printf("CSMPPlayer::SetVideoRect:deinterlace_changed \n");
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index 7f77e20..503952d 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -205,6 +205,7 @@ private:
CRect m_dst_rect;
int m_view_mode;
EDEINTERLACEMODE m_deinterlace_mode;
+ EINTERLACEMETHOD m_deinterlace_method;
bool m_dvd_mediatype;
std::vector<SIdsData*> m_sub_ids;
diff --git a/xbmc/settings/VideoSettings.h b/xbmc/settings/VideoSettings.h
index 3ee5710..95d03ab 100644
--- a/xbmc/settings/VideoSettings.h
+++ b/xbmc/settings/VideoSettings.h
@@ -68,7 +68,8 @@ enum EINTERLACEMETHOD
VS_INTERLACEMETHOD_SW_BLEND = 20,
- VS_INTERLACEMETHOD_MAX // do not use and keep as last enum value.
+ VS_INTERLACEMETHOD_MAX, // do not use and keep as last enum value.
+ VS_INTERLACEMETHOD_INVALID=-1,
};
enum ESCALINGMETHOD
https://github.com/xbmc/xbmc/commit/24070fbf6d4df9673e6587ee72df8228028672ba
commit 24070fbf6d4df9673e6587ee72df8228028672ba
Author: davilla <davilla@...>
Date: Wed Feb 1 13:43:39 2012 -0500
[smp] hook control of deinterlacer
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 445f44c..2941df9 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -126,6 +126,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
m_show_mainvideo = -1;
m_dst_rect.SetRect(0, 0, 0, 0);
+ m_deinterlace_mode = VS_DEINTERLACEMODE_INVALID;
IDirectFB *dfb = g_Windowing.GetIDirectFB();
DFBResult res = dfb->GetInterface(dfb, "IAdvancedMediaProvider", "EM8630", (void*)m_ampID, (void **)&m_amp);
@@ -963,66 +964,99 @@ void CSMPPlayer::GetVideoRect(CRect& SrcRect, CRect& DestRect)
void CSMPPlayer::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
{
+ bool dst_rect_changed = false;
+ bool deinterlace_changed = false;
+
// check if destination rect or video view mode has changed
- if ((m_dst_rect != DestRect) || (m_view_mode != g_settings.m_currentVideoSettings.m_ViewMode))
+ int view_mode = g_settings.m_currentVideoSettings.m_ViewMode;
+ if ((m_dst_rect != DestRect) || (m_view_mode != view_mode))
{
m_dst_rect = DestRect;
- m_view_mode = g_settings.m_currentVideoSettings.m_ViewMode;
+ m_view_mode = view_mode;
+ dst_rect_changed = true;
}
- else
+ // check if deinterlace settings change changed
+ EDEINTERLACEMODE deinterlace_mode = g_settings.m_currentVideoSettings.m_DeinterlaceMode;
+ if (m_deinterlace_mode != deinterlace_mode)
{
- // mainvideo 'should' be showing already if we get here, make sure.
- ShowMainVideo(true);
- return;
+ m_deinterlace_mode = deinterlace_mode;
+ deinterlace_changed = true;
}
- // when running 1080p display size,
- // gui is at 720p but m_dst_rect is relative to gui.
- // need to scale up m_dst_rect to display size as video decodes
- // to separate video plane that is at display size.
- CRect gui, display, dst_rect;
- RESOLUTION res = g_graphicsContext.GetVideoResolution();
- gui.SetRect(0, 0, g_settings.m_ResInfo[res].iWidth, g_settings.m_ResInfo[res].iHeight);
- // bug in directfb/smp handling of SetScreenRectangle on video layer
- // when gui size is different from display. After SetScreenRectangle
- // video is too large when gui is 720p and display is 1080p.
- display.SetRect(0, 0, g_settings.m_ResInfo[res].iWidth, g_settings.m_ResInfo[res].iHeight);
- //display.SetRect(0, 0, g_settings.m_ResInfo[res].iScreenWidth, g_settings.m_ResInfo[res].iScreenHeight);
-
- dst_rect = m_dst_rect;
- if (gui != display)
+ if (dst_rect_changed || deinterlace_changed)
{
- float xscale = display.Width() / gui.Width();
- float yscale = display.Height() / gui.Height();
- dst_rect.x1 *= xscale;
- dst_rect.x2 *= xscale;
- dst_rect.y1 *= yscale;
- dst_rect.y2 *= yscale;
- }
+ if (dst_rect_changed)
+ ShowMainVideo(false);
- // destination rectangle cannot be outside display bounds
- if (!display.PtInRect(CPoint(dst_rect.x1, dst_rect.y1)))
- return;
- if (!display.PtInRect(CPoint(dst_rect.x2, dst_rect.y2)))
- return;
+ IDirectFB *dfb = g_Windowing.GetIDirectFB();
+ IDirectFBDisplayLayer *dfb_layer;
+ dfb->GetDisplayLayer(dfb, XBMC_MAINVIDEO, &dfb_layer);
+ dfb_layer->SetCooperativeLevel(dfb_layer, DLSCL_EXCLUSIVE);
- CStdString rectangle;
- rectangle.Format("%i,%i,%i,%i",
- (int)dst_rect.x1, (int)dst_rect.y1,
- (int)dst_rect.Width(), (int)dst_rect.Height());
- printf("CSMPPlayer::SetVideoRect:m_dst_rect(%s)\n", rectangle.c_str());
+ if (deinterlace_changed)
+ {
+ DFBDisplayLayerConfig dlcfg;
+ dfb_layer->GetConfiguration(dfb_layer, &dlcfg);
+ dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_OPTIONS | DLCONF_DEINTERLACING_MODE);
+ if (m_deinterlace_mode == VS_DEINTERLACEMODE_OFF)
+ {
+ dlcfg.options = (DFBDisplayLayerOptions)(dlcfg.options & ~DLOP_DEINTERLACING);
+ dlcfg.deint_mode = DDM_NONE;
+ }
+ else
+ {
+ dlcfg.options = (DFBDisplayLayerOptions)(dlcfg.options | DLOP_DEINTERLACING);
+ dlcfg.deint_mode = DDM_PROGRESSIVE;
+ }
+ dfb_layer->SetConfiguration(dfb_layer, &dlcfg);
+ //printf("CSMPPlayer::SetVideoRect:deinterlace_changed \n");
+ }
- ShowMainVideo(false);
+ if (dst_rect_changed)
+ {
+ // when running 1080p display size,
+ // gui is at 720p but m_dst_rect is relative to gui.
+ // need to scale up m_dst_rect to display size as video decodes
+ // to separate video plane that is at display size.
+ CRect gui, display, dst_rect;
+ RESOLUTION res = g_graphicsContext.GetVideoResolution();
+ gui.SetRect(0, 0, g_settings.m_ResInfo[res].iWidth, g_settings.m_ResInfo[res].iHeight);
+ // bug in directfb/smp handling of SetScreenRectangle on video layer
+ // when gui size is different from display. After SetScreenRectangle
+ // video is too large when gui is 720p and display is 1080p.
+ display.SetRect(0, 0, g_settings.m_ResInfo[res].iWidth, g_settings.m_ResInfo[res].iHeight);
+ //display.SetRect(0, 0, g_settings.m_ResInfo[res].iScreenWidth, g_settings.m_ResInfo[res].iScreenHeight);
+
+ dst_rect = m_dst_rect;
+ if (gui != display)
+ {
+ float xscale = display.Width() / gui.Width();
+ float yscale = display.Height() / gui.Height();
+ dst_rect.x1 *= xscale;
+ dst_rect.x2 *= xscale;
+ dst_rect.y1 *= yscale;
+ dst_rect.y2 *= yscale;
+ }
+ // destination rectangle cannot be outside display bounds
+ if (!display.PtInRect(CPoint(dst_rect.x1, dst_rect.y1)))
+ return;
+ if (!display.PtInRect(CPoint(dst_rect.x2, dst_rect.y2)))
+ return;
+
+ dfb_layer->SetScreenRectangle(dfb_layer, dst_rect.x1, dst_rect.y1, dst_rect.Width(), dst_rect.Height());
- IDirectFB *dfb = g_Windowing.GetIDirectFB();
- IDirectFBDisplayLayer *dfb_layer;
- dfb->GetDisplayLayer(dfb, XBMC_MAINVIDEO, &dfb_layer);
- dfb_layer->SetCooperativeLevel(dfb_layer, DLSCL_EXCLUSIVE);
- dfb_layer->SetScreenRectangle(dfb_layer, dst_rect.x1, dst_rect.y1, dst_rect.Width(), dst_rect.Height());
- // the dest rect change will sometimes glitch, try to wait it out.
- for (int i = 0; i < 6; i++)
- dfb_layer->WaitForSync(dfb_layer);
- dfb_layer->Release(dfb_layer);
+ CStdString rectangle;
+ rectangle.Format("%i,%i,%i,%i",
+ (int)dst_rect.x1, (int)dst_rect.y1,
+ (int)dst_rect.Width(), (int)dst_rect.Height());
+ //printf("CSMPPlayer::SetVideoRect:m_dst_rect(%s)\n", rectangle.c_str());
+ }
+
+ // changes will sometimes glitch, try to wait it out.
+ for (int i = 0; i < 6; i++)
+ dfb_layer->WaitForSync(dfb_layer);
+ dfb_layer->Release(dfb_layer);
+ }
// we only get called once gui has changed to something
// that would show video playback, so show it.
ShowMainVideo(true);
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index fff7b98..7f77e20 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -23,6 +23,7 @@
#include "FileItem.h"
#include "cores/IPlayer.h"
#include "dialogs/GUIDialogBusy.h"
+#include "settings/VideoSettings.h"
#include "threads/Thread.h"
typedef struct SIdsData SIdsData;
@@ -203,6 +204,7 @@ private:
int m_show_mainvideo;
CRect m_dst_rect;
int m_view_mode;
+ EDEINTERLACEMODE m_deinterlace_mode;
bool m_dvd_mediatype;
std::vector<SIdsData*> m_sub_ids;
diff --git a/xbmc/settings/VideoSettings.h b/xbmc/settings/VideoSettings.h
index 6641145..3ee5710 100644
--- a/xbmc/settings/VideoSettings.h
+++ b/xbmc/settings/VideoSettings.h
@@ -33,7 +33,8 @@ enum EDEINTERLACEMODE
{
VS_DEINTERLACEMODE_OFF=0,
VS_DEINTERLACEMODE_AUTO=1,
- VS_DEINTERLACEMODE_FORCE=2
+ VS_DEINTERLACEMODE_FORCE=2,
+ VS_DEINTERLACEMODE_INVALID=-1
};
enum EINTERLACEMETHOD
https://github.com/xbmc/xbmc/commit/fa06aab5df8e23fd71c221550442e8725b0c9770
commit fa06aab5df8e23fd71c221550442e8725b0c9770
Author: davilla <davilla@...>
Date: Tue Jan 31 13:21:18 2012 -0500
[smp] force vob to auto-detection
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index baadec7..445f44c 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -199,7 +199,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
else if (extension.Equals(".ts"))
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
else if (extension.Equals(".vob"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2PES;
+ format.mediaType = MTYPE_APP_NONE; // Force autodetection
else if (extension.Equals(".mp3"))
format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_MP3 | MTYPE_CONT_UNKNOWN;
else if (extension.Equals(".aac"))
https://github.com/xbmc/xbmc/commit/64ceb67c867cd8ffb6f169e783bff4058818ba7b
commit 64ceb67c867cd8ffb6f169e783bff4058818ba7b
Author: theuni <theuni-nospam-@...>
Date: Mon Jan 30 23:58:50 2012 -0500
Revert "Revert "[smp] do not hammer libcdio on every file open""
This reverts commit 03a1a52701a83f0d8bb8d9b98bd8b22c9468d961.
Un-vert now that the mighty have spoken.
diff --git a/xbmc/linux/XFileUtils.cpp b/xbmc/linux/XFileUtils.cpp
index 0545f0d..7da8314 100644
--- a/xbmc/linux/XFileUtils.cpp
+++ b/xbmc/linux/XFileUtils.cpp
@@ -275,7 +275,7 @@ if (errno == 20)
HANDLE result = new CXHandle(CXHandle::HND_FILE);
result->fd = fd;
-#if defined(TARGET_LINUX) && defined(HAS_DVD_DRIVE)
+#if defined(TARGET_LINUX) && defined(HAS_DVD_DRIVE) && !defined(HAS_SIGMASMP)
// special case for opening the cdrom device
if (strcmp(lpFileName, MEDIA_DETECT::CLibcdio::GetInstance()->GetDeviceFileName())==0)
result->m_bCDROM = true;
https://github.com/xbmc/xbmc/commit/1f976510147efa77e2ad467788dcd042a83a8374
commit 1f976510147efa77e2ad467788dcd042a83a8374
Author: theuni <theuni-nospam-@...>
Date: Mon Jan 30 23:57:45 2012 -0500
Revert "Revert "[smp] fixed logic typo""
Un-vert now that the mighty have spoken.
This reverts commit 4d214268e1dfbb956aaff635d98bac1d85fea3e5.
Conflicts:
xbmc/storage/DetectDVDType.cpp
diff --git a/xbmc/storage/DetectDVDType.cpp b/xbmc/storage/DetectDVDType.cpp
index 5e185c7..79f2bed 100644
--- a/xbmc/storage/DetectDVDType.cpp
+++ b/xbmc/storage/DetectDVDType.cpp
@@ -88,7 +88,8 @@ void CDetectDVDMedia::OnStartup()
void CDetectDVDMedia::Process()
{
// for apple - currently disable this check since cdio will return null if no media is loaded
-#ifndef __APPLE__
+// note: drive detect callbacks are not working under sigma so we bypass this also.
+#if !defined(__APPLE__) && !defined(HAS_SIGMASMP)
//Before entering loop make sure we actually have a CDrom drive
CdIo_t *p_cdio = m_cdio->cdio_open(NULL, DRIVER_DEVICE);
if (p_cdio == NULL)
https://github.com/xbmc/xbmc/commit/a1751eb587ba41a3b184e5debae9332ca69824f1
commit a1751eb587ba41a3b184e5debae9332ca69824f1
Author: theuni <theuni-nospam-@...>
Date: Mon Jan 30 23:32:06 2012 -0500
[smp] fix gles build with no GL_BGRA
diff --git a/xbmc/cores/VideoRenderers/OverlayRendererGL.cpp b/xbmc/cores/VideoRenderers/OverlayRendererGL.cpp
index 4cdd7fa..b18093d 100644
--- a/xbmc/cores/VideoRenderers/OverlayRendererGL.cpp
+++ b/xbmc/cores/VideoRenderers/OverlayRendererGL.cpp
@@ -65,7 +65,9 @@ static void LoadTexture(GLenum target
int bytesPerPixel;
switch (externalFormat)
{
+#ifndef HAS_GLES
case GL_BGRA:
+#endif
case GL_RGBA:
bytesPerPixel = 4;
break;
https://github.com/xbmc/xbmc/commit/23a1d4dafbee6b8dbd33883936534534c95977a4
commit 23a1d4dafbee6b8dbd33883936534534c95977a4
Merge: c79cfa4 f76c547
Author: theuni <theuni-nospam-@...>
Date: Mon Jan 30 23:25:24 2012 -0500
Merge commit 'Eden_beta2' into xbmc-buildroot
Conflicts:
xbmc/settings/GUIWindowSettingsScreenCalibration.cpp
diff --cc xbmc/GUIInfoManager.cpp
index 2b7285b,0aae139..b9d4c6b
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@@ -1286,10 -1286,10 +1286,10 @@@ CStdString CGUIInfoManager::GetLabel(in
break;
case SYSTEM_SCREEN_RESOLUTION:
- if (g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].bFullScreen)
+ if(g_Windowing.IsFullScreen())
strLabel.Format("%ix%i@... - %s (%02.2f fps)",
- g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iWidth,
- g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iHeight,
+ g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iScreenWidth,
+ g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iScreenHeight,
g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].fRefreshRate,
g_localizeStrings.Get(244), GetFPS());
else
diff --cc xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
index 7d7ce26,578f6cc..36a5db2
mode 100755,100644..100755
--- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
diff --cc xbmc/settings/GUIWindowSettingsCategory.cpp
index 2260575,e9f77b2..e834dff
mode 100755,100644..100755
--- a/xbmc/settings/GUIWindowSettingsCategory.cpp
+++ b/xbmc/settings/GUIWindowSettingsCategory.cpp
diff --cc xbmc/settings/GUIWindowSettingsScreenCalibration.cpp
index 52bbdc4,6aaf61b..3b831e0
--- a/xbmc/settings/GUIWindowSettingsScreenCalibration.cpp
+++ b/xbmc/settings/GUIWindowSettingsScreenCalibration.cpp
@@@ -350,13 -351,13 +351,13 @@@ void CGUIWindowSettingsScreenCalibratio
}
// set the label control correctly
CStdString strText;
- if (g_settings.m_ResInfo[m_Res[m_iCurRes]].bFullScreen)
+ if (g_Windowing.IsFullScreen())
- strText.Format("%ix%i@... - %s | %s", g_settings.m_ResInfo[m_Res[m_iCurRes]].iWidth,
- g_settings.m_ResInfo[m_Res[m_iCurRes]].iHeight, g_settings.m_ResInfo[m_Res[m_iCurRes]].fRefreshRate,
+ strText.Format("%ix%i@... - %s | %s", g_settings.m_ResInfo[m_Res[m_iCurRes]].iScreenWidth,
+ g_settings.m_ResInfo[m_Res[m_iCurRes]].iScreenHeight, g_settings.m_ResInfo[m_Res[m_iCurRes]].fRefreshRate,
g_localizeStrings.Get(244).c_str(), strStatus.c_str());
else
- strText.Format("%ix%i - %s | %s", g_settings.m_ResInfo[m_Res[m_iCurRes]].iWidth,
- g_settings.m_ResInfo[m_Res[m_iCurRes]].iHeight,
+ strText.Format("%ix%i - %s | %s", g_settings.m_ResInfo[m_Res[m_iCurRes]].iScreenWidth,
+ g_settings.m_ResInfo[m_Res[m_iCurRes]].iScreenHeight,
g_localizeStrings.Get(242).c_str(), strStatus.c_str());
SET_CONTROL_LABEL(CONTROL_LABEL_ROW1, strText);
diff --cc xbmc/video/windows/GUIWindowFullScreen.cpp
index 27612b6,4d77a03..357534b
--- a/xbmc/video/windows/GUIWindowFullScreen.cpp
+++ b/xbmc/video/windows/GUIWindowFullScreen.cpp
@@@ -870,10 -871,10 +871,10 @@@ void CGUIWindowFullScreen::FrameMove(
int iResolution = g_graphicsContext.GetVideoResolution();
{
CStdString strStatus;
- if (g_settings.m_ResInfo[iResolution].bFullScreen)
+ if (g_Windowing.IsFullScreen())
strStatus.Format("%s %ix%i@... - %s",
- g_localizeStrings.Get(13287), g_settings.m_ResInfo[iResolution].iWidth,
- g_settings.m_ResInfo[iResolution].iHeight, g_settings.m_ResInfo[iResolution].fRefreshRate,
+ g_localizeStrings.Get(13287), g_settings.m_ResInfo[iResolution].iScreenWidth,
+ g_settings.m_ResInfo[iResolution].iScreenHeight, g_settings.m_ResInfo[iResolution].fRefreshRate,
g_localizeStrings.Get(244));
else
strStatus.Format("%s %ix%i - %s",
diff --cc xbmc/windowing/WinSystem.cpp
index 8ba5226,30c24e7..17c7c4b
mode 100755,100644..100755
--- a/xbmc/windowing/WinSystem.cpp
+++ b/xbmc/windowing/WinSystem.cpp
https://github.com/xbmc/xbmc/commit/c79cfa47bde616e3906657465a4b43a4cc45abd5
commit c79cfa47bde616e3906657465a4b43a4cc45abd5
Author: theuni <theuni-nospam-@...>
Date: Mon Jan 30 23:24:42 2012 -0500
Revert "[smp] various sigma fixes"
This reverts commit 83f90152c19b8acf0610a7468a6babd63cb5de8c.
Reverting for clean merge to beta2. This commit should be re-evaluated.
diff --git a/xbmc/storage/DetectDVDType.cpp b/xbmc/storage/DetectDVDType.cpp
old mode 100755
new mode 100644
index 4b60cf4..5e185c7
--- a/xbmc/storage/DetectDVDType.cpp
+++ b/xbmc/storage/DetectDVDType.cpp
@@ -88,8 +88,7 @@ void CDetectDVDMedia::OnStartup()
void CDetectDVDMedia::Process()
{
// for apple - currently disable this check since cdio will return null if no media is loaded
-// note: drive detect callbacks are not working under sigma so we bypass this also.
-#if !defined(__APPLE__) || !defined(HAS_SIGMASMP)
+#ifndef __APPLE__
//Before entering loop make sure we actually have a CDrom drive
CdIo_t *p_cdio = m_cdio->cdio_open(NULL, DRIVER_DEVICE);
if (p_cdio == NULL)
@@ -428,10 +427,8 @@ DWORD CDetectDVDMedia::GetTrayState()
m_cdio->cdio_destroy(cdio);
}
else
- {
- m_dwLastTrayState = DRIVE_NOT_READY;
return DRIVE_NOT_READY;
- }
+
#endif // USING_CDIO78
#endif // _LINUX
diff --git a/xbmc/storage/MediaManager.cpp b/xbmc/storage/MediaManager.cpp
old mode 100755
new mode 100644
index b0f0ab2..b78bee5
--- a/xbmc/storage/MediaManager.cpp
+++ b/xbmc/storage/MediaManager.cpp
@@ -501,10 +501,6 @@ bool CMediaManager::HashDVD(const CStdString& dvdpath, uint32_t& crc)
CFileItemList vecItemsTS;
bool success = false;
-#if defined(HAS_SIGMASMP)
- // On sigmal, this breaks DVDs with CSS
- return false;
-#endif
// first try to open the VIDEO_TS folder of the DVD
if (!CDirectory::GetDirectory( dvdpath, vecItemsTS, ".ifo" ))
{
diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp
old mode 100755
new mode 100644
index 4406114..584e948
--- a/xbmc/utils/URIUtils.cpp
+++ b/xbmc/utils/URIUtils.cpp
@@ -519,15 +519,7 @@ bool URIUtils::IsDVD(const CStdString& strFile)
#else
CStdString strFileLow = strFile;
strFileLow.MakeLower();
- if (strFileLow == "d:/" ||
- strFileLow == "d:\\" ||
- strFileLow == "d:" ||
- strFileLow == "iso9660://" ||
-#if defined(HAS_SIGMASMP)
- strFileLow == "iso9660://video_ts/video_ts.ifo" ||
-#endif
- strFileLow == "udf://" ||
- strFileLow == "dvd://1" )
+ if (strFileLow == "d:/" || strFileLow == "d:\\" || strFileLow == "d:" || strFileLow == "iso9660://" || strFileLow == "udf://" || strFileLow == "dvd://1" )
return true;
#endif
https://github.com/xbmc/xbmc/commit/4d214268e1dfbb956aaff635d98bac1d85fea3e5
commit 4d214268e1dfbb956aaff635d98bac1d85fea3e5
Author: theuni <theuni-nospam-@...>
Date: Mon Jan 30 23:24:32 2012 -0500
Revert "[smp] fixed logic typo"
This reverts commit 9c83c7f71c87289619478141dfd571874489b601.
Reverting for clean merge to beta2. This commit should be re-evaluated.
diff --git a/xbmc/storage/DetectDVDType.cpp b/xbmc/storage/DetectDVDType.cpp
index 14e6bef..4b60cf4 100755
--- a/xbmc/storage/DetectDVDType.cpp
+++ b/xbmc/storage/DetectDVDType.cpp
@@ -89,7 +89,7 @@ void CDetectDVDMedia::Process()
{
// for apple - currently disable this check since cdio will return null if no media is loaded
// note: drive detect callbacks are not working under sigma so we bypass this also.
-#if !defined(__APPLE__) && !defined(HAS_SIGMASMP)
+#if !defined(__APPLE__) || !defined(HAS_SIGMASMP)
//Before entering loop make sure we actually have a CDrom drive
CdIo_t *p_cdio = m_cdio->cdio_open(NULL, DRIVER_DEVICE);
if (p_cdio == NULL)
https://github.com/xbmc/xbmc/commit/03a1a52701a83f0d8bb8d9b98bd8b22c9468d961
commit 03a1a52701a83f0d8bb8d9b98bd8b22c9468d961
Author: theuni <theuni-nospam-@...>
Date: Mon Jan 30 23:22:28 2012 -0500
Revert "[smp] do not hammer libcdio on every file open"
This reverts commit 73d39afacb74d8555615a3c8b8a9772dd4ba006c.
Reverting for clean merge to beta2. This commit should be re-evaluated.
diff --git a/xbmc/linux/XFileUtils.cpp b/xbmc/linux/XFileUtils.cpp
index 7da8314..0545f0d 100644
--- a/xbmc/linux/XFileUtils.cpp
+++ b/xbmc/linux/XFileUtils.cpp
@@ -275,7 +275,7 @@ if (errno == 20)
HANDLE result = new CXHandle(CXHandle::HND_FILE);
result->fd = fd;
-#if defined(TARGET_LINUX) && defined(HAS_DVD_DRIVE) && !defined(HAS_SIGMASMP)
+#if defined(TARGET_LINUX) && defined(HAS_DVD_DRIVE)
// special case for opening the cdrom device
if (strcmp(lpFileName, MEDIA_DETECT::CLibcdio::GetInstance()->GetDeviceFileName())==0)
result->m_bCDROM = true;
https://github.com/xbmc/xbmc/commit/2bbe34c64563fbefed1948faf91bc57393290846
commit 2bbe34c64563fbefed1948faf91bc57393290846
Author: theuni <theuni-nospam-@...>
Date: Mon Jan 30 19:43:02 2012 -0500
Revert "[smp] fixed virtual keyboard arrows"
This reverts commit 3d11cbd79497dbf95082632d3af9717596e87e12.
We'll handle this in as.xml instead.
diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp
index 5927b9c..df922a2 100644
--- a/xbmc/settings/GUISettings.cpp
+++ b/xbmc/settings/GUISettings.cpp
@@ -483,11 +483,7 @@ void CGUISettings::Initialize()
AddInt(NULL, "input.appleremotesequencetime", 13603, 500, 50, 50, 1000, SPIN_CONTROL_INT_PLUS, MASK_MS, TEXT_OFF);
AddSeparator(in, "input.sep1");
#endif
-#if defined (HAS_SIGMASMP)
- AddBool(NULL, "input.remoteaskeyboard", 21449, true);
-#else
AddBool(in, "input.remoteaskeyboard", 21449, false);
-#endif
#if defined(TARGET_DARWIN_IOS)
AddBool(NULL, "input.enablemouse", 21369, true);
#else
https://github.com/xbmc/xbmc/commit/9cbdc3f5715217f608126cb40f5244051c7f04db
commit 9cbdc3f5715217f608126cb40f5244051c7f04db
Author: theuni <theuni-nospam-@...>
Date: Mon Jan 30 19:38:52 2012 -0500
Revert "[smp] hide some unused audio and video settings"
This reverts commit c3076778be76a6c0bc9e0018b309070ebe95f2e6.
We'll handle this in as.xml instead
diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp
old mode 100755
new mode 100644
index 8d43048..5927b9c
--- a/xbmc/settings/GUISettings.cpp
+++ b/xbmc/settings/GUISettings.cpp
@@ -369,11 +369,8 @@ void CGUISettings::Initialize()
#else
// this setting would ideally not be saved, as its value is systematically derived from videoscreen.screenmode.
// contains a DISPLAYMODE
-#if defined (HAS_SIGMASMP)
- AddInt(NULL, "videoscreen.screen", 240, 0, -1, 1, g_Windowing.GetNumScreens(), SPIN_CONTROL_TEXT);
-#else
- AddInt(vs, "videoscreen.screen", 240, 0, -1, 1, g_Windowing.GetNumScreens(), SPIN_CONTROL_TEXT);
-#endif
+ bool showhide = true;
+ AddInt(showhide ? vs : NULL, "videoscreen.screen", 240, 0, -1, 1, g_Windowing.GetNumScreens(), SPIN_CONTROL_TEXT);
// this setting would ideally not be saved, as its value is systematically derived from videoscreen.screenmode.
// contains an index to the g_settings.m_ResInfo array. the only meaningful fields are iScreen, iWidth, iHeight.
#if defined (__APPLE__)
@@ -440,13 +437,8 @@ void CGUISettings::Initialize()
map<int,int> channelLayout;
for(int layout = 0; layout < PCM_MAX_LAYOUT; ++layout)
channelLayout.insert(make_pair(34101+layout, layout));
-#if defined(HAS_SIGMASMP)
- AddInt( NULL, "audiooutput.channellayout", 34100, PCM_LAYOUT_2_0, channelLayout, SPIN_CONTROL_TEXT);
- AddBool(NULL, "audiooutput.dontnormalizelevels", 346, true);
-#else
AddInt(ao, "audiooutput.channellayout", 34100, PCM_LAYOUT_2_0, channelLayout, SPIN_CONTROL_TEXT);
AddBool(ao, "audiooutput.dontnormalizelevels", 346, true);
-#endif
#if (defined(__APPLE__) && defined(__arm__))
AddBool(g_sysinfo.IsAppleTV2() ? ao : NULL, "audiooutput.ac3passthrough", 364, false);
@@ -462,7 +454,7 @@ void CGUISettings::Initialize()
#ifdef __APPLE__
AddString(ao, "audiooutput.audiodevice", 545, "Default", SPIN_CONTROL_TEXT);
-#elif defined(_LINUX) && !defined(HAS_SIGMASMP)
+#elif defined(_LINUX)
AddSeparator(ao, "audiooutput.sep1");
AddString(ao, "audiooutput.audiodevice", 545, "default", SPIN_CONTROL_TEXT);
AddString(ao, "audiooutput.customdevice", 1300, "", EDIT_CONTROL_INPUT);
@@ -623,7 +615,7 @@ void CGUISettings::Initialize()
// FIXME: hide this setting until it is properly respected. In the meanwhile, default to AUTO.
//AddInt(5, "videoplayer.displayresolution", 169, (int)RES_AUTORES, (int)RES_AUTORES, 1, (int)CUSTOM+MAX_RESOLUTIONS, SPIN_CONTROL_TEXT);
AddInt(NULL, "videoplayer.displayresolution", 169, (int)RES_AUTORES, (int)RES_AUTORES, 1, (int)RES_AUTORES, SPIN_CONTROL_TEXT);
-#if !defined(HAS_SIGMASMP) && !(defined(__APPLE__) && defined(__arm__))
+#if !(defined(__APPLE__) && defined(__arm__))
AddBool(vp, "videoplayer.adjustrefreshrate", 170, false);
AddInt(vp, "videoplayer.pauseafterrefreshchange", 13550, 0, 0, 1, MAXREFRESHCHANGEDELAY, SPIN_CONTROL_TEXT);
#else
@@ -631,7 +623,7 @@ void CGUISettings::Initialize()
AddInt(NULL, "videoplayer.pauseafterrefreshchange", 13550, 0, 0, 1, MAXREFRESHCHANGEDELAY, SPIN_CONTROL_TEXT);
#endif
//sync settings not available on windows gl build
-#if (defined(_WIN32) && defined(HAS_GL)) || defined(HAS_SIGMASMP)
+#if defined(_WIN32) && defined(HAS_GL)
#define SYNCSETTINGS 0
#else
#define SYNCSETTINGS 1
https://github.com/xbmc/xbmc/commit/1f36c0ed7e4fc9524e268da8381a68dbb47b3472
commit 1f36c0ed7e4fc9524e268da8381a68dbb47b3472
Author: theuni <theuni-nospam-@...>
Date: Sun Jan 29 21:07:09 2012 -0500
[smp] Allow GUISettings to be overridden.
This is useful for packagers as they can override menu defaults in as.xml
rather than patching xbmc code.
Usage:
<settingsoverride>
<override>
<setting hidden="true" locked="true">input.enablemouse</setting>
<default>false</default>
</override>
<override>
<setting>lookandfeel.enablerssfeeds</setting>
<default>false</default>
</override>
</settingsoverride>
Hidden: Do not show control in GUI.
Locked: Force a default setting.
Default: Set the default for first-run.
The first would disable the mouse. adding "locked" will force the setting, even
if the user currently has it enabled. In addition, it hides the option from the
settings menu.
The second sets the rss feed option to false by default. The user may enable it
later.
A setting that is locked and not hidden will appear grey'd out. Note that
locking is not always safe. Some settings may depend on a control to be enabled
in order to populate other data. Packager beware.
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 36eb715..3648d6b 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -626,7 +626,8 @@ bool CApplication::Create()
g_powerManager.Initialize();
CLog::Log(LOGNOTICE, "load settings...");
-
+ g_advancedSettings.Initialize();
+ g_advancedSettings.Load();
g_guiSettings.Initialize(); // Initialize default Settings - don't move
g_powerManager.SetDefaults();
if (!g_settings.Load())
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp
index a543f7b..025cbb8 100644
--- a/xbmc/settings/AdvancedSettings.cpp
+++ b/xbmc/settings/AdvancedSettings.cpp
@@ -300,6 +300,7 @@ bool CAdvancedSettings::Load()
// it should instead use the versions of GetString/Integer/Float that
// don't take defaults in. Defaults are set in the constructor above
Initialize(); // In case of profile switch.
+ CSpecialProtocol::SetProfilePath(g_settings.GetUserDataFolder());
ParseSettingsFile("special://xbmc/system/advancedsettings.xml");
for (unsigned int i = 0; i < m_settingsFiles.size(); i++)
ParseSettingsFile(m_settingsFiles[i]);
@@ -827,6 +828,57 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file)
}
}
+ TiXmlElement* pSettingsOverride = pRootElement->FirstChildElement("settingsoverride");
+ if (pSettingsOverride)
+ {
+ m_settingsOverride.clear();
+ CLog::Log(LOGDEBUG,"Configuring settings overrides");
+ TiXmlNode* pOverride = pSettingsOverride->FirstChildElement("override");
+ while (pOverride)
+ {
+ SettingsOverride override;
+ TiXmlNode* pSetting = pOverride->FirstChild("setting");
+ if (pSetting)
+ override.setting = _P(pSetting->FirstChild()->Value()).c_str();
+ TiXmlNode* pValue = pOverride->FirstChild("default");
+ if (pValue)
+ override.value = pValue->FirstChild()->Value();
+
+ override.hidden = false;
+ CStdString StrHidden = pSetting->ToElement()->Attribute("hidden");;
+ if (!StrHidden.IsEmpty() && StrHidden != "0" && !StrHidden.Equals("false"))
+ override.hidden = true;
+
+ override.locked = false;
+ CStdString StrLocked = pSetting->ToElement()->Attribute("locked");
+ if (!StrLocked.IsEmpty() && StrLocked != "0" && !StrLocked.Equals("false"))
+ override.locked = true;
+
+ if (!override.setting.IsEmpty() && !override.value.IsEmpty())
+ {
+ CLog::Log(LOGDEBUG," Overriding:");
+ CLog::Log(LOGDEBUG," Setting: [%s]", override.setting.c_str());
+ CLog::Log(LOGDEBUG," Default: [%s]", override.value.c_str());
+ if (override.hidden)
+ CLog::Log(LOGDEBUG," Hidden: [true]");
+ if (override.locked)
+ CLog::Log(LOGDEBUG," Locked: [true]");
+ m_settingsOverride.push_back(override);
+ }
+ else
+ {
+ // error message about missing tag
+ if (override.setting.IsEmpty())
+ CLog::Log(LOGERROR," Missing <setting> tag");
+ else
+ CLog::Log(LOGERROR," Missing <default> tag");
+ }
+
+ // get next one
+ pOverride = pOverride->NextSiblingElement("override");
+ }
+ }
+
XMLUtils::GetInt(pRootElement, "remotedelay", m_remoteDelay, 1, 20);
XMLUtils::GetFloat(pRootElement, "controllerdeadzone", m_controllerDeadzone, 0.0f, 1.0f);
XMLUtils::GetInt(pRootElement, "thumbsize", m_thumbSize, 0, 1024);
@@ -927,9 +979,6 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file)
XMLUtils::GetInt(pElement, "algorithmdirtyregions", m_guiAlgorithmDirtyRegions);
XMLUtils::GetInt(pElement, "nofliptimeout", m_guiDirtyRegionNoFlipTimeout);
}
-
- // load in the GUISettings overrides:
- g_guiSettings.LoadXML(pRootElement, true); // true to hide the settings we read in
}
void CAdvancedSettings::Clear()
diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h
index bb7062b..c44e946 100644
--- a/xbmc/settings/AdvancedSettings.h
+++ b/xbmc/settings/AdvancedSettings.h
@@ -59,6 +59,14 @@ struct RefreshOverride
bool fallback;
};
+struct SettingsOverride
+{
+ CStdString setting;
+ CStdString value;
+ bool hidden;
+ bool locked;
+};
+
typedef std::vector<TVShowRegexp> SETTINGS_TVSHOWLIST;
class CAdvancedSettings
@@ -180,7 +188,9 @@ class CAdvancedSettings
SETTINGS_TVSHOWLIST m_tvshowEnumRegExps;
CStdString m_tvshowMultiPartEnumRegExp;
typedef std::vector< std::pair<CStdString, CStdString> > StringMapping;
+ typedef std::vector< SettingsOverride > SettingsOverrideList;
StringMapping m_pathSubstitutions;
+ SettingsOverrideList m_settingsOverride;
int m_remoteDelay; ///< \brief number of remote messages to ignore before repeating
float m_controllerDeadzone;
diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp
index bf87e10..8d43048 100755
--- a/xbmc/settings/GUISettings.cpp
+++ b/xbmc/settings/GUISettings.cpp
@@ -922,6 +922,25 @@ void CGUISettings::AddSeparator(CSettingsCategory* cat, const char *strSetting)
void CGUISettings::AddBool(CSettingsCategory* cat, const char *strSetting, int iLabel, bool bData, int iControlType)
{
int iOrder = cat?++cat->m_entries:0;
+
+ for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
+ i != g_advancedSettings.m_settingsOverride.end(); i++)
+ {
+ if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0)
+ {
+ if (i->hidden)
+ iOrder = 0;
+ bool override = false;
+ if (i->value.Equals("true") || i->value.Equals("0"))
+ override = true;
+ CSettingBool* pSetting = new CSettingBool(iOrder, CStdString(strSetting).ToLower(), iLabel, override, iControlType);
+ if (!pSetting) return ;
+ settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
+ return;
+ }
+ }
+
+
CSettingBool* pSetting = new CSettingBool(iOrder, CStdString(strSetting).ToLower(), iLabel, bData, iControlType);
if (!pSetting) return ;
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
@@ -973,6 +992,19 @@ void CGUISettings::ToggleBool(const char *strSetting)
void CGUISettings::AddFloat(CSettingsCategory* cat, const char *strSetting, int iLabel, float fData, float fMin, float fStep, float fMax, int iControlType)
{
int iOrder = cat?++cat->m_entries:0;
+ for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
+ i != g_advancedSettings.m_settingsOverride.end(); i++)
+ {
+ if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0)
+ {
+ if (i->hidden)
+ iOrder = 0;
+ CSettingFloat* pSetting = new CSettingFloat(iOrder, CStdString(strSetting).ToLower(), iLabel, (float)atof((i->value.c_str())), fMin, fStep, fMax, iControlType);
+ if (!pSetting) return ;
+ settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
+ return;
+ }
+ }
CSettingFloat* pSetting = new CSettingFloat(iOrder, CStdString(strSetting).ToLower(), iLabel, fData, fMin, fStep, fMax, iControlType);
if (!pSetting) return ;
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
@@ -1016,11 +1048,27 @@ void CGUISettings::LoadMasterLock(TiXmlElement *pRootElement)
LoadFromXML(pRootElement, it);
}
-
void CGUISettings::AddInt(CSettingsCategory* cat, const char *strSetting, int iLabel, int iData, int iMin, int iStep, int iMax, int iControlType, const char *strFormat)
{
int iOrder = cat?++cat->m_entries:0;
CSettingInt* pSetting = new CSettingInt(iOrder, CStdString(strSetting).ToLower(), iLabel, iData, iMin, iStep, iMax, iControlType, strFormat);
+
+ for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
+ i != g_advancedSettings.m_settingsOverride.end(); i++)
+ {
+ if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0)
+ {
+ if (i->hidden)
+ pSetting->SetOrder(0);
+ if (pSetting)
+ {
+ pSetting->FromString(i->value.c_str());
+ settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
+ return;
+ }
+ }
+ }
+
if (!pSetting) return ;
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
}
@@ -1030,6 +1078,24 @@ void CGUISettings::AddInt(CSettingsCategory* cat, const char *strSetting, int iL
int iOrder = cat?++cat->m_entries:0;
CSettingInt* pSetting = new CSettingInt(iOrder, CStdString(strSetting).ToLower(), iLabel, iData, iMin, iStep, iMax, iControlType, iFormat, iLabelMin);
if (!pSetting) return ;
+
+ //Check for advancedsettings overrides
+ for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
+ i != g_advancedSettings.m_settingsOverride.end(); i++)
+ {
+ if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0)
+ {
+ if (i->hidden)
+ pSetting->SetOrder(0);
+ if (pSetting)
+ {
+ pSetting->FromString(i->value.c_str());
+ settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
+ return;
+ }
+ }
+ }
+
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
}
@@ -1040,7 +1106,25 @@ void CGUISettings::AddInt(CSettingsCategory* cat, const char *strSetting,
int iOrder = cat?++cat->m_entries:0;
CSettingInt* pSetting = new CSettingInt(iOrder, CStdString(strSetting).ToLower(), iLabel, iData, entries, iControlType);
if (!pSetting) return ;
+
+ //Check for advancedsettings overrides
+ for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
+ i != g_advancedSettings.m_settingsOverride.end(); i++)
+ {
+ if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0)
+ {
+ if (i->hidden)
+ pSetting->SetOrder(0);
+ if (pSetting)
+ {
+ pSetting->FromString(i->value.c_str());
+ settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
+ return;
+ }
+ }
+ }
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
+
}
void CGUISettings::AddHex(CSettingsCategory* cat, const char *strSetting, int iLabel, int iData, int iMin, int iStep, int iMax, int iControlType, const char *strFormat)
@@ -1048,6 +1132,21 @@ void CGUISettings::AddHex(CSettingsCategory* cat, const char *strSetting, int iL
int iOrder = cat?++cat->m_entries:0;
CSettingHex* pSetting = new CSettingHex(iOrder, CStdString(strSetting).ToLower(), iLabel, iData, iMin, iStep, iMax, iControlType, strFormat);
if (!pSetting) return ;
+ for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
+ i != g_advancedSettings.m_settingsOverride.end(); i++)
+ {
+ if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0)
+ {
+ if (i->hidden)
+ pSetting->SetOrder(0);
+ if (pSetting)
+ {
+ pSetting->FromString(i->value.c_str());
+ settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
+ return;
+ }
+ }
+ }
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
}
@@ -1084,6 +1183,21 @@ void CGUISettings::AddString(CSettingsCategory* cat, const char *strSetting, int
int iOrder = cat?++cat->m_entries:0;
CSettingString* pSetting = new CSettingString(iOrder, CStdString(strSetting).ToLower(), iLabel, strData, iControlType, bAllowEmpty, iHeadingString);
if (!pSetting) return ;
+ for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
+ i != g_advancedSettings.m_settingsOverride.end(); i++)
+ {
+ if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0)
+ {
+ if (i->hidden)
+ pSetting->SetOrder(0);
+ if (pSetting)
+ {
+ pSetting->FromString(i->value.c_str());
+ settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
+ return;
+ }
+ }
+ }
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
}
@@ -1092,6 +1206,21 @@ void CGUISettings::AddPath(CSettingsCategory* cat, const char *strSetting, int i
int iOrder = cat?++cat->m_entries:0;
CSettingPath* pSetting = new CSettingPath(iOrder, CStdString(strSetting).ToLower(), iLabel, strData, iControlType, bAllowEmpty, iHeadingString);
if (!pSetting) return ;
+ for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
+ i != g_advancedSettings.m_settingsOverride.end(); i++)
+ {
+ if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0)
+ {
+ if (i->hidden)
+ pSetting->SetOrder(0);
+ if (pSetting)
+ {
+ pSetting->FromString(i->value.c_str());
+ settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
+ return;
+ }
+ }
+ }
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
}
@@ -1100,6 +1229,21 @@ void CGUISettings::AddDefaultAddon(CSettingsCategory* cat, const char *strSettin
int iOrder = cat?++cat->m_entries:0;
CSettingAddon* pSetting = new CSettingAddon(iOrder, CStdString(strSetting).ToLower(), iLabel, strData, type);
if (!pSetting) return ;
+ for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
+ i != g_advancedSettings.m_settingsOverride.end(); i++)
+ {
+ if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0)
+ {
+ if (i->hidden)
+ pSetting->SetOrder(0);
+ if (pSetting)
+ {
+ pSetting->FromString(i->value.c_str());
+ settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
+ return;
+ }
+ }
+ }
settingsMap.insert(pair<CStdString, CSetting*>(CStdString(strSetting).ToLower(), pSetting));
}
@@ -1277,6 +1421,21 @@ void CGUISettings::LoadFromXML(TiXmlElement *pRootElement, mapIter &it, bool adv
pGrandChild->Attribute("pathversion", &pathVersion);
strValue = CSpecialProtocol::ReplaceOldPath(strValue, pathVersion);
}
+
+
+ for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
+ i != g_advancedSettings.m_settingsOverride.end(); i++)
+ {
+ if (strncmp((*it).first, i->setting.c_str(), i->setting.size()) == 0)
+ {
+ if (i->hidden || i->locked)
+ {
+ (*it).second->FromString(i->value.c_str());
+ return;
+ }
+ }
+ }
+
(*it).second->FromString(strValue);
if (advanced)
(*it).second->SetAdvanced();
diff --git a/xbmc/settings/GUIWindowSettingsCategory.cpp b/xbmc/settings/GUIWindowSettingsCategory.cpp
index 29dfecd..2260575 100755
--- a/xbmc/settings/GUIWindowSettingsCategory.cpp
+++ b/xbmc/settings/GUIWindowSettingsCategory.cpp
@@ -549,6 +549,18 @@ void CGUIWindowSettingsCategory::UpdateSettings()
CBaseSettingControl *pSettingControl = m_vecSettings[i];
pSettingControl->Update();
CStdString strSetting = pSettingControl->GetSetting()->GetSetting();
+
+ for (CAdvancedSettings::SettingsOverrideList::iterator i = g_advancedSettings.m_settingsOverride.begin();
+ i != g_advancedSettings.m_settingsOverride.end(); i++)
+ {
+ if (strncmp(strSetting, i->setting.c_str(), i->setting.size()) == 0 && i->locked)
+ {
+ CGUIControl *pControl = (CGUIControl *)GetControl(pSettingControl->GetID());
+ pControl->SetEnabled(false);
+ continue;
+ }
+ }
+
#ifdef HAVE_LIBVDPAU
if (strSetting.Equals("videoplayer.vdpauUpscalingLevel"))
{
diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp
index ca56955..49bb08c 100644
--- a/xbmc/settings/Settings.cpp
+++ b/xbmc/settings/Settings.cpp
@@ -738,9 +738,6 @@ bool CSettings::LoadSettings(const CStdString& strSettingsFile)
LoadPlayerCoreFactorySettings("special://xbmc/system/playercorefactory.xml", true);
LoadPlayerCoreFactorySettings(GetUserDataItem("playercorefactory.xml"), false);
- // Advanced settings
- g_advancedSettings.Load();
-
// Add the list of disc stub extensions (if any) to the list of video extensions
if (!m_discStubExtensions.IsEmpty())
g_settings.m_videoExtensions += "|" + m_discStubExtensions;
https://github.com/xbmc/xbmc/commit/920fc38846afcd1c5cd5d1c3799c0a6f79f88044
commit 920fc38846afcd1c5cd5d1c3799c0a6f79f88044
Author: davilla <davilla@...>
Date: Mon Jan 23 14:03:58 2012 -0500
fixed, refresh rate switching. bypass old code
diff --git a/xbmc/settings/GUIWindowSettingsCategory.cpp b/xbmc/settings/GUIWindowSettingsCategory.cpp
index 663b2dd..29dfecd 100755
--- a/xbmc/settings/GUIWindowSettingsCategory.cpp
+++ b/xbmc/settings/GUIWindowSettingsCategory.cpp
@@ -2314,8 +2314,10 @@ void CGUIWindowSettingsCategory::FillInResolutions(CStdString strSetting, Displa
RESOLUTION_INFO res1 = g_settings.m_ResInfo[res];
RESOLUTION_INFO res2 = g_settings.m_ResInfo[resolutions[idx].ResInfo_Index];
- if (res1.iScreen == res2.iScreen &&
- res1.iScreenWidth == res2.iScreenWidth && res1.iScreenHeight == res2.iScreenHeight)
+ if (res1.iScreen == res2.iScreen &&
+ res1.iScreenWidth == res2.iScreenWidth &&
+ res1.iScreenHeight == res2.iScreenHeight &&
+ (int)res1.fRefreshRate == (int)res2.fRefreshRate)
spinres = (RESOLUTION) resolutions[idx].ResInfo_Index;
}
}
@@ -2386,6 +2388,10 @@ void CGUIWindowSettingsCategory::FillInRefreshRates(CStdString strSetting, RESOL
// Select a rate
if (UserChange)
{
+ // hack for sigma to allow switching refresh rates
+#if defined (HAS_SIGMASMP)
+ OnRefreshRateChanged(res);
+#else
RESOLUTION newresolution;
if (res == RES_WINDOW)
newresolution = RES_WINDOW;
@@ -2394,8 +2400,9 @@ void CGUIWindowSettingsCategory::FillInRefreshRates(CStdString strSetting, RESOL
if (pControl)
pControl->SetValue(newresolution);
-
+
OnRefreshRateChanged(newresolution);
+#endif
}
else
{
https://github.com/xbmc/xbmc/commit/8560b6fdf2b37898ff7b1e7a06c9e8149a750e57
commit 8560b6fdf2b37898ff7b1e7a06c9e8149a750e57
Author: davilla <davilla@...>
Date: Mon Jan 23 14:03:08 2012 -0500
changed, be more robust in matching res
diff --git a/xbmc/windowing/WinSystem.cpp b/xbmc/windowing/WinSystem.cpp
old mode 100644
new mode 100755
index e79b282..8ba5226
--- a/xbmc/windowing/WinSystem.cpp
+++ b/xbmc/windowing/WinSystem.cpp
@@ -115,7 +115,9 @@ static void AddResolution(vector<RESOLUTION_WHR> &resolutions, unsigned int addi
int refresh = g_settings.m_ResInfo[addindex].fRefreshRate + 0.5;
for (unsigned int idx = 0; idx < resolutions.size(); idx++)
- if (resolutions[idx].width == width && resolutions[idx].height == height && (int)resolutions[idx].refresh == refresh)
+ if (resolutions[idx].width == width &&
+ resolutions[idx].height == height &&
+ resolutions[idx].refresh == refresh)
return; // already taken care of.
RESOLUTION_WHR res = {width, height, refresh, addindex};
@@ -126,7 +128,7 @@ static bool resSortPredicate (RESOLUTION_WHR i, RESOLUTION_WHR j)
{
return ( i.width < j.width
|| (i.width == j.width && i.height < j.height)
- || (i.width == j.width && i.height < j.height && i.refresh < j.refresh));
+ || (i.width == j.width && i.height == j.height && i.refresh < j.refresh));
}
vector<RESOLUTION_WHR> CWinSystemBase::ScreenResolutions(int screen)
https://github.com/xbmc/xbmc/commit/cdfc58769bf5a9078beb98b3b54cf8707f358f5a
commit cdfc58769bf5a9078beb98b3b54cf8707f358f5a
Author: davilla <davilla@...>
Date: Mon Jan 23 11:04:23 2012 -0500
fixed, strip 23.97/ and 29.97/ from show_edid output
diff --git a/xbmc/windowing/dfb/WinSystemDFB.cpp b/xbmc/windowing/dfb/WinSystemDFB.cpp
old mode 100644
new mode 100755
index 3a1a8e2..b47b7eb
--- a/xbmc/windowing/dfb/WinSystemDFB.cpp
+++ b/xbmc/windowing/dfb/WinSystemDFB.cpp
@@ -283,7 +283,9 @@ void CWinSystemDFB::UpdateResolutions()
// run show_edid and pipe stderr to stdout
cmd = "/usr/sigma/bin/show_edid 2>&1";
// find the video output info, strip stuff we do not care about
- cmd += " | grep ': VIC' | sed 's;59.94/;;' | grep -v ')x'";
+ cmd += " | grep ': VIC'";
+ cmd += " | sed 's;23.97/;;' | sed 's;29.97/;;' | sed 's;59.94/;;'";
+ cmd += " | grep -v ')x'";
// pull out rez and refresh rate, sort it and drop duplicates
cmd += " | awk '{print $5 $6}' | sort | uniq";
FILE* pipe = popen(cmd.c_str(), "r");
https://github.com/xbmc/xbmc/commit/4116d929f03f8a43670ce13ed7e2b8f4deb425c5
commit 4116d929f03f8a43670ce13ed7e2b8f4deb425c5
Author: davilla <davilla@...>
Date: Sun Jan 22 14:05:20 2012 -0500
fixed, if we hide the display setting, we can crash here
diff --git a/xbmc/settings/GUIWindowSettingsCategory.cpp b/xbmc/settings/GUIWindowSettingsCategory.cpp
old mode 100644
new mode 100755
index 42b9cc7..663b2dd
--- a/xbmc/settings/GUIWindowSettingsCategory.cpp
+++ b/xbmc/settings/GUIWindowSettingsCategory.cpp
@@ -2258,30 +2258,32 @@ void CGUIWindowSettingsCategory::FillInCharSets(CSetting *pSetting)
DisplayMode CGUIWindowSettingsCategory::FillInScreens(CStdString strSetting, RESOLUTION res)
{
- CBaseSettingControl *control = GetSetting(strSetting);
- control->SetDelayed();
- CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(control->GetID());
- pControl->Clear();
-
- CStdString strScreen;
- if (g_advancedSettings.m_canWindowed)
- pControl->AddLabel(g_localizeStrings.Get(242), -1);
-
- for (int idx = 0; idx < g_Windowing.GetNumScreens(); idx++)
- {
- strScreen.Format(g_localizeStrings.Get(241), g_settings.m_ResInfo[RES_DESKTOP + idx].iScreen + 1);
- pControl->AddLabel(strScreen, g_settings.m_ResInfo[RES_DESKTOP + idx].iScreen);
- }
-
DisplayMode mode;
-
if (res == RES_WINDOW)
mode = DM_WINDOWED;
else
mode = g_settings.m_ResInfo[res].iScreen;
- pControl->SetValue(mode);
- g_guiSettings.SetInt("videoscreen.screen", mode);
+ CBaseSettingControl *control = GetSetting(strSetting);
+ if (control)
+ {
+ control->SetDelayed();
+ CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(control->GetID());
+ pControl->Clear();
+
+ CStdString strScreen;
+ if (g_advancedSettings.m_canWindowed)
+ pControl->AddLabel(g_localizeStrings.Get(242), -1);
+
+ for (int idx = 0; idx < g_Windowing.GetNumScreens(); idx++)
+ {
+ strScreen.Format(g_localizeStrings.Get(241), g_settings.m_ResInfo[RES_DESKTOP + idx].iScreen + 1);
+ pControl->AddLabel(strScreen, g_settings.m_ResInfo[RES_DESKTOP + idx].iScreen);
+ }
+ pControl->SetValue(mode);
+ g_guiSettings.SetInt("videoscreen.screen", mode);
+ }
+
return mode;
}
https://github.com/xbmc/xbmc/commit/04e5c5bb32bc2fb8f94fb51dfc00cf0e8a36e8c8
commit 04e5c5bb32bc2fb8f94fb51dfc00cf0e8a36e8c8
Author: davilla <davilla@...>
Date: Sat Jan 21 13:56:00 2012 -0500
[smp] changed, allow audio device to be changed without restarting player
diff --git a/xbmc/cores/IPlayer.h b/xbmc/cores/IPlayer.h
old mode 100644
new mode 100755
index 7c3a897..d2265cd
--- a/xbmc/cores/IPlayer.h
+++ b/xbmc/cores/IPlayer.h
@@ -124,6 +124,7 @@ public:
virtual void GetAudioStreamName(int iStream, CStdString &strStreamName){};
virtual void SetAudioStream(int iStream){};
virtual void GetAudioStreamLanguage(int iStream, CStdString &strLanguage){};
+ virtual void ResetAudioOutput() {};
virtual TextCacheStruct_t* GetTeletextCache() { return NULL; };
virtual void LoadPage(int p, int sp, unsigned char* buffer) {};
@@ -170,7 +171,7 @@ public:
virtual bool SetPlayerState(CStdString state) { return false;};
virtual CStdString GetPlayingTitle() { return ""; };
-
+
protected:
IPlayerCallback& m_callback;
};
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index f98f64f..baadec7 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -710,6 +710,21 @@ void CSMPPlayer::SetAudioStream(int SetAudioStream)
//CLog::Log(LOGDEBUG, "CSMPPlayer::SetAudioStream(%d)", SetAudioStream);
}
+void CSMPPlayer::GetAudioStreamLanguage(int iStream, CStdString &strLanguage)
+{
+ CSingleLock lock(m_amp_command_csection);
+ if (m_amp && m_amp_media)
+ m_amp_media->GetAudioStreamName(iStream, strLanguage);
+}
+
+void CSMPPlayer::ResetAudioOutput()
+{
+ CSingleLock lock(m_amp_command_csection);
+
+ if (m_amp && m_amp_media)
+ SetupAudioOutput();
+}
+
void CSMPPlayer::SetSubTitleDelay(float fValue = 0.0f)
{
if (GetSubtitleCount())
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index 83ee482..fff7b98 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -89,7 +89,8 @@ public:
virtual int GetAudioStream();
virtual void GetAudioStreamName(int iStream, CStdString &strStreamName);
virtual void SetAudioStream(int iStream);
- virtual void GetAudioStreamLanguage(int iStream, CStdString &strLanguage) {};
+ virtual void GetAudioStreamLanguage(int iStream, CStdString &strLanguage);
+ virtual void ResetAudioOutput();
virtual TextCacheStruct_t* GetTeletextCache() {return NULL;};
virtual void LoadPage(int p, int sp, unsigned char* buffer) {};
diff --git a/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp b/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp
old mode 100644
new mode 100755
index 66eee83..37aaa8a
--- a/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp
+++ b/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp
@@ -265,7 +265,11 @@ void CGUIDialogAudioSubtitleSettings::OnSettingChanged(SettingInfo &setting)
}
EnableSettings(AUDIO_SETTINGS_OUTPUT_TO_ALL_SPEAKERS, bitstream);
+#if defined (HAS_SIGMASMP)
+ g_application.m_pPlayer->ResetAudioOutput();
+#else
g_application.Restart();
+#endif
EnableSettings(AUDIO_SETTINGS_VOLUME, !g_application.m_pPlayer->IsPassthrough());
}
else if (setting.id == SUBTITLE_SETTINGS_ENABLE)
https://github.com/xbmc/xbmc/commit/ca2c834327a70326fb1d25e96d8e291583eaf3d1
commit ca2c834327a70326fb1d25e96d8e291583eaf3d1
Author: davilla <davilla@...>
Date: Fri Jan 20 17:11:13 2012 -0500
[smp] hook display resolution/refresh to new helper app (show_edid)
diff --git a/xbmc/windowing/dfb/WinSystemDFB.cpp b/xbmc/windowing/dfb/WinSystemDFB.cpp
old mode 100755
new mode 100644
index 8555c1f..3a1a8e2
--- a/xbmc/windowing/dfb/WinSystemDFB.cpp
+++ b/xbmc/windowing/dfb/WinSystemDFB.cpp
@@ -42,6 +42,7 @@ CWinSystemDFB::CWinSystemDFB() : CWinSystemBase()
m_dfb_image_provider = NULL;
m_out_signal = DSOS_NONE;
+ m_tv_standard = DSOS_NONE;
//m_buffermode = DLBM_FRONTONLY; // no backbuffer ( tearing unless we WaitForSync)
//m_buffermode = DLBM_BACKVIDEO; // backbuffer in video memory (no tearing but gui fps is slower)
m_buffermode = DLBM_BACKVIDEO;
@@ -59,6 +60,10 @@ CWinSystemDFB::~CWinSystemDFB()
bool CWinSystemDFB::InitWindowSystem()
{
CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem");
+
+ // we have to get resolutions from hdmi BEFORE creating dfb.
+ UpdateResolutions();
+
DirectFBInit(NULL, NULL);
DirectFBCreate(&m_dfb);
if (!m_dfb)
@@ -74,10 +79,6 @@ bool CWinSystemDFB::InitWindowSystem()
CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: m_dfb->GetScreen failed!");
return false;
}
-
- if (!CWinSystemBase::InitWindowSystem())
- return false;
-
m_events = new CWinEventsDFB();
return true;
@@ -106,21 +107,27 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
m_nHeight = res.iHeight;
m_bFullScreen = fullScreen;
-// if (m_bWindowCreated)
-// DestroyWindow();
-
// change the output display to match
+ DFBScreenEncoderTVStandards tv_standard;
+ if ((int)res.fRefreshRate == 50)
+ tv_standard = DSETV_HDTV50;
+ else
+ tv_standard = DSETV_HDTV60;
+
DFBScreenOutputSignals out_signal;
- if (res.iScreenWidth == 1920 && res.iScreenHeight == 1080)
+ if (res.iScreenWidth == 1920 && res.iScreenHeight == 1080 && (int)res.fRefreshRate == 24)
+ out_signal = DSOS_1080p24;
+ else if (res.iScreenWidth == 1920 && res.iScreenHeight == 1080)
out_signal = DSOS_1080p;
else
out_signal = DSOS_720p;
- if (m_out_signal != out_signal)
+ if (m_out_signal != out_signal || m_tv_standard != tv_standard)
{
DFBScreenEncoderConfig enc_cfg;
- enc_cfg.flags = (DFBScreenEncoderConfigFlags)(DSECONF_OUT_SIGNALS | DSECONF_DELAYED_CONFIG);
+ enc_cfg.flags = (DFBScreenEncoderConfigFlags)(DSECONF_OUT_SIGNALS | DSECONF_TV_STANDARD | DSECONF_DELAYED_CONFIG);
enc_cfg.out_signals = out_signal;
+ enc_cfg.tv_standard = tv_standard;
enc_cfg.delayed_config = true;
if (m_dfb_screen->SetEncoderConfiguration(m_dfb_screen, 0, &enc_cfg) == DFB_OK)
{
@@ -129,15 +136,14 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
out_cfg.out_signals = out_signal;
out_cfg.delayed_config = false;
if (m_dfb_screen->SetOutputConfiguration(m_dfb_screen, 0, &out_cfg) != DFB_OK)
- {
CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow: SetOutputConfiguration(0) failed!");
- }
}
else
{
CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow: SetEncoderConfiguration(0) failed!");
}
m_out_signal = out_signal;
+ m_tv_standard = tv_standard;
}
DFBDisplayLayerConfig dlcfg;
@@ -147,8 +153,6 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
m_dfb_layer->SetCooperativeLevel(m_dfb_layer, DLSCL_ADMINISTRATIVE);
m_dfb_layer->GetConfiguration(m_dfb_layer, &dlcfg);
dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT);
- //dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_OPTIONS | DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT);
- //dlcfg.options = DLOP_ALPHACHANNEL;
dlcfg.buffermode = (DFBDisplayLayerBufferMode)m_buffermode;
dlcfg.pixelformat = DSPF_ARGB;
dlcfg.width = m_nWidth;
@@ -254,37 +258,139 @@ bool CWinSystemDFB::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
void CWinSystemDFB::UpdateResolutions()
{
- DFBScreenDescription screen_desc;
- m_dfb_screen->GetDescription(m_dfb_screen, &screen_desc);
+ if (m_dfb_screen)
+ {
+ DFBScreenDescription screen_desc;
+ m_dfb_screen->GetDescription(m_dfb_screen, &screen_desc);
- if (screen_desc.encoders)
+ if (screen_desc.encoders)
+ {
+ DFBScreenEncoderDescription enc_desc[screen_desc.encoders];
+ m_dfb_screen->GetEncoderDescriptions(m_dfb_screen, enc_desc);
+ for (int i = 0; i < screen_desc.encoders; i++)
+ {
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::UpdateResolutions: Encoder %d, out_signals0x%x), tv_standards(0x%x)",
+ i, enc_desc[i].out_signals, enc_desc[i].tv_standards);
+ }
+ }
+ }
+
+ bool got_display_rez = false;
+ RESOLUTION Res720p60 = RES_INVALID;
+ RESOLUTION res_index = RES_DESKTOP;
+
+ CStdString cmd;
+ // run show_edid and pipe stderr to stdout
+ cmd = "/usr/sigma/bin/show_edid 2>&1";
+ // find the video output info, strip stuff we do not care about
+ cmd += " | grep ': VIC' | sed 's;59.94/;;' | grep -v ')x'";
+ // pull out rez and refresh rate, sort it and drop duplicates
+ cmd += " | awk '{print $5 $6}' | sort | uniq";
+ FILE* pipe = popen(cmd.c_str(), "r");
+ if (pipe)
{
- DFBScreenEncoderDescription enc_desc[screen_desc.encoders];
- m_dfb_screen->GetEncoderDescriptions(m_dfb_screen, enc_desc);
- for (int i = 0; i < screen_desc.encoders; i++)
+ char line[1024];
+ while (fgets(line, sizeof(line) - 1, pipe))
+ {
+ // we expect this type of output from popen
+ // printf("CWinSystemDFB::UpdateResolutions = %s", line);
+ // 1280x720p50Hz
+ // 1280x720p60Hz
+ // 1920x1080i50Hz
+ // 1920x1080i60Hz
+ // 1920x1080p24Hz
+ // 1920x1080p50Hz
+ // 1920x1080p60Hz
+
+ char interlacing;
+ int refresh, width, height;
+ if (sscanf(line, "%dx%d%c%dHz", &width, &height, &interlacing, &refresh) == 4)
+ {
+ // We only care about progressive 60, 50 or 24Hz resolutions with a height of >= 720
+ if (height < 720 || interlacing == 'i' || !(refresh == 60 || refresh == 50 ||refresh == 24))
+ continue;
+
+ got_display_rez = true;
+ // if this is a new setting,
+ // create a new empty setting to fill in.
+ if ((int)g_settings.m_ResInfo.size() <= res_index)
+ {
+ RESOLUTION_INFO res;
+ g_settings.m_ResInfo.push_back(res);
+ }
+ int gui_width = width;
+ int gui_height = height;
+ float gui_refresh = refresh;
+ if (gui_width == 1920 && gui_height == 1080)
+ {
+ // we can not render GUI fast enough in 1080p.
+ // So we will render GUI at 720p and scale that to 1080p display.
+ gui_width = 1280;
+ gui_height = 720;
+ }
+
+ g_settings.m_ResInfo[res_index].iScreen = 0;
+ g_settings.m_ResInfo[res_index].bFullScreen = true;
+ g_settings.m_ResInfo[res_index].iSubtitles = (int)(0.965 * gui_height);
+ g_settings.m_ResInfo[res_index].dwFlags = D3DPRESENTFLAG_PROGRESSIVE;
+ g_settings.m_ResInfo[res_index].fRefreshRate = gui_refresh;
+ g_settings.m_ResInfo[res_index].fPixelRatio = 1.0f;
+ g_settings.m_ResInfo[res_index].iWidth = gui_width;
+ g_settings.m_ResInfo[res_index].iHeight = gui_height;
+ g_settings.m_ResInfo[res_index].iScreenWidth = width;
+ g_settings.m_ResInfo[res_index].iScreenHeight = height;
+ g_settings.m_ResInfo[res_index].strMode.Format("%dx%d @ %.2f - Full Screen", width, height, gui_refresh);
+ g_graphicsContext.ResetOverscan(g_settings.m_ResInfo[res_index]);
+
+ CLog::Log(LOGINFO, "Found possible resolution for display %d with %d x %d @ %f Hz\n",
+ g_settings.m_ResInfo[res_index].iScreen,
+ g_settings.m_ResInfo[res_index].iScreenWidth,
+ g_settings.m_ResInfo[res_index].iScreenHeight,
+ g_settings.m_ResInfo[res_index].fRefreshRate);
+
+ if (width == 1280 && height == 720 && refresh == 60)
+ Res720p60 = res_index;
+
+ res_index = (RESOLUTION)((int)res_index + 1);
+ }
+ }
+ pclose(pipe);
+ // swap desktop index for 720p if available
+ if (Res720p60 != RES_INVALID)
{
- CLog::Log(LOGDEBUG, "CWinSystemDFB::UpdateResolutions: Encoder %d, out_signals0x%x), tv_standards(0x%x)",
- i, enc_desc[i].out_signals, enc_desc[i].tv_standards);
+ CLog::Log(LOGINFO, "Found 720p at %d, setting to RES_DESKTOP at %d", (int)Res720p60, (int)RES_DESKTOP);
+
+ RESOLUTION_INFO desktop = g_settings.m_ResInfo[RES_DESKTOP];
+ g_settings.m_ResInfo[RES_DESKTOP] = g_settings.m_ResInfo[Res720p60];
+ g_settings.m_ResInfo[Res720p60] = desktop;
}
}
- int display = 0;
- uint32_t flags = 0;
- double fps = 59.94;
- int gui_w = 1280;
- int gui_h = 720;
- UpdateDesktopResolution(g_settings.m_ResInfo[RES_DESKTOP], display, gui_w, gui_h, fps, flags);
-
- RESOLUTION_INFO res;
- fps = 59.94;
- gui_w = 1280;
- gui_h = 720;
- UpdateDesktopResolution(res, display, gui_w, gui_h, fps, flags);
- res.iScreenWidth = 1920;
- res.iScreenHeight = 1080;
- res.strMode.Format("%dx%d @ %.2f%s - Full Screen",
- res.iScreenWidth, res.iScreenHeight, res.fRefreshRate, flags & D3DPRESENTFLAG_INTERLACED ? "i" : "");
- g_settings.m_ResInfo.push_back(res);
+ // show_edid does not exist, failed or parsing borked, setup defaults
+ if (!got_display_rez)
+ {
+ double gui_fps;
+ int gui_w, gui_h;
+ int gui_flags = 0;
+ uint32_t gui_display = 0;
+ gui_w = 1280;
+ gui_h = 720;
+ gui_fps = 59.94;
+ UpdateDesktopResolution(g_settings.m_ResInfo[RES_DESKTOP], gui_display, gui_w, gui_h, gui_fps, gui_flags);
+
+ RESOLUTION_INFO res;
+ gui_w = 1280;
+ gui_h = 720;
+ gui_fps = 59.94;
+ UpdateDesktopResolution(res, gui_display, gui_w, gui_h, gui_fps, gui_flags);
+ res.iScreenWidth = 1920;
+ res.iScreenHeight = 1080;
+ res.strMode.Format("%dx%d @ %.2f%s - Full Screen",
+ res.iScreenWidth, res.iScreenHeight, res.fRefreshRate, gui_flags & D3DPRESENTFLAG_INTERLACED ? "i" : "");
+ g_settings.m_ResInfo.push_back(res);
+
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::UpdateResolutions: show_edid failed, defaulting display settings");
+ }
}
bool CWinSystemDFB::IsExtSupported(const char* extension)
diff --git a/xbmc/windowing/dfb/WinSystemDFB.h b/xbmc/windowing/dfb/WinSystemDFB.h
old mode 100755
new mode 100644
index 502c43d..4d456aa
--- a/xbmc/windowing/dfb/WinSystemDFB.h
+++ b/xbmc/windowing/dfb/WinSystemDFB.h
@@ -89,6 +89,7 @@ protected:
IDirectFBSurface *m_dfb_surface;
int m_buffermode;
int m_out_signal;
+ int m_tv_standard;
IDirectFBImageProvider *m_dfb_image_provider;
IDirectFBSurface *m_dummysurface1;
IDirectFBSurface *m_dummysurface2;
https://github.com/xbmc/xbmc/commit/adbe6a3af6264d7865a502331a9e63383ba0e185
commit adbe6a3af6264d7865a502331a9e63383ba0e185
Author: davilla <davilla@...>
Date: Fri Jan 20 17:07:19 2012 -0500
[smp] changed, add refresh rate to display resolution spinner so we can tell the difference between 24, 50 and 60 Hz refresh rates
diff --git a/xbmc/settings/GUIWindowSettingsCategory.cpp b/xbmc/settings/GUIWindowSettingsCategory.cpp
index fb8f937..42b9cc7 100644
--- a/xbmc/settings/GUIWindowSettingsCategory.cpp
+++ b/xbmc/settings/GUIWindowSettingsCategory.cpp
@@ -2307,7 +2307,7 @@ void CGUIWindowSettingsCategory::FillInResolutions(CStdString strSetting, Displa
for (unsigned int idx = 0; idx < resolutions.size(); idx++)
{
CStdString strRes;
- strRes.Format("%dx%d", resolutions[idx].width, resolutions[idx].height);
+ strRes.Format("%dx%d @%dHz", resolutions[idx].width, resolutions[idx].height, resolutions[idx].refresh);
pControl->AddLabel(strRes, resolutions[idx].ResInfo_Index);
RESOLUTION_INFO res1 = g_settings.m_ResInfo[res];
diff --git a/xbmc/windowing/WinSystem.cpp b/xbmc/windowing/WinSystem.cpp
index 6902c59..e79b282 100644
--- a/xbmc/windowing/WinSystem.cpp
+++ b/xbmc/windowing/WinSystem.cpp
@@ -112,19 +112,21 @@ static void AddResolution(vector<RESOLUTION_WHR> &resolutions, unsigned int addi
{
int width = g_settings.m_ResInfo[addindex].iScreenWidth;
int height = g_settings.m_ResInfo[addindex].iScreenHeight;
+ int refresh = g_settings.m_ResInfo[addindex].fRefreshRate + 0.5;
for (unsigned int idx = 0; idx < resolutions.size(); idx++)
- if (resolutions[idx].width == width && resolutions[idx].height == height)
+ if (resolutions[idx].width == width && resolutions[idx].height == height && (int)resolutions[idx].refresh == refresh)
return; // already taken care of.
- RESOLUTION_WHR res = {width, height, addindex};
+ RESOLUTION_WHR res = {width, height, refresh, addindex};
resolutions.push_back(res);
}
static bool resSortPredicate (RESOLUTION_WHR i, RESOLUTION_WHR j)
{
return ( i.width < j.width
- || (i.width == j.width && i.height < j.height));
+ || (i.width == j.width && i.height < j.height)
+ || (i.width == j.width && i.height < j.height && i.refresh < j.refresh));
}
vector<RESOLUTION_WHR> CWinSystemBase::ScreenResolutions(int screen)
diff --git a/xbmc/windowing/WinSystem.h b/xbmc/windowing/WinSystem.h
index b773a7e..8292453 100644
--- a/xbmc/windowing/WinSystem.h
+++ b/xbmc/windowing/WinSystem.h
@@ -41,6 +41,7 @@ struct RESOLUTION_WHR
{
int width;
int height;
+ int refresh;
int ResInfo_Index;
};
https://github.com/xbmc/xbmc/commit/c3076778be76a6c0bc9e0018b309070ebe95f2e6
commit c3076778be76a6c0bc9e0018b309070ebe95f2e6
Author: davilla <davilla@...>
Date: Fri Jan 20 17:04:23 2012 -0500
[smp] hide some unused audio and video settings
diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp
old mode 100644
new mode 100755
index 8129b9c..bf87e10
--- a/xbmc/settings/GUISettings.cpp
+++ b/xbmc/settings/GUISettings.cpp
@@ -369,8 +369,11 @@ void CGUISettings::Initialize()
#else
// this setting would ideally not be saved, as its value is systematically derived from videoscreen.screenmode.
// contains a DISPLAYMODE
- bool showhide = true;
- AddInt(showhide ? vs : NULL, "videoscreen.screen", 240, 0, -1, 1, g_Windowing.GetNumScreens(), SPIN_CONTROL_TEXT);
+#if defined (HAS_SIGMASMP)
+ AddInt(NULL, "videoscreen.screen", 240, 0, -1, 1, g_Windowing.GetNumScreens(), SPIN_CONTROL_TEXT);
+#else
+ AddInt(vs, "videoscreen.screen", 240, 0, -1, 1, g_Windowing.GetNumScreens(), SPIN_CONTROL_TEXT);
+#endif
// this setting would ideally not be saved, as its value is systematically derived from videoscreen.screenmode.
// contains an index to the g_settings.m_ResInfo array. the only meaningful fields are iScreen, iWidth, iHeight.
#if defined (__APPLE__)
@@ -437,8 +440,13 @@ void CGUISettings::Initialize()
map<int,int> channelLayout;
for(int layout = 0; layout < PCM_MAX_LAYOUT; ++layout)
channelLayout.insert(make_pair(34101+layout, layout));
+#if defined(HAS_SIGMASMP)
+ AddInt( NULL, "audiooutput.channellayout", 34100, PCM_LAYOUT_2_0, channelLayout, SPIN_CONTROL_TEXT);
+ AddBool(NULL, "audiooutput.dontnormalizelevels", 346, true);
+#else
AddInt(ao, "audiooutput.channellayout", 34100, PCM_LAYOUT_2_0, channelLayout, SPIN_CONTROL_TEXT);
AddBool(ao, "audiooutput.dontnormalizelevels", 346, true);
+#endif
#if (defined(__APPLE__) && defined(__arm__))
AddBool(g_sysinfo.IsAppleTV2() ? ao : NULL, "audiooutput.ac3passthrough", 364, false);
@@ -454,7 +462,7 @@ void CGUISettings::Initialize()
#ifdef __APPLE__
AddString(ao, "audiooutput.audiodevice", 545, "Default", SPIN_CONTROL_TEXT);
-#elif defined(_LINUX)
+#elif defined(_LINUX) && !defined(HAS_SIGMASMP)
AddSeparator(ao, "audiooutput.sep1");
AddString(ao, "audiooutput.audiodevice", 545, "default", SPIN_CONTROL_TEXT);
AddString(ao, "audiooutput.customdevice", 1300, "", EDIT_CONTROL_INPUT);
@@ -615,7 +623,7 @@ void CGUISettings::Initialize()
// FIXME: hide this setting until it is properly respected. In the meanwhile, default to AUTO.
//AddInt(5, "videoplayer.displayresolution", 169, (int)RES_AUTORES, (int)RES_AUTORES, 1, (int)CUSTOM+MAX_RESOLUTIONS, SPIN_CONTROL_TEXT);
AddInt(NULL, "videoplayer.displayresolution", 169, (int)RES_AUTORES, (int)RES_AUTORES, 1, (int)RES_AUTORES, SPIN_CONTROL_TEXT);
-#if !(defined(__APPLE__) && defined(__arm__))
+#if !defined(HAS_SIGMASMP) && !(defined(__APPLE__) && defined(__arm__))
AddBool(vp, "videoplayer.adjustrefreshrate", 170, false);
AddInt(vp, "videoplayer.pauseafterrefreshchange", 13550, 0, 0, 1, MAXREFRESHCHANGEDELAY, SPIN_CONTROL_TEXT);
#else
@@ -623,7 +631,7 @@ void CGUISettings::Initialize()
AddInt(NULL, "videoplayer.pauseafterrefreshchange", 13550, 0, 0, 1, MAXREFRESHCHANGEDELAY, SPIN_CONTROL_TEXT);
#endif
//sync settings not available on windows gl build
-#if defined(_WIN32) && defined(HAS_GL)
+#if (defined(_WIN32) && defined(HAS_GL)) || defined(HAS_SIGMASMP)
#define SYNCSETTINGS 0
#else
#define SYNCSETTINGS 1
https://github.com/xbmc/xbmc/commit/b191bbe0749f24374b932c06995b47473c1a8a7d
commit b191bbe0749f24374b932c06995b47473c1a8a7d
Author: davilla <davilla@...>
Date: Thu Jan 19 15:05:08 2012 -0500
[smp] fixed, stop referencing global m_SubtitleOn and setup m_subtitle_show early. remove unsued m_subtitle_delay
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 4d470da..f98f64f 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -117,7 +117,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
m_subtitle_index = -1;
m_subtitle_count = 0;
- m_subtitle_delay = 0;
+ m_subtitle_show = g_settings.m_currentVideoSettings.m_SubtitleOn;
m_title_index = 0;
m_title_count = 0;
@@ -804,7 +804,6 @@ void CSMPPlayer::SetSubtitleVisible(bool bVisible)
CSingleLock lock(m_amp_command_csection);
m_subtitle_show = bVisible;
- g_settings.m_currentVideoSettings.m_SubtitleOn = bVisible;
if (m_amp && m_amp_media)
{
@@ -1376,7 +1375,7 @@ void CSMPPlayer::Process()
if (m_video_count > 0 || m_dvd_mediatype)
{
// turn on/off subs
- SetSubtitleVisible(g_settings.m_currentVideoSettings.m_SubtitleOn);
+ SetSubtitleVisible(m_subtitle_show);
SetSubTitleDelay(g_settings.m_currentVideoSettings.m_SubtitleDelay);
// setup renderer for bypass. This tell it to get out of the way as
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index 0c39848..83ee482 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -190,7 +190,6 @@ private:
int m_subtitle_index;
int m_subtitle_count;
bool m_subtitle_show;
- int m_subtitle_delay;
SLPBCmd_SubsParameters *m_subtitle_params;
int m_title_index;
https://github.com/xbmc/xbmc/commit/8865bcbe8c6b5cc483804acec900f7ebd5237e85
commit 8865bcbe8c6b5cc483804acec900f7ebd5237e85
Author: davilla <davilla@...>
Date: Wed Jan 18 16:43:50 2012 -0500
[smp] fixed, a) since we know fps if AddSubtitle is called, use them. b) AddSubtitle want the current sub inex returned
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index fa4ed34..4d470da 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -906,8 +906,8 @@ int CSMPPlayer::AddSubtitle(const CStdString& strSubPath)
{
m_subtitle_params->setSUBFrameRate = TRUE;
params.externalsubs.type = SLPBTextSubs_SUB;
- params.externalsubs.framerateNumerator = 25;
- params.externalsubs.framerateDenominator = 1;
+ params.externalsubs.framerateNumerator = m_video_fps_numerator;
+ params.externalsubs.framerateDenominator = m_video_fps_denominator;
}
else if (URIUtils::GetExtension(strSubPath) == ".smi")
params.externalsubs.type = SLPBTextSubs_SMI;
@@ -934,8 +934,7 @@ int CSMPPlayer::AddSubtitle(const CStdString& strSubPath)
}
}
- // this waits until we can stop/restart amp stream.
- return -1;
+ return m_subtitle_index;
}
void CSMPPlayer::Update(bool bPauseDrawing)
https://github.com/xbmc/xbmc/commit/abe30fc02bde18d9d76614b9dab89be3e0975607
commit abe30fc02bde18d9d76614b9dab89be3e0975607
Author: davilla <davilla@...>
Date: Wed Jan 18 16:25:27 2012 -0500
[smp] changed we do not need to check SLPBPARAMS_MAX_TEXT_SUBS anymore. clean up code in SetSubtitleVisible
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index dec09be..fa4ed34 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -247,7 +247,6 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
}
else
{
-#if defined(SLPBPARAMS_MAX_TEXT_SUBS)
// Setup open parameters
struct SLPBOpenParams parameters = {0, };
parameters.zero = 0;
@@ -387,7 +386,6 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
// open the media using the IAdvancedMediaProvider
res = m_amp->OpenMedia(m_amp, (char*)ids_url.c_str(), &format, ¶meters);
-#endif
}
CLog::Log(LOGDEBUG, "CSMPPlayer: Opening: %s", ids_url.c_str());
if (res != DFB_OK)
@@ -843,12 +841,12 @@ void CSMPPlayer::SetSubtitleVisible(bool bVisible)
if ( !(texttype == SLPBTextSubs_SSA || texttype == SLPBTextSubs_ASS)
|| g_guiSettings.GetBool("subtitles.overrideassfonts"))
{
+ RESOLUTION res = g_graphicsContext.GetVideoResolution();
SetSubTitleParameters(g_guiSettings.GetInt("subtitles.height"),
g_guiSettings.GetInt("subtitles.color"),
g_guiSettings.GetInt("subtitles.style"),
g_guiSettings.GetInt("subtitles.align"),
- (g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].iSubtitles
- * 1080) / g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].iHeight);
+ (g_settings.m_ResInfo[res].iSubtitles * 1080) / g_settings.m_ResInfo[res].iHeight);
}
}
}
https://github.com/xbmc/xbmc/commit/c1bbd7b6a3fef89e2e7698a78123f65753cccc05
commit c1bbd7b6a3fef89e2e7698a78123f65753cccc05
Author: davilla <davilla@...>
Date: Wed Jan 18 15:32:29 2012 -0500
[smp] implement AddSubtitle function. add ability to alter sub display params. fix m2ts
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index 59c2a9c..600b15d 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -222,6 +222,10 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
cmd.lpb.cmd = LPBCmd_SELECT_SUBTITLE_STREAM;
cmd.lpb.param1.streamIndex = params.streamindex;
break;
+ case SMP_ADD_EXTERNAL_SUBTITLES:
+ cmd.lpb.cmd = LPBCmd_ADD_EXTERNAL_SUBTITLES;
+ cmd.lpb.param1.externalSubs = params.externalsubs;
+ break;
default:
CLog::Log(LOGDEBUG, "CAMPMediaSpace::SetupCommand: unknown lpb command, what(%d)", what);
rtn = false;
@@ -869,8 +873,9 @@ void CSMPMediaSpace::GetAudioStreamName(int iStream, CStdString &strStreamName)
CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
}
}
+
//========================================================================
-void CSMPMediaSpace::GetSubtitleName(int iStream, CStdString &strStreamName)
+void CSMPMediaSpace::GetSubtitleInfo(int iStream, CStdString &strStreamName, enum SLPBSubs &Type, enum SLPBTextSubs &TextType)
{
if (m_mediatype == MTYPE_APP_NONE)
{
@@ -882,10 +887,17 @@ void CSMPMediaSpace::GetSubtitleName(int iStream, CStdString &strStreamName)
res.lpb.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
cmd.lpb.cmd = LPBCmd_GET_SUBTITLE_STREAM_INFO;
cmd.lpb.param1.streamIndex = iStream;
- if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
- strStreamName.Format("%s", res.lpb.value.streamInfo.name);
- else
- strStreamName.Format("Undefined");
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
+ {
+ strStreamName.Format("%s", res.lpb.value.streamInfo.name);
+ Type = (enum SLPBSubs) res.lpb.value.streamInfo.format.format.subs.type;
+ TextType = (enum SLPBTextSubs) res.lpb.value.streamInfo.format.format.subs.textType;
+ }
+ else
+ {
+ Type = SLPBSubs_Unknown;
+ strStreamName.Format("Undefined");
+ }
}
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
@@ -896,6 +908,7 @@ void CSMPMediaSpace::GetSubtitleName(int iStream, CStdString &strStreamName)
{
g_LangCodeExpander.Lookup(strStreamName,
m_status.dvd.title.spuStreams.subPictureStreams[iStream].languageCode);
+ Type = SLPBSubs_Embedded_dvd;
}
}
#endif
@@ -904,5 +917,4 @@ void CSMPMediaSpace::GetSubtitleName(int iStream, CStdString &strStreamName)
CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
}
}
-
#endif
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
index d7ec15c..cefe4ff 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -27,6 +27,8 @@
typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
+#define NO_RED_SUPPORT
+
#include <cdefs_lpb.h>
#ifndef NO_RED_SUPPORT
#define RMbool bool
@@ -57,7 +59,8 @@ enum SMPCommands
SMP_SELECT_AUDIO_STREAM,
SMP_SET_SUBS_PARAMETERS,
SMP_SELECT_SUBTITLE_STREAM,
- SMP_DO_ACTION
+ SMP_DO_ACTION,
+ SMP_ADD_EXTERNAL_SUBTITLES
};
union UMSStatus
@@ -94,6 +97,7 @@ union UMSParams
int action;
SAdjustment adjustment;
SLPBCmd_SubsParameters *subsparams;
+ struct SLPBExternalSubtitles externalsubs;
};
struct SMPChapterInfo
@@ -126,7 +130,7 @@ public:
bool MediaSetMenu();
bool MediaIsInMenu();
void GetAudioStreamName(int iStream, CStdString &strStreamName);
- void GetSubtitleName(int iStream, CStdString &strStreamName);
+ void GetSubtitleInfo(int iStream, CStdString &strStreamName, enum SLPBSubs &Type, enum SLPBTextSubs &TextType);
private:
UMSStatus m_status;
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index a321824..dec09be 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -32,6 +32,7 @@
#include "filesystem/File.h"
#include "filesystem/SpecialProtocol.h"
#include "guilib/GUIMessage.h"
+#include "guilib/GUIFont.h"
#include "guilib/GUIWindowManager.h"
#include "settings/AdvancedSettings.h"
#include "settings/GUISettings.h"
@@ -141,6 +142,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
return false;
}
+ int ts_skip = 0;
std::string ids_url;
SMediaFormat format = { 0 };
CStdString itempath(m_item.GetPath());
@@ -188,7 +190,10 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
else if (extension.Equals(".mpg"))
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
else if (extension.Equals(".m2ts"))
+ {
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ ts_skip = 4;
+ }
else if (extension.Equals(".m2t"))
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
else if (extension.Equals(".ts"))
@@ -204,15 +209,16 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
}
m_amp_media = new CSMPMediaSpace(m_amp, format.mediaType);
+ // This must stay in the stack until open
+ char ids_c_str[64];
if (ids_url.empty())
{
// use amp ids method to handle xbmc's vfs
SIdsData ids;
- char c_str[64];
// setup the IDataSource cookie, CloseMedia will delete it
ids.src = new CFileIDataSource(itempath);
- snprintf(c_str, sizeof(c_str)/sizeof(char), "ids://0x%08lx", (long unsigned int)&ids);
- ids_url = c_str;
+ snprintf(ids_c_str, sizeof(ids_c_str)/sizeof(char), "ids://0x%08lx", (long unsigned int)&ids);
+ ids_url = ids_c_str;
}
SetupAudioOutput();
@@ -254,6 +260,8 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
parameters.stcOffset = -200;
// max prebuffersize in bytes, 0 for default
parameters.maxPrebufferSize = 100 * 1024;
+ // some param :)
+ parameters.tsSkip = ts_skip;
// find any available external subtitles
// SRT, SSA, ASS, SUB, SMI or binary SUB/IDX
@@ -326,8 +334,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
m_sub_urls.push_back(url);
parameters.textSubs.entry[i].fileUrl = (char*)m_sub_urls.back().c_str();
- // TODO: figure out a better description of the subtitle.
- strcpy(parameters.textSubs.entry[i].description, "some external subtitle file");
+ strncpy(parameters.textSubs.entry[i].description, filenames[i].c_str(), MAX_NAME_SIZE-1);
CLog::Log(LOGDEBUG, "subtile file found, %s, creating ids source %s",
filenames[i].c_str(), parameters.textSubs.entry[i].fileUrl);
parameters.textSubs.count++;
@@ -368,6 +375,16 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
}
}
}
+
+ // Add default font
+ CStdString fontPath = "special://xbmc/media/Fonts/";
+ fontPath += g_guiSettings.GetString("subtitles.font");
+ SIdsData *fontIdsdata = new SIdsData;
+ char fontC_str[64];
+ fontIdsdata->src = new CFileIDataSource(fontPath.c_str());
+ snprintf(fontC_str, sizeof(fontC_str)/sizeof(char), "ids://0x%08lx", (long unsigned int)fontIdsdata);
+ parameters.DefaultFontFileUrl = fontC_str;
+
// open the media using the IAdvancedMediaProvider
res = m_amp->OpenMedia(m_amp, (char*)ids_url.c_str(), &format, ¶meters);
#endif
@@ -702,33 +719,13 @@ void CSMPPlayer::SetSubTitleDelay(float fValue = 0.0f)
CSingleLock lock(m_amp_command_csection);
m_subtitle_params->setDelay = true;
- m_subtitle_params->delay_ms = (int)fValue;
+ m_subtitle_params->delay_ms = (int)(-fValue*1000.0);
if (m_subtitle_params->setSUBFrameRate)
{
m_subtitle_params->subFramerateNumerator = m_video_fps_numerator;
m_subtitle_params->subFramerateDenominator = m_video_fps_denominator;
}
- /*
- TODO: find where these are get/set
- bool setFontSize;
- unsigned fontSize = g_guiSettings.GetInt("subtitles.height");
-
- bool setPosY;
- int posY;
-
- bool setFillColor;
- fillColor = g_guiSettings.GetInt("subtitles.color");
- unsigned fillAlpha;
-
- bool setBorderColor;
- unsigned borderColor;
- unsigned borderAlpha;
-
- bool setEncoding;
- enum ELPBCmd_SubsParameters_Encoding encoding;
- */
-
UMSCommand cmd;
UMSResult res;
UMSParams params;
@@ -766,7 +763,10 @@ void CSMPPlayer::GetSubtitleName(int iStream, CStdString &strStreamName)
{
CSingleLock lock(m_amp_command_csection);
- m_amp_media->GetSubtitleName(iStream, strStreamName);
+ enum SLPBSubs type;
+ enum SLPBTextSubs texttype;
+
+ m_amp_media->GetSubtitleInfo(iStream, strStreamName, type, texttype);
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetSubtitleName");
}
@@ -829,6 +829,29 @@ void CSMPPlayer::SetSubtitleVisible(bool bVisible)
{
m_amp_media->SetupCommand(SMP_SELECT_SUBTITLE_STREAM, cmd, params, res);
m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+
+ // Now force parameters if needed
+ if (params.streamindex != -1)
+ {
+ enum SLPBSubs type;
+ enum SLPBTextSubs texttype;
+ CStdString strstreamname;
+ m_amp_media->GetSubtitleInfo(params.streamindex, strstreamname, type, texttype);
+
+ if ((type == SLPBSubs_External_text || type == SLPBSubs_Embedded_text))
+ {
+ if ( !(texttype == SLPBTextSubs_SSA || texttype == SLPBTextSubs_ASS)
+ || g_guiSettings.GetBool("subtitles.overrideassfonts"))
+ {
+ SetSubTitleParameters(g_guiSettings.GetInt("subtitles.height"),
+ g_guiSettings.GetInt("subtitles.color"),
+ g_guiSettings.GetInt("subtitles.style"),
+ g_guiSettings.GetInt("subtitles.align"),
+ (g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].iSubtitles
+ * 1080) / g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].iHeight);
+ }
+ }
+ }
}
}
//CLog::Log(LOGDEBUG, "CSMPPlayer::SetSubtitleVisible(%d), m_subtitle_index(%d)", m_subtitle_show, m_subtitle_index);
@@ -836,6 +859,83 @@ void CSMPPlayer::SetSubtitleVisible(bool bVisible)
int CSMPPlayer::AddSubtitle(const CStdString& strSubPath)
{
+ CSingleLock lock(m_amp_command_csection);
+
+ if (m_amp && m_amp_media)
+ {
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+
+ {
+ SIdsData *idsdata;
+ CStdString url;
+
+ idsdata = new SIdsData;
+ // setup the IDataSource cookie, Who will delete it ?
+ idsdata->src = new CFileIDataSource(strSubPath.c_str());
+ m_sub_ids.push_back(idsdata);
+ url.Format("ids://0x%08lx", (long unsigned int)m_sub_ids.back());
+ m_sub_urls.push_back(url);
+ params.externalsubs.fileUrl = (char*)m_sub_urls.back().c_str();
+ }
+
+ params.externalsubs.type = SLPBTextSubs_ASCII;
+ if (URIUtils::GetExtension(strSubPath) == ".txt" ||
+ URIUtils::GetExtension(strSubPath) == ".text")
+ {
+ if (CheckForUTF8(strSubPath))
+ params.externalsubs.type = SLPBTextSubs_UTF8;
+ else
+ params.externalsubs.type = SLPBTextSubs_ASCII;
+ }
+ else if (URIUtils::GetExtension(strSubPath) == ".utf" ||
+ URIUtils::GetExtension(strSubPath) == ".utf8" ||
+ URIUtils::GetExtension(strSubPath) == ".utf-8")
+ params.externalsubs.type = SLPBTextSubs_UTF8;
+ else if (URIUtils::GetExtension(strSubPath) == ".srt")
+ {
+ if (CheckForUTF8(strSubPath))
+ params.externalsubs.type = SLPBTextSubs_UTF8;
+ else
+ params.externalsubs.type = SLPBTextSubs_ASCII;
+ }
+ else if (URIUtils::GetExtension(strSubPath) == ".ssa")
+ params.externalsubs.type = SLPBTextSubs_SSA;
+ else if (URIUtils::GetExtension(strSubPath) == ".ass")
+ params.externalsubs.type = SLPBTextSubs_ASS;
+ else if (URIUtils::GetExtension(strSubPath) == ".sub")
+ {
+ m_subtitle_params->setSUBFrameRate = TRUE;
+ params.externalsubs.type = SLPBTextSubs_SUB;
+ params.externalsubs.framerateNumerator = 25;
+ params.externalsubs.framerateDenominator = 1;
+ }
+ else if (URIUtils::GetExtension(strSubPath) == ".smi")
+ params.externalsubs.type = SLPBTextSubs_SMI;
+ else if (URIUtils::GetExtension(strSubPath) == ".srt")
+ {
+ if (CheckForUTF8(strSubPath))
+ params.externalsubs.type = SLPBTextSubs_UTF8;
+ else
+ params.externalsubs.type = SLPBTextSubs_ASCII;
+ }
+
+ strncpy(params.externalsubs.description, strSubPath.c_str(), MAX_NAME_SIZE-1);
+ params.externalsubs.switchNow = true;
+
+ if (m_amp && m_amp_media)
+ {
+ m_amp_media->SetupCommand(SMP_ADD_EXTERNAL_SUBTITLES, cmd, params, res);
+ m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+
+ GetAmpStatus();
+ m_subtitle_count = m_amp_media->GetStatusSubTitleInfo(m_subtitle_index);
+
+ SetSubtitleVisible(true);
+ }
+ }
+
// this waits until we can stop/restart amp stream.
return -1;
}
@@ -1731,4 +1831,67 @@ bool CSMPPlayer::GetAmpStatus()
return false;
}
+void CSMPPlayer::SetSubTitleParameters(int height, int color, int style, int align, int posy)
+{
+ static unsigned colortable[8] = { 0xFFFFFF00, 0xFFFFFFFF, 0xFF0099FF, 0xFF00FF00, 0xFFCCFF00, 0xFF00FFFF, 0xFFE5E5E5, 0xFFC0C0C0 };
+
+ if (GetSubtitleCount())
+ {
+ CSingleLock lock(m_amp_command_csection);
+
+ m_subtitle_params->setFontSize = true;
+ m_subtitle_params->fontSize = height;
+ m_subtitle_params->setFillColor = true;
+ m_subtitle_params->fillColor = colortable[color];
+ m_subtitle_params->setStyle = true;
+ switch (style)
+ {
+ case FONT_STYLE_BOLD:
+ m_subtitle_params->style = SLPBFONTSTYLE_BOLD;
+ break;
+ case FONT_STYLE_ITALICS:
+ m_subtitle_params->style = SLPBFONTSTYLE_ITALIC;
+ break;
+ case FONT_STYLE_BOLD_ITALICS:
+ m_subtitle_params->style = SLPBFONTSTYLE_ITALIC | SLPBFONTSTYLE_BOLD;
+ break;
+ default:
+ m_subtitle_params->style = SLPBFONTSTYLE_NORMAL;
+ break;
+ }
+ m_subtitle_params->setAlignment = true;
+ m_subtitle_params->alignmentHorizontal = ELPBCmd_SubsParameters_AlignmentHorizontal_Centered;
+
+ switch (align)
+ {
+ case SUBTITLE_ALIGN_BOTTOM_INSIDE:
+ case SUBTITLE_ALIGN_BOTTOM_OUTSIDE:
+ m_subtitle_params->alignmentVertical = ELPBCmd_SubsParameters_AlignmentVertical_Bottom;
+ break;
+ case SUBTITLE_ALIGN_TOP_INSIDE:
+ case SUBTITLE_ALIGN_TOP_OUTSIDE:
+ m_subtitle_params->alignmentVertical = ELPBCmd_SubsParameters_AlignmentVertical_Top;
+ break;
+ default:
+ m_subtitle_params->setAlignment = false;
+ m_subtitle_params->setPosY = true;
+ m_subtitle_params->posY = posy;
+ break;
+ }
+
+ CLog::Log(LOGDEBUG, "CSMPPlayer::SetSubTitleParameters, height=%d, color=0x%x, style=%d, align=%d",
+ height, color, style, align);
+
+ if (m_amp && m_amp_media)
+ {
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.subsparams = m_subtitle_params;
+ if (!(m_amp_media->SetupCommand(SMP_SET_SUBS_PARAMETERS, cmd, params, res)))
+ return;
+ m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+ }
+ }
+}
#endif
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index 4fc3e38..0c39848 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -150,6 +150,7 @@ private:
bool WaitForAmpFormatValid(int timeout_ms);
void ShowMainVideo(bool show);
bool GetAmpStatus();
+ void SetSubTitleParameters(int height, int color, int style, int align, int posy);
int m_speed;
bool m_paused;
https://github.com/xbmc/xbmc/commit/73d39afacb74d8555615a3c8b8a9772dd4ba006c
commit 73d39afacb74d8555615a3c8b8a9772dd4ba006c
Author: davilla <davilla@...>
Date: Wed Jan 18 14:40:38 2012 -0500
[smp] do not hammer libcdio on every file open
diff --git a/xbmc/linux/XFileUtils.cpp b/xbmc/linux/XFileUtils.cpp
index 0545f0d..7da8314 100644
--- a/xbmc/linux/XFileUtils.cpp
+++ b/xbmc/linux/XFileUtils.cpp
@@ -275,7 +275,7 @@ if (errno == 20)
HANDLE result = new CXHandle(CXHandle::HND_FILE);
result->fd = fd;
-#if defined(TARGET_LINUX) && defined(HAS_DVD_DRIVE)
+#if defined(TARGET_LINUX) && defined(HAS_DVD_DRIVE) && !defined(HAS_SIGMASMP)
// special case for opening the cdrom device
if (strcmp(lpFileName, MEDIA_DETECT::CLibcdio::GetInstance()->GetDeviceFileName())==0)
result->m_bCDROM = true;
https://github.com/xbmc/xbmc/commit/5f493773731f4c2b74a22bed444000dba5e1ad4f
commit 5f493773731f4c2b74a22bed444000dba5e1ad4f
Author: davilla <davilla@...>
Date: Wed Jan 18 14:38:15 2012 -0500
[smp] disable assert check for mips
diff --git a/xbmc/utils/MathUtils.h b/xbmc/utils/MathUtils.h
index df767ed..174138a 100644
--- a/xbmc/utils/MathUtils.h
+++ b/xbmc/utils/MathUtils.h
@@ -20,6 +20,7 @@
*
*/
+
#include <stdint.h>
#include <cassert>
#include <climits>
@@ -48,8 +49,10 @@ namespace MathUtils
*/
inline int round_int (double x)
{
+#if !defined(__mips__)
assert(x > static_cast<double>(INT_MIN / 2) - 1.0);
assert(x < static_cast <double>(INT_MAX / 2) + 1.0);
+#endif
const float round_to_nearest = 0.5f;
int i;
https://github.com/xbmc/xbmc/commit/4ada87e60d57dccfadd2d3d3e0d98d845c63ba33
commit 4ada87e60d57dccfadd2d3d3e0d98d845c63ba33
Author: davilla <davilla@...>
Date: Wed Jan 18 13:45:28 2012 -0500
[smp] check external ascii subs for UTF8 and flags them as such
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 456caa3..a321824 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -29,6 +29,7 @@
#include "GUIUserMessages.h"
#include "Util.h"
#include "cores/VideoRenderers/RenderManager.h"
+#include "filesystem/File.h"
#include "filesystem/SpecialProtocol.h"
#include "guilib/GUIMessage.h"
#include "guilib/GUIWindowManager.h"
@@ -269,13 +270,23 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
//
if (URIUtils::GetExtension(filenames[i]) == ".txt" ||
URIUtils::GetExtension(filenames[i]) == ".text")
- parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
+ {
+ if (CheckForUTF8(filenames[i]))
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_UTF8;
+ else
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
+ }
else if (URIUtils::GetExtension(filenames[i]) == ".utf" ||
URIUtils::GetExtension(filenames[i]) == ".utf8" ||
URIUtils::GetExtension(filenames[i]) == ".utf-8")
parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_UTF8;
else if (URIUtils::GetExtension(filenames[i]) == ".srt")
- parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
+ {
+ if (CheckForUTF8(filenames[i]))
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_UTF8;
+ else
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
+ }
else if (URIUtils::GetExtension(filenames[i]) == ".ssa")
parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SSA;
else if (URIUtils::GetExtension(filenames[i]) == ".ass")
@@ -294,7 +305,12 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
else if (URIUtils::GetExtension(filenames[i]) == ".smi")
parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SMI;
else if (URIUtils::GetExtension(filenames[i]) == ".srt")
- parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
+ {
+ if (CheckForUTF8(filenames[i]))
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_UTF8;
+ else
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
+ }
// if we have a type, create the file data source (ids)
if (parameters.textSubs.entry[parameters.textSubs.count].type)
@@ -1365,6 +1381,35 @@ void CSMPPlayer::Process()
//========================================================================
//========================================================================
+bool CSMPPlayer::CheckForUTF8(const CStdString &filename)
+{
+ bool isUTF8 = false;
+ int size_read = 0;
+ unsigned char buffer[1024] = {0};
+ XFILE::CFile *cfile = new XFILE::CFile();
+
+ if (cfile->Open(filename, 0))
+ size_read = cfile->Read(buffer, 4);
+
+ // 'might' be utf8 so test it.
+ if (size_read == 4)
+ {
+ // check both big and little endian flavors
+ if ((buffer[1] == 0xEF && buffer[0] == 0xBB && buffer[3] == 0xBF) ||
+ (buffer[0] == 0xEF && buffer[1] == 0xBB && buffer[2] == 0xBF))
+ {
+ isUTF8 = true;
+ }
+ }
+ cfile->Close();
+ delete cfile;
+
+ //printf("CSMPPlayer::CheckForUTF8, %s is UTF8(%d), buffer[0]=%x, buffer[1]=%x, buffer[2]=%x, buffer[3]=%x\n",
+ // filename.c_str(), isUTF8, buffer[0], buffer[1], buffer[2], buffer[3]);
+
+ return isUTF8;
+}
+
void CSMPPlayer::SetupAudioOutput()
{
// this can be called before or after m_amp->OpenMedia.
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index ba8aa9b..4fc3e38 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -142,6 +142,7 @@ protected:
virtual void Process();
private:
+ bool CheckForUTF8(const CStdString &filename);
void SetupAudioOutput();
bool WaitForAmpStopped(int timeout_ms);
bool WaitForAmpPlaying(int timeout_ms);
https://github.com/xbmc/xbmc/commit/b81e1261a33d10bedba8683a6fe331cf61f3cff6
commit b81e1261a33d10bedba8683a6fe331cf61f3cff6
Author: davilla <davilla@...>
Date: Tue Jan 17 18:29:59 2012 -0500
[smp] fixed compiler error, why does sigma code set this to COMP_digital when that does not match the typedef ?????
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 6c5a2b5..456caa3 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1479,7 +1479,7 @@ void CSMPPlayer::SetupAudioOutput()
aConfig.drc.boost = 0x10000000; // default scaleLo
aConfig.drc.cut = 0x10000000; // default scaleHi
aConfig.drc.partComp = 0x10000000; // default scalePCM
- aConfig.drc.mode = 11; // compression type (magic value. COMP_digital = (10 + CompMode_digital) where CompMode_digital = 1;
+ aConfig.drc.mode = SDRCParams::DRC_Off;
aConfig.drc.dialogRef = 0;
// dual mode (for 2 channel sources only)
https://github.com/xbmc/xbmc/commit/3807b7cb82f820380a77aad5d266d2be0656e45d
commit 3807b7cb82f820380a77aad5d266d2be0656e45d
Author: davilla <davilla@...>
Date: Tue Jan 17 18:25:31 2012 -0500
[smp] fixed wrong var in Dynamic Range Control. changed hdmi/pcm can handle 96000/192000
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index f9e5d85..6c5a2b5 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1393,6 +1393,8 @@ void CSMPPlayer::SetupAudioOutput()
{
aConfig.hdmi.bitstream.formats = AUDIO_MTYPE_TO_BITMASK(MTYPE_ELEM_PCM);
aConfig.hdmi.bitstream.formatParamTab[MTYPE_ELEM_PCM - MTYPE_ELEM_AUDIO_FIRST].samplingRates = default_samplingRates;
+ aConfig.hdmi.bitstream.formatParamTab[MTYPE_ELEM_PCM - MTYPE_ELEM_AUDIO_FIRST].samplingRates |= ASRATE_TO_BITMASK(FREQ_96000);
+ aConfig.hdmi.bitstream.formatParamTab[MTYPE_ELEM_PCM - MTYPE_ELEM_AUDIO_FIRST].samplingRates |= ASRATE_TO_BITMASK(FREQ_192000);
aConfig.hdmi.bitstream.formatParamTab[MTYPE_ELEM_PCM - MTYPE_ELEM_AUDIO_FIRST].maxBitrate = 7;
}
aConfig.hdmi.bitstream.pcmChannels = CCf_default; // autodetect number of channels on PCM link
@@ -1460,7 +1462,7 @@ void CSMPPlayer::SetupAudioOutput()
aConfig.spdif.bitstream.pcmChannels = CCf_LR; // 2 PCM channels
aConfig.spdif.bitstream.pcmRate = 48000; // max sample rate on PCM link
aConfig.spdif.bitstream.preserveOriginalBitstream = 1; // preserve original bitstream
- aConfig.spdif.bitstream.preserveOriginalQuality = 1; // preserve original quality
+ aConfig.spdif.bitstream.preserveOriginalQuality = 1; // preserve original quality
aConfig.spdif.output.speakers = CCf_LCRSlSr; // multi-channel speaker configuration
aConfig.spdif.output.lfe = 1; // LFE speaker will be inferred from the field above
for (int i = 0; i < 8; i++)
@@ -1473,18 +1475,22 @@ void CSMPPlayer::SetupAudioOutput()
aConfig.spdif.output.hdmiEnable = false;
// Dynamic Range Control (valid only for applicable content formats - for example AC3)
+ // **************************************
aConfig.drc.boost = 0x10000000; // default scaleLo
aConfig.drc.cut = 0x10000000; // default scaleHi
aConfig.drc.partComp = 0x10000000; // default scalePCM
- aConfig.drc.dialogRef = 11; // compression type (magic value. COMP_digital = (10 + CompMode_digital) where CompMode_digital = 1;
+ aConfig.drc.mode = 11; // compression type (magic value. COMP_digital = (10 + CompMode_digital) where CompMode_digital = 1;
+ aConfig.drc.dialogRef = 0;
// dual mode (for 2 channel sources only)
+ // **************************************
aConfig.dualMode = DM_Stereo;
//aConfig.dualMode = DM_MixMono;
//aConfig.dualMode = DM_LeftMono;
//aConfig.dualMode = DM_RightMono;
// SRS Labs TruSurround HD (optional) parameters
+ // **************************************
aConfig.srsTruSurroundHd.mode = SSRSParams::SRS_Disabled;
// now that all audio outputs are setup, enable the user selection
https://github.com/xbmc/xbmc/commit/4584401ced613cfe49f88980c3e6b9cb65d14c1d
commit 4584401ced613cfe49f88980c3e6b9cb65d14c1d
Author: davilla <davilla@...>
Date: Tue Jan 17 17:37:46 2012 -0500
[smp] hook audio output settings
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 102895a..f9e5d85 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -46,6 +46,7 @@
#include "SMPMediaSpace.h"
#include <directfb.h>
+#include <directfb_version.h>
#include <iadvancedmediaprovider.h>
#include <algorithm>
@@ -213,6 +214,8 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
ids_url = c_str;
}
+ SetupAudioOutput();
+
if (m_dvd_mediatype)
{
#ifndef NO_RED_SUPPORT
@@ -1362,6 +1365,148 @@ void CSMPPlayer::Process()
//========================================================================
//========================================================================
+void CSMPPlayer::SetupAudioOutput()
+{
+ // this can be called before or after m_amp->OpenMedia.
+ struct SAudioOutConfig aConfig;
+ memset(&aConfig, 0, sizeof(SAudioOutConfig));
+
+ aConfig.size = sizeof(SAudioOutConfig);
+
+ UINT32 default_samplingRates = ASRATE_TO_BITMASK(FREQ_22050)
+ | ASRATE_TO_BITMASK(FREQ_32000)
+ | ASRATE_TO_BITMASK(FREQ_44100)
+ | ASRATE_TO_BITMASK(FREQ_48000);
+
+ bool ac3passthrough = g_guiSettings.GetBool("audiooutput.ac3passthrough");
+ bool dtspassthrough = g_guiSettings.GetBool("audiooutput.dtspassthrough");
+ bool aacpassthrough = g_guiSettings.GetBool("audiooutput.passthroughaac");
+
+ // HDMI connection configuration
+ // **************************************
+ aConfig.hdmi.bitstream.status = CS_Disconnected;
+ if (ac3passthrough || dtspassthrough || aacpassthrough)
+ {
+ aConfig.hdmi.bitstream.formats = 0; // auto-detect supported formats
+ }
+ else
+ {
+ aConfig.hdmi.bitstream.formats = AUDIO_MTYPE_TO_BITMASK(MTYPE_ELEM_PCM);
+ aConfig.hdmi.bitstream.formatParamTab[MTYPE_ELEM_PCM - MTYPE_ELEM_AUDIO_FIRST].samplingRates = default_samplingRates;
+ aConfig.hdmi.bitstream.formatParamTab[MTYPE_ELEM_PCM - MTYPE_ELEM_AUDIO_FIRST].maxBitrate = 7;
+ }
+ aConfig.hdmi.bitstream.pcmChannels = CCf_default; // autodetect number of channels on PCM link
+ aConfig.hdmi.bitstream.pcmRate = 0; // autodetect max sample rate on PCM link
+ aConfig.hdmi.bitstream.preserveOriginalBitstream = 1; // preserve original bitstream
+ aConfig.hdmi.bitstream.preserveOriginalQuality = 1; // preserve original quality
+ aConfig.hdmi.output.speakers = CCf_default; // autodetect
+ aConfig.hdmi.output.lfe = 0; // LFE speaker will be inferred from the field above
+ for (int i = 0; i < 8; i++)
+ aConfig.hdmi.output.delay[i] = 0; // default delays
+ for (int i = 0; i < 8; i++)
+ aConfig.hdmi.output.volume[i] = 0x10000000; // default volume
+ aConfig.hdmi.output.surroundMode = SRND_OFF; // surround mode
+ aConfig.hdmi.output.bassMode = BM_None;
+ aConfig.hdmi.output.centerUp = 0;
+ aConfig.hdmi.output.hdmiEnable = true;
+
+ // Multichannel analog connection configuration
+ // **************************************
+ aConfig.multiChannel.status = CS_Disconnected;
+ aConfig.multiChannel.output.speakers= CCf_default; // autodetect
+ aConfig.multiChannel.output.lfe = 0; // LFE speaker will be inferred from the field above
+ for (int i = 0; i < 8; i++)
+ aConfig.multiChannel.output.delay[i] = 0; // default delays
+ for (int i = 0; i < 8; i++)
+ aConfig.multiChannel.output.volume[i] = 0x10000000; // default volume
+ aConfig.multiChannel.output.surroundMode = SRND_OFF; // surround mode
+ aConfig.multiChannel.output.bassMode = BM_None;
+ aConfig.multiChannel.output.centerUp = 0;
+ aConfig.multiChannel.output.hdmiEnable = false;
+ aConfig.multiChannel.preserveOriginalQuality = 0;
+
+ // Stereo analog connection configuration
+ // **************************************
+ aConfig.stereo.status = CS_Disconnected;
+ for (int i = 0; i < 2; i++)
+ aConfig.stereo.volume[i] = 0x10000000; // default volume
+ aConfig.stereo.surroundMode = SRND_Default; // surround mode
+ aConfig.stereo.bassMode = BM_None; // bass management
+
+ // SPDIF connection configuration
+ // **************************************
+ aConfig.spdif.bitstream.status = CS_Disconnected;
+ aConfig.spdif.bitstream.formats = AUDIO_MTYPE_TO_BITMASK(MTYPE_ELEM_PCM);
+ aConfig.spdif.bitstream.formatParamTab[MTYPE_ELEM_PCM - MTYPE_ELEM_AUDIO_FIRST].samplingRates = default_samplingRates;
+ aConfig.spdif.bitstream.formatParamTab[MTYPE_ELEM_PCM - MTYPE_ELEM_AUDIO_FIRST].maxBitrate = 7;
+ if (ac3passthrough)
+ {
+ aConfig.spdif.bitstream.formats |= AUDIO_MTYPE_TO_BITMASK(MTYPE_ELEM_AC3);
+ aConfig.spdif.bitstream.formatParamTab[MTYPE_ELEM_AC3 - MTYPE_ELEM_AUDIO_FIRST].samplingRates = default_samplingRates;
+ aConfig.spdif.bitstream.formatParamTab[MTYPE_ELEM_AC3 - MTYPE_ELEM_AUDIO_FIRST].maxBitrate = 512000;
+ }
+ if (dtspassthrough)
+ {
+ aConfig.spdif.bitstream.formats |= AUDIO_MTYPE_TO_BITMASK(MTYPE_ELEM_DTS);
+ aConfig.spdif.bitstream.formatParamTab[MTYPE_ELEM_DTS - MTYPE_ELEM_AUDIO_FIRST].samplingRates = default_samplingRates;
+ aConfig.spdif.bitstream.formatParamTab[MTYPE_ELEM_DTS - MTYPE_ELEM_AUDIO_FIRST].maxBitrate = 512000;
+ }
+ if (aacpassthrough)
+ {
+ aConfig.spdif.bitstream.formats |= AUDIO_MTYPE_TO_BITMASK(MTYPE_ELEM_AAC);
+ aConfig.spdif.bitstream.formatParamTab[MTYPE_ELEM_AAC - MTYPE_ELEM_AUDIO_FIRST].samplingRates = default_samplingRates;
+ aConfig.spdif.bitstream.formatParamTab[MTYPE_ELEM_AAC - MTYPE_ELEM_AUDIO_FIRST].maxBitrate = 512000;
+ }
+ aConfig.spdif.bitstream.pcmChannels = CCf_LR; // 2 PCM channels
+ aConfig.spdif.bitstream.pcmRate = 48000; // max sample rate on PCM link
+ aConfig.spdif.bitstream.preserveOriginalBitstream = 1; // preserve original bitstream
+ aConfig.spdif.bitstream.preserveOriginalQuality = 1; // preserve original quality
+ aConfig.spdif.output.speakers = CCf_LCRSlSr; // multi-channel speaker configuration
+ aConfig.spdif.output.lfe = 1; // LFE speaker will be inferred from the field above
+ for (int i = 0; i < 8; i++)
+ aConfig.spdif.output.delay[i] = 0; // default delays
+ for (int i = 0; i < 8; i++)
+ aConfig.spdif.output.volume[i] = 0x10000000; // default volume
+ aConfig.spdif.output.surroundMode = SRND_Default; // surround mode
+ aConfig.spdif.output.bassMode = BM_None;
+ aConfig.spdif.output.centerUp = 0;
+ aConfig.spdif.output.hdmiEnable = false;
+
+ // Dynamic Range Control (valid only for applicable content formats - for example AC3)
+ aConfig.drc.boost = 0x10000000; // default scaleLo
+ aConfig.drc.cut = 0x10000000; // default scaleHi
+ aConfig.drc.partComp = 0x10000000; // default scalePCM
+ aConfig.drc.dialogRef = 11; // compression type (magic value. COMP_digital = (10 + CompMode_digital) where CompMode_digital = 1;
+
+ // dual mode (for 2 channel sources only)
+ aConfig.dualMode = DM_Stereo;
+ //aConfig.dualMode = DM_MixMono;
+ //aConfig.dualMode = DM_LeftMono;
+ //aConfig.dualMode = DM_RightMono;
+
+ // SRS Labs TruSurround HD (optional) parameters
+ aConfig.srsTruSurroundHd.mode = SSRSParams::SRS_Disabled;
+
+ // now that all audio outputs are setup, enable the user selection
+ switch(g_guiSettings.GetInt("audiooutput.mode"))
+ {
+ case AUDIO_HDMI:
+ // detected automatically
+ aConfig.hdmi.bitstream.status = CS_Unknown;
+ break;
+ case AUDIO_IEC958:
+ aConfig.spdif.bitstream.status = CS_Connected;
+ break;
+ case AUDIO_ANALOG:
+ aConfig.stereo.status = CS_Connected;
+ break;
+ }
+
+ DFBResult res = m_amp->SetConfiguration(m_amp, NULL, &aConfig);
+ if (res != DFB_OK)
+ CLog::Log(LOGDEBUG, "CSMPPlayer::SetupAudioRendering:Could not SetConfiguration");
+}
+
bool CSMPPlayer::WaitForAmpStopped(int timeout_ms)
{
bool rtn = false;
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index c46b2d8..ba8aa9b 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -142,6 +142,7 @@ protected:
virtual void Process();
private:
+ void SetupAudioOutput();
bool WaitForAmpStopped(int timeout_ms);
bool WaitForAmpPlaying(int timeout_ms);
bool WaitForAmpOpenMedia(int timeout_ms);
https://github.com/xbmc/xbmc/commit/09b921a1d69bad1108a114f22a5320a697fc7a83
commit 09b921a1d69bad1108a114f22a5320a697fc7a83
Author: theuni <theuni-nospam-@...>
Date: Mon Dec 26 18:46:31 2011 -0500
[smp] disable dxt textures on default skin
Speeds up window transitions a reasonable amount.
diff --git a/addons/skin.confluence/media/Makefile.in b/addons/skin.confluence/media/Makefile.in
index 52a040e..ef0e3b0 100644
--- a/addons/skin.confluence/media/Makefile.in
+++ b/addons/skin.confluence/media/Makefile.in
@@ -10,7 +10,7 @@ all: $(TARGET)
.PHONY: force
$(TARGET): $(XBMCTEX) $(IMAGES)
- $(XBMCTEX) -input . -output $(TARGET)
+ $(XBMCTEX) -use_none -input . -output $(TARGET)
$(XBMCTEX): force
$(MAKE) -C @abs_top_srcdir@...
https://github.com/xbmc/xbmc/commit/9c83c7f71c87289619478141dfd571874489b601
commit 9c83c7f71c87289619478141dfd571874489b601
Author: davilla <davilla@...>
Date: Mon Dec 26 11:45:21 2011 -0500
[smp] fixed logic typo
diff --git a/xbmc/storage/DetectDVDType.cpp b/xbmc/storage/DetectDVDType.cpp
index 4b60cf4..14e6bef 100755
--- a/xbmc/storage/DetectDVDType.cpp
+++ b/xbmc/storage/DetectDVDType.cpp
@@ -89,7 +89,7 @@ void CDetectDVDMedia::Process()
{
// for apple - currently disable this check since cdio will return null if no media is loaded
// note: drive detect callbacks are not working under sigma so we bypass this also.
-#if !defined(__APPLE__) || !defined(HAS_SIGMASMP)
+#if !defined(__APPLE__) && !defined(HAS_SIGMASMP)
//Before entering loop make sure we actually have a CDrom drive
CdIo_t *p_cdio = m_cdio->cdio_open(NULL, DRIVER_DEVICE);
if (p_cdio == NULL)
https://github.com/xbmc/xbmc/commit/1f5d0a5f1059b6cec3d1bd29c4fd494f3a6d5c82
commit 1f5d0a5f1059b6cec3d1bd29c4fd494f3a6d5c82
Author: theuni <theuni-nospam-@...>
Date: Fri Dec 23 17:22:35 2011 -0500
[smp] specify default players so that they can be overridden in advancedsettings
diff --git a/system/playercorefactory.xml b/system/playercorefactory.xml
index 66784de..264ef20 100644
--- a/system/playercorefactory.xml
+++ b/system/playercorefactory.xml
@@ -10,17 +10,17 @@
</players>
<rules name="system rules">
- <rule name="rtv" protocols="rtv" player="DVDPlayer" />
- <rule name="hdhomerun/myth/rtmp/mms/udp" protocols="hdhomerun|myth|cmyth|rtmp|mms|mmsh|udp" player="DVDPlayer" />
- <rule name="lastfm/shout" protocols="lastfm|shout" player="PAPlayer" />
+ <rule name="rtv" protocols="rtv" player="defaultplayer" />
+ <rule name="hdhomerun/myth/rtmp/mms/udp" protocols="hdhomerun|myth|cmyth|rtmp|mms|mmsh|udp" player="defaultplayer" />
+ <rule name="lastfm/shout" protocols="lastfm|shout" player="audiodefaultplayer" />
<!-- dvdplayer can play standard rtsp streams -->
- <rule name="rtsp" protocols="rtsp" filetypes="!(rm|ra)" player="PAPlayer" />
+ <rule name="rtsp" protocols="rtsp" filetypes="!(rm|ra)" player="audiodefaultplayer" />
<!-- Internet streams -->
<rule name="streams" internetstream="true">
- <rule name="flv/aacp/sdp" mimetypes="video/x-flv|video-flv|audio/aacp|application/sdp" player="DVDPlayer" />
- <rule name="mp2" mimetypes="application/octet-stream" filetypes="mp2" player="PAPlayer" />
+ <rule name="flv/aacp/sdp" mimetypes="video/x-flv|video-flv|audio/aacp|application/sdp" player="defaultplayer" />
+ <rule name="mp2" mimetypes="application/octet-stream" filetypes="mp2" player="audiodefaultplayer" />
</rule>
<!-- DVDs -->
@@ -29,9 +29,9 @@
<rule name="dvdimage" dvdimage="true" player="videodefaultdvdplayer" />
<!-- Only dvdplayer can handle these normally -->
- <rule name="sdp/asf" filetypes="sdp|asf" player="DVDPlayer" />
+ <rule name="sdp/asf" filetypes="sdp|asf" player="defaultplayer" />
<!-- Pass these to dvdplayer as we do not know if they are audio or video -->
- <rule name="nsv" filetypes="nsv" player="DVDPlayer" />
+ <rule name="nsv" filetypes="nsv" player="defaultplayer" />
</rules>
</playercorefactory>
https://github.com/xbmc/xbmc/commit/7bf405fcc930f1b24ab64f16ba10feab26cc3d19
commit 7bf405fcc930f1b24ab64f16ba10feab26cc3d19
Author: theuni <theuni-nospam-@...>
Date: Fri Dec 23 17:10:17 2011 -0500
Revert "[smp] default to smpplayer"
This reverts commit 627384e42e81bc8fc3bdf10f722e03800516bf17.
Handle in advancedsettings instead.
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp
index d0564a8..a543f7b 100644
--- a/xbmc/settings/AdvancedSettings.cpp
+++ b/xbmc/settings/AdvancedSettings.cpp
@@ -62,11 +62,6 @@ void CAdvancedSettings::Initialize()
m_karaokeAlwaysEmptyOnCdgs = 1;
m_karaokeUseSongSpecificBackground = 0;
-#if defined (HAS_SIGMASMP)
- m_audioDefaultPlayer = "smpplayer";
-#else
- m_audioDefaultPlayer = "paplayer";
-#endif
m_audioDefaultPlayer = "paplayer";
m_audioPlayCountMinimumPercent = 90.0f;
m_audioHost = "default";
@@ -88,13 +83,8 @@ void CAdvancedSettings::Initialize()
m_videoBlackBarColour = 0;
m_videoPPFFmpegDeint = "linblenddeint";
m_videoPPFFmpegPostProc = "ha:128:7,va,dr";
-#if defined (HAS_SIGMASMP)
- m_videoDefaultPlayer = "smpplayer";
- m_videoDefaultDVDPlayer = "smpplayer";
-#else
m_videoDefaultPlayer = "dvdplayer";
m_videoDefaultDVDPlayer = "dvdplayer";
-#endif
m_videoIgnoreSecondsAtStart = 3*60;
m_videoIgnorePercentAtEnd = 8.0f;
m_videoPlayCountMinimumPercent = 90.0f;
https://github.com/xbmc/xbmc/commit/d3ddd00043b262d1fbd7ec23f0bd2b04aa66082c
commit d3ddd00043b262d1fbd7ec23f0bd2b04aa66082c
Author: theuni <theuni-nospam-@...>
Date: Fri Dec 23 17:09:48 2011 -0500
Revert "[smp] fix default audio player"
This reverts commit cb50ce82cb7216897a9aca713666ec98407e14bf.
Handle in advancedsettings instead.
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp
index a09d726..d0564a8 100644
--- a/xbmc/settings/AdvancedSettings.cpp
+++ b/xbmc/settings/AdvancedSettings.cpp
@@ -67,6 +67,7 @@ void CAdvancedSettings::Initialize()
#else
m_audioDefaultPlayer = "paplayer";
#endif
+ m_audioDefaultPlayer = "paplayer";
m_audioPlayCountMinimumPercent = 90.0f;
m_audioHost = "default";
https://github.com/xbmc/xbmc/commit/d4848ec99a3d91cdd746b8443c765b4214133eae
commit d4848ec99a3d91cdd746b8443c765b4214133eae
Author: theuni <theuni-nospam-@...>
Date: Fri Dec 23 16:06:25 2011 -0500
[smp] temporary fix for input-key handling.
Ignore unknown (or unnecessary) keys rather than sending an Unknown key. This
fixes modifier behavior for now, but this handling needs to be redone
completely.
diff --git a/xbmc/windowing/dfb/WinEventsDFB.cpp b/xbmc/windowing/dfb/WinEventsDFB.cpp
index 1c6834b..90a1d71 100755
--- a/xbmc/windowing/dfb/WinEventsDFB.cpp
+++ b/xbmc/windowing/dfb/WinEventsDFB.cpp
@@ -171,7 +171,7 @@ bool CWinEventsDFB::MessagePump()
break;
default:
CLog::Log(LOGDEBUG, "CWinEventsDFB::MessagePump unknown key(%d)", event.input.key_symbol);
- newEvent.key.keysym.sym = (XBMCKey)XBMCK_UNKNOWN;
+ return false;
break;
}
}
https://github.com/xbmc/xbmc/commit/83f90152c19b8acf0610a7468a6babd63cb5de8c
commit 83f90152c19b8acf0610a7468a6babd63cb5de8c
Author: davilla <davilla@...>
Date: Fri Dec 23 13:56:48 2011 -0500
[smp] various sigma fixes
diff --git a/xbmc/storage/DetectDVDType.cpp b/xbmc/storage/DetectDVDType.cpp
old mode 100644
new mode 100755
index 5e185c7..4b60cf4
--- a/xbmc/storage/DetectDVDType.cpp
+++ b/xbmc/storage/DetectDVDType.cpp
@@ -88,7 +88,8 @@ void CDetectDVDMedia::OnStartup()
void CDetectDVDMedia::Process()
{
// for apple - currently disable this check since cdio will return null if no media is loaded
-#ifndef __APPLE__
+// note: drive detect callbacks are not working under sigma so we bypass this also.
+#if !defined(__APPLE__) || !defined(HAS_SIGMASMP)
//Before entering loop make sure we actually have a CDrom drive
CdIo_t *p_cdio = m_cdio->cdio_open(NULL, DRIVER_DEVICE);
if (p_cdio == NULL)
@@ -427,8 +428,10 @@ DWORD CDetectDVDMedia::GetTrayState()
m_cdio->cdio_destroy(cdio);
}
else
+ {
+ m_dwLastTrayState = DRIVE_NOT_READY;
return DRIVE_NOT_READY;
-
+ }
#endif // USING_CDIO78
#endif // _LINUX
diff --git a/xbmc/storage/MediaManager.cpp b/xbmc/storage/MediaManager.cpp
old mode 100644
new mode 100755
index b78bee5..b0f0ab2
--- a/xbmc/storage/MediaManager.cpp
+++ b/xbmc/storage/MediaManager.cpp
@@ -501,6 +501,10 @@ bool CMediaManager::HashDVD(const CStdString& dvdpath, uint32_t& crc)
CFileItemList vecItemsTS;
bool success = false;
+#if defined(HAS_SIGMASMP)
+ // On sigmal, this breaks DVDs with CSS
+ return false;
+#endif
// first try to open the VIDEO_TS folder of the DVD
if (!CDirectory::GetDirectory( dvdpath, vecItemsTS, ".ifo" ))
{
diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp
old mode 100644
new mode 100755
index 584e948..4406114
--- a/xbmc/utils/URIUtils.cpp
+++ b/xbmc/utils/URIUtils.cpp
@@ -519,7 +519,15 @@ bool URIUtils::IsDVD(const CStdString& strFile)
#else
CStdString strFileLow = strFile;
strFileLow.MakeLower();
- if (strFileLow == "d:/" || strFileLow == "d:\\" || strFileLow == "d:" || strFileLow == "iso9660://" || strFileLow == "udf://" || strFileLow == "dvd://1" )
+ if (strFileLow == "d:/" ||
+ strFileLow == "d:\\" ||
+ strFileLow == "d:" ||
+ strFileLow == "iso9660://" ||
+#if defined(HAS_SIGMASMP)
+ strFileLow == "iso9660://video_ts/video_ts.ifo" ||
+#endif
+ strFileLow == "udf://" ||
+ strFileLow == "dvd://1" )
return true;
#endif
https://github.com/xbmc/xbmc/commit/3fd64db02a3f36ee66a4309b06894f623b8fc934
commit 3fd64db02a3f36ee66a4309b06894f623b8fc934
Merge: f249b01 22ad8e4
Author: theuni <theuni-nospam-@...>
Date: Fri Dec 23 02:31:40 2011 -0500
Merge remote-tracking branch 'origin/Eden' into xbmc-buildroot
Conflicts:
Makefile.in
xbmc/rendering/gles/RenderSystemGLES.h
diff --cc Makefile.in
index 269cff4,9d850e4..122af68
mode 100644,100755..100755
--- a/Makefile.in
+++ b/Makefile.in
@@@ -1,105 -1,5 +1,4 @@@
AUTOGENERATED_MAKEFILES=@OUTPUT_FILES@
- BIN_DIRS= \
- xbmc/guilib \
- lib/tinyXML \
- xbmc \
- xbmc/addons \
- xbmc/cdrip \
- xbmc/cores \
- xbmc/cores/DllLoader \
- xbmc/cores/DllLoader/exports \
- xbmc/cores/DllLoader/exports/util \
- xbmc/cores/dvdplayer \
- xbmc/cores/dvdplayer/DVDCodecs \
- xbmc/cores/dvdplayer/DVDCodecs/Audio \
- xbmc/cores/dvdplayer/DVDCodecs/Overlay \
- xbmc/cores/dvdplayer/DVDCodecs/Video \
- xbmc/cores/dvdplayer/DVDDemuxers/ \
- xbmc/cores/dvdplayer/DVDInputStreams/ \
- xbmc/cores/dvdplayer/DVDSubtitles/ \
- xbmc/cores/paplayer \
- xbmc/cores/AudioRenderers \
- xbmc/cores/VideoRenderers \
- xbmc/cores/VideoRenderers/VideoShaders \
- xbmc/cores/ExternalPlayer \
- xbmc/cores/smpplayer \
- xbmc/cores/playercorefactory \
- xbmc/filesystem \
- xbmc/filesystem/MusicDatabaseDirectory \
- xbmc/filesystem/VideoDatabaseDirectory \
- xbmc/dialogs \
- xbmc/music \
- xbmc/music/dialogs \
- xbmc/music/infoscanner \
- xbmc/music/karaoke \
- xbmc/music/tags \
- xbmc/music/windows \
- xbmc/pictures \
- xbmc/programs \
- xbmc/video \
- xbmc/video/dialogs \
- xbmc/video/windows \
- xbmc/windows \
- xbmc/network \
- xbmc/network/libscrobbler \
- xbmc/network/linux \
- xbmc/network/osx \
- xbmc/playlists \
- xbmc/powermanagement \
- xbmc/powermanagement/linux \
- xbmc/rendering \
- xbmc/storage \
- xbmc/storage/linux \
- xbmc/storage/osx \
- lib/libhts \
- xbmc/interfaces \
- xbmc/interfaces/http-api \
- xbmc/interfaces/info \
- xbmc/interfaces/json-rpc \
- xbmc/interfaces/python \
- xbmc/interfaces/python/xbmcmodule \
- lib/libRTV \
- lib/libUPnP \
- lib/libXDAAP \
- xbmc/dbwrappers \
- lib/UnrarXLib \
- lib/libsquish \
- lib/SlingboxLib \
- xbmc/visualizations \
- xbmc/screensavers \
- xbmc/utils \
- xbmc/settings \
- xbmc/linux \
- xbmc/input \
- xbmc/input/linux \
- xbmc/osx \
- xbmc/threads \
- xbmc/windowing \
- xbmc/peripherals \
- xbmc/peripherals/bus \
- xbmc/peripherals/devices \
- xbmc/peripherals/dialogs \
--
- ifeq (@USE_OPENGL@...)
- BIN_DIRS += xbmc/rendering/gl
- endif
- ifeq (@USE_OPENGLES@...)
- BIN_DIRS += xbmc/rendering/gles
- BIN_DIRS += xbmc/windowing/egl
- endif
- ifeq (@USE_DIRECTFB@...)
- BIN_DIRS += xbmc/windowing/dfb
- endif
-
- ifeq ($(findstring osx,@ARCH@...)
- BIN_DIRS += xbmc/network/osx
- BIN_DIRS += xbmc/storage/osx
- BIN_DIRS += xbmc/powermanagement/osx
- BIN_DIRS += xbmc/windowing/osx
- else
- BIN_DIRS += xbmc/windowing/X11
- endif
-
EC_DIRS= \
tools/EventClients
@@@ -119,6 -19,100 +18,105 @@@ DVDPLAYER_ARCHIVES=xbmc/cores/dvdplayer
xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreams.a \
xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitles.a
+ DIRECTORY_ARCHIVES=$(DVDPLAYER_ARCHIVES) \
+ lib/SlingboxLib/SlingboxLib.a \
+ lib/libRTV/librtv.a \
+ lib/libUPnP/libupnp.a \
+ lib/libXDAAP/libxdaap.a \
+ lib/libhts/libhts.a \
+ lib/libsquish/libsquish.a \
+ lib/tinyXML/tinyxml.a \
+ lib/xbmc-dll-symbols/dll-symbols.a \
+ xbmc/addons/addons.a \
+ xbmc/cdrip/cdrip.a \
+ xbmc/cores/AudioRenderers/audiorenderers.a \
+ xbmc/cores/DllLoader/dllloader.a \
+ xbmc/cores/DllLoader/exports/exports.a \
+ xbmc/cores/DllLoader/exports/util/exports_utils.a \
+ xbmc/cores/ExternalPlayer/ExternalPlayer.a \
+ xbmc/cores/VideoRenderers/VideoRenderer.a \
+ xbmc/cores/VideoRenderers/VideoShaders/VideoShaders.a \
+ xbmc/cores/cores.a \
+ xbmc/cores/paplayer/paplayer.a \
++ xbmc/cores/smpplayer/SMPPlayer.a \
+ xbmc/cores/playercorefactory/playercorefactory.a \
+ xbmc/dbwrappers/dbwrappers.a \
+ xbmc/dialogs/dialogs.a \
+ xbmc/filesystem/MusicDatabaseDirectory/musicdatabasedirectory.a \
+ xbmc/filesystem/VideoDatabaseDirectory/videodatabasedirectory.a \
+ xbmc/filesystem/filesystem.a \
+ xbmc/guilib/guilib.a \
+ xbmc/input/input.a \
+ xbmc/interfaces/http-api/http-api.a \
+ xbmc/interfaces/info/info.a \
+ xbmc/interfaces/interfaces.a \
+ xbmc/interfaces/json-rpc/json-rpc.a \
+ xbmc/interfaces/python/python.a \
+ xbmc/interfaces/python/xbmcmodule/xbmcmodule.a \
+ xbmc/linux/linux.a \
+ xbmc/music/dialogs/musicdialogs.a \
+ xbmc/music/infoscanner/musicscanner.a \
+ xbmc/music/karaoke/karaoke.a \
+ xbmc/music/music.a \
+ xbmc/music/tags/musictags.a \
+ xbmc/music/windows/musicwindows.a \
+ xbmc/network/libscrobbler/scrobbler.a \
+ xbmc/network/network.a \
+ xbmc/peripherals/bus/peripheral-bus.a \
+ xbmc/peripherals/devices/peripheral-devices.a \
+ xbmc/peripherals/dialogs/peripheral-dialogs.a \
+ xbmc/peripherals/peripherals.a \
+ xbmc/pictures/pictures.a \
+ xbmc/playlists/playlists.a \
+ xbmc/powermanagement/powermanagement.a \
+ xbmc/programs/programs.a \
+ xbmc/rendering/rendering.a \
+ xbmc/settings/settings.a \
+ xbmc/storage/storage.a \
+ xbmc/threads/threads.a \
+ xbmc/utils/utils.a \
+ xbmc/video/dialogs/videodialogs.a \
+ xbmc/video/video.a \
+ xbmc/video/windows/videowindows.a \
+ xbmc/windowing/windowing.a \
+ xbmc/windows/windows.a \
+ xbmc/xbmc.a \
+
+
+ ifeq (@USE_OPENGL@...)
+ DIRECTORY_ARCHIVES += xbmc/rendering/gl/rendering_gl.a
+ endif
+
+ ifeq (@USE_OPENGLES@...)
+ DIRECTORY_ARCHIVES += xbmc/rendering/gles/rendering_gles.a
+ DIRECTORY_ARCHIVES += xbmc/windowing/egl/windowing_egl.a
+ endif
+
++ifeq (@USE_DIRECTFB@...)
++DIRECTORY_ARCHIVES += xbmc/windowing/dfb/windowing_dfb.a
++endif
++
+ ifeq ($(findstring osx,@ARCH@...)
+ DIRECTORY_ARCHIVES += xbmc/osx/osx.a
+ DIRECTORY_ARCHIVES += xbmc/network/osx/network.a
+ DIRECTORY_ARCHIVES += xbmc/network/linux/network_linux.a
+ DIRECTORY_ARCHIVES += xbmc/powermanagement/osx/powermanagement.a
+ DIRECTORY_ARCHIVES += xbmc/storage/osx/storage.a
+ DIRECTORY_ARCHIVES += xbmc/windowing/osx/windowing_osx.a
+ else
+ DIRECTORY_ARCHIVES += xbmc/input/linux/input_linux.a
+ DIRECTORY_ARCHIVES += xbmc/network/linux/network_linux.a
+ DIRECTORY_ARCHIVES += xbmc/powermanagement/linux/powermanagement_linux.a
+ DIRECTORY_ARCHIVES += xbmc/storage/linux/storage_linux.a
+ DIRECTORY_ARCHIVES += xbmc/windowing/X11/windowing_X11.a
+ endif
+
+ ifeq (@HAVE_XBMC_NONFREE@...)
+ DIRECTORY_ARCHIVES += lib/UnrarXLib/UnrarXLib.a
+ endif
+
+ BIN_DIRS = $(dir $(DIRECTORY_ARCHIVES))
+
PAPCODECS_DIRS= \
lib/xbadpcm \
lib/nosefart \
diff --cc configure.in
index 7a9969c,bca9239..f63b780
--- a/configure.in
+++ b/configure.in
@@@ -608,13 -589,15 +610,17 @@@ elif test "$use_arch" = "arm"; the
CXXFLAGS="$CXXFLAGS -Wa,-march=armv6 -mtune=cortex-a8 -mthumb-interwork"
use_cpu=cortex-a8])
else
- # Compile for ARMv7a architecture, CortexA8 cpu and NEON coprocessor
- CFLAGS+=" -Wa,-march=armv7a -mcpu=cortex-a8 -mfpu=neon -mvectorize-with-neon-quad"
- CXXFLAGS+=" -Wa,-march=armv7a -mcpu=cortex-a8 -mfpu=neon -mvectorize-with-neon-quad"
- FFMPEG_EXTRACFLAGS+=" -mfpu=neon"
+ # Compile for ARMv7a architecture, CortexA8 cpu and check for enabled NEON coprocessor
+ CFLAGS="$CFLAGS -Wa,-march=armv7a -mcpu=cortex-a8"
+ CXXFLAGS="$CXXFLAGS -Wa,-march=armv7a -mcpu=cortex-a8"
+ if test "$use_neon" = "yes"; then
+ CFLAGS="$CFLAGS -mfpu=neon -mvectorize-with-neon-quad"
+ CXXFLAGS="$CXXFLAGS -mfpu=neon -mvectorize-with-neon-quad"
+ FFMPEG_EXTRACFLAGS="$FFMPEG_EXTRACFLAGS -mfpu=neon"
+ fi
fi
+elif expr "X$host_cpu" : 'Xmips.*' > /dev/null; then
+ use_arch=mips
fi
# Checks for library functions.
diff --cc xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
index fb2fb10,cf3a15e..7d7ce26
mode 100755,100644..100755
--- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
diff --cc xbmc/rendering/gles/RenderSystemGLES.h
index 372755e,d7690b6..ebe1b7d
--- a/xbmc/rendering/gles/RenderSystemGLES.h
+++ b/xbmc/rendering/gles/RenderSystemGLES.h
@@@ -114,9 -104,9 +116,13 @@@ protected
CGUIShader **m_pGUIshader; // One GUI shader for each method
ESHADERMETHOD m_method; // Current GUI Shader method
+ GLfloat m_view[16];
+ GLfloat m_projection[16];
+ GLint m_viewPort[4];
++
+ GLuint m_vbo_texture_index;
+ GLuint m_vbo_font_index;
+ unsigned int m_font_ibo_size;
};
#endif // RENDER_SYSTEM_H
https://github.com/xbmc/xbmc/commit/f249b01dc588ce8f2714f61f4f0fc45f355427e6
commit f249b01dc588ce8f2714f61f4f0fc45f355427e6
Author: davilla <davilla@...>
Date: Thu Dec 22 15:32:53 2011 -0500
[smp] add flv
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index b8a8131..102895a 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -175,6 +175,8 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_ASF;
else if (extension.Equals(".avi"))
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_AVI;
+ else if (extension.Equals(".flv"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_FLV;
else if (extension.Equals(".mkv"))
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MKV;
else if (extension.Equals(".mp4"))
https://github.com/xbmc/xbmc/commit/37402c529fb7d05c0fb73692286ea6a2affb0e81
commit 37402c529fb7d05c0fb73692286ea6a2affb0e81
Author: davilla <davilla@...>
Date: Thu Dec 22 15:23:32 2011 -0500
[smp] fixed hang if we timeout
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index e5acf8e..b8a8131 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1351,6 +1351,7 @@ void CSMPPlayer::Process()
CLog::Log(LOGERROR, "CSMPPlayer::Process Exception thrown");
}
+ m_ready.Set();
// we are done, hide the mainvideo layer.
ShowMainVideo(false);
if (m_amp)
https://github.com/xbmc/xbmc/commit/f031d04e2375b8d9e91f3f8b1f0f854cd75b4afe
commit f031d04e2375b8d9e91f3f8b1f0f854cd75b4afe
Author: davilla <davilla@...>
Date: Thu Dec 22 15:06:37 2011 -0500
[smp] cosmetic var rename
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 6fee090..e5acf8e 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -141,11 +141,11 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
std::string ids_url;
SMediaFormat format = { 0 };
- CStdString filepath(m_item.GetPath());
+ CStdString itempath(m_item.GetPath());
// default to hinting container type
CStdString extension;
- extension = URIUtils::GetExtension(filepath);
+ extension = URIUtils::GetExtension(itempath);
if (m_item.IsDVD())
{
// raw dvd (dvd://), pass the device path (/dev/rs0/) into amp
@@ -159,11 +159,11 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
m_dvd_mediatype = true;
format.mediaType = MTYPE_APP_DVD;
// strip if present, amp only wants to see ".../VIDEO_TS/" for path.
- if (filepath.Right(strlen("/VIDEO_TS/VIDEO_TS.IFO")).Equals("/VIDEO_TS/VIDEO_TS.IFO"));
- filepath = filepath.Left(filepath.size() - strlen("/VIDEO_TS/VIDEO_TS.IFO"));
- ids_url = filepath;
+ if (itempath.Right(strlen("/VIDEO_TS/VIDEO_TS.IFO")).Equals("/VIDEO_TS/VIDEO_TS.IFO"));
+ itempath = itempath.Left(itempath.size() - strlen("/VIDEO_TS/VIDEO_TS.IFO"));
+ ids_url = itempath;
}
- else if (filepath.Left(strlen("http://")).Equals("http://"))
+ else if (itempath.Left(strlen("http://")).Equals("http://"))
{
m_dvd_mediatype = false;
format.mediaType = MTYPE_APP_NONE;
@@ -206,7 +206,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
SIdsData ids;
char c_str[64];
// setup the IDataSource cookie, CloseMedia will delete it
- ids.src = new CFileIDataSource(filepath);
+ ids.src = new CFileIDataSource(itempath);
snprintf(c_str, sizeof(c_str)/sizeof(char), "ids://0x%08lx", (long unsigned int)&ids);
ids_url = c_str;
}
https://github.com/xbmc/xbmc/commit/bb1d113bb3ca5d59404623ed73923d7f270110b3
commit bb1d113bb3ca5d59404623ed73923d7f270110b3
Author: davilla <davilla@...>
Date: Thu Dec 22 15:04:26 2011 -0500
[smp] fixed crash, add more robust checks in our ids:// handler
diff --git a/xbmc/cores/smpplayer/FileIDataSource.cpp b/xbmc/cores/smpplayer/FileIDataSource.cpp
old mode 100644
new mode 100755
index fbea975..9cfe562
--- a/xbmc/cores/smpplayer/FileIDataSource.cpp
+++ b/xbmc/cores/smpplayer/FileIDataSource.cpp
@@ -95,6 +95,8 @@ uint32_t CFileIDataSource::Read(void *ch, uint32_t size, unsigned char *buf, enu
// (long unsigned int)ch, size);
unsigned int readSize;
XFILE::CFile *cfile = (XFILE::CFile*)ch;
+ if (!cfile)
+ return -1;
readSize = cfile->Read(buf, size);
if (readSize > 0)
@@ -121,6 +123,8 @@ int64_t CFileIDataSource::Seek(void *ch, int64_t pos, bool isRel, enum EDSResult
//fprintf(stderr, "CFileIDataSource::Seek, ch(0x%08lx), pos(%lld), isRel(%d)\n",
// (long unsigned int)ch, pos, isRel);
XFILE::CFile *cfile = (XFILE::CFile*)ch;
+ if (!cfile)
+ return -1;
if (pRes)
*pRes = DSRES_SOURCE_ERROR;
@@ -151,7 +155,8 @@ void CFileIDataSource::Flush(void *ch, bool internal)
CLog::Log(LOGDEBUG, "CFileIDataSource::Flush, ch(0x%08lx), internal(%d)",
(long unsigned int)ch, internal);
XFILE::CFile *cfile = (XFILE::CFile*)ch;
- cfile->Flush();
+ if (cfile)
+ cfile->Flush();
};
@@ -161,6 +166,7 @@ void CFileIDataSource::Close(void* ch)
CLog::Log(LOGDEBUG, "CFileIDataSource::Close, ch(0x%08lx)",
(long unsigned int)ch);
XFILE::CFile *cfile = (XFILE::CFile*)ch;
- cfile->Close();
+ if (cfile)
+ cfile->Close();
delete cfile;
}
https://github.com/xbmc/xbmc/commit/2f1c60745cfe9cc37b8d2e92908a8f93e20a549b
commit 2f1c60745cfe9cc37b8d2e92908a8f93e20a549b
Author: theuni <theuni-nospam-@...>
Date: Thu Dec 22 14:28:40 2011 -0500
[smp] revert part of last commit, we need these defines
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
index 4482658..d7ec15c 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -29,6 +29,11 @@ typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
#include <cdefs_lpb.h>
#ifndef NO_RED_SUPPORT
+#define RMbool bool
+#define RMuint8 uint8_t
+#define RMint16 int16_t
+#define RMuint16 uint16_t
+#define RMuint32 uint32_t
#include <cdefs_dvd.h>
#endif
https://github.com/xbmc/xbmc/commit/0a43749d8d3dbbb1ed2336ea845ef133a42cc16c
commit 0a43749d8d3dbbb1ed2336ea845ef133a42cc16c
Author: theuni <theuni-nospam-@...>
Date: Thu Dec 22 14:13:31 2011 -0500
[smp] cleanup RED_SUPPORT now that buildroot handles it
diff --git a/xbmc/cores/smpplayer/Makefile.in b/xbmc/cores/smpplayer/Makefile.in
index ee52f80..e179513 100755
--- a/xbmc/cores/smpplayer/Makefile.in
+++ b/xbmc/cores/smpplayer/Makefile.in
@@ -1,10 +1,6 @@
CXXFLAGS+= \
@DIRECTFB_CFLAGS@ \
-ifneq (@USE_SMP_RED_SUPPORT@...)
-CXXFLAGS+= -DNO_RED_SUPPORT
-endif
-
SRCS= \
FileIDataSource.cpp \
SMPMediaSpace.cpp \
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
index 2e75786..4482658 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -32,18 +32,6 @@ typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
#include <cdefs_dvd.h>
#endif
-// SMP RED dev testing
-#if 1
-#undef NO_RED_SUPPORT
-#define RMbool bool
-#define RMuint8 uint8_t
-#define RMint16 int16_t
-#define RMuint16 uint16_t
-#define RMuint32 uint32_t
-#include "dvdtypes.h"
-#include "cdefs_dvd.h"
-#endif
-
enum SMPState
{
SMP_NONE,
https://github.com/xbmc/xbmc/commit/5a4a6ba8cec6b2aa07673c87c1e25a0efeef20a6
commit 5a4a6ba8cec6b2aa07673c87c1e25a0efeef20a6
Author: davilla <davilla@...>
Date: Thu Dec 22 10:25:42 2011 -0500
[smp] fixed trick play modes
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index c95b11f..59c2a9c 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -169,13 +169,16 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
}
else if (params.playspeed > 0)
{
- cmd.lpb.cmd = LPBCmd_FAST_FORWARD;
+ if (params.playspeed > 4)
+ cmd.lpb.cmd = LPBCmd_SCAN_FORWARD;
+ else
+ cmd.lpb.cmd = LPBCmd_FAST_FORWARD;
cmd.lpb.param2.speed = params.playspeed * 1024;
}
else
{
cmd.lpb.cmd = LPBCmd_SCAN_BACKWARD;
- cmd.lpb.param2.speed = params.playspeed * 1024;
+ cmd.lpb.param2.speed = -params.playspeed * 1024;
}
break;
case SMP_STOP:
@@ -240,16 +243,19 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
{
cmd.dvd.cmd = DVDCmd_Play;
cmd.dvd.param1.speed = 1 * 1024;
+ cmd.dvd.param2.selector = 0;
}
else if (params.playspeed > 0)
{
cmd.dvd.cmd = DVDCmd_Forward_Scan;
cmd.dvd.param1.speed = params.playspeed * 1024;
+ cmd.dvd.param2.selector = 0;
}
else
{
cmd.dvd.cmd = DVDCmd_Backward_Scan;
- cmd.dvd.param1.speed = params.playspeed * 1024;
+ cmd.dvd.param1.speed = -params.playspeed * 1024;
+ cmd.dvd.param2.selector = PLAY_MODE_KEY;
}
break;
case SMP_STOP:
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index daac37e..6fee090 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1106,15 +1106,11 @@ void CSMPPlayer::ToFFRW(int iSpeed)
if (m_speed != iSpeed)
{
- // recover power of two value
- int ipower = 0;
- int ispeed = abs(iSpeed);
- while (ispeed >>= 1) ipower++;
-
UMSCommand cmd;
UMSResult res;
UMSParams params;
- params.playspeed = ipower;
+ params.playspeed = iSpeed;
+
if (m_amp && m_amp_media)
{
m_amp_media->SetupCommand(SMP_PLAY, cmd, params, res);
https://github.com/xbmc/xbmc/commit/90a1b74d1402a5a31874433d00a605337be24791
commit 90a1b74d1402a5a31874433d00a605337be24791
Author: theuni <theuni-nospam-@...>
Date: Wed Dec 21 14:28:50 2011 -0500
[smp] possible fix for crash after fe1d9f9fc15
The attrib pointer to a diffuse texture would be hanging around for the next
render (typically font) even if it was invalid. To fix, we make sure to use the
same criteria to enable as we do use to disable.
This makes the early return unnecessary. It's been removed to stay in sync with
mainline behavior.
diff --git a/xbmc/guilib/GUITextureGLES.cpp b/xbmc/guilib/GUITextureGLES.cpp
index b8675e6..7b8dce0 100644
--- a/xbmc/guilib/GUITextureGLES.cpp
+++ b/xbmc/guilib/GUITextureGLES.cpp
@@ -102,9 +102,6 @@ void CGUITextureGLES::Begin(color_t color)
void CGUITextureGLES::End()
{
- if (!m_packedVertices.size())
- return;
-
GLint posLoc = g_Windowing.GUIShaderGetPos();
GLint colLoc = g_Windowing.GUIShaderGetCol();
GLint tex0Loc = g_Windowing.GUIShaderGetCoord0();
@@ -114,7 +111,7 @@ void CGUITextureGLES::End()
glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(PackedVertex), (char*)&m_packedVertices[0] + offsetof(PackedVertex, r));
glEnableVertexAttribArray(colLoc);
}
- if(tex1Loc >= 0)
+ if(m_diffuse.size())
{
glVertexAttribPointer(tex1Loc, 2, GL_FLOAT, 0, sizeof(PackedVertex), (char*)&m_packedVertices[0] + offsetof(PackedVertex, u2));
glEnableVertexAttribArray(tex1Loc);
https://github.com/xbmc/xbmc/commit/11096ff3b7111ff1dd28c71ac7b128acba83af66
commit 11096ff3b7111ff1dd28c71ac7b128acba83af66
Author: davilla <davilla@...>
Date: Wed Dec 21 12:15:01 2011 -0500
[smp] fixed, restore http:// access
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index f887f0b..daac37e 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -163,6 +163,11 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
filepath = filepath.Left(filepath.size() - strlen("/VIDEO_TS/VIDEO_TS.IFO"));
ids_url = filepath;
}
+ else if (filepath.Left(strlen("http://")).Equals("http://"))
+ {
+ m_dvd_mediatype = false;
+ format.mediaType = MTYPE_APP_NONE;
+ }
else
{
m_dvd_mediatype = false;
https://github.com/xbmc/xbmc/commit/f70b64173b48a9ee4398eeb70daa1f08be9d0ddd
commit f70b64173b48a9ee4398eeb70daa1f08be9d0ddd
Author: davilla <davilla@...>
Date: Wed Dec 21 11:43:47 2011 -0500
[smp] delay setting starttime a bit to help amp
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 73bfa6c..f887f0b 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -355,7 +355,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
return false;
}
- // create the playing thread
+ // the playing thread
m_StopPlaying = false;
Create();
// spin the busy dialog until we are playing
@@ -364,7 +364,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
{
CGUIDialogBusy *dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
dialog->Show();
- while(!m_ready.WaitMSec(1))
+ while(!m_ready.WaitMSec(10))
g_windowManager.ProcessRenderLoop(false);
dialog->Close();
}
@@ -1245,16 +1245,6 @@ void CSMPPlayer::Process()
// restore system volume setting.
SetVolume(g_settings.m_nVolumeLevel);
- // starttime has units of seconds
- if (m_options.starttime > 1)
- {
- // BUGFIX: if we try to seek before amp renders 1st frame,
- // bad things happen.
- Sleep(100);
- SeekTime(m_options.starttime * 1000);
- WaitForAmpPlaying(1000);
- }
-
// wait until video.format.formatValid or audio.format.formatValid
WaitForAmpFormatValid(10000);
@@ -1303,6 +1293,11 @@ void CSMPPlayer::Process()
if (m_options.identify == false)
m_callback.OnPlayBackStarted();
+ // starttime has units of seconds, if we try to do this
+ // to early, it confuses amp.
+ if (m_options.starttime > 1)
+ SeekTime(m_options.starttime * 1000);
+
while (!m_bStop && !m_StopPlaying)
{
// AMP monitoring loop for automatic playback termination (250ms wait)
https://github.com/xbmc/xbmc/commit/a8e3b69f602575f2cc0d08803055962c42b72aa9
commit a8e3b69f602575f2cc0d08803055962c42b72aa9
Author: davilla <davilla@...>
Date: Wed Dec 21 10:41:23 2011 -0500
[smp] fixed volume control
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index 8b28905..c95b11f 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -204,13 +204,8 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
cmd.lpb.param2.time.Frame = 0;
break;
case SMP_SET_VOLUME:
- SAdjustment adjustment;
- // use ADJ_MIXER_VOLUME_MAIN and not ADJ_VOLUME as
- // ADJ_VOLUME will cause a complete re-init of audio decoder.
- adjustment.type = ADJ_MIXER_VOLUME_MAIN;
- adjustment.value.volume = params.volume;
cmd.lpb.cmd = (ELPBCmd)Cmd_Adjust;
- cmd.lpb.control.adjustment = &adjustment;
+ cmd.lpb.control.adjustment = ¶ms.adjustment;
break;
case SMP_SELECT_AUDIO_STREAM:
cmd.lpb.cmd = LPBCmd_SELECT_AUDIO_STREAM;
@@ -276,13 +271,8 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
// cmd.lpb.param2.time.Hour, cmd.lpb.param2.time.Minute, cmd.lpb.param2.time.Second);
break;
case SMP_SET_VOLUME:
- SAdjustment adjustment;
- // use ADJ_MIXER_VOLUME_MAIN and not ADJ_VOLUME as
- // ADJ_VOLUME will cause a complete re-init of audio decoder.
- adjustment.type = ADJ_MIXER_VOLUME_MAIN;
- adjustment.value.volume = params.volume;
cmd.dvd.cmd = (EDVDCmd)Cmd_Adjust;
- cmd.generic.control.adjustment = &adjustment;
+ cmd.generic.control.adjustment = ¶ms.adjustment;
break;
case SMP_SELECT_AUDIO_STREAM:
cmd.dvd.cmd = DVDCmd_Audio_Stream_Change;
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
index fd13af2..2e75786 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -98,8 +98,8 @@ union UMSParams
float seekpercent;
int streamindex;
int playspeed;
- uint32_t volume;
int action;
+ SAdjustment adjustment;
SLPBCmd_SubsParameters *subsparams;
};
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index f1696b4..73bfa6c 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -611,7 +611,10 @@ void CSMPPlayer::SetVolume(long nVolume)
UMSCommand cmd;
UMSResult res;
UMSParams params;
- params.volume = volume;
+ // use ADJ_MIXER_VOLUME_MAIN and not ADJ_VOLUME as
+ // ADJ_VOLUME will cause a complete re-init of audio decoder.
+ params.adjustment.type = ADJ_MIXER_VOLUME_MAIN;
+ params.adjustment.value.volume = volume;
m_amp_media->SetupCommand(SMP_SET_VOLUME, cmd, params, res);
if (m_amp->PostPresentationCmd(m_amp, &cmd.generic) != DFB_OK)
CLog::Log(LOGDEBUG, "CSMPPlayer::SetVolume:AMP command failed!");
https://github.com/xbmc/xbmc/commit/bcd68b1554d838d0d0bc01a16114ec12a2aa74c4
commit bcd68b1554d838d0d0bc01a16114ec12a2aa74c4
Author: theuni <theuni-nospam-@...>
Date: Wed Dec 21 02:54:04 2011 -0500
[smp] Use IBOs for fonts, see previous commit.
Because we don't know how many characters will be batched together, we assume
a big number (2000) and expand later on-demand.
diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp
index 30fa40a..1287aed 100755
--- a/xbmc/guilib/GUIFontTTFGL.cpp
+++ b/xbmc/guilib/GUIFontTTFGL.cpp
@@ -132,37 +132,24 @@ void CGUIFontTTFGL::End()
GLint colLoc = g_Windowing.GUIShaderGetCol();
GLint tex0Loc = g_Windowing.GUIShaderGetCoord0();
- // stack object until VBOs will be used
- std::vector<SVertex> vecVertices( 6 * (m_vertex_count / 4) );
- SVertex *vertices = &vecVertices[0];
-
- for (int i=0; i<m_vertex_count; i+=4)
- {
- *vertices++ = m_vertex[i];
- *vertices++ = m_vertex[i+1];
- *vertices++ = m_vertex[i+2];
-
- *vertices++ = m_vertex[i+1];
- *vertices++ = m_vertex[i+3];
- *vertices++ = m_vertex[i+2];
- }
-
- vertices = &vecVertices[0];
-
- glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, x));
+ glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(SVertex), (char*)m_vertex + offsetof(SVertex, x));
// Normalize color values. Does not affect Performance at all.
- glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, r));
- glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, GL_FALSE, sizeof(SVertex), (char*)vertices + offsetof(SVertex, u));
+ glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(SVertex), (char*)m_vertex + offsetof(SVertex, r));
+ glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, GL_FALSE, sizeof(SVertex), (char*)m_vertex + offsetof(SVertex, u));
glEnableVertexAttribArray(posLoc);
glEnableVertexAttribArray(colLoc);
glEnableVertexAttribArray(tex0Loc);
- glDrawArrays(GL_TRIANGLES, 0, vecVertices.size());
+ g_Windowing.InitializeFontIBO(m_vertex_count / 4);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_Windowing.GetFontIBO());
+ glDrawElements(GL_TRIANGLES, 6 * (m_vertex_count / 4), GL_UNSIGNED_SHORT, NULL);
glDisableVertexAttribArray(posLoc);
glDisableVertexAttribArray(colLoc);
glDisableVertexAttribArray(tex0Loc);
+
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
#endif
}
diff --git a/xbmc/rendering/gles/RenderSystemGLES.cpp b/xbmc/rendering/gles/RenderSystemGLES.cpp
index f23ed12..f0b43d3 100644
--- a/xbmc/rendering/gles/RenderSystemGLES.cpp
+++ b/xbmc/rendering/gles/RenderSystemGLES.cpp
@@ -70,6 +70,7 @@ bool CRenderSystemGLES::InitRenderSystem()
// Get the GLES version number
m_RenderVersionMajor = 0;
m_RenderVersionMinor = 0;
+ m_font_ibo_size = 0;
const char* ver = (const char*)glGetString(GL_VERSION);
if (ver != 0)
@@ -117,7 +118,9 @@ bool CRenderSystemGLES::InitRenderSystem()
InitialiseGUIShader();
glGenBuffers(1, (GLuint*) &m_vbo_texture_index);
+ glGenBuffers(1, (GLuint*) &m_vbo_font_index);
InitializeTextureIBO();
+ InitializeFontIBO(2000);
return true;
}
@@ -141,6 +144,30 @@ void CRenderSystemGLES::InitializeTextureIBO()
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
delete [] idx;
}
+
+void CRenderSystemGLES::InitializeFontIBO(unsigned int size)
+{
+ if (size <= m_font_ibo_size)
+ return;
+ m_font_ibo_size = size; //Enough to render 'size' characters in one draw.
+ //Resized on-demand later if necessary. 2000 by default.
+
+ GLushort *idx;
+ idx = new GLushort[6*m_font_ibo_size];
+ for (unsigned int i=0, size=0; i < 4*m_font_ibo_size; i+=4, size+=6)
+ {
+ idx[size+0] = i+0;
+ idx[size+1] = i+1;
+ idx[size+2] = i+2;
+ idx[size+3] = i+1;
+ idx[size+4] = i+3;
+ idx[size+5] = i+2;
+ }
+
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, (GLuint) m_vbo_font_index);
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof( GLushort)*6*m_font_ibo_size, idx, GL_DYNAMIC_DRAW);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+ delete [] idx;
}
bool CRenderSystemGLES::ResetRenderSystem(int width, int height, bool fullScreen, float refreshRate)
@@ -195,7 +222,7 @@ bool CRenderSystemGLES::DestroyRenderSystem()
m_pGUIshader = NULL;
}
glDeleteBuffers(1, (GLuint*) &m_vbo_texture_index);
-
+ glDeleteBuffers(1, (GLuint*) &m_vbo_font_index);
m_bRenderCreated = false;
return true;
@@ -678,4 +705,9 @@ GLuint CRenderSystemGLES::GetTextureIBO()
return m_vbo_texture_index;
}
+GLuint CRenderSystemGLES::GetFontIBO()
+{
+ return m_vbo_font_index;
+}
+
#endif
diff --git a/xbmc/rendering/gles/RenderSystemGLES.h b/xbmc/rendering/gles/RenderSystemGLES.h
index a53f8f9..372755e 100644
--- a/xbmc/rendering/gles/RenderSystemGLES.h
+++ b/xbmc/rendering/gles/RenderSystemGLES.h
@@ -87,7 +87,9 @@ public:
void SetBlending(bool blend);
void InitializeTextureIBO();
+ void InitializeFontIBO(unsigned int size);
GLuint GetTextureIBO();
+ GLuint GetFontIBO();
protected:
virtual void SetVSyncImpl(bool enable) = 0;
@@ -113,6 +115,8 @@ protected:
ESHADERMETHOD m_method; // Current GUI Shader method
GLuint m_vbo_texture_index;
+ GLuint m_vbo_font_index;
+ unsigned int m_font_ibo_size;
};
#endif // RENDER_SYSTEM_H
https://github.com/xbmc/xbmc/commit/d73f814925b05c0e9731dc42c0d15c505c056238
commit d73f814925b05c0e9731dc42c0d15c505c056238
Author: theuni <theuni-nospam-@...>
Date: Wed Dec 21 02:51:40 2011 -0500
[smp] Use static IBOs For texture render.
Textures and their borders may contain up to 36 vertices
(9 textures, 4 vertices each).
We need to reserve 9 * 6 indices to account for the conversion to triangles.
For some reason, Sigma seems happiest using IBOs combined with client-side
vertex data. Combined with the next commit, this should work around the
troublesome codepath and with any luck, prevent a driver bug from presenting.
diff --git a/xbmc/guilib/GUITextureGLES.cpp b/xbmc/guilib/GUITextureGLES.cpp
index 3281b94..b8675e6 100644
--- a/xbmc/guilib/GUITextureGLES.cpp
+++ b/xbmc/guilib/GUITextureGLES.cpp
@@ -123,20 +123,9 @@ void CGUITextureGLES::End()
glEnableVertexAttribArray(posLoc);
glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, 0, sizeof(PackedVertex), (char*)&m_packedVertices[0] + offsetof(PackedVertex, u1));
glEnableVertexAttribArray(tex0Loc);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_Windowing.GetTextureIBO());
- GLushort *idx;
- idx = new GLushort[m_packedVertices.size()*6 / 4];
- for (unsigned int i=0, size=0; i < m_packedVertices.size(); i+=4, size+=6)
- {
- idx[size+0] = i+0;
- idx[size+1] = i+1;
- idx[size+2] = i+2;
- idx[size+3] = i+2;
- idx[size+4] = i+3;
- idx[size+5] = i+0;
- }
-
- glDrawElements(GL_TRIANGLES, m_packedVertices.size()*6 / 4, GL_UNSIGNED_SHORT, idx);
+ glDrawElements(GL_TRIANGLES, m_packedVertices.size()*6 / 4, GL_UNSIGNED_SHORT, NULL);
if (m_diffuse.size())
{
@@ -149,7 +138,7 @@ void CGUITextureGLES::End()
glDisableVertexAttribArray(colLoc);
glDisableVertexAttribArray(tex0Loc);
- delete [] idx;
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
void CGUITextureGLES::Draw(float *x, float *y, float *z, const CRect &texture, const CRect &diffuse, int orientation)
diff --git a/xbmc/rendering/gles/RenderSystemGLES.cpp b/xbmc/rendering/gles/RenderSystemGLES.cpp
index 63b2c86..f23ed12 100644
--- a/xbmc/rendering/gles/RenderSystemGLES.cpp
+++ b/xbmc/rendering/gles/RenderSystemGLES.cpp
@@ -116,7 +116,31 @@ bool CRenderSystemGLES::InitRenderSystem()
InitialiseGUIShader();
+ glGenBuffers(1, (GLuint*) &m_vbo_texture_index);
+ InitializeTextureIBO();
+
return true;
+ }
+
+void CRenderSystemGLES::InitializeTextureIBO()
+{
+ GLushort *idx;
+ idx = new GLushort[6*9];
+ for (unsigned int i=0, size=0; i < 4*9; i+=4, size+=6)
+ {
+ idx[size+0] = i+0;
+ idx[size+1] = i+1;
+ idx[size+2] = i+2;
+ idx[size+3] = i+2;
+ idx[size+4] = i+3;
+ idx[size+5] = i+0;
+ }
+
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, (GLuint) m_vbo_texture_index);
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof( GLushort)*9*6, idx, GL_STATIC_DRAW);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+ delete [] idx;
+}
}
bool CRenderSystemGLES::ResetRenderSystem(int width, int height, bool fullScreen, float refreshRate)
@@ -170,6 +194,7 @@ bool CRenderSystemGLES::DestroyRenderSystem()
delete[] m_pGUIshader;
m_pGUIshader = NULL;
}
+ glDeleteBuffers(1, (GLuint*) &m_vbo_texture_index);
m_bRenderCreated = false;
@@ -648,4 +673,9 @@ GLint CRenderSystemGLES::GUIShaderGetCoord1()
return -1;
}
+GLuint CRenderSystemGLES::GetTextureIBO()
+{
+ return m_vbo_texture_index;
+}
+
#endif
diff --git a/xbmc/rendering/gles/RenderSystemGLES.h b/xbmc/rendering/gles/RenderSystemGLES.h
index 298c19b..a53f8f9 100644
--- a/xbmc/rendering/gles/RenderSystemGLES.h
+++ b/xbmc/rendering/gles/RenderSystemGLES.h
@@ -86,6 +86,9 @@ public:
void SetActiveTextureUnit(GLenum textureunit);
void SetBlending(bool blend);
+ void InitializeTextureIBO();
+ GLuint GetTextureIBO();
+
protected:
virtual void SetVSyncImpl(bool enable) = 0;
virtual bool PresentRenderImpl(const CDirtyRegionList &dirty) = 0;
@@ -108,6 +111,8 @@ protected:
CGUIShader **m_pGUIshader; // One GUI shader for each method
ESHADERMETHOD m_method; // Current GUI Shader method
+
+ GLuint m_vbo_texture_index;
};
#endif // RENDER_SYSTEM_H
https://github.com/xbmc/xbmc/commit/d852391e204d582fdecdad76b51b36bac9b4888c
commit d852391e204d582fdecdad76b51b36bac9b4888c
Author: davilla <davilla@...>
Date: Tue Dec 20 19:12:00 2011 -0500
[smp] fixed, double counting .idx subtitles
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 78c1c51..f1696b4 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -273,8 +273,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
else if (URIUtils::GetExtension(filenames[i]) == ".sub")
{
// make sure this is NOT a idx/sub pair
- CStdString strSubFile;
- if ( !CUtil::FindVobSubPair( filenames, filenames[i], strSubFile ) )
+ if ( !CUtil::IsVobSub(filenames, filenames[i]) )
{
m_subtitle_params->setSUBFrameRate = TRUE;
parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SUB;
https://github.com/xbmc/xbmc/commit/f1c7982e38af6b77bb4ee51838764ee4c15a96fa
commit f1c7982e38af6b77bb4ee51838764ee4c15a96fa
Author: davilla <davilla@...>
Date: Tue Dec 20 18:46:11 2011 -0500
[smp] changed, exclude all files that amp cannot handle
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index d79bc1a..78c1c51 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -191,7 +191,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
else if (extension.Equals(".aac"))
format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_AAC | MTYPE_CONT_UNKNOWN;
else
- format.mediaType = MTYPE_APP_UNKNOWN;
+ return false;
}
m_amp_media = new CSMPMediaSpace(m_amp, format.mediaType);
https://github.com/xbmc/xbmc/commit/1b32b35afd6beec5275c836cbaae0feda48ea248
commit 1b32b35afd6beec5275c836cbaae0feda48ea248
Author: davilla <davilla@...>
Date: Tue Dec 20 18:43:55 2011 -0500
[smp] fixed, wrong command
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 437f05a..d79bc1a 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -613,7 +613,7 @@ void CSMPPlayer::SetVolume(long nVolume)
UMSResult res;
UMSParams params;
params.volume = volume;
- m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
+ m_amp_media->SetupCommand(SMP_SET_VOLUME, cmd, params, res);
if (m_amp->PostPresentationCmd(m_amp, &cmd.generic) != DFB_OK)
CLog::Log(LOGDEBUG, "CSMPPlayer::SetVolume:AMP command failed!");
}
https://github.com/xbmc/xbmc/commit/7a1099162382b56ea89cf9f2b5b04009e8335853
commit 7a1099162382b56ea89cf9f2b5b04009e8335853
Author: davilla <davilla@...>
Date: Tue Dec 20 18:29:14 2011 -0500
[smp] add hint for .m2ts files
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index ada0bab..437f05a 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -178,6 +178,8 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
else if (extension.Equals(".mpg"))
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".m2ts"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
else if (extension.Equals(".m2t"))
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
else if (extension.Equals(".ts"))
https://github.com/xbmc/xbmc/commit/69b4e997be1e909409d37947de8c7d5d5fc0d603
commit 69b4e997be1e909409d37947de8c7d5d5fc0d603
Author: davilla <davilla@...>
Date: Tue Dec 20 15:34:48 2011 -0500
[smp] fixed, nav to dvd root menu
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index 1ea102f..8b28905 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -783,6 +783,38 @@ bool CSMPMediaSpace::MediaHasMenu()
}
//========================================================================
+bool CSMPMediaSpace::MediaSetMenu()
+{
+ bool rtn = false;
+ if (m_mediatype == MTYPE_APP_NONE)
+ {
+ return rtn;
+ }
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
+ {
+ UMSCommand cmd;
+ UMSResult res;
+ cmd.dvd.dataSize = sizeof(SDVDCommand);
+ res.dvd.dataSize = sizeof(SDVDResult);
+ cmd.dvd.mediaSpace = MEDIA_SPACE_DVD;
+ res.dvd.mediaSpace = MEDIA_SPACE_DVD;
+ // jump to the root menu
+ cmd.dvd.cmd = DVDCmd_Menu_Call;
+ cmd.dvd.param1.menuID = RM_DVD_MENU_ID_ROOT;
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
+ rtn = true;
+ return rtn;
+ }
+ else
+#endif
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ return false;
+ }
+}
+
+//========================================================================
bool CSMPMediaSpace::MediaIsInMenu(void)
{
if (m_mediatype == MTYPE_APP_NONE)
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
index d4bc821..fd13af2 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -130,6 +130,7 @@ public:
int GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo*> &chapters);
bool MediaHasMenu();
+ bool MediaSetMenu();
bool MediaIsInMenu();
void GetAudioStreamName(int iStream, CStdString &strStreamName);
void GetSubtitleName(int iStream, CStdString &strStreamName);
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 1125097..ada0bab 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1124,10 +1124,9 @@ bool CSMPPlayer::OnAction(const CAction &action)
{
if (action.GetID() == ACTION_SHOW_VIDEOMENU)
{
- //THREAD_ACTION(action);
- printf("%s: ACTION_SHOW_VIDEOMENU\n", __FUNCTION__);
- //pStream->OnMenu();
- // send a message to everyone that we've gone to the menu
+ if (m_amp && m_amp_media)
+ m_amp_media->MediaSetMenu();
+ // send a message to everyone that we've gone to the root menu
CGUIMessage msg(GUI_MSG_VIDEO_MENU_STARTED, 0, 0);
g_windowManager.SendMessage(msg);
return true;
https://github.com/xbmc/xbmc/commit/7980c761632c79e232fae3c36a559f766ac0c9b3
commit 7980c761632c79e232fae3c36a559f766ac0c9b3
Author: davilla <davilla@...>
Date: Tue Dec 20 13:20:26 2011 -0500
[smp] various small fixes
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 0a3c6d5..1125097 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1243,7 +1243,7 @@ void CSMPPlayer::Process()
SetVolume(g_settings.m_nVolumeLevel);
// starttime has units of seconds
- if (m_options.starttime > 0)
+ if (m_options.starttime > 1)
{
// BUGFIX: if we try to seek before amp renders 1st frame,
// bad things happen.
@@ -1253,7 +1253,7 @@ void CSMPPlayer::Process()
}
// wait until video.format.formatValid or audio.format.formatValid
- WaitForAmpFormatValid(2000);
+ WaitForAmpFormatValid(10000);
// drop CGUIDialogBusy dialog and release the hold in OpenFile.
m_ready.Set();
@@ -1424,7 +1424,7 @@ bool CSMPPlayer::WaitForAmpOpenMedia(int timeout_ms)
DFBEvent event;
m_amp_event->GetEvent(m_amp_event, &event);
- if (GetAmpStatus() && m_amp_media->GetStatusState() != SMP_ERROR)
+ if (GetAmpStatus() && m_amp_media->GetStatusState(true) != SMP_ERROR)
rtn = true;
}
else
@@ -1441,7 +1441,7 @@ bool CSMPPlayer::WaitForAmpFormatValid(int timeout_ms)
{
bool rtn = false;
bool isvideo = m_item.IsVideo();
- bool isaudio = m_item.IsVideo();
+ bool isaudio = m_item.IsAudio();
while (!m_bStop && !rtn && (timeout_ms > 0))
{
Sleep(100);
https://github.com/xbmc/xbmc/commit/641617b8c831e9dc0f6ee847ae0458eef6efdacf
commit 641617b8c831e9dc0f6ee847ae0458eef6efdacf
Author: davilla <davilla@...>
Date: Tue Dec 20 13:19:51 2011 -0500
[smp] returning SMP_ERROR can cause issued, only return it when we need to know
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index 797f831..1ea102f 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -393,21 +393,25 @@ bool CSMPMediaSpace::StatusUpdate()
}
//========================================================================
-int CSMPMediaSpace::GetStatusState()
+int CSMPMediaSpace::GetStatusState(bool checklastCmd)
{
- SMPState state = SMP_UNKNOWN;
- if (m_status.generic.flags & SSTATUS_MODE)
+ SMPState state = SMP_NONE;
+ if (checklastCmd)
{
- if (m_status.generic.mode.flags & SSTATUS_MODE_STOPPED)
- state = SMP_STOPPED;
- else if (m_status.generic.mode.flags & SSTATUS_MODE_PLAYING)
- state = SMP_PLAYING;
- else if (m_status.generic.mode.flags & SSTATUS_MODE_PAUSED)
- state = SMP_PAUSED;
+ if (IS_ERROR(m_status.generic.lastCmd.result))
+ state = SMP_ERROR;
+ }
+ else if (m_status.generic.flags & SSTATUS_MODE)
+ {
+ {
+ if (m_status.generic.mode.flags & SSTATUS_MODE_STOPPED)
+ state = SMP_STOPPED;
+ else if (m_status.generic.mode.flags & SSTATUS_MODE_PLAYING)
+ state = SMP_PLAYING;
+ else if (m_status.generic.mode.flags & SSTATUS_MODE_PAUSED)
+ state = SMP_PAUSED;
+ }
}
- if (IS_ERROR(m_status.generic.lastCmd.result))
- state = SMP_ERROR;
-
#if 0
printf("%s: type(%d), title(%d), chapters(%d), video(%d), audio(%d), audios(%d), spus(%d), menus(0x%x)\n", __FUNCTION__,
m_status.dvd.title.type,
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
index 9753978..d4bc821 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -46,7 +46,7 @@ typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
enum SMPState
{
- SMP_UNKNOWN,
+ SMP_NONE,
SMP_STOPPED,
SMP_PLAYING,
SMP_PAUSED,
@@ -119,7 +119,7 @@ public:
bool SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams ¶ms, UMSResult &res);
bool StatusUpdate();
- int GetStatusState();
+ int GetStatusState(bool checklastCmd = false);
bool GetStatusFormatValid(bool isvideo, bool isaudio);
void GetStatusTime(int64_t &elapsed_ms, int64_t &duration_ms);
void GetStatusVideo(int &width, int &height, int &viewmode, float &fps_numerator, float &fps_denominator);
https://github.com/xbmc/xbmc/commit/cf3a36946a0c39674873207bf31a00dd33c7672e
commit cf3a36946a0c39674873207bf31a00dd33c7672e
Author: davilla <davilla@...>
Date: Tue Dec 20 12:33:00 2011 -0500
[smp] fixed make menu key on ir remote pop up OSD but not when we are in a DVD menu
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index d0f65de..0a3c6d5 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1132,9 +1132,22 @@ bool CSMPPlayer::OnAction(const CAction &action)
g_windowManager.SendMessage(msg);
return true;
}
+ if (action.GetID() == ACTION_CONTEXT_MENU)
+ {
+ // hack around missing keymap setting
+ if (g_graphicsContext.IsFullScreenVideo())
+ {
+ g_application.OnAction(CAction(ACTION_SHOW_OSD));
+ return true;
+ }
+ }
if (IsInMenu())
{
+ // do not show OSD if in DVD menu.
+ if (action.GetID() == ACTION_SHOW_OSD)
+ return true;
+
UMSCommand cmd;
UMSResult res;
UMSParams params;
@@ -1149,7 +1162,7 @@ bool CSMPPlayer::OnAction(const CAction &action)
}
}
return false;
-};
+}
bool CSMPPlayer::IsInMenu() const
{
https://github.com/xbmc/xbmc/commit/f8264fe1dde12dc6b51b48becbc4d7183035a07c
commit f8264fe1dde12dc6b51b48becbc4d7183035a07c
Author: davilla <davilla@...>
Date: Tue Dec 20 12:32:04 2011 -0500
[smp] fixed, wrong title type
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index 0c813a2..797f831 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -788,9 +788,9 @@ bool CSMPMediaSpace::MediaIsInMenu(void)
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
{
- //printf("m_status.dvd.title.type(0x%x), m_status.dvd.mode.flags0x%x\n",
- // m_status.dvd.title.type, m_status.dvd.mode.flags);
- return ((m_status.dvd.title.type == TT_Sequential_Title) ||
+ //printf("m_status.dvd.title.type(0x%x)/(0x%x), m_status.dvd.mode.flags(0x%x)/(0x%x)\n",
+ // m_status.dvd.title.type, TT_Menu, m_status.dvd.mode.flags, SDVDSTATUS_MODE_MENU_ACTIVE);
+ return ((m_status.dvd.title.type == TT_Menu) ||
m_status.dvd.mode.flags & SDVDSTATUS_MODE_MENU_ACTIVE);
}
else
https://github.com/xbmc/xbmc/commit/fa06d3fa25e36d20d0c279343b9fd7e9056e92d0
commit fa06d3fa25e36d20d0c279343b9fd7e9056e92d0
Author: davilla <davilla@...>
Date: Tue Dec 20 12:09:11 2011 -0500
[smp] remove bogus comment
diff --git a/xbmc/windowing/dfb/WinEventsDFB.cpp b/xbmc/windowing/dfb/WinEventsDFB.cpp
index 7aaac01..1c6834b 100755
--- a/xbmc/windowing/dfb/WinEventsDFB.cpp
+++ b/xbmc/windowing/dfb/WinEventsDFB.cpp
@@ -168,7 +168,6 @@ bool CWinEventsDFB::MessagePump()
newEvent.key.keysym.sym = (XBMCKey)XBMCK_l;
break;
case DIKS_LANGUAGE:
- // XBMC_ActiveEvent
break;
default:
CLog::Log(LOGDEBUG, "CWinEventsDFB::MessagePump unknown key(%d)", event.input.key_symbol);
https://github.com/xbmc/xbmc/commit/cd86a32191affcf9634da3bfb7fc741d5b93dafe
commit cd86a32191affcf9634da3bfb7fc741d5b93dafe
Author: davilla <davilla@...>
Date: Tue Dec 20 12:08:30 2011 -0500
[smp] fixed, if no video/audio always return false
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index ae3d400..0c813a2 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -433,6 +433,8 @@ bool CSMPMediaSpace::GetStatusFormatValid(bool isvideo, bool isaudio)
return (m_status.lpb.video.format.formatValid);
else if (isaudio)
return (m_status.lpb.audio.format.formatValid);
+ else
+ return false;
}
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
https://github.com/xbmc/xbmc/commit/12262ff5d906367eaae5adac3fe6f4e3163cd2ab
commit 12262ff5d906367eaae5adac3fe6f4e3163cd2ab
Author: davilla <davilla@...>
Date: Tue Dec 20 11:57:57 2011 -0500
[smp] fixed, treat TT_Sequential_Titles as in MediaIsInMenu, that is the type of title for dealing with menus
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index 8c271e3..ae3d400 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -786,7 +786,10 @@ bool CSMPMediaSpace::MediaIsInMenu(void)
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
{
- return (m_status.dvd.mode.flags & SDVDSTATUS_MODE_MENU_ACTIVE);
+ //printf("m_status.dvd.title.type(0x%x), m_status.dvd.mode.flags0x%x\n",
+ // m_status.dvd.title.type, m_status.dvd.mode.flags);
+ return ((m_status.dvd.title.type == TT_Sequential_Title) ||
+ m_status.dvd.mode.flags & SDVDSTATUS_MODE_MENU_ACTIVE);
}
else
#endif
https://github.com/xbmc/xbmc/commit/3717281a71709444737929510f83ab35837e8b7b
commit 3717281a71709444737929510f83ab35837e8b7b
Author: davilla <davilla@...>
Date: Tue Dec 20 11:55:50 2011 -0500
[smp] paranoia, check m_amp && m_amp_media before assume the object exists
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 97fe79e..d0f65de 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -440,17 +440,19 @@ void CSMPPlayer::Pause()
if (m_paused)
{
- m_amp_media->SetupCommand(SMP_PAUSE_OFF, cmd, params, res);
+ if (m_amp_media)
+ m_amp_media->SetupCommand(SMP_PAUSE_OFF, cmd, params, res);
m_callback.OnPlayBackResumed();
}
else
{
- m_amp_media->SetupCommand(SMP_PAUSE_ON, cmd, params, res);
+ if (m_amp_media)
+ m_amp_media->SetupCommand(SMP_PAUSE_ON, cmd, params, res);
m_callback.OnPlayBackPaused();
}
m_paused = !m_paused;
- if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
+ if (m_amp && m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
CLog::Log(LOGERROR, "CSMPPlayer::Pause:AMP command failed!");
CLog::Log(LOGDEBUG, "CSMPPlayer::Pause");
}
@@ -552,13 +554,14 @@ void CSMPPlayer::Seek(bool bPlus, bool bLargeStep)
UMSResult res;
UMSParams params;
params.seektime_ms = seek_ms;
- m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
+ if (m_amp_media)
+ m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
// This will popup seek info dialog if skin supports it
//g_infoManager.SetDisplayAfterSeek(100000);
//m_callback.OnPlayBackSeek((int)seek_ms, (int)(seek_ms - m_elapsed_ms));
- if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
+ if (m_amp && m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
CLog::Log(LOGERROR, "CSMPPlayer::SeekTime:AMP command failed!");
//g_infoManager.SetDisplayAfterSeek();
@@ -578,9 +581,12 @@ void CSMPPlayer::SeekPercentage(float fPercent)
UMSResult res;
UMSParams params;
params.seekpercent = fPercent;
- m_amp_media->SetupCommand(SMP_SEEK_PERCENT, cmd, params, res);
- if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
- CLog::Log(LOGERROR, "CSMPPlayer::SeekTime:AMP command failed!");
+ if (m_amp && m_amp_media)
+ {
+ m_amp_media->SetupCommand(SMP_SEEK_PERCENT, cmd, params, res);
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::SeekTime:AMP command failed!");
+ }
}
float CSMPPlayer::GetPercentage()
@@ -651,8 +657,11 @@ void CSMPPlayer::SetAudioStream(int SetAudioStream)
UMSResult res;
UMSParams params;
params.streamindex = m_audio_index;
- m_amp_media->SetupCommand(SMP_SELECT_AUDIO_STREAM, cmd, params, res);
- m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+ if (m_amp && m_amp_media)
+ {
+ m_amp_media->SetupCommand(SMP_SELECT_AUDIO_STREAM, cmd, params, res);
+ m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+ }
//CLog::Log(LOGDEBUG, "CSMPPlayer::SetAudioStream(%d)", SetAudioStream);
}
@@ -694,9 +703,12 @@ void CSMPPlayer::SetSubTitleDelay(float fValue = 0.0f)
UMSResult res;
UMSParams params;
params.subsparams = m_subtitle_params;
- if (!(m_amp_media->SetupCommand(SMP_SET_SUBS_PARAMETERS, cmd, params, res)))
- return;
- m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+ if (m_amp && m_amp_media)
+ {
+ if (!(m_amp_media->SetupCommand(SMP_SET_SUBS_PARAMETERS, cmd, params, res)))
+ return;
+ m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+ }
}
}
@@ -745,8 +757,11 @@ void CSMPPlayer::SetSubtitle(int iStream)
UMSResult res;
UMSParams params;
params.streamindex = m_subtitle_index;
- m_amp_media->SetupCommand(SMP_SELECT_SUBTITLE_STREAM, cmd, params, res);
- m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+ if (m_amp && m_amp_media)
+ {
+ m_amp_media->SetupCommand(SMP_SELECT_SUBTITLE_STREAM, cmd, params, res);
+ m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+ }
//CLog::Log(LOGDEBUG, "CSMPPlayer::SetSubtitle(%d)", iStream);
}
@@ -780,8 +795,11 @@ void CSMPPlayer::SetSubtitleVisible(bool bVisible)
{
params.streamindex = -1;
}
- m_amp_media->SetupCommand(SMP_SELECT_SUBTITLE_STREAM, cmd, params, res);
- m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+ if (m_amp && m_amp_media)
+ {
+ m_amp_media->SetupCommand(SMP_SELECT_SUBTITLE_STREAM, cmd, params, res);
+ m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+ }
}
//CLog::Log(LOGDEBUG, "CSMPPlayer::SetSubtitleVisible(%d), m_subtitle_index(%d)", m_subtitle_show, m_subtitle_index);
}
@@ -924,13 +942,14 @@ int CSMPPlayer::SeekChapter(int chapter_index)
UMSResult res;
UMSParams params;
params.seektime_ms = seek_ms;
- m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
+ if (m_amp_media)
+ m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
// This will popup seek info dialog if skin supports it.
//g_infoManager.SetDisplayAfterSeek(100000);
//m_callback.OnPlayBackSeekChapter(GetChapter());
- if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
+ if (m_amp && m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
CLog::Log(LOGERROR, "CSMPPlayer::SeekChapter:ExecutePresentationCmd failed!");
if (IS_SUCCESS(res.generic.value))
@@ -980,13 +999,14 @@ void CSMPPlayer::SeekTime(__int64 seek_ms)
UMSResult res;
UMSParams params;
params.seektime_ms = seek_ms;
- m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
+ if (m_amp_media)
+ m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
// This will popup seek info dialog if skin supports it.
//g_infoManager.SetDisplayAfterSeek(100000);
//m_callback.OnPlayBackSeek((int)seek_ms, (int)(seek_ms - GetTime()));
- if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
+ if (m_amp && m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
CLog::Log(LOGERROR, "CSMPPlayer::SeekTime:AMP command failed!");
//g_infoManager.SetDisplayAfterSeek();
@@ -1086,10 +1106,12 @@ void CSMPPlayer::ToFFRW(int iSpeed)
UMSResult res;
UMSParams params;
params.playspeed = ipower;
- m_amp_media->SetupCommand(SMP_PLAY, cmd, params, res);
- if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
- CLog::Log(LOGERROR, "CSMPPlayer::ToFFRW:AMP command failed!");
-
+ if (m_amp && m_amp_media)
+ {
+ m_amp_media->SetupCommand(SMP_PLAY, cmd, params, res);
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::ToFFRW:AMP command failed!");
+ }
m_speed = iSpeed;
}
}
@@ -1117,10 +1139,13 @@ bool CSMPPlayer::OnAction(const CAction &action)
UMSResult res;
UMSParams params;
params.action = action.GetID();
- if (!(m_amp_media->SetupCommand(SMP_DO_ACTION, cmd, params, res)))
- return false;
- if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
- CLog::Log(LOGERROR, "CSMPPlayer::OnAction");
+ if (m_amp && m_amp_media)
+ {
+ if (!(m_amp_media->SetupCommand(SMP_DO_ACTION, cmd, params, res)))
+ return false;
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::OnAction");
+ }
}
}
return false;
@@ -1287,12 +1312,15 @@ void CSMPPlayer::Process()
UMSCommand cmd;
UMSResult res;
UMSParams params;
- m_amp_media->SetupCommand(SMP_STOP, cmd, params, res);
- if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
- CLog::Log(LOGERROR, "CSMPPlayer::Process:AMP stop command failed!");
- if (!IS_SUCCESS( ((SResult*)&res)->value ))
+ if (m_amp && m_amp_media)
{
- CLog::Log(LOGERROR, "CSMPPlayer::Process:AMP stop SResult(%d)", ((SResult*)&res)->value);
+ m_amp_media->SetupCommand(SMP_STOP, cmd, params, res);
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::Process:AMP stop command failed!");
+ if (!IS_SUCCESS( ((SResult*)&res)->value ))
+ {
+ CLog::Log(LOGERROR, "CSMPPlayer::Process:AMP stop SResult(%d)", ((SResult*)&res)->value);
+ }
}
}
}
https://github.com/xbmc/xbmc/commit/74790e7a6cc29afab01633201ac9e86f02a293df
commit 74790e7a6cc29afab01633201ac9e86f02a293df
Author: davilla <davilla@...>
Date: Tue Dec 20 11:40:30 2011 -0500
[smp] fixed subtitle switching via ir remote
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 30ade9a..97fe79e 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -645,13 +645,15 @@ void CSMPPlayer::SetAudioStream(int SetAudioStream)
{
CSingleLock lock(m_amp_command_csection);
+ m_audio_index = SetAudioStream;
+
UMSCommand cmd;
UMSResult res;
UMSParams params;
- params.streamindex = SetAudioStream;
+ params.streamindex = m_audio_index;
m_amp_media->SetupCommand(SMP_SELECT_AUDIO_STREAM, cmd, params, res);
m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
- //CLog::Log(LOGDEBUG, "CSMPPlayer::SetAudioStream");
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::SetAudioStream(%d)", SetAudioStream);
}
void CSMPPlayer::SetSubTitleDelay(float fValue = 0.0f)
@@ -712,7 +714,10 @@ int CSMPPlayer::GetSubtitleCount()
int CSMPPlayer::GetSubtitle()
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetSubtitle");
- return m_subtitle_index;
+ if (m_subtitle_show)
+ return m_subtitle_index;
+ else
+ return -1;
}
void CSMPPlayer::GetSubtitleName(int iStream, CStdString &strStreamName)
@@ -725,15 +730,24 @@ void CSMPPlayer::GetSubtitleName(int iStream, CStdString &strStreamName)
void CSMPPlayer::SetSubtitle(int iStream)
{
+ // iStream is a zero based value;
CSingleLock lock(m_amp_command_csection);
+ m_subtitle_index = iStream;
+
+ // smells like a bug, if no showing subs and we get called
+ // to set the subtitle, we are expected to update internal state
+ // but not show the subtitle.
+ if (!m_subtitle_show)
+ return;
+
UMSCommand cmd;
UMSResult res;
UMSParams params;
- params.streamindex = iStream;
+ params.streamindex = m_subtitle_index;
m_amp_media->SetupCommand(SMP_SELECT_SUBTITLE_STREAM, cmd, params, res);
m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
- //CLog::Log(LOGDEBUG, "CSMPPlayer::SetSubtitle");
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::SetSubtitle(%d)", iStream);
}
bool CSMPPlayer::GetSubtitleVisible()
@@ -749,15 +763,27 @@ void CSMPPlayer::SetSubtitleVisible(bool bVisible)
m_subtitle_show = bVisible;
g_settings.m_currentVideoSettings.m_SubtitleOn = bVisible;
- UMSCommand cmd;
- UMSResult res;
- UMSParams params;
- if (bVisible)
- params.streamindex = m_subtitle_index;
- else
- params.streamindex = -1;
- m_amp_media->SetupCommand(SMP_SELECT_SUBTITLE_STREAM, cmd, params, res);
- m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+ if (m_amp && m_amp_media)
+ {
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ if (m_subtitle_show)
+ {
+ // on startup, if asked to show subs and SetSubtitle has not
+ // been called, we are expected to switch/show the 1st subtitle
+ if (m_subtitle_index < 0 && m_subtitle_count)
+ m_subtitle_index = 0;
+ params.streamindex = m_subtitle_index;
+ }
+ else
+ {
+ params.streamindex = -1;
+ }
+ m_amp_media->SetupCommand(SMP_SELECT_SUBTITLE_STREAM, cmd, params, res);
+ m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
+ }
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::SetSubtitleVisible(%d), m_subtitle_index(%d)", m_subtitle_show, m_subtitle_index);
}
int CSMPPlayer::AddSubtitle(const CStdString& strSubPath)
https://github.com/xbmc/xbmc/commit/d810884265a54d14eeedfb0e844c447a3b94d05e
commit d810884265a54d14eeedfb0e844c447a3b94d05e
Author: davilla <davilla@...>
Date: Tue Dec 20 11:38:16 2011 -0500
[smp] hook CWinEventsDFB into CWinSystemDFB so we can control create/destroy of CWinEventsDFB
diff --git a/xbmc/windowing/dfb/WinEventsDFB.cpp b/xbmc/windowing/dfb/WinEventsDFB.cpp
old mode 100644
new mode 100755
index 12a4349..7aaac01
--- a/xbmc/windowing/dfb/WinEventsDFB.cpp
+++ b/xbmc/windowing/dfb/WinEventsDFB.cpp
@@ -25,32 +25,49 @@
#include "WinEvents.h"
#include "Application.h"
#include "WindowingFactory.h"
+#include "utils/log.h"
#include <directfb.h>
PHANDLE_EVENT_FUNC CWinEventsBase::m_pEventFunc = NULL;
-bool CWinEventsDFB::MessagePump()
+// these should be member vars but CWinEvents is used
+// in an odd way right now.
+static IDirectFB *g_dfb = NULL;
+static IDirectFBEventBuffer *g_buffer = NULL;
+static bool g_initialized = false;
+
+CWinEventsDFB::CWinEventsDFB()
{
- static IDirectFB *dfb;
- static IDirectFBEventBuffer *buffer = NULL;
- static bool m_initialized = false;
- if (!m_initialized)
+ g_dfb = g_Windowing.GetIDirectFB();
+ if (g_dfb->CreateInputEventBuffer(g_dfb, DICAPS_ALL, DFB_TRUE, &g_buffer) != DFB_OK)
{
- dfb = g_Windowing.GetIDirectFB();
- if (dfb->CreateInputEventBuffer(dfb, DICAPS_ALL, DFB_TRUE, &buffer) != DFB_OK)
- {
- fprintf(stderr, "Could not create input event buffer!!!\n");
- return false;
- }
- m_initialized=true;
+ g_dfb = NULL;
+ fprintf(stderr, "Could not create input event buffer!!!\n");
}
+ g_initialized = true;
+}
+CWinEventsDFB::~CWinEventsDFB()
+{
+ if (g_dfb && g_buffer && g_initialized)
+ {
+ g_initialized = false;
+ g_buffer->Release(g_buffer);
+ g_buffer = NULL;
+ g_dfb = NULL;
+ }
+}
+bool CWinEventsDFB::MessagePump()
+{
DFBEvent event;
bool ret = false;
- while (buffer->HasEvent(buffer) == DFB_OK)
+ if (!g_initialized)
+ return ret;
+
+ while (g_buffer && g_buffer->HasEvent(g_buffer) == DFB_OK)
{
- buffer->GetEvent(buffer, &event);
+ g_buffer->GetEvent(g_buffer, &event);
if (event.clazz != DFEC_INPUT)
return false;
@@ -150,7 +167,11 @@ bool CWinEventsDFB::MessagePump()
case DIKS_SUBTITLE:
newEvent.key.keysym.sym = (XBMCKey)XBMCK_l;
break;
+ case DIKS_LANGUAGE:
+ // XBMC_ActiveEvent
+ break;
default:
+ CLog::Log(LOGDEBUG, "CWinEventsDFB::MessagePump unknown key(%d)", event.input.key_symbol);
newEvent.key.keysym.sym = (XBMCKey)XBMCK_UNKNOWN;
break;
}
diff --git a/xbmc/windowing/dfb/WinEventsDFB.h b/xbmc/windowing/dfb/WinEventsDFB.h
old mode 100644
new mode 100755
diff --git a/xbmc/windowing/dfb/WinSystemDFB.cpp b/xbmc/windowing/dfb/WinSystemDFB.cpp
index 2d5b5dd..8555c1f 100755
--- a/xbmc/windowing/dfb/WinSystemDFB.cpp
+++ b/xbmc/windowing/dfb/WinSystemDFB.cpp
@@ -23,6 +23,7 @@
#ifdef HAS_DIRECTFB
#include "WinSystemDFB.h"
+#include "WinEventsDFB.h"
#include "utils/log.h"
#include "filesystem/SpecialProtocol.h"
#include "settings/Settings.h"
@@ -77,11 +78,17 @@ bool CWinSystemDFB::InitWindowSystem()
if (!CWinSystemBase::InitWindowSystem())
return false;
+ m_events = new CWinEventsDFB();
+
return true;
}
bool CWinSystemDFB::DestroyWindowSystem()
{
+ if (m_events)
+ delete m_events;
+ m_events = NULL;
+
if (m_dfb_screen)
m_dfb_screen->Release(m_dfb_screen);
m_dfb_screen = NULL;
@@ -160,16 +167,15 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
DFBSurfaceDescription dsc;
memset(&dsc, 0, sizeof(dsc));
// set the flags to indicate what we want to get back
- dsc.flags = (DFBSurfaceDescriptionFlags)(DSDESC_WIDTH|DSDESC_HEIGHT|DSDESC_CAPS);
- dsc.width = width;
+ dsc.caps = (DFBSurfaceCapabilities)(DSCAPS_VIDEOONLY | DSCAPS_PAGE_ALIGNED);
+ dsc.flags = (DFBSurfaceDescriptionFlags)(DSDESC_WIDTH|DSDESC_HEIGHT|DSDESC_CAPS);
+ dsc.width = width;
dsc.height = height;
- dsc.caps = (DFBSurfaceCapabilities)(DSCAPS_VIDEOONLY | DSCAPS_PAGE_ALIGNED);
dsc.pixelformat = DSPF_ARGB;
m_dfb->CreateSurface(m_dfb, &dsc, &m_dummysurface1);
m_dfb->CreateSurface(m_dfb, &dsc, &m_dummysurface2);
m_nativewindow = new DFB_WS_Window;
-
m_nativewindow->main_surface = m_dfb_surface;
m_nativewindow->magic_number = DFB_WS_2P2_MAGIC_NUMBER;
m_nativewindow->idle1_surface = m_dummysurface1;
diff --git a/xbmc/windowing/dfb/WinSystemDFB.h b/xbmc/windowing/dfb/WinSystemDFB.h
index 644d09a..502c43d 100755
--- a/xbmc/windowing/dfb/WinSystemDFB.h
+++ b/xbmc/windowing/dfb/WinSystemDFB.h
@@ -46,6 +46,7 @@ typedef struct _IDirectFBDataBuffer IDirectFBDataBuffer;
typedef struct _IDirectFBImageProvider IDirectFBImageProvider;
typedef struct DFB_WS_Window* EGLNativeWindowType;
+class CWinEventsDFB;
class CWinBindingEGL;
class CWinSystemDFB : public CWinSystemBase, public CRenderSystemGLES
@@ -92,6 +93,7 @@ protected:
IDirectFBSurface *m_dummysurface1;
IDirectFBSurface *m_dummysurface2;
DFB_WS_Window *m_nativewindow;
+ CWinEventsDFB *m_events;
};
XBMC_GLOBAL_REF(CWinSystemDFB,g_Windowing);
https://github.com/xbmc/xbmc/commit/47303b92c67e830614c877ea6227a0f5ba4c1c89
commit 47303b92c67e830614c877ea6227a0f5ba4c1c89
Author: davilla <davilla@...>
Date: Mon Dec 19 16:05:26 2011 -0500
[smp] fixed, quality what format we are waiting for in GetStatusFormatValid
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index a9439f7..8c271e3 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -423,11 +423,16 @@ int CSMPMediaSpace::GetStatusState()
return state;
}
//========================================================================
-bool CSMPMediaSpace::GetStatusFormatValid()
+bool CSMPMediaSpace::GetStatusFormatValid(bool isvideo, bool isaudio)
{
if (m_mediatype == MTYPE_APP_NONE)
{
- return (m_status.lpb.video.format.formatValid || m_status.lpb.audio.format.formatValid);
+ if (isvideo && isaudio)
+ return (m_status.lpb.video.format.formatValid && m_status.lpb.audio.format.formatValid);
+ else if (isvideo)
+ return (m_status.lpb.video.format.formatValid);
+ else if (isaudio)
+ return (m_status.lpb.audio.format.formatValid);
}
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
index c45ff1e..9753978 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -33,7 +33,7 @@ typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
#endif
// SMP RED dev testing
-#if 0
+#if 1
#undef NO_RED_SUPPORT
#define RMbool bool
#define RMuint8 uint8_t
@@ -120,7 +120,7 @@ public:
bool StatusUpdate();
int GetStatusState();
- bool GetStatusFormatValid();
+ bool GetStatusFormatValid(bool isvideo, bool isaudio);
void GetStatusTime(int64_t &elapsed_ms, int64_t &duration_ms);
void GetStatusVideo(int &width, int &height, int &viewmode, float &fps_numerator, float &fps_denominator);
int GetStatusVideoInfo(int &index, CStdString &info, CStdString &codec);
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index e535f15..30ade9a 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1373,11 +1373,12 @@ bool CSMPPlayer::WaitForAmpOpenMedia(int timeout_ms)
bool CSMPPlayer::WaitForAmpFormatValid(int timeout_ms)
{
bool rtn = false;
-
+ bool isvideo = m_item.IsVideo();
+ bool isaudio = m_item.IsVideo();
while (!m_bStop && !rtn && (timeout_ms > 0))
{
Sleep(100);
- if (GetAmpStatus() && m_amp_media->GetStatusFormatValid())
+ if (GetAmpStatus() && m_amp_media->GetStatusFormatValid(isvideo, isaudio))
rtn = true;
timeout_ms -= 100;
}
https://github.com/xbmc/xbmc/commit/667afa8233cadff372b8f286307f9b3f03e5ab08
commit 667afa8233cadff372b8f286307f9b3f03e5ab08
Author: davilla <davilla@...>
Date: Mon Dec 19 15:23:37 2011 -0500
[smp] refactor dvd handling to detect/handle physical disk
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 2cc70ad..e535f15 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -35,6 +35,7 @@
#include "settings/AdvancedSettings.h"
#include "settings/GUISettings.h"
#include "settings/Settings.h"
+#include "storage/MediaManager.h"
#include "threads/SingleLock.h"
#include "windowing/WindowingFactory.h"
#include "utils/log.h"
@@ -145,45 +146,52 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
// default to hinting container type
CStdString extension;
extension = URIUtils::GetExtension(filepath);
- if (extension.Equals(".wmv"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_ASF;
- else if (extension.Equals(".avi"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_AVI;
- else if (extension.Equals(".mkv"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MKV;
- else if (extension.Equals(".mp4"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
- else if (extension.Equals(".mov"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
- else if (extension.Equals(".mpg"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
- else if (extension.Equals(".m2t"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
- else if (extension.Equals(".ts"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
- else if (extension.Equals(".vob"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2PES;
- else if (extension.Equals(".mp3"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_MP3 | MTYPE_CONT_UNKNOWN;
- else if (extension.Equals(".aac"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_AAC | MTYPE_CONT_UNKNOWN;
+ if (m_item.IsDVD())
+ {
+ // raw dvd (dvd://), pass the device path (/dev/rs0/) into amp
+ m_dvd_mediatype = true;
+ format.mediaType = MTYPE_APP_DVD;
+ ids_url = g_mediaManager.TranslateDevicePath("");
+ }
+ else if (m_item.IsDVDFile())
+ {
+ // some type of dvd with VIDEO_TS/VIDEO_TS.IFO structure
+ m_dvd_mediatype = true;
+ format.mediaType = MTYPE_APP_DVD;
+ // strip if present, amp only wants to see ".../VIDEO_TS/" for path.
+ if (filepath.Right(strlen("/VIDEO_TS/VIDEO_TS.IFO")).Equals("/VIDEO_TS/VIDEO_TS.IFO"));
+ filepath = filepath.Left(filepath.size() - strlen("/VIDEO_TS/VIDEO_TS.IFO"));
+ ids_url = filepath;
+ }
else
{
- if (m_item.IsDVDFile())
- {
- format.mediaType = MTYPE_APP_DVD;
- // strip if present, amp only wants to see ".../VIDEO_TS/" for path.
- if (filepath.Right(strlen("/VIDEO_TS/VIDEO_TS.IFO")).Equals("/VIDEO_TS/VIDEO_TS.IFO"));
- filepath = filepath.Left(filepath.size() - strlen("/VIDEO_TS/VIDEO_TS.IFO"));
- ids_url = filepath;
- }
+ m_dvd_mediatype = false;
+ if (extension.Equals(".wmv"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_ASF;
+ else if (extension.Equals(".avi"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_AVI;
+ else if (extension.Equals(".mkv"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MKV;
+ else if (extension.Equals(".mp4"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
+ else if (extension.Equals(".mov"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
+ else if (extension.Equals(".mpg"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".m2t"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".ts"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".vob"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2PES;
+ else if (extension.Equals(".mp3"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_MP3 | MTYPE_CONT_UNKNOWN;
+ else if (extension.Equals(".aac"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_AAC | MTYPE_CONT_UNKNOWN;
else
- {
format.mediaType = MTYPE_APP_UNKNOWN;
- }
}
m_amp_media = new CSMPMediaSpace(m_amp, format.mediaType);
- CLog::Log(LOGDEBUG, "CSMPPlayer: Opening: %s", filepath.c_str());
if (ids_url.empty())
{
@@ -196,7 +204,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
ids_url = c_str;
}
- if (m_item.IsDVDFile())
+ if (m_dvd_mediatype)
{
#ifndef NO_RED_SUPPORT
SDVDInitialSettings dvd_settings = {
@@ -337,6 +345,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
res = m_amp->OpenMedia(m_amp, (char*)ids_url.c_str(), &format, ¶meters);
#endif
}
+ CLog::Log(LOGDEBUG, "CSMPPlayer: Opening: %s", ids_url.c_str());
if (res != DFB_OK)
{
CLog::Log(LOGDEBUG, "CSMPPlayer::OpenFile:OpenMedia() failed(0x%x)", res);
@@ -1063,7 +1072,7 @@ bool CSMPPlayer::OnAction(const CAction &action)
{
CLog::Log(LOGDEBUG, "%s - action id = %d", __FUNCTION__, action.GetID());
- if (m_item.IsDVDFile())
+ if (m_dvd_mediatype)
{
if (action.GetID() == ACTION_SHOW_VIDEOMENU)
{
@@ -1188,7 +1197,7 @@ void CSMPPlayer::Process()
// we are playing but hidden and all stream fields are valid.
// check for video in media content
GetAmpStatus();
- if (m_video_count > 0 || m_item.IsDVDFile())
+ if (m_video_count > 0 || m_dvd_mediatype)
{
// turn on/off subs
SetSubtitleVisible(g_settings.m_currentVideoSettings.m_SubtitleOn);
@@ -1199,7 +1208,7 @@ void CSMPPlayer::Process()
// that is under the GUI layer.
int width = GetPictureWidth();
int height = GetPictureHeight();
- if (m_item.IsDVDFile())
+ if (m_dvd_mediatype)
{
// this is not right but seems to work.
width = g_graphicsContext.GetWidth();
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index 6bac845..c46b2d8 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -200,6 +200,7 @@ private:
int m_show_mainvideo;
CRect m_dst_rect;
int m_view_mode;
+ bool m_dvd_mediatype;
std::vector<SIdsData*> m_sub_ids;
std::vector<CStdString> m_sub_urls;
https://github.com/xbmc/xbmc/commit/840c7296c27d425fd176e66c17e8aecdc78d5946
commit 840c7296c27d425fd176e66c17e8aecdc78d5946
Author: theuni <theuni-nospam-@...>
Date: Tue Dec 6 18:23:38 2011 -0500
[smp] Hook up triple-buffering
diff --git a/xbmc/windowing/dfb/WinSystemDFB.cpp b/xbmc/windowing/dfb/WinSystemDFB.cpp
index 50d82e2..2d5b5dd 100755
--- a/xbmc/windowing/dfb/WinSystemDFB.cpp
+++ b/xbmc/windowing/dfb/WinSystemDFB.cpp
@@ -43,7 +43,7 @@ CWinSystemDFB::CWinSystemDFB() : CWinSystemBase()
m_out_signal = DSOS_NONE;
//m_buffermode = DLBM_FRONTONLY; // no backbuffer ( tearing unless we WaitForSync)
//m_buffermode = DLBM_BACKVIDEO; // backbuffer in video memory (no tearing but gui fps is slower)
- m_buffermode = DLBM_TRIPLE;
+ m_buffermode = DLBM_BACKVIDEO;
m_eWindowSystem = WINDOW_SYSTEM_DFB;
m_eglBinding = new CWinBindingEGL();
m_bWindowCreated = false;
@@ -82,8 +82,6 @@ bool CWinSystemDFB::InitWindowSystem()
bool CWinSystemDFB::DestroyWindowSystem()
{
- m_eglBinding->DestroyWindow();
-
if (m_dfb_screen)
m_dfb_screen->Release(m_dfb_screen);
m_dfb_screen = NULL;
@@ -101,8 +99,8 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
m_nHeight = res.iHeight;
m_bFullScreen = fullScreen;
- if (m_bWindowCreated)
- DestroyWindow();
+// if (m_bWindowCreated)
+// DestroyWindow();
// change the output display to match
DFBScreenOutputSignals out_signal;
@@ -159,7 +157,24 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
m_dfb_surface->GetSize(m_dfb_surface, &width, &height);
CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow: Surface(EGL) width(%d), height(%d)",
width, height);
- if (!m_eglBinding->CreateWindow((EGLNativeDisplayType)m_dfb, (NativeWindowType)m_dfb_surface))
+ DFBSurfaceDescription dsc;
+ memset(&dsc, 0, sizeof(dsc));
+ // set the flags to indicate what we want to get back
+ dsc.flags = (DFBSurfaceDescriptionFlags)(DSDESC_WIDTH|DSDESC_HEIGHT|DSDESC_CAPS);
+ dsc.width = width;
+ dsc.height = height;
+ dsc.caps = (DFBSurfaceCapabilities)(DSCAPS_VIDEOONLY | DSCAPS_PAGE_ALIGNED);
+ dsc.pixelformat = DSPF_ARGB;
+ m_dfb->CreateSurface(m_dfb, &dsc, &m_dummysurface1);
+ m_dfb->CreateSurface(m_dfb, &dsc, &m_dummysurface2);
+
+ m_nativewindow = new DFB_WS_Window;
+
+ m_nativewindow->main_surface = m_dfb_surface;
+ m_nativewindow->magic_number = DFB_WS_2P2_MAGIC_NUMBER;
+ m_nativewindow->idle1_surface = m_dummysurface1;
+ m_nativewindow->idle2_surface = m_dummysurface2;
+ if (!m_eglBinding->CreateWindow((EGLNativeDisplayType)m_dfb, (EGLNativeWindowType)m_nativewindow))
return false;
// setup video layer
@@ -184,12 +199,20 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
bool CWinSystemDFB::DestroyWindow()
{
CLog::Log(LOGDEBUG, "CWinSystemDFB::DestroyWindow");
-
+ m_eglBinding->DestroyWindow();
// we have to release the image provider as it also depends on size.
if (m_dfb_image_provider)
m_dfb_image_provider->Release(m_dfb_image_provider);
m_dfb_image_provider = NULL;
-
+
+ if (m_dummysurface1)
+ m_dummysurface1->Release(m_dummysurface1);
+ m_dummysurface1 = NULL;
+
+ if (m_dummysurface2)
+ m_dummysurface2->Release(m_dummysurface2);
+ m_dummysurface2 = NULL;
+
if (m_dfb_surface)
m_dfb_surface->Release(m_dfb_surface);
m_dfb_surface = NULL;
diff --git a/xbmc/windowing/dfb/WinSystemDFB.h b/xbmc/windowing/dfb/WinSystemDFB.h
index 1dbeff0..644d09a 100755
--- a/xbmc/windowing/dfb/WinSystemDFB.h
+++ b/xbmc/windowing/dfb/WinSystemDFB.h
@@ -44,6 +44,7 @@ typedef struct _IDirectFBSurface IDirectFBSurface;
typedef struct _IDirectFBDisplayLayer IDirectFBDisplayLayer;
typedef struct _IDirectFBDataBuffer IDirectFBDataBuffer;
typedef struct _IDirectFBImageProvider IDirectFBImageProvider;
+typedef struct DFB_WS_Window* EGLNativeWindowType;
class CWinBindingEGL;
@@ -88,6 +89,9 @@ protected:
int m_buffermode;
int m_out_signal;
IDirectFBImageProvider *m_dfb_image_provider;
+ IDirectFBSurface *m_dummysurface1;
+ IDirectFBSurface *m_dummysurface2;
+ DFB_WS_Window *m_nativewindow;
};
XBMC_GLOBAL_REF(CWinSystemDFB,g_Windowing);
https://github.com/xbmc/xbmc/commit/6e73eaeae6f67e19d46b9acd5e88c46d1c991857
commit 6e73eaeae6f67e19d46b9acd5e88c46d1c991857
Author: davilla <davilla@...>
Date: Fri Dec 16 18:18:12 2011 -0500
[smp] disable forced red dev testing
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
index 5a9a21a..c45ff1e 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -33,7 +33,7 @@ typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
#endif
// SMP RED dev testing
-#if 1
+#if 0
#undef NO_RED_SUPPORT
#define RMbool bool
#define RMuint8 uint8_t
https://github.com/xbmc/xbmc/commit/d734a9e090723a20328adaf60bc3907c4f9cbbec
commit d734a9e090723a20328adaf60bc3907c4f9cbbec
Author: davilla <davilla@...>
Date: Fri Dec 16 17:46:01 2011 -0500
[smp] fixed subtitle and playback size of dvd. refactor getting audio/subtitle info
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index b9f1fde..a9439f7 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -212,10 +212,6 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
cmd.lpb.cmd = (ELPBCmd)Cmd_Adjust;
cmd.lpb.control.adjustment = &adjustment;
break;
- case SMP_GET_AUDIO_STREAM_INFO:
- cmd.lpb.cmd = LPBCmd_GET_AUDIO_STREAM_INFO;
- cmd.lpb.param1.streamIndex = params.streamindex;
- break;
case SMP_SELECT_AUDIO_STREAM:
cmd.lpb.cmd = LPBCmd_SELECT_AUDIO_STREAM;
cmd.lpb.param1.streamIndex = params.streamindex;
@@ -224,10 +220,6 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
cmd.lpb.cmd = LPBCmd_SET_SUBS_PARAMETERS;
cmd.lpb.param1.subsParams = *params.subsparams;
break;
- case SMP_GET_SUBTITLE_STREAM_INFO:
- cmd.lpb.cmd = LPBCmd_GET_SUBTITLE_STREAM_INFO;
- cmd.lpb.param1.streamIndex = params.streamindex;
- break;
case SMP_SELECT_SUBTITLE_STREAM:
cmd.lpb.cmd = LPBCmd_SELECT_SUBTITLE_STREAM;
cmd.lpb.param1.streamIndex = params.streamindex;
@@ -292,24 +284,42 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
cmd.dvd.cmd = (EDVDCmd)Cmd_Adjust;
cmd.generic.control.adjustment = &adjustment;
break;
- case SMP_GET_AUDIO_STREAM_INFO:
- // do nothing
- break;
case SMP_SELECT_AUDIO_STREAM:
cmd.dvd.cmd = DVDCmd_Audio_Stream_Change;
cmd.dvd.param1.selector = params.streamindex;
break;
- //case SMP_SET_SUBS_PARAMETERS:
- // cmd.dvd.cmd = LPBCmd_SET_SUBS_PARAMETERS;
- // cmd.dvd.param1.subsParams = *params.subsparams;
- // break;
- case SMP_GET_SUBTITLE_STREAM_INFO:
- // do nothing
+ case SMP_SET_SUBS_PARAMETERS:
+ // do nothing for dvd media
+ rtn = false;
+ break;
+ case SMP_SELECT_SUBTITLE_STREAM:
+ cmd.dvd.cmd = DVDCmd_Subpicture_Stream_Change;
+ if (params.streamindex == -1)
+ {
+ // turn off the current subtitle
+ cmd.dvd.param1.selector = m_status.dvd.spu;
+ cmd.dvd.param2.spuDisplay = FALSE;
+ }
+ else
+ {
+ int streamindex = 0;
+ cmd.dvd.param1.selector = 0;
+ for (int i = 0; i < m_status.dvd.title.spus; i++)
+ {
+ if (m_status.dvd.title.spuStreams.isAvailable[i] &&
+ m_status.dvd.title.spuStreams.subPictureStreams[i].isLanguage)
+ {
+ if (streamindex == params.streamindex)
+ {
+ cmd.dvd.param1.selector = i;
+ cmd.dvd.param2.spuDisplay = TRUE;
+ break;
+ }
+ streamindex++;
+ }
+ }
+ }
break;
- //case SMP_SELECT_SUBTITLE_STREAM:
- // cmd.dvd.cmd = LPBCmd_SELECT_SUBTITLE_STREAM;
- // cmd.dvd.param1.streamIndex = params.streamindex;
- // break;
case SMP_DO_ACTION:
switch(params.action)
{
@@ -332,6 +342,32 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
case ACTION_SELECT_ITEM:
cmd.dvd.cmd = DVDCmd_Button_Activate;
break;
+ case ACTION_NEXT_ITEM:
+ case ACTION_PAGE_UP:
+ if (m_status.dvd.title.number < m_status.dvd.volume.titles)
+ {
+ cmd.dvd.cmd = DVDCmd_Title_Play;
+ cmd.dvd.param1.selector = m_status.dvd.title.number + 1;
+ cmd.dvd.param3.endAction = PIEA_Default;
+ }
+ else
+ {
+ rtn = false;
+ }
+ break;
+ case ACTION_PREV_ITEM:
+ case ACTION_PAGE_DOWN:
+ if (m_status.dvd.title.number > 1)
+ {
+ cmd.dvd.cmd = DVDCmd_Title_Play;
+ cmd.dvd.param1.selector = m_status.dvd.title.number - 1;
+ cmd.dvd.param3.endAction = PIEA_Default;
+ }
+ else
+ {
+ rtn = false;
+ }
+ break;
}
break;
default:
@@ -473,6 +509,8 @@ void CSMPMediaSpace::GetStatusVideo(int &width, int &height, int &viewmode, floa
viewmode = VIEW_MODE_NORMAL;
break;
}
+ fps_numerator = m_status.dvd.title.videoStream.isPAL ? 25 : 30;
+ fps_denominator = 1;
}
#endif
else
@@ -565,6 +603,30 @@ int CSMPMediaSpace::GetStatusAudioInfo(int &index, CStdString &info, CStdString
}
}
+//========================================================================
+int CSMPMediaSpace::GetStatusTitleInfo(int &index)
+{
+ // returns title count and current title (zero based)
+ if (m_mediatype == MTYPE_APP_NONE)
+ {
+ index = 0;
+ return(1);
+ }
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
+ {
+ index = m_status.dvd.title.number - 1;
+ return m_status.dvd.volume.titles;
+ }
+#endif
+ else
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ return 0;
+ }
+}
+
+//========================================================================
int CSMPMediaSpace::GetStatusSubTitleInfo(int &index)
{
if (m_mediatype == MTYPE_APP_NONE)
@@ -575,10 +637,16 @@ int CSMPMediaSpace::GetStatusSubTitleInfo(int &index)
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
{
- //index = m_status.dvd.spu;
- //return m_status.dvd.title.spus;
- //m_status.dvd.title.spuStreams.subPictureStreams[index].isLanguage
- return 0;
+ int count = 0;
+ for (int i = 0; i < m_status.dvd.title.spus; i++)
+ {
+ if (m_status.dvd.title.spuStreams.isAvailable[i] &&
+ m_status.dvd.title.spuStreams.subPictureStreams[i].isLanguage)
+ {
+ count++;
+ }
+ }
+ return count;
}
#endif
else
@@ -642,7 +710,7 @@ int CSMPMediaSpace::GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo
}
chapters.clear();
}
- if (m_status.dvd.title.number && m_status.dvd.title.chapters)
+ if (m_status.dvd.title.number > 0 && m_status.dvd.title.chapters)
{
for (int i = 0; i < m_status.dvd.title.chapters; i++)
{
@@ -731,9 +799,12 @@ void CSMPMediaSpace::GetAudioStreamName(int iStream, CStdString &strStreamName)
{
UMSCommand cmd;
UMSResult res;
- UMSParams params;
- params.streamindex = iStream;
- SetupCommand(SMP_GET_AUDIO_STREAM_INFO, cmd, params, res);
+ cmd.lpb.dataSize = sizeof(SLPBCommand);
+ res.lpb.dataSize = sizeof(SLPBResult);
+ cmd.lpb.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ res.lpb.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ cmd.lpb.cmd = LPBCmd_GET_AUDIO_STREAM_INFO;
+ cmd.lpb.param1.streamIndex = iStream;
if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
strStreamName.Format("%s", res.lpb.value.streamInfo.name);
else
@@ -761,11 +832,14 @@ void CSMPMediaSpace::GetSubtitleName(int iStream, CStdString &strStreamName)
{
if (m_mediatype == MTYPE_APP_NONE)
{
- UMSCommand cmd;
- UMSResult res;
- UMSParams params;
- params.streamindex = iStream;
- SetupCommand(SMP_GET_SUBTITLE_STREAM_INFO, cmd, params, res);
+ UMSCommand cmd;
+ UMSResult res;
+ cmd.lpb.dataSize = sizeof(SLPBCommand);
+ res.lpb.dataSize = sizeof(SLPBResult);
+ cmd.lpb.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ res.lpb.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ cmd.lpb.cmd = LPBCmd_GET_SUBTITLE_STREAM_INFO;
+ cmd.lpb.param1.streamIndex = iStream;
if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
strStreamName.Format("%s", res.lpb.value.streamInfo.name);
else
@@ -774,7 +848,13 @@ void CSMPMediaSpace::GetSubtitleName(int iStream, CStdString &strStreamName)
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
{
- strStreamName.Format("Undefined");
+ if (iStream <= MAX_AST && iStream < m_status.dvd.title.spus &&
+ m_status.dvd.title.spuStreams.isAvailable[iStream] &&
+ m_status.dvd.title.spuStreams.subPictureStreams[iStream].isLanguage)
+ {
+ g_LangCodeExpander.Lookup(strStreamName,
+ m_status.dvd.title.spuStreams.subPictureStreams[iStream].languageCode);
+ }
}
#endif
else
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
index 6c04396..5a9a21a 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -61,10 +61,8 @@ enum SMPCommands
SMP_SEEK_TIME,
SMP_SEEK_PERCENT,
SMP_SET_VOLUME,
- SMP_GET_AUDIO_STREAM_INFO,
SMP_SELECT_AUDIO_STREAM,
SMP_SET_SUBS_PARAMETERS,
- SMP_GET_SUBTITLE_STREAM_INFO,
SMP_SELECT_SUBTITLE_STREAM,
SMP_DO_ACTION
};
@@ -127,6 +125,7 @@ public:
void GetStatusVideo(int &width, int &height, int &viewmode, float &fps_numerator, float &fps_denominator);
int GetStatusVideoInfo(int &index, CStdString &info, CStdString &codec);
int GetStatusAudioInfo(int &index, CStdString &info, CStdString &codec, uint32_t &channels);
+ int GetStatusTitleInfo(int &index);
int GetStatusSubTitleInfo(int &index);
int GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo*> &chapters);
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index eaacf80..2cc70ad 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -115,6 +115,8 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
m_subtitle_count = 0;
m_subtitle_delay = 0;
+ m_title_index = 0;
+ m_title_count = 0;
m_chapter_index = 0;
m_chapter_count = 0;
@@ -602,28 +604,24 @@ void CSMPPlayer::SetVolume(long nVolume)
void CSMPPlayer::GetAudioInfo(CStdString &strAudioInfo)
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioInfo");
- GetAmpStatus();
strAudioInfo = m_audio_info;
}
void CSMPPlayer::GetVideoInfo(CStdString &strVideoInfo)
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetVideoInfo");
- GetAmpStatus();
strVideoInfo = m_video_info;
}
int CSMPPlayer::GetAudioStreamCount()
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioStreamCount");
- GetAmpStatus();
return m_audio_count;
}
int CSMPPlayer::GetAudioStream()
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioStream");
- GetAmpStatus();
return m_audio_index;
}
@@ -685,7 +683,8 @@ void CSMPPlayer::SetSubTitleDelay(float fValue = 0.0f)
UMSResult res;
UMSParams params;
params.subsparams = m_subtitle_params;
- m_amp_media->SetupCommand(SMP_SET_SUBS_PARAMETERS, cmd, params, res);
+ if (!(m_amp_media->SetupCommand(SMP_SET_SUBS_PARAMETERS, cmd, params, res)))
+ return;
m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
}
}
@@ -698,14 +697,12 @@ float CSMPPlayer::GetSubTitleDelay()
int CSMPPlayer::GetSubtitleCount()
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetSubtitleCount");
- GetAmpStatus();
return m_subtitle_count;
}
int CSMPPlayer::GetSubtitle()
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetSubtitle");
- GetAmpStatus();
return m_subtitle_index;
}
@@ -732,6 +729,7 @@ void CSMPPlayer::SetSubtitle(int iStream)
bool CSMPPlayer::GetSubtitleVisible()
{
+ CSingleLock lock(m_amp_command_csection);
return m_subtitle_show;
}
@@ -746,7 +744,7 @@ void CSMPPlayer::SetSubtitleVisible(bool bVisible)
UMSResult res;
UMSParams params;
if (bVisible)
- params.streamindex = GetSubtitle();
+ params.streamindex = m_subtitle_index;
else
params.streamindex = -1;
m_amp_media->SetupCommand(SMP_SELECT_SUBTITLE_STREAM, cmd, params, res);
@@ -930,7 +928,6 @@ int CSMPPlayer::SeekChapter(int chapter_index)
float CSMPPlayer::GetActualFPS()
{
- GetAmpStatus();
float video_fps = m_video_fps_numerator / m_video_fps_denominator;
CLog::Log(LOGDEBUG, "CSMPPlayer::GetActualFPS:m_video_fps(%f)", video_fps);
return video_fps;
@@ -967,7 +964,6 @@ __int64 CSMPPlayer::GetTime()
int CSMPPlayer::GetTotalTime()
{
- GetAmpStatus();
return m_duration_ms / 1000;
}
@@ -991,7 +987,6 @@ int CSMPPlayer::GetSourceBitrate()
int CSMPPlayer::GetChannels()
{
// returns number of audio channels (ie 5.1 = 6)
- GetAmpStatus();
return m_audio_channels;
}
@@ -1009,26 +1004,22 @@ int CSMPPlayer::GetSampleRate()
CStdString CSMPPlayer::GetAudioCodecName()
{
- GetAmpStatus();
return m_audio_codec;
}
CStdString CSMPPlayer::GetVideoCodecName()
{
- GetAmpStatus();
return m_video_codec;
}
int CSMPPlayer::GetPictureWidth()
{
- GetAmpStatus();
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetPictureWidth(%d)", m_video_width);
return m_video_width;
}
int CSMPPlayer::GetPictureHeight()
{
- GetAmpStatus();
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetPictureHeight(%)", m_video_height);
return m_video_height;
}
@@ -1208,6 +1199,12 @@ void CSMPPlayer::Process()
// that is under the GUI layer.
int width = GetPictureWidth();
int height = GetPictureHeight();
+ if (m_item.IsDVDFile())
+ {
+ // this is not right but seems to work.
+ width = g_graphicsContext.GetWidth();
+ height = g_graphicsContext.GetHeight();
+ }
double fFrameRate = GetActualFPS();
unsigned int flags = 0;
@@ -1435,9 +1432,19 @@ bool CSMPPlayer::GetAmpStatus()
}
m_video_count = m_amp_media->GetStatusVideoInfo(m_video_index, m_video_info, m_video_codec);
if (m_video_count)
+ {
+ int title_index = m_title_index;
+ int title_count = m_title_count;
+ m_title_count = m_amp_media->GetStatusTitleInfo(m_title_index);
+ if (m_title_count != title_count || m_title_index != title_index)
+ {
+ // 1st run or title changed, update subtitle info
+ m_subtitle_count = m_amp_media->GetStatusSubTitleInfo(m_subtitle_index);
+ SetSubtitleVisible(m_subtitle_show);
+ }
m_amp_media->GetStatusVideo(m_video_width, m_video_height, m_video_viewmode, m_video_fps_numerator, m_video_fps_denominator);
+ }
m_audio_count = m_amp_media->GetStatusAudioInfo(m_audio_index, m_audio_info, m_audio_codec, m_audio_channels);
- m_subtitle_count = m_amp_media->GetStatusSubTitleInfo(m_subtitle_index);
return true;
}
else
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index 159ff3e..6bac845 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -190,6 +190,9 @@ private:
int m_subtitle_delay;
SLPBCmd_SubsParameters *m_subtitle_params;
+ int m_title_index;
+ int m_title_count;
+
int m_chapter_index;
int m_chapter_count;
std::vector<SMPChapterInfo*> m_chapters;
https://github.com/xbmc/xbmc/commit/29d042c3bc41d3bac2ff2b8930d3110c8727b936
commit 29d042c3bc41d3bac2ff2b8930d3110c8727b936
Author: davilla <davilla@...>
Date: Fri Dec 16 13:36:14 2011 -0500
[smp] fixed audio lang selection and current chapter index when there is only one chapter
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 80fd63e..eaacf80 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -26,9 +26,11 @@
#include "Application.h"
#include "FileItem.h"
#include "GUIInfoManager.h"
+#include "GUIUserMessages.h"
#include "Util.h"
#include "cores/VideoRenderers/RenderManager.h"
#include "filesystem/SpecialProtocol.h"
+#include "guilib/GUIMessage.h"
#include "guilib/GUIWindowManager.h"
#include "settings/AdvancedSettings.h"
#include "settings/GUISettings.h"
@@ -640,7 +642,7 @@ void CSMPPlayer::SetAudioStream(int SetAudioStream)
UMSResult res;
UMSParams params;
params.streamindex = SetAudioStream;
- m_amp_media->SetupCommand(SMP_GET_AUDIO_STREAM_INFO, cmd, params, res);
+ m_amp_media->SetupCommand(SMP_SELECT_AUDIO_STREAM, cmd, params, res);
m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
//CLog::Log(LOGDEBUG, "CSMPPlayer::SetAudioStream");
}
@@ -846,17 +848,18 @@ int CSMPPlayer::GetChapterCount()
int CSMPPlayer::GetChapter()
{
+ int chapter_index = m_chapter_count > 0 ? 1:0;
for (int i = 0; i < m_chapter_count - 1; i++)
{
if (m_elapsed_ms >= m_chapters[i]->seekto_ms && m_elapsed_ms < m_chapters[i + 1]->seekto_ms)
return i + 1;
}
- return 0;
+ return chapter_index;
}
void CSMPPlayer::GetChapterName(CStdString& strChapterName)
{
- if (m_chapter_count)
+ if (m_chapter_count && m_chapter_index < m_chapter_count)
strChapterName = m_chapters[m_chapter_index]->name;
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetChapterName:strChapterName(%s)", strChapterName.c_str());
}
@@ -1071,15 +1074,28 @@ bool CSMPPlayer::OnAction(const CAction &action)
if (m_item.IsDVDFile())
{
- UMSCommand cmd;
- UMSResult res;
- UMSParams params;
- params.action = action.GetID();
- if (!(m_amp_media->SetupCommand(SMP_DO_ACTION, cmd, params, res)))
- return false;
+ if (action.GetID() == ACTION_SHOW_VIDEOMENU)
+ {
+ //THREAD_ACTION(action);
+ printf("%s: ACTION_SHOW_VIDEOMENU\n", __FUNCTION__);
+ //pStream->OnMenu();
+ // send a message to everyone that we've gone to the menu
+ CGUIMessage msg(GUI_MSG_VIDEO_MENU_STARTED, 0, 0);
+ g_windowManager.SendMessage(msg);
+ return true;
+ }
- if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
- CLog::Log(LOGERROR, "CSMPPlayer::OnAction");
+ if (IsInMenu())
+ {
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.action = action.GetID();
+ if (!(m_amp_media->SetupCommand(SMP_DO_ACTION, cmd, params, res)))
+ return false;
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::OnAction");
+ }
}
return false;
};
https://github.com/xbmc/xbmc/commit/0ba96e1541e42c9b2ca40858ad898c2de371d86f
commit 0ba96e1541e42c9b2ca40858ad898c2de371d86f
Author: davilla <davilla@...>
Date: Fri Dec 16 12:14:54 2011 -0500
[smp] fixed chapter indexing, it is one based, not zero based
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index 76e9c88..b9f1fde 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -591,6 +591,9 @@ int CSMPMediaSpace::GetStatusSubTitleInfo(int &index)
//========================================================================
int CSMPMediaSpace::GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo*> &chapters)
{
+ // this routine is called two ways.
+ // 1) to just return the number of chapters, SMPChapterInfo is not touched.
+ // 2) return the number of chapters and update SMPChapterInfo in chapters.
int chapter_count = 0;
if (m_mediatype == MTYPE_APP_NONE)
{
@@ -650,12 +653,13 @@ int CSMPMediaSpace::GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo
cmd.dvd.mediaSpace = MEDIA_SPACE_DVD;
res.dvd.mediaSpace = MEDIA_SPACE_DVD;
cmd.dvd.cmd = DVDCmd_QueryChapter;
+ // both selectors are one based.
cmd.dvd.param1.selector = m_status.dvd.title.number;
- cmd.dvd.param2.selector = i;
+ cmd.dvd.param2.selector = i+1;
if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
{
SMPChapterInfo *info = new SMPChapterInfo;
- info->number = i;
+ info->number = i+1;
info->seekto_ms = res.dvd.info.chapter.startTime.Hour * 3600000;
info->seekto_ms += res.dvd.info.chapter.startTime.Minute * 60000;
info->seekto_ms += res.dvd.info.chapter.startTime.Second * 1000;
https://github.com/xbmc/xbmc/commit/4c60e7cc72fbb334162cd09da2866088adeef7cc
commit 4c60e7cc72fbb334162cd09da2866088adeef7cc
Author: davilla <davilla@...>
Date: Fri Dec 16 11:55:28 2011 -0500
[smp] restore CSMPPlayer::HasMenu
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index 6187b34..76e9c88 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -680,6 +680,26 @@ int CSMPMediaSpace::GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo
}
//========================================================================
+bool CSMPMediaSpace::MediaHasMenu()
+{
+ if (m_mediatype == MTYPE_APP_NONE)
+ {
+ return false;
+ }
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
+ {
+ return m_status.dvd.title.menus;
+ }
+ else
+#endif
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ return false;
+ }
+}
+
+//========================================================================
bool CSMPMediaSpace::MediaIsInMenu(void)
{
if (m_mediatype == MTYPE_APP_NONE)
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
index f22289a..6c04396 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -130,6 +130,7 @@ public:
int GetStatusSubTitleInfo(int &index);
int GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo*> &chapters);
+ bool MediaHasMenu();
bool MediaIsInMenu();
void GetAudioStreamName(int iStream, CStdString &strStreamName);
void GetSubtitleName(int iStream, CStdString &strStreamName);
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 03f5500..80fd63e 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1043,6 +1043,9 @@ void CSMPPlayer::ToFFRW(int iSpeed)
if (!m_amp && m_StopPlaying)
return;
+ // ff/rw is not possible when in a dvd menu
+ if (IsInMenu()) return;
+
if (m_speed != iSpeed)
{
// recover power of two value
@@ -1086,6 +1089,11 @@ bool CSMPPlayer::IsInMenu() const
return m_amp_media->MediaIsInMenu();
}
+bool CSMPPlayer::HasMenu()
+{
+ return m_amp_media->MediaHasMenu();
+}
+
bool CSMPPlayer::GetCurrentSubtitle(CStdString& strSubtitle)
{
strSubtitle = "";
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index fca6deb..159ff3e 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -124,6 +124,7 @@ public:
virtual int GetCacheLevel() const {return -1;};
virtual bool IsInMenu() const;
+ virtual bool HasMenu();
virtual void DoAudioWork() {};
virtual bool OnAction(const CAction &action);
https://github.com/xbmc/xbmc/commit/8c9afb534e173ea7362827ffb5b9f1f084756c14
commit 8c9afb534e173ea7362827ffb5b9f1f084756c14
Author: davilla <davilla@...>
Date: Thu Dec 15 18:21:57 2011 -0500
[smp] fixed, audio info, chapters, dvd startup
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index 46d1810..6187b34 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -28,7 +28,9 @@
#include "SMPMediaSpace.h"
#include "guilib/Key.h"
+#include "settings/Settings.h"
#include "utils/log.h"
+#include "utils/LangCodeExpander.h"
static const char *mediaType2String(TMediaType type)
{
@@ -115,8 +117,9 @@ static const char *mediaTypeToCodecName(TMediaType type)
//========================================================================
-CSMPMediaSpace::CSMPMediaSpace(const int mediatype)
+CSMPMediaSpace::CSMPMediaSpace(IAdvancedMediaProvider *amp, const int mediatype)
{
+ m_amp = amp;
m_mediatype = GET_APPLICATION_MTYPE(mediatype);
memset(&m_status, 0, sizeof(union UMSStatus));
@@ -289,28 +292,24 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
cmd.dvd.cmd = (EDVDCmd)Cmd_Adjust;
cmd.generic.control.adjustment = &adjustment;
break;
- //case SMP_GET_AUDIO_STREAM_INFO:
- // cmd.dvd.cmd = LPBCmd_GET_AUDIO_STREAM_INFO;
- // cmd.dvd.param1.streamIndex = params.streamindex;
- // break;
+ case SMP_GET_AUDIO_STREAM_INFO:
+ // do nothing
+ break;
case SMP_SELECT_AUDIO_STREAM:
cmd.dvd.cmd = DVDCmd_Audio_Stream_Change;
cmd.dvd.param1.selector = params.streamindex;
break;
- /*
- case SMP_SET_SUBS_PARAMETERS:
- cmd.dvd.cmd = LPBCmd_SET_SUBS_PARAMETERS;
- cmd.dvd.param1.subsParams = *params.subsparams;
- break;
+ //case SMP_SET_SUBS_PARAMETERS:
+ // cmd.dvd.cmd = LPBCmd_SET_SUBS_PARAMETERS;
+ // cmd.dvd.param1.subsParams = *params.subsparams;
+ // break;
case SMP_GET_SUBTITLE_STREAM_INFO:
- cmd.dvd.cmd = LPBCmd_GET_SUBTITLE_STREAM_INFO;
- cmd.dvd.param1.streamIndex = params.streamindex;
+ // do nothing
break;
- case SMP_SELECT_SUBTITLE_STREAM:
- cmd.dvd.cmd = LPBCmd_SELECT_SUBTITLE_STREAM;
- cmd.dvd.param1.streamIndex = params.streamindex;
- break;
- */
+ //case SMP_SELECT_SUBTITLE_STREAM:
+ // cmd.dvd.cmd = LPBCmd_SELECT_SUBTITLE_STREAM;
+ // cmd.dvd.param1.streamIndex = params.streamindex;
+ // break;
case SMP_DO_ACTION:
switch(params.action)
{
@@ -351,19 +350,10 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
}
//========================================================================
-void CSMPMediaSpace::GetResultStreamInfo(UMSResult &res, CStdString &streaminfo)
-{
- if (m_mediatype == MTYPE_APP_NONE)
- {
- streaminfo.Format("%s", res.lpb.value.streamInfo.name);
- }
-}
-
-//========================================================================
-bool CSMPMediaSpace::StatusUpdate(IAdvancedMediaProvider *amp)
+bool CSMPMediaSpace::StatusUpdate()
{
// get status, only update what has changed (DFB_FALSE).
- return (amp->UploadStatusChanges(amp, &m_status.generic, DFB_FALSE) == DFB_OK);
+ return (m_amp->UploadStatusChanges(m_amp, &m_status.generic, DFB_FALSE) == DFB_OK);
}
//========================================================================
@@ -382,6 +372,18 @@ int CSMPMediaSpace::GetStatusState()
if (IS_ERROR(m_status.generic.lastCmd.result))
state = SMP_ERROR;
+#if 0
+ printf("%s: type(%d), title(%d), chapters(%d), video(%d), audio(%d), audios(%d), spus(%d), menus(0x%x)\n", __FUNCTION__,
+ m_status.dvd.title.type,
+ m_status.dvd.title.number,
+ m_status.dvd.title.chapters,
+ m_status.dvd.video,
+ m_status.dvd.audio,
+ m_status.dvd.title.audios,
+ m_status.dvd.title.spus,
+ m_status.dvd.title.menus);
+#endif
+
return state;
}
//========================================================================
@@ -394,7 +396,7 @@ bool CSMPMediaSpace::GetStatusFormatValid()
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
{
- return (m_status.dvd.video > 0);
+ return (m_status.dvd.title.type > 0);
}
#endif
else
@@ -415,7 +417,7 @@ void CSMPMediaSpace::GetStatusTime(int64_t &elapsed_ms, int64_t &duration_ms)
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
{
- duration_ms = m_status.dvd.title.duration;
+ duration_ms = 1000 * m_status.dvd.title.duration;
}
#endif
else
@@ -425,12 +427,13 @@ void CSMPMediaSpace::GetStatusTime(int64_t &elapsed_ms, int64_t &duration_ms)
}
//========================================================================
-void CSMPMediaSpace::GetStatusVideo(int &width, int &height, float &fps_numerator, float &fps_denominator)
+void CSMPMediaSpace::GetStatusVideo(int &width, int &height, int &viewmode, float &fps_numerator, float &fps_denominator)
{
if (m_mediatype == MTYPE_APP_NONE)
{
width = m_status.lpb.video.format.format.image.width;
height= m_status.lpb.video.format.format.image.height;
+ viewmode = VIEW_MODE_ORIGINAL;
if (m_status.lpb.video.format.format.image.rateN > 0)
{
fps_numerator = m_status.lpb.video.format.format.image.rateM;
@@ -442,6 +445,34 @@ void CSMPMediaSpace::GetStatusVideo(int &width, int &height, float &fps_numerato
{
width = m_status.dvd.title.videoStream.width;
height= m_status.dvd.title.videoStream.height;
+ switch(m_status.dvd.video)
+ {
+ case RM_DVD_VIDEO_4_3__4_3_RECT:
+ default:
+ // 4:3 source, 4:3 output display
+ viewmode = VIEW_MODE_ORIGINAL;
+ break;
+ case RM_DVD_VIDEO_4_3__16_9_ZOOM_ON:
+ // 4:3 source, 16:9 output display, crop top and bottom
+ viewmode = VIEW_MODE_ZOOM;
+ break;
+ case RM_DVD_VIDEO_4_3__16_9_ZOOM_OFF:
+ // 4:3 source, 16:9 output display, black band on sides
+ viewmode = VIEW_MODE_WIDE_ZOOM;
+ break;
+ case RM_DVD_VIDEO_16_9__16_9_RECT:
+ // 16:9 source, 16:9 output display. This is the so-called 'Wide' mode.
+ viewmode = VIEW_MODE_WIDE_ZOOM;
+ break;
+ case RM_DVD_VIDEO_16_9__4_3_PANSCAN:
+ // 16:9 source, pan and scan, 4:3 output display
+ viewmode = VIEW_MODE_NORMAL;
+ break;
+ case RM_DVD_VIDEO_16_9__4_3_LETTERBOX:
+ // 16:9 source, letter box, 4:3 output display
+ viewmode = VIEW_MODE_NORMAL;
+ break;
+ }
}
#endif
else
@@ -516,9 +547,12 @@ int CSMPMediaSpace::GetStatusAudioInfo(int &index, CStdString &info, CStdString
default:
break;
}
+ CStdString language;
+ g_LangCodeExpander.Lookup(language,
+ m_status.dvd.title.audioStreams.audioStreams[index].languageCode);
info.Format("Audio stream (%d) [%s] of type %s",
- index, m_status.lpb.audio.name, mediaType2String(type));
- channels = m_status.dvd.title.audioStreams.audioStreams[index].numberOfChannels;
+ index, language.c_str(), mediaType2String(type));
+ channels = m_status.dvd.title.audioStreams.audioStreams[index].numberOfChannels + 1;
codec = mediaTypeToCodecName(type);
}
return m_status.dvd.title.audios;
@@ -541,7 +575,9 @@ int CSMPMediaSpace::GetStatusSubTitleInfo(int &index)
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
{
- index = m_status.dvd.chapterInfo.number;
+ //index = m_status.dvd.spu;
+ //return m_status.dvd.title.spus;
+ //m_status.dvd.title.spuStreams.subPictureStreams[index].isLanguage
return 0;
}
#endif
@@ -559,8 +595,7 @@ int CSMPMediaSpace::GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo
if (m_mediatype == MTYPE_APP_NONE)
{
#if defined(SLPBSTATUS_CHAPTER_LIST_SIZE)
- chapter_count = m_status.lpb.media.nb_chapters;
- if (chapter_count && update)
+ if (update)
{
if (!chapters.empty())
{
@@ -571,22 +606,69 @@ int CSMPMediaSpace::GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo
}
chapters.clear();
}
- // update avi/mkv chapters.
- for (int i = 0; i < chapter_count; i++)
+ if (m_status.lpb.media.nb_chapters && update)
{
- SMPChapterInfo *info = new SMPChapterInfo;
- info->name = m_status.lpb.media.chapterList[i].pName;
- info->seekto_ms = m_status.lpb.media.chapterList[i].time_ms;
- chapters.push_back(info);
+ // update avi/mkv chapters.
+ for (int i = 0; i < chapter_count; i++)
+ {
+ SMPChapterInfo *info = new SMPChapterInfo;
+ info->name = m_status.lpb.media.chapterList[i].pName;
+ info->seekto_ms = m_status.lpb.media.chapterList[i].time_ms;
+ chapters.push_back(info);
+ }
+ chapter_count = chapters.size();
}
}
+ else
+ {
+ chapter_count = m_status.lpb.media.nb_chapters;
+ }
#endif
}
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
{
- chapter_count = m_status.dvd.title.chapters;
- chapter_count = 0;
+ if (update)
+ {
+ if (!chapters.empty())
+ {
+ for (unsigned int i = 0; i < chapters.size(); i++)
+ {
+ SMPChapterInfo *info = chapters[i];
+ delete info;
+ }
+ chapters.clear();
+ }
+ if (m_status.dvd.title.number && m_status.dvd.title.chapters)
+ {
+ for (int i = 0; i < m_status.dvd.title.chapters; i++)
+ {
+ UMSCommand cmd;
+ UMSResult res;
+ cmd.dvd.dataSize = sizeof(SDVDCommand);
+ res.dvd.dataSize = sizeof(SDVDResult);
+ cmd.dvd.mediaSpace = MEDIA_SPACE_DVD;
+ res.dvd.mediaSpace = MEDIA_SPACE_DVD;
+ cmd.dvd.cmd = DVDCmd_QueryChapter;
+ cmd.dvd.param1.selector = m_status.dvd.title.number;
+ cmd.dvd.param2.selector = i;
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
+ {
+ SMPChapterInfo *info = new SMPChapterInfo;
+ info->number = i;
+ info->seekto_ms = res.dvd.info.chapter.startTime.Hour * 3600000;
+ info->seekto_ms += res.dvd.info.chapter.startTime.Minute * 60000;
+ info->seekto_ms += res.dvd.info.chapter.startTime.Second * 1000;
+ chapters.push_back(info);
+ }
+ }
+ chapter_count = chapters.size();
+ }
+ }
+ else
+ {
+ chapter_count = m_status.dvd.title.chapters;
+ }
}
#endif
else
@@ -598,7 +680,7 @@ int CSMPMediaSpace::GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo
}
//========================================================================
-bool CSMPMediaSpace::MediaHasMenu()
+bool CSMPMediaSpace::MediaIsInMenu(void)
{
if (m_mediatype == MTYPE_APP_NONE)
{
@@ -607,7 +689,7 @@ bool CSMPMediaSpace::MediaHasMenu()
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
{
- return m_status.dvd.title.menus;
+ return (m_status.dvd.mode.flags & SDVDSTATUS_MODE_MENU_ACTIVE);
}
else
#endif
@@ -616,23 +698,65 @@ bool CSMPMediaSpace::MediaHasMenu()
return false;
}
}
+
+
//========================================================================
-bool CSMPMediaSpace::MediaIsInMenu(void)
+void CSMPMediaSpace::GetAudioStreamName(int iStream, CStdString &strStreamName)
{
if (m_mediatype == MTYPE_APP_NONE)
{
- return false;
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.streamindex = iStream;
+ SetupCommand(SMP_GET_AUDIO_STREAM_INFO, cmd, params, res);
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
+ strStreamName.Format("%s", res.lpb.value.streamInfo.name);
+ else
+ strStreamName.Format("Undefined");
}
#ifndef NO_RED_SUPPORT
else if (m_mediatype == MTYPE_APP_DVD)
{
- return (m_status.dvd.mode.flags & SDVDSTATUS_MODE_MENU_ACTIVE);
+ if (iStream <= MAX_AST &&
+ m_status.dvd.title.audios > 0 &&
+ m_status.dvd.title.audioStreams.isAvailable[iStream])
+ {
+ g_LangCodeExpander.Lookup(strStreamName,
+ m_status.dvd.title.audioStreams.audioStreams[iStream].languageCode);
+ }
}
+#endif
else
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ }
+}
+//========================================================================
+void CSMPMediaSpace::GetSubtitleName(int iStream, CStdString &strStreamName)
+{
+ if (m_mediatype == MTYPE_APP_NONE)
+ {
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.streamindex = iStream;
+ SetupCommand(SMP_GET_SUBTITLE_STREAM_INFO, cmd, params, res);
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
+ strStreamName.Format("%s", res.lpb.value.streamInfo.name);
+ else
+ strStreamName.Format("Undefined");
+ }
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
+ {
+ strStreamName.Format("Undefined");
+ }
#endif
+ else
{
CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
- return false;
}
}
+
#endif
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
index c9ca31a..f22289a 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -33,7 +33,7 @@ typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
#endif
// SMP RED dev testing
-#if 0
+#if 1
#undef NO_RED_SUPPORT
#define RMbool bool
#define RMuint8 uint8_t
@@ -108,32 +108,34 @@ union UMSParams
struct SMPChapterInfo
{
std::string name;
+ int number;
int64_t seekto_ms;
};
class CSMPMediaSpace
{
public:
- CSMPMediaSpace(int mediaType);
+ CSMPMediaSpace(IAdvancedMediaProvider *amp, int mediaType);
~CSMPMediaSpace();
bool SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams ¶ms, UMSResult &res);
- void GetResultStreamInfo(UMSResult &res, CStdString &streaminfo);
- bool StatusUpdate(IAdvancedMediaProvider *amp);
+ bool StatusUpdate();
int GetStatusState();
bool GetStatusFormatValid();
void GetStatusTime(int64_t &elapsed_ms, int64_t &duration_ms);
- void GetStatusVideo(int &width, int &height, float &fps_numerator, float &fps_denominator);
+ void GetStatusVideo(int &width, int &height, int &viewmode, float &fps_numerator, float &fps_denominator);
int GetStatusVideoInfo(int &index, CStdString &info, CStdString &codec);
int GetStatusAudioInfo(int &index, CStdString &info, CStdString &codec, uint32_t &channels);
int GetStatusSubTitleInfo(int &index);
int GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo*> &chapters);
- bool MediaHasMenu();
bool MediaIsInMenu();
+ void GetAudioStreamName(int iStream, CStdString &strStreamName);
+ void GetSubtitleName(int iStream, CStdString &strStreamName);
private:
- UMSStatus m_status;
- int m_mediatype;
+ UMSStatus m_status;
+ int m_mediatype;
+ IAdvancedMediaProvider *m_amp;
};
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index ef0482b..03f5500 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -105,6 +105,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
m_video_codec = "none";
m_video_width = 0;
m_video_height = 0;
+ m_video_viewmode = VIEW_MODE_NORMAL;
m_video_fps_numerator = 25;
m_video_fps_denominator = 1;
@@ -177,7 +178,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
format.mediaType = MTYPE_APP_UNKNOWN;
}
}
- m_amp_media = new CSMPMediaSpace(format.mediaType);
+ m_amp_media = new CSMPMediaSpace(m_amp, format.mediaType);
CLog::Log(LOGDEBUG, "CSMPPlayer: Opening: %s", filepath.c_str());
if (ids_url.empty())
@@ -627,16 +628,7 @@ int CSMPPlayer::GetAudioStream()
void CSMPPlayer::GetAudioStreamName(int iStream, CStdString &strStreamName)
{
CSingleLock lock(m_amp_command_csection);
-
- UMSCommand cmd;
- UMSResult res;
- UMSParams params;
- params.streamindex = iStream;
- m_amp_media->SetupCommand(SMP_GET_AUDIO_STREAM_INFO, cmd, params, res);
- if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
- m_amp_media->GetResultStreamInfo(res, strStreamName);
- else
- strStreamName.Format("Undefined");
+ m_amp_media->GetAudioStreamName(iStream, strStreamName);
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioStreamName");
}
@@ -719,15 +711,7 @@ void CSMPPlayer::GetSubtitleName(int iStream, CStdString &strStreamName)
{
CSingleLock lock(m_amp_command_csection);
- UMSCommand cmd;
- UMSResult res;
- UMSParams params;
- params.streamindex = iStream;
- m_amp_media->SetupCommand(SMP_GET_SUBTITLE_STREAM_INFO, cmd, params, res);
- if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
- m_amp_media->GetResultStreamInfo(res, strStreamName);
- else
- strStreamName.Format("Undefined");
+ m_amp_media->GetSubtitleName(iStream, strStreamName);
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetSubtitleName");
}
@@ -862,10 +846,12 @@ int CSMPPlayer::GetChapterCount()
int CSMPPlayer::GetChapter()
{
- // returns a one based value.
- int chapter_index = m_chapter_index + 1;
- //CLog::Log(LOGDEBUG, "CSMPPlayer::GetChapter:chapter_index(%d)", chapter_index);
- return chapter_index;
+ for (int i = 0; i < m_chapter_count - 1; i++)
+ {
+ if (m_elapsed_ms >= m_chapters[i]->seekto_ms && m_elapsed_ms < m_chapters[i + 1]->seekto_ms)
+ return i + 1;
+ }
+ return 0;
}
void CSMPPlayer::GetChapterName(CStdString& strChapterName)
@@ -1277,11 +1263,6 @@ void CSMPPlayer::Process()
//========================================================================
//========================================================================
-bool CSMPPlayer::HasMenu()
-{
- return m_amp_media->MediaHasMenu();
-}
-
bool CSMPPlayer::WaitForAmpStopped(int timeout_ms)
{
bool rtn = false;
@@ -1404,7 +1385,7 @@ bool CSMPPlayer::GetAmpStatus()
{
CSingleLock lock(m_amp_status_csection);
- if (m_amp_media->StatusUpdate(m_amp))
+ if (m_amp_media->StatusUpdate())
{
int64_t elapsed_ms = 0;
m_amp_media->GetStatusTime(elapsed_ms, m_duration_ms);
@@ -1430,7 +1411,7 @@ bool CSMPPlayer::GetAmpStatus()
}
m_video_count = m_amp_media->GetStatusVideoInfo(m_video_index, m_video_info, m_video_codec);
if (m_video_count)
- m_amp_media->GetStatusVideo(m_video_width, m_video_height, m_video_fps_numerator, m_video_fps_denominator);
+ m_amp_media->GetStatusVideo(m_video_width, m_video_height, m_video_viewmode, m_video_fps_numerator, m_video_fps_denominator);
m_audio_count = m_amp_media->GetStatusAudioInfo(m_audio_index, m_audio_info, m_audio_codec, m_audio_channels);
m_subtitle_count = m_amp_media->GetStatusSubTitleInfo(m_subtitle_index);
return true;
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index db2f438..fca6deb 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -141,8 +141,6 @@ protected:
virtual void Process();
private:
- bool HasMenu();
-
bool WaitForAmpStopped(int timeout_ms);
bool WaitForAmpPlaying(int timeout_ms);
bool WaitForAmpOpenMedia(int timeout_ms);
@@ -181,6 +179,7 @@ private:
CStdString m_video_codec;
int m_video_width;
int m_video_height;
+ int m_video_viewmode;
float m_video_fps_numerator;
float m_video_fps_denominator;
https://github.com/xbmc/xbmc/commit/7db8d13bd3b348d43156fdd1ac5d1f8ceba7ac12
commit 7db8d13bd3b348d43156fdd1ac5d1f8ceba7ac12
Author: davilla <davilla@...>
Date: Thu Dec 15 13:50:14 2011 -0500
[smp] revert change to WaitForAmpFormatValid
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index dea4127..ef0482b 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1366,8 +1366,7 @@ bool CSMPPlayer::WaitForAmpFormatValid(int timeout_ms)
while (!m_bStop && !rtn && (timeout_ms > 0))
{
Sleep(100);
- //if (GetAmpStatus() && m_amp_media->GetStatusFormatValid())
- if (GetAmpStatus() && m_amp_media->GetStatusState() != SMP_MEDIA_VALID)
+ if (GetAmpStatus() && m_amp_media->GetStatusFormatValid())
rtn = true;
timeout_ms -= 100;
}
https://github.com/xbmc/xbmc/commit/e8d1ec7d4c162c6258dd560e18811fe169a36aaa
commit e8d1ec7d4c162c6258dd560e18811fe169a36aaa
Author: davilla <davilla@...>
Date: Thu Dec 15 13:45:23 2011 -0500
[smp] opps, disable red dev testing
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
index 0b40f35..c9ca31a 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -33,7 +33,7 @@ typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
#endif
// SMP RED dev testing
-#if 1
+#if 0
#undef NO_RED_SUPPORT
#define RMbool bool
#define RMuint8 uint8_t
https://github.com/xbmc/xbmc/commit/927f2541c8bc91ed0b43f1c51db484942ad27036
commit 927f2541c8bc91ed0b43f1c51db484942ad27036
Author: davilla <davilla@...>
Date: Thu Dec 15 13:42:46 2011 -0500
[smp] fixed, dvd audio info
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
index cb618c4..46d1810 100755
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -492,6 +492,35 @@ int CSMPMediaSpace::GetStatusAudioInfo(int &index, CStdString &info, CStdString
else if (m_mediatype == MTYPE_APP_DVD)
{
index = m_status.dvd.audio;
+ if (m_status.dvd.title.audioStreams.isAvailable[index])
+ {
+ TMediaType type = MTYPE_ELEM_NONE;
+ switch(m_status.dvd.title.audioStreams.audioStreams[index].audioType)
+ {
+ case RM_DVD_AUDIO_AC3:
+ type = MTYPE_ELEM_AC3;
+ break;
+ case RM_DVD_AUDIO_DTS:
+ type = MTYPE_ELEM_DTS;
+ break;
+ case RM_DVD_AUDIO_PCM:
+ case RM_DVD_AUDIO_RPCM:
+ case RM_DVD_AUDIO_PCM_AOB:
+ case RM_DVD_AUDIO_PCM_VOB:
+ type = MTYPE_ELEM_PCM;
+ break;
+ case RM_DVD_AUDIO_MPEG:
+ case RM_DVD_AUDIO_MPEG_EXTENSION:
+ type = MTYPE_ELEM_MP3;
+ break;
+ default:
+ break;
+ }
+ info.Format("Audio stream (%d) [%s] of type %s",
+ index, m_status.lpb.audio.name, mediaType2String(type));
+ channels = m_status.dvd.title.audioStreams.audioStreams[index].numberOfChannels;
+ codec = mediaTypeToCodecName(type);
+ }
return m_status.dvd.title.audios;
}
#endif
https://github.com/xbmc/xbmc/commit/526e9d5359d5a30a7ffc6f0acf48ac655dda4e1e
commit 526e9d5359d5a30a7ffc6f0acf48ac655dda4e1e
Author: davilla <davilla@...>
Date: Thu Dec 15 13:41:08 2011 -0500
[smp] refactor CSMPMediaSpace to support NO_RED_SUPPORT and make it easy to add otheres like blue
diff --git a/xbmc/cores/smpplayer/Makefile.in b/xbmc/cores/smpplayer/Makefile.in
old mode 100644
new mode 100755
index e179513..ee52f80
--- a/xbmc/cores/smpplayer/Makefile.in
+++ b/xbmc/cores/smpplayer/Makefile.in
@@ -1,6 +1,10 @@
CXXFLAGS+= \
@DIRECTFB_CFLAGS@ \
+ifneq (@USE_SMP_RED_SUPPORT@...)
+CXXFLAGS+= -DNO_RED_SUPPORT
+endif
+
SRCS= \
FileIDataSource.cpp \
SMPMediaSpace.cpp \
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
old mode 100644
new mode 100755
index 35c0d17..cb618c4
--- a/xbmc/cores/smpplayer/SMPMediaSpace.cpp
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -117,16 +117,26 @@ static const char *mediaTypeToCodecName(TMediaType type)
//========================================================================
CSMPMediaSpace::CSMPMediaSpace(const int mediatype)
{
- m_mediatype = mediatype;
+ m_mediatype = GET_APPLICATION_MTYPE(mediatype);
memset(&m_status, 0, sizeof(union UMSStatus));
m_status.generic.size = sizeof(union UMSStatus);
- if (mediatype != MTYPE_APP_DVD)
+ if (m_mediatype == MTYPE_APP_NONE)
+ {
m_status.generic.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-#ifdef HAS_RED_SUPPORT
- else
+ CLog::Log(LOGDEBUG, "%s: linear media format", __FUNCTION__);
+ }
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
+ {
m_status.generic.mediaSpace = MEDIA_SPACE_DVD;
+ CLog::Log(LOGDEBUG, "%s: dvd media format", __FUNCTION__);
+ }
#endif
+ else
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ }
}
//========================================================================
@@ -139,7 +149,7 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
{
bool rtn = true;
- if (m_mediatype != MTYPE_APP_DVD)
+ if (m_mediatype == MTYPE_APP_NONE)
{
cmd.lpb.dataSize = sizeof(SLPBCommand);
cmd.lpb.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
@@ -225,8 +235,8 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
break;
}
}
-#ifdef HAS_RED_SUPPORT
- else
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
{
cmd.dvd.dataSize = sizeof(SDVDCommand);
cmd.dvd.mediaSpace = MEDIA_SPACE_DVD;
@@ -332,6 +342,10 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
}
}
#endif
+ else
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ }
return rtn;
}
@@ -339,7 +353,7 @@ bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams &
//========================================================================
void CSMPMediaSpace::GetResultStreamInfo(UMSResult &res, CStdString &streaminfo)
{
- if (m_mediatype != MTYPE_APP_DVD)
+ if (m_mediatype == MTYPE_APP_NONE)
{
streaminfo.Format("%s", res.lpb.value.streamInfo.name);
}
@@ -373,15 +387,20 @@ int CSMPMediaSpace::GetStatusState()
//========================================================================
bool CSMPMediaSpace::GetStatusFormatValid()
{
-#ifdef HAS_RED_SUPPORT
- if (m_mediatype == MTYPE_APP_DVD)
+ if (m_mediatype == MTYPE_APP_NONE)
+ {
+ return (m_status.lpb.video.format.formatValid || m_status.lpb.audio.format.formatValid);
+ }
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
{
return (m_status.dvd.video > 0);
}
- else
#endif
+ else
{
- return (m_status.lpb.video.format.formatValid || m_status.lpb.audio.format.formatValid);
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ return false;
}
}
@@ -389,18 +408,26 @@ bool CSMPMediaSpace::GetStatusFormatValid()
void CSMPMediaSpace::GetStatusTime(int64_t &elapsed_ms, int64_t &duration_ms)
{
elapsed_ms = 1000 * m_status.generic.elapsedTime;
- if (m_mediatype != MTYPE_APP_DVD)
+ if (m_mediatype == MTYPE_APP_NONE)
+ {
duration_ms = 1000 * m_status.lpb.media.duration;
-#ifdef HAS_RED_SUPPORT
- else
+ }
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
+ {
duration_ms = m_status.dvd.title.duration;
+ }
#endif
+ else
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ }
}
//========================================================================
void CSMPMediaSpace::GetStatusVideo(int &width, int &height, float &fps_numerator, float &fps_denominator)
{
- if (m_mediatype != MTYPE_APP_DVD)
+ if (m_mediatype == MTYPE_APP_NONE)
{
width = m_status.lpb.video.format.format.image.width;
height= m_status.lpb.video.format.format.image.height;
@@ -410,46 +437,48 @@ void CSMPMediaSpace::GetStatusVideo(int &width, int &height, float &fps_numerato
fps_denominator = m_status.lpb.video.format.format.image.rateN;
}
}
-#ifdef HAS_RED_SUPPORT
- else
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
{
width = m_status.dvd.title.videoStream.width;
height= m_status.dvd.title.videoStream.height;
}
#endif
+ else
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ }
}
//========================================================================
int CSMPMediaSpace::GetStatusVideoInfo(int &index, CStdString &info, CStdString &codec)
{
-#ifdef HAS_RED_SUPPORT
- if (m_mediatype == MTYPE_APP_DVD)
- {
- index = 0;
- return(1);
- }
- else
-#endif
+ if (m_mediatype == MTYPE_APP_NONE)
{
index = m_status.lpb.video.index;
info.Format("Video stream (%d) [%s] of type %s",
index, m_status.lpb.video.name, mediaType2String(m_status.lpb.video.format.mediaType));
codec = mediaTypeToCodecName(m_status.lpb.video.format.mediaType);
- return(m_status.lpb.media.video_streams);
+ return m_status.lpb.media.video_streams;
+ }
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
+ {
+ index = 0;
+ return 1;
+ }
+#endif
+ else
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ return 0;
}
}
//========================================================================
int CSMPMediaSpace::GetStatusAudioInfo(int &index, CStdString &info, CStdString &codec, uint32_t &channels)
{
-#ifdef HAS_RED_SUPPORT
- if (m_mediatype == MTYPE_APP_DVD)
- {
- index = m_status.dvd.audio;
- return(m_status.dvd.title.audios);
- }
- else
-#endif
+ if (m_mediatype == MTYPE_APP_NONE)
{
index = m_status.lpb.audio.index;
info.Format("Audio stream (%d) [%s] of type %s",
@@ -459,22 +488,38 @@ int CSMPMediaSpace::GetStatusAudioInfo(int &index, CStdString &info, CStdString
codec = mediaTypeToCodecName(m_status.lpb.audio.format.mediaType);
return(m_status.lpb.media.audio_streams);
}
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
+ {
+ index = m_status.dvd.audio;
+ return m_status.dvd.title.audios;
+ }
+#endif
+ else
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ return 0;
+ }
}
int CSMPMediaSpace::GetStatusSubTitleInfo(int &index)
{
-#ifdef HAS_RED_SUPPORT
- if (m_mediatype == MTYPE_APP_DVD)
+ if (m_mediatype == MTYPE_APP_NONE)
+ {
+ index = m_status.lpb.subtitle.index;
+ return(m_status.lpb.media.subtitle_streams);
+ }
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
{
index = m_status.dvd.chapterInfo.number;
- //return(m_status.lpb.media.subtitle_streams);
- return(0);
+ return 0;
}
- else
#endif
+ else
{
- index = m_status.lpb.subtitle.index;
- return(m_status.lpb.media.subtitle_streams);
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ return 0;
}
}
@@ -482,7 +527,7 @@ int CSMPMediaSpace::GetStatusSubTitleInfo(int &index)
int CSMPMediaSpace::GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo*> &chapters)
{
int chapter_count = 0;
- if (m_mediatype != MTYPE_APP_DVD)
+ if (m_mediatype == MTYPE_APP_NONE)
{
#if defined(SLPBSTATUS_CHAPTER_LIST_SIZE)
chapter_count = m_status.lpb.media.nb_chapters;
@@ -508,13 +553,17 @@ int CSMPMediaSpace::GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo
}
#endif
}
-#ifdef HAS_RED_SUPPORT
- else
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
{
chapter_count = m_status.dvd.title.chapters;
chapter_count = 0;
}
#endif
+ else
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
+ }
return chapter_count;
}
@@ -522,21 +571,39 @@ int CSMPMediaSpace::GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo
//========================================================================
bool CSMPMediaSpace::MediaHasMenu()
{
-#ifdef HAS_RED_SUPPORT
- if (m_mediatype == MTYPE_APP_DVD)
+ if (m_mediatype == MTYPE_APP_NONE)
+ {
+ return false;
+ }
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
+ {
return m_status.dvd.title.menus;
+ }
else
#endif
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
return false;
+ }
}
//========================================================================
bool CSMPMediaSpace::MediaIsInMenu(void)
{
-#ifdef HAS_RED_SUPPORT
- if (m_mediatype == MTYPE_APP_DVD)
+ if (m_mediatype == MTYPE_APP_NONE)
+ {
+ return false;
+ }
+#ifndef NO_RED_SUPPORT
+ else if (m_mediatype == MTYPE_APP_DVD)
+ {
return (m_status.dvd.mode.flags & SDVDSTATUS_MODE_MENU_ACTIVE);
+ }
else
#endif
+ {
+ CLog::Log(LOGERROR, "%s: unknown media format", __FUNCTION__);
return false;
+ }
}
#endif
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
old mode 100644
new mode 100755
index 9bf68c1..0b40f35
--- a/xbmc/cores/smpplayer/SMPMediaSpace.h
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -28,8 +28,13 @@
typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
#include <cdefs_lpb.h>
-//#define HAS_RED_SUPPORT
-#ifdef HAS_RED_SUPPORT
+#ifndef NO_RED_SUPPORT
+#include <cdefs_dvd.h>
+#endif
+
+// SMP RED dev testing
+#if 1
+#undef NO_RED_SUPPORT
#define RMbool bool
#define RMuint8 uint8_t
#define RMint16 int16_t
@@ -37,7 +42,6 @@ typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
#define RMuint32 uint32_t
#include "dvdtypes.h"
#include "cdefs_dvd.h"
-//#include <cdefs_dvd.h>
#endif
enum SMPState
@@ -69,7 +73,7 @@ union UMSStatus
{
struct SStatus generic;
struct SLPBStatus lpb;
-#ifdef HAS_RED_SUPPORT
+#ifndef NO_RED_SUPPORT
struct SDVDStatus dvd;
#endif
};
@@ -77,7 +81,7 @@ union UMSCommand
{
struct SCommand generic;
struct SLPBCommand lpb;
-#ifdef HAS_RED_SUPPORT
+#ifndef NO_RED_SUPPORT
struct SDVDCommand dvd;
#endif
};
@@ -85,7 +89,7 @@ union UMSResult
{
struct SResult generic;
struct SLPBResult lpb;
-#ifdef HAS_RED_SUPPORT
+#ifndef NO_RED_SUPPORT
struct SDVDResult dvd;
#endif
};
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 7383010..dea4127 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -173,7 +173,9 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
ids_url = filepath;
}
else
+ {
format.mediaType = MTYPE_APP_UNKNOWN;
+ }
}
m_amp_media = new CSMPMediaSpace(format.mediaType);
CLog::Log(LOGDEBUG, "CSMPPlayer: Opening: %s", filepath.c_str());
@@ -189,9 +191,9 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
ids_url = c_str;
}
-#ifdef HAS_RED_SUPPORT
if (m_item.IsDVDFile())
{
+#ifndef NO_RED_SUPPORT
SDVDInitialSettings dvd_settings = {
RM_DVD_REGION_FREE,
RM_LANGUAGE_ENGLISH,
@@ -202,11 +204,16 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
NULL, //ParentalLevelChangeCallback,
NULL};
- // open the media using the IAdvancedMediaProvider
+ // open the dvd media using the IAdvancedMediaProvider
res = m_amp->OpenMedia(m_amp, (char*)ids_url.c_str(), &format, &dvd_settings);
+#else
+ CLog::Log(LOGDEBUG, "CSMPPlayer::OpenFile:OpenMedia() dvd playback disabled");
+ delete m_amp_media;
+ m_amp_media = NULL;
+ return false;
+#endif
}
else
-#endif
{
#if defined(SLPBPARAMS_MAX_TEXT_SUBS)
// Setup open parameters
@@ -1072,7 +1079,7 @@ void CSMPPlayer::ToFFRW(int iSpeed)
bool CSMPPlayer::OnAction(const CAction &action)
{
CLog::Log(LOGDEBUG, "%s - action id = %d", __FUNCTION__, action.GetID());
-#ifdef HAS_RED_SUPPORT
+
if (m_item.IsDVDFile())
{
UMSCommand cmd;
@@ -1085,7 +1092,6 @@ bool CSMPPlayer::OnAction(const CAction &action)
if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
CLog::Log(LOGERROR, "CSMPPlayer::OnAction");
}
-#endif
return false;
};
@@ -1360,7 +1366,8 @@ bool CSMPPlayer::WaitForAmpFormatValid(int timeout_ms)
while (!m_bStop && !rtn && (timeout_ms > 0))
{
Sleep(100);
- if (GetAmpStatus() && m_amp_media->GetStatusFormatValid())
+ //if (GetAmpStatus() && m_amp_media->GetStatusFormatValid())
+ if (GetAmpStatus() && m_amp_media->GetStatusState() != SMP_MEDIA_VALID)
rtn = true;
timeout_ms -= 100;
}
https://github.com/xbmc/xbmc/commit/158b56e87d400108b91af56399f4c4d8b38939fa
commit 158b56e87d400108b91af56399f4c4d8b38939fa
Author: davilla <davilla@...>
Date: Thu Dec 15 10:21:55 2011 -0500
[smp] HasMenu is private and not part of IPlayer
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
old mode 100644
new mode 100755
index afc15ba..7383010
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1094,11 +1094,6 @@ bool CSMPPlayer::IsInMenu() const
return m_amp_media->MediaIsInMenu();
}
-bool CSMPPlayer::HasMenu()
-{
- return m_amp_media->MediaHasMenu();
-}
-
bool CSMPPlayer::GetCurrentSubtitle(CStdString& strSubtitle)
{
strSubtitle = "";
@@ -1274,6 +1269,13 @@ void CSMPPlayer::Process()
m_amp->CloseMedia(m_amp);
}
+//========================================================================
+//========================================================================
+bool CSMPPlayer::HasMenu()
+{
+ return m_amp_media->MediaHasMenu();
+}
+
bool CSMPPlayer::WaitForAmpStopped(int timeout_ms)
{
bool rtn = false;
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
old mode 100644
new mode 100755
index 8a75550..db2f438
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -124,7 +124,6 @@ public:
virtual int GetCacheLevel() const {return -1;};
virtual bool IsInMenu() const;
- virtual bool HasMenu();
virtual void DoAudioWork() {};
virtual bool OnAction(const CAction &action);
@@ -140,8 +139,10 @@ protected:
virtual void OnStartup();
virtual void OnExit();
virtual void Process();
-
+
private:
+ bool HasMenu();
+
bool WaitForAmpStopped(int timeout_ms);
bool WaitForAmpPlaying(int timeout_ms);
bool WaitForAmpOpenMedia(int timeout_ms);
https://github.com/xbmc/xbmc/commit/8560f639e00ea14f41d5d04bb04432d7505f379a
commit 8560f639e00ea14f41d5d04bb04432d7505f379a
Author: davilla <davilla@...>
Date: Wed Dec 14 19:18:12 2011 -0500
[smp] refactor smpplayer to support dvd media, initial dvd support, beware regressions
diff --git a/xbmc/cores/smpplayer/Makefile.in b/xbmc/cores/smpplayer/Makefile.in
index 97a2aef..e179513 100644
--- a/xbmc/cores/smpplayer/Makefile.in
+++ b/xbmc/cores/smpplayer/Makefile.in
@@ -3,6 +3,7 @@ CXXFLAGS+= \
SRCS= \
FileIDataSource.cpp \
+ SMPMediaSpace.cpp \
SMPPlayer.cpp
LIB= SMPPlayer.a
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.cpp b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
new file mode 100644
index 0000000..35c0d17
--- /dev/null
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.cpp
@@ -0,0 +1,542 @@
+/*
+ * Copyright (C) 2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "system.h"
+
+#if defined(HAS_SIGMASMP)
+#include <vector>
+#include <directfb.h>
+#include <iadvancedmediaprovider.h>
+
+#include "SMPMediaSpace.h"
+#include "guilib/Key.h"
+#include "utils/log.h"
+
+static const char *mediaType2String(TMediaType type)
+{
+ const char *text = NULL;
+
+ switch (type)
+ {
+ case MTYPE_ELEM_NONE: text = "none"; break;
+ case MTYPE_ELEM_UNKNOWN: text = "unknown"; break;
+ case MTYPE_ELEM_MPEG1: text = "MPEG1 video"; break;
+ case MTYPE_ELEM_MPEG2: text = "MPEG2 video"; break;
+ case MTYPE_ELEM_MPEG4: text = "MPEG4 video"; break;
+ case MTYPE_ELEM_AVC: text = "MPEG4 AVC video"; break;
+ case MTYPE_ELEM_VC1: text = "VC1 video"; break;
+ case MTYPE_ELEM_DIVX3: text = "DIVX 3 video"; break;
+ case MTYPE_ELEM_DIVX4: text = "DIVX 4 video"; break;
+ //case MTYPE_ELEM_MPA: text = "MPEG audio"; break;
+ case MTYPE_ELEM_MP1: text = "MPEG1 Layer 1-2 audio"; break;
+ //case MTYPE_ELEM_MP2: text = "MPEG1 Layer 2 audio"; break;
+ case MTYPE_ELEM_MP3: text = "MPEG1 Layer 3 (MP3) audio"; break;
+ case MTYPE_ELEM_MP2MC: text = "MPEG2 (MC) audio"; break;
+ case MTYPE_ELEM_AAC: text = "MPEG2 AAC audio"; break;
+ case MTYPE_ELEM_AACP: text = "MPEG2 AAC+ audio"; break;
+ case MTYPE_ELEM_AC3: text = "Dolby Digital (AC3) audio"; break;
+ case MTYPE_ELEM_DDP: text = "Dolby Digital Plus audio"; break;
+ case MTYPE_ELEM_DLLS: text = "? audio"; break;
+ case MTYPE_ELEM_DTS: text = "DTS audio"; break;
+ case MTYPE_ELEM_DTSHD: text = "DTS-HD audio"; break;
+ case MTYPE_ELEM_PCM: text = "PCM audio"; break;
+ case MTYPE_ELEM_WMA: text = "WMA"; break;
+ case MTYPE_ELEM_WMAPRO: text = "WMA-PRO"; break;
+ case MTYPE_ELEM_SPU: text = "SD graphic subtitles"; break;
+ case MTYPE_ELEM_PG: text = "HD graphic subtitles"; break;
+ case MTYPE_ELEM_IG: text = "Interactive graphics"; break;
+ case MTYPE_ELEM_TS: text = "Text subtitles"; break;
+ case MTYPE_ELEM_JPEG: text = "JPEG graphics"; break;
+ case MTYPE_ELEM_GIF: text = "GIF graphics"; break;
+ case MTYPE_ELEM_PNG: text = "PNG graphics"; break;
+ case MTYPE_ELEM_BMP: text = "BMP graphics"; break;
+ case MTYPE_ELEM_TIFF: text = "TIFF graphics"; break;
+ case MTYPE_ELEM_PIXMAP: text = "RAW graphics"; break;
+ case MTYPE_ELEM_ASCII: text = "ASCII text"; break;
+ case MTYPE_ELEM_FONT: text = "Font data"; break;
+ case MTYPE_ELEM_VIDEO: text = "video"; break;
+ case MTYPE_ELEM_AUDIO: text = "audio"; break;
+ case MTYPE_ELEM_GRAPHICS: text = "graphics"; break;
+ case MTYPE_CONT_ASF: text = "asf"; break;
+ case MTYPE_CONT_AVI: text = "avi"; break;
+ default: text = "invalid value"; break;
+ }
+ return text;
+}
+
+static const char *mediaTypeToCodecName(TMediaType type)
+{
+ const char *text = NULL;
+
+ switch (type)
+ {
+ case MTYPE_ELEM_MPEG1: text = "mpeg1video"; break;
+ case MTYPE_ELEM_MPEG2: text = "mpeg2video"; break;
+ case MTYPE_ELEM_MPEG4: text = "mpeg4"; break;
+ case MTYPE_ELEM_AVC: text = "avc1"; break;
+ case MTYPE_ELEM_VC1: text = "vc-1"; break;
+ case MTYPE_ELEM_DIVX3: text = "divx"; break;
+ case MTYPE_ELEM_DIVX4: text = "divx"; break;
+ case MTYPE_ELEM_MP1: text = "mp1"; break;
+ //case MTYPE_ELEM_MP2: text = "mp2"; break;
+ case MTYPE_ELEM_MP3: text = "mp3"; break;
+ case MTYPE_ELEM_MP2MC: text = "mp2"; break;
+ case MTYPE_ELEM_AAC: text = "aac"; break;
+ case MTYPE_ELEM_AACP: text = "aac"; break;
+ case MTYPE_ELEM_AC3: text = "ac3"; break;
+ case MTYPE_ELEM_DDP: text = "dca"; break;
+ case MTYPE_ELEM_DTS: text = "dts"; break;
+ case MTYPE_ELEM_DTSHD: text = "dtshd-ma"; break;
+ case MTYPE_ELEM_PCM: text = "pcm"; break;
+ case MTYPE_ELEM_WMA: text = "wma"; break;
+ case MTYPE_ELEM_WMAPRO: text = "wmapro"; break;
+ default: text = ""; break;
+ }
+ return text;
+}
+
+
+//========================================================================
+CSMPMediaSpace::CSMPMediaSpace(const int mediatype)
+{
+ m_mediatype = mediatype;
+
+ memset(&m_status, 0, sizeof(union UMSStatus));
+ m_status.generic.size = sizeof(union UMSStatus);
+ if (mediatype != MTYPE_APP_DVD)
+ m_status.generic.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+#ifdef HAS_RED_SUPPORT
+ else
+ m_status.generic.mediaSpace = MEDIA_SPACE_DVD;
+#endif
+}
+
+//========================================================================
+CSMPMediaSpace::~CSMPMediaSpace()
+{
+}
+
+//========================================================================
+bool CSMPMediaSpace::SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams ¶ms, UMSResult &res)
+{
+ bool rtn = true;
+
+ if (m_mediatype != MTYPE_APP_DVD)
+ {
+ cmd.lpb.dataSize = sizeof(SLPBCommand);
+ cmd.lpb.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ res.lpb.dataSize = sizeof(SLPBResult);
+ res.lpb.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ switch(what)
+ {
+ case SMP_PLAY:
+ if (params.playspeed == 0)
+ {
+ cmd.lpb.cmd = LPBCmd_PLAY;
+ cmd.lpb.param2.speed = 1 * 1024;
+ }
+ else if (params.playspeed > 0)
+ {
+ cmd.lpb.cmd = LPBCmd_FAST_FORWARD;
+ cmd.lpb.param2.speed = params.playspeed * 1024;
+ }
+ else
+ {
+ cmd.lpb.cmd = LPBCmd_SCAN_BACKWARD;
+ cmd.lpb.param2.speed = params.playspeed * 1024;
+ }
+ break;
+ case SMP_STOP:
+ cmd.lpb.cmd = LPBCmd_STOP;
+ break;
+ case SMP_PAUSE_ON:
+ cmd.lpb.cmd = LPBCmd_PAUSE_ON;
+ break;
+ case SMP_PAUSE_OFF:
+ cmd.lpb.cmd = LPBCmd_PAUSE_OFF;
+ break;
+ case SMP_SEEK_TIME:
+ cmd.lpb.cmd = LPBCmd_SEEK;
+ cmd.lpb.param1.seekMode = SM_BY_TIME;
+ cmd.lpb.param2.time.Hour = (params.seektime_ms / 3600000);
+ cmd.lpb.param2.time.Minute = (params.seektime_ms / 60000) % 60;
+ cmd.lpb.param2.time.Second = (params.seektime_ms / 1000) % 60;
+ cmd.lpb.param2.time.Frame = 0;
+ //CLog::Log(LOGDEBUG, "CAMPMediaSpace::SetupCommand:SMP_SEEK to Hour(%lu), Minute(%lu), Second(%lu)",
+ // cmd.lpb.param2.time.Hour, cmd.lpb.param2.time.Minute, cmd.lpb.param2.time.Second);
+ break;
+ case SMP_SEEK_PERCENT:
+ cmd.lpb.cmd = LPBCmd_SEEK;
+ cmd.lpb.param1.seekMode = SM_BY_PERCENTAGE;
+ cmd.lpb.param2.percentage = params.seekpercent;
+ cmd.lpb.param2.time.Frame = 0;
+ break;
+ case SMP_SET_VOLUME:
+ SAdjustment adjustment;
+ // use ADJ_MIXER_VOLUME_MAIN and not ADJ_VOLUME as
+ // ADJ_VOLUME will cause a complete re-init of audio decoder.
+ adjustment.type = ADJ_MIXER_VOLUME_MAIN;
+ adjustment.value.volume = params.volume;
+ cmd.lpb.cmd = (ELPBCmd)Cmd_Adjust;
+ cmd.lpb.control.adjustment = &adjustment;
+ break;
+ case SMP_GET_AUDIO_STREAM_INFO:
+ cmd.lpb.cmd = LPBCmd_GET_AUDIO_STREAM_INFO;
+ cmd.lpb.param1.streamIndex = params.streamindex;
+ break;
+ case SMP_SELECT_AUDIO_STREAM:
+ cmd.lpb.cmd = LPBCmd_SELECT_AUDIO_STREAM;
+ cmd.lpb.param1.streamIndex = params.streamindex;
+ break;
+ case SMP_SET_SUBS_PARAMETERS:
+ cmd.lpb.cmd = LPBCmd_SET_SUBS_PARAMETERS;
+ cmd.lpb.param1.subsParams = *params.subsparams;
+ break;
+ case SMP_GET_SUBTITLE_STREAM_INFO:
+ cmd.lpb.cmd = LPBCmd_GET_SUBTITLE_STREAM_INFO;
+ cmd.lpb.param1.streamIndex = params.streamindex;
+ break;
+ case SMP_SELECT_SUBTITLE_STREAM:
+ cmd.lpb.cmd = LPBCmd_SELECT_SUBTITLE_STREAM;
+ cmd.lpb.param1.streamIndex = params.streamindex;
+ break;
+ default:
+ CLog::Log(LOGDEBUG, "CAMPMediaSpace::SetupCommand: unknown lpb command, what(%d)", what);
+ rtn = false;
+ break;
+ }
+ }
+#ifdef HAS_RED_SUPPORT
+ else
+ {
+ cmd.dvd.dataSize = sizeof(SDVDCommand);
+ cmd.dvd.mediaSpace = MEDIA_SPACE_DVD;
+ res.dvd.dataSize = sizeof(SDVDResult);
+ res.dvd.mediaSpace = MEDIA_SPACE_DVD;
+
+ switch(what)
+ {
+ case SMP_PLAY:
+ if (params.playspeed == 0)
+ {
+ cmd.dvd.cmd = DVDCmd_Play;
+ cmd.dvd.param1.speed = 1 * 1024;
+ }
+ else if (params.playspeed > 0)
+ {
+ cmd.dvd.cmd = DVDCmd_Forward_Scan;
+ cmd.dvd.param1.speed = params.playspeed * 1024;
+ }
+ else
+ {
+ cmd.dvd.cmd = DVDCmd_Backward_Scan;
+ cmd.dvd.param1.speed = params.playspeed * 1024;
+ }
+ break;
+ case SMP_STOP:
+ cmd.dvd.cmd = DVDCmd_Stop;
+ break;
+ case SMP_PAUSE_ON:
+ cmd.dvd.cmd = DVDCmd_Pause_On;
+ break;
+ case SMP_PAUSE_OFF:
+ cmd.dvd.cmd = DVDCmd_Pause_Off;
+ break;
+ case SMP_SEEK_TIME:
+ cmd.dvd.cmd = DVDCmd_Time_Search;
+ cmd.dvd.param2.time.Hour = (params.seektime_ms / 3600000);
+ cmd.dvd.param2.time.Minute = (params.seektime_ms / 60000) % 60;
+ cmd.dvd.param2.time.Second = (params.seektime_ms / 1000) % 60;
+ cmd.dvd.param2.time.Frame = 0;
+ //CLog::Log(LOGDEBUG, "CAMPMediaSpace::SetupCommand:SMP_SEEK to Hour(%lu), Minute(%lu), Second(%lu)",
+ // cmd.lpb.param2.time.Hour, cmd.lpb.param2.time.Minute, cmd.lpb.param2.time.Second);
+ break;
+ case SMP_SET_VOLUME:
+ SAdjustment adjustment;
+ // use ADJ_MIXER_VOLUME_MAIN and not ADJ_VOLUME as
+ // ADJ_VOLUME will cause a complete re-init of audio decoder.
+ adjustment.type = ADJ_MIXER_VOLUME_MAIN;
+ adjustment.value.volume = params.volume;
+ cmd.dvd.cmd = (EDVDCmd)Cmd_Adjust;
+ cmd.generic.control.adjustment = &adjustment;
+ break;
+ //case SMP_GET_AUDIO_STREAM_INFO:
+ // cmd.dvd.cmd = LPBCmd_GET_AUDIO_STREAM_INFO;
+ // cmd.dvd.param1.streamIndex = params.streamindex;
+ // break;
+ case SMP_SELECT_AUDIO_STREAM:
+ cmd.dvd.cmd = DVDCmd_Audio_Stream_Change;
+ cmd.dvd.param1.selector = params.streamindex;
+ break;
+ /*
+ case SMP_SET_SUBS_PARAMETERS:
+ cmd.dvd.cmd = LPBCmd_SET_SUBS_PARAMETERS;
+ cmd.dvd.param1.subsParams = *params.subsparams;
+ break;
+ case SMP_GET_SUBTITLE_STREAM_INFO:
+ cmd.dvd.cmd = LPBCmd_GET_SUBTITLE_STREAM_INFO;
+ cmd.dvd.param1.streamIndex = params.streamindex;
+ break;
+ case SMP_SELECT_SUBTITLE_STREAM:
+ cmd.dvd.cmd = LPBCmd_SELECT_SUBTITLE_STREAM;
+ cmd.dvd.param1.streamIndex = params.streamindex;
+ break;
+ */
+ case SMP_DO_ACTION:
+ switch(params.action)
+ {
+ default:
+ CLog::Log(LOGDEBUG, "CAMPMediaSpace::SetupCommand: unknown dvd action(%d)", params.action);
+ rtn = false;
+ break;
+ case ACTION_MOVE_UP:
+ cmd.dvd.cmd = DVDCmd_Upper_Button_Select;
+ break;
+ case ACTION_MOVE_DOWN:
+ cmd.dvd.cmd = DVDCmd_Lower_Button_Select;
+ break;
+ case ACTION_MOVE_LEFT:
+ cmd.dvd.cmd = DVDCmd_Left_Button_Select;
+ break;
+ case ACTION_MOVE_RIGHT:
+ cmd.dvd.cmd = DVDCmd_Right_Button_Select;
+ break;
+ case ACTION_SELECT_ITEM:
+ cmd.dvd.cmd = DVDCmd_Button_Activate;
+ break;
+ }
+ break;
+ default:
+ CLog::Log(LOGDEBUG, "CAMPMediaSpace::SetupCommand: unknown dvd command, what(%d)", what);
+ rtn = false;
+ break;
+ }
+ }
+#endif
+
+ return rtn;
+}
+
+//========================================================================
+void CSMPMediaSpace::GetResultStreamInfo(UMSResult &res, CStdString &streaminfo)
+{
+ if (m_mediatype != MTYPE_APP_DVD)
+ {
+ streaminfo.Format("%s", res.lpb.value.streamInfo.name);
+ }
+}
+
+//========================================================================
+bool CSMPMediaSpace::StatusUpdate(IAdvancedMediaProvider *amp)
+{
+ // get status, only update what has changed (DFB_FALSE).
+ return (amp->UploadStatusChanges(amp, &m_status.generic, DFB_FALSE) == DFB_OK);
+}
+
+//========================================================================
+int CSMPMediaSpace::GetStatusState()
+{
+ SMPState state = SMP_UNKNOWN;
+ if (m_status.generic.flags & SSTATUS_MODE)
+ {
+ if (m_status.generic.mode.flags & SSTATUS_MODE_STOPPED)
+ state = SMP_STOPPED;
+ else if (m_status.generic.mode.flags & SSTATUS_MODE_PLAYING)
+ state = SMP_PLAYING;
+ else if (m_status.generic.mode.flags & SSTATUS_MODE_PAUSED)
+ state = SMP_PAUSED;
+ }
+ if (IS_ERROR(m_status.generic.lastCmd.result))
+ state = SMP_ERROR;
+
+ return state;
+}
+//========================================================================
+bool CSMPMediaSpace::GetStatusFormatValid()
+{
+#ifdef HAS_RED_SUPPORT
+ if (m_mediatype == MTYPE_APP_DVD)
+ {
+ return (m_status.dvd.video > 0);
+ }
+ else
+#endif
+ {
+ return (m_status.lpb.video.format.formatValid || m_status.lpb.audio.format.formatValid);
+ }
+}
+
+//========================================================================
+void CSMPMediaSpace::GetStatusTime(int64_t &elapsed_ms, int64_t &duration_ms)
+{
+ elapsed_ms = 1000 * m_status.generic.elapsedTime;
+ if (m_mediatype != MTYPE_APP_DVD)
+ duration_ms = 1000 * m_status.lpb.media.duration;
+#ifdef HAS_RED_SUPPORT
+ else
+ duration_ms = m_status.dvd.title.duration;
+#endif
+}
+
+//========================================================================
+void CSMPMediaSpace::GetStatusVideo(int &width, int &height, float &fps_numerator, float &fps_denominator)
+{
+ if (m_mediatype != MTYPE_APP_DVD)
+ {
+ width = m_status.lpb.video.format.format.image.width;
+ height= m_status.lpb.video.format.format.image.height;
+ if (m_status.lpb.video.format.format.image.rateN > 0)
+ {
+ fps_numerator = m_status.lpb.video.format.format.image.rateM;
+ fps_denominator = m_status.lpb.video.format.format.image.rateN;
+ }
+ }
+#ifdef HAS_RED_SUPPORT
+ else
+ {
+ width = m_status.dvd.title.videoStream.width;
+ height= m_status.dvd.title.videoStream.height;
+ }
+#endif
+}
+
+//========================================================================
+int CSMPMediaSpace::GetStatusVideoInfo(int &index, CStdString &info, CStdString &codec)
+{
+#ifdef HAS_RED_SUPPORT
+ if (m_mediatype == MTYPE_APP_DVD)
+ {
+ index = 0;
+ return(1);
+ }
+ else
+#endif
+ {
+ index = m_status.lpb.video.index;
+ info.Format("Video stream (%d) [%s] of type %s",
+ index, m_status.lpb.video.name, mediaType2String(m_status.lpb.video.format.mediaType));
+ codec = mediaTypeToCodecName(m_status.lpb.video.format.mediaType);
+ return(m_status.lpb.media.video_streams);
+ }
+}
+
+//========================================================================
+int CSMPMediaSpace::GetStatusAudioInfo(int &index, CStdString &info, CStdString &codec, uint32_t &channels)
+{
+#ifdef HAS_RED_SUPPORT
+ if (m_mediatype == MTYPE_APP_DVD)
+ {
+ index = m_status.dvd.audio;
+ return(m_status.dvd.title.audios);
+ }
+ else
+#endif
+ {
+ index = m_status.lpb.audio.index;
+ info.Format("Audio stream (%d) [%s] of type %s",
+ index, m_status.lpb.audio.name, mediaType2String(m_status.lpb.audio.format.mediaType));
+ channels = m_status.lpb.audio.format.format.sound.channels;
+ channels += m_status.lpb.audio.format.format.sound.lfe;
+ codec = mediaTypeToCodecName(m_status.lpb.audio.format.mediaType);
+ return(m_status.lpb.media.audio_streams);
+ }
+}
+
+int CSMPMediaSpace::GetStatusSubTitleInfo(int &index)
+{
+#ifdef HAS_RED_SUPPORT
+ if (m_mediatype == MTYPE_APP_DVD)
+ {
+ index = m_status.dvd.chapterInfo.number;
+ //return(m_status.lpb.media.subtitle_streams);
+ return(0);
+ }
+ else
+#endif
+ {
+ index = m_status.lpb.subtitle.index;
+ return(m_status.lpb.media.subtitle_streams);
+ }
+}
+
+//========================================================================
+int CSMPMediaSpace::GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo*> &chapters)
+{
+ int chapter_count = 0;
+ if (m_mediatype != MTYPE_APP_DVD)
+ {
+#if defined(SLPBSTATUS_CHAPTER_LIST_SIZE)
+ chapter_count = m_status.lpb.media.nb_chapters;
+ if (chapter_count && update)
+ {
+ if (!chapters.empty())
+ {
+ for (unsigned int i = 0; i < chapters.size(); i++)
+ {
+ SMPChapterInfo *info = chapters[i];
+ delete info;
+ }
+ chapters.clear();
+ }
+ // update avi/mkv chapters.
+ for (int i = 0; i < chapter_count; i++)
+ {
+ SMPChapterInfo *info = new SMPChapterInfo;
+ info->name = m_status.lpb.media.chapterList[i].pName;
+ info->seekto_ms = m_status.lpb.media.chapterList[i].time_ms;
+ chapters.push_back(info);
+ }
+ }
+#endif
+ }
+#ifdef HAS_RED_SUPPORT
+ else
+ {
+ chapter_count = m_status.dvd.title.chapters;
+ chapter_count = 0;
+ }
+#endif
+
+ return chapter_count;
+}
+
+//========================================================================
+bool CSMPMediaSpace::MediaHasMenu()
+{
+#ifdef HAS_RED_SUPPORT
+ if (m_mediatype == MTYPE_APP_DVD)
+ return m_status.dvd.title.menus;
+ else
+#endif
+ return false;
+}
+//========================================================================
+bool CSMPMediaSpace::MediaIsInMenu(void)
+{
+#ifdef HAS_RED_SUPPORT
+ if (m_mediatype == MTYPE_APP_DVD)
+ return (m_status.dvd.mode.flags & SDVDSTATUS_MODE_MENU_ACTIVE);
+ else
+#endif
+ return false;
+}
+#endif
diff --git a/xbmc/cores/smpplayer/SMPMediaSpace.h b/xbmc/cores/smpplayer/SMPMediaSpace.h
new file mode 100644
index 0000000..9bf68c1
--- /dev/null
+++ b/xbmc/cores/smpplayer/SMPMediaSpace.h
@@ -0,0 +1,135 @@
+#pragma once
+/*
+ * Copyright (C) 2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include <stdint.h>
+#include <stdio.h>
+
+#include "utils/StdString.h"
+
+typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
+
+#include <cdefs_lpb.h>
+//#define HAS_RED_SUPPORT
+#ifdef HAS_RED_SUPPORT
+#define RMbool bool
+#define RMuint8 uint8_t
+#define RMint16 int16_t
+#define RMuint16 uint16_t
+#define RMuint32 uint32_t
+#include "dvdtypes.h"
+#include "cdefs_dvd.h"
+//#include <cdefs_dvd.h>
+#endif
+
+enum SMPState
+{
+ SMP_UNKNOWN,
+ SMP_STOPPED,
+ SMP_PLAYING,
+ SMP_PAUSED,
+ SMP_ERROR
+};
+enum SMPCommands
+{
+ SMP_PLAY = 0,
+ SMP_STOP,
+ SMP_PAUSE_ON,
+ SMP_PAUSE_OFF,
+ SMP_SEEK_TIME,
+ SMP_SEEK_PERCENT,
+ SMP_SET_VOLUME,
+ SMP_GET_AUDIO_STREAM_INFO,
+ SMP_SELECT_AUDIO_STREAM,
+ SMP_SET_SUBS_PARAMETERS,
+ SMP_GET_SUBTITLE_STREAM_INFO,
+ SMP_SELECT_SUBTITLE_STREAM,
+ SMP_DO_ACTION
+};
+
+union UMSStatus
+{
+ struct SStatus generic;
+ struct SLPBStatus lpb;
+#ifdef HAS_RED_SUPPORT
+ struct SDVDStatus dvd;
+#endif
+};
+union UMSCommand
+{
+ struct SCommand generic;
+ struct SLPBCommand lpb;
+#ifdef HAS_RED_SUPPORT
+ struct SDVDCommand dvd;
+#endif
+};
+union UMSResult
+{
+ struct SResult generic;
+ struct SLPBResult lpb;
+#ifdef HAS_RED_SUPPORT
+ struct SDVDResult dvd;
+#endif
+};
+
+union UMSParams
+{
+ int64_t seektime_ms;
+ float seekpercent;
+ int streamindex;
+ int playspeed;
+ uint32_t volume;
+ int action;
+ SLPBCmd_SubsParameters *subsparams;
+};
+
+struct SMPChapterInfo
+{
+ std::string name;
+ int64_t seekto_ms;
+};
+
+class CSMPMediaSpace
+{
+public:
+ CSMPMediaSpace(int mediaType);
+ ~CSMPMediaSpace();
+
+ bool SetupCommand(SMPCommands what, UMSCommand &cmd, UMSParams ¶ms, UMSResult &res);
+ void GetResultStreamInfo(UMSResult &res, CStdString &streaminfo);
+
+ bool StatusUpdate(IAdvancedMediaProvider *amp);
+ int GetStatusState();
+ bool GetStatusFormatValid();
+ void GetStatusTime(int64_t &elapsed_ms, int64_t &duration_ms);
+ void GetStatusVideo(int &width, int &height, float &fps_numerator, float &fps_denominator);
+ int GetStatusVideoInfo(int &index, CStdString &info, CStdString &codec);
+ int GetStatusAudioInfo(int &index, CStdString &info, CStdString &codec, uint32_t &channels);
+ int GetStatusSubTitleInfo(int &index);
+ int GetStatusChapterInfo(bool update, std::vector<SMPChapterInfo*> &chapters);
+
+ bool MediaHasMenu();
+ bool MediaIsInMenu();
+
+private:
+ UMSStatus m_status;
+ int m_mediatype;
+};
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
old mode 100755
new mode 100644
index 724f7b3..afc15ba
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -40,130 +40,19 @@
#include "utils/URIUtils.h"
#include "FileIDataSource.h"
+#include "SMPMediaSpace.h"
#include <directfb.h>
#include <iadvancedmediaprovider.h>
-#include <cdefs_lpb.h>
-#ifdef HAS_RED_SUPPORT
-#include <cdefs_dvd.h>
-#endif
#include <algorithm>
-union UMSStatus
-{
- struct SStatus generic;
- struct SLPBStatus lpb;
-#ifdef HAS_RED_SUPPORT
- struct SDVDStatus dvd;
-#endif
-};
-union UMSCommand
-{
- struct SCommand generic;
- struct SLPBCommand lpb;
-#ifdef HAS_RED_SUPPORT
- struct SDVDCommand dvd;
-#endif
-};
-union UMSResult
-{
- struct SResult generic;
- struct SLPBResult lpb;
-#ifdef HAS_RED_SUPPORT
- struct SDVDResult dvd;
-#endif
-};
-
struct SIdsData
{
CFileIDataSource *src;
void *ch;
};
-static const char *mediaType2String(TMediaType type)
-{
- const char *text = NULL;
-
- switch (type)
- {
- case MTYPE_ELEM_NONE: text = "none"; break;
- case MTYPE_ELEM_UNKNOWN: text = "unknown"; break;
- case MTYPE_ELEM_MPEG1: text = "MPEG1 video"; break;
- case MTYPE_ELEM_MPEG2: text = "MPEG2 video"; break;
- case MTYPE_ELEM_MPEG4: text = "MPEG4 video"; break;
- case MTYPE_ELEM_AVC: text = "MPEG4 AVC video"; break;
- case MTYPE_ELEM_VC1: text = "VC1 video"; break;
- case MTYPE_ELEM_DIVX3: text = "DIVX 3 video"; break;
- case MTYPE_ELEM_DIVX4: text = "DIVX 4 video"; break;
- //case MTYPE_ELEM_MPA: text = "MPEG audio"; break;
- case MTYPE_ELEM_MP1: text = "MPEG1 Layer 1-2 audio"; break;
- //case MTYPE_ELEM_MP2: text = "MPEG1 Layer 2 audio"; break;
- case MTYPE_ELEM_MP3: text = "MPEG1 Layer 3 (MP3) audio"; break;
- case MTYPE_ELEM_MP2MC: text = "MPEG2 (MC) audio"; break;
- case MTYPE_ELEM_AAC: text = "MPEG2 AAC audio"; break;
- case MTYPE_ELEM_AACP: text = "MPEG2 AAC+ audio"; break;
- case MTYPE_ELEM_AC3: text = "Dolby Digital (AC3) audio"; break;
- case MTYPE_ELEM_DDP: text = "Dolby Digital Plus audio"; break;
- case MTYPE_ELEM_DLLS: text = "? audio"; break;
- case MTYPE_ELEM_DTS: text = "DTS audio"; break;
- case MTYPE_ELEM_DTSHD: text = "DTS-HD audio"; break;
- case MTYPE_ELEM_PCM: text = "PCM audio"; break;
- case MTYPE_ELEM_WMA: text = "WMA"; break;
- case MTYPE_ELEM_WMAPRO: text = "WMA-PRO"; break;
- case MTYPE_ELEM_SPU: text = "SD graphic subtitles"; break;
- case MTYPE_ELEM_PG: text = "HD graphic subtitles"; break;
- case MTYPE_ELEM_IG: text = "Interactive graphics"; break;
- case MTYPE_ELEM_TS: text = "Text subtitles"; break;
- case MTYPE_ELEM_JPEG: text = "JPEG graphics"; break;
- case MTYPE_ELEM_GIF: text = "GIF graphics"; break;
- case MTYPE_ELEM_PNG: text = "PNG graphics"; break;
- case MTYPE_ELEM_BMP: text = "BMP graphics"; break;
- case MTYPE_ELEM_TIFF: text = "TIFF graphics"; break;
- case MTYPE_ELEM_PIXMAP: text = "RAW graphics"; break;
- case MTYPE_ELEM_ASCII: text = "ASCII text"; break;
- case MTYPE_ELEM_FONT: text = "Font data"; break;
- case MTYPE_ELEM_VIDEO: text = "video"; break;
- case MTYPE_ELEM_AUDIO: text = "audio"; break;
- case MTYPE_ELEM_GRAPHICS: text = "graphics"; break;
- case MTYPE_CONT_ASF: text = "asf"; break;
- case MTYPE_CONT_AVI: text = "avi"; break;
- default: text = "invalid value"; break;
- }
- return text;
-}
-
-static const char *mediaTypeToCodecName(TMediaType type)
-{
- const char *text = NULL;
-
- switch (type)
- {
- case MTYPE_ELEM_MPEG1: text = "mpeg1video"; break;
- case MTYPE_ELEM_MPEG2: text = "mpeg2video"; break;
- case MTYPE_ELEM_MPEG4: text = "mpeg4"; break;
- case MTYPE_ELEM_AVC: text = "avc1"; break;
- case MTYPE_ELEM_VC1: text = "vc-1"; break;
- case MTYPE_ELEM_DIVX3: text = "divx"; break;
- case MTYPE_ELEM_DIVX4: text = "divx"; break;
- case MTYPE_ELEM_MP1: text = "mp1"; break;
- //case MTYPE_ELEM_MP2: text = "mp2"; break;
- case MTYPE_ELEM_MP3: text = "mp3"; break;
- case MTYPE_ELEM_MP2MC: text = "mp2"; break;
- case MTYPE_ELEM_AAC: text = "aac"; break;
- case MTYPE_ELEM_AACP: text = "aac"; break;
- case MTYPE_ELEM_AC3: text = "ac3"; break;
- case MTYPE_ELEM_DDP: text = "dca"; break;
- case MTYPE_ELEM_DTS: text = "dts"; break;
- case MTYPE_ELEM_DTSHD: text = "dtshd-ma"; break;
- case MTYPE_ELEM_PCM: text = "pcm"; break;
- case MTYPE_ELEM_WMA: text = "wma"; break;
- case MTYPE_ELEM_WMAPRO: text = "wmapro"; break;
- default: text = ""; break;
- }
- return text;
-}
-
CSMPPlayer::CSMPPlayer(IPlayerCallback &callback)
: IPlayer(callback),
CThread(),
@@ -173,14 +62,10 @@ CSMPPlayer::CSMPPlayer(IPlayerCallback &callback)
// request video layer
m_ampID = MAIN_VIDEO_AMP_ID;
//m_ampID = SECONDARY_VIDEO_AMP_ID;
+ m_amp_media = NULL;
m_speed = 0;
m_paused = false;
m_StopPlaying = false;
-
- m_status = malloc(sizeof(union UMSStatus));
- memset(m_status, 0, sizeof(union UMSStatus));
- ((UMSStatus*)m_status)->generic.size = sizeof(union UMSStatus);
- ((UMSStatus*)m_status)->generic.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
m_subtitle_params = (SLPBCmd_SubsParameters*)calloc(1, sizeof(SLPBCmd_SubsParameters));
}
@@ -190,7 +75,6 @@ CSMPPlayer::~CSMPPlayer()
CloseFile();
free(m_subtitle_params);
- free(m_status);
}
bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
@@ -211,11 +95,14 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
m_audio_index = -1;
m_audio_count = 0;
m_audio_info = "none";
+ m_audio_codec = "none";
m_audio_delay = g_settings.m_currentVideoSettings.m_AudioDelay;
+ m_audio_channels = 0;
m_video_index = -1;
m_video_count = 0;
m_video_info = "none";
+ m_video_codec = "none";
m_video_width = 0;
m_video_height = 0;
m_video_fps_numerator = 25;
@@ -288,6 +175,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
else
format.mediaType = MTYPE_APP_UNKNOWN;
}
+ m_amp_media = new CSMPMediaSpace(format.mediaType);
CLog::Log(LOGDEBUG, "CSMPPlayer: Opening: %s", filepath.c_str());
if (ids_url.empty())
@@ -300,25 +188,42 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
snprintf(c_str, sizeof(c_str)/sizeof(char), "ids://0x%08lx", (long unsigned int)&ids);
ids_url = c_str;
}
- // Setup open parameters
- struct SLPBOpenParams parameters = {0, };
- parameters.zero = 0;
- // magic cookie to indicate this is binary params
- parameters.a1b2c3d4 = 0xa1b2c3d4;
- // audio offset time from video in milliseconds
- parameters.audioOffset = m_audio_delay;
- // system time clock offset in milliseconds.
- // negative values will delay start of presentation.
- parameters.stcOffset = -200;
- // max prebuffersize in bytes, 0 for default
- parameters.maxPrebufferSize = 100 * 1024;
-#if defined(SLPBPARAMS_MAX_TEXT_SUBS)
- if (!m_item.IsDVDFile())
+#ifdef HAS_RED_SUPPORT
+ if (m_item.IsDVDFile())
{
+ SDVDInitialSettings dvd_settings = {
+ RM_DVD_REGION_FREE,
+ RM_LANGUAGE_ENGLISH,
+ RM_LANGUAGE_ENGLISH,
+ RM_LANGUAGE_ENGLISH,
+ RM_COUNTRY_UNITED_STATES,
+ RM_DVD_PARENTAL_LEVEL_DISABLED,
+ NULL, //ParentalLevelChangeCallback,
+ NULL};
+
+ // open the media using the IAdvancedMediaProvider
+ res = m_amp->OpenMedia(m_amp, (char*)ids_url.c_str(), &format, &dvd_settings);
+ }
+ else
+#endif
+ {
+#if defined(SLPBPARAMS_MAX_TEXT_SUBS)
+ // Setup open parameters
+ struct SLPBOpenParams parameters = {0, };
+ parameters.zero = 0;
+ // magic cookie to indicate this is binary params
+ parameters.a1b2c3d4 = 0xa1b2c3d4;
+ // audio offset time from video in milliseconds
+ parameters.audioOffset = m_audio_delay;
+ // system time clock offset in milliseconds.
+ // negative values will delay start of presentation.
+ parameters.stcOffset = -200;
+ // max prebuffersize in bytes, 0 for default
+ parameters.maxPrebufferSize = 100 * 1024;
+
// find any available external subtitles
// SRT, SSA, ASS, SUB, SMI or binary SUB/IDX
-
std::vector<CStdString> filenames;
CUtil::ScanForExternalSubtitles( m_item.GetPath(), filenames );
int sub_file_count = filenames.size();
@@ -416,14 +321,15 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
}
}
}
- }
+ // open the media using the IAdvancedMediaProvider
+ res = m_amp->OpenMedia(m_amp, (char*)ids_url.c_str(), &format, ¶meters);
#endif
-
- // open the media using the IAdvancedMediaProvider
- res = m_amp->OpenMedia(m_amp, (char*)ids_url.c_str(), &format, ¶meters);
+ }
if (res != DFB_OK)
{
CLog::Log(LOGDEBUG, "CSMPPlayer::OpenFile:OpenMedia() failed(0x%x)", res);
+ delete m_amp_media;
+ m_amp_media = NULL;
return false;
}
@@ -443,13 +349,19 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
// Playback might have been stopped due to some error.
if (m_bStop || m_StopPlaying)
+ {
+ delete m_amp_media;
+ m_amp_media = NULL;
return false;
+ }
return true;
}
catch(...)
{
CLog::Log(LOGERROR, "%s - Exception thrown on open", __FUNCTION__);
+ delete m_amp_media;
+ m_amp_media = NULL;
return false;
}
}
@@ -465,6 +377,8 @@ bool CSMPPlayer::CloseFile()
// we are done after the StopThread call
StopThread();
+ delete m_amp_media;
+ m_amp_media = NULL;
if (m_amp)
m_amp->Release(m_amp);
m_amp = NULL;
@@ -477,6 +391,9 @@ bool CSMPPlayer::CloseFile()
m_sub_ids.pop_back();
while (!m_sub_urls.empty())
m_sub_urls.pop_back();
+ while (!m_chapters.empty())
+ m_chapters.pop_back();
+ m_chapter_count = 0;
CLog::Log(LOGDEBUG, "CSMPPlayer: finished waiting");
g_renderManager.UnInit();
@@ -496,27 +413,23 @@ void CSMPPlayer::Pause()
if (!m_amp && m_StopPlaying)
return;
- SLPBCommand cmd;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
if (m_paused)
{
- cmd.cmd = LPBCmd_PAUSE_OFF;
+ m_amp_media->SetupCommand(SMP_PAUSE_OFF, cmd, params, res);
m_callback.OnPlayBackResumed();
}
else
{
- cmd.cmd = LPBCmd_PAUSE_ON;
+ m_amp_media->SetupCommand(SMP_PAUSE_ON, cmd, params, res);
m_callback.OnPlayBackPaused();
}
m_paused = !m_paused;
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
CLog::Log(LOGERROR, "CSMPPlayer::Pause:AMP command failed!");
CLog::Log(LOGDEBUG, "CSMPPlayer::Pause");
}
@@ -614,26 +527,17 @@ void CSMPPlayer::Seek(bool bPlus, bool bLargeStep)
if (seek_ms > m_duration_ms)
seek_ms = m_duration_ms;
- SLPBCommand cmd;
- cmd.cmd = LPBCmd_SEEK;
- cmd.param1.seekMode = SM_BY_TIME;
- cmd.param2.time.Hour = (seek_ms / 3600000);
- cmd.param2.time.Minute = (seek_ms / 60000) % 60;
- cmd.param2.time.Second = (seek_ms / 1000) % 60;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
- //CLog::Log(LOGDEBUG, "CSMPPlayer::Seek:to Hour(%lu), Minute(%lu), Second(%lu)",
- // cmd.param2.time.Hour, cmd.param2.time.Minute, cmd.param2.time.Second);
-
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.seektime_ms = seek_ms;
+ m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
// This will popup seek info dialog if skin supports it
//g_infoManager.SetDisplayAfterSeek(100000);
//m_callback.OnPlayBackSeek((int)seek_ms, (int)(seek_ms - m_elapsed_ms));
- if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
CLog::Log(LOGERROR, "CSMPPlayer::SeekTime:AMP command failed!");
//g_infoManager.SetDisplayAfterSeek();
@@ -649,18 +553,12 @@ void CSMPPlayer::SeekPercentage(float fPercent)
{
CSingleLock lock(m_amp_command_csection);
- SLPBCommand cmd;
- cmd.cmd = LPBCmd_SEEK;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
- cmd.param1.seekMode = SM_BY_PERCENTAGE;
- cmd.param2.percentage = fPercent;
-
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.seekpercent = fPercent;
+ m_amp_media->SetupCommand(SMP_SEEK_PERCENT, cmd, params, res);
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
CLog::Log(LOGERROR, "CSMPPlayer::SeekTime:AMP command failed!");
}
@@ -682,63 +580,40 @@ void CSMPPlayer::SetVolume(long nVolume)
// Maximum gain is 0xFFFFFFFF ~=24db
uint32_t volume = (1.0f + (nVolume / 6000.0f)) * (float)0x10000000;
- SAdjustment adjustment;
- // use ADJ_MIXER_VOLUME_MAIN and not ADJ_VOLUME as
- // ADJ_VOLUME will cause a complete re-init of audio decoder.
- adjustment.type = ADJ_MIXER_VOLUME_MAIN;
- adjustment.value.volume = volume;
-
- SLPBCommand cmd;
- cmd.cmd = (ELPBCmd)Cmd_Adjust;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
- cmd.control.adjustment = &adjustment;
-
- if (m_amp->PostPresentationCmd(m_amp, (SCommand*)&cmd) != DFB_OK)
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.volume = volume;
+ m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
+ if (m_amp->PostPresentationCmd(m_amp, &cmd.generic) != DFB_OK)
CLog::Log(LOGDEBUG, "CSMPPlayer::SetVolume:AMP command failed!");
}
void CSMPPlayer::GetAudioInfo(CStdString &strAudioInfo)
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioInfo");
- if (GetAmpStatus())
- {
- m_audio_info.Format("Audio stream (%d) [%s] of type %s",
- ((UMSStatus*)m_status)->lpb.audio.index,
- ((UMSStatus*)m_status)->lpb.audio.name,
- mediaType2String(((UMSStatus*)m_status)->lpb.audio.format.mediaType));
- }
+ GetAmpStatus();
strAudioInfo = m_audio_info;
}
void CSMPPlayer::GetVideoInfo(CStdString &strVideoInfo)
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetVideoInfo");
- if (GetAmpStatus())
- {
- m_video_info.Format("Video stream (%d) [%s] of type %s",
- ((UMSStatus*)m_status)->lpb.video.index,
- ((UMSStatus*)m_status)->lpb.video.name,
- mediaType2String(((UMSStatus*)m_status)->lpb.video.format.mediaType));
- }
+ GetAmpStatus();
strVideoInfo = m_video_info;
}
int CSMPPlayer::GetAudioStreamCount()
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioStreamCount");
- if (GetAmpStatus())
- m_audio_count = ((UMSStatus*)m_status)->lpb.media.audio_streams;
-
+ GetAmpStatus();
return m_audio_count;
}
int CSMPPlayer::GetAudioStream()
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioStream");
- if (GetAmpStatus())
- m_audio_index = ((UMSStatus*)m_status)->lpb.audio.index;
-
+ GetAmpStatus();
return m_audio_index;
}
@@ -746,18 +621,13 @@ void CSMPPlayer::GetAudioStreamName(int iStream, CStdString &strStreamName)
{
CSingleLock lock(m_amp_command_csection);
- SLPBCommand cmd;
- cmd.cmd = LPBCmd_GET_AUDIO_STREAM_INFO;
- cmd.param1.streamIndex = iStream;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) == DFB_OK)
- strStreamName.Format("%s", res.value.streamInfo.name);
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.streamindex = iStream;
+ m_amp_media->SetupCommand(SMP_GET_AUDIO_STREAM_INFO, cmd, params, res);
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
+ m_amp_media->GetResultStreamInfo(res, strStreamName);
else
strStreamName.Format("Undefined");
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioStreamName");
@@ -767,17 +637,12 @@ void CSMPPlayer::SetAudioStream(int SetAudioStream)
{
CSingleLock lock(m_amp_command_csection);
- SLPBCommand cmd;
- cmd.cmd = LPBCmd_SELECT_AUDIO_STREAM;
- cmd.param1.streamIndex = SetAudioStream;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res);
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.streamindex = SetAudioStream;
+ m_amp_media->SetupCommand(SMP_GET_AUDIO_STREAM_INFO, cmd, params, res);
+ m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
//CLog::Log(LOGDEBUG, "CSMPPlayer::SetAudioStream");
}
@@ -815,17 +680,12 @@ void CSMPPlayer::SetSubTitleDelay(float fValue = 0.0f)
enum ELPBCmd_SubsParameters_Encoding encoding;
*/
- SLPBCommand cmd;
- cmd.cmd = LPBCmd_SET_SUBS_PARAMETERS;
- cmd.param1.subsParams = *m_subtitle_params;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res);
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.subsparams = m_subtitle_params;
+ m_amp_media->SetupCommand(SMP_SET_SUBS_PARAMETERS, cmd, params, res);
+ m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
}
}
@@ -837,18 +697,14 @@ float CSMPPlayer::GetSubTitleDelay()
int CSMPPlayer::GetSubtitleCount()
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetSubtitleCount");
- if (GetAmpStatus())
- m_subtitle_count = ((UMSStatus*)m_status)->lpb.media.subtitle_streams;
-
+ GetAmpStatus();
return m_subtitle_count;
}
int CSMPPlayer::GetSubtitle()
{
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetSubtitle");
- if (GetAmpStatus())
- m_subtitle_index = ((UMSStatus*)m_status)->lpb.subtitle.index;
-
+ GetAmpStatus();
return m_subtitle_index;
}
@@ -856,18 +712,13 @@ void CSMPPlayer::GetSubtitleName(int iStream, CStdString &strStreamName)
{
CSingleLock lock(m_amp_command_csection);
- SLPBCommand cmd;
- cmd.cmd = LPBCmd_GET_SUBTITLE_STREAM_INFO;
- cmd.param1.streamIndex = iStream;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) == DFB_OK)
- strStreamName.Format("%s", res.value.streamInfo.name);
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.streamindex = iStream;
+ m_amp_media->SetupCommand(SMP_GET_SUBTITLE_STREAM_INFO, cmd, params, res);
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) == DFB_OK)
+ m_amp_media->GetResultStreamInfo(res, strStreamName);
else
strStreamName.Format("Undefined");
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetSubtitleName");
@@ -877,17 +728,12 @@ void CSMPPlayer::SetSubtitle(int iStream)
{
CSingleLock lock(m_amp_command_csection);
- SLPBCommand cmd;
- cmd.cmd = LPBCmd_SELECT_SUBTITLE_STREAM;
- cmd.param1.streamIndex = iStream;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res);
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.streamindex = iStream;
+ m_amp_media->SetupCommand(SMP_SELECT_SUBTITLE_STREAM, cmd, params, res);
+ m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
//CLog::Log(LOGDEBUG, "CSMPPlayer::SetSubtitle");
}
@@ -903,20 +749,15 @@ void CSMPPlayer::SetSubtitleVisible(bool bVisible)
m_subtitle_show = bVisible;
g_settings.m_currentVideoSettings.m_SubtitleOn = bVisible;
- SLPBCommand cmd;
- cmd.cmd = LPBCmd_SELECT_SUBTITLE_STREAM;
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
if (bVisible)
- cmd.param1.streamIndex = GetSubtitle();
+ params.streamindex = GetSubtitle();
else
- cmd.param1.streamIndex = -1;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res);
+ params.streamindex = -1;
+ m_amp_media->SetupCommand(SMP_SELECT_SUBTITLE_STREAM, cmd, params, res);
+ m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic);
}
int CSMPPlayer::AddSubtitle(const CStdString& strSubPath)
@@ -989,7 +830,6 @@ void CSMPPlayer::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
ShowMainVideo(false);
IDirectFB *dfb = g_Windowing.GetIDirectFB();
- DFBDisplayLayerConfig dlcfg;
IDirectFBDisplayLayer *dfb_layer;
dfb->GetDisplayLayer(dfb, XBMC_MAINVIDEO, &dfb_layer);
dfb_layer->SetCooperativeLevel(dfb_layer, DLSCL_EXCLUSIVE);
@@ -1024,7 +864,7 @@ int CSMPPlayer::GetChapter()
void CSMPPlayer::GetChapterName(CStdString& strChapterName)
{
if (m_chapter_count)
- strChapterName = m_chapters[m_chapter_index].name;
+ strChapterName = m_chapters[m_chapter_index]->name;
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetChapterName:strChapterName(%s)", strChapterName.c_str());
}
@@ -1044,36 +884,27 @@ int CSMPPlayer::SeekChapter(int chapter_index)
// amp time units are seconds,
// so we add 1000ms to get into the chapter.
- int64_t seek_ms = m_chapters[chapter_index - 1].seekto_ms + 1000;
+ int64_t seek_ms = m_chapters[chapter_index - 1]->seekto_ms + 1000;
// bugfix: dcchd takes forever to seek to 0 and play
// seek to 1 second and play is immediate.
if (seek_ms <= 0)
seek_ms = 1000;
- SLPBCommand cmd;
- cmd.cmd = LPBCmd_SEEK;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
- cmd.param1.seekMode = SM_BY_TIME;
- cmd.param2.time.Hour = (seek_ms / 3600000);
- cmd.param2.time.Minute = (seek_ms / 60000) % 60;
- cmd.param2.time.Second = (seek_ms / 1000) % 60;
- //CLog::Log(LOGDEBUG, "CSMPPlayer::SeekChapter:to Hour(%lu), Minute(%lu), Second(%lu)",
- // cmd.param2.time.Hour, cmd.param2.time.Minute, cmd.param2.time.Second);
-
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.seektime_ms = seek_ms;
+ m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
// This will popup seek info dialog if skin supports it.
//g_infoManager.SetDisplayAfterSeek(100000);
//m_callback.OnPlayBackSeekChapter(GetChapter());
- if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
CLog::Log(LOGERROR, "CSMPPlayer::SeekChapter:ExecutePresentationCmd failed!");
- if (IS_SUCCESS( ((SResult*)&res)->value ))
+ if (IS_SUCCESS(res.generic.value))
{
for (int timeout = 10; timeout > 0; timeout--)
{
@@ -1103,18 +934,8 @@ int CSMPPlayer::SeekChapter(int chapter_index)
float CSMPPlayer::GetActualFPS()
{
+ GetAmpStatus();
float video_fps = m_video_fps_numerator / m_video_fps_denominator;
- if (GetAmpStatus())
- {
- // display field rate, in rateM/rateN fields per second
- float rateN = ((UMSStatus*)m_status)->lpb.video.format.format.image.rateN;
- if (rateN > 0.0)
- {
- m_video_fps_numerator = ((UMSStatus*)m_status)->lpb.video.format.format.image.rateM;
- m_video_fps_denominator = rateN;
- video_fps = m_video_fps_numerator / m_video_fps_denominator;
- }
- }
CLog::Log(LOGDEBUG, "CSMPPlayer::GetActualFPS:m_video_fps(%f)", video_fps);
return video_fps;
}
@@ -1127,27 +948,17 @@ void CSMPPlayer::SeekTime(__int64 seek_ms)
if (seek_ms <= 0)
seek_ms = 1000;
- // iTime units are milliseconds.
- SLPBCommand cmd;
- cmd.cmd = LPBCmd_SEEK;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
- cmd.param1.seekMode = SM_BY_TIME;
- cmd.param2.time.Hour = (seek_ms / 3600000);
- cmd.param2.time.Minute = (seek_ms / 60000) % 60;
- cmd.param2.time.Second = (seek_ms / 1000) % 60;
- //CLog::Log(LOGDEBUG, "CSMPPlayer::SeekTime:to Hour(%lu), Minute(%lu), Second(%lu)",
- // cmd.param2.time.Hour, cmd.param2.time.Minute, cmd.param2.time.Second);
-
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.seektime_ms = seek_ms;
+ m_amp_media->SetupCommand(SMP_SEEK_TIME, cmd, params, res);
// This will popup seek info dialog if skin supports it.
//g_infoManager.SetDisplayAfterSeek(100000);
//m_callback.OnPlayBackSeek((int)seek_ms, (int)(seek_ms - GetTime()));
- if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
CLog::Log(LOGERROR, "CSMPPlayer::SeekTime:AMP command failed!");
//g_infoManager.SetDisplayAfterSeek();
@@ -1160,8 +971,7 @@ __int64 CSMPPlayer::GetTime()
int CSMPPlayer::GetTotalTime()
{
- if (GetAmpStatus())
- m_duration_ms = 1000 * ((UMSStatus*)m_status)->lpb.media.duration;
+ GetAmpStatus();
return m_duration_ms / 1000;
}
@@ -1185,12 +995,7 @@ int CSMPPlayer::GetSourceBitrate()
int CSMPPlayer::GetChannels()
{
// returns number of audio channels (ie 5.1 = 6)
- if (GetAmpStatus())
- {
- m_audio_channels = ((UMSStatus*)m_status)->lpb.audio.format.format.sound.channels;
- m_audio_channels += ((UMSStatus*)m_status)->lpb.audio.format.format.sound.lfe;
- }
-
+ GetAmpStatus();
return m_audio_channels;
}
@@ -1208,32 +1013,26 @@ int CSMPPlayer::GetSampleRate()
CStdString CSMPPlayer::GetAudioCodecName()
{
- CStdString strAudioCodec;
- if (GetAmpStatus())
- strAudioCodec = mediaTypeToCodecName(((UMSStatus*)m_status)->lpb.audio.format.mediaType);
- return strAudioCodec;
+ GetAmpStatus();
+ return m_audio_codec;
}
CStdString CSMPPlayer::GetVideoCodecName()
{
- CStdString strVideoCodec;
- if (GetAmpStatus())
- strVideoCodec = mediaTypeToCodecName(((UMSStatus*)m_status)->lpb.audio.format.mediaType);
- return strVideoCodec;
+ GetAmpStatus();
+ return m_video_codec;
}
int CSMPPlayer::GetPictureWidth()
{
- if (GetAmpStatus())
- m_video_width = ((UMSStatus*)m_status)->lpb.video.format.format.image.width;
+ GetAmpStatus();
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetPictureWidth(%d)", m_video_width);
return m_video_width;
}
int CSMPPlayer::GetPictureHeight()
{
- if (GetAmpStatus())
- m_video_height= ((UMSStatus*)m_status)->lpb.video.format.format.image.height;
+ GetAmpStatus();
//CLog::Log(LOGDEBUG, "CSMPPlayer::GetPictureHeight(%)", m_video_height);
return m_video_height;
}
@@ -1253,37 +1052,17 @@ void CSMPPlayer::ToFFRW(int iSpeed)
if (m_speed != iSpeed)
{
- SLPBCommand cmd;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
// recover power of two value
int ipower = 0;
int ispeed = abs(iSpeed);
while (ispeed >>= 1) ipower++;
- switch(ipower)
- {
- // regular playback
- case 0:
- cmd.cmd = LPBCmd_PLAY;
- cmd.param2.speed = 1 * 1024;
- break;
- default:
- // N x fast forward/rewind (I-frames)
- if (iSpeed > 0)
- cmd.cmd = LPBCmd_FAST_FORWARD;
- else
- cmd.cmd = LPBCmd_SCAN_BACKWARD;
- cmd.param2.speed = ipower * 1024;
- break;
- }
-
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.playspeed = ipower;
+ m_amp_media->SetupCommand(SMP_PLAY, cmd, params, res);
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
CLog::Log(LOGERROR, "CSMPPlayer::ToFFRW:AMP command failed!");
m_speed = iSpeed;
@@ -1296,53 +1075,41 @@ bool CSMPPlayer::OnAction(const CAction &action)
#ifdef HAS_RED_SUPPORT
if (m_item.IsDVDFile())
{
- SDVDStatus cmd;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_DVD;
-
- switch(action.GetID())
- {
- default:
- return false;
- break;
-
- case ACTION_MOVE_UP:
- cmd.cmd = DVDCmd_Upper_Button_Select;
- printf("Sent UPPER_BUTTON_SELECT command\n");
- break;
-
- case ACTION_MOVE_DOWN:
- cmd.cmd = DVDCmd_Lower_Button_Select;
- printf("Sent LOWER_BUTTON_SELECT command\n");
- break;
-
- case ACTION_MOVE_LEFT:
- cmd.cmd = DVDCmd_Left_Button_Select;
- printf("Sent LEFT_BUTTON_SELECT command\n");
- break;
-
- case ACTION_MOVE_RIGHT:
- cmd.cmd = DVDCmd_Right_Button_Select;
- printf("Sent RIGHT_BUTTON_SELECT command\n");
- break;
-
- case ACTION_SELECT_ITEM:
- cmd.cmd = DVDCmd_Button_Activate;
- printf("Sent BUTTON_ACTIVATE command\n");
- break;
- }
-
- SDVDResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_DVD;
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ params.action = action.GetID();
+ if (!(m_amp_media->SetupCommand(SMP_DO_ACTION, cmd, params, res)))
+ return false;
- if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
- CLog::Log(LOGERROR, "CSMPPlayer::ToFFRW:AMP command failed!");
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::OnAction");
}
#endif
return false;
};
+bool CSMPPlayer::IsInMenu() const
+{
+ return m_amp_media->MediaIsInMenu();
+}
+
+bool CSMPPlayer::HasMenu()
+{
+ return m_amp_media->MediaHasMenu();
+}
+
+bool CSMPPlayer::GetCurrentSubtitle(CStdString& strSubtitle)
+{
+ strSubtitle = "";
+ return false;
+}
+
+CStdString CSMPPlayer::GetPlayingTitle()
+{
+ return "";
+};
+
void CSMPPlayer::OnStartup()
{
//CThread::SetName("CSMPPlayer");
@@ -1418,7 +1185,8 @@ void CSMPPlayer::Process()
// we are playing but hidden and all stream fields are valid.
// check for video in media content
- if (GetVideoStreamCount() > 0 || m_item.IsDVDFile())
+ GetAmpStatus();
+ if (m_video_count > 0 || m_item.IsDVDFile())
{
// turn on/off subs
SetSubtitleVisible(g_settings.m_currentVideoSettings.m_SubtitleOn);
@@ -1460,11 +1228,8 @@ void CSMPPlayer::Process()
DFBEvent event;
m_amp_event->GetEvent(m_amp_event, &event);
- if (GetAmpStatus() && (((UMSStatus*)m_status)->generic.flags & SSTATUS_MODE) &&
- (((UMSStatus*)m_status)->generic.mode.flags & SSTATUS_MODE_STOPPED))
- {
+ if (GetAmpStatus() && m_amp_media->GetStatusState() == SMP_STOPPED)
break;
- }
}
else
{
@@ -1474,18 +1239,13 @@ void CSMPPlayer::Process()
}
// have to stop if playing before CloseMedia or bad things happen.
- if ((((UMSStatus*)m_status)->generic.mode.flags & SSTATUS_MODE_STOPPED) != SSTATUS_MODE_STOPPED)
+ if (m_amp_media->GetStatusState() != SMP_STOPPED)
{
- SLPBCommand cmd;
- cmd.dataSize = sizeof(cmd);
- cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
-
- cmd.cmd = LPBCmd_STOP;
-
- SLPBResult res;
- res.dataSize = sizeof(res);
- res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
- if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ UMSCommand cmd;
+ UMSResult res;
+ UMSParams params;
+ m_amp_media->SetupCommand(SMP_STOP, cmd, params, res);
+ if (m_amp->ExecutePresentationCmd(m_amp, &cmd.generic, &res.generic) != DFB_OK)
CLog::Log(LOGERROR, "CSMPPlayer::Process:AMP stop command failed!");
if (!IS_SUCCESS( ((SResult*)&res)->value ))
{
@@ -1496,9 +1256,6 @@ void CSMPPlayer::Process()
else
{
m_ready.Set();
- CLog::Log(LOGERROR, "CSMPPlayer::Process: WaitForAmpPlaying() failed, m_status.flags(0x%08lx), m_status.mode.flags(0x%08lx)",
- (long unsigned int)((UMSStatus*)m_status)->generic.flags,
- (long unsigned int)((UMSStatus*)m_status)->generic.mode.flags);
}
}
@@ -1517,19 +1274,11 @@ void CSMPPlayer::Process()
m_amp->CloseMedia(m_amp);
}
-int CSMPPlayer::GetVideoStreamCount()
-{
- if (GetAmpStatus())
- m_video_count = ((UMSStatus*)m_status)->lpb.media.video_streams;
- //CLog::Log(LOGDEBUG, "CSMPPlayer::GetVideoStreamCount(%d)", m_video_count);
- return m_video_count;
-}
-
bool CSMPPlayer::WaitForAmpStopped(int timeout_ms)
{
bool rtn = false;
- while (!m_bStop && (timeout_ms > 0))
+ while (!m_bStop && !rtn && (timeout_ms > 0))
{
if (m_amp_event->WaitForEventWithTimeout(m_amp_event, 0, 100) == DFB_OK)
{
@@ -1537,15 +1286,8 @@ bool CSMPPlayer::WaitForAmpStopped(int timeout_ms)
DFBEvent event;
m_amp_event->GetEvent(m_amp_event, &event);
- if (GetAmpStatus())
- {
- if ((((UMSStatus*)m_status)->generic.flags & SSTATUS_MODE) &&
- (((UMSStatus*)m_status)->generic.mode.flags & SSTATUS_MODE_STOPPED))
- {
- rtn = true;
- break;
- }
- }
+ if (GetAmpStatus() && m_amp_media->GetStatusState() == SMP_STOPPED)
+ rtn = true;
}
else
{
@@ -1562,7 +1304,7 @@ bool CSMPPlayer::WaitForAmpPlaying(int timeout_ms)
{
bool rtn = false;
- while (!m_bStop && (timeout_ms > 0))
+ while (!m_bStop && !rtn && (timeout_ms > 0))
{
if (m_amp_event->WaitForEventWithTimeout(m_amp_event, 0, 100) == DFB_OK)
{
@@ -1570,15 +1312,8 @@ bool CSMPPlayer::WaitForAmpPlaying(int timeout_ms)
DFBEvent event;
m_amp_event->GetEvent(m_amp_event, &event);
- if (GetAmpStatus())
- {
- if ((((UMSStatus*)m_status)->generic.flags & SSTATUS_MODE) &&
- (((UMSStatus*)m_status)->generic.mode.flags & SSTATUS_MODE_PLAYING))
- {
- rtn = true;
- break;
- }
- }
+ if (GetAmpStatus() && m_amp_media->GetStatusState() == SMP_PLAYING)
+ rtn = true;
}
else
{
@@ -1595,7 +1330,7 @@ bool CSMPPlayer::WaitForAmpOpenMedia(int timeout_ms)
{
bool rtn = false;
- while (!m_bStop && (timeout_ms > 0))
+ while (!m_bStop && !rtn && (timeout_ms > 0))
{
if (m_amp_event->WaitForEventWithTimeout(m_amp_event, 0, 100) == DFB_OK)
{
@@ -1603,14 +1338,8 @@ bool CSMPPlayer::WaitForAmpOpenMedia(int timeout_ms)
DFBEvent event;
m_amp_event->GetEvent(m_amp_event, &event);
- if (GetAmpStatus())
- {
- if (!IS_ERROR(((UMSStatus*)m_status)->generic.lastCmd.result))
- {
- rtn = true;
- break;
- }
- }
+ if (GetAmpStatus() && m_amp_media->GetStatusState() != SMP_ERROR)
+ rtn = true;
}
else
{
@@ -1626,18 +1355,11 @@ bool CSMPPlayer::WaitForAmpFormatValid(int timeout_ms)
{
bool rtn = false;
- while (!m_bStop && (timeout_ms > 0))
+ while (!m_bStop && !rtn && (timeout_ms > 0))
{
Sleep(100);
- if (GetAmpStatus())
- {
- if (((UMSStatus*)m_status)->lpb.video.format.formatValid ||
- ((UMSStatus*)m_status)->lpb.audio.format.formatValid)
- {
- rtn = true;
- break;
- }
- }
+ if (GetAmpStatus() && m_amp_media->GetStatusFormatValid())
+ rtn = true;
timeout_ms -= 100;
}
@@ -1670,34 +1392,19 @@ void CSMPPlayer::ShowMainVideo(bool show)
bool CSMPPlayer::GetAmpStatus()
{
- if (m_amp)
+ if (m_amp && m_amp_media)
{
- static uint32_t flags = 0;
CSingleLock lock(m_amp_status_csection);
- // get status, only update what has changed (DFB_FALSE).
- if (m_amp->UploadStatusChanges(m_amp, (SStatus*)m_status, DFB_FALSE) == DFB_OK)
+ if (m_amp_media->StatusUpdate(m_amp))
{
- int elapsed_ms = 1000 * ((UMSStatus*)m_status)->generic.elapsedTime;
- int chapter_count = 0;
- #if defined(SLPBSTATUS_CHAPTER_LIST_SIZE)
- chapter_count = ((UMSStatus*)m_status)->lpb.media.nb_chapters;
- #endif
+ int64_t elapsed_ms = 0;
+ m_amp_media->GetStatusTime(elapsed_ms, m_duration_ms);
+ int chapter_count = m_amp_media->GetStatusChapterInfo(false, m_chapters);
if ((elapsed_ms != m_elapsed_ms) || (chapter_count != m_chapter_count))
{
- #if defined(SLPBSTATUS_CHAPTER_LIST_SIZE)
if (m_chapter_count != chapter_count)
- {
- // update avi/mkv chapters.
- for (int i = 0; i < chapter_count; i++)
- {
- m_chapters[i].name = ((UMSStatus*)m_status)->lpb.media.chapterList[i].pName;
- m_chapters[i].seekto_ms = ((UMSStatus*)m_status)->lpb.media.chapterList[i].time_ms;
- }
- // update internal AFTER we update names/seekto_ms.
- m_chapter_count = chapter_count;
- }
- #endif
+ m_chapter_count = m_amp_media->GetStatusChapterInfo(true, m_chapters);
int chapter_index = 0;
// check for a chapter list and figure out which chapter we are in.
@@ -1707,27 +1414,17 @@ bool CSMPPlayer::GetAmpStatus()
chapter_index = chapter_num - 1;
// potential problem here, elapsedTime is seconds so
// it might take one second+ for us to see any chapter seeks.
- if ((elapsed_ms/1000) >= (m_chapters[chapter_index].seekto_ms/1000))
+ if ((elapsed_ms/1000) >= (m_chapters[chapter_index]->seekto_ms/1000))
break;
}
m_elapsed_ms = elapsed_ms;
m_chapter_index = chapter_index;
}
-
- m_video_index = ((UMSStatus*)m_status)->lpb.video.index;
- m_video_count = ((UMSStatus*)m_status)->lpb.media.video_streams;
-
- m_audio_index = ((UMSStatus*)m_status)->lpb.audio.index;
- m_audio_count = ((UMSStatus*)m_status)->lpb.media.audio_streams;
-
- if (flags != ((UMSStatus*)m_status)->generic.mode.flags)
- {
- CLog::Log(LOGDEBUG, "CSMPPlayer::GetAmpStatus: flags changed, old(%d), new(%d)",
- flags, ((UMSStatus*)m_status)->generic.mode.flags);
- flags = ((UMSStatus*)m_status)->generic.mode.flags;
- }
-
-
+ m_video_count = m_amp_media->GetStatusVideoInfo(m_video_index, m_video_info, m_video_codec);
+ if (m_video_count)
+ m_amp_media->GetStatusVideo(m_video_width, m_video_height, m_video_fps_numerator, m_video_fps_denominator);
+ m_audio_count = m_amp_media->GetStatusAudioInfo(m_audio_index, m_audio_info, m_audio_codec, m_audio_channels);
+ m_subtitle_count = m_amp_media->GetStatusSubTitleInfo(m_subtitle_index);
return true;
}
else
@@ -1736,6 +1433,7 @@ bool CSMPPlayer::GetAmpStatus()
return false;
}
}
+ return false;
}
#endif
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
old mode 100755
new mode 100644
index eb6b4f7..8a75550
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -30,6 +30,10 @@ typedef struct SLPBCmd_SubsParameters SLPBCmd_SubsParameters;
typedef struct _IDirectFBEventBuffer IDirectFBEventBuffer;
typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
+typedef struct SMPChapterInfo SMPChapterInfo;
+
+class CSMPMediaSpace;
+
class CSMPPlayer : public IPlayer, public CThread
{
public:
@@ -119,18 +123,18 @@ public:
//Cache filled in Percent
virtual int GetCacheLevel() const {return -1;};
- virtual bool IsInMenu() const {return false;};
- virtual bool HasMenu() {return false;};
+ virtual bool IsInMenu() const;
+ virtual bool HasMenu();
virtual void DoAudioWork() {};
virtual bool OnAction(const CAction &action);
- virtual bool GetCurrentSubtitle(CStdString& strSubtitle) {strSubtitle = ""; return false;}
+ virtual bool GetCurrentSubtitle(CStdString& strSubtitle);
//returns a state that is needed for resuming from a specific time
virtual CStdString GetPlayerState() {return "";};
virtual bool SetPlayerState(CStdString state) {return false;};
- virtual CStdString GetPlayingTitle() {return "";};
+ virtual CStdString GetPlayingTitle();
protected:
virtual void OnStartup();
@@ -138,7 +142,6 @@ protected:
virtual void Process();
private:
- int GetVideoStreamCount();
bool WaitForAmpStopped(int timeout_ms);
bool WaitForAmpPlaying(int timeout_ms);
bool WaitForAmpOpenMedia(int timeout_ms);
@@ -152,12 +155,13 @@ private:
CEvent m_ready;
CFileItem m_item;
CPlayerOptions m_options;
- CCriticalSection m_amp_command_csection;
IAdvancedMediaProvider *m_amp;
IDirectFBEventBuffer *m_amp_event;
int m_ampID;
+ CSMPMediaSpace *m_amp_media;
CCriticalSection m_amp_status_csection;
+ CCriticalSection m_amp_command_csection;
int64_t m_elapsed_ms;
int64_t m_duration_ms;
@@ -165,12 +169,15 @@ private:
int m_audio_index;
int m_audio_count;
CStdString m_audio_info;
+ CStdString m_audio_codec;
int m_audio_delay;
uint32_t m_audio_channels;
+
int m_video_index;
int m_video_count;
CStdString m_video_info;
+ CStdString m_video_codec;
int m_video_width;
int m_video_height;
float m_video_fps_numerator;
@@ -184,17 +191,11 @@ private:
int m_chapter_index;
int m_chapter_count;
- struct chapters
- {
- std::string name;
- int64_t seekto_ms;
- } m_chapters[64];
+ std::vector<SMPChapterInfo*> m_chapters;
int m_show_mainvideo;
CRect m_dst_rect;
int m_view_mode;
- // opaque smp global status
- void* m_status;
std::vector<SIdsData*> m_sub_ids;
std::vector<CStdString> m_sub_urls;
https://github.com/xbmc/xbmc/commit/3f4b23d5a0aa8a1d60510031a883dfe4fb3ca3f5
commit 3f4b23d5a0aa8a1d60510031a883dfe4fb3ca3f5
Author: theuni <theuni-nospam-@...>
Date: Tue Dec 13 03:34:58 2011 -0500
[smp] Don't bother with SM_TEXTURE_NOBLEND
The blend is free anyway, and we get a reasonable gain from avoiding the state change.
diff --git a/xbmc/guilib/GUITextureGLES.cpp b/xbmc/guilib/GUITextureGLES.cpp
index 8bc4e82..3281b94 100644
--- a/xbmc/guilib/GUITextureGLES.cpp
+++ b/xbmc/guilib/GUITextureGLES.cpp
@@ -85,7 +85,7 @@ void CGUITextureGLES::Begin(color_t color)
}
else
{
- g_Windowing.EnableGUIShader(SM_TEXTURE_NOBLEND);
+ g_Windowing.EnableGUIShader(SM_TEXTURE);
}
}
https://github.com/xbmc/xbmc/commit/45f28e69ba96dfbe14d22dfb0f963b26e65511fd
commit 45f28e69ba96dfbe14d22dfb0f963b26e65511fd
Author: theuni <theuni-nospam-@...>
Date: Tue Dec 13 03:32:59 2011 -0500
[smp] render fonts as rgba
We gain in a few ways here, and lose only a little:
1. Most drivers seem to like 32byte textures better.
2a. We can use a texture shader instead, which saves us 1 op per pixel.
2b. 2a means that we save TONS of state changes. SM_TEXTURE is now used for everything other than diffuse textures and video playback.
These add up to a reasonable fps gain.
diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp
index 26bd940..30fa40a 100755
--- a/xbmc/guilib/GUIFontTTFGL.cpp
+++ b/xbmc/guilib/GUIFontTTFGL.cpp
@@ -71,8 +71,8 @@ void CGUIFontTTFGL::Begin()
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Set the texture image -- THIS WORKS, so the pixels must be wrong.
- glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, m_texture->GetWidth(), m_texture->GetHeight(), 0,
- GL_ALPHA, GL_UNSIGNED_BYTE, m_texture->GetPixels());
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_texture->GetWidth(), m_texture->GetHeight(), 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, m_texture->GetPixels());
VerifyGLState();
m_bTextureLoaded = true;
@@ -98,7 +98,7 @@ void CGUIFontTTFGL::Begin()
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
VerifyGLState();
#else
- g_Windowing.EnableGUIShader(SM_FONTS);
+ g_Windowing.EnableGUIShader(SM_TEXTURE);
#endif
m_vertex_count = 0;
@@ -170,7 +170,7 @@ CBaseTexture* CGUIFontTTFGL::ReallocTexture(unsigned int& newHeight)
{
newHeight = CBaseTexture::PadPow2(newHeight);
- CBaseTexture* newTexture = new CTexture(m_textureWidth, newHeight, XB_FMT_A8);
+ CBaseTexture* newTexture = new CTexture(m_textureWidth, newHeight, XB_FMT_A8R8G8B8);
if (!newTexture || newTexture->GetPixels() == NULL)
{
@@ -202,14 +202,27 @@ bool CGUIFontTTFGL::CopyCharToTexture(FT_BitmapGlyph bitGlyph, Character* ch)
FT_Bitmap bitmap = bitGlyph->bitmap;
unsigned char* source = (unsigned char*) bitmap.buffer;
- unsigned char* target = (unsigned char*) m_texture->GetPixels() + (m_posY + ch->offsetY) * m_texture->GetPitch() + m_posX + bitGlyph->left;
+ unsigned char* target = (unsigned char*) m_texture->GetPixels() + ((m_posY + ch->offsetY) * m_texture->GetPitch()) + ((m_posX + bitGlyph->left) * 4);
+ int dstPitch = m_texture->GetPitch();
for (int y = 0; y < bitmap.rows; y++)
{
- memcpy(target, source, bitmap.width);
+ unsigned char *dst2 = target;
+ unsigned char *src2 = source;
+ for (int x = 0; x < bitmap.width; x++, src2++)
+ {
+ *dst2++ = 0xff;
+ *dst2++ = 0xff;
+ *dst2++ = 0xff;
+ *dst2++ = src2[0];
+ }
source += bitmap.width;
- target += m_texture->GetPitch();
+ target += dstPitch;
}
+
+
+
+
// THE SOURCE VALUES ARE THE SAME IN BOTH SITUATIONS.
// Since we have a new texture, we need to delete the old one
https://github.com/xbmc/xbmc/commit/780a16c3928c4eb648c6bd65687bf0d076d89317
commit 780a16c3928c4eb648c6bd65687bf0d076d89317
Author: theuni <theuni-nospam-@...>
Date: Sat Dec 10 17:20:16 2011 -0500
[smp] Cache GL state where possible
diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
index eb52efd..fb2fb10 100755
--- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -343,7 +343,7 @@ void CLinuxRendererGLES::LoadPlane( YUVPLANE& plane, int type, unsigned flipinde
stride = width;
}
- glBindTexture(m_textureTarget, plane.id);
+ g_Windowing.BindTexture(plane.id);
glTexSubImage2D(m_textureTarget, 0, 0, 0, width, height, type, GL_UNSIGNED_BYTE, pixelData);
/* check if we need to load any border pixels */
@@ -359,7 +359,7 @@ void CLinuxRendererGLES::LoadPlane( YUVPLANE& plane, int type, unsigned flipinde
, type, GL_UNSIGNED_BYTE
, (unsigned char*)pixelData + stride - 1);
- glBindTexture(m_textureTarget, 0);
+ g_Windowing.BindTexture(0);
plane.flipindex = flipindex;
@@ -403,8 +403,7 @@ void CLinuxRendererGLES::RenderUpdate(bool clear, DWORD flags, DWORD alpha)
g_graphicsContext.BeginPaint();
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ g_Windowing.SetBlending(true);
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
@@ -454,14 +453,13 @@ void CLinuxRendererGLES::RenderUpdate(bool clear, DWORD flags, DWORD alpha)
if (alpha<255)
{
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ g_Windowing.SetBlending(true);
if (m_pYUVShader)
m_pYUVShader->SetAlpha(alpha / 255.0f);
}
else
{
- glDisable(GL_BLEND);
+ g_Windowing.SetBlending(false);
if (m_pYUVShader)
m_pYUVShader->SetAlpha(1.0f);
}
@@ -472,7 +470,7 @@ void CLinuxRendererGLES::RenderUpdate(bool clear, DWORD flags, DWORD alpha)
Render(flags, index);
VerifyGLState();
- glEnable(GL_BLEND);
+ g_Windowing.SetBlending(true);
g_graphicsContext.EndPaint();
#if !defined(__APPLE__)
@@ -783,21 +781,21 @@ void CLinuxRendererGLES::RenderSinglePass(int index, int field)
glDisable(GL_DEPTH_TEST);
// Y
- glActiveTexture(GL_TEXTURE0);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE0);
glEnable(m_textureTarget);
- glBindTexture(m_textureTarget, planes[0].id);
+ g_Windowing.BindTexture(planes[0].id);
// U
- glActiveTexture(GL_TEXTURE1);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE1);
glEnable(m_textureTarget);
- glBindTexture(m_textureTarget, planes[1].id);
+ g_Windowing.BindTexture(planes[1].id);
// V
- glActiveTexture(GL_TEXTURE2);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE2);
glEnable(m_textureTarget);
- glBindTexture(m_textureTarget, planes[2].id);
+ g_Windowing.BindTexture(planes[2].id);
- glActiveTexture(GL_TEXTURE0);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE0);
VerifyGLState();
m_pYUVShader->SetBlack(g_settings.m_currentVideoSettings.m_Brightness * 0.01f - 0.5f);
@@ -859,13 +857,13 @@ void CLinuxRendererGLES::RenderSinglePass(int index, int field)
glDisableVertexAttribArray(Uloc);
glDisableVertexAttribArray(Vloc);
- glActiveTexture(GL_TEXTURE1);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE1);
glDisable(m_textureTarget);
- glActiveTexture(GL_TEXTURE2);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE2);
glDisable(m_textureTarget);
- glActiveTexture(GL_TEXTURE0);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE0);
glDisable(m_textureTarget);
g_matrices.MatrixMode(MM_MODELVIEW);
@@ -892,23 +890,23 @@ void CLinuxRendererGLES::RenderMultiPass(int index, int field)
// Y
glEnable(m_textureTarget);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(m_textureTarget, planes[0].id);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE0);
+ g_Windowing.BindTexture(planes[0].id);
VerifyGLState();
// U
- glActiveTexture(GL_TEXTURE1);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE1);
glEnable(m_textureTarget);
- glBindTexture(m_textureTarget, planes[1].id);
+ g_Windowing.BindTexture(planes[1].id);
VerifyGLState();
// V
- glActiveTexture(GL_TEXTURE2);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE2);
glEnable(m_textureTarget);
- glBindTexture(m_textureTarget, planes[2].id);
+ g_Windowing.BindTexture(planes[2].id);
VerifyGLState();
- glActiveTexture(GL_TEXTURE0);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE0);
VerifyGLState();
// make sure the yuv shader is loaded and ready to go
@@ -1003,16 +1001,15 @@ void CLinuxRendererGLES::RenderMultiPass(int index, int field)
VerifyGLState();
m_fbo.EndRender();
-
- glActiveTexture(GL_TEXTURE1);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE1);
glDisable(m_textureTarget);
- glActiveTexture(GL_TEXTURE2);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE2);
glDisable(m_textureTarget);
- glActiveTexture(GL_TEXTURE0);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE0);
glDisable(m_textureTarget);
glEnable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, m_fbo.Texture());
+ g_Windowing.BindTexture(m_fbo.Texture());
VerifyGLState();
// Use regular normalized texture coordinates
@@ -1071,8 +1068,8 @@ void CLinuxRendererGLES::RenderSoftware(int index, int field)
// Y
glEnable(m_textureTarget);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(m_textureTarget, planes[0].id);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE0);
+ g_Windowing.BindTexture(planes[0].id);
g_Windowing.EnableGUIShader(SM_TEXTURE_RGBA);
@@ -1133,8 +1130,8 @@ void CLinuxRendererGLES::RenderOpenMax(int index, int field)
// Y
glEnable(m_textureTarget);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(m_textureTarget, textureId);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE0);
+ g_Windowing.BindTexture(textureId);
g_Windowing.EnableGUIShader(SM_TEXTURE_RGBA);
@@ -1197,8 +1194,8 @@ void CLinuxRendererGLES::RenderCoreVideoRef(int index, int field)
glDisable(GL_DEPTH_TEST);
glEnable(m_textureTarget);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(m_textureTarget, plane.id);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE0);
+ g_Windowing.BindTexture(plane.id);
g_Windowing.EnableGUIShader(SM_TEXTURE_RGBA);
@@ -1267,7 +1264,7 @@ bool CLinuxRendererGLES::RenderCapture(CRenderCapture* capture)
m_destRect.SetRect(0, 0, (float)capture->GetWidth(), (float)capture->GetHeight());
// clear framebuffer and invert Y axis to get non-inverted image
- glDisable(GL_BLEND);
+ g_Windowing.SetBlending(false);
g_matrices.MatrixMode(MM_MODELVIEW);
g_matrices.PushMatrix();
@@ -1560,7 +1557,7 @@ bool CLinuxRendererGLES::CreateYV12Texture(int index)
if (plane.texwidth * plane.texheight == 0)
continue;
- glBindTexture(m_textureTarget, plane.id);
+ g_Windowing.BindTexture(plane.id);
if (m_renderMethod & RENDER_SW)
{
if(m_renderMethod & RENDER_POT)
@@ -1616,7 +1613,7 @@ void CLinuxRendererGLES::UploadCVRefTexture(int index)
glEnable(m_textureTarget);
VerifyGLState();
- glBindTexture(m_textureTarget, plane.id);
+ g_Windowing.BindTexture(plane.id);
#if !TARGET_OS_IPHONE
#ifdef GL_UNPACK_ROW_LENGTH
// Set row pixels
@@ -1637,7 +1634,7 @@ void CLinuxRendererGLES::UploadCVRefTexture(int index)
glPixelStorei( GL_UNPACK_ROW_LENGTH, 0);
#endif
#endif
- glBindTexture(m_textureTarget, 0);
+ g_Windowing.BindTexture(0);
glDisable(m_textureTarget);
VerifyGLState();
@@ -1693,7 +1690,7 @@ bool CLinuxRendererGLES::CreateCVRefTexture(int index)
glGenTextures(1, &plane.id);
VerifyGLState();
- glBindTexture(m_textureTarget, plane.id);
+ g_Windowing.BindTexture(plane.id);
#if !TARGET_OS_IPHONE
#ifdef GL_UNPACK_ROW_LENGTH
// Set row pixels
@@ -1719,7 +1716,7 @@ bool CLinuxRendererGLES::CreateCVRefTexture(int index)
// turn off client storage so it doesn't get picked up for the next texture
glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_FALSE);
#endif
- glBindTexture(m_textureTarget, 0);
+ g_Windowing.BindTexture(0);
glDisable(m_textureTarget);
m_eventTexturesDone[index]->Set();
@@ -1751,19 +1748,19 @@ void CLinuxRendererGLES::SetTextureFilter(GLenum method)
for (int f = FIELD_FULL; f<=FIELD_BOT ; f++)
{
- glBindTexture(m_textureTarget, fields[f][0].id);
+ g_Windowing.BindTexture(fields[f][0].id);
glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, method);
glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, method);
VerifyGLState();
if (!(m_renderMethod & RENDER_SW))
{
- glBindTexture(m_textureTarget, fields[f][1].id);
+ g_Windowing.BindTexture(fields[f][1].id);
glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, method);
glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, method);
VerifyGLState();
- glBindTexture(m_textureTarget, fields[f][2].id);
+ g_Windowing.BindTexture(fields[f][2].id);
glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, method);
glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, method);
VerifyGLState();
diff --git a/xbmc/cores/VideoRenderers/OverlayRendererGL.cpp b/xbmc/cores/VideoRenderers/OverlayRendererGL.cpp
index 7526a04..f099241 100644
--- a/xbmc/cores/VideoRenderers/OverlayRendererGL.cpp
+++ b/xbmc/cores/VideoRenderers/OverlayRendererGL.cpp
@@ -158,7 +158,11 @@ COverlayTextureGL::COverlayTextureGL(CDVDOverlayImage* o)
glGenTextures(1, &m_texture);
glEnable(GL_TEXTURE_2D);
+#ifndef HAS_GLES
glBindTexture(GL_TEXTURE_2D, m_texture);
+#else
+ g_Windowing.BindTexture(m_texture);
+#endif
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
@@ -179,7 +183,11 @@ COverlayTextureGL::COverlayTextureGL(CDVDOverlayImage* o)
, rgba);
free(rgba);
+#ifndef HAS_GLES
glBindTexture(GL_TEXTURE_2D, 0);
+#else
+ g_Windowing.BindTexture(0);
+#endif
glDisable(GL_TEXTURE_2D);
if(o->source_width && o->source_height)
@@ -236,7 +244,11 @@ COverlayTextureGL::COverlayTextureGL(CDVDOverlaySpu* o)
glGenTextures(1, &m_texture);
glEnable(GL_TEXTURE_2D);
+#ifndef HAS_GLES
glBindTexture(GL_TEXTURE_2D, m_texture);
+#else
+ g_Windowing.BindTexture(m_texture);
+#endif
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
@@ -258,7 +270,11 @@ COverlayTextureGL::COverlayTextureGL(CDVDOverlaySpu* o)
free(rgba);
+#ifndef HAS_GLES
glBindTexture(GL_TEXTURE_2D, 0);
+#else
+ g_Windowing.BindTexture(0);
+#endif
glDisable(GL_TEXTURE_2D);
m_align = ALIGN_VIDEO;
@@ -293,7 +309,11 @@ COverlayGlyphGL::COverlayGlyphGL(CDVDOverlaySSA* o, double pts)
glGenTextures(1, &m_texture);
glEnable(GL_TEXTURE_2D);
+#ifndef HAS_GLES
glBindTexture(GL_TEXTURE_2D, m_texture);
+#else
+ g_Windowing.BindTexture(m_texture);
+#endif
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
@@ -383,7 +403,11 @@ COverlayGlyphGL::COverlayGlyphGL(CDVDOverlaySSA* o, double pts)
vt += 4;
}
+#ifndef HAS_GLES
glBindTexture(GL_TEXTURE_2D, 0);
+#else
+ g_Windowing.BindTexture(0);
+#endif
glDisable(GL_TEXTURE_2D);
}
@@ -398,12 +422,13 @@ void COverlayGlyphGL::Render(SRenderState& state)
if (m_texture == 0)
return;
+#ifdef HAS_GL
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBindTexture(GL_TEXTURE_2D, m_texture);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
-#ifdef HAS_GL
+
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE);
@@ -435,6 +460,8 @@ void COverlayGlyphGL::Render(SRenderState& state)
glPopClientAttrib();
glPopMatrix();
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glDisable(GL_BLEND);
#else
g_matrices.MatrixMode(MM_MODELVIEW);
g_matrices.PushMatrix();
@@ -442,6 +469,8 @@ void COverlayGlyphGL::Render(SRenderState& state)
g_matrices.Scalef(state.width, state.height, 1.0f);
VerifyGLState();
+ g_Windowing.SetBlending(true);
+ g_Windowing.BindTexture(m_texture);
g_Windowing.EnableGUIShader(SM_FONTS);
GLint posLoc = g_Windowing.GUIShaderGetPos();
@@ -471,12 +500,13 @@ void COverlayGlyphGL::Render(SRenderState& state)
g_Windowing.DisableGUIShader();
g_matrices.PopMatrix();
+ g_Windowing.BindTexture(0);
+ g_Windowing.SetBlending(false);
#endif
- glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
+ glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
- glBindTexture(GL_TEXTURE_2D, 0);
}
@@ -488,9 +518,14 @@ COverlayTextureGL::~COverlayTextureGL()
void COverlayTextureGL::Render(SRenderState& state)
{
glEnable(GL_TEXTURE_2D);
- glEnable(GL_BLEND);
+#ifndef HAS_GLES
glBindTexture(GL_TEXTURE_2D, m_texture);
+ glEnable(GL_BLEND);
+#else
+ g_Windowing.BindTexture(m_texture);
+ g_Windowing.SetBlending(true);
+#endif
#if USE_PREMULTIPLIED_ALPHA
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
#else
@@ -535,6 +570,8 @@ void COverlayTextureGL::Render(SRenderState& state)
glTexCoord2f(0.0f, m_v);
glVertex2f(rd.left , rd.bottom);
glEnd();
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glDisable(GL_BLEND);
#else
g_Windowing.EnableGUIShader(SM_TEXTURE);
@@ -579,12 +616,13 @@ void COverlayTextureGL::Render(SRenderState& state)
glDisableVertexAttribArray(tex0Loc);
g_Windowing.DisableGUIShader();
+ g_Windowing.BindTexture(0);
+ g_Windowing.SetBlending(false);
#endif
- glDisable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, 0);
}
#endif // HAS_GL
diff --git a/xbmc/guilib/GUIFontTTFGL.cpp b/xbmc/guilib/GUIFontTTFGL.cpp
index 87e07ca..26bd940 100755
--- a/xbmc/guilib/GUIFontTTFGL.cpp
+++ b/xbmc/guilib/GUIFontTTFGL.cpp
@@ -62,7 +62,7 @@ void CGUIFontTTFGL::Begin()
glGenTextures(1, (GLuint*) &m_nTexture);
// Bind the texture object
- glBindTexture(GL_TEXTURE_2D, m_nTexture);
+ g_Windowing.BindTexture(m_nTexture);
#ifdef HAS_GL
glEnable(GL_TEXTURE_2D);
#endif
@@ -79,12 +79,11 @@ void CGUIFontTTFGL::Begin()
}
// Turn Blending On
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND);
+ g_Windowing.SetBlending(true);
#ifdef HAS_GL
glEnable(GL_TEXTURE_2D);
#endif
- glBindTexture(GL_TEXTURE_2D, m_nTexture);
+ g_Windowing.BindTexture(m_nTexture);
#ifdef HAS_GL
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_COMBINE);
@@ -164,8 +163,6 @@ void CGUIFontTTFGL::End()
glDisableVertexAttribArray(posLoc);
glDisableVertexAttribArray(colLoc);
glDisableVertexAttribArray(tex0Loc);
-
- g_Windowing.DisableGUIShader();
#endif
}
diff --git a/xbmc/guilib/GUITextureGLES.cpp b/xbmc/guilib/GUITextureGLES.cpp
index 0694e9a..8bc4e82 100644
--- a/xbmc/guilib/GUITextureGLES.cpp
+++ b/xbmc/guilib/GUITextureGLES.cpp
@@ -41,12 +41,12 @@ CGUITextureGLES::CGUITextureGLES(float posX, float posY, float width, float heig
void CGUITextureGLES::Begin(color_t color)
{
CBaseTexture* texture = m_texture.m_textures[m_currentFrame];
- glActiveTexture(GL_TEXTURE0);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE0);
texture->LoadToGPU();
if (m_diffuse.size())
m_diffuse.m_textures[0]->LoadToGPU();
- glBindTexture(GL_TEXTURE_2D, texture->GetTextureObject());
+ g_Windowing.BindTexture(texture->GetTextureObject());
// Setup Colors
for (int i = 0; i < 4; i++)
@@ -72,8 +72,8 @@ void CGUITextureGLES::Begin(color_t color)
hasAlpha |= m_diffuse.m_textures[0]->HasAlpha();
- glActiveTexture(GL_TEXTURE1);
- glBindTexture(GL_TEXTURE_2D, m_diffuse.m_textures[0]->GetTextureObject());
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE1);
+ g_Windowing.BindTexture(m_diffuse.m_textures[0]->GetTextureObject());
hasAlpha = true;
}
@@ -91,12 +91,11 @@ void CGUITextureGLES::Begin(color_t color)
if ( hasAlpha )
{
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
- glEnable( GL_BLEND );
+ g_Windowing.SetBlending(true);
}
else
{
- glDisable(GL_BLEND);
+ g_Windowing.SetBlending(false);
}
m_packedVertices.clear();
}
@@ -142,7 +141,7 @@ void CGUITextureGLES::End()
if (m_diffuse.size())
{
glDisableVertexAttribArray(tex1Loc);
- glActiveTexture(GL_TEXTURE0);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE0);
}
glDisableVertexAttribArray(posLoc);
@@ -150,8 +149,6 @@ void CGUITextureGLES::End()
glDisableVertexAttribArray(colLoc);
glDisableVertexAttribArray(tex0Loc);
- glEnable(GL_BLEND);
- g_Windowing.DisableGUIShader();
delete [] idx;
}
@@ -238,13 +235,12 @@ void CGUITextureGLES::DrawQuad(const CRect &rect, color_t color, CBaseTexture *t
{
if (texture)
{
- glActiveTexture(GL_TEXTURE0);
+ g_Windowing.SetActiveTextureUnit(GL_TEXTURE0);
texture->LoadToGPU();
- glBindTexture(GL_TEXTURE_2D, texture->GetTextureObject());
+ g_Windowing.BindTexture(texture->GetTextureObject());
}
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND); // Turn Blending On
+ g_Windowing.SetBlending(true);
VerifyGLState();
@@ -314,7 +310,6 @@ void CGUITextureGLES::DrawQuad(const CRect &rect, color_t color, CBaseTexture *t
if (texture)
glDisableVertexAttribArray(tex0Loc);
- g_Windowing.DisableGUIShader();
}
#endif
diff --git a/xbmc/pictures/SlideShowPicture.cpp b/xbmc/pictures/SlideShowPicture.cpp
index 5baa120..9a71984 100644
--- a/xbmc/pictures/SlideShowPicture.cpp
+++ b/xbmc/pictures/SlideShowPicture.cpp
@@ -772,11 +772,10 @@ void CSlideShowPic::Render(float *x, float *y, CBaseTexture* pTexture, color_t c
if (pTexture)
{
pTexture->LoadToGPU();
- glBindTexture(GL_TEXTURE_2D, pTexture->GetTextureObject());
+ g_Windowing.BindTexture(pTexture->GetTextureObject());
glEnable(GL_TEXTURE_2D);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
- glEnable(GL_BLEND); // Turn Blending On
+ g_Windowing.SetBlending(true);
g_Windowing.EnableGUIShader(SM_TEXTURE);
}
diff --git a/xbmc/rendering/gles/RenderSystemGLES.cpp b/xbmc/rendering/gles/RenderSystemGLES.cpp
index ff9122b..63b2c86 100644
--- a/xbmc/rendering/gles/RenderSystemGLES.cpp
+++ b/xbmc/rendering/gles/RenderSystemGLES.cpp
@@ -140,8 +140,13 @@ bool CRenderSystemGLES::ResetRenderSystem(int width, int height, bool fullScreen
g_matrices.MatrixMode(MM_MODELVIEW);
g_matrices.LoadIdentity();
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND); // Turn Blending On
+ m_blending = true;
+
+ glActiveTexture(GL_TEXTURE0);
+ m_textureUnit = GL_TEXTURE0;
+
glDisable(GL_DEPTH_TEST);
return true;
@@ -350,7 +355,7 @@ void CRenderSystemGLES::CaptureStateBlock()
g_matrices.MatrixMode(MM_MODELVIEW);
g_matrices.PushMatrix();
glDisable(GL_SCISSOR_TEST); // fixes FBO corruption on Macs
- glActiveTexture(GL_TEXTURE0);
+ SetActiveTextureUnit(GL_TEXTURE0);
//TODO - NOTE: Only for Screensavers & Visualisations
// glColor3f(1.0, 1.0, 1.0);
}
@@ -366,9 +371,14 @@ void CRenderSystemGLES::ApplyStateBlock()
g_matrices.PopMatrix();
g_matrices.MatrixMode(MM_MODELVIEW);
g_matrices.PopMatrix();
- glActiveTexture(GL_TEXTURE0);
- glEnable(GL_BLEND);
glEnable(GL_SCISSOR_TEST);
+ glActiveTexture(m_textureUnit);
+ glBindTexture(GL_TEXTURE_2D, m_boundTexture);
+ if (m_blending)
+ glEnable(GL_BLEND);
+ else
+ glDisable(GL_BLEND);
+
}
void CRenderSystemGLES::SetCameraPosition(const CPoint &camera, int screenWidth, int screenHeight)
@@ -553,6 +563,8 @@ void CRenderSystemGLES::InitialiseGUIShader()
void CRenderSystemGLES::EnableGUIShader(ESHADERMETHOD method)
{
+ if (m_method == method)
+ return;
m_method = method;
if (m_pGUIshader[m_method])
{
@@ -573,6 +585,37 @@ void CRenderSystemGLES::DisableGUIShader()
m_method = SM_DEFAULT;
}
+void CRenderSystemGLES::SetBlending(bool blend)
+{
+ if (blend == m_blending)
+ return;
+
+ if (blend)
+ glEnable(GL_BLEND);
+ else
+ glDisable(GL_BLEND);
+ m_blending = blend;
+}
+
+
+void CRenderSystemGLES::BindTexture(GLuint texture)
+{
+ if (texture == m_boundTexture)
+ return;
+
+ glBindTexture(GL_TEXTURE_2D, texture);
+ m_boundTexture = texture;
+}
+
+void CRenderSystemGLES::SetActiveTextureUnit(GLenum textureunit)
+{
+ if (textureunit == m_textureUnit)
+ return;
+
+ glActiveTexture(textureunit);
+ m_textureUnit = textureunit;
+}
+
GLint CRenderSystemGLES::GUIShaderGetPos()
{
if (m_pGUIshader[m_method])
diff --git a/xbmc/rendering/gles/RenderSystemGLES.h b/xbmc/rendering/gles/RenderSystemGLES.h
index 9c6966d..298c19b 100644
--- a/xbmc/rendering/gles/RenderSystemGLES.h
+++ b/xbmc/rendering/gles/RenderSystemGLES.h
@@ -82,6 +82,9 @@ public:
GLint GUIShaderGetCol();
GLint GUIShaderGetCoord0();
GLint GUIShaderGetCoord1();
+ void BindTexture(GLuint texture);
+ void SetActiveTextureUnit(GLenum textureunit);
+ void SetBlending(bool blend);
protected:
virtual void SetVSyncImpl(bool enable) = 0;
@@ -97,6 +100,10 @@ protected:
int m_width;
int m_height;
+ GLuint m_boundTexture;
+ GLenum m_textureUnit;
+ bool m_blending;
+
CStdString m_RenderExtensions;
CGUIShader **m_pGUIshader; // One GUI shader for each method
https://github.com/xbmc/xbmc/commit/8eda1dc0dc76977958571e8b2b593b0be13e23cd
commit 8eda1dc0dc76977958571e8b2b593b0be13e23cd
Author: theuni <theuni-nospam-@...>
Date: Tue Dec 13 03:41:56 2011 -0500
[smp] remove unneeded cflags
diff --git a/tools/sigma/sigma-buildroot-sdk.mk b/tools/sigma/sigma-buildroot-sdk.mk
index 9dd6c09..0bd2820 100644
--- a/tools/sigma/sigma-buildroot-sdk.mk
+++ b/tools/sigma/sigma-buildroot-sdk.mk
@@ -5,7 +5,7 @@ export XBMCSTAGE=$(BUILDROOT)/output/staging
export SYSROOT=$(BUILDROOT)/output/host/usr/mipsel-unknown-linux-gnu/sysroot
export BUILD=$(shell uname -m)-unknown-linux-gnu
export BUILDPREFIX=$(XBMCSTAGE)/usr
-export CFLAGS=-I$(XBMCSTAGE)/usr/lib/DCCHD/test/include_egl
+export CFLAGS=
export CXXFLAGS=${CFLAGS}
export CPPFLAGS=${CFLAGS}
export LDFLAGS=-Wl,--unresolved-symbols=ignore-in-shared-libs
https://github.com/xbmc/xbmc/commit/fe1d9f9fc15ef872b9ae2991baaa2b57d2574d9c
commit fe1d9f9fc15ef872b9ae2991baaa2b57d2574d9c
Author: theuni <theuni-nospam-@...>
Date: Fri Dec 9 14:59:35 2011 -0500
[smp] batch textures and their borders
Similar to how fonts are rendered. Don't render individually (max of 5), do
them all at once instead.
Increases rendering speed somewhat. Significant gains (~30%) in screens with
many elements with borders (eg settings).
diff --git a/xbmc/guilib/GUITextureGLES.cpp b/xbmc/guilib/GUITextureGLES.cpp
index de0cfb5..0694e9a 100644
--- a/xbmc/guilib/GUITextureGLES.cpp
+++ b/xbmc/guilib/GUITextureGLES.cpp
@@ -75,10 +75,6 @@ void CGUITextureGLES::Begin(color_t color)
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, m_diffuse.m_textures[0]->GetTextureObject());
- GLint tex1Loc = g_Windowing.GUIShaderGetCoord1();
- glVertexAttribPointer(tex1Loc, 2, GL_FLOAT, 0, 0, m_tex1);
- glEnableVertexAttribArray(tex1Loc);
-
hasAlpha = true;
}
else
@@ -93,20 +89,6 @@ void CGUITextureGLES::Begin(color_t color)
}
}
- GLint posLoc = g_Windowing.GUIShaderGetPos();
- GLint colLoc = g_Windowing.GUIShaderGetCol();
- GLint tex0Loc = g_Windowing.GUIShaderGetCoord0();
-
- glVertexAttribPointer(posLoc, 3, GL_FLOAT, 0, 0, m_vert);
- if(colLoc >= 0)
- glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, m_col);
- glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, 0, 0, m_tex0);
-
- glEnableVertexAttribArray(posLoc);
- if(colLoc >= 0)
- glEnableVertexAttribArray(colLoc);
- glEnableVertexAttribArray(tex0Loc);
-
if ( hasAlpha )
{
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
@@ -116,101 +98,140 @@ void CGUITextureGLES::Begin(color_t color)
{
glDisable(GL_BLEND);
}
+ m_packedVertices.clear();
}
void CGUITextureGLES::End()
{
+ if (!m_packedVertices.size())
+ return;
+
+ GLint posLoc = g_Windowing.GUIShaderGetPos();
+ GLint colLoc = g_Windowing.GUIShaderGetCol();
+ GLint tex0Loc = g_Windowing.GUIShaderGetCoord0();
+ GLint tex1Loc = g_Windowing.GUIShaderGetCoord1();
+ if(colLoc >= 0)
+ {
+ glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(PackedVertex), (char*)&m_packedVertices[0] + offsetof(PackedVertex, r));
+ glEnableVertexAttribArray(colLoc);
+ }
+ if(tex1Loc >= 0)
+ {
+ glVertexAttribPointer(tex1Loc, 2, GL_FLOAT, 0, sizeof(PackedVertex), (char*)&m_packedVertices[0] + offsetof(PackedVertex, u2));
+ glEnableVertexAttribArray(tex1Loc);
+ }
+ glVertexAttribPointer(posLoc, 3, GL_FLOAT, 0, sizeof(PackedVertex), (char*)&m_packedVertices[0] + offsetof(PackedVertex, x));
+ glEnableVertexAttribArray(posLoc);
+ glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, 0, sizeof(PackedVertex), (char*)&m_packedVertices[0] + offsetof(PackedVertex, u1));
+ glEnableVertexAttribArray(tex0Loc);
+
+ GLushort *idx;
+ idx = new GLushort[m_packedVertices.size()*6 / 4];
+ for (unsigned int i=0, size=0; i < m_packedVertices.size(); i+=4, size+=6)
+ {
+ idx[size+0] = i+0;
+ idx[size+1] = i+1;
+ idx[size+2] = i+2;
+ idx[size+3] = i+2;
+ idx[size+4] = i+3;
+ idx[size+5] = i+0;
+ }
+
+ glDrawElements(GL_TRIANGLES, m_packedVertices.size()*6 / 4, GL_UNSIGNED_SHORT, idx);
+
if (m_diffuse.size())
{
- glDisableVertexAttribArray(g_Windowing.GUIShaderGetCoord1());
+ glDisableVertexAttribArray(tex1Loc);
glActiveTexture(GL_TEXTURE0);
}
- glDisableVertexAttribArray(g_Windowing.GUIShaderGetPos());
- GLint colLoc = g_Windowing.GUIShaderGetCol();
+ glDisableVertexAttribArray(posLoc);
if(colLoc >= 0)
- glDisableVertexAttribArray(g_Windowing.GUIShaderGetCol());
- glDisableVertexAttribArray(g_Windowing.GUIShaderGetCoord0());
+ glDisableVertexAttribArray(colLoc);
+ glDisableVertexAttribArray(tex0Loc);
glEnable(GL_BLEND);
g_Windowing.DisableGUIShader();
+ delete [] idx;
}
void CGUITextureGLES::Draw(float *x, float *y, float *z, const CRect &texture, const CRect &diffuse, int orientation)
{
- GLubyte idx[4] = {0, 1, 3, 2}; //determines order of triangle strip
-
- // Setup vertex position values
- for (int i=0; i<4; i++)
- {
- m_vert[i][0] = x[i];
- m_vert[i][1] = y[i];
- m_vert[i][2] = z[i];
- }
+ PackedVertex vertices[4];
// Setup texture coordinates
//TopLeft
- m_tex0[0][0] = texture.x1;
- m_tex0[0][1] = texture.y1;
+ vertices[0].u1 = texture.x1;
+ vertices[0].v1 = texture.y1;
//TopRight
if (orientation & 4)
{
- m_tex0[1][0] = texture.x1;
- m_tex0[1][1] = texture.y2;
+ vertices[1].u1 = texture.x1;
+ vertices[1].v1 = texture.y2;
}
else
{
- m_tex0[1][0] = texture.x2;
- m_tex0[1][1] = texture.y1;
+ vertices[1].u1 = texture.x2;
+ vertices[1].v1 = texture.y1;
}
//BottomRight
- m_tex0[2][0] = texture.x2;
- m_tex0[2][1] = texture.y2;
+ vertices[2].u1 = texture.x2;
+ vertices[2].v1 = texture.y2;
//BottomLeft
if (orientation & 4)
{
- m_tex0[3][0] = texture.x2;
- m_tex0[3][1] = texture.y1;
+ vertices[3].u1 = texture.x2;
+ vertices[3].v1 = texture.y1;
}
else
{
- m_tex0[3][0] = texture.x1;
- m_tex0[3][1] = texture.y2;
+ vertices[3].u1 = texture.x1;
+ vertices[3].v1 = texture.y2;
}
if (m_diffuse.size())
{
//TopLeft
- m_tex1[0][0] = diffuse.x1;
- m_tex1[0][1] = diffuse.y1;
+ vertices[0].u2 = diffuse.x1;
+ vertices[0].v2 = diffuse.y1;
//TopRight
if (m_info.orientation & 4)
{
- m_tex1[1][0] = diffuse.x1;
- m_tex1[1][1] = diffuse.y2;
+ vertices[1].u2 = diffuse.x1;
+ vertices[1].v2 = diffuse.y2;
}
else
{
- m_tex1[1][0] = diffuse.x2;
- m_tex1[1][1] = diffuse.y1;
+ vertices[1].u2 = diffuse.x2;
+ vertices[1].v2 = diffuse.y1;
}
//BottomRight
- m_tex1[2][0] = diffuse.x2;
- m_tex1[2][1] = diffuse.y2;
+ vertices[2].u2 = diffuse.x2;
+ vertices[2].v2 = diffuse.y2;
//BottomLeft
if (m_info.orientation & 4)
{
- m_tex1[3][0] = diffuse.x2;
- m_tex1[3][1] = diffuse.y1;
+ vertices[3].u2 = diffuse.x2;
+ vertices[3].v2 = diffuse.y1;
}
else
{
- m_tex1[3][0] = diffuse.x1;
- m_tex1[3][1] = diffuse.y2;
+ vertices[3].u2 = diffuse.x1;
+ vertices[3].v2 = diffuse.y2;
}
}
- glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_BYTE, idx);
+ for (int i=0; i<4; i++)
+ {
+ vertices[i].x = x[i];
+ vertices[i].y = y[i];
+ vertices[i].z = z[i];
+ vertices[i].r = m_col[i][0];
+ vertices[i].g = m_col[i][1];
+ vertices[i].b = m_col[i][2];
+ vertices[i].a = m_col[i][3];
+ m_packedVertices.push_back(vertices[i]);
+ }
}
void CGUITextureGLES::DrawQuad(const CRect &rect, color_t color, CBaseTexture *texture, const CRect *texCoords)
diff --git a/xbmc/guilib/GUITextureGLES.h b/xbmc/guilib/GUITextureGLES.h
index 3fdb05e..8c5d6c6 100644
--- a/xbmc/guilib/GUITextureGLES.h
+++ b/xbmc/guilib/GUITextureGLES.h
@@ -31,6 +31,15 @@
#include "GUITexture.h"
+struct PackedVertex
+{
+ float x, y, z;
+ unsigned char r, g, b, a;
+ float u1, v1;
+ float u2, v2;
+};
+typedef std::vector<PackedVertex> PackedVertices;
+
class CGUITextureGLES : public CGUITextureBase
{
public:
@@ -42,9 +51,8 @@ protected:
void End();
GLubyte m_col [4][4];
- GLfloat m_vert[4][3];
- GLfloat m_tex0[4][2];
- GLfloat m_tex1[4][2];
+
+ PackedVertices m_packedVertices;
};
#endif
https://github.com/xbmc/xbmc/commit/8182d9080ee729ef1be67df046316409ac8e83a5
commit 8182d9080ee729ef1be67df046316409ac8e83a5
Author: davilla <davilla@...>
Date: Fri Dec 9 13:25:04 2011 -0500
[smp] add ability to have split gui/display resolutions. WARNING you must delete userdata/guisettings.xml as overscan settings for 1080p change
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index 1a2aeaa..4e3eda3 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -1285,14 +1285,14 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow)
case SYSTEM_SCREEN_RESOLUTION:
if (g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].bFullScreen)
strLabel.Format("%ix%i@... - %s (%02.2f fps)",
- g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iWidth,
- g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iHeight,
+ g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iScreenWidth,
+ g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iScreenHeight,
g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].fRefreshRate,
g_localizeStrings.Get(244), GetFPS());
else
strLabel.Format("%ix%i - %s (%02.2f fps)",
- g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iWidth,
- g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iHeight,
+ g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iScreenWidth,
+ g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iScreenHeight,
g_localizeStrings.Get(242), GetFPS());
return strLabel;
break;
@@ -1411,10 +1411,10 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow)
strLabel = g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].strMode;
break;
case SYSTEM_SCREEN_WIDTH:
- strLabel.Format("%i", g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].iWidth);
+ strLabel.Format("%i", g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].iScreenWidth);
break;
case SYSTEM_SCREEN_HEIGHT:
- strLabel.Format("%i", g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].iHeight);
+ strLabel.Format("%i", g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].iScreenHeight);
break;
case SYSTEM_CURRENT_WINDOW:
return g_localizeStrings.Get(g_windowManager.GetFocusedWindow());
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index e96ef2a..724f7b3 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -44,6 +44,9 @@
#include <directfb.h>
#include <iadvancedmediaprovider.h>
#include <cdefs_lpb.h>
+#ifdef HAS_RED_SUPPORT
+#include <cdefs_dvd.h>
+#endif
#include <algorithm>
@@ -51,16 +54,25 @@ union UMSStatus
{
struct SStatus generic;
struct SLPBStatus lpb;
+#ifdef HAS_RED_SUPPORT
+ struct SDVDStatus dvd;
+#endif
};
union UMSCommand
{
struct SCommand generic;
struct SLPBCommand lpb;
+#ifdef HAS_RED_SUPPORT
+ struct SDVDCommand dvd;
+#endif
};
union UMSResult
{
struct SResult generic;
struct SLPBResult lpb;
+#ifdef HAS_RED_SUPPORT
+ struct SDVDResult dvd;
+#endif
};
struct SIdsData
@@ -269,22 +281,25 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
{
format.mediaType = MTYPE_APP_DVD;
// strip if present, amp only wants to see ".../VIDEO_TS/" for path.
- if (filepath.Right(strlen("VIDEO_TS.IFO")).Equals("VIDEO_TS.IFO"));
- filepath = filepath.Left(filepath.size() - strlen("VIDEO_TS.IFO"));
+ if (filepath.Right(strlen("/VIDEO_TS/VIDEO_TS.IFO")).Equals("/VIDEO_TS/VIDEO_TS.IFO"));
+ filepath = filepath.Left(filepath.size() - strlen("/VIDEO_TS/VIDEO_TS.IFO"));
+ ids_url = filepath;
}
else
format.mediaType = MTYPE_APP_UNKNOWN;
}
CLog::Log(LOGDEBUG, "CSMPPlayer: Opening: %s", filepath.c_str());
- // use amp ids method to handle xbmc's vfs
- SIdsData ids;
- char c_str[64];
- // setup the IDataSource cookie, CloseMedia will delete it
- ids.src = new CFileIDataSource(filepath);
- snprintf(c_str, sizeof(c_str)/sizeof(char), "ids://0x%08lx", (long unsigned int)&ids);
- ids_url = c_str;
-
+ if (ids_url.empty())
+ {
+ // use amp ids method to handle xbmc's vfs
+ SIdsData ids;
+ char c_str[64];
+ // setup the IDataSource cookie, CloseMedia will delete it
+ ids.src = new CFileIDataSource(filepath);
+ snprintf(c_str, sizeof(c_str)/sizeof(char), "ids://0x%08lx", (long unsigned int)&ids);
+ ids_url = c_str;
+ }
// Setup open parameters
struct SLPBOpenParams parameters = {0, };
parameters.zero = 0;
@@ -935,22 +950,50 @@ void CSMPPlayer::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
return;
}
- CRect gui;
+ // when running 1080p display size,
+ // gui is at 720p but m_dst_rect is relative to gui.
+ // need to scale up m_dst_rect to display size as video decodes
+ // to separate video plane that is at display size.
+ CRect gui, display, dst_rect;
RESOLUTION res = g_graphicsContext.GetVideoResolution();
gui.SetRect(0, 0, g_settings.m_ResInfo[res].iWidth, g_settings.m_ResInfo[res].iHeight);
- if (!gui.PtInRect(CPoint(m_dst_rect.x1, m_dst_rect.y1)))
+ // bug in directfb/smp handling of SetScreenRectangle on video layer
+ // when gui size is different from display. After SetScreenRectangle
+ // video is too large when gui is 720p and display is 1080p.
+ display.SetRect(0, 0, g_settings.m_ResInfo[res].iWidth, g_settings.m_ResInfo[res].iHeight);
+ //display.SetRect(0, 0, g_settings.m_ResInfo[res].iScreenWidth, g_settings.m_ResInfo[res].iScreenHeight);
+
+ dst_rect = m_dst_rect;
+ if (gui != display)
+ {
+ float xscale = display.Width() / gui.Width();
+ float yscale = display.Height() / gui.Height();
+ dst_rect.x1 *= xscale;
+ dst_rect.x2 *= xscale;
+ dst_rect.y1 *= yscale;
+ dst_rect.y2 *= yscale;
+ }
+
+ // destination rectangle cannot be outside display bounds
+ if (!display.PtInRect(CPoint(dst_rect.x1, dst_rect.y1)))
return;
- if (!gui.PtInRect(CPoint(m_dst_rect.x2, m_dst_rect.y2)))
+ if (!display.PtInRect(CPoint(dst_rect.x2, dst_rect.y2)))
return;
+ CStdString rectangle;
+ rectangle.Format("%i,%i,%i,%i",
+ (int)dst_rect.x1, (int)dst_rect.y1,
+ (int)dst_rect.Width(), (int)dst_rect.Height());
+ printf("CSMPPlayer::SetVideoRect:m_dst_rect(%s)\n", rectangle.c_str());
+
ShowMainVideo(false);
IDirectFB *dfb = g_Windowing.GetIDirectFB();
+ DFBDisplayLayerConfig dlcfg;
IDirectFBDisplayLayer *dfb_layer;
dfb->GetDisplayLayer(dfb, XBMC_MAINVIDEO, &dfb_layer);
dfb_layer->SetCooperativeLevel(dfb_layer, DLSCL_EXCLUSIVE);
-
- dfb_layer->SetScreenRectangle(dfb_layer, m_dst_rect.x1, m_dst_rect.y1, m_dst_rect.Width(), m_dst_rect.Height());
+ dfb_layer->SetScreenRectangle(dfb_layer, dst_rect.x1, dst_rect.y1, dst_rect.Width(), dst_rect.Height());
// the dest rect change will sometimes glitch, try to wait it out.
for (int i = 0; i < 6; i++)
dfb_layer->WaitForSync(dfb_layer);
@@ -1250,6 +1293,53 @@ void CSMPPlayer::ToFFRW(int iSpeed)
bool CSMPPlayer::OnAction(const CAction &action)
{
CLog::Log(LOGDEBUG, "%s - action id = %d", __FUNCTION__, action.GetID());
+#ifdef HAS_RED_SUPPORT
+ if (m_item.IsDVDFile())
+ {
+ SDVDStatus cmd;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_DVD;
+
+ switch(action.GetID())
+ {
+ default:
+ return false;
+ break;
+
+ case ACTION_MOVE_UP:
+ cmd.cmd = DVDCmd_Upper_Button_Select;
+ printf("Sent UPPER_BUTTON_SELECT command\n");
+ break;
+
+ case ACTION_MOVE_DOWN:
+ cmd.cmd = DVDCmd_Lower_Button_Select;
+ printf("Sent LOWER_BUTTON_SELECT command\n");
+ break;
+
+ case ACTION_MOVE_LEFT:
+ cmd.cmd = DVDCmd_Left_Button_Select;
+ printf("Sent LEFT_BUTTON_SELECT command\n");
+ break;
+
+ case ACTION_MOVE_RIGHT:
+ cmd.cmd = DVDCmd_Right_Button_Select;
+ printf("Sent RIGHT_BUTTON_SELECT command\n");
+ break;
+
+ case ACTION_SELECT_ITEM:
+ cmd.cmd = DVDCmd_Button_Activate;
+ printf("Sent BUTTON_ACTIVATE command\n");
+ break;
+ }
+
+ SDVDResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_DVD;
+
+ if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::ToFFRW:AMP command failed!");
+ }
+#endif
return false;
};
diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp
index f222e1d..8acca7d 100644
--- a/xbmc/guilib/GraphicContext.cpp
+++ b/xbmc/guilib/GraphicContext.cpp
@@ -532,6 +532,8 @@ void CGraphicContext::ResetScreenParameters(RESOLUTION res)
default:
break;
}
+ g_settings.m_ResInfo[res].iScreenWidth = g_settings.m_ResInfo[res].iWidth;
+ g_settings.m_ResInfo[res].iScreenHeight = g_settings.m_ResInfo[res].iHeight;
ResetOverscan(res, g_settings.m_ResInfo[res].Overscan);
}
diff --git a/xbmc/guilib/JpegIO.cpp b/xbmc/guilib/JpegIO.cpp
index 79682a4..b22b398 100644
--- a/xbmc/guilib/JpegIO.cpp
+++ b/xbmc/guilib/JpegIO.cpp
@@ -198,8 +198,8 @@ bool CJpegIO::Open(const CStdString &texturePath, unsigned int minx, unsigned in
the gpu can hold, use the previous one.*/
if (m_minx == 0 || m_miny == 0)
{
- m_minx = g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iWidth;
- m_miny = g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iHeight;
+ m_minx = g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iScreenWidth;
+ m_miny = g_settings.m_ResInfo[g_guiSettings.m_LookAndFeelResolution].iScreenHeight;
}
m_cinfo.scale_denom = 8;
m_cinfo.out_color_space = JCS_RGB;
diff --git a/xbmc/guilib/Resolution.h b/xbmc/guilib/Resolution.h
index dc8fbc4..bc86435 100644
--- a/xbmc/guilib/Resolution.h
+++ b/xbmc/guilib/Resolution.h
@@ -85,6 +85,8 @@ struct RESOLUTION_INFO
int iScreen;
int iWidth;
int iHeight;
+ int iScreenWidth;
+ int iScreenHeight;
int iSubtitles;
uint32_t dwFlags;
float fPixelRatio;
@@ -97,6 +99,8 @@ public:
{
iWidth = width;
iHeight = height;
+ iScreenWidth = width;
+ iScreenHeight = height;
fPixelRatio = aspect ? ((float)width)/height / aspect : 1.0f;
strMode = mode;
bFullScreen = true;
@@ -111,6 +115,7 @@ public:
{
Overscan = res.Overscan; bFullScreen = res.bFullScreen;
iScreen = res.iScreen; iWidth = res.iWidth; iHeight = res.iHeight;
+ iScreenWidth = res.iScreenWidth; iScreenHeight = res.iScreenHeight;
iSubtitles = res.iSubtitles; dwFlags = res.dwFlags;
fPixelRatio = res.fPixelRatio; fRefreshRate = res.fRefreshRate;
strMode = res.strMode; strOutput = res.strOutput; strId = res.strId;
diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp
index 2ebbd70..3a24c56 100644
--- a/xbmc/settings/GUISettings.cpp
+++ b/xbmc/settings/GUISettings.cpp
@@ -370,7 +370,8 @@ void CGUISettings::Initialize()
#else
// this setting would ideally not be saved, as its value is systematically derived from videoscreen.screenmode.
// contains a DISPLAYMODE
- AddInt(vs, "videoscreen.screen", 240, 0, -1, 1, g_Windowing.GetNumScreens(), SPIN_CONTROL_TEXT);
+ bool showhide = true;
+ AddInt(showhide ? vs : NULL, "videoscreen.screen", 240, 0, -1, 1, g_Windowing.GetNumScreens(), SPIN_CONTROL_TEXT);
// this setting would ideally not be saved, as its value is systematically derived from videoscreen.screenmode.
// contains an index to the g_settings.m_ResInfo array. the only meaningful fields are iScreen, iWidth, iHeight.
#if defined (__APPLE__)
@@ -1356,7 +1357,7 @@ RESOLUTION CGUISettings::GetResFromString(const CStdString &res)
const RESOLUTION_INFO &info = g_settings.m_ResInfo[i];
if (info.iScreen != screen)
continue;
- float score = 10*(square_error((float)info.iWidth, (float)width) + square_error((float)info.iHeight, (float)height)) + square_error(info.fRefreshRate, refresh);
+ float score = 10*(square_error((float)info.iScreenWidth, (float)width) + square_error((float)info.iScreenHeight, (float)height)) + square_error(info.fRefreshRate, refresh);
if (score < bestScore)
{
bestScore = score;
@@ -1378,7 +1379,7 @@ void CGUISettings::SetResolution(RESOLUTION res)
else if (res >= RES_CUSTOM && res < (RESOLUTION)g_settings.m_ResInfo.size())
{
const RESOLUTION_INFO &info = g_settings.m_ResInfo[res];
- mode.Format("%1i%05i%05i%09.5f", info.iScreen, info.iWidth, info.iHeight, info.fRefreshRate);
+ mode.Format("%1i%05i%05i%09.5f", info.iScreen, info.iScreenWidth, info.iScreenHeight, info.fRefreshRate);
}
else
{
diff --git a/xbmc/settings/GUIWindowSettingsCategory.cpp b/xbmc/settings/GUIWindowSettingsCategory.cpp
index fc68c39..bde056e 100644
--- a/xbmc/settings/GUIWindowSettingsCategory.cpp
+++ b/xbmc/settings/GUIWindowSettingsCategory.cpp
@@ -2353,7 +2353,8 @@ void CGUIWindowSettingsCategory::FillInResolutions(CStdString strSetting, Displa
RESOLUTION_INFO res1 = g_settings.m_ResInfo[res];
RESOLUTION_INFO res2 = g_settings.m_ResInfo[resolutions[idx].ResInfo_Index];
- if (res1.iScreen == res2.iScreen && res1.iWidth == res2.iWidth && res1.iHeight == res2.iHeight)
+ if (res1.iScreen == res2.iScreen &&
+ res1.iScreenWidth == res2.iScreenWidth && res1.iScreenHeight == res2.iScreenHeight)
spinres = (RESOLUTION) resolutions[idx].ResInfo_Index;
}
}
@@ -2389,11 +2390,11 @@ void CGUIWindowSettingsCategory::FillInResolutions(CStdString strSetting, Displa
void CGUIWindowSettingsCategory::FillInRefreshRates(CStdString strSetting, RESOLUTION res, bool UserChange)
{
- // The only meaningful parts of res here are iScreen, iWidth, iHeight
+ // The only meaningful parts of res here are iScreen, iScreenWidth, iScreenHeight
vector<REFRESHRATE> refreshrates;
if (res > RES_WINDOW)
- refreshrates = g_Windowing.RefreshRates(g_settings.m_ResInfo[res].iScreen, g_settings.m_ResInfo[res].iWidth, g_settings.m_ResInfo[res].iHeight);
+ refreshrates = g_Windowing.RefreshRates(g_settings.m_ResInfo[res].iScreen, g_settings.m_ResInfo[res].iScreenWidth, g_settings.m_ResInfo[res].iScreenHeight);
// The control setting doesn't exist when not in standalone mode, don't manipulate it
CBaseSettingControl *control = GetSetting(strSetting);
@@ -2450,7 +2451,7 @@ void CGUIWindowSettingsCategory::OnRefreshRateChanged(RESOLUTION nextRes)
g_guiSettings.SetResolution(nextRes);
g_graphicsContext.SetVideoResolution(nextRes);
- if (!CGUIDialogYesNo::ShowAndGetInput(13110, 13111, 20022, 20022, -1, -1, cancelled, 10000))
+ if (!CGUIDialogYesNo::ShowAndGetInput(13110, 13111, 20022, 20022, -1, -1, cancelled, 20000))
{
g_guiSettings.SetResolution(lastRes);
g_graphicsContext.SetVideoResolution(lastRes);
diff --git a/xbmc/settings/GUIWindowSettingsScreenCalibration.cpp b/xbmc/settings/GUIWindowSettingsScreenCalibration.cpp
index e26fc65..52bbdc4 100644
--- a/xbmc/settings/GUIWindowSettingsScreenCalibration.cpp
+++ b/xbmc/settings/GUIWindowSettingsScreenCalibration.cpp
@@ -351,12 +351,12 @@ void CGUIWindowSettingsScreenCalibration::UpdateFromControl(int iControl)
// set the label control correctly
CStdString strText;
if (g_settings.m_ResInfo[m_Res[m_iCurRes]].bFullScreen)
- strText.Format("%ix%i@... - %s | %s", g_settings.m_ResInfo[m_Res[m_iCurRes]].iWidth,
- g_settings.m_ResInfo[m_Res[m_iCurRes]].iHeight, g_settings.m_ResInfo[m_Res[m_iCurRes]].fRefreshRate,
+ strText.Format("%ix%i@... - %s | %s", g_settings.m_ResInfo[m_Res[m_iCurRes]].iScreenWidth,
+ g_settings.m_ResInfo[m_Res[m_iCurRes]].iScreenHeight, g_settings.m_ResInfo[m_Res[m_iCurRes]].fRefreshRate,
g_localizeStrings.Get(244).c_str(), strStatus.c_str());
else
- strText.Format("%ix%i - %s | %s", g_settings.m_ResInfo[m_Res[m_iCurRes]].iWidth,
- g_settings.m_ResInfo[m_Res[m_iCurRes]].iHeight,
+ strText.Format("%ix%i - %s | %s", g_settings.m_ResInfo[m_Res[m_iCurRes]].iScreenWidth,
+ g_settings.m_ResInfo[m_Res[m_iCurRes]].iScreenHeight,
g_localizeStrings.Get(242).c_str(), strStatus.c_str());
SET_CONTROL_LABEL(CONTROL_LABEL_ROW1, strText);
diff --git a/xbmc/video/windows/GUIWindowFullScreen.cpp b/xbmc/video/windows/GUIWindowFullScreen.cpp
index 486ae8a..6c957f8 100644
--- a/xbmc/video/windows/GUIWindowFullScreen.cpp
+++ b/xbmc/video/windows/GUIWindowFullScreen.cpp
@@ -869,13 +869,13 @@ void CGUIWindowFullScreen::FrameMove()
CStdString strStatus;
if (g_settings.m_ResInfo[iResolution].bFullScreen)
strStatus.Format("%s %ix%i@... - %s",
- g_localizeStrings.Get(13287), g_settings.m_ResInfo[iResolution].iWidth,
- g_settings.m_ResInfo[iResolution].iHeight, g_settings.m_ResInfo[iResolution].fRefreshRate,
+ g_localizeStrings.Get(13287), g_settings.m_ResInfo[iResolution].iScreenWidth,
+ g_settings.m_ResInfo[iResolution].iScreenHeight, g_settings.m_ResInfo[iResolution].fRefreshRate,
g_localizeStrings.Get(244));
else
strStatus.Format("%s %ix%i - %s",
- g_localizeStrings.Get(13287), g_settings.m_ResInfo[iResolution].iWidth,
- g_settings.m_ResInfo[iResolution].iHeight, g_localizeStrings.Get(242));
+ g_localizeStrings.Get(13287), g_settings.m_ResInfo[iResolution].iScreenWidth,
+ g_settings.m_ResInfo[iResolution].iScreenHeight, g_localizeStrings.Get(242));
CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), LABEL_ROW3);
msg.SetLabel(strStatus);
diff --git a/xbmc/windowing/WinSystem.cpp b/xbmc/windowing/WinSystem.cpp
index 99671ae..6902c59 100644
--- a/xbmc/windowing/WinSystem.cpp
+++ b/xbmc/windowing/WinSystem.cpp
@@ -63,6 +63,8 @@ void CWinSystemBase::UpdateDesktopResolution(RESOLUTION_INFO& newRes, int screen
newRes.fPixelRatio = 1.0f;
newRes.iWidth = width;
newRes.iHeight = height;
+ newRes.iScreenWidth = width;
+ newRes.iScreenHeight = height;
newRes.strMode.Format("%dx%d", width, height);
if (refreshRate > 1)
newRes.strMode.Format("%s @ %.2f%s - Full Screen", newRes.strMode, refreshRate, dwFlags & D3DPRESENTFLAG_INTERLACED ? "i" : "");
@@ -78,6 +80,8 @@ void CWinSystemBase::UpdateResolutions()
window.iWidth = 720;
if (window.iHeight == 0)
window.iHeight = 480;
+ window.iScreenWidth = window.iWidth;
+ window.iScreenHeight = window.iHeight;
if (window.iSubtitles == 0)
window.iSubtitles = (int)(0.965 * window.iHeight);
window.fPixelRatio = 1.0f;
@@ -89,6 +93,8 @@ void CWinSystemBase::SetWindowResolution(int width, int height)
RESOLUTION_INFO& window = g_settings.m_ResInfo[RES_WINDOW];
window.iWidth = width;
window.iHeight = height;
+ window.iScreenWidth = width;
+ window.iScreenHeight = height;
window.iSubtitles = (int)(0.965 * window.iHeight);
g_graphicsContext.ResetOverscan(window);
}
@@ -104,8 +110,8 @@ int CWinSystemBase::DesktopResolution(int screen)
static void AddResolution(vector<RESOLUTION_WHR> &resolutions, unsigned int addindex)
{
- int width = g_settings.m_ResInfo[addindex].iWidth;
- int height = g_settings.m_ResInfo[addindex].iHeight;
+ int width = g_settings.m_ResInfo[addindex].iScreenWidth;
+ int height = g_settings.m_ResInfo[addindex].iScreenHeight;
for (unsigned int idx = 0; idx < resolutions.size(); idx++)
if (resolutions[idx].width == width && resolutions[idx].height == height)
@@ -161,8 +167,8 @@ vector<REFRESHRATE> CWinSystemBase::RefreshRates(int screen, int width, int heig
for (unsigned int idx = RES_DESKTOP; idx < g_settings.m_ResInfo.size(); idx++)
if ( g_settings.m_ResInfo[idx].iScreen == screen
- && g_settings.m_ResInfo[idx].iWidth == width
- && g_settings.m_ResInfo[idx].iHeight == height)
+ && g_settings.m_ResInfo[idx].iScreenWidth == width
+ && g_settings.m_ResInfo[idx].iScreenHeight == height)
AddRefreshRate(refreshrates, idx);
// Can't assume a sort order
diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp
index 4287a04..7801d4c 100644
--- a/xbmc/windowing/X11/WinSystemX11.cpp
+++ b/xbmc/windowing/X11/WinSystemX11.cpp
@@ -246,6 +246,8 @@ void CWinSystemX11::UpdateResolutions()
RESOLUTION_INFO res;
res.iWidth = mode.w;
res.iHeight = mode.h;
+ res.iScreenWidth = mode.w;
+ res.iScreenHeight = mode.h;
if (mode.h>0 && mode.w>0 && out.hmm>0 && out.wmm>0)
res.fPixelRatio = ((float)out.wmm/(float)mode.w) / (((float)out.hmm/(float)mode.h));
else
diff --git a/xbmc/windowing/X11/WinSystemX11GLES.cpp b/xbmc/windowing/X11/WinSystemX11GLES.cpp
index a94906d..d1afe27 100644
--- a/xbmc/windowing/X11/WinSystemX11GLES.cpp
+++ b/xbmc/windowing/X11/WinSystemX11GLES.cpp
@@ -307,6 +307,8 @@ void CWinSystemX11GLES::UpdateResolutions()
RESOLUTION_INFO res;
res.iWidth = mode.w;
res.iHeight = mode.h;
+ res.iScreenWidth = mode.w;
+ res.iScreenHeight = mode.h;
if (mode.h>0 && mode.w>0 && out.hmm>0 && out.wmm>0)
res.fPixelRatio = ((float)out.wmm/(float)mode.w) / (((float)out.hmm/(float)mode.h));
else
diff --git a/xbmc/windowing/dfb/WinSystemDFB.cpp b/xbmc/windowing/dfb/WinSystemDFB.cpp
index 92487a2..50d82e2 100755
--- a/xbmc/windowing/dfb/WinSystemDFB.cpp
+++ b/xbmc/windowing/dfb/WinSystemDFB.cpp
@@ -97,7 +97,6 @@ bool CWinSystemDFB::DestroyWindowSystem()
bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction)
{
- CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow");
m_nWidth = res.iWidth;
m_nHeight = res.iHeight;
m_bFullScreen = fullScreen;
@@ -107,7 +106,7 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
// change the output display to match
DFBScreenOutputSignals out_signal;
- if (m_nWidth == 1920 && m_nHeight == 1080)
+ if (res.iScreenWidth == 1920 && res.iScreenHeight == 1080)
out_signal = DSOS_1080p;
else
out_signal = DSOS_720p;
@@ -137,11 +136,11 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
}
DFBDisplayLayerConfig dlcfg;
+
// setup GUI layer
- m_dfb->GetDisplayLayer(m_dfb, DLID_PRIMARY, &m_dfb_layer);
+ m_dfb->GetDisplayLayer(m_dfb, XBMC_OSD, &m_dfb_layer);
m_dfb_layer->SetCooperativeLevel(m_dfb_layer, DLSCL_ADMINISTRATIVE);
m_dfb_layer->GetConfiguration(m_dfb_layer, &dlcfg);
-
dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT);
//dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_OPTIONS | DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT);
//dlcfg.options = DLOP_ALPHACHANNEL;
@@ -151,19 +150,32 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
dlcfg.height = m_nHeight;
m_dfb_layer->SetConfiguration(m_dfb_layer, &dlcfg);
m_dfb_layer->SetOpacity(m_dfb_layer, 0xFF);
-
CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow: DisplayLayer width(%d), height(%d)",
dlcfg.width, dlcfg.height);
+ // setup EGL
m_dfb_layer->GetSurface(m_dfb_layer, &m_dfb_surface);
int width, height;
m_dfb_surface->GetSize(m_dfb_surface, &width, &height);
- CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow: Surface width(%d), height(%d)",
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow: Surface(EGL) width(%d), height(%d)",
width, height);
-
if (!m_eglBinding->CreateWindow((EGLNativeDisplayType)m_dfb, (NativeWindowType)m_dfb_surface))
return false;
+ // setup video layer
+ IDirectFBDisplayLayer *dfb_videolayer;
+ m_dfb->GetDisplayLayer(m_dfb, XBMC_MAINVIDEO, &dfb_videolayer);
+ dfb_videolayer->SetCooperativeLevel(dfb_videolayer, DLSCL_ADMINISTRATIVE);
+ dfb_videolayer->GetConfiguration(dfb_videolayer, &dlcfg);
+ dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_WIDTH | DLCONF_HEIGHT);
+ dlcfg.width = res.iScreenWidth;
+ dlcfg.height = res.iScreenHeight;
+ dfb_videolayer->SetConfiguration(dfb_videolayer, &dlcfg);
+ dfb_videolayer->SetScreenRectangle(dfb_videolayer, 0, 0, res.iScreenWidth, res.iScreenHeight);
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow: VideoLayer width(%d), height(%d)",
+ dlcfg.width, dlcfg.height);
+ dfb_videolayer->Release(dfb_videolayer);
+
m_bWindowCreated = true;
return true;
@@ -226,18 +238,23 @@ void CWinSystemDFB::UpdateResolutions()
i, enc_desc[i].out_signals, enc_desc[i].tv_standards);
}
}
- int w = 1280;
- int h = 720;
+
int display = 0;
+ uint32_t flags = 0;
double fps = 59.94;
- UpdateDesktopResolution(g_settings.m_ResInfo[RES_DESKTOP], display, w, h, fps);
+ int gui_w = 1280;
+ int gui_h = 720;
+ UpdateDesktopResolution(g_settings.m_ResInfo[RES_DESKTOP], display, gui_w, gui_h, fps, flags);
RESOLUTION_INFO res;
- w = 1920;
- h = 1080;
- fps = 59.94;
- UpdateDesktopResolution(res, display, w, h, fps);
- g_graphicsContext.ResetOverscan(res);
+ fps = 59.94;
+ gui_w = 1280;
+ gui_h = 720;
+ UpdateDesktopResolution(res, display, gui_w, gui_h, fps, flags);
+ res.iScreenWidth = 1920;
+ res.iScreenHeight = 1080;
+ res.strMode.Format("%dx%d @ %.2f%s - Full Screen",
+ res.iScreenWidth, res.iScreenHeight, res.fRefreshRate, flags & D3DPRESENTFLAG_INTERLACED ? "i" : "");
g_settings.m_ResInfo.push_back(res);
}
https://github.com/xbmc/xbmc/commit/399e8853d4b6b1bbcecd95b24d20797dfc4053ab
commit 399e8853d4b6b1bbcecd95b24d20797dfc4053ab
Author: davilla <davilla@...>
Date: Thu Dec 8 16:26:29 2011 -0500
[smp] fixed, EPC_SMPPLAYER must be before EPC_EXTPLAYER
diff --git a/xbmc/cores/playercorefactory/PlayerCoreFactory.h b/xbmc/cores/playercorefactory/PlayerCoreFactory.h
old mode 100644
new mode 100755
index d239ab3..cf32796
--- a/xbmc/cores/playercorefactory/PlayerCoreFactory.h
+++ b/xbmc/cores/playercorefactory/PlayerCoreFactory.h
@@ -37,8 +37,8 @@ enum EPLAYERCORES
EPC_DVDPLAYER,
EPC_MPLAYER,
EPC_PAPLAYER,
+ EPC_SMPPLAYER,
EPC_EXTPLAYER,
- EPC_SMPPLAYER
};
typedef unsigned int PLAYERCOREID;
https://github.com/xbmc/xbmc/commit/2b7ca1311317d641e309af86245d7ec741014b34
commit 2b7ca1311317d641e309af86245d7ec741014b34
Author: davilla <davilla@...>
Date: Thu Nov 24 00:16:40 2011 -0500
[smp] 1) fixed busy/wait dialog during video playback startup. 2) guard GetAmpStatus.
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 8ec13df..e96ef2a 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -422,7 +422,7 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
CGUIDialogBusy *dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
dialog->Show();
while(!m_ready.WaitMSec(1))
- g_windowManager.Process(false);
+ g_windowManager.ProcessRenderLoop(false);
dialog->Close();
}
@@ -1580,68 +1580,71 @@ void CSMPPlayer::ShowMainVideo(bool show)
bool CSMPPlayer::GetAmpStatus()
{
- static uint32_t flags = 0;
- CSingleLock lock(m_amp_status_csection);
-
- // get status, only update what has changed (DFB_FALSE).
- if (m_amp->UploadStatusChanges(m_amp, (SStatus*)m_status, DFB_FALSE) == DFB_OK)
+ if (m_amp)
{
- int elapsed_ms = 1000 * ((UMSStatus*)m_status)->generic.elapsedTime;
- int chapter_count = 0;
-#if defined(SLPBSTATUS_CHAPTER_LIST_SIZE)
- chapter_count = ((UMSStatus*)m_status)->lpb.media.nb_chapters;
-#endif
- if ((elapsed_ms != m_elapsed_ms) || (chapter_count != m_chapter_count))
+ static uint32_t flags = 0;
+ CSingleLock lock(m_amp_status_csection);
+
+ // get status, only update what has changed (DFB_FALSE).
+ if (m_amp->UploadStatusChanges(m_amp, (SStatus*)m_status, DFB_FALSE) == DFB_OK)
{
-#if defined(SLPBSTATUS_CHAPTER_LIST_SIZE)
- if (m_chapter_count != chapter_count)
+ int elapsed_ms = 1000 * ((UMSStatus*)m_status)->generic.elapsedTime;
+ int chapter_count = 0;
+ #if defined(SLPBSTATUS_CHAPTER_LIST_SIZE)
+ chapter_count = ((UMSStatus*)m_status)->lpb.media.nb_chapters;
+ #endif
+ if ((elapsed_ms != m_elapsed_ms) || (chapter_count != m_chapter_count))
{
- // update avi/mkv chapters.
- for (int i = 0; i < chapter_count; i++)
+ #if defined(SLPBSTATUS_CHAPTER_LIST_SIZE)
+ if (m_chapter_count != chapter_count)
{
- m_chapters[i].name = ((UMSStatus*)m_status)->lpb.media.chapterList[i].pName;
- m_chapters[i].seekto_ms = ((UMSStatus*)m_status)->lpb.media.chapterList[i].time_ms;
+ // update avi/mkv chapters.
+ for (int i = 0; i < chapter_count; i++)
+ {
+ m_chapters[i].name = ((UMSStatus*)m_status)->lpb.media.chapterList[i].pName;
+ m_chapters[i].seekto_ms = ((UMSStatus*)m_status)->lpb.media.chapterList[i].time_ms;
+ }
+ // update internal AFTER we update names/seekto_ms.
+ m_chapter_count = chapter_count;
}
- // update internal AFTER we update names/seekto_ms.
- m_chapter_count = chapter_count;
- }
-#endif
+ #endif
- int chapter_index = 0;
- // check for a chapter list and figure out which chapter we are in.
- // chapter_index is zero based here.
- for (int chapter_num = m_chapter_count; chapter_num > 0; chapter_num--)
- {
- chapter_index = chapter_num - 1;
- // potential problem here, elapsedTime is seconds so
- // it might take one second+ for us to see any chapter seeks.
- if ((elapsed_ms/1000) >= (m_chapters[chapter_index].seekto_ms/1000))
- break;
+ int chapter_index = 0;
+ // check for a chapter list and figure out which chapter we are in.
+ // chapter_index is zero based here.
+ for (int chapter_num = m_chapter_count; chapter_num > 0; chapter_num--)
+ {
+ chapter_index = chapter_num - 1;
+ // potential problem here, elapsedTime is seconds so
+ // it might take one second+ for us to see any chapter seeks.
+ if ((elapsed_ms/1000) >= (m_chapters[chapter_index].seekto_ms/1000))
+ break;
+ }
+ m_elapsed_ms = elapsed_ms;
+ m_chapter_index = chapter_index;
}
- m_elapsed_ms = elapsed_ms;
- m_chapter_index = chapter_index;
- }
- m_video_index = ((UMSStatus*)m_status)->lpb.video.index;
- m_video_count = ((UMSStatus*)m_status)->lpb.media.video_streams;
+ m_video_index = ((UMSStatus*)m_status)->lpb.video.index;
+ m_video_count = ((UMSStatus*)m_status)->lpb.media.video_streams;
- m_audio_index = ((UMSStatus*)m_status)->lpb.audio.index;
- m_audio_count = ((UMSStatus*)m_status)->lpb.media.audio_streams;
+ m_audio_index = ((UMSStatus*)m_status)->lpb.audio.index;
+ m_audio_count = ((UMSStatus*)m_status)->lpb.media.audio_streams;
- if (flags != ((UMSStatus*)m_status)->generic.mode.flags)
+ if (flags != ((UMSStatus*)m_status)->generic.mode.flags)
+ {
+ CLog::Log(LOGDEBUG, "CSMPPlayer::GetAmpStatus: flags changed, old(%d), new(%d)",
+ flags, ((UMSStatus*)m_status)->generic.mode.flags);
+ flags = ((UMSStatus*)m_status)->generic.mode.flags;
+ }
+
+
+ return true;
+ }
+ else
{
- CLog::Log(LOGDEBUG, "CSMPPlayer::GetAmpStatus: flags changed, old(%d), new(%d)",
- flags, ((UMSStatus*)m_status)->generic.mode.flags);
- flags = ((UMSStatus*)m_status)->generic.mode.flags;
+ CLog::Log(LOGDEBUG, "CSMPPlayer::GetAmpStatus:UploadStatusChanges return is not DFB_OK");
+ return false;
}
-
-
- return true;
- }
- else
- {
- CLog::Log(LOGDEBUG, "CSMPPlayer::GetAmpStatus:UploadStatusChanges return is not DFB_OK");
- return false;
}
}
https://github.com/xbmc/xbmc/commit/564105165334a64747b0f6ee640cbc92471758e9
commit 564105165334a64747b0f6ee640cbc92471758e9
Author: davilla <davilla@...>
Date: Wed Nov 23 12:38:20 2011 -0500
[smp] hook dvd file open. dvd nav will need much more work
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 0dbc217..8ec13df 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -234,56 +234,56 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
return false;
}
- std::string url;
+ std::string ids_url;
SMediaFormat format = { 0 };
-#if 0
- CStdString protocol = m_item.GetProtocol();
- if (protocol == "http")
- {
- format.mediaType = MTYPE_APP_UNKNOWN;
- // strip user agent that we append
- url = m_item.m_strPath;
- url = url.erase(url.rfind('|'), url.size());
- }
+ CStdString filepath(m_item.GetPath());
+
+ // default to hinting container type
+ CStdString extension;
+ extension = URIUtils::GetExtension(filepath);
+ if (extension.Equals(".wmv"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_ASF;
+ else if (extension.Equals(".avi"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_AVI;
+ else if (extension.Equals(".mkv"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MKV;
+ else if (extension.Equals(".mp4"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
+ else if (extension.Equals(".mov"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
+ else if (extension.Equals(".mpg"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".m2t"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".ts"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".vob"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2PES;
+ else if (extension.Equals(".mp3"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_MP3 | MTYPE_CONT_UNKNOWN;
+ else if (extension.Equals(".aac"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_AAC | MTYPE_CONT_UNKNOWN;
else
-#endif
{
- // default to hinting container type
- CStdString extension;
- extension = URIUtils::GetExtension(m_item.GetPath());
- if (extension.Equals(".wmv"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_ASF;
- else if (extension.Equals(".avi"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_AVI;
- else if (extension.Equals(".mkv"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MKV;
- else if (extension.Equals(".mp4"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
- else if (extension.Equals(".mov"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
- else if (extension.Equals(".mpg"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
- else if (extension.Equals(".m2t"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
- else if (extension.Equals(".ts"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
- else if (extension.Equals(".vob"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2PES;
- else if (extension.Equals(".mp3"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_MP3 | MTYPE_CONT_UNKNOWN;
- else if (extension.Equals(".aac"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_AAC | MTYPE_CONT_UNKNOWN;
+ if (m_item.IsDVDFile())
+ {
+ format.mediaType = MTYPE_APP_DVD;
+ // strip if present, amp only wants to see ".../VIDEO_TS/" for path.
+ if (filepath.Right(strlen("VIDEO_TS.IFO")).Equals("VIDEO_TS.IFO"));
+ filepath = filepath.Left(filepath.size() - strlen("VIDEO_TS.IFO"));
+ }
else
format.mediaType = MTYPE_APP_UNKNOWN;
-
- // local source only for now, smb is failing to read
- SIdsData ids;
- char c_str[64];
- // setup the IDataSource cookie, CloseMedia will delete it
- ids.src = new CFileIDataSource(m_item.GetPath());
- snprintf(c_str, sizeof(c_str)/sizeof(char), "ids://0x%08lx", (long unsigned int)&ids);
- url = c_str;
}
+ CLog::Log(LOGDEBUG, "CSMPPlayer: Opening: %s", filepath.c_str());
+
+ // use amp ids method to handle xbmc's vfs
+ SIdsData ids;
+ char c_str[64];
+ // setup the IDataSource cookie, CloseMedia will delete it
+ ids.src = new CFileIDataSource(filepath);
+ snprintf(c_str, sizeof(c_str)/sizeof(char), "ids://0x%08lx", (long unsigned int)&ids);
+ ids_url = c_str;
// Setup open parameters
struct SLPBOpenParams parameters = {0, };
@@ -299,114 +299,117 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
parameters.maxPrebufferSize = 100 * 1024;
#if defined(SLPBPARAMS_MAX_TEXT_SUBS)
- // find any available external subtitles
- // SRT, SSA, ASS, SUB, SMI or binary SUB/IDX
-
- std::vector<CStdString> filenames;
- CUtil::ScanForExternalSubtitles( m_item.GetPath(), filenames );
- int sub_file_count = filenames.size();
- if (sub_file_count > SLPBPARAMS_MAX_TEXT_SUBS)
- sub_file_count = SLPBPARAMS_MAX_TEXT_SUBS;
-
- parameters.textSubs.count = 0;
- for(int i = 0; i < sub_file_count; i++)
+ if (!m_item.IsDVDFile())
{
- parameters.textSubs.entry[parameters.textSubs.count].type = (SLPBTextSubs)0;
- //
- if (URIUtils::GetExtension(filenames[i]) == ".txt" ||
- URIUtils::GetExtension(filenames[i]) == ".text")
- parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
- else if (URIUtils::GetExtension(filenames[i]) == ".utf" ||
- URIUtils::GetExtension(filenames[i]) == ".utf8" ||
- URIUtils::GetExtension(filenames[i]) == ".utf-8")
- parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_UTF8;
- else if (URIUtils::GetExtension(filenames[i]) == ".srt")
- parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
- else if (URIUtils::GetExtension(filenames[i]) == ".ssa")
- parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SSA;
- else if (URIUtils::GetExtension(filenames[i]) == ".ass")
- parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASS;
- else if (URIUtils::GetExtension(filenames[i]) == ".sub")
+ // find any available external subtitles
+ // SRT, SSA, ASS, SUB, SMI or binary SUB/IDX
+
+ std::vector<CStdString> filenames;
+ CUtil::ScanForExternalSubtitles( m_item.GetPath(), filenames );
+ int sub_file_count = filenames.size();
+ if (sub_file_count > SLPBPARAMS_MAX_TEXT_SUBS)
+ sub_file_count = SLPBPARAMS_MAX_TEXT_SUBS;
+
+ parameters.textSubs.count = 0;
+ for(int i = 0; i < sub_file_count; i++)
{
- // make sure this is NOT a idx/sub pair
- CStdString strSubFile;
- if ( !CUtil::FindVobSubPair( filenames, filenames[i], strSubFile ) )
+ parameters.textSubs.entry[parameters.textSubs.count].type = (SLPBTextSubs)0;
+ //
+ if (URIUtils::GetExtension(filenames[i]) == ".txt" ||
+ URIUtils::GetExtension(filenames[i]) == ".text")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
+ else if (URIUtils::GetExtension(filenames[i]) == ".utf" ||
+ URIUtils::GetExtension(filenames[i]) == ".utf8" ||
+ URIUtils::GetExtension(filenames[i]) == ".utf-8")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_UTF8;
+ else if (URIUtils::GetExtension(filenames[i]) == ".srt")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
+ else if (URIUtils::GetExtension(filenames[i]) == ".ssa")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SSA;
+ else if (URIUtils::GetExtension(filenames[i]) == ".ass")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASS;
+ else if (URIUtils::GetExtension(filenames[i]) == ".sub")
{
- m_subtitle_params->setSUBFrameRate = TRUE;
- parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SUB;
- parameters.textSubs.entry[parameters.textSubs.count].framerateNumerator = 25;
- parameters.textSubs.entry[parameters.textSubs.count].framerateDenominator = 1;
+ // make sure this is NOT a idx/sub pair
+ CStdString strSubFile;
+ if ( !CUtil::FindVobSubPair( filenames, filenames[i], strSubFile ) )
+ {
+ m_subtitle_params->setSUBFrameRate = TRUE;
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SUB;
+ parameters.textSubs.entry[parameters.textSubs.count].framerateNumerator = 25;
+ parameters.textSubs.entry[parameters.textSubs.count].framerateDenominator = 1;
+ }
}
- }
- else if (URIUtils::GetExtension(filenames[i]) == ".smi")
- parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SMI;
- else if (URIUtils::GetExtension(filenames[i]) == ".srt")
- parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
-
- // if we have a type, create the file data source (ids)
- if (parameters.textSubs.entry[parameters.textSubs.count].type)
- {
- SIdsData *idsdata;
- CStdString url;
-
- idsdata = new SIdsData;
- // setup the IDataSource cookie, Who will delete it ?
- idsdata->src = new CFileIDataSource(filenames[i].c_str());
- m_sub_ids.push_back(idsdata);
- url.Format("ids://0x%08lx", (long unsigned int)m_sub_ids.back());
- m_sub_urls.push_back(url);
- parameters.textSubs.entry[i].fileUrl = (char*)m_sub_urls.back().c_str();
-
- // TODO: figure out a better description of the subtitle.
- strcpy(parameters.textSubs.entry[i].description, "some external subtitle file");
- CLog::Log(LOGDEBUG, "subtile file found, %s, creating ids source %s",
- filenames[i].c_str(), parameters.textSubs.entry[i].fileUrl);
- parameters.textSubs.count++;
- }
- }
+ else if (URIUtils::GetExtension(filenames[i]) == ".smi")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SMI;
+ else if (URIUtils::GetExtension(filenames[i]) == ".srt")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
- // check for any idx/sub pair (vobsub file)
- for(int i = 0; i < sub_file_count; i++)
- {
- if (URIUtils::GetExtension(filenames[i]) == ".idx")
- {
- // check for idx/sub pair (vobsub file)
- CStdString strSubFile;
- if ( CUtil::FindVobSubPair( filenames, filenames[i], strSubFile ) )
+ // if we have a type, create the file data source (ids)
+ if (parameters.textSubs.entry[parameters.textSubs.count].type)
{
SIdsData *idsdata;
CStdString url;
idsdata = new SIdsData;
- // setup the IDataSource cookies, Who will delete them ?
+ // setup the IDataSource cookie, Who will delete it ?
idsdata->src = new CFileIDataSource(filenames[i].c_str());
m_sub_ids.push_back(idsdata);
url.Format("ids://0x%08lx", (long unsigned int)m_sub_ids.back());
m_sub_urls.push_back(url);
- parameters.subidxIdxFileUrl = (char*)m_sub_urls.back().c_str();
- CLog::Log(LOGDEBUG, "subtile file found, %s, creating ids source %s",
- filenames[i].c_str(), parameters.subidxIdxFileUrl);
+ parameters.textSubs.entry[i].fileUrl = (char*)m_sub_urls.back().c_str();
- idsdata = new SIdsData;
- idsdata->src = new CFileIDataSource(strSubFile.c_str());
- m_sub_ids.push_back(idsdata);
- url.Format("ids://0x%08lx", (long unsigned int)m_sub_ids.back());
- m_sub_urls.push_back(url);
- parameters.subidxSubFileUrl = (char*)m_sub_urls.back().c_str();
+ // TODO: figure out a better description of the subtitle.
+ strcpy(parameters.textSubs.entry[i].description, "some external subtitle file");
CLog::Log(LOGDEBUG, "subtile file found, %s, creating ids source %s",
- filenames[i].c_str(), parameters.subidxSubFileUrl);
- break;
+ filenames[i].c_str(), parameters.textSubs.entry[i].fileUrl);
+ parameters.textSubs.count++;
+ }
+ }
+
+ // check for any idx/sub pair (vobsub file)
+ for(int i = 0; i < sub_file_count; i++)
+ {
+ if (URIUtils::GetExtension(filenames[i]) == ".idx")
+ {
+ // check for idx/sub pair (vobsub file)
+ CStdString strSubFile;
+ if ( CUtil::FindVobSubPair( filenames, filenames[i], strSubFile ) )
+ {
+ SIdsData *idsdata;
+ CStdString url;
+
+ idsdata = new SIdsData;
+ // setup the IDataSource cookies, Who will delete them ?
+ idsdata->src = new CFileIDataSource(filenames[i].c_str());
+ m_sub_ids.push_back(idsdata);
+ url.Format("ids://0x%08lx", (long unsigned int)m_sub_ids.back());
+ m_sub_urls.push_back(url);
+ parameters.subidxIdxFileUrl = (char*)m_sub_urls.back().c_str();
+ CLog::Log(LOGDEBUG, "subtile file found, %s, creating ids source %s",
+ filenames[i].c_str(), parameters.subidxIdxFileUrl);
+
+ idsdata = new SIdsData;
+ idsdata->src = new CFileIDataSource(strSubFile.c_str());
+ m_sub_ids.push_back(idsdata);
+ url.Format("ids://0x%08lx", (long unsigned int)m_sub_ids.back());
+ m_sub_urls.push_back(url);
+ parameters.subidxSubFileUrl = (char*)m_sub_urls.back().c_str();
+ CLog::Log(LOGDEBUG, "subtile file found, %s, creating ids source %s",
+ filenames[i].c_str(), parameters.subidxSubFileUrl);
+ break;
+ }
}
}
}
#endif
// open the media using the IAdvancedMediaProvider
- res = m_amp->OpenMedia(m_amp, (char*)url.c_str(), &format, ¶meters);
+ res = m_amp->OpenMedia(m_amp, (char*)ids_url.c_str(), &format, ¶meters);
if (res != DFB_OK)
{
- CLog::Log(LOGDEBUG, "CSMPPlayer::OpenFile:OpenMedia() failed");
- throw;
+ CLog::Log(LOGDEBUG, "CSMPPlayer::OpenFile:OpenMedia() failed(0x%x)", res);
+ return false;
}
// create the playing thread
@@ -1244,6 +1247,12 @@ void CSMPPlayer::ToFFRW(int iSpeed)
}
}
+bool CSMPPlayer::OnAction(const CAction &action)
+{
+ CLog::Log(LOGDEBUG, "%s - action id = %d", __FUNCTION__, action.GetID());
+ return false;
+};
+
void CSMPPlayer::OnStartup()
{
//CThread::SetName("CSMPPlayer");
@@ -1270,21 +1279,17 @@ void CSMPPlayer::Process()
try
{
// wait for media to open with 20 second timeout.
- if (WaitForAmpOpenMedia(20000))
+ if (WaitForAmpOpenMedia(40000))
{
DFBResult res;
// start the playback.
res = m_amp->StartPresentation(m_amp, DFB_TRUE);
if (res != DFB_OK)
- {
- CLog::Log(LOGDEBUG,"CSMPPlayer::Process:StartPresentation() failed");
- throw;
- }
+ throw "CSMPPlayer::Process:StartPresentation() failed";
}
else
{
- CLog::Log(LOGDEBUG, "CSMPPlayer::Process:WaitForAmpOpenMedia timeout");
- throw;
+ throw "CSMPPlayer::Process:WaitForAmpOpenMedia timeout";
}
// hide the mainvideo layer so we can get stream info
@@ -1323,7 +1328,7 @@ void CSMPPlayer::Process()
// we are playing but hidden and all stream fields are valid.
// check for video in media content
- if (GetVideoStreamCount() > 0)
+ if (GetVideoStreamCount() > 0 || m_item.IsDVDFile())
{
// turn on/off subs
SetSubtitleVisible(g_settings.m_currentVideoSettings.m_SubtitleOn);
@@ -1407,6 +1412,10 @@ void CSMPPlayer::Process()
}
}
+ catch(char* error)
+ {
+ CLog::Log(LOGERROR, "%s", error);
+ }
catch(...)
{
CLog::Log(LOGERROR, "CSMPPlayer::Process Exception thrown");
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index 388ee75..eb6b4f7 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -123,7 +123,7 @@ public:
virtual bool HasMenu() {return false;};
virtual void DoAudioWork() {};
- virtual bool OnAction(const CAction &action) {return false;};
+ virtual bool OnAction(const CAction &action);
virtual bool GetCurrentSubtitle(CStdString& strSubtitle) {strSubtitle = ""; return false;}
//returns a state that is needed for resuming from a specific time
https://github.com/xbmc/xbmc/commit/ed3c999f83f832d0f1f58f8b1c16205451990d40
commit ed3c999f83f832d0f1f58f8b1c16205451990d40
Author: Cory Fields <foss@...>
Date: Wed Nov 23 04:47:36 2011 -0500
[smp] dr: triple buffering by default
diff --git a/xbmc/guilib/DirtyRegionTracker.h b/xbmc/guilib/DirtyRegionTracker.h
index fce3fc4..9c73677 100644
--- a/xbmc/guilib/DirtyRegionTracker.h
+++ b/xbmc/guilib/DirtyRegionTracker.h
@@ -28,7 +28,7 @@
#elif defined(_WIN32)
#define DEFAULT_BUFFERING 3
#else
-#define DEFAULT_BUFFERING 2
+#define DEFAULT_BUFFERING 3
#endif
class CDirtyRegionTracker
https://github.com/xbmc/xbmc/commit/b91450dd5e4c0e0f826a58ff487b9251b71cc009
commit b91450dd5e4c0e0f826a58ff487b9251b71cc009
Author: davilla <davilla@...>
Date: Thu Nov 17 12:56:24 2011 -0500
[dfb] 1) report directfb init failures and bail, 2) report bogus directdb encoder output signals
diff --git a/xbmc/windowing/dfb/WinSystemDFB.cpp b/xbmc/windowing/dfb/WinSystemDFB.cpp
index 9842080..92487a2 100755
--- a/xbmc/windowing/dfb/WinSystemDFB.cpp
+++ b/xbmc/windowing/dfb/WinSystemDFB.cpp
@@ -46,6 +46,7 @@ CWinSystemDFB::CWinSystemDFB() : CWinSystemBase()
m_buffermode = DLBM_TRIPLE;
m_eWindowSystem = WINDOW_SYSTEM_DFB;
m_eglBinding = new CWinBindingEGL();
+ m_bWindowCreated = false;
}
CWinSystemDFB::~CWinSystemDFB()
@@ -56,11 +57,22 @@ CWinSystemDFB::~CWinSystemDFB()
bool CWinSystemDFB::InitWindowSystem()
{
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem");
DirectFBInit(NULL, NULL);
DirectFBCreate(&m_dfb);
+ if (!m_dfb)
+ {
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: DirectFBCreate failed!");
+ return false;
+ }
m_dfb->SetCooperativeLevel(m_dfb, DFSCL_NORMAL);
m_dfb->GetScreen(m_dfb, DSCID_PRIMARY, &m_dfb_screen);
+ if (!m_dfb_screen)
+ {
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: m_dfb->GetScreen failed!");
+ return false;
+ }
if (!CWinSystemBase::InitWindowSystem())
return false;
@@ -85,14 +97,13 @@ bool CWinSystemDFB::DestroyWindowSystem()
bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction)
{
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow");
m_nWidth = res.iWidth;
m_nHeight = res.iHeight;
m_bFullScreen = fullScreen;
- int width, height;
- DFBDisplayLayerConfig dlcfg;
-
- DestroyWindow();
+ if (m_bWindowCreated)
+ DestroyWindow();
// change the output display to match
DFBScreenOutputSignals out_signal;
@@ -125,6 +136,7 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
m_out_signal = out_signal;
}
+ DFBDisplayLayerConfig dlcfg;
// setup GUI layer
m_dfb->GetDisplayLayer(m_dfb, DLID_PRIMARY, &m_dfb_layer);
m_dfb_layer->SetCooperativeLevel(m_dfb_layer, DLSCL_ADMINISTRATIVE);
@@ -144,6 +156,7 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
dlcfg.width, dlcfg.height);
m_dfb_layer->GetSurface(m_dfb_layer, &m_dfb_surface);
+ int width, height;
m_dfb_surface->GetSize(m_dfb_surface, &width, &height);
CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow: Surface width(%d), height(%d)",
width, height);
@@ -200,6 +213,19 @@ bool CWinSystemDFB::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
void CWinSystemDFB::UpdateResolutions()
{
+ DFBScreenDescription screen_desc;
+ m_dfb_screen->GetDescription(m_dfb_screen, &screen_desc);
+
+ if (screen_desc.encoders)
+ {
+ DFBScreenEncoderDescription enc_desc[screen_desc.encoders];
+ m_dfb_screen->GetEncoderDescriptions(m_dfb_screen, enc_desc);
+ for (int i = 0; i < screen_desc.encoders; i++)
+ {
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::UpdateResolutions: Encoder %d, out_signals0x%x), tv_standards(0x%x)",
+ i, enc_desc[i].out_signals, enc_desc[i].tv_standards);
+ }
+ }
int w = 1280;
int h = 720;
int display = 0;
https://github.com/xbmc/xbmc/commit/123f1472ffeb6967d13a24504eb2dda30fa0c0b0
commit 123f1472ffeb6967d13a24504eb2dda30fa0c0b0
Author: davilla <davilla@...>
Date: Fri Nov 11 20:16:04 2011 -0500
[smp] disable pvrtexlib
diff --git a/tools/sigma/Makefile b/tools/sigma/Makefile
index 94607dc..e5be496 100644
--- a/tools/sigma/Makefile
+++ b/tools/sigma/Makefile
@@ -10,7 +10,7 @@ export PYTHON_NOVERSIONCHECK=no-check
CONFIGURE=./configure --build=$(BUILD) --host=$(HOST) --prefix=/usr \
--enable-gles --disable-optical-drive --disable-dvdcss --enable-optimizations \
- --disable-x11 --disable-libbluray --disable-sdl --enable-directfb --enable-pvrtexlib
+ --disable-x11 --disable-libbluray --disable-sdl --enable-directfb
all: configure
configure:
https://github.com/xbmc/xbmc/commit/79992c4ac91619c685ced11919a5b610c96a6789
commit 79992c4ac91619c685ced11919a5b610c96a6789
Author: davilla <davilla@...>
Date: Fri Nov 11 19:45:03 2011 -0500
[smp] add output display switching
diff --git a/xbmc/windowing/dfb/WinSystemDFB.cpp b/xbmc/windowing/dfb/WinSystemDFB.cpp
index b7bfcc5..9842080 100755
--- a/xbmc/windowing/dfb/WinSystemDFB.cpp
+++ b/xbmc/windowing/dfb/WinSystemDFB.cpp
@@ -32,8 +32,6 @@
#include <vector>
#include <directfb.h>
-#define VERBOSE_LOGGING 1
-
CWinSystemDFB::CWinSystemDFB() : CWinSystemBase()
{
m_dfb = NULL;
@@ -42,6 +40,7 @@ CWinSystemDFB::CWinSystemDFB() : CWinSystemBase()
m_dfb_surface = NULL;
m_dfb_image_provider = NULL;
+ m_out_signal = DSOS_NONE;
//m_buffermode = DLBM_FRONTONLY; // no backbuffer ( tearing unless we WaitForSync)
//m_buffermode = DLBM_BACKVIDEO; // backbuffer in video memory (no tearing but gui fps is slower)
m_buffermode = DLBM_TRIPLE;
@@ -57,126 +56,12 @@ CWinSystemDFB::~CWinSystemDFB()
bool CWinSystemDFB::InitWindowSystem()
{
- int width, height;
- DFBDisplayLayerConfig dlcfg;
-
DirectFBInit(NULL, NULL);
DirectFBCreate(&m_dfb);
m_dfb->SetCooperativeLevel(m_dfb, DFSCL_NORMAL);
m_dfb->GetScreen(m_dfb, DSCID_PRIMARY, &m_dfb_screen);
- // setup GUI layer
- m_dfb->GetDisplayLayer(m_dfb, DLID_PRIMARY, &m_dfb_layer);
- m_dfb_layer->SetCooperativeLevel(m_dfb_layer, DLSCL_ADMINISTRATIVE);
- m_dfb_layer->GetConfiguration(m_dfb_layer, &dlcfg);
- CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: DisplayLayer width(%d), height(%d)",
- dlcfg.width, dlcfg.height);
-
- dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT);
- //dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_OPTIONS | DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT);
- //dlcfg.options = DLOP_ALPHACHANNEL;
- dlcfg.buffermode = (DFBDisplayLayerBufferMode)m_buffermode;
- dlcfg.pixelformat = DSPF_ARGB;
- m_dfb_layer->SetConfiguration(m_dfb_layer, &dlcfg);
- m_dfb_layer->SetOpacity(m_dfb_layer, 0xFF);
-
- m_dfb_layer->GetSurface(m_dfb_layer, &m_dfb_surface);
- m_dfb_surface->GetSize(m_dfb_surface, &width, &height);
- CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: Surface width(%d), height(%d)",
- width, height);
-
-#if VERBOSE_LOGGING > 0
- // get and dump the screen descriptor
- DFBScreenDescription screen_desc;
- screen_desc.caps = DSCCAPS_ALL;
- m_dfb_screen->GetDescription(m_dfb_screen, &screen_desc);
- CLog::Log(LOGDEBUG, "screen_desc caps(0x%x), name(%s), mixers(%d), encoders(%d), outputs(%d)",
- screen_desc.caps, screen_desc.name, screen_desc.mixers, screen_desc.encoders, screen_desc.outputs);
-
- // get and dump the mixer descriptors
- DFBScreenMixerDescription mixer_descs[screen_desc.mixers];
- m_dfb_screen->GetMixerDescriptions(m_dfb_screen, mixer_descs);
- for (int i = 0; i < screen_desc.mixers; ++i)
- {
- CLog::Log(LOGDEBUG, "i(%d), mixer_descs caps(0x%x), layers(0x%x), "
- "sub_num(0x%x), sub_layers(0x%x), name(%s)",
- i, mixer_descs[i].caps, mixer_descs[i].layers,
- mixer_descs[i].sub_num, mixer_descs[i].sub_layers, mixer_descs[i].name);
- }
-
- // get and dump the encoder descriptors
- DFBScreenEncoderConfig encoder_cfg;
- DFBScreenOutputSignals out_signal;
- for (int i = 0; i < screen_desc.encoders; ++i)
- {
- m_dfb_screen->GetEncoderConfiguration(m_dfb_screen, i, &encoder_cfg);
- CLog::Log(LOGDEBUG, "i(%d), enc_cfg flags(0x%x), tv_standard(0x%x), out_signals(0x%x)",
- i, encoder_cfg.flags, encoder_cfg.tv_standard, encoder_cfg.out_signals);
- if (encoder_cfg.out_signals & ~DSOS_EDID)
- {
- out_signal = (DFBScreenOutputSignals)(encoder_cfg.out_signals & ~DSOS_EDID);
- //break;
- }
- }
-
- // get and dump the screen descriptors
- DFBScreenOutputDescription screen_descs[screen_desc.outputs];
- m_dfb_screen->GetOutputDescriptions(m_dfb_screen, screen_descs);
- for (int i = 0; i < screen_desc.outputs; ++i)
- {
- CLog::Log(LOGDEBUG, "i(%d), screen_descs caps(0x%x), all_connectors(0x%x), all_signals(0x%x), name(%s)",
- i, screen_descs[i].caps, screen_descs[i].all_connectors, screen_descs[i].all_signals, screen_descs[i].name);
- }
-
- DFBScreenOutputConfig output_cfg;
- output_cfg.flags = DSOCONF_ALL;
- m_dfb_screen->GetOutputConfiguration(m_dfb_screen, 0, &output_cfg);
- CLog::Log(LOGDEBUG,
- "output_cfg flags(0x%x), encoder(0x%x), "
- "out_signals(0x%x), out_connectors(0x%x), slow_blanking(0x%x)",
- output_cfg.flags, output_cfg.encoder,
- output_cfg.out_signals, output_cfg.out_connectors, output_cfg.slow_blanking);
-
- IDirectFBScreen *screen = NULL;
- if (m_dfb->GetScreen(m_dfb, DSCID_PRIMARY, &screen) == DFB_OK)
- {
- DFBScreenMixerConfig mixcfg;
- screen->GetMixerConfiguration(screen, 0, &mixcfg);
- // dump the mixer config
- for (int n = 0; n < DFB_DISPLAYLAYER_IDS_MAX; n++)
- {
- if (DFB_DISPLAYLAYER_IDS_HAVE( mixcfg.layers, n))
- {
- switch(n)
- {
- case XBMC_OSD:
- CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) OSD layer (graphic)", n);
- break;
- case XBMC_BKGND:
- CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) Background layer (graphic)", n);
- break;
- case XBMC_MAINVIDEO:
- CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) Main video layer", n);
- break;
- case XBMC_SECVIDEO:
- CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) Secondary video layer (video or graphic)", n);
- break;
- case XBMC_SECOSD:
- CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) Secondary OSD layer (graphic)", n);
- break;
- }
- }
- }
- if (mixcfg.flags & DSMCONF_BACKGROUND)
- {
- CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: Background ARGB "
- "0x%02x, 0x%02x, 0x%02x, 0x%02x",
- mixcfg.background.a, mixcfg.background.r, mixcfg.background.g, mixcfg.background.b );
- }
- }
-#endif
-
if (!CWinSystemBase::InitWindowSystem())
return false;
@@ -185,16 +70,7 @@ bool CWinSystemDFB::InitWindowSystem()
bool CWinSystemDFB::DestroyWindowSystem()
{
- if (m_dfb_image_provider)
- m_dfb_image_provider->Release(m_dfb_image_provider);
- m_dfb_image_provider = NULL;
-
- if (m_dfb_surface)
- m_dfb_surface->Release(m_dfb_surface);
- m_dfb_surface = NULL;
- if (m_dfb_layer)
- m_dfb_layer->Release(m_dfb_layer);
- m_dfb_layer = NULL;
+ m_eglBinding->DestroyWindow();
if (m_dfb_screen)
m_dfb_screen->Release(m_dfb_screen);
@@ -213,6 +89,65 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
m_nHeight = res.iHeight;
m_bFullScreen = fullScreen;
+ int width, height;
+ DFBDisplayLayerConfig dlcfg;
+
+ DestroyWindow();
+
+ // change the output display to match
+ DFBScreenOutputSignals out_signal;
+ if (m_nWidth == 1920 && m_nHeight == 1080)
+ out_signal = DSOS_1080p;
+ else
+ out_signal = DSOS_720p;
+
+ if (m_out_signal != out_signal)
+ {
+ DFBScreenEncoderConfig enc_cfg;
+ enc_cfg.flags = (DFBScreenEncoderConfigFlags)(DSECONF_OUT_SIGNALS | DSECONF_DELAYED_CONFIG);
+ enc_cfg.out_signals = out_signal;
+ enc_cfg.delayed_config = true;
+ if (m_dfb_screen->SetEncoderConfiguration(m_dfb_screen, 0, &enc_cfg) == DFB_OK)
+ {
+ DFBScreenOutputConfig out_cfg;
+ out_cfg.flags = (DFBScreenOutputConfigFlags)(DSOCONF_SIGNALS | DSOCONF_DELAYED_CONFIG);
+ out_cfg.out_signals = out_signal;
+ out_cfg.delayed_config = false;
+ if (m_dfb_screen->SetOutputConfiguration(m_dfb_screen, 0, &out_cfg) != DFB_OK)
+ {
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow: SetOutputConfiguration(0) failed!");
+ }
+ }
+ else
+ {
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow: SetEncoderConfiguration(0) failed!");
+ }
+ m_out_signal = out_signal;
+ }
+
+ // setup GUI layer
+ m_dfb->GetDisplayLayer(m_dfb, DLID_PRIMARY, &m_dfb_layer);
+ m_dfb_layer->SetCooperativeLevel(m_dfb_layer, DLSCL_ADMINISTRATIVE);
+ m_dfb_layer->GetConfiguration(m_dfb_layer, &dlcfg);
+
+ dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT);
+ //dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_OPTIONS | DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT);
+ //dlcfg.options = DLOP_ALPHACHANNEL;
+ dlcfg.buffermode = (DFBDisplayLayerBufferMode)m_buffermode;
+ dlcfg.pixelformat = DSPF_ARGB;
+ dlcfg.width = m_nWidth;
+ dlcfg.height = m_nHeight;
+ m_dfb_layer->SetConfiguration(m_dfb_layer, &dlcfg);
+ m_dfb_layer->SetOpacity(m_dfb_layer, 0xFF);
+
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow: DisplayLayer width(%d), height(%d)",
+ dlcfg.width, dlcfg.height);
+
+ m_dfb_layer->GetSurface(m_dfb_layer, &m_dfb_surface);
+ m_dfb_surface->GetSize(m_dfb_surface, &width, &height);
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::CreateNewWindow: Surface width(%d), height(%d)",
+ width, height);
+
if (!m_eglBinding->CreateWindow((EGLNativeDisplayType)m_dfb, (NativeWindowType)m_dfb_surface))
return false;
@@ -223,8 +158,20 @@ bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RES
bool CWinSystemDFB::DestroyWindow()
{
- if (!m_eglBinding->DestroyWindow())
- return false;
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::DestroyWindow");
+
+ // we have to release the image provider as it also depends on size.
+ if (m_dfb_image_provider)
+ m_dfb_image_provider->Release(m_dfb_image_provider);
+ m_dfb_image_provider = NULL;
+
+ if (m_dfb_surface)
+ m_dfb_surface->Release(m_dfb_surface);
+ m_dfb_surface = NULL;
+
+ if (m_dfb_layer)
+ m_dfb_layer->Release(m_dfb_layer);
+ m_dfb_layer = NULL;
m_bWindowCreated = false;
@@ -244,7 +191,6 @@ bool CWinSystemDFB::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
m_nHeight = res.iHeight;
m_bFullScreen = fullScreen;
- m_eglBinding->ReleaseSurface();
CreateNewWindow("", fullScreen, res, NULL);
CRenderSystemGLES::ResetRenderSystem(res.iWidth, res.iHeight, true, 0);
@@ -254,11 +200,19 @@ bool CWinSystemDFB::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl
void CWinSystemDFB::UpdateResolutions()
{
- CWinSystemBase::UpdateResolutions();
-
int w = 1280;
int h = 720;
- UpdateDesktopResolution(g_settings.m_ResInfo[RES_DESKTOP], 0, w, h, 0.0);
+ int display = 0;
+ double fps = 59.94;
+ UpdateDesktopResolution(g_settings.m_ResInfo[RES_DESKTOP], display, w, h, fps);
+
+ RESOLUTION_INFO res;
+ w = 1920;
+ h = 1080;
+ fps = 59.94;
+ UpdateDesktopResolution(res, display, w, h, fps);
+ g_graphicsContext.ResetOverscan(res);
+ g_settings.m_ResInfo.push_back(res);
}
bool CWinSystemDFB::IsExtSupported(const char* extension)
diff --git a/xbmc/windowing/dfb/WinSystemDFB.h b/xbmc/windowing/dfb/WinSystemDFB.h
index 32e1fb7..1dbeff0 100755
--- a/xbmc/windowing/dfb/WinSystemDFB.h
+++ b/xbmc/windowing/dfb/WinSystemDFB.h
@@ -86,6 +86,7 @@ protected:
IDirectFBDisplayLayer *m_dfb_layer;
IDirectFBSurface *m_dfb_surface;
int m_buffermode;
+ int m_out_signal;
IDirectFBImageProvider *m_dfb_image_provider;
};
https://github.com/xbmc/xbmc/commit/874bae16eb9ba08bb6ee397cb0586c998e7e2baa
commit 874bae16eb9ba08bb6ee397cb0586c998e7e2baa
Author: davilla <davilla@...>
Date: Fri Nov 11 13:52:49 2011 -0500
[smp] fixed, hide/show mainvideo instead of trying to hide/show gui. This adds ShowMainVideo and removes WaitForWindowFullScreenVideo
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 785698d..0dbc217 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -216,6 +216,9 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
m_chapter_index = 0;
m_chapter_count = 0;
+ m_show_mainvideo = -1;
+ m_dst_rect.SetRect(0, 0, 0, 0);
+
IDirectFB *dfb = g_Windowing.GetIDirectFB();
DFBResult res = dfb->GetInterface(dfb, "IAdvancedMediaProvider", "EM8630", (void*)m_ampID, (void **)&m_amp);
if (res != DFB_OK)
@@ -924,19 +927,11 @@ void CSMPPlayer::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
}
else
{
+ // mainvideo 'should' be showing already if we get here, make sure.
+ ShowMainVideo(true);
return;
}
- /*
- CStdString rectangle;
- rectangle.Format("%i,%i,%i,%i",
- (int)SrcRect.x1, (int)SrcRect.y1,
- (int)SrcRect.x2, (int)SrcRect.y2);
- printf("CSMPPlayer::SetVideoRect: %s\n", rectangle.c_str());
- rectangle.Format("%i,%i,%i,%i",
- (int)DestRect.x1, (int)DestRect.y1,
- (int)DestRect.x2, (int)DestRect.y2);
- printf("CSMPPlayer::SetVideoRect: %s\n", rectangle.c_str());
- */
+
CRect gui;
RESOLUTION res = g_graphicsContext.GetVideoResolution();
gui.SetRect(0, 0, g_settings.m_ResInfo[res].iWidth, g_settings.m_ResInfo[res].iHeight);
@@ -945,15 +940,21 @@ void CSMPPlayer::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
if (!gui.PtInRect(CPoint(m_dst_rect.x2, m_dst_rect.y2)))
return;
- DFBResult dfb_result;
+ ShowMainVideo(false);
+
IDirectFB *dfb = g_Windowing.GetIDirectFB();
IDirectFBDisplayLayer *dfb_layer;
- dfb_result = dfb->GetDisplayLayer(dfb, XBMC_MAINVIDEO, &dfb_layer);
- dfb_result = dfb_layer->SetCooperativeLevel(dfb_layer, DLSCL_EXCLUSIVE);
+ dfb->GetDisplayLayer(dfb, XBMC_MAINVIDEO, &dfb_layer);
+ dfb_layer->SetCooperativeLevel(dfb_layer, DLSCL_EXCLUSIVE);
- dfb_result = dfb_layer->WaitForSync(dfb_layer);
- dfb_result = dfb_layer->SetScreenRectangle(dfb_layer, m_dst_rect.x1, m_dst_rect.y1, m_dst_rect.Width(), m_dst_rect.Height());
- dfb_result = dfb_layer->Release(dfb_layer);
+ dfb_layer->SetScreenRectangle(dfb_layer, m_dst_rect.x1, m_dst_rect.y1, m_dst_rect.Width(), m_dst_rect.Height());
+ // the dest rect change will sometimes glitch, try to wait it out.
+ for (int i = 0; i < 6; i++)
+ dfb_layer->WaitForSync(dfb_layer);
+ dfb_layer->Release(dfb_layer);
+ // we only get called once gui has changed to something
+ // that would show video playback, so show it.
+ ShowMainVideo(true);
}
void CSMPPlayer::GetVideoAspectRatio(float &fAR)
@@ -1286,10 +1287,11 @@ void CSMPPlayer::Process()
throw;
}
- // hide the gui layer so we can get stream info first
+ // hide the mainvideo layer so we can get stream info
+ // and setup/transition to gui video playback
// without having video playback blended into it.
if (m_item.IsVideo())
- g_Windowing.Hide();
+ ShowMainVideo(false);
// wait for playback to start with 20 second timeout
if (WaitForAmpPlaying(20000))
@@ -1317,9 +1319,7 @@ void CSMPPlayer::Process()
WaitForAmpFormatValid(2000);
// drop CGUIDialogBusy dialog and release the hold in OpenFile.
- // sleep a bit to let main thread run and do it's thing.
m_ready.Set();
- Sleep(100);
// we are playing but hidden and all stream fields are valid.
// check for video in media content
@@ -1329,15 +1329,11 @@ void CSMPPlayer::Process()
SetSubtitleVisible(g_settings.m_currentVideoSettings.m_SubtitleOn);
SetSubTitleDelay(g_settings.m_currentVideoSettings.m_SubtitleDelay);
- // big fake out here, we do not know the video width, height yet
- // so setup renderer to full display size and tell it we are doing
- // bypass. This tell it to get out of the way as amp will be doing
- // the actual video rendering in a video plane that is under the GUI
- // layer.
+ // setup renderer for bypass. This tell it to get out of the way as
+ // amp will be doing the actual video rendering in a video plane
+ // that is under the GUI layer.
int width = GetPictureWidth();
int height = GetPictureHeight();
- int displayWidth = width;
- int displayHeight = height;
double fFrameRate = GetActualFPS();
unsigned int flags = 0;
@@ -1345,9 +1341,9 @@ void CSMPPlayer::Process()
flags |= CONF_FLAGS_FULLSCREEN;
CStdString formatstr = "BYPASS";
CLog::Log(LOGDEBUG,"%s - change configuration. %dx%d. framerate: %4.2f. format: %s",
- __FUNCTION__, GetPictureWidth(), GetPictureHeight(), fFrameRate, formatstr.c_str());
+ __FUNCTION__, width, height, fFrameRate, formatstr.c_str());
g_renderManager.IsConfigured();
- if(!g_renderManager.Configure(width, height, displayWidth, displayHeight, fFrameRate, flags, 0))
+ if(!g_renderManager.Configure(width, height, width, height, fFrameRate, flags, 0))
{
CLog::Log(LOGERROR, "%s - failed to configure renderer", __FUNCTION__);
}
@@ -1355,22 +1351,11 @@ void CSMPPlayer::Process()
{
CLog::Log(LOGERROR, "%s - renderer not started", __FUNCTION__);
}
- CRect src_rect;
- // m_dst_rect gets set to zeros as renderer has not switched over yet.
- GetVideoRect(src_rect, m_dst_rect);
- m_view_mode = g_settings.m_currentVideoSettings.m_ViewMode;
}
if (m_options.identify == false)
m_callback.OnPlayBackStarted();
- if (GetVideoStreamCount() > 0)
- {
- WaitForWindowFullScreenVideo(4000);
- // show gui layer again.
- g_Windowing.Show();
- }
-
while (!m_bStop && !m_StopPlaying)
{
// AMP monitoring loop for automatic playback termination (250ms wait)
@@ -1427,8 +1412,8 @@ void CSMPPlayer::Process()
CLog::Log(LOGERROR, "CSMPPlayer::Process Exception thrown");
}
- // in case we error somewhere with gui hidden
- g_Windowing.Show();
+ // we are done, hide the mainvideo layer.
+ ShowMainVideo(false);
if (m_amp)
m_amp->CloseMedia(m_amp);
}
@@ -1560,38 +1545,28 @@ bool CSMPPlayer::WaitForAmpFormatValid(int timeout_ms)
return rtn;
}
-bool CSMPPlayer::WaitForWindowFullScreenVideo(int timeout_ms)
+void CSMPPlayer::ShowMainVideo(bool show)
{
- bool rtn = false;
+ if (m_show_mainvideo == show)
+ return;
- double present_time;
- // we do a two step check.
- // 1st, wait for switch to fullscreen video rendering in gui
- while (!m_bStop && (timeout_ms > 0))
+ DFBScreenMixerConfig mixcfg;
+ IDirectFBScreen *screen = g_Windowing.GetIDirectFBScreen();
+ screen->GetMixerConfiguration(screen, 0, &mixcfg);
+ if (show)
{
- if (g_graphicsContext.IsFullScreenVideo() && g_renderManager.IsStarted())
- break;
-
- timeout_ms -= 100;
- Sleep(100);
+ if (!DFB_DISPLAYLAYER_IDS_HAVE(mixcfg.layers, XBMC_MAINVIDEO))
+ DFB_DISPLAYLAYER_IDS_ADD(mixcfg.layers, XBMC_MAINVIDEO);
}
- // 2nd, wait for renderer to flip at least once.
- present_time = g_renderManager.GetPresentTime();
- while (!m_bStop && (timeout_ms > 0))
+ else
{
- if (present_time < g_renderManager.GetPresentTime())
- {
- rtn = true;
- break;
- }
- timeout_ms -= 100;
- Sleep(100);
+ if (DFB_DISPLAYLAYER_IDS_HAVE(mixcfg.layers, XBMC_MAINVIDEO))
+ DFB_DISPLAYLAYER_IDS_REMOVE(mixcfg.layers, XBMC_MAINVIDEO);
}
- // BUGFIX: why don't we know when gui has truly transitioned?
- // sleep another second to be sure.
- Sleep(1000);
+ mixcfg.flags = (DFBScreenMixerConfigFlags)(mixcfg.flags | DSMCONF_LAYERS);
+ screen->SetMixerConfiguration(screen, 0, &mixcfg);
- return rtn;
+ m_show_mainvideo = show;
}
bool CSMPPlayer::GetAmpStatus()
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
old mode 100644
new mode 100755
index 674775c..388ee75
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -143,7 +143,7 @@ private:
bool WaitForAmpPlaying(int timeout_ms);
bool WaitForAmpOpenMedia(int timeout_ms);
bool WaitForAmpFormatValid(int timeout_ms);
- bool WaitForWindowFullScreenVideo(int timeout_ms);
+ void ShowMainVideo(bool show);
bool GetAmpStatus();
int m_speed;
@@ -190,6 +190,7 @@ private:
int64_t seekto_ms;
} m_chapters[64];
+ int m_show_mainvideo;
CRect m_dst_rect;
int m_view_mode;
// opaque smp global status
https://github.com/xbmc/xbmc/commit/e39dd9c7b894c6afba390bda51c529c78039459e
commit e39dd9c7b894c6afba390bda51c529c78039459e
Author: davilla <davilla@...>
Date: Fri Nov 11 13:49:13 2011 -0500
[smp] 1) fix DLOP_ALPHACHANNEL, it is ignored unless we add DLCONF_OPTIONS to flags. 2) fix mixcfg dump. 3) add GetIDirectFBScreen function
diff --git a/xbmc/windowing/dfb/WinSystemDFB.cpp b/xbmc/windowing/dfb/WinSystemDFB.cpp
index 7b0ee9b..b7bfcc5 100755
--- a/xbmc/windowing/dfb/WinSystemDFB.cpp
+++ b/xbmc/windowing/dfb/WinSystemDFB.cpp
@@ -74,7 +74,8 @@ bool CWinSystemDFB::InitWindowSystem()
dlcfg.width, dlcfg.height);
dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT);
- dlcfg.options = DLOP_ALPHACHANNEL;
+ //dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_OPTIONS | DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT);
+ //dlcfg.options = DLOP_ALPHACHANNEL;
dlcfg.buffermode = (DFBDisplayLayerBufferMode)m_buffermode;
dlcfg.pixelformat = DSPF_ARGB;
m_dfb_layer->SetConfiguration(m_dfb_layer, &dlcfg);
@@ -154,12 +155,6 @@ bool CWinSystemDFB::InitWindowSystem()
break;
case XBMC_BKGND:
CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) Background layer (graphic)", n);
- if (mixcfg.flags & DSMCONF_BACKGROUND)
- {
- CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) Background layer ARGB "
- "0x%02x, 0x%02x, 0x%02x, 0x%02x",
- n, mixcfg.background.a, mixcfg.background.r, mixcfg.background.g, mixcfg.background.b );
- }
break;
case XBMC_MAINVIDEO:
CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) Main video layer", n);
@@ -173,6 +168,12 @@ bool CWinSystemDFB::InitWindowSystem()
}
}
}
+ if (mixcfg.flags & DSMCONF_BACKGROUND)
+ {
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: Background ARGB "
+ "0x%02x, 0x%02x, 0x%02x, 0x%02x",
+ mixcfg.background.a, mixcfg.background.r, mixcfg.background.g, mixcfg.background.b );
+ }
}
#endif
@@ -331,6 +332,11 @@ IDirectFB* CWinSystemDFB::GetIDirectFB() const
return m_dfb;
}
+IDirectFBScreen* CWinSystemDFB::GetIDirectFBScreen() const
+{
+ return m_dfb_screen;
+}
+
bool CWinSystemDFB::CreateImageProvider(IDirectFBDataBuffer *buffer, IDirectFBImageProvider **provider, bool retain1st)
{
// some hardware accelerated dfb image provider implementations have
diff --git a/xbmc/windowing/dfb/WinSystemDFB.h b/xbmc/windowing/dfb/WinSystemDFB.h
old mode 100644
new mode 100755
index 477c3a1..32e1fb7
--- a/xbmc/windowing/dfb/WinSystemDFB.h
+++ b/xbmc/windowing/dfb/WinSystemDFB.h
@@ -72,6 +72,7 @@ public:
virtual bool Show(bool raise = true);
IDirectFB* GetIDirectFB() const;
+ IDirectFBScreen* GetIDirectFBScreen() const;
bool CreateImageProvider(IDirectFBDataBuffer *buffer, IDirectFBImageProvider **provider, bool retain1st);
bool ReleaseImageProvider(IDirectFBImageProvider *provider);
https://github.com/xbmc/xbmc/commit/b2ee440e75f454fa8d5ca998c5d994aeaf4dc608
commit b2ee440e75f454fa8d5ca998c5d994aeaf4dc608
Author: davilla <davilla@...>
Date: Fri Nov 11 11:28:31 2011 -0500
[smp] removing debug logging
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index a157a7f..785698d 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -926,7 +926,7 @@ void CSMPPlayer::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
{
return;
}
-
+ /*
CStdString rectangle;
rectangle.Format("%i,%i,%i,%i",
(int)SrcRect.x1, (int)SrcRect.y1,
@@ -936,7 +936,7 @@ void CSMPPlayer::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
(int)DestRect.x1, (int)DestRect.y1,
(int)DestRect.x2, (int)DestRect.y2);
printf("CSMPPlayer::SetVideoRect: %s\n", rectangle.c_str());
-
+ */
CRect gui;
RESOLUTION res = g_graphicsContext.GetVideoResolution();
gui.SetRect(0, 0, g_settings.m_ResInfo[res].iWidth, g_settings.m_ResInfo[res].iHeight);
@@ -1346,8 +1346,6 @@ void CSMPPlayer::Process()
CStdString formatstr = "BYPASS";
CLog::Log(LOGDEBUG,"%s - change configuration. %dx%d. framerate: %4.2f. format: %s",
__FUNCTION__, GetPictureWidth(), GetPictureHeight(), fFrameRate, formatstr.c_str());
- printf("%s - change configuration. %dx%d. %dx%d framerate: %4.2f. format: %s\n",
- __FUNCTION__, width, height, displayWidth, displayHeight, fFrameRate, formatstr.c_str());
g_renderManager.IsConfigured();
if(!g_renderManager.Configure(width, height, displayWidth, displayHeight, fFrameRate, flags, 0))
{
https://github.com/xbmc/xbmc/commit/62a64f9a21ee12883a871cdac727551f1b405de7
commit 62a64f9a21ee12883a871cdac727551f1b405de7
Author: davilla <davilla@...>
Date: Fri Nov 11 11:25:45 2011 -0500
[smp] add setting of mainvideo diestrect according to renderer requirements
diff --git a/xbmc/cores/IPlayer.h b/xbmc/cores/IPlayer.h
index 91655a5..7c3a897 100644
--- a/xbmc/cores/IPlayer.h
+++ b/xbmc/cores/IPlayer.h
@@ -98,6 +98,7 @@ public:
virtual void GetGeneralInfo( CStdString& strVideoInfo) = 0;
virtual void Update(bool bPauseDrawing = false) = 0;
virtual void GetVideoRect(CRect& SrcRect, CRect& DestRect) {}
+ virtual void SetVideoRect(const CRect& SrcRect, const CRect& DestRect) {}
virtual void GetVideoAspectRatio(float& fAR) { fAR = 1.0f; }
virtual bool CanRecord() { return false;};
virtual bool IsRecording() { return false;};
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 97cc007..a157a7f 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -914,6 +914,48 @@ void CSMPPlayer::GetVideoRect(CRect& SrcRect, CRect& DestRect)
g_renderManager.GetVideoRect(SrcRect, DestRect);
}
+void CSMPPlayer::SetVideoRect(const CRect &SrcRect, const CRect &DestRect)
+{
+ // check if destination rect or video view mode has changed
+ if ((m_dst_rect != DestRect) || (m_view_mode != g_settings.m_currentVideoSettings.m_ViewMode))
+ {
+ m_dst_rect = DestRect;
+ m_view_mode = g_settings.m_currentVideoSettings.m_ViewMode;
+ }
+ else
+ {
+ return;
+ }
+
+ CStdString rectangle;
+ rectangle.Format("%i,%i,%i,%i",
+ (int)SrcRect.x1, (int)SrcRect.y1,
+ (int)SrcRect.x2, (int)SrcRect.y2);
+ printf("CSMPPlayer::SetVideoRect: %s\n", rectangle.c_str());
+ rectangle.Format("%i,%i,%i,%i",
+ (int)DestRect.x1, (int)DestRect.y1,
+ (int)DestRect.x2, (int)DestRect.y2);
+ printf("CSMPPlayer::SetVideoRect: %s\n", rectangle.c_str());
+
+ CRect gui;
+ RESOLUTION res = g_graphicsContext.GetVideoResolution();
+ gui.SetRect(0, 0, g_settings.m_ResInfo[res].iWidth, g_settings.m_ResInfo[res].iHeight);
+ if (!gui.PtInRect(CPoint(m_dst_rect.x1, m_dst_rect.y1)))
+ return;
+ if (!gui.PtInRect(CPoint(m_dst_rect.x2, m_dst_rect.y2)))
+ return;
+
+ DFBResult dfb_result;
+ IDirectFB *dfb = g_Windowing.GetIDirectFB();
+ IDirectFBDisplayLayer *dfb_layer;
+ dfb_result = dfb->GetDisplayLayer(dfb, XBMC_MAINVIDEO, &dfb_layer);
+ dfb_result = dfb_layer->SetCooperativeLevel(dfb_layer, DLSCL_EXCLUSIVE);
+
+ dfb_result = dfb_layer->WaitForSync(dfb_layer);
+ dfb_result = dfb_layer->SetScreenRectangle(dfb_layer, m_dst_rect.x1, m_dst_rect.y1, m_dst_rect.Width(), m_dst_rect.Height());
+ dfb_result = dfb_layer->Release(dfb_layer);
+}
+
void CSMPPlayer::GetVideoAspectRatio(float &fAR)
{
fAR = g_renderManager.GetAspectRatio();
@@ -1095,7 +1137,6 @@ int CSMPPlayer::GetSourceBitrate()
int CSMPPlayer::GetChannels()
{
- //CLog::Log(LOGDEBUG, "CSMPPlayer::GetActualFPS");
// returns number of audio channels (ie 5.1 = 6)
if (GetAmpStatus())
{
@@ -1293,11 +1334,11 @@ void CSMPPlayer::Process()
// bypass. This tell it to get out of the way as amp will be doing
// the actual video rendering in a video plane that is under the GUI
// layer.
- int width = g_graphicsContext.GetWidth();
- int height= g_graphicsContext.GetHeight();
+ int width = GetPictureWidth();
+ int height = GetPictureHeight();
int displayWidth = width;
int displayHeight = height;
- double fFrameRate = 24;
+ double fFrameRate = GetActualFPS();
unsigned int flags = 0;
flags |= CONF_FLAGS_FORMAT_BYPASS;
@@ -1305,6 +1346,8 @@ void CSMPPlayer::Process()
CStdString formatstr = "BYPASS";
CLog::Log(LOGDEBUG,"%s - change configuration. %dx%d. framerate: %4.2f. format: %s",
__FUNCTION__, GetPictureWidth(), GetPictureHeight(), fFrameRate, formatstr.c_str());
+ printf("%s - change configuration. %dx%d. %dx%d framerate: %4.2f. format: %s\n",
+ __FUNCTION__, width, height, displayWidth, displayHeight, fFrameRate, formatstr.c_str());
g_renderManager.IsConfigured();
if(!g_renderManager.Configure(width, height, displayWidth, displayHeight, fFrameRate, flags, 0))
{
@@ -1314,6 +1357,10 @@ void CSMPPlayer::Process()
{
CLog::Log(LOGERROR, "%s - renderer not started", __FUNCTION__);
}
+ CRect src_rect;
+ // m_dst_rect gets set to zeros as renderer has not switched over yet.
+ GetVideoRect(src_rect, m_dst_rect);
+ m_view_mode = g_settings.m_currentVideoSettings.m_ViewMode;
}
if (m_options.identify == false)
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
index a096f1a..674775c 100644
--- a/xbmc/cores/smpplayer/SMPPlayer.h
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -61,6 +61,7 @@ public:
virtual void GetGeneralInfo(CStdString &strVideoInfo) {};
virtual void Update(bool bPauseDrawing);
virtual void GetVideoRect(CRect& SrcRect, CRect& DestRect);
+ virtual void SetVideoRect(const CRect &SrcRect, const CRect &DestRect);
virtual void GetVideoAspectRatio(float &fAR);
virtual bool CanRecord() {return false;};
virtual bool IsRecording() {return false;};
@@ -189,6 +190,8 @@ private:
int64_t seekto_ms;
} m_chapters[64];
+ CRect m_dst_rect;
+ int m_view_mode;
// opaque smp global status
void* m_status;
diff --git a/xbmc/windowing/dfb/WinSystemDFB.cpp b/xbmc/windowing/dfb/WinSystemDFB.cpp
old mode 100644
new mode 100755
index 1e7e040..7b0ee9b
--- a/xbmc/windowing/dfb/WinSystemDFB.cpp
+++ b/xbmc/windowing/dfb/WinSystemDFB.cpp
@@ -32,16 +32,6 @@
#include <vector>
#include <directfb.h>
-// based on sigma's directfb definitions.
-// beware, others might be different.
-enum {
- XBMC_OSD = DSCID_PRIMARY,
- XBMC_BKGND,
- XBMC_MAINVIDEO,
- XBMC_SECVIDEO,
- XBMC_SECOSD
-};
-
#define VERBOSE_LOGGING 1
CWinSystemDFB::CWinSystemDFB() : CWinSystemBase()
@@ -84,7 +74,7 @@ bool CWinSystemDFB::InitWindowSystem()
dlcfg.width, dlcfg.height);
dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT);
- dlcfg.options = DLOP_ALPHACHANNEL;
+ dlcfg.options = DLOP_ALPHACHANNEL;
dlcfg.buffermode = (DFBDisplayLayerBufferMode)m_buffermode;
dlcfg.pixelformat = DSPF_ARGB;
m_dfb_layer->SetConfiguration(m_dfb_layer, &dlcfg);
diff --git a/xbmc/windowing/dfb/WinSystemDFB.h b/xbmc/windowing/dfb/WinSystemDFB.h
index a24db32..477c3a1 100644
--- a/xbmc/windowing/dfb/WinSystemDFB.h
+++ b/xbmc/windowing/dfb/WinSystemDFB.h
@@ -28,6 +28,16 @@
#include "utils/GlobalsHandling.h"
#include "windowing/WinSystem.h"
+// based on sigma's directfb definitions.
+// beware, others might be different.
+enum {
+ XBMC_OSD = 0,
+ XBMC_BKGND,
+ XBMC_MAINVIDEO,
+ XBMC_SECVIDEO,
+ XBMC_SECOSD
+};
+
typedef struct _IDirectFB IDirectFB;
typedef struct _IDirectFBScreen IDirectFBScreen;
typedef struct _IDirectFBSurface IDirectFBSurface;
https://github.com/xbmc/xbmc/commit/b0827961b9917a481e37f2723d75050c7c109d25
commit b0827961b9917a481e37f2723d75050c7c109d25
Author: davilla <davilla@...>
Date: Thu Nov 10 13:06:51 2011 -0500
[smp] changed, remove SetScissors, it borks gui overlay on videoplayback
diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
old mode 100644
new mode 100755
index cb603a8..eb52efd
--- a/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
+++ b/xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
@@ -28,6 +28,7 @@
#include <locale.h>
#include "guilib/MatrixGLES.h"
#include "LinuxRendererGLES.h"
+#include "Application.h"
#include "utils/fastmemcpy.h"
#include "utils/MathUtils.h"
#include "utils/GLUtils.h"
@@ -396,14 +397,11 @@ void CLinuxRendererGLES::RenderUpdate(bool clear, DWORD flags, DWORD alpha)
{
ManageDisplay();
ManageTextures();
- g_graphicsContext.BeginPaint();
+ // if running bypass, then player adjusts src/dst rects for video.
+ if (g_application.m_pPlayer)
+ g_application.m_pPlayer->SetVideoRect(m_sourceRect, m_destRect);
- // RENDER_BYPASS means we are rendering video
- // outside the control of gles and on a different
- // graphics plane that is under the gles layer.
- // Clear a hole where video would appear so we do not see
- // background images that have already been rendered.
- g_graphicsContext.SetScissors(m_destRect);
+ g_graphicsContext.BeginPaint();
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
https://github.com/xbmc/xbmc/commit/ee0d324b394acac4dfb4948fa5427a062d51bdfe
commit ee0d324b394acac4dfb4948fa5427a062d51bdfe
Author: theuni <theuni-nospam-@...>
Date: Sat Nov 5 15:59:49 2011 -0400
[smp] pvr: cosmetics after last commit
diff --git a/tools/TexturePacker/XBMCTex.cpp b/tools/TexturePacker/XBMCTex.cpp
index b857294..36174c7 100644
--- a/tools/TexturePacker/XBMCTex.cpp
+++ b/tools/TexturePacker/XBMCTex.cpp
@@ -367,25 +367,25 @@ CXBTFFrame createXBTFFrame(SDL_Surface* image, CXBTFWriter& writer, double maxMS
unsigned char* padded_argb;
unsigned int padded_w, padded_h;
- // copy original into larger power-of-two image with w = h.
- padded_argb = new unsigned char[padded_size * padded_size * 4];
- memset(padded_argb, 0x00, padded_size * padded_size * 4);
- unsigned char *src = argb;
- unsigned char *dst = padded_argb;
- for (int y = 0; y < height; y++)
+ // copy original into larger power-of-two image with w = h.
+ padded_argb = new unsigned char[padded_size * padded_size * 4];
+ memset(padded_argb, 0x00, padded_size * padded_size * 4);
+ unsigned char *src = argb;
+ unsigned char *dst = padded_argb;
+ for (int y = 0; y < height; y++)
+ {
+ for (unsigned int x = 0; x < width; x++)
{
- for (unsigned int x = 0; x < width; x++)
- {
- *dst++ = src[2];
- *dst++ = src[1];
- *dst++ = src[0];
- *dst++ = src[3];
- src += 4;
- }
+ *dst++ = src[2];
+ *dst++ = src[1];
+ *dst++ = src[0];
+ *dst++ = src[3];
+ src += 4;
}
+ }
- padded_w = padded_size;
- padded_h = padded_size;
+ padded_w = padded_size;
+ padded_h = padded_size;
try
{
@@ -439,7 +439,7 @@ CXBTFFrame createXBTFFrame(SDL_Surface* image, CXBTFWriter& writer, double maxMS
pvrheader->texture_width = padded_w;
pvrheader->texture_height = padded_h;
- delete[] padded_argb;
+ delete[] padded_argb;
width = padded_w;
height = padded_h;
https://github.com/xbmc/xbmc/commit/994fb86f45c64656f8de48df4181cf3fb9c46319
commit 994fb86f45c64656f8de48df4181cf3fb9c46319
Author: theuni <theuni-nospam-@...>
Date: Sat Nov 5 15:55:47 2011 -0400
[smp] pvr: need convert images to bgra before compression
We need this so that they blend correctly with other textures, otherwise we have no way
of knowing if they're stored as bgra or rgba internally.
This is a nasty fix, ideally everything should be rgba.
diff --git a/tools/TexturePacker/XBMCTex.cpp b/tools/TexturePacker/XBMCTex.cpp
index da08881..b857294 100644
--- a/tools/TexturePacker/XBMCTex.cpp
+++ b/tools/TexturePacker/XBMCTex.cpp
@@ -367,25 +367,25 @@ CXBTFFrame createXBTFFrame(SDL_Surface* image, CXBTFWriter& writer, double maxMS
unsigned char* padded_argb;
unsigned int padded_w, padded_h;
- if ((width == height) && (width == NP2(width)))
- {
- // w == h and power-of-two, no padding required.
- padded_w = width;
- padded_h = height;
- padded_argb = argb;
- }
- else
- {
-
// copy original into larger power-of-two image with w = h.
padded_argb = new unsigned char[padded_size * padded_size * 4];
memset(padded_argb, 0x00, padded_size * padded_size * 4);
- for (int i = 0; i < height; i++)
- memcpy(padded_argb + (i * padded_size * 4), argb + (i * width * 4), width * 4);
+ unsigned char *src = argb;
+ unsigned char *dst = padded_argb;
+ for (int y = 0; y < height; y++)
+ {
+ for (unsigned int x = 0; x < width; x++)
+ {
+ *dst++ = src[2];
+ *dst++ = src[1];
+ *dst++ = src[0];
+ *dst++ = src[3];
+ src += 4;
+ }
+ }
padded_w = padded_size;
padded_h = padded_size;
- }
try
{
@@ -439,7 +439,6 @@ CXBTFFrame createXBTFFrame(SDL_Surface* image, CXBTFWriter& writer, double maxMS
pvrheader->texture_width = padded_w;
pvrheader->texture_height = padded_h;
- if (padded_argb != argb)
delete[] padded_argb;
width = padded_w;
https://github.com/xbmc/xbmc/commit/8405cdb9bf95a04538a8e108d326fbf9e17cc2d4
commit 8405cdb9bf95a04538a8e108d326fbf9e17cc2d4
Author: theuni <theuni-nospam-@...>
Date: Sat Nov 5 15:53:46 2011 -0400
[smp] pvr: don't use pvr for textures where the padding makes it bigger than raw rgba
diff --git a/tools/TexturePacker/XBMCTex.cpp b/tools/TexturePacker/XBMCTex.cpp
index 6085e82..da08881 100644
--- a/tools/TexturePacker/XBMCTex.cpp
+++ b/tools/TexturePacker/XBMCTex.cpp
@@ -352,7 +352,17 @@ CXBTFFrame createXBTFFrame(SDL_Surface* image, CXBTFWriter& writer, double maxMS
// into a min size of 32 x 32 which is also the smallest size
// that pvr compression will generate as the size of the compressed
// image is only dependent on width/height and pvr format.
- if ((width > 16) && (height > 16))
+
+ unsigned int padded_size = width;
+ // take the larger of width or height
+ if (padded_size < height)
+ padded_size = height;
+
+ // make it the next power of two if not already.
+ padded_size = NP2(padded_size);
+
+ if (((width > 16) && (height > 16)) &&
+ (width * height * 32) > (padded_size * padded_size * 4))
{
unsigned char* padded_argb;
unsigned int padded_w, padded_h;
@@ -366,14 +376,6 @@ CXBTFFrame createXBTFFrame(SDL_Surface* image, CXBTFWriter& writer, double maxMS
}
else
{
- // this image needs to be padded.
- unsigned int padded_size = width;
- // take the larger of width or height
- if (padded_size < height)
- padded_size = height;
-
- // make it the next power of two if not already.
- padded_size = NP2(padded_size);
// copy original into larger power-of-two image with w = h.
padded_argb = new unsigned char[padded_size * padded_size * 4];
https://github.com/xbmc/xbmc/commit/b5c4368512f1c138388eaf9cc2efd7e8f3637d0d
commit b5c4368512f1c138388eaf9cc2efd7e8f3637d0d
Author: theuni <theuni-nospam-@...>
Date: Sat Nov 5 15:50:36 2011 -0400
[smp] pvr: don't lzo pvr textures
diff --git a/tools/TexturePacker/XBMCTex.cpp b/tools/TexturePacker/XBMCTex.cpp
index a5b3cd9..6085e82 100644
--- a/tools/TexturePacker/XBMCTex.cpp
+++ b/tools/TexturePacker/XBMCTex.cpp
@@ -200,7 +200,8 @@ CXBTFFrame appendContent(CXBTFWriter &writer, int width, int height, unsigned ch
#ifdef USE_LZO_PACKING
lzo_uint packedSize = size;
- if ((flags & FLAGS_USE_LZO) == FLAGS_USE_LZO)
+ //Don't bother packing pvr, it's already highly compressed
+ if (((flags & FLAGS_USE_LZO) == FLAGS_USE_LZO) && (format != XB_FMT_PVR4) && (format != XB_FMT_PVR2))
{
// grab a temporary buffer for unpacking into
unsigned char *packed = new unsigned char[size + size / 16 + 64 + 3]; // see simple.c in lzo
https://github.com/xbmc/xbmc/commit/d87ff3b9a822721d04fd981d8e5576fc30900f47
commit d87ff3b9a822721d04fd981d8e5576fc30900f47
Author: davilla <davilla@...>
Date: Sat Nov 5 13:00:40 2011 -0400
[smp] add and enable pvr compressions of images inside Textures.xbt
diff --git a/.gitignore b/.gitignore
index 651eb3f..487fe77 100644
--- a/.gitignore
+++ b/.gitignore
@@ -292,6 +292,9 @@ lib/cmyth/Makefile
/lib/pcre/libpcre/Debug
/lib/pcre/libpcre/Release
+# /libPVRTexLib
+/lib/libPVRTexLib/PVRTexLib
+
# /lib/libapetag
/lib/libapetag/Makefile
/lib/libapetag/config.h
diff --git a/configure.in b/configure.in
index 6d3b97b..7a9969c 100755
--- a/configure.in
+++ b/configure.in
@@ -388,6 +388,12 @@ AC_ARG_ENABLE([texturepacker],
[use_texturepacker=$enableval],
[use_texturepacker=auto])
+AC_ARG_ENABLE([pvrtexlib],
+ [AS_HELP_STRING([--enable-pvrtexlib],
+ [enable pvr texture compression support])],
+ [use_pvrtexlib=$enableval],
+ [use_pvrtexlib=no])
+
AC_ARG_WITH([lirc-device],
[AS_HELP_STRING([--with-lirc-device=file],
[specify the default LIRC device (default is /dev/lircd)])],
@@ -1670,6 +1676,14 @@ else
USE_TEXTUREPACKER=0
fi
+if test "x$use_pvrtexlib" != "xno"; then
+ final_message="$final_message\n PVRTexLib:\tYes"
+ USE_PVRTEXLIB=1
+else
+ final_message="$final_message\n PVRTexLib:\tNo"
+ USE_PVRTEXLIB=0
+fi
+
if test "$use_mid" = "yes"; then
final_message="$final_message\n MID Support:\tYes"
SDL_DEFINES="$SDL_DEFINES -DMID"
@@ -1972,6 +1986,7 @@ AC_SUBST(USE_DIRECTFB)
AC_SUBST(USE_TEXTUREPACKER)
AC_SUBST(USE_TEXTUREPACKER_NATIVE)
AC_SUBST(USE_TEXTUREPACKER_NATIVE_ROOT)
+AC_SUBST(USE_PVRTEXLIB)
AC_SUBST(USE_AIRTUNES)
AC_SUBST(USE_LIBUDEV)
AC_SUBST(USE_LIBUSB)
diff --git a/lib/libPVRTexLib/Makefile b/lib/libPVRTexLib/Makefile
new file mode 100755
index 0000000..9e4f8b6
--- /dev/null
+++ b/lib/libPVRTexLib/Makefile
@@ -0,0 +1,30 @@
+LIBNAME=PVRTexLib
+VERSION=2.08.28.0634
+SOURCE=$(LIBNAME)
+# download location and format
+BASE_URL=http://mirrors.xbmc.org/build-deps/darwin-libs
+ARCHIVE=$(SOURCE)_$(VERSION).tar.gz
+ARCHIVE_TOOL=tar
+ARCHIVE_TOOL_FLAGS=xf
+TARBALLS_LOCATION=/tmp
+RETRIEVE_TOOL=/usr/bin/curl
+RETRIEVE_TOOL_FLAGS=-Ls --create-dirs --output $(TARBALLS_LOCATION)/$(ARCHIVE)
+ARCHIVE_TOOL=tar
+ARCHIVE_TOOL_FLAGS=xf
+
+all: $(SOURCE)
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ touch $(SOURCE)
+
+clean:
+ rm -rf $(SOURCE)
+
+distclean::
+ rm -rf $(SOURCE)
+
diff --git a/tools/TexturePacker/Makefile.in b/tools/TexturePacker/Makefile.in
index fc5a80c..271d045 100644
--- a/tools/TexturePacker/Makefile.in
+++ b/tools/TexturePacker/Makefile.in
@@ -23,6 +23,21 @@ else
LIBS += -L@... -lsquish
endif
+ifeq (@USE_PVRTEXLIB@...)
+ifeq ($(shell uname),Darwin)
+PVR_LIB = @abs_top_srcdir@...
+else
+ifeq ($(shell uname -m),x86_64)
+PVR_LIB = @abs_top_srcdir@...
+else
+PVR_LIB = @abs_top_srcdir@...
+endif
+endif
+DEFINES += -DUSE_PVR_COMPRESSION
+CXXFLAGS+= -I@...
+LIBS += -L$(PVR_LIB) -lPVRTexLib
+endif
+
LIBS += -lSDL_image -lSDL -llzo2
SRCS = \
@@ -41,8 +56,14 @@ all: $(TARGET)
ifeq (@USE_TEXTUREPACKER_NATIVE@...)
# TexturePacker run native on build system, build it with native tools
$(TARGET): $(SRCS)
+ifeq (@USE_PVRTEXLIB@...)
+ make -C @abs_top_srcdir@...
+endif
g++ $(DEFINES) $(CXXFLAGS) $(SRCS) $(LIBS) -o $(TARGET)
clean:
+ifeq (@USE_PVRTEXLIB@...)
+ make -C @abs_top_srcdir@... clean
+endif
rm -f $(TARGET)
else
include @abs_top_srcdir@...
diff --git a/tools/TexturePacker/XBMCTex.cpp b/tools/TexturePacker/XBMCTex.cpp
index 63da748..a5b3cd9 100644
--- a/tools/TexturePacker/XBMCTex.cpp
+++ b/tools/TexturePacker/XBMCTex.cpp
@@ -41,6 +41,9 @@
#include "SDL_anigif.h"
#include "cmdlineargs.h"
#include "libsquish/squish.h"
+#ifdef USE_PVR_COMPRESSION
+#include "PVRTexLib.h"
+#endif
#ifdef _WIN32
#define strncasecmp strnicmp
@@ -59,6 +62,7 @@ using namespace std;
#define FLAGS_USE_LZO 1
#define FLAGS_ALLOW_YCOCG 2
#define FLAGS_USE_DXT 4
+#define FLAGS_USE_PVR 8
#define DIR_SEPARATOR "/"
#define DIR_SEPARATOR_CHAR '/'
@@ -90,6 +94,10 @@ const char *GetFormatString(unsigned int format)
return "ARGB ";
case XB_FMT_A8:
return "A8 ";
+ case XB_FMT_PVR2:
+ return "PVR2 ";
+ case XB_FMT_PVR4:
+ return "PVR4 ";
default:
return "?????";
}
@@ -335,7 +343,114 @@ CXBTFFrame createXBTFFrame(SDL_Surface* image, CXBTFWriter& writer, double maxMS
}
}
}
+#if defined(USE_PVR_COMPRESSION)
+ else if (flags & FLAGS_USE_PVR)
+ {
+ // image w must == h and be a power-of-two for prv compressio.
+ // So we look for images with width/height > 16, these will pad
+ // into a min size of 32 x 32 which is also the smallest size
+ // that pvr compression will generate as the size of the compressed
+ // image is only dependent on width/height and pvr format.
+ if ((width > 16) && (height > 16))
+ {
+ unsigned char* padded_argb;
+ unsigned int padded_w, padded_h;
+
+ if ((width == height) && (width == NP2(width)))
+ {
+ // w == h and power-of-two, no padding required.
+ padded_w = width;
+ padded_h = height;
+ padded_argb = argb;
+ }
+ else
+ {
+ // this image needs to be padded.
+ unsigned int padded_size = width;
+ // take the larger of width or height
+ if (padded_size < height)
+ padded_size = height;
+
+ // make it the next power of two if not already.
+ padded_size = NP2(padded_size);
+
+ // copy original into larger power-of-two image with w = h.
+ padded_argb = new unsigned char[padded_size * padded_size * 4];
+ memset(padded_argb, 0x00, padded_size * padded_size * 4);
+ for (int i = 0; i < height; i++)
+ memcpy(padded_argb + (i * padded_size * 4), argb + (i * width * 4), width * 4);
+
+ padded_w = padded_size;
+ padded_h = padded_size;
+ }
+ try
+ {
+ pvrtexlib::PVRTextureUtilities PVRU = pvrtexlib::PVRTextureUtilities();
+
+ pvrtexlib::CPVRTexture sOriginalTexture
+ (
+ padded_w, // u32Width,
+ padded_h, // u32Height,
+ 0, // u32MipMapCount,
+ 1, // u32NumSurfaces,
+ false, // bBorder,
+ false, // bTwiddled,
+ false, // bCubeMap,
+ false, // bVolume,
+ false, // bFalseMips,
+ hasAlpha, // bHasAlpha
+ false, // bVerticallyFlipped
+ pvrtexlib::eInt8StandardPixelType, // ePixelType,
+ 0.0f, // fNormalMap,
+ padded_argb // pPixelData
+ );
+
+ // setup for compression
+ pvrtexlib::CPVRTextureHeader sProcessHeader(sOriginalTexture.getHeader());
+ PVRU.ProcessRawPVR(
+ sOriginalTexture, // sInputTexture
+ sProcessHeader, // sProcessHeader
+ false, // bDoBleeding
+ 0.0f, // fBleedRed
+ 0.0f, // fBleedGreen
+ 0.0f, // fBleedBlue
+ false, // bPremultAlpha
+ pvrtexlib::eRESIZE_BICUBIC // eResizeMode
+ );
+
+ // create texture to encode to
+ pvrtexlib::CPVRTexture sCompressedTexture(sOriginalTexture.getHeader());
+
+ // do the actual compression
+ sCompressedTexture.setPixelType(pvrtexlib::OGL_PVRTC4);
+ PVRU.CompressPVR(sOriginalTexture, sCompressedTexture);
+
+ compressedSize = sCompressedTexture.getData().getDataSize() + sizeof(XB_PVRHEADER);
+ compressed = new unsigned char[compressedSize];
+ memcpy(compressed + sizeof(XB_PVRHEADER), sCompressedTexture.getData().getData(), compressedSize - sizeof(XB_PVRHEADER));
+ // filling our header values
+ XB_PVRHEADER *pvrheader = (XB_PVRHEADER*)compressed;
+ pvrheader->image_width = width;
+ pvrheader->image_height = height;
+ pvrheader->texture_width = padded_w;
+ pvrheader->texture_height = padded_h;
+
+ if (padded_argb != argb)
+ delete[] padded_argb;
+
+ width = padded_w;
+ height = padded_h;
+ format = XB_FMT_PVR4;
+ }
+ PVRCATCH(myException)
+ {
+ // handle any exceptions here
+ printf("PVR Exception: %s",myException.what());
+ }
+ }
+ }
+#endif
CXBTFFrame frame;
if (format)
{
@@ -363,6 +478,7 @@ void Usage()
puts(" -dupecheck Enable duplicate file detection. Reduces output file size. Default: on");
puts(" -use_lzo Use lz0 packing. Default: on");
puts(" -use_dxt Use DXT compression. Default: on");
+ puts(" -use_pvr Use PVR compression. Default: off");
puts(" -use_none Use No compression. Default: off");
}
@@ -534,6 +650,9 @@ int main(int argc, char* argv[])
// setup some defaults, dxt with lzo post packing,
flags = FLAGS_USE_DXT;
+#if defined(USE_PVR_COMPRESSION)
+ flags = FLAGS_USE_PVR;
+#endif
#ifdef USE_LZO_PACKING
flags |= FLAGS_USE_LZO;
#endif
@@ -580,6 +699,11 @@ int main(int argc, char* argv[])
{
flags |= FLAGS_USE_DXT;
}
+ else if (!stricmp(args[i], "-use_pvr"))
+ {
+ flags &= ~FLAGS_USE_DXT;
+ flags |= FLAGS_USE_PVR;
+ }
#ifdef USE_LZO_PACKING
else if (!stricmp(args[i], "-use_lzo"))
{
diff --git a/tools/sigma/Makefile b/tools/sigma/Makefile
index e5be496..94607dc 100644
--- a/tools/sigma/Makefile
+++ b/tools/sigma/Makefile
@@ -10,7 +10,7 @@ export PYTHON_NOVERSIONCHECK=no-check
CONFIGURE=./configure --build=$(BUILD) --host=$(HOST) --prefix=/usr \
--enable-gles --disable-optical-drive --disable-dvdcss --enable-optimizations \
- --disable-x11 --disable-libbluray --disable-sdl --enable-directfb
+ --disable-x11 --disable-libbluray --disable-sdl --enable-directfb --enable-pvrtexlib
all: configure
configure:
diff --git a/xbmc/guilib/Texture.cpp b/xbmc/guilib/Texture.cpp
index 914bd72..7b952fb 100644
--- a/xbmc/guilib/Texture.cpp
+++ b/xbmc/guilib/Texture.cpp
@@ -73,7 +73,7 @@ CBaseTexture::~CBaseTexture()
delete[] m_pixels;
}
-void CBaseTexture::Allocate(unsigned int width, unsigned int height, unsigned int format)
+void CBaseTexture::Allocate(unsigned int width, unsigned int height, unsigned int format, const void* format_opaque)
{
m_imageWidth = width;
m_imageHeight = height;
@@ -97,6 +97,13 @@ void CBaseTexture::Allocate(unsigned int width, unsigned int height, unsigned in
m_textureWidth = ((m_textureWidth + 3) / 4) * 4;
m_textureHeight = ((m_textureHeight + 3) / 4) * 4;
}
+ else if ((m_format & XB_FMT_PVR2) || (m_format & XB_FMT_PVR4))
+ { // pvr compressed textures might be inset into a larger image.
+ // recover the real size and set m_imageWidth, m_imageHeight
+ XB_PVRHEADER *pvrheader = (XB_PVRHEADER*)format_opaque;
+ m_imageWidth = pvrheader->image_width;
+ m_imageHeight = pvrheader->image_height;
+ }
// check for max texture size
#define CLAMP(x, y) { if (x > y) x = y; }
@@ -120,6 +127,14 @@ void CBaseTexture::Update(unsigned int width, unsigned int height, unsigned int
{ // compressed format that we don't support
Allocate(width, height, XB_FMT_A8R8G8B8);
CDDSImage::Decompress(m_pixels, std::min(width, m_textureWidth), std::min(height, m_textureHeight), GetPitch(m_textureWidth), pixels, format);
+ ClampToEdge();
+ }
+ else if ((m_format & XB_FMT_PVR2) || (m_format & XB_FMT_PVR4))
+ { // pvr compressed textures might be inset into a larger image.
+ // and we need access to real image size in Allocate,
+ // pass in pixels so we can access the real sizes.
+ Allocate(width, height, format, pixels);
+ memcpy(m_pixels, pixels + sizeof(XB_PVRHEADER), GetPitch(width) * GetRows(height));
}
else
{
@@ -143,8 +158,8 @@ void CBaseTexture::Update(unsigned int width, unsigned int height, unsigned int
dst += dstPitch;
}
}
+ ClampToEdge();
}
- ClampToEdge();
if (loadToGPU)
LoadToGPU();
@@ -365,6 +380,10 @@ unsigned int CBaseTexture::GetPitch(unsigned int width) const
return ((width + 3) / 4) * 16;
case XB_FMT_A8:
return width;
+ case XB_FMT_PVR2:
+ return width / 4;
+ case XB_FMT_PVR4:
+ return width / 2;
case XB_FMT_RGB8:
return (((width + 1)* 3 / 4) * 4);
case XB_FMT_RGBA8:
diff --git a/xbmc/guilib/Texture.h b/xbmc/guilib/Texture.h
index 7a204b2..8a87c71 100644
--- a/xbmc/guilib/Texture.h
+++ b/xbmc/guilib/Texture.h
@@ -87,7 +87,7 @@ public:
int GetOrientation() const { return m_orientation; }
void Update(unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, const unsigned char *pixels, bool loadToGPU);
- void Allocate(unsigned int width, unsigned int height, unsigned int format);
+ void Allocate(unsigned int width, unsigned int height, unsigned int format, const void* format_opaque = NULL);
void ClampToEdge();
static unsigned int PadPow2(unsigned int x);
diff --git a/xbmc/guilib/TextureBundleXBT.cpp b/xbmc/guilib/TextureBundleXBT.cpp
index ff94284..8ce2c58 100644
--- a/xbmc/guilib/TextureBundleXBT.cpp
+++ b/xbmc/guilib/TextureBundleXBT.cpp
@@ -150,8 +150,10 @@ bool CTextureBundleXBT::LoadTexture(const CStdString& Filename, CBaseTexture** p
return false;
}
- width = frame.GetWidth();
- height = frame.GetHeight();
+ // get image width/height from texture itself as the
+ // real image might be padded in the texture.
+ width = (*ppTexture)->GetWidth();
+ height = (*ppTexture)->GetHeight();
return true;
}
diff --git a/xbmc/guilib/TextureGL.cpp b/xbmc/guilib/TextureGL.cpp
index 2c16007..f2d0039 100644
--- a/xbmc/guilib/TextureGL.cpp
+++ b/xbmc/guilib/TextureGL.cpp
@@ -31,6 +31,10 @@
#include <directfb.h>
#endif
+#if defined(HAS_GLES)
+#include <GLES2/gl2extimg.h>
+#endif
+
using namespace std;
/************************************************************************/
@@ -160,39 +164,59 @@ void CGLTexture::LoadToGPU()
else
#endif
{
- GLint internalformat;
- GLenum pixelformat;
+ GLint internalformat = GL_RGBA;
+ GLenum pixelformat;
- switch (m_format)
- {
- default:
- case XB_FMT_RGBA8:
- internalformat = pixelformat = GL_RGBA;
- break;
- case XB_FMT_RGB8:
- internalformat = pixelformat = GL_RGB;
- break;
- case XB_FMT_A8R8G8B8:
- if (g_Windowing.SupportsBGRA())
- {
- internalformat = pixelformat = GL_BGRA_EXT;
- }
- else if (g_Windowing.SupportsBGRAApple())
- {
- // Apple's implementation does not conform to spec. Instead, they require
- // differing format/internalformat, more like GL.
- internalformat = GL_RGBA;
- pixelformat = GL_BGRA_EXT;
- }
- else
- {
- SwapBlueRed(m_pixels, m_textureHeight, GetPitch());
+ switch (m_format)
+ {
+ default:
+ case XB_FMT_RGBA8:
internalformat = pixelformat = GL_RGBA;
- }
- break;
- }
- glTexImage2D(GL_TEXTURE_2D, 0, internalformat, m_textureWidth, m_textureHeight, 0,
- pixelformat, GL_UNSIGNED_BYTE, m_pixels);
+ break;
+ case XB_FMT_RGB8:
+ internalformat = pixelformat = GL_RGB;
+ break;
+ case XB_FMT_A8R8G8B8:
+ if (g_Windowing.SupportsBGRA())
+ {
+ internalformat = pixelformat = GL_BGRA_EXT;
+ }
+ else if (g_Windowing.SupportsBGRAApple())
+ {
+ // Apple's implementation does not conform to spec. Instead, they require
+ // differing format/internalformat, more like GL.
+ internalformat = GL_RGBA;
+ pixelformat = GL_BGRA_EXT;
+ }
+ else
+ {
+ SwapBlueRed(m_pixels, m_textureHeight, GetPitch());
+ internalformat = pixelformat = GL_RGBA;
+ }
+ break;
+ case XB_FMT_PVR2:
+ if (m_hasAlpha)
+ pixelformat = GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
+ else
+ pixelformat = GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
+ break;
+ case XB_FMT_PVR4:
+ if (m_hasAlpha)
+ pixelformat = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
+ else
+ pixelformat = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
+ break;
+ }
+ if ((m_format & XB_FMT_PVR2) || (m_format & XB_FMT_PVR4))
+ {
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, pixelformat,
+ m_textureWidth, m_textureHeight, 0, GetPitch() * GetRows(), m_pixels);
+ }
+ else
+ {
+ glTexImage2D(GL_TEXTURE_2D, 0, internalformat, m_textureWidth, m_textureHeight, 0,
+ pixelformat, GL_UNSIGNED_BYTE, m_pixels);
+ }
}
#endif
VerifyGLState();
diff --git a/xbmc/guilib/XBTF.h b/xbmc/guilib/XBTF.h
index 0c010cb..5459442 100644
--- a/xbmc/guilib/XBTF.h
+++ b/xbmc/guilib/XBTF.h
@@ -40,8 +40,19 @@
#define XB_FMT_RGBA8 64
#define XB_FMT_RGB8 128
#define XB_FMT_DFBSURFACE 256
+#define XB_FMT_PVR2 512
+#define XB_FMT_PVR4 1024
#define XB_FMT_OPAQUE 65536
+// wrapper for pvr compressed images
+struct XB_PVRHEADER
+{
+ uint32_t image_width;
+ uint32_t image_height;
+ uint32_t texture_width;
+ uint32_t texture_height;
+};
+
class CXBTFFrame
{
public:
https://github.com/xbmc/xbmc/commit/85646cb0d700f0d78b5287569782521dd169fce9
commit 85646cb0d700f0d78b5287569782521dd169fce9
Author: theuni <theuni-nospam-@...>
Date: Thu Oct 20 20:44:37 2011 -0400
[smp] use menu key rather than 'c'
diff --git a/xbmc/windowing/dfb/WinEventsDFB.cpp b/xbmc/windowing/dfb/WinEventsDFB.cpp
index 1a3312c..12a4349 100644
--- a/xbmc/windowing/dfb/WinEventsDFB.cpp
+++ b/xbmc/windowing/dfb/WinEventsDFB.cpp
@@ -25,7 +25,6 @@
#include "WinEvents.h"
#include "Application.h"
#include "WindowingFactory.h"
-
#include <directfb.h>
PHANDLE_EVENT_FUNC CWinEventsBase::m_pEventFunc = NULL;
@@ -140,7 +139,7 @@ bool CWinEventsDFB::MessagePump()
newEvent.key.keysym.sym = (XBMCKey)XBMCK_TAB;
break;
case DIKS_MENU:
- newEvent.key.keysym.sym = (XBMCKey)XBMCK_c;
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_MENU;
break;
case DIKS_NEXT:
newEvent.key.keysym.sym = (XBMCKey)XBMCK_MEDIA_NEXT_TRACK;
https://github.com/xbmc/xbmc/commit/3d11cbd79497dbf95082632d3af9717596e87e12
commit 3d11cbd79497dbf95082632d3af9717596e87e12
Author: theuni <theuni-nospam-@...>
Date: Thu Oct 20 20:20:19 2011 -0400
[smp] fixed virtual keyboard arrows
diff --git a/xbmc/settings/GUISettings.cpp b/xbmc/settings/GUISettings.cpp
index 0249ddd..2ebbd70 100644
--- a/xbmc/settings/GUISettings.cpp
+++ b/xbmc/settings/GUISettings.cpp
@@ -483,7 +483,11 @@ void CGUISettings::Initialize()
AddInt(NULL, "input.appleremotesequencetime", 13603, 500, 50, 50, 1000, SPIN_CONTROL_INT_PLUS, MASK_MS, TEXT_OFF);
AddSeparator(in, "input.sep1");
#endif
+#if defined (HAS_SIGMASMP)
+ AddBool(NULL, "input.remoteaskeyboard", 21449, true);
+#else
AddBool(in, "input.remoteaskeyboard", 21449, false);
+#endif
#if defined(TARGET_DARWIN_IOS)
AddBool(NULL, "input.enablemouse", 21369, true);
#else
https://github.com/xbmc/xbmc/commit/daa4720102b828484f5c8dc4b596a7e64a36a733
commit daa4720102b828484f5c8dc4b596a7e64a36a733
Author: davilla <davilla@...>
Date: Thu Oct 20 14:25:09 2011 -0400
[smp] fixed, initial video bleed on playback startup
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
index 18e7d30..97cc007 100755
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -1245,6 +1245,11 @@ void CSMPPlayer::Process()
throw;
}
+ // hide the gui layer so we can get stream info first
+ // without having video playback blended into it.
+ if (m_item.IsVideo())
+ g_Windowing.Hide();
+
// wait for playback to start with 20 second timeout
if (WaitForAmpPlaying(20000))
{
@@ -1279,10 +1284,6 @@ void CSMPPlayer::Process()
// check for video in media content
if (GetVideoStreamCount() > 0)
{
- // hide the gui layer so we can get stream info first
- // without having video playback blended into it.
- g_Windowing.Hide();
-
// turn on/off subs
SetSubtitleVisible(g_settings.m_currentVideoSettings.m_SubtitleOn);
SetSubTitleDelay(g_settings.m_currentVideoSettings.m_SubtitleDelay);
@@ -1381,6 +1382,8 @@ void CSMPPlayer::Process()
CLog::Log(LOGERROR, "CSMPPlayer::Process Exception thrown");
}
+ // in case we error somewhere with gui hidden
+ g_Windowing.Show();
if (m_amp)
m_amp->CloseMedia(m_amp);
}
https://github.com/xbmc/xbmc/commit/89a067ef329cbbd8b73c5f490a0c007b928daee1
commit 89a067ef329cbbd8b73c5f490a0c007b928daee1
Author: davilla <davilla@...>
Date: Thu Oct 20 14:08:01 2011 -0400
[dfb] add missing event to xbmc key mapping
diff --git a/xbmc/windowing/dfb/WinEventsDFB.cpp b/xbmc/windowing/dfb/WinEventsDFB.cpp
index a9ada3f..1a3312c 100644
--- a/xbmc/windowing/dfb/WinEventsDFB.cpp
+++ b/xbmc/windowing/dfb/WinEventsDFB.cpp
@@ -109,10 +109,13 @@ bool CWinEventsDFB::MessagePump()
case DIKS_VOLUME_UP:
newEvent.key.keysym.sym = (XBMCKey)XBMCK_VOLUME_UP;
break;
+ case DIKS_VOLUME_DOWN:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_VOLUME_DOWN;
+ break;
case DIKS_MUTE:
newEvent.key.keysym.sym = (XBMCKey)XBMCK_VOLUME_MUTE;
break;
- case DIKS_PREVIOUS:
+ case DIKS_BACKSPACE:
newEvent.key.keysym.sym = (XBMCKey)XBMCK_BACKSPACE;
break;
case DIKS_PLAY:
@@ -128,11 +131,26 @@ bool CWinEventsDFB::MessagePump()
newEvent.key.keysym.sym = (XBMCKey)XBMCK_f;
break;
case DIKS_PAUSE:
- newEvent.key.keysym.sym = (XBMCKey)XBMCK_PAUSE;
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_MEDIA_PLAY_PAUSE;
break;
case DIKS_INFO:
newEvent.key.keysym.sym = (XBMCKey)XBMCK_i;
break;
+ case DIKS_PROGRAM:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_TAB;
+ break;
+ case DIKS_MENU:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_c;
+ break;
+ case DIKS_NEXT:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_MEDIA_NEXT_TRACK;
+ break;
+ case DIKS_PREVIOUS:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_MEDIA_PREV_TRACK;
+ break;
+ case DIKS_SUBTITLE:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_l;
+ break;
default:
newEvent.key.keysym.sym = (XBMCKey)XBMCK_UNKNOWN;
break;
https://github.com/xbmc/xbmc/commit/0bcf92eb4770971db221be6ae58ded6fb87d787a
commit 0bcf92eb4770971db221be6ae58ded6fb87d787a
Author: davilla <davilla@...>
Date: Thu Oct 20 14:06:44 2011 -0400
[smp] changed wait for playback to start timeout from 2 to 20 seconds, add srt subtitle handling, add mp3/aac audio playback
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
old mode 100644
new mode 100755
index d0e9365..18e7d30
--- a/xbmc/cores/smpplayer/SMPPlayer.cpp
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -260,12 +260,16 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
else if (extension.Equals(".mpg"))
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
- else if (extension.Equals(".vob"))
+ else if (extension.Equals(".m2t"))
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
else if (extension.Equals(".ts"))
format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
- else if (extension.Equals(".m2ts"))
- format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".vob"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2PES;
+ else if (extension.Equals(".mp3"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_MP3 | MTYPE_CONT_UNKNOWN;
+ else if (extension.Equals(".aac"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_ELEM_AAC | MTYPE_CONT_UNKNOWN;
else
format.mediaType = MTYPE_APP_UNKNOWN;
@@ -313,6 +317,8 @@ bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
URIUtils::GetExtension(filenames[i]) == ".utf8" ||
URIUtils::GetExtension(filenames[i]) == ".utf-8")
parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_UTF8;
+ else if (URIUtils::GetExtension(filenames[i]) == ".srt")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
else if (URIUtils::GetExtension(filenames[i]) == ".ssa")
parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SSA;
else if (URIUtils::GetExtension(filenames[i]) == ".ass")
@@ -1239,8 +1245,8 @@ void CSMPPlayer::Process()
throw;
}
- // wait for playback to start with 2 second timeout
- if (WaitForAmpPlaying(2000))
+ // wait for playback to start with 20 second timeout
+ if (WaitForAmpPlaying(20000))
{
m_speed = 1;
m_callback.OnPlayBackSpeedChanged(m_speed);
https://github.com/xbmc/xbmc/commit/cb50ce82cb7216897a9aca713666ec98407e14bf
commit cb50ce82cb7216897a9aca713666ec98407e14bf
Author: theuni <theuni-nospam-@...>
Date: Wed Oct 19 13:08:49 2011 -0400
[smp] fix default audio player
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp
index 5d4d627..9cf18cb 100644
--- a/xbmc/settings/AdvancedSettings.cpp
+++ b/xbmc/settings/AdvancedSettings.cpp
@@ -67,7 +67,6 @@ void CAdvancedSettings::Initialize()
#else
m_audioDefaultPlayer = "paplayer";
#endif
- m_audioDefaultPlayer = "paplayer";
m_audioPlayCountMinimumPercent = 90.0f;
m_audioHost = "default";
https://github.com/xbmc/xbmc/commit/627384e42e81bc8fc3bdf10f722e03800516bf17
commit 627384e42e81bc8fc3bdf10f722e03800516bf17
Author: theuni <theuni-nospam-@...>
Date: Mon Oct 17 19:02:14 2011 -0400
[smp] default to smpplayer
This can be reverted once we have a proper init script and config file.
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp
index 9e4e156..5d4d627 100644
--- a/xbmc/settings/AdvancedSettings.cpp
+++ b/xbmc/settings/AdvancedSettings.cpp
@@ -62,6 +62,11 @@ void CAdvancedSettings::Initialize()
m_karaokeAlwaysEmptyOnCdgs = 1;
m_karaokeUseSongSpecificBackground = 0;
+#if defined (HAS_SIGMASMP)
+ m_audioDefaultPlayer = "smpplayer";
+#else
+ m_audioDefaultPlayer = "paplayer";
+#endif
m_audioDefaultPlayer = "paplayer";
m_audioPlayCountMinimumPercent = 90.0f;
m_audioHost = "default";
@@ -83,8 +88,13 @@ void CAdvancedSettings::Initialize()
m_videoBlackBarColour = 0;
m_videoPPFFmpegDeint = "linblenddeint";
m_videoPPFFmpegPostProc = "ha:128:7,va,dr";
+#if defined (HAS_SIGMASMP)
+ m_videoDefaultPlayer = "smpplayer";
+ m_videoDefaultDVDPlayer = "smpplayer";
+#else
m_videoDefaultPlayer = "dvdplayer";
m_videoDefaultDVDPlayer = "dvdplayer";
+#endif
m_videoIgnoreSecondsAtStart = 3*60;
m_videoIgnorePercentAtEnd = 8.0f;
m_videoPlayCountMinimumPercent = 90.0f;
https://github.com/xbmc/xbmc/commit/eb6d6d58a305257bbbc8277f4015eadde150cc39
commit eb6d6d58a305257bbbc8277f4015eadde150cc39
Author: theuni <theuni-nospam-@...>
Date: Mon Oct 17 19:04:41 2011 -0400
[smp] hook up smpplayer
diff --git a/.gitignore b/.gitignore
index 8f780f8..651eb3f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -706,6 +706,9 @@ lib/cmyth/Makefile
# /xbmc/cores/paplayer/
/xbmc/cores/paplayer/Makefile
+# /xbmc/cores/smpplayer/
+xbmc/cores/smpplayer/Makefile
+
# /lib/xbadpcm/
/lib/xbadpcm/Makefile
/lib/xbadpcm/adpcm.lib
diff --git a/Makefile.in b/Makefile.in
index 1833dc5..269cff4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -22,6 +22,7 @@ BIN_DIRS= \
xbmc/cores/VideoRenderers \
xbmc/cores/VideoRenderers/VideoShaders \
xbmc/cores/ExternalPlayer \
+ xbmc/cores/smpplayer \
xbmc/cores/playercorefactory \
xbmc/filesystem \
xbmc/filesystem/MusicDatabaseDirectory \
@@ -247,6 +248,8 @@ xbmc/cores/VideoRenderers/VideoShaders/VideoShaders.a: force
$(MAKE) -C xbmc/cores/VideoRenderers/VideoShaders
xbmc/cores/ExternalPlayer/ExternalPlayer.a: force
$(MAKE) -C xbmc/cores/ExternalPlayer
+xbmc/cores/smpplayer/SMPPlayer.a: force
+ $(MAKE) -C xbmc/cores/smpplayer
xbmc/cores/playercorefactory/playercorefactory.a: force
$(MAKE) -C xbmc/cores/playercorefactory
xbmc/filesystem/filesystem.a: force
@@ -471,6 +474,7 @@ OBJSXBMC= \
$(DVDPLAYER_ARCHIVES) \
xbmc/cores/AudioRenderers/audiorenderers.a \
xbmc/cores/ExternalPlayer/ExternalPlayer.a \
+ xbmc/cores/smpplayer/SMPPlayer.a \
xbmc/filesystem/filesystem.a \
xbmc/filesystem/MusicDatabaseDirectory/musicdatabasedirectory.a \
xbmc/filesystem/VideoDatabaseDirectory/videodatabasedirectory.a \
diff --git a/configure.in b/configure.in
index 9e07fce..6d3b97b 100755
--- a/configure.in
+++ b/configure.in
@@ -1872,6 +1872,7 @@ OUTPUT_FILES="Makefile \
xbmc/cores/dvdplayer/DVDSubtitles/Makefile \
xbmc/cores/AudioRenderers/Makefile \
xbmc/cores/paplayer/Makefile \
+ xbmc/cores/smpplayer/Makefile \
lib/timidity/Makefile \
lib/xbadpcm/Makefile \
lib/asap/Makefile \
diff --git a/xbmc/cores/playercorefactory/PlayerCoreConfig.h b/xbmc/cores/playercorefactory/PlayerCoreConfig.h
index b4d741e..917a7fb 100644
--- a/xbmc/cores/playercorefactory/PlayerCoreConfig.h
+++ b/xbmc/cores/playercorefactory/PlayerCoreConfig.h
@@ -27,6 +27,9 @@
#include "cores/paplayer/PAPlayer.h"
#include "cores/ExternalPlayer/ExternalPlayer.h"
#include "utils/log.h"
+#if defined (HAS_SIGMASMP)
+#include "cores/smpplayer/SMPPlayer.h"
+#endif
class CPlayerCoreConfig
{
@@ -74,6 +77,9 @@ public:
case EPC_DVDPLAYER: pPlayer = new CDVDPlayer(callback); break;
case EPC_PAPLAYER: pPlayer = new PAPlayer(callback); break;
case EPC_EXTPLAYER: pPlayer = new CExternalPlayer(callback); break;
+#if defined (HAS_SIGMASMP)
+ case EPC_SMPPLAYER: pPlayer = new CSMPPlayer(callback); break;
+#endif
default: return NULL;
}
diff --git a/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp b/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
index 3aaf546..a2e6c48 100644
--- a/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
+++ b/xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
@@ -280,6 +280,13 @@ bool CPlayerCoreFactory::LoadConfiguration(TiXmlElement* pConfig, bool clear)
paplayer->m_bPlaysAudio = true;
s_vecCoreConfigs.push_back(paplayer);
+#if defined (HAS_SIGMASMP)
+ CPlayerCoreConfig* smpplayer = new CPlayerCoreConfig("SMPPlayer", EPC_SMPPLAYER, NULL);
+ smpplayer->m_bPlaysAudio = true;
+ smpplayer->m_bPlaysVideo = true;
+ s_vecCoreConfigs.push_back(smpplayer);
+#endif
+
for(std::vector<CPlayerSelectionRule *>::iterator it = s_vecCoreSelectionRules.begin(); it != s_vecCoreSelectionRules.end(); it++)
delete *it;
s_vecCoreSelectionRules.clear();
diff --git a/xbmc/cores/playercorefactory/PlayerCoreFactory.h b/xbmc/cores/playercorefactory/PlayerCoreFactory.h
index 04ac1dc..d239ab3 100644
--- a/xbmc/cores/playercorefactory/PlayerCoreFactory.h
+++ b/xbmc/cores/playercorefactory/PlayerCoreFactory.h
@@ -37,7 +37,8 @@ enum EPLAYERCORES
EPC_DVDPLAYER,
EPC_MPLAYER,
EPC_PAPLAYER,
- EPC_EXTPLAYER
+ EPC_EXTPLAYER,
+ EPC_SMPPLAYER
};
typedef unsigned int PLAYERCOREID;
@@ -46,6 +47,7 @@ const PLAYERCOREID PCID_NONE = 0;
const PLAYERCOREID PCID_DVDPLAYER = 1;
const PLAYERCOREID PCID_MPLAYER = 2;
const PLAYERCOREID PCID_PAPLAYER = 3;
+const PLAYERCOREID PCID_SMPPLAYER = 4;
class CPlayerCoreFactory
{
diff --git a/xbmc/cores/smpplayer/FileIDataSource.cpp b/xbmc/cores/smpplayer/FileIDataSource.cpp
new file mode 100644
index 0000000..fbea975
--- /dev/null
+++ b/xbmc/cores/smpplayer/FileIDataSource.cpp
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "FileIDataSource.h"
+#include "filesystem/File.h"
+#include "utils/log.h"
+#include "FileItem.h"
+
+//========================================================================
+CFileIDataSource::CFileIDataSource(const char *url)
+{
+ strncpy(m_url, url, sizeof(m_url));
+}
+
+//========================================================================
+CFileIDataSource::~CFileIDataSource()
+{
+}
+
+//========================================================================
+void* CFileIDataSource::GetFormatSpecificCPInterface()
+{
+ CLog::Log(LOGDEBUG, "CFileIDataSource::GetFormatSpecificCPInterface");
+
+ return (void*)NULL;
+}
+
+//========================================================================
+void* CFileIDataSource::Open(char* url, enum EDSResult *pRes)
+{
+ // open the file, always in read mode, calc bitrate
+ unsigned int flags = READ_BITRATE;
+ XFILE::CFile *cfile = new XFILE::CFile();
+
+ if (CFileItem(m_url, false).IsInternetStream())
+ flags |= READ_CACHED;
+
+ // open file in binary mode
+ if (!cfile->Open(m_url, flags))
+ {
+ delete cfile;
+ cfile = NULL;
+ }
+
+ CLog::Log(LOGDEBUG, "CFileIDataSource::Open url(%s), filename(%s), ch(0x%08lx)",
+ url, m_url, (long unsigned int)cfile);
+
+ if (pRes)
+ {
+ if (cfile)
+ *pRes = DSRES_OK;
+ else
+ *pRes = DSRES_SOURCE_MISSING;
+ }
+
+ return (void*)cfile;
+}
+
+//========================================================================
+bool CFileIDataSource::GetChannelParams(struct SChannelParams *pParams)
+{
+ CLog::Log(LOGDEBUG, "CFileIDataSource::GetChannelParams");
+ // we do not know the channel parameters,
+ /*
+ pParams->blockSize; // amount of data currently available in the buffer
+ pParams->bitrate;
+ pParams->delay;
+ pParams->nonBlocking; // whether the source is non-blocking or not
+ */
+return false;
+}
+
+//========================================================================
+uint32_t CFileIDataSource::Read(void *ch, uint32_t size, unsigned char *buf, enum EDSResult *pRes)
+{
+ //fprintf(stderr, "CFileIDataSource::Read, ch(0x%08lx), size(%d)\n",
+ // (long unsigned int)ch, size);
+ unsigned int readSize;
+ XFILE::CFile *cfile = (XFILE::CFile*)ch;
+
+ readSize = cfile->Read(buf, size);
+ if (readSize > 0)
+ {
+ if (pRes)
+ *pRes = DSRES_OK;
+ return readSize;
+ }
+ else if (readSize == 0)
+ {
+ if (pRes)
+ *pRes = DSRES_EOF;
+ return 0;
+ }
+ else if (pRes)
+ *pRes = DSRES_SOURCE_ERROR;
+
+ return -1;
+}
+
+//========================================================================
+int64_t CFileIDataSource::Seek(void *ch, int64_t pos, bool isRel, enum EDSResult *pRes)
+{
+ //fprintf(stderr, "CFileIDataSource::Seek, ch(0x%08lx), pos(%lld), isRel(%d)\n",
+ // (long unsigned int)ch, pos, isRel);
+ XFILE::CFile *cfile = (XFILE::CFile*)ch;
+
+ if (pRes)
+ *pRes = DSRES_SOURCE_ERROR;
+
+ if (!isRel && (pos == -1))
+ {
+ // seek to the end of file
+ pos = cfile->Seek(0, SEEK_END);
+ if (pos == -1)
+ return -1;
+ }
+ else
+ {
+ pos = cfile->Seek(pos, isRel ? SEEK_CUR : SEEK_SET);
+ if (pos == -1)
+ return -1;
+ }
+
+ if (pRes)
+ *pRes = DSRES_OK;
+
+ return pos;
+}
+
+//========================================================================
+void CFileIDataSource::Flush(void *ch, bool internal)
+{
+ CLog::Log(LOGDEBUG, "CFileIDataSource::Flush, ch(0x%08lx), internal(%d)",
+ (long unsigned int)ch, internal);
+ XFILE::CFile *cfile = (XFILE::CFile*)ch;
+ cfile->Flush();
+};
+
+
+//========================================================================
+void CFileIDataSource::Close(void* ch)
+{
+ CLog::Log(LOGDEBUG, "CFileIDataSource::Close, ch(0x%08lx)",
+ (long unsigned int)ch);
+ XFILE::CFile *cfile = (XFILE::CFile*)ch;
+ cfile->Close();
+ delete cfile;
+}
diff --git a/xbmc/cores/smpplayer/FileIDataSource.h b/xbmc/cores/smpplayer/FileIDataSource.h
new file mode 100644
index 0000000..5d336d5
--- /dev/null
+++ b/xbmc/cores/smpplayer/FileIDataSource.h
@@ -0,0 +1,93 @@
+#pragma once
+/*
+ * Copyright (C) 2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include <stdint.h>
+#include <stdio.h>
+
+class CFileIDataSource
+{
+public:
+ struct SChannelParams
+ {
+ uint32_t blockSize;
+ uint32_t bitrate;
+ uint32_t delay;
+ uint8_t nonBlocking;
+ };
+
+ /// Data source operation result code
+ enum EDSResult
+ {
+ DSRES_OK = 0, // operation completed successfully
+ DSRES_INVALID_PARAMS, // operation failed because of invalid parameters (wrong URL, seek position, etc)
+ DSRES_SOURCE_MISSING, // operation failed because the source is currently unavailable (disc ejected, connection closed, etc)
+ DSRES_SOURCE_TIMEOUT, // operation has not completed inside the accepted time interval, but it may be a temporary situation
+ DSRES_SOURCE_ERROR, // operation failed due to an internal error reported by the source
+ DSRES_SOURCE_PROTECTED, // operation failed because the source is protected
+ DSRES_SOURCE_NOSUPPORT, // operation failed because the source does not support it
+ DSRES_ERROR, // operation failed due to an unspecified error (either invalid parameters or source problems)
+ DSRES_EOF, // end of file has been encountered
+ };
+
+ CFileIDataSource(const char *url);
+ virtual ~CFileIDataSource();
+
+ virtual void* GetFormatSpecificCPInterface();
+
+ // Returns channel parameters like block size, bitrate, delay.
+ virtual bool GetChannelParams(struct SChannelParams *pParams);
+
+ // Opens a data channel for reading
+ // Returns an opaque channel handle.
+ // The url of the data is transparent to the caller
+ virtual void* Open(char* url, enum EDSResult *pRes = NULL);
+
+ // Reads size bytes from the current location of the specified, previously opened channel.
+ // Blocks until the requested size has been read or an exception occurs
+ // Returns the number of bytes actually read, or:
+ // 0, after the end of source has been reached
+ // -1, if any error has occurred (the optional parameter pRes holds, if present, the error reason)
+ virtual uint32_t Read(void *ch, uint32_t size, unsigned char *buf, enum EDSResult *pRes = NULL);
+
+ // Seeks at the specified location of the specified, previously opened channel.
+ // The seek can be absolute (from start) or relative (to the current position).
+ // For seeking at the end of the file, specify -1 as absolute position
+ // Returns the new absolute position into the file if successful, -1 otherwise.
+ // All data sources that don't support seeking must return -1 for every position,
+ // especially for relative position 0 (which is used in order to determine whether
+ // the data source supports seeking).
+ virtual int64_t Seek(void* ch, int64_t pos, bool isRel = 0, enum EDSResult *pRes = NULL);
+
+ // Flushes the internal or the external portion of the channel
+ // internal: Flushing the channel unblocks the pending Read() call, if any,
+ // that has been waiting for data to become available.
+ // external: Flushing the channel discards any data not read yet.
+ //
+ // The expected use is: Flush(internal), (temporarily) stop the reading process, Flush(external)
+ virtual void Flush(void *ch, bool internal = false);
+
+ // Closes a previously opened channel.
+ virtual void Close(void* ch);
+
+private:
+ char m_url[2048];
+};
diff --git a/xbmc/cores/smpplayer/Makefile.in b/xbmc/cores/smpplayer/Makefile.in
new file mode 100644
index 0000000..97a2aef
--- /dev/null
+++ b/xbmc/cores/smpplayer/Makefile.in
@@ -0,0 +1,12 @@
+CXXFLAGS+= \
+ @DIRECTFB_CFLAGS@ \
+
+SRCS= \
+ FileIDataSource.cpp \
+ SMPPlayer.cpp
+
+LIB= SMPPlayer.a
+
+include @abs_top_srcdir@...
+-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS)))
+
diff --git a/xbmc/cores/smpplayer/SMPPlayer.cpp b/xbmc/cores/smpplayer/SMPPlayer.cpp
new file mode 100644
index 0000000..d0e9365
--- /dev/null
+++ b/xbmc/cores/smpplayer/SMPPlayer.cpp
@@ -0,0 +1,1610 @@
+/*
+ * Copyright (C) 2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "system.h"
+
+#if defined (HAS_SIGMASMP)
+#include "SMPPlayer.h"
+#include "Application.h"
+#include "FileItem.h"
+#include "GUIInfoManager.h"
+#include "Util.h"
+#include "cores/VideoRenderers/RenderManager.h"
+#include "filesystem/SpecialProtocol.h"
+#include "guilib/GUIWindowManager.h"
+#include "settings/AdvancedSettings.h"
+#include "settings/GUISettings.h"
+#include "settings/Settings.h"
+#include "threads/SingleLock.h"
+#include "windowing/WindowingFactory.h"
+#include "utils/log.h"
+#include "utils/TimeUtils.h"
+#include "utils/URIUtils.h"
+
+#include "FileIDataSource.h"
+
+#include <directfb.h>
+#include <iadvancedmediaprovider.h>
+#include <cdefs_lpb.h>
+
+#include <algorithm>
+
+union UMSStatus
+{
+ struct SStatus generic;
+ struct SLPBStatus lpb;
+};
+union UMSCommand
+{
+ struct SCommand generic;
+ struct SLPBCommand lpb;
+};
+union UMSResult
+{
+ struct SResult generic;
+ struct SLPBResult lpb;
+};
+
+struct SIdsData
+{
+ CFileIDataSource *src;
+ void *ch;
+};
+
+static const char *mediaType2String(TMediaType type)
+{
+ const char *text = NULL;
+
+ switch (type)
+ {
+ case MTYPE_ELEM_NONE: text = "none"; break;
+ case MTYPE_ELEM_UNKNOWN: text = "unknown"; break;
+ case MTYPE_ELEM_MPEG1: text = "MPEG1 video"; break;
+ case MTYPE_ELEM_MPEG2: text = "MPEG2 video"; break;
+ case MTYPE_ELEM_MPEG4: text = "MPEG4 video"; break;
+ case MTYPE_ELEM_AVC: text = "MPEG4 AVC video"; break;
+ case MTYPE_ELEM_VC1: text = "VC1 video"; break;
+ case MTYPE_ELEM_DIVX3: text = "DIVX 3 video"; break;
+ case MTYPE_ELEM_DIVX4: text = "DIVX 4 video"; break;
+ //case MTYPE_ELEM_MPA: text = "MPEG audio"; break;
+ case MTYPE_ELEM_MP1: text = "MPEG1 Layer 1-2 audio"; break;
+ //case MTYPE_ELEM_MP2: text = "MPEG1 Layer 2 audio"; break;
+ case MTYPE_ELEM_MP3: text = "MPEG1 Layer 3 (MP3) audio"; break;
+ case MTYPE_ELEM_MP2MC: text = "MPEG2 (MC) audio"; break;
+ case MTYPE_ELEM_AAC: text = "MPEG2 AAC audio"; break;
+ case MTYPE_ELEM_AACP: text = "MPEG2 AAC+ audio"; break;
+ case MTYPE_ELEM_AC3: text = "Dolby Digital (AC3) audio"; break;
+ case MTYPE_ELEM_DDP: text = "Dolby Digital Plus audio"; break;
+ case MTYPE_ELEM_DLLS: text = "? audio"; break;
+ case MTYPE_ELEM_DTS: text = "DTS audio"; break;
+ case MTYPE_ELEM_DTSHD: text = "DTS-HD audio"; break;
+ case MTYPE_ELEM_PCM: text = "PCM audio"; break;
+ case MTYPE_ELEM_WMA: text = "WMA"; break;
+ case MTYPE_ELEM_WMAPRO: text = "WMA-PRO"; break;
+ case MTYPE_ELEM_SPU: text = "SD graphic subtitles"; break;
+ case MTYPE_ELEM_PG: text = "HD graphic subtitles"; break;
+ case MTYPE_ELEM_IG: text = "Interactive graphics"; break;
+ case MTYPE_ELEM_TS: text = "Text subtitles"; break;
+ case MTYPE_ELEM_JPEG: text = "JPEG graphics"; break;
+ case MTYPE_ELEM_GIF: text = "GIF graphics"; break;
+ case MTYPE_ELEM_PNG: text = "PNG graphics"; break;
+ case MTYPE_ELEM_BMP: text = "BMP graphics"; break;
+ case MTYPE_ELEM_TIFF: text = "TIFF graphics"; break;
+ case MTYPE_ELEM_PIXMAP: text = "RAW graphics"; break;
+ case MTYPE_ELEM_ASCII: text = "ASCII text"; break;
+ case MTYPE_ELEM_FONT: text = "Font data"; break;
+ case MTYPE_ELEM_VIDEO: text = "video"; break;
+ case MTYPE_ELEM_AUDIO: text = "audio"; break;
+ case MTYPE_ELEM_GRAPHICS: text = "graphics"; break;
+ case MTYPE_CONT_ASF: text = "asf"; break;
+ case MTYPE_CONT_AVI: text = "avi"; break;
+ default: text = "invalid value"; break;
+ }
+ return text;
+}
+
+static const char *mediaTypeToCodecName(TMediaType type)
+{
+ const char *text = NULL;
+
+ switch (type)
+ {
+ case MTYPE_ELEM_MPEG1: text = "mpeg1video"; break;
+ case MTYPE_ELEM_MPEG2: text = "mpeg2video"; break;
+ case MTYPE_ELEM_MPEG4: text = "mpeg4"; break;
+ case MTYPE_ELEM_AVC: text = "avc1"; break;
+ case MTYPE_ELEM_VC1: text = "vc-1"; break;
+ case MTYPE_ELEM_DIVX3: text = "divx"; break;
+ case MTYPE_ELEM_DIVX4: text = "divx"; break;
+ case MTYPE_ELEM_MP1: text = "mp1"; break;
+ //case MTYPE_ELEM_MP2: text = "mp2"; break;
+ case MTYPE_ELEM_MP3: text = "mp3"; break;
+ case MTYPE_ELEM_MP2MC: text = "mp2"; break;
+ case MTYPE_ELEM_AAC: text = "aac"; break;
+ case MTYPE_ELEM_AACP: text = "aac"; break;
+ case MTYPE_ELEM_AC3: text = "ac3"; break;
+ case MTYPE_ELEM_DDP: text = "dca"; break;
+ case MTYPE_ELEM_DTS: text = "dts"; break;
+ case MTYPE_ELEM_DTSHD: text = "dtshd-ma"; break;
+ case MTYPE_ELEM_PCM: text = "pcm"; break;
+ case MTYPE_ELEM_WMA: text = "wma"; break;
+ case MTYPE_ELEM_WMAPRO: text = "wmapro"; break;
+ default: text = ""; break;
+ }
+ return text;
+}
+
+CSMPPlayer::CSMPPlayer(IPlayerCallback &callback)
+ : IPlayer(callback),
+ CThread(),
+ m_ready(true)
+{
+ m_amp = NULL;
+ // request video layer
+ m_ampID = MAIN_VIDEO_AMP_ID;
+ //m_ampID = SECONDARY_VIDEO_AMP_ID;
+ m_speed = 0;
+ m_paused = false;
+ m_StopPlaying = false;
+
+ m_status = malloc(sizeof(union UMSStatus));
+ memset(m_status, 0, sizeof(union UMSStatus));
+ ((UMSStatus*)m_status)->generic.size = sizeof(union UMSStatus);
+ ((UMSStatus*)m_status)->generic.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ m_subtitle_params = (SLPBCmd_SubsParameters*)calloc(1, sizeof(SLPBCmd_SubsParameters));
+}
+
+CSMPPlayer::~CSMPPlayer()
+{
+ CloseFile();
+
+ free(m_subtitle_params);
+ free(m_status);
+}
+
+bool CSMPPlayer::OpenFile(const CFileItem &file, const CPlayerOptions &options)
+{
+ try
+ {
+ CLog::Log(LOGNOTICE, "CSMPPlayer: Opening: %s", file.GetPath().c_str());
+ // if playing a file close it first
+ // this has to be changed so we won't have to close it.
+ if(ThreadHandle())
+ CloseFile();
+
+ m_item = file;
+ m_options = options;
+ m_elapsed_ms = 0;
+ m_duration_ms = 0;
+
+ m_audio_index = -1;
+ m_audio_count = 0;
+ m_audio_info = "none";
+ m_audio_delay = g_settings.m_currentVideoSettings.m_AudioDelay;
+
+ m_video_index = -1;
+ m_video_count = 0;
+ m_video_info = "none";
+ m_video_width = 0;
+ m_video_height = 0;
+ m_video_fps_numerator = 25;
+ m_video_fps_denominator = 1;
+
+ m_subtitle_index = -1;
+ m_subtitle_count = 0;
+ m_subtitle_delay = 0;
+
+ m_chapter_index = 0;
+ m_chapter_count = 0;
+
+ IDirectFB *dfb = g_Windowing.GetIDirectFB();
+ DFBResult res = dfb->GetInterface(dfb, "IAdvancedMediaProvider", "EM8630", (void*)m_ampID, (void **)&m_amp);
+ if (res != DFB_OK)
+ {
+ CLog::Log(LOGDEBUG, "CSMPPlayer::OpenFile:Could not get IAdvancedMediaProvider");
+ return false;
+ }
+ // The event buffer must be retrieved BEFORE the OpenMedia() call
+ res = m_amp->GetEventBuffer(m_amp, &m_amp_event);
+ if (res != DFB_OK)
+ {
+ CLog::Log(LOGDEBUG, "CSMPPlayer::OpenFile:Could not retrieve the AMP event buffer!!!");
+ return false;
+ }
+
+ std::string url;
+ SMediaFormat format = { 0 };
+#if 0
+ CStdString protocol = m_item.GetProtocol();
+ if (protocol == "http")
+ {
+ format.mediaType = MTYPE_APP_UNKNOWN;
+ // strip user agent that we append
+ url = m_item.m_strPath;
+ url = url.erase(url.rfind('|'), url.size());
+ }
+ else
+#endif
+ {
+ // default to hinting container type
+ CStdString extension;
+ extension = URIUtils::GetExtension(m_item.GetPath());
+ if (extension.Equals(".wmv"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_ASF;
+ else if (extension.Equals(".avi"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_AVI;
+ else if (extension.Equals(".mkv"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MKV;
+ else if (extension.Equals(".mp4"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
+ else if (extension.Equals(".mov"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_MP4;
+ else if (extension.Equals(".mpg"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".vob"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".ts"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else if (extension.Equals(".m2ts"))
+ format.mediaType = MTYPE_APP_NONE | MTYPE_CONT_M2TS;
+ else
+ format.mediaType = MTYPE_APP_UNKNOWN;
+
+ // local source only for now, smb is failing to read
+ SIdsData ids;
+ char c_str[64];
+ // setup the IDataSource cookie, CloseMedia will delete it
+ ids.src = new CFileIDataSource(m_item.GetPath());
+ snprintf(c_str, sizeof(c_str)/sizeof(char), "ids://0x%08lx", (long unsigned int)&ids);
+ url = c_str;
+ }
+
+ // Setup open parameters
+ struct SLPBOpenParams parameters = {0, };
+ parameters.zero = 0;
+ // magic cookie to indicate this is binary params
+ parameters.a1b2c3d4 = 0xa1b2c3d4;
+ // audio offset time from video in milliseconds
+ parameters.audioOffset = m_audio_delay;
+ // system time clock offset in milliseconds.
+ // negative values will delay start of presentation.
+ parameters.stcOffset = -200;
+ // max prebuffersize in bytes, 0 for default
+ parameters.maxPrebufferSize = 100 * 1024;
+
+#if defined(SLPBPARAMS_MAX_TEXT_SUBS)
+ // find any available external subtitles
+ // SRT, SSA, ASS, SUB, SMI or binary SUB/IDX
+
+ std::vector<CStdString> filenames;
+ CUtil::ScanForExternalSubtitles( m_item.GetPath(), filenames );
+ int sub_file_count = filenames.size();
+ if (sub_file_count > SLPBPARAMS_MAX_TEXT_SUBS)
+ sub_file_count = SLPBPARAMS_MAX_TEXT_SUBS;
+
+ parameters.textSubs.count = 0;
+ for(int i = 0; i < sub_file_count; i++)
+ {
+ parameters.textSubs.entry[parameters.textSubs.count].type = (SLPBTextSubs)0;
+ //
+ if (URIUtils::GetExtension(filenames[i]) == ".txt" ||
+ URIUtils::GetExtension(filenames[i]) == ".text")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
+ else if (URIUtils::GetExtension(filenames[i]) == ".utf" ||
+ URIUtils::GetExtension(filenames[i]) == ".utf8" ||
+ URIUtils::GetExtension(filenames[i]) == ".utf-8")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_UTF8;
+ else if (URIUtils::GetExtension(filenames[i]) == ".ssa")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SSA;
+ else if (URIUtils::GetExtension(filenames[i]) == ".ass")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASS;
+ else if (URIUtils::GetExtension(filenames[i]) == ".sub")
+ {
+ // make sure this is NOT a idx/sub pair
+ CStdString strSubFile;
+ if ( !CUtil::FindVobSubPair( filenames, filenames[i], strSubFile ) )
+ {
+ m_subtitle_params->setSUBFrameRate = TRUE;
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SUB;
+ parameters.textSubs.entry[parameters.textSubs.count].framerateNumerator = 25;
+ parameters.textSubs.entry[parameters.textSubs.count].framerateDenominator = 1;
+ }
+ }
+ else if (URIUtils::GetExtension(filenames[i]) == ".smi")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_SMI;
+ else if (URIUtils::GetExtension(filenames[i]) == ".srt")
+ parameters.textSubs.entry[parameters.textSubs.count].type = SLPBTextSubs_ASCII;
+
+ // if we have a type, create the file data source (ids)
+ if (parameters.textSubs.entry[parameters.textSubs.count].type)
+ {
+ SIdsData *idsdata;
+ CStdString url;
+
+ idsdata = new SIdsData;
+ // setup the IDataSource cookie, Who will delete it ?
+ idsdata->src = new CFileIDataSource(filenames[i].c_str());
+ m_sub_ids.push_back(idsdata);
+ url.Format("ids://0x%08lx", (long unsigned int)m_sub_ids.back());
+ m_sub_urls.push_back(url);
+ parameters.textSubs.entry[i].fileUrl = (char*)m_sub_urls.back().c_str();
+
+ // TODO: figure out a better description of the subtitle.
+ strcpy(parameters.textSubs.entry[i].description, "some external subtitle file");
+ CLog::Log(LOGDEBUG, "subtile file found, %s, creating ids source %s",
+ filenames[i].c_str(), parameters.textSubs.entry[i].fileUrl);
+ parameters.textSubs.count++;
+ }
+ }
+
+ // check for any idx/sub pair (vobsub file)
+ for(int i = 0; i < sub_file_count; i++)
+ {
+ if (URIUtils::GetExtension(filenames[i]) == ".idx")
+ {
+ // check for idx/sub pair (vobsub file)
+ CStdString strSubFile;
+ if ( CUtil::FindVobSubPair( filenames, filenames[i], strSubFile ) )
+ {
+ SIdsData *idsdata;
+ CStdString url;
+
+ idsdata = new SIdsData;
+ // setup the IDataSource cookies, Who will delete them ?
+ idsdata->src = new CFileIDataSource(filenames[i].c_str());
+ m_sub_ids.push_back(idsdata);
+ url.Format("ids://0x%08lx", (long unsigned int)m_sub_ids.back());
+ m_sub_urls.push_back(url);
+ parameters.subidxIdxFileUrl = (char*)m_sub_urls.back().c_str();
+ CLog::Log(LOGDEBUG, "subtile file found, %s, creating ids source %s",
+ filenames[i].c_str(), parameters.subidxIdxFileUrl);
+
+ idsdata = new SIdsData;
+ idsdata->src = new CFileIDataSource(strSubFile.c_str());
+ m_sub_ids.push_back(idsdata);
+ url.Format("ids://0x%08lx", (long unsigned int)m_sub_ids.back());
+ m_sub_urls.push_back(url);
+ parameters.subidxSubFileUrl = (char*)m_sub_urls.back().c_str();
+ CLog::Log(LOGDEBUG, "subtile file found, %s, creating ids source %s",
+ filenames[i].c_str(), parameters.subidxSubFileUrl);
+ break;
+ }
+ }
+ }
+#endif
+
+ // open the media using the IAdvancedMediaProvider
+ res = m_amp->OpenMedia(m_amp, (char*)url.c_str(), &format, ¶meters);
+ if (res != DFB_OK)
+ {
+ CLog::Log(LOGDEBUG, "CSMPPlayer::OpenFile:OpenMedia() failed");
+ throw;
+ }
+
+ // create the playing thread
+ m_StopPlaying = false;
+ Create();
+ // spin the busy dialog until we are playing
+ m_ready.Reset();
+ if(!m_ready.WaitMSec(100))
+ {
+ CGUIDialogBusy *dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
+ dialog->Show();
+ while(!m_ready.WaitMSec(1))
+ g_windowManager.Process(false);
+ dialog->Close();
+ }
+
+ // Playback might have been stopped due to some error.
+ if (m_bStop || m_StopPlaying)
+ return false;
+
+ return true;
+ }
+ catch(...)
+ {
+ CLog::Log(LOGERROR, "%s - Exception thrown on open", __FUNCTION__);
+ return false;
+ }
+}
+
+bool CSMPPlayer::CloseFile()
+{
+ CLog::Log(LOGDEBUG, "CSMPPlayer::CloseFile");
+ m_StopPlaying = true;
+
+ CLog::Log(LOGDEBUG, "CSMPPlayer: waiting for threads to exit");
+ // wait for the main thread to finish up
+ // since this main thread cleans up all other resources and threads
+ // we are done after the StopThread call
+ StopThread();
+
+ if (m_amp)
+ m_amp->Release(m_amp);
+ m_amp = NULL;
+ // The event buffer must be released after the Release call
+ if (m_amp_event)
+ m_amp_event->Release(m_amp_event);
+ m_amp_event = NULL;
+
+ while (!m_sub_ids.empty())
+ m_sub_ids.pop_back();
+ while (!m_sub_urls.empty())
+ m_sub_urls.pop_back();
+
+ CLog::Log(LOGDEBUG, "CSMPPlayer: finished waiting");
+ g_renderManager.UnInit();
+
+ return true;
+}
+
+bool CSMPPlayer::IsPlaying() const
+{
+ return !m_bStop;
+}
+
+void CSMPPlayer::Pause()
+{
+ CSingleLock lock(m_amp_command_csection);
+
+ if (!m_amp && m_StopPlaying)
+ return;
+
+ SLPBCommand cmd;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ if (m_paused)
+ {
+ cmd.cmd = LPBCmd_PAUSE_OFF;
+ m_callback.OnPlayBackResumed();
+ }
+ else
+ {
+ cmd.cmd = LPBCmd_PAUSE_ON;
+ m_callback.OnPlayBackPaused();
+ }
+ m_paused = !m_paused;
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::Pause:AMP command failed!");
+ CLog::Log(LOGDEBUG, "CSMPPlayer::Pause");
+}
+
+bool CSMPPlayer::IsPaused() const
+{
+ return m_paused;
+}
+
+bool CSMPPlayer::HasVideo() const
+{
+ return m_video_count > 0;
+}
+
+bool CSMPPlayer::HasAudio() const
+{
+ return m_audio_count > 0;
+}
+
+void CSMPPlayer::ToggleFrameDrop()
+{
+ CLog::Log(LOGDEBUG, "CSMPPlayer::ToggleFrameDrop");
+}
+
+bool CSMPPlayer::CanSeek()
+{
+ return GetTotalTime() > 0;
+}
+
+void CSMPPlayer::Seek(bool bPlus, bool bLargeStep)
+{
+ CSingleLock lock(m_amp_command_csection);
+
+ // try chapter seeking first, chapter_index is ones based.
+ int chapter_index = GetChapter();
+ if (bLargeStep)
+ {
+ // seek to next chapter
+ if (bPlus && (chapter_index < GetChapterCount()))
+ {
+ SeekChapter(chapter_index + 1);
+ return;
+ }
+ // seek to previous chapter
+ if (!bPlus && chapter_index > 1)
+ {
+ SeekChapter(chapter_index - 1);
+ return;
+ }
+ }
+
+ // force updated to m_elapsed_ms, m_duration_ms.
+ GetTotalTime();
+
+ int64_t seek_ms;
+ if (g_advancedSettings.m_videoUseTimeSeeking)
+ {
+ if (bLargeStep && (GetTotalTime() > (2 * g_advancedSettings.m_videoTimeSeekForwardBig)))
+ seek_ms = bPlus ? g_advancedSettings.m_videoTimeSeekForwardBig : g_advancedSettings.m_videoTimeSeekBackwardBig;
+ else
+ seek_ms = bPlus ? g_advancedSettings.m_videoTimeSeekForward : g_advancedSettings.m_videoTimeSeekBackward;
+ // convert to milliseconds
+ seek_ms *= 1000;
+ seek_ms += m_elapsed_ms;
+ }
+ else
+ {
+ float percent;
+ if (bLargeStep)
+ percent = bPlus ? g_advancedSettings.m_videoPercentSeekForwardBig : g_advancedSettings.m_videoPercentSeekBackwardBig;
+ else
+ percent = bPlus ? g_advancedSettings.m_videoPercentSeekForward : g_advancedSettings.m_videoPercentSeekBackward;
+ percent /= 100.0f;
+ percent += (float)m_elapsed_ms/(float)m_duration_ms;
+ // convert to milliseconds
+ seek_ms = m_duration_ms * percent;
+ }
+
+ // handle stacked videos, dvdplayer does it so we do it too.
+ if (g_application.CurrentFileItem().IsStack() &&
+ (seek_ms > m_duration_ms || seek_ms < 0))
+ {
+ CLog::Log(LOGDEBUG, "CSMPPlayer::Seek: In mystery code, what did I do");
+ g_application.SeekTime((seek_ms - m_elapsed_ms) * 0.001 + g_application.GetTime());
+ // warning, don't access any object variables here as
+ // the object may have been destroyed
+ return;
+ }
+
+ // bugfix, dcchd takes forever to seek to 0 and play
+ // seek to 1 second and play is immediate.
+ if (seek_ms <= 0)
+ seek_ms = 1000;
+
+ if (seek_ms > m_duration_ms)
+ seek_ms = m_duration_ms;
+
+ SLPBCommand cmd;
+ cmd.cmd = LPBCmd_SEEK;
+ cmd.param1.seekMode = SM_BY_TIME;
+ cmd.param2.time.Hour = (seek_ms / 3600000);
+ cmd.param2.time.Minute = (seek_ms / 60000) % 60;
+ cmd.param2.time.Second = (seek_ms / 1000) % 60;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::Seek:to Hour(%lu), Minute(%lu), Second(%lu)",
+ // cmd.param2.time.Hour, cmd.param2.time.Minute, cmd.param2.time.Second);
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ // This will popup seek info dialog if skin supports it
+ //g_infoManager.SetDisplayAfterSeek(100000);
+ //m_callback.OnPlayBackSeek((int)seek_ms, (int)(seek_ms - m_elapsed_ms));
+
+ if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::SeekTime:AMP command failed!");
+
+ //g_infoManager.SetDisplayAfterSeek();
+}
+
+bool CSMPPlayer::SeekScene(bool bPlus)
+{
+ CLog::Log(LOGDEBUG, "CSMPPlayer::SeekScene");
+ return false;
+}
+
+void CSMPPlayer::SeekPercentage(float fPercent)
+{
+ CSingleLock lock(m_amp_command_csection);
+
+ SLPBCommand cmd;
+ cmd.cmd = LPBCmd_SEEK;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ cmd.param1.seekMode = SM_BY_PERCENTAGE;
+ cmd.param2.percentage = fPercent;
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::SeekTime:AMP command failed!");
+}
+
+float CSMPPlayer::GetPercentage()
+{
+ GetTotalTime();
+ if (m_duration_ms)
+ return 100.0f * (float)m_elapsed_ms/(float)m_duration_ms;
+ else
+ return 0.0f;
+}
+
+void CSMPPlayer::SetVolume(long nVolume)
+{
+ CSingleLock lock(m_amp_command_csection);
+ // nVolume is a milliBels from -6000 (-60dB or mute) to 0 (0dB or full volume)
+ // 0db is represented by Volume = 0x10000000
+ // bit shifts adjust by 6db.
+ // Maximum gain is 0xFFFFFFFF ~=24db
+ uint32_t volume = (1.0f + (nVolume / 6000.0f)) * (float)0x10000000;
+
+ SAdjustment adjustment;
+ // use ADJ_MIXER_VOLUME_MAIN and not ADJ_VOLUME as
+ // ADJ_VOLUME will cause a complete re-init of audio decoder.
+ adjustment.type = ADJ_MIXER_VOLUME_MAIN;
+ adjustment.value.volume = volume;
+
+ SLPBCommand cmd;
+ cmd.cmd = (ELPBCmd)Cmd_Adjust;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ cmd.control.adjustment = &adjustment;
+
+ if (m_amp->PostPresentationCmd(m_amp, (SCommand*)&cmd) != DFB_OK)
+ CLog::Log(LOGDEBUG, "CSMPPlayer::SetVolume:AMP command failed!");
+}
+
+void CSMPPlayer::GetAudioInfo(CStdString &strAudioInfo)
+{
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioInfo");
+ if (GetAmpStatus())
+ {
+ m_audio_info.Format("Audio stream (%d) [%s] of type %s",
+ ((UMSStatus*)m_status)->lpb.audio.index,
+ ((UMSStatus*)m_status)->lpb.audio.name,
+ mediaType2String(((UMSStatus*)m_status)->lpb.audio.format.mediaType));
+ }
+ strAudioInfo = m_audio_info;
+}
+
+void CSMPPlayer::GetVideoInfo(CStdString &strVideoInfo)
+{
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetVideoInfo");
+ if (GetAmpStatus())
+ {
+ m_video_info.Format("Video stream (%d) [%s] of type %s",
+ ((UMSStatus*)m_status)->lpb.video.index,
+ ((UMSStatus*)m_status)->lpb.video.name,
+ mediaType2String(((UMSStatus*)m_status)->lpb.video.format.mediaType));
+ }
+ strVideoInfo = m_video_info;
+}
+
+int CSMPPlayer::GetAudioStreamCount()
+{
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioStreamCount");
+ if (GetAmpStatus())
+ m_audio_count = ((UMSStatus*)m_status)->lpb.media.audio_streams;
+
+ return m_audio_count;
+}
+
+int CSMPPlayer::GetAudioStream()
+{
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioStream");
+ if (GetAmpStatus())
+ m_audio_index = ((UMSStatus*)m_status)->lpb.audio.index;
+
+ return m_audio_index;
+}
+
+void CSMPPlayer::GetAudioStreamName(int iStream, CStdString &strStreamName)
+{
+ CSingleLock lock(m_amp_command_csection);
+
+ SLPBCommand cmd;
+ cmd.cmd = LPBCmd_GET_AUDIO_STREAM_INFO;
+ cmd.param1.streamIndex = iStream;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) == DFB_OK)
+ strStreamName.Format("%s", res.value.streamInfo.name);
+ else
+ strStreamName.Format("Undefined");
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioStreamName");
+}
+
+void CSMPPlayer::SetAudioStream(int SetAudioStream)
+{
+ CSingleLock lock(m_amp_command_csection);
+
+ SLPBCommand cmd;
+ cmd.cmd = LPBCmd_SELECT_AUDIO_STREAM;
+ cmd.param1.streamIndex = SetAudioStream;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res);
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::SetAudioStream");
+}
+
+void CSMPPlayer::SetSubTitleDelay(float fValue = 0.0f)
+{
+ if (GetSubtitleCount())
+ {
+ CSingleLock lock(m_amp_command_csection);
+
+ m_subtitle_params->setDelay = true;
+ m_subtitle_params->delay_ms = (int)fValue;
+ if (m_subtitle_params->setSUBFrameRate)
+ {
+ m_subtitle_params->subFramerateNumerator = m_video_fps_numerator;
+ m_subtitle_params->subFramerateDenominator = m_video_fps_denominator;
+ }
+
+ /*
+ TODO: find where these are get/set
+ bool setFontSize;
+ unsigned fontSize = g_guiSettings.GetInt("subtitles.height");
+
+ bool setPosY;
+ int posY;
+
+ bool setFillColor;
+ fillColor = g_guiSettings.GetInt("subtitles.color");
+ unsigned fillAlpha;
+
+ bool setBorderColor;
+ unsigned borderColor;
+ unsigned borderAlpha;
+
+ bool setEncoding;
+ enum ELPBCmd_SubsParameters_Encoding encoding;
+ */
+
+ SLPBCommand cmd;
+ cmd.cmd = LPBCmd_SET_SUBS_PARAMETERS;
+ cmd.param1.subsParams = *m_subtitle_params;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res);
+ }
+}
+
+float CSMPPlayer::GetSubTitleDelay()
+{
+ return (float)m_subtitle_params->delay_ms;
+}
+
+int CSMPPlayer::GetSubtitleCount()
+{
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetSubtitleCount");
+ if (GetAmpStatus())
+ m_subtitle_count = ((UMSStatus*)m_status)->lpb.media.subtitle_streams;
+
+ return m_subtitle_count;
+}
+
+int CSMPPlayer::GetSubtitle()
+{
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetSubtitle");
+ if (GetAmpStatus())
+ m_subtitle_index = ((UMSStatus*)m_status)->lpb.subtitle.index;
+
+ return m_subtitle_index;
+}
+
+void CSMPPlayer::GetSubtitleName(int iStream, CStdString &strStreamName)
+{
+ CSingleLock lock(m_amp_command_csection);
+
+ SLPBCommand cmd;
+ cmd.cmd = LPBCmd_GET_SUBTITLE_STREAM_INFO;
+ cmd.param1.streamIndex = iStream;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) == DFB_OK)
+ strStreamName.Format("%s", res.value.streamInfo.name);
+ else
+ strStreamName.Format("Undefined");
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetSubtitleName");
+}
+
+void CSMPPlayer::SetSubtitle(int iStream)
+{
+ CSingleLock lock(m_amp_command_csection);
+
+ SLPBCommand cmd;
+ cmd.cmd = LPBCmd_SELECT_SUBTITLE_STREAM;
+ cmd.param1.streamIndex = iStream;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res);
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::SetSubtitle");
+}
+
+bool CSMPPlayer::GetSubtitleVisible()
+{
+ return m_subtitle_show;
+}
+
+void CSMPPlayer::SetSubtitleVisible(bool bVisible)
+{
+ CSingleLock lock(m_amp_command_csection);
+
+ m_subtitle_show = bVisible;
+ g_settings.m_currentVideoSettings.m_SubtitleOn = bVisible;
+
+ SLPBCommand cmd;
+ cmd.cmd = LPBCmd_SELECT_SUBTITLE_STREAM;
+ if (bVisible)
+ cmd.param1.streamIndex = GetSubtitle();
+ else
+ cmd.param1.streamIndex = -1;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res);
+}
+
+int CSMPPlayer::AddSubtitle(const CStdString& strSubPath)
+{
+ // this waits until we can stop/restart amp stream.
+ return -1;
+}
+
+void CSMPPlayer::Update(bool bPauseDrawing)
+{
+ g_renderManager.Update(bPauseDrawing);
+}
+
+void CSMPPlayer::GetVideoRect(CRect& SrcRect, CRect& DestRect)
+{
+ g_renderManager.GetVideoRect(SrcRect, DestRect);
+}
+
+void CSMPPlayer::GetVideoAspectRatio(float &fAR)
+{
+ fAR = g_renderManager.GetAspectRatio();
+}
+
+int CSMPPlayer::GetChapterCount()
+{
+ return m_chapter_count;
+}
+
+int CSMPPlayer::GetChapter()
+{
+ // returns a one based value.
+ int chapter_index = m_chapter_index + 1;
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetChapter:chapter_index(%d)", chapter_index);
+ return chapter_index;
+}
+
+void CSMPPlayer::GetChapterName(CStdString& strChapterName)
+{
+ if (m_chapter_count)
+ strChapterName = m_chapters[m_chapter_index].name;
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetChapterName:strChapterName(%s)", strChapterName.c_str());
+}
+
+int CSMPPlayer::SeekChapter(int chapter_index)
+{
+ CSingleLock lock(m_amp_command_csection);
+
+ GetAmpStatus();
+ // chapter_index is a one based value.
+ int chapter_count = GetChapterCount();
+ if (chapter_count > 0)
+ {
+ if (chapter_index < 1)
+ chapter_index = 1;
+ if (chapter_index > chapter_count)
+ chapter_index = chapter_count;
+
+ // amp time units are seconds,
+ // so we add 1000ms to get into the chapter.
+ int64_t seek_ms = m_chapters[chapter_index - 1].seekto_ms + 1000;
+
+ // bugfix: dcchd takes forever to seek to 0 and play
+ // seek to 1 second and play is immediate.
+ if (seek_ms <= 0)
+ seek_ms = 1000;
+
+ SLPBCommand cmd;
+ cmd.cmd = LPBCmd_SEEK;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ cmd.param1.seekMode = SM_BY_TIME;
+ cmd.param2.time.Hour = (seek_ms / 3600000);
+ cmd.param2.time.Minute = (seek_ms / 60000) % 60;
+ cmd.param2.time.Second = (seek_ms / 1000) % 60;
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::SeekChapter:to Hour(%lu), Minute(%lu), Second(%lu)",
+ // cmd.param2.time.Hour, cmd.param2.time.Minute, cmd.param2.time.Second);
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ // This will popup seek info dialog if skin supports it.
+ //g_infoManager.SetDisplayAfterSeek(100000);
+ //m_callback.OnPlayBackSeekChapter(GetChapter());
+
+ if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::SeekChapter:ExecutePresentationCmd failed!");
+
+ if (IS_SUCCESS( ((SResult*)&res)->value ))
+ {
+ for (int timeout = 10; timeout > 0; timeout--)
+ {
+ Sleep(100);
+ // wait until this chapter starts playing
+ GetAmpStatus();
+ if (chapter_index == GetChapter())
+ break;
+ }
+ }
+ else
+ {
+ CLog::Log(LOGDEBUG, "CSMPPlayer::SeekChapter:LPBCmd_SEEK failed");
+ }
+ //g_infoManager.SetDisplayAfterSeek();
+ }
+ else
+ {
+ // we do not have a chapter list so do a regular big jump.
+ if (chapter_index > GetChapter())
+ Seek(true, true);
+ else
+ Seek(false, true);
+ }
+ return 0;
+}
+
+float CSMPPlayer::GetActualFPS()
+{
+ float video_fps = m_video_fps_numerator / m_video_fps_denominator;
+ if (GetAmpStatus())
+ {
+ // display field rate, in rateM/rateN fields per second
+ float rateN = ((UMSStatus*)m_status)->lpb.video.format.format.image.rateN;
+ if (rateN > 0.0)
+ {
+ m_video_fps_numerator = ((UMSStatus*)m_status)->lpb.video.format.format.image.rateM;
+ m_video_fps_denominator = rateN;
+ video_fps = m_video_fps_numerator / m_video_fps_denominator;
+ }
+ }
+ CLog::Log(LOGDEBUG, "CSMPPlayer::GetActualFPS:m_video_fps(%f)", video_fps);
+ return video_fps;
+}
+
+void CSMPPlayer::SeekTime(__int64 seek_ms)
+{
+ CSingleLock lock(m_amp_command_csection);
+ // bugfix, dcchd takes forever to seek to 0 and play
+ // seek to 1 second and play is immediate.
+ if (seek_ms <= 0)
+ seek_ms = 1000;
+
+ // iTime units are milliseconds.
+ SLPBCommand cmd;
+ cmd.cmd = LPBCmd_SEEK;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ cmd.param1.seekMode = SM_BY_TIME;
+ cmd.param2.time.Hour = (seek_ms / 3600000);
+ cmd.param2.time.Minute = (seek_ms / 60000) % 60;
+ cmd.param2.time.Second = (seek_ms / 1000) % 60;
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::SeekTime:to Hour(%lu), Minute(%lu), Second(%lu)",
+ // cmd.param2.time.Hour, cmd.param2.time.Minute, cmd.param2.time.Second);
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ // This will popup seek info dialog if skin supports it.
+ //g_infoManager.SetDisplayAfterSeek(100000);
+ //m_callback.OnPlayBackSeek((int)seek_ms, (int)(seek_ms - GetTime()));
+
+ if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::SeekTime:AMP command failed!");
+
+ //g_infoManager.SetDisplayAfterSeek();
+}
+
+__int64 CSMPPlayer::GetTime()
+{
+ return m_elapsed_ms;
+}
+
+int CSMPPlayer::GetTotalTime()
+{
+ if (GetAmpStatus())
+ m_duration_ms = 1000 * ((UMSStatus*)m_status)->lpb.media.duration;
+ return m_duration_ms / 1000;
+}
+
+int CSMPPlayer::GetAudioBitrate()
+{
+ CLog::Log(LOGDEBUG, "CSMPPlayer::GetAudioBitrate");
+ return 0;
+}
+int CSMPPlayer::GetVideoBitrate()
+{
+ CLog::Log(LOGDEBUG, "CSMPPlayer::GetVideoBitrate");
+ return 0;
+}
+
+int CSMPPlayer::GetSourceBitrate()
+{
+ CLog::Log(LOGDEBUG, "CSMPPlayer::GetSourceBitrate");
+ return 0;
+}
+
+int CSMPPlayer::GetChannels()
+{
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetActualFPS");
+ // returns number of audio channels (ie 5.1 = 6)
+ if (GetAmpStatus())
+ {
+ m_audio_channels = ((UMSStatus*)m_status)->lpb.audio.format.format.sound.channels;
+ m_audio_channels += ((UMSStatus*)m_status)->lpb.audio.format.format.sound.lfe;
+ }
+
+ return m_audio_channels;
+}
+
+int CSMPPlayer::GetBitsPerSample()
+{
+ CLog::Log(LOGDEBUG, "CSMPPlayer::GetBitsPerSample");
+ return 0;
+}
+
+int CSMPPlayer::GetSampleRate()
+{
+ CLog::Log(LOGDEBUG, "CSMPPlayer::GetSampleRate");
+ return 0;
+}
+
+CStdString CSMPPlayer::GetAudioCodecName()
+{
+ CStdString strAudioCodec;
+ if (GetAmpStatus())
+ strAudioCodec = mediaTypeToCodecName(((UMSStatus*)m_status)->lpb.audio.format.mediaType);
+ return strAudioCodec;
+}
+
+CStdString CSMPPlayer::GetVideoCodecName()
+{
+ CStdString strVideoCodec;
+ if (GetAmpStatus())
+ strVideoCodec = mediaTypeToCodecName(((UMSStatus*)m_status)->lpb.audio.format.mediaType);
+ return strVideoCodec;
+}
+
+int CSMPPlayer::GetPictureWidth()
+{
+ if (GetAmpStatus())
+ m_video_width = ((UMSStatus*)m_status)->lpb.video.format.format.image.width;
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetPictureWidth(%d)", m_video_width);
+ return m_video_width;
+}
+
+int CSMPPlayer::GetPictureHeight()
+{
+ if (GetAmpStatus())
+ m_video_height= ((UMSStatus*)m_status)->lpb.video.format.format.image.height;
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetPictureHeight(%)", m_video_height);
+ return m_video_height;
+}
+
+bool CSMPPlayer::GetStreamDetails(CStreamDetails &details)
+{
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetStreamDetails");
+ return false;
+}
+
+void CSMPPlayer::ToFFRW(int iSpeed)
+{
+ CSingleLock lock(m_amp_command_csection);
+
+ if (!m_amp && m_StopPlaying)
+ return;
+
+ if (m_speed != iSpeed)
+ {
+ SLPBCommand cmd;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ // recover power of two value
+ int ipower = 0;
+ int ispeed = abs(iSpeed);
+ while (ispeed >>= 1) ipower++;
+
+ switch(ipower)
+ {
+ // regular playback
+ case 0:
+ cmd.cmd = LPBCmd_PLAY;
+ cmd.param2.speed = 1 * 1024;
+ break;
+ default:
+ // N x fast forward/rewind (I-frames)
+ if (iSpeed > 0)
+ cmd.cmd = LPBCmd_FAST_FORWARD;
+ else
+ cmd.cmd = LPBCmd_SCAN_BACKWARD;
+ cmd.param2.speed = ipower * 1024;
+ break;
+ }
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::ToFFRW:AMP command failed!");
+
+ m_speed = iSpeed;
+ }
+}
+
+void CSMPPlayer::OnStartup()
+{
+ //CThread::SetName("CSMPPlayer");
+ g_renderManager.PreInit();
+}
+
+void CSMPPlayer::OnExit()
+{
+ //CLog::Log(LOGNOTICE, "CSMPPlayer::OnExit()");
+ Sleep(100);
+ m_bStop = true;
+ // if we didn't stop playing, advance to the next item in xbmc's playlist
+ if(m_options.identify == false)
+ {
+ if (m_StopPlaying)
+ m_callback.OnPlayBackStopped();
+ else
+ m_callback.OnPlayBackEnded();
+ }
+}
+
+void CSMPPlayer::Process()
+{
+ try
+ {
+ // wait for media to open with 20 second timeout.
+ if (WaitForAmpOpenMedia(20000))
+ {
+ DFBResult res;
+ // start the playback.
+ res = m_amp->StartPresentation(m_amp, DFB_TRUE);
+ if (res != DFB_OK)
+ {
+ CLog::Log(LOGDEBUG,"CSMPPlayer::Process:StartPresentation() failed");
+ throw;
+ }
+ }
+ else
+ {
+ CLog::Log(LOGDEBUG, "CSMPPlayer::Process:WaitForAmpOpenMedia timeout");
+ throw;
+ }
+
+ // wait for playback to start with 2 second timeout
+ if (WaitForAmpPlaying(2000))
+ {
+ m_speed = 1;
+ m_callback.OnPlayBackSpeedChanged(m_speed);
+
+ // get our initial status.
+ GetAmpStatus();
+
+ // restore system volume setting.
+ SetVolume(g_settings.m_nVolumeLevel);
+
+ // starttime has units of seconds
+ if (m_options.starttime > 0)
+ {
+ // BUGFIX: if we try to seek before amp renders 1st frame,
+ // bad things happen.
+ Sleep(100);
+ SeekTime(m_options.starttime * 1000);
+ WaitForAmpPlaying(1000);
+ }
+
+ // wait until video.format.formatValid or audio.format.formatValid
+ WaitForAmpFormatValid(2000);
+
+ // drop CGUIDialogBusy dialog and release the hold in OpenFile.
+ // sleep a bit to let main thread run and do it's thing.
+ m_ready.Set();
+ Sleep(100);
+
+ // we are playing but hidden and all stream fields are valid.
+ // check for video in media content
+ if (GetVideoStreamCount() > 0)
+ {
+ // hide the gui layer so we can get stream info first
+ // without having video playback blended into it.
+ g_Windowing.Hide();
+
+ // turn on/off subs
+ SetSubtitleVisible(g_settings.m_currentVideoSettings.m_SubtitleOn);
+ SetSubTitleDelay(g_settings.m_currentVideoSettings.m_SubtitleDelay);
+
+ // big fake out here, we do not know the video width, height yet
+ // so setup renderer to full display size and tell it we are doing
+ // bypass. This tell it to get out of the way as amp will be doing
+ // the actual video rendering in a video plane that is under the GUI
+ // layer.
+ int width = g_graphicsContext.GetWidth();
+ int height= g_graphicsContext.GetHeight();
+ int displayWidth = width;
+ int displayHeight = height;
+ double fFrameRate = 24;
+ unsigned int flags = 0;
+
+ flags |= CONF_FLAGS_FORMAT_BYPASS;
+ flags |= CONF_FLAGS_FULLSCREEN;
+ CStdString formatstr = "BYPASS";
+ CLog::Log(LOGDEBUG,"%s - change configuration. %dx%d. framerate: %4.2f. format: %s",
+ __FUNCTION__, GetPictureWidth(), GetPictureHeight(), fFrameRate, formatstr.c_str());
+ g_renderManager.IsConfigured();
+ if(!g_renderManager.Configure(width, height, displayWidth, displayHeight, fFrameRate, flags, 0))
+ {
+ CLog::Log(LOGERROR, "%s - failed to configure renderer", __FUNCTION__);
+ }
+ if (!g_renderManager.IsStarted())
+ {
+ CLog::Log(LOGERROR, "%s - renderer not started", __FUNCTION__);
+ }
+ }
+
+ if (m_options.identify == false)
+ m_callback.OnPlayBackStarted();
+
+ if (GetVideoStreamCount() > 0)
+ {
+ WaitForWindowFullScreenVideo(4000);
+ // show gui layer again.
+ g_Windowing.Show();
+ }
+
+ while (!m_bStop && !m_StopPlaying)
+ {
+ // AMP monitoring loop for automatic playback termination (250ms wait)
+ if (m_amp_event->WaitForEventWithTimeout(m_amp_event, 0, 250) == DFB_OK)
+ {
+ // eat the event
+ DFBEvent event;
+ m_amp_event->GetEvent(m_amp_event, &event);
+
+ if (GetAmpStatus() && (((UMSStatus*)m_status)->generic.flags & SSTATUS_MODE) &&
+ (((UMSStatus*)m_status)->generic.mode.flags & SSTATUS_MODE_STOPPED))
+ {
+ break;
+ }
+ }
+ else
+ {
+ // we should never get here but just in case.
+ Sleep(250);
+ }
+ }
+
+ // have to stop if playing before CloseMedia or bad things happen.
+ if ((((UMSStatus*)m_status)->generic.mode.flags & SSTATUS_MODE_STOPPED) != SSTATUS_MODE_STOPPED)
+ {
+ SLPBCommand cmd;
+ cmd.dataSize = sizeof(cmd);
+ cmd.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+
+ cmd.cmd = LPBCmd_STOP;
+
+ SLPBResult res;
+ res.dataSize = sizeof(res);
+ res.mediaSpace = MEDIA_SPACE_LINEAR_MEDIA;
+ if (m_amp->ExecutePresentationCmd(m_amp, (SCommand*)&cmd, (SResult*)&res) != DFB_OK)
+ CLog::Log(LOGERROR, "CSMPPlayer::Process:AMP stop command failed!");
+ if (!IS_SUCCESS( ((SResult*)&res)->value ))
+ {
+ CLog::Log(LOGERROR, "CSMPPlayer::Process:AMP stop SResult(%d)", ((SResult*)&res)->value);
+ }
+ }
+ }
+ else
+ {
+ m_ready.Set();
+ CLog::Log(LOGERROR, "CSMPPlayer::Process: WaitForAmpPlaying() failed, m_status.flags(0x%08lx), m_status.mode.flags(0x%08lx)",
+ (long unsigned int)((UMSStatus*)m_status)->generic.flags,
+ (long unsigned int)((UMSStatus*)m_status)->generic.mode.flags);
+ }
+
+ }
+ catch(...)
+ {
+ CLog::Log(LOGERROR, "CSMPPlayer::Process Exception thrown");
+ }
+
+ if (m_amp)
+ m_amp->CloseMedia(m_amp);
+}
+
+int CSMPPlayer::GetVideoStreamCount()
+{
+ if (GetAmpStatus())
+ m_video_count = ((UMSStatus*)m_status)->lpb.media.video_streams;
+ //CLog::Log(LOGDEBUG, "CSMPPlayer::GetVideoStreamCount(%d)", m_video_count);
+ return m_video_count;
+}
+
+bool CSMPPlayer::WaitForAmpStopped(int timeout_ms)
+{
+ bool rtn = false;
+
+ while (!m_bStop && (timeout_ms > 0))
+ {
+ if (m_amp_event->WaitForEventWithTimeout(m_amp_event, 0, 100) == DFB_OK)
+ {
+ // eat the event
+ DFBEvent event;
+ m_amp_event->GetEvent(m_amp_event, &event);
+
+ if (GetAmpStatus())
+ {
+ if ((((UMSStatus*)m_status)->generic.flags & SSTATUS_MODE) &&
+ (((UMSStatus*)m_status)->generic.mode.flags & SSTATUS_MODE_STOPPED))
+ {
+ rtn = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ // we should never get here but just in case.
+ Sleep(100);
+ }
+ timeout_ms -= 100;
+ }
+
+ return rtn;
+}
+
+bool CSMPPlayer::WaitForAmpPlaying(int timeout_ms)
+{
+ bool rtn = false;
+
+ while (!m_bStop && (timeout_ms > 0))
+ {
+ if (m_amp_event->WaitForEventWithTimeout(m_amp_event, 0, 100) == DFB_OK)
+ {
+ // eat the event
+ DFBEvent event;
+ m_amp_event->GetEvent(m_amp_event, &event);
+
+ if (GetAmpStatus())
+ {
+ if ((((UMSStatus*)m_status)->generic.flags & SSTATUS_MODE) &&
+ (((UMSStatus*)m_status)->generic.mode.flags & SSTATUS_MODE_PLAYING))
+ {
+ rtn = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ // we should never get here but just in case.
+ Sleep(100);
+ }
+ timeout_ms -= 100;
+ }
+
+ return rtn;
+}
+
+bool CSMPPlayer::WaitForAmpOpenMedia(int timeout_ms)
+{
+ bool rtn = false;
+
+ while (!m_bStop && (timeout_ms > 0))
+ {
+ if (m_amp_event->WaitForEventWithTimeout(m_amp_event, 0, 100) == DFB_OK)
+ {
+ // eat the event
+ DFBEvent event;
+ m_amp_event->GetEvent(m_amp_event, &event);
+
+ if (GetAmpStatus())
+ {
+ if (!IS_ERROR(((UMSStatus*)m_status)->generic.lastCmd.result))
+ {
+ rtn = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ Sleep(100);
+ }
+ timeout_ms -= 100;
+ }
+
+ return rtn;
+}
+
+bool CSMPPlayer::WaitForAmpFormatValid(int timeout_ms)
+{
+ bool rtn = false;
+
+ while (!m_bStop && (timeout_ms > 0))
+ {
+ Sleep(100);
+ if (GetAmpStatus())
+ {
+ if (((UMSStatus*)m_status)->lpb.video.format.formatValid ||
+ ((UMSStatus*)m_status)->lpb.audio.format.formatValid)
+ {
+ rtn = true;
+ break;
+ }
+ }
+ timeout_ms -= 100;
+ }
+
+ return rtn;
+}
+
+bool CSMPPlayer::WaitForWindowFullScreenVideo(int timeout_ms)
+{
+ bool rtn = false;
+
+ double present_time;
+ // we do a two step check.
+ // 1st, wait for switch to fullscreen video rendering in gui
+ while (!m_bStop && (timeout_ms > 0))
+ {
+ if (g_graphicsContext.IsFullScreenVideo() && g_renderManager.IsStarted())
+ break;
+
+ timeout_ms -= 100;
+ Sleep(100);
+ }
+ // 2nd, wait for renderer to flip at least once.
+ present_time = g_renderManager.GetPresentTime();
+ while (!m_bStop && (timeout_ms > 0))
+ {
+ if (present_time < g_renderManager.GetPresentTime())
+ {
+ rtn = true;
+ break;
+ }
+ timeout_ms -= 100;
+ Sleep(100);
+ }
+ // BUGFIX: why don't we know when gui has truly transitioned?
+ // sleep another second to be sure.
+ Sleep(1000);
+
+ return rtn;
+}
+
+bool CSMPPlayer::GetAmpStatus()
+{
+ static uint32_t flags = 0;
+ CSingleLock lock(m_amp_status_csection);
+
+ // get status, only update what has changed (DFB_FALSE).
+ if (m_amp->UploadStatusChanges(m_amp, (SStatus*)m_status, DFB_FALSE) == DFB_OK)
+ {
+ int elapsed_ms = 1000 * ((UMSStatus*)m_status)->generic.elapsedTime;
+ int chapter_count = 0;
+#if defined(SLPBSTATUS_CHAPTER_LIST_SIZE)
+ chapter_count = ((UMSStatus*)m_status)->lpb.media.nb_chapters;
+#endif
+ if ((elapsed_ms != m_elapsed_ms) || (chapter_count != m_chapter_count))
+ {
+#if defined(SLPBSTATUS_CHAPTER_LIST_SIZE)
+ if (m_chapter_count != chapter_count)
+ {
+ // update avi/mkv chapters.
+ for (int i = 0; i < chapter_count; i++)
+ {
+ m_chapters[i].name = ((UMSStatus*)m_status)->lpb.media.chapterList[i].pName;
+ m_chapters[i].seekto_ms = ((UMSStatus*)m_status)->lpb.media.chapterList[i].time_ms;
+ }
+ // update internal AFTER we update names/seekto_ms.
+ m_chapter_count = chapter_count;
+ }
+#endif
+
+ int chapter_index = 0;
+ // check for a chapter list and figure out which chapter we are in.
+ // chapter_index is zero based here.
+ for (int chapter_num = m_chapter_count; chapter_num > 0; chapter_num--)
+ {
+ chapter_index = chapter_num - 1;
+ // potential problem here, elapsedTime is seconds so
+ // it might take one second+ for us to see any chapter seeks.
+ if ((elapsed_ms/1000) >= (m_chapters[chapter_index].seekto_ms/1000))
+ break;
+ }
+ m_elapsed_ms = elapsed_ms;
+ m_chapter_index = chapter_index;
+ }
+
+ m_video_index = ((UMSStatus*)m_status)->lpb.video.index;
+ m_video_count = ((UMSStatus*)m_status)->lpb.media.video_streams;
+
+ m_audio_index = ((UMSStatus*)m_status)->lpb.audio.index;
+ m_audio_count = ((UMSStatus*)m_status)->lpb.media.audio_streams;
+
+ if (flags != ((UMSStatus*)m_status)->generic.mode.flags)
+ {
+ CLog::Log(LOGDEBUG, "CSMPPlayer::GetAmpStatus: flags changed, old(%d), new(%d)",
+ flags, ((UMSStatus*)m_status)->generic.mode.flags);
+ flags = ((UMSStatus*)m_status)->generic.mode.flags;
+ }
+
+
+ return true;
+ }
+ else
+ {
+ CLog::Log(LOGDEBUG, "CSMPPlayer::GetAmpStatus:UploadStatusChanges return is not DFB_OK");
+ return false;
+ }
+}
+
+#endif
diff --git a/xbmc/cores/smpplayer/SMPPlayer.h b/xbmc/cores/smpplayer/SMPPlayer.h
new file mode 100644
index 0000000..a096f1a
--- /dev/null
+++ b/xbmc/cores/smpplayer/SMPPlayer.h
@@ -0,0 +1,199 @@
+#pragma once
+/*
+ * Copyright (C) 2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "FileItem.h"
+#include "cores/IPlayer.h"
+#include "dialogs/GUIDialogBusy.h"
+#include "threads/Thread.h"
+
+typedef struct SIdsData SIdsData;
+typedef struct SLPBCmd_SubsParameters SLPBCmd_SubsParameters;
+typedef struct _IDirectFBEventBuffer IDirectFBEventBuffer;
+typedef struct _IAdvancedMediaProvider IAdvancedMediaProvider;
+
+class CSMPPlayer : public IPlayer, public CThread
+{
+public:
+
+ CSMPPlayer(IPlayerCallback &callback);
+ virtual ~CSMPPlayer();
+
+ virtual void RegisterAudioCallback(IAudioCallback* pCallback) {}
+ virtual void UnRegisterAudioCallback() {}
+ virtual bool OpenFile(const CFileItem &file, const CPlayerOptions &options);
+ virtual bool QueueNextFile(const CFileItem &file) {return false;}
+ virtual void OnNothingToQueueNotify() {}
+ virtual bool CloseFile();
+ virtual bool IsPlaying() const;
+ virtual void Pause();
+ virtual bool IsPaused() const;
+ virtual bool HasVideo() const;
+ virtual bool HasAudio() const;
+ virtual void ToggleFrameDrop();
+ virtual bool CanSeek();
+ virtual void Seek(bool bPlus = true, bool bLargeStep = false);
+ virtual bool SeekScene(bool bPlus = true);
+ virtual void SeekPercentage(float fPercent = 0.0f);
+ virtual float GetPercentage();
+ virtual void SetVolume(long nVolume);
+ virtual void SetDynamicRangeCompression(long drc) {}
+ virtual void GetAudioInfo(CStdString &strAudioInfo);
+ virtual void GetVideoInfo(CStdString &strVideoInfo);
+ virtual void GetGeneralInfo(CStdString &strVideoInfo) {};
+ virtual void Update(bool bPauseDrawing);
+ virtual void GetVideoRect(CRect& SrcRect, CRect& DestRect);
+ virtual void GetVideoAspectRatio(float &fAR);
+ virtual bool CanRecord() {return false;};
+ virtual bool IsRecording() {return false;};
+ virtual bool Record(bool bOnOff) {return false;};
+
+ virtual void SetAVDelay(float fValue = 0.0f) {return;}
+ virtual float GetAVDelay() {return 0.0f;};
+
+ virtual void SetSubTitleDelay(float fValue);
+ virtual float GetSubTitleDelay();
+ virtual int GetSubtitleCount();
+ virtual int GetSubtitle();
+ virtual void GetSubtitleName(int iStream, CStdString &strStreamName);
+ virtual void SetSubtitle(int iStream);
+ virtual bool GetSubtitleVisible();
+ virtual void SetSubtitleVisible(bool bVisible);
+ virtual bool GetSubtitleExtension(CStdString &strSubtitleExtension) { return false; }
+ virtual int AddSubtitle(const CStdString& strSubPath);
+
+ virtual int GetAudioStreamCount();
+ virtual int GetAudioStream();
+ virtual void GetAudioStreamName(int iStream, CStdString &strStreamName);
+ virtual void SetAudioStream(int iStream);
+ virtual void GetAudioStreamLanguage(int iStream, CStdString &strLanguage) {};
+
+ virtual TextCacheStruct_t* GetTeletextCache() {return NULL;};
+ virtual void LoadPage(int p, int sp, unsigned char* buffer) {};
+
+ virtual int GetChapterCount();
+ virtual int GetChapter();
+ virtual void GetChapterName(CStdString& strChapterName);
+ virtual int SeekChapter(int iChapter);
+
+ virtual float GetActualFPS();
+ virtual void SeekTime(__int64 iTime = 0);
+ virtual __int64 GetTime();
+ virtual int GetTotalTime();
+ virtual int GetAudioBitrate();
+ virtual int GetVideoBitrate();
+ virtual int GetSourceBitrate();
+ virtual int GetChannels();
+ virtual int GetBitsPerSample();
+ virtual int GetSampleRate();
+ virtual CStdString GetAudioCodecName();
+ virtual CStdString GetVideoCodecName();
+ virtual int GetPictureWidth();
+ virtual int GetPictureHeight();
+ virtual bool GetStreamDetails(CStreamDetails &details);
+ virtual void ToFFRW(int iSpeed = 0);
+ // Skip to next track/item inside the current media (if supported).
+ virtual bool SkipNext() {return false;}
+
+ //Returns true if not playback (paused or stopped beeing filled)
+ virtual bool IsCaching() const {return false;};
+ //Cache filled in Percent
+ virtual int GetCacheLevel() const {return -1;};
+
+ virtual bool IsInMenu() const {return false;};
+ virtual bool HasMenu() {return false;};
+
+ virtual void DoAudioWork() {};
+ virtual bool OnAction(const CAction &action) {return false;};
+
+ virtual bool GetCurrentSubtitle(CStdString& strSubtitle) {strSubtitle = ""; return false;}
+ //returns a state that is needed for resuming from a specific time
+ virtual CStdString GetPlayerState() {return "";};
+ virtual bool SetPlayerState(CStdString state) {return false;};
+
+ virtual CStdString GetPlayingTitle() {return "";};
+
+protected:
+ virtual void OnStartup();
+ virtual void OnExit();
+ virtual void Process();
+
+private:
+ int GetVideoStreamCount();
+ bool WaitForAmpStopped(int timeout_ms);
+ bool WaitForAmpPlaying(int timeout_ms);
+ bool WaitForAmpOpenMedia(int timeout_ms);
+ bool WaitForAmpFormatValid(int timeout_ms);
+ bool WaitForWindowFullScreenVideo(int timeout_ms);
+ bool GetAmpStatus();
+
+ int m_speed;
+ bool m_paused;
+ bool m_StopPlaying;
+ CEvent m_ready;
+ CFileItem m_item;
+ CPlayerOptions m_options;
+ CCriticalSection m_amp_command_csection;
+
+ IAdvancedMediaProvider *m_amp;
+ IDirectFBEventBuffer *m_amp_event;
+ int m_ampID;
+ CCriticalSection m_amp_status_csection;
+
+ int64_t m_elapsed_ms;
+ int64_t m_duration_ms;
+
+ int m_audio_index;
+ int m_audio_count;
+ CStdString m_audio_info;
+ int m_audio_delay;
+ uint32_t m_audio_channels;
+
+ int m_video_index;
+ int m_video_count;
+ CStdString m_video_info;
+ int m_video_width;
+ int m_video_height;
+ float m_video_fps_numerator;
+ float m_video_fps_denominator;
+
+ int m_subtitle_index;
+ int m_subtitle_count;
+ bool m_subtitle_show;
+ int m_subtitle_delay;
+ SLPBCmd_SubsParameters *m_subtitle_params;
+
+ int m_chapter_index;
+ int m_chapter_count;
+ struct chapters
+ {
+ std::string name;
+ int64_t seekto_ms;
+ } m_chapters[64];
+
+ // opaque smp global status
+ void* m_status;
+
+ std::vector<SIdsData*> m_sub_ids;
+ std::vector<CStdString> m_sub_urls;
+
+
+};
diff --git a/xbmc/system.h b/xbmc/system.h
index 0c63414..eeafbb9 100644
--- a/xbmc/system.h
+++ b/xbmc/system.h
@@ -239,6 +239,7 @@
#if defined(HAVE_DIRECTFB)
#define HAS_DIRECTFB
#define SUPPORT_DIRECTFB_WS
+#define HAS_SIGMASMP
#endif
#endif
https://github.com/xbmc/xbmc/commit/edcce75ff7d1388af1d58061e2310f86fb9a67e2
commit edcce75ff7d1388af1d58061e2310f86fb9a67e2
Author: theuni <theuni-nospam-@...>
Date: Thu Oct 13 15:27:04 2011 -0400
[smp] hook up hardware jpeg decode
diff --git a/xbmc/guilib/Texture.cpp b/xbmc/guilib/Texture.cpp
index 7c886b1..914bd72 100644
--- a/xbmc/guilib/Texture.cpp
+++ b/xbmc/guilib/Texture.cpp
@@ -32,6 +32,16 @@
#include "filesystem/File.h"
#include "osx/DarwinUtils.h"
#endif
+#if defined(HAS_DIRECTFB)
+#include "filesystem/File.h"
+#include "threads/SingleLock.h"
+#include "threads/CriticalSection.h"
+#include <directfb.h>
+
+// we need this to serialize access to hw image decoder.
+static CCriticalSection gHWLoaderSection;
+#endif
+
/************************************************************************/
/* */
@@ -42,6 +52,9 @@ CBaseTexture::CBaseTexture(unsigned int width, unsigned int height, unsigned int
#ifndef HAS_DX
m_texture = 0;
#endif
+#if defined(HAS_DIRECTFB)
+ m_dfbSurface = NULL;
+#endif
m_pixels = NULL;
m_loadedToGPU = false;
Allocate(width, height, format);
@@ -49,6 +62,14 @@ CBaseTexture::CBaseTexture(unsigned int width, unsigned int height, unsigned int
CBaseTexture::~CBaseTexture()
{
+#if defined(HAS_DIRECTFB)
+ if (m_dfbSurface && (m_format & XB_FMT_DFBSURFACE))
+ {
+ m_dfbSurface->Release(m_dfbSurface);
+ m_dfbSurface = NULL;
+ }
+ else
+#endif
delete[] m_pixels;
}
@@ -83,8 +104,11 @@ void CBaseTexture::Allocate(unsigned int width, unsigned int height, unsigned in
CLAMP(m_textureHeight, g_Windowing.GetMaxTextureSize());
CLAMP(m_imageWidth, m_textureWidth);
CLAMP(m_imageHeight, m_textureHeight);
- delete[] m_pixels;
- m_pixels = new unsigned char[GetPitch() * GetRows()];
+ if (!(m_format & XB_FMT_DFBSURFACE))
+ {
+ delete[] m_pixels;
+ m_pixels = new unsigned char[GetPitch() * GetRows()];
+ }
}
void CBaseTexture::Update(unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, const unsigned char *pixels, bool loadToGPU)
@@ -128,6 +152,9 @@ void CBaseTexture::Update(unsigned int width, unsigned int height, unsigned int
void CBaseTexture::ClampToEdge()
{
+ if (m_format & XB_FMT_DFBSURFACE)
+ return;
+
unsigned int imagePitch = GetPitch(m_imageWidth);
unsigned int imageRows = GetRows(m_imageHeight);
unsigned int texturePitch = GetPitch(m_textureWidth);
@@ -170,6 +197,14 @@ bool CBaseTexture::LoadFromFile(const CStdString& texturePath, unsigned int maxW
return false;
}
+#if defined (HAS_DIRECTFB)
+ if (URIUtils::GetExtension(texturePath).Equals(".jpg") || URIUtils::GetExtension(texturePath).Equals(".tbn"))
+ {
+ if (LoadHWAccelerated(texturePath))
+ return true;
+ }
+#endif
+
//ImageLib is sooo sloow for jpegs. Try our own decoder first. If it fails, fall back to ImageLib.
if (URIUtils::GetExtension(texturePath).Equals(".jpg") || URIUtils::GetExtension(texturePath).Equals(".tbn"))
{
@@ -334,6 +369,7 @@ unsigned int CBaseTexture::GetPitch(unsigned int width) const
return (((width + 1)* 3 / 4) * 4);
case XB_FMT_RGBA8:
case XB_FMT_A8R8G8B8:
+ case XB_FMT_DFBSURFACE:
default:
return width*4;
}
@@ -349,6 +385,7 @@ unsigned int CBaseTexture::GetRows(unsigned int height) const
case XB_FMT_DXT5:
case XB_FMT_DXT5_YCoCg:
return (height + 3) / 4;
+ case XB_FMT_DFBSURFACE:
default:
return height;
}
@@ -375,3 +412,188 @@ bool CBaseTexture::HasAlpha() const
{
return m_hasAlpha;
}
+
+bool CBaseTexture::LoadHWAccelerated(const CStdString& texturePath)
+{
+#if defined (HAS_DIRECTFB)
+ CSingleLock lock(gHWLoaderSection);
+
+ if (!g_Windowing.IsCreated())
+ return false;
+
+ XFILE::CFile file;
+ uint8_t *imageBuff = NULL;
+ int64_t imageBuffSize = 0;
+
+#if 1
+ //open path and read data to buffer
+ //this handles advancedsettings.xml pathsubstitution
+ //and resulting networking
+ if (file.Open(texturePath, 0))
+ {
+ int64_t imgsize;
+ imgsize = file.GetLength();
+ imageBuff = new uint8_t[imgsize];
+ imageBuffSize = file.Read(imageBuff, imgsize);
+ file.Close();
+
+ if (imgsize != imageBuffSize)
+ CLog::Log(LOGERROR,"CBaseTexture::LoadHWAccelerated:imgsize(%llu) != imageBuffSize(%llu)",
+ imgsize, imageBuffSize);
+
+ if (imageBuffSize <= 0)
+ {
+ delete [] imageBuff;
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ DFBResult err;
+ IDirectFB *dfb = g_Windowing.GetIDirectFB();
+ if (!dfb)
+ {
+ delete [] imageBuff;
+ return false;
+ }
+
+ // create a directfb data buffer for memory
+ DFBDataBufferDescription dbd ={ (DFBDataBufferDescriptionFlags)0, 0 };
+ dbd.flags = DBDESC_MEMORY;
+ dbd.memory.data = imageBuff;
+ dbd.memory.length = imageBuffSize;
+#else
+ DFBResult err;
+ IDirectFB *dfb = g_Windowing.GetIDirectFB();
+ if (!dfb)
+ {
+ delete [] imageBuff;
+ return false;
+ }
+
+ char image_filename[1024];
+ DFBDataBufferDescription dbd = {DBDESC_FILE, image_filename};
+ strcpy(image_filename, CSpecialProtocol::TranslatePath(texturePath).c_str());
+#endif
+
+ IDirectFBDataBuffer *buffer = NULL;
+ err = dfb->CreateDataBuffer(dfb, &dbd, &buffer);
+ if (err != DFB_OK)
+ {
+ CLog::Log(LOGERROR,"CBaseTexture::LoadHWAccelerated:dfb->CreateDataBuffer failed");
+ delete [] imageBuff;
+ return false;
+ }
+
+ IDirectFBImageProvider *provider = NULL;
+ // use g_Windowing to create the image provider and retain the 1st
+ // so we avoid recurring setup overhead.
+ if (!g_Windowing.CreateImageProvider(buffer, &provider, true))
+ {
+ CLog::Log(LOGERROR,"CBaseTexture::LoadHWAccelerated:buffer->CreateImageProvider failed");
+ buffer->Release(buffer);
+ delete [] imageBuff;
+ return false;
+ }
+
+ // get the surface description, from the incoming compressed image.
+ DFBSurfaceDescription dsc;
+ memset(&dsc, 0, sizeof(dsc));
+
+ // important to set what we want to get back in flags
+ // before calling GetSurfaceDescription.
+ dsc.flags = (DFBSurfaceDescriptionFlags)(DSDESC_CAPS|DSDESC_WIDTH|DSDESC_HEIGHT|DSDESC_PIXELFORMAT);
+ provider->GetSurfaceDescription(provider, &dsc);
+
+ // remember original jpeg/png width, height.
+ unsigned int img_width = dsc.width;
+ unsigned int img_height = dsc.height;
+ // check size limits and limit to screen size - preserving aspectratio of image
+ unsigned int maxSize = g_Windowing.GetMaxTextureSize();
+ if ( img_width > maxSize || img_height > maxSize )
+ {
+ float aspect;
+ if (img_width > img_height)
+ {
+ aspect = (float)img_width / (float)img_height;
+ img_width = g_Windowing.GetWidth();
+ img_height = (float)img_width / (float)aspect;
+ }
+ else
+ {
+ aspect = (float)img_height / (float)img_width;
+ img_height = g_Windowing.GetHeight();
+ img_width = (float)img_height / (float)aspect;
+ }
+ CLog::Log(LOGDEBUG, "CBaseTexture::LoadHWAccelerated:clamping image size from %i x %i to %i x %i",
+ dsc.width, dsc.height, img_height, img_height);
+ dsc.width = img_width;
+ dsc.height = img_height;
+ }
+ if (!g_Windowing.SupportsNPOT(false))
+ {
+ dsc.width = PadPow2(img_width);
+ dsc.height = PadPow2(img_height);
+ }
+
+ // set caps to DSCAPS_VIDEOONLY so we get hw decode.
+ dsc.caps = (DFBSurfaceCapabilities)(dsc.caps | DSCAPS_VIDEOONLY);
+ dsc.caps = (DFBSurfaceCapabilities)(dsc.caps &~DSCAPS_SYSTEMONLY);
+ dsc.pixelformat = DSPF_ARGB;
+
+ // create the surface and render the compressed image to it.
+ // once we render to it, we can release/delete most dfb objects.
+ IDirectFBSurface *imagesurface = NULL;
+ dfb->CreateSurface(dfb, &dsc, &imagesurface);
+ if (!imagesurface)
+ {
+ // sometimes, during startup, we get a null surface back.
+ CLog::Log(LOGERROR, "CBaseTexture::LoadHWAccelerated:dfb->CreateSurface failed");
+ g_Windowing.ReleaseImageProvider(provider);
+ buffer->Release(buffer);
+ delete [] imageBuff;
+ return false;
+ }
+ const DFBRectangle dstRect = {0, 0, img_width, img_height};
+ provider->RenderTo(provider, imagesurface, &dstRect);
+ // use g_Windowing to manage release
+ g_Windowing.ReleaseImageProvider(provider);
+ buffer->Release(buffer);
+ delete [] imageBuff;
+
+#if 1
+ m_dfbSurface = imagesurface;
+ Allocate(img_width, img_height, XB_FMT_DFBSURFACE);
+ // correct our texture width to match the IDirectFBSurface pitch
+ int imgpitch = 0;
+ void *src = NULL;
+ imagesurface->Lock(imagesurface, DSLF_READ , &src, &imgpitch);
+ m_textureWidth = imgpitch / 4;
+
+ // jpegs don't have alpha so there's no need to test
+ m_hasAlpha = 0;
+
+ imagesurface->Unlock(imagesurface);
+#else
+ Allocate(img_width, img_height, XB_FMT_A8R8G8B8);
+ // lock the rendered surface, get a read pointer to it
+ // and memcpy the contents into our m_pixels.
+ // TODO: fixup memcpy to pay attention to imgpitch
+ int imgpitch = 0;
+ void *src = NULL;
+ imagesurface->Lock(imagesurface, DSLF_READ , &src, &imgpitch);
+ memcpy(m_pixels, src, GetPitch() * dsc.height);
+ imagesurface->Unlock(imagesurface);
+ imagesurface->Release(imagesurface);
+
+ ClampToEdge();
+#endif
+
+ return true;
+#else
+ return false;
+#endif
+}
diff --git a/xbmc/guilib/Texture.h b/xbmc/guilib/Texture.h
index ec0de7c..7a204b2 100644
--- a/xbmc/guilib/Texture.h
+++ b/xbmc/guilib/Texture.h
@@ -30,7 +30,9 @@
#include "gui3d.h"
#include "utils/StdString.h"
#include "XBTF.h"
-
+#if defined(HAS_DIRECTFB)
+#include <directfb.h>
+#endif
#pragma pack(1)
struct COLOR {unsigned char b,g,r,x;}; // Windows GDI expects 4bytes per color
#pragma pack()
@@ -111,6 +113,10 @@ protected:
unsigned int m_format;
int m_orientation;
bool m_hasAlpha;
+#if defined(HAS_DIRECTFB)
+ bool LoadHWAccelerated(const CStdString& texturePath);
+ IDirectFBSurface *m_dfbSurface;
+#endif
};
#if defined(HAS_GL) || defined(HAS_GLES)
diff --git a/xbmc/guilib/TextureGL.cpp b/xbmc/guilib/TextureGL.cpp
index 7701712..2c16007 100644
--- a/xbmc/guilib/TextureGL.cpp
+++ b/xbmc/guilib/TextureGL.cpp
@@ -27,6 +27,10 @@
#if defined(HAS_GL) || defined(HAS_GLES)
+#if defined(HAS_DIRECTFB)
+#include <directfb.h>
+#endif
+
using namespace std;
/************************************************************************/
@@ -55,7 +59,7 @@ void CGLTexture::DestroyTextureObject()
void CGLTexture::LoadToGPU()
{
- if (!m_pixels)
+ if (!m_pixels && !m_dfbSurface)
{
// nothing to load - probably same image (no change)
return;
@@ -139,7 +143,23 @@ void CGLTexture::LoadToGPU()
#ifndef GL_BGRA_EXT
#define GL_BGRA_EXT 0x80E1
#endif
-
+#if defined (HAS_DIRECTFB)
+ if (m_format & XB_FMT_DFBSURFACE)
+ {
+ int imgpitch = 0;
+ void *imgsrc = NULL;
+ m_dfbSurface->Lock(m_dfbSurface, DSLF_READ , &imgsrc, &imgpitch);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, m_textureWidth, m_textureHeight, 0,
+ GL_BGRA_EXT, GL_UNSIGNED_BYTE, imgsrc);
+ VerifyGLState();
+
+ m_dfbSurface->Unlock(m_dfbSurface);
+ m_dfbSurface->Release(m_dfbSurface);
+ m_dfbSurface = NULL;
+ }
+ else
+#endif
+ {
GLint internalformat;
GLenum pixelformat;
@@ -173,7 +193,7 @@ void CGLTexture::LoadToGPU()
}
glTexImage2D(GL_TEXTURE_2D, 0, internalformat, m_textureWidth, m_textureHeight, 0,
pixelformat, GL_UNSIGNED_BYTE, m_pixels);
-
+ }
#endif
VerifyGLState();
diff --git a/xbmc/guilib/XBTF.h b/xbmc/guilib/XBTF.h
index aed9b65..0c010cb 100644
--- a/xbmc/guilib/XBTF.h
+++ b/xbmc/guilib/XBTF.h
@@ -39,6 +39,7 @@
#define XB_FMT_A8 32
#define XB_FMT_RGBA8 64
#define XB_FMT_RGB8 128
+#define XB_FMT_DFBSURFACE 256
#define XB_FMT_OPAQUE 65536
class CXBTFFrame
https://github.com/xbmc/xbmc/commit/86d1457d46632e16454ccf178463e59c3e58ea3c
commit 86d1457d46632e16454ccf178463e59c3e58ea3c
Author: theuni <theuni-nospam-@...>
Date: Wed Oct 12 17:56:18 2011 -0400
[smp] dvdnav: fix cross-compile
remove cflags that aren't safe
diff --git a/lib/libdvd/libdvdnav/Makefile b/lib/libdvd/libdvdnav/Makefile
index 85245b7..8b74346 100644
--- a/lib/libdvd/libdvdnav/Makefile
+++ b/lib/libdvd/libdvdnav/Makefile
@@ -21,7 +21,7 @@ CFLAGS += -DHAVE_CONFIG_H -DHAVE_DLFCN_H
L=libdvdnav
MINI_L=libdvdnavmini
-CFLAGS += $(DVDREAD_CFLAGS)
+#CFLAGS += $(DVDREAD_CFLAGS)
LIB = $(L).a
SHLIB = $(L).so
https://github.com/xbmc/xbmc/commit/982c8309df7c1d4114d3ce42f024a9618dd5e83c
commit 982c8309df7c1d4114d3ce42f024a9618dd5e83c
Author: theuni <theuni-nospam-@...>
Date: Wed Oct 12 17:11:24 2011 -0400
[smp] Add makefile for building xbmc
diff --git a/tools/sigma/Makefile b/tools/sigma/Makefile
new file mode 100644
index 0000000..e5be496
--- /dev/null
+++ b/tools/sigma/Makefile
@@ -0,0 +1,20 @@
+include sigma-buildroot-sdk.mk
+
+SOURCE=../../
+# configuration settings
+export PYTHON_VERSION=2.7
+export PYTHON_LDFLAGS=-L$(BUILDPREFIX)/lib -lpython$(PYTHON_VERSION) -lpthread -ldl -lutil -lm
+export PYTHON_CPPFLAGS=-I$(BUILDPREFIX)/include/python$(PYTHON_VERSION)
+export PYTHON_SITE_PKG=$(BUILDPREFIX)/lib/python$(PYTHON_VERSION)/site-packages
+export PYTHON_NOVERSIONCHECK=no-check
+
+CONFIGURE=./configure --build=$(BUILD) --host=$(HOST) --prefix=/usr \
+ --enable-gles --disable-optical-drive --disable-dvdcss --enable-optimizations \
+ --disable-x11 --disable-libbluray --disable-sdl --enable-directfb
+all: configure
+
+configure:
+ cd $(SOURCE); ./bootstrap
+ cd $(SOURCE); $(CONFIGURE)
+ cd $(SOURCE); make -j8
+ #cd $(SOURCE); make install
diff --git a/tools/sigma/sigma-buildroot-sdk.mk b/tools/sigma/sigma-buildroot-sdk.mk
new file mode 100644
index 0000000..9dd6c09
--- /dev/null
+++ b/tools/sigma/sigma-buildroot-sdk.mk
@@ -0,0 +1,23 @@
+#Specify path to buildroot here
+BUILDROOT=
+
+export XBMCSTAGE=$(BUILDROOT)/output/staging
+export SYSROOT=$(BUILDROOT)/output/host/usr/mipsel-unknown-linux-gnu/sysroot
+export BUILD=$(shell uname -m)-unknown-linux-gnu
+export BUILDPREFIX=$(XBMCSTAGE)/usr
+export CFLAGS=-I$(XBMCSTAGE)/usr/lib/DCCHD/test/include_egl
+export CXXFLAGS=${CFLAGS}
+export CPPFLAGS=${CFLAGS}
+export LDFLAGS=-Wl,--unresolved-symbols=ignore-in-shared-libs
+export CROSSBIN=$(BUILDROOT)/output/external-toolchain/bin/mips-linux-gnu-
+export CC=${CROSSBIN}gcc -EL --sysroot=$(SYSROOT) -march=mips32r2 -mtune=24kf
+export CXX=${CROSSBIN}g++ -EL --sysroot=$(SYSROOT) -march=mips32r2 -mtune=24kf
+export LD=${CROSSBIN}ld -EL --sysroot=$(SYSROOT)
+export AR=${CROSSBIN}ar
+export RANLIB=${CROSSBIN}ranlib
+export STRIP=${CROSSBIN}strip
+export OBJDUMP=${CROSSBIN}objdump
+export HOST=mips-linux-gnu
+export CXXCPP=${CXX} -E
+export PATH:=$(SYSROOT)/usr/bin:$(PATH)
+export PATH:=$(BUILDROOT)/output/external-toolchain/bin:$(BUILDROOT)/output/host/usr/bin:$(PATH)
https://github.com/xbmc/xbmc/commit/8d79cd0b56e5f9e6a3b01d14ba82128775b6ab70
commit 8d79cd0b56e5f9e6a3b01d14ba82128775b6ab70
Author: theuni <theuni-nospam-@...>
Date: Wed Oct 12 17:11:01 2011 -0400
[smp] add directfb support
Note: This implementation is sigma-specific. It uses both egl and directfb
directly.
diff --git a/.gitignore b/.gitignore
index d7c757e..8f780f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1219,3 +1219,5 @@ lib/cmyth/Makefile
/xbmc/visualizations/XBMCProjectM/libprojectM/config.inp
/xbmc/win32/git_rev.h
+
+/xbmc/windowing/dfb/Makefile
diff --git a/Makefile.in b/Makefile.in
index ba0f50a..1833dc5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -86,6 +86,9 @@ ifeq (@USE_OPENGLES@...)
BIN_DIRS += xbmc/rendering/gles
BIN_DIRS += xbmc/windowing/egl
endif
+ifeq (@USE_DIRECTFB@...)
+BIN_DIRS += xbmc/windowing/dfb
+endif
ifeq ($(findstring osx,@ARCH@...)
BIN_DIRS += xbmc/network/osx
@@ -286,6 +289,8 @@ xbmc/windowing/windowing.a: force
$(MAKE) -C xbmc/windowing
xbmc/windowing/egl/windowing_egl.a: force
$(MAKE) -C xbmc/windowing/egl
+xbmc/windowing/dfb/windowing_dfb.a: force
+ $(MAKE) -C xbmc/windowing/dfb
xbmc/windowing/osx/windowing_osx.a: force
$(MAKE) -C xbmc/windowing/osx
xbmc/windowing/X11/windowing_X11.a: force
@@ -515,6 +520,9 @@ ifeq (@USE_OPENGLES@...)
OBJSXBMC += xbmc/rendering/gles/rendering_gles.a
OBJSXBMC += xbmc/windowing/egl/windowing_egl.a
endif
+ifeq (@USE_DIRECTFB@...)
+OBJSXBMC += xbmc/windowing/dfb/windowing_dfb.a
+endif
ifeq (@HAVE_XBMC_NONFREE@...)
OBJSXBMC += lib/UnrarXLib/UnrarXLib.a
diff --git a/configure.in b/configure.in
index 69693ab..9e07fce 100755
--- a/configure.in
+++ b/configure.in
@@ -83,6 +83,9 @@ projectm_enabled="== ProjectM enabled. =="
projectm_disabled="== ProjectM disabled. =="
x11_enabled="== X11 enabled. =="
x11_disabled="== X11 disabled. =="
+directfb_enabled="== directfb enabled. =="
+directfb_disabled="== directfb disabled. =="
+windowing_error="Could not enable directfb and X11 support simultaneously. Please disable one."
pulse_not_found="== Could not find libpulse. PulseAudio support disabled. =="
pulse_disabled="== PulseAudio support manually disabled. =="
dvdcss_enabled="== DVDCSS support enabled. =="
@@ -271,6 +274,12 @@ AC_ARG_ENABLE([ccache],
[use_ccache=$enableval],
[use_ccache=auto])
+AC_ARG_ENABLE([directfb],
+ [AS_HELP_STRING([--enable-directfb],
+ [enable directfb (default is no) 'Linux Only'])],
+ [use_directfb=$enableval],
+ [use_directfb=no])
+
AC_ARG_ENABLE([pulse],
[AS_HELP_STRING([--enable-pulse],
[enable PulseAudio support (default is auto)])],
@@ -676,6 +685,22 @@ else
fi
fi
+if test "$use_directfb" = "yes" && test "$host_vendor" != "apple"; then
+ if test "x$use_gles" != "xyes"; then
+ AC_MSG_ERROR($directfb_gles)
+ fi
+ AC_MSG_NOTICE($directfb_enabled)
+ PKG_CHECK_MODULES([DIRECTFB], [directfb],
+ [INCLUDES="$INCLUDES $DIRECTFB_CFLAGS"; LIBS="$LIBS $DIRECTFB_LIBS"],
+ AC_MSG_ERROR($missing_library))
+ AC_DEFINE([HAVE_DIRECTFB], [1], [Define to 1 if you have directfb libs installed.])
+ USE_DIRECTFB=1
+ use_sdl=no;use_joystick=no
+else
+ AC_MSG_RESULT($directfb_disabled)
+ USE_DIRECTFB=0
+fi
+
# platform common libraries
AC_CHECK_PROG(MYSQL_CONFIG, mysql_config, "yes", "no")
if test $MYSQL_CONFIG = "yes"; then
@@ -909,6 +934,9 @@ fi
# X11
if test "$use_x11" = "yes" && test "$host_vendor" != "apple"; then
+ if test "$use_directfb" = "yes"; then
+ AC_MSG_ERROR($windowing_error)
+ fi
AC_MSG_NOTICE($x11_enabled)
PKG_CHECK_MODULES([X11], [x11],
[INCLUDES="$INCLUDES $X11_CFLAGS"; LIBS="$LIBS $X11_LIBS"],
@@ -1879,6 +1907,7 @@ OUTPUT_FILES="Makefile \
xbmc/visualizations/OpenGLSpectrum/Makefile \
xbmc/visualizations/WaveForm/Makefile \
xbmc/visualizations/iTunes/Makefile \
+ xbmc/windowing/dfb/Makefile \
tools/Linux/xbmc.sh \
tools/Linux/xbmc-standalone.sh \
tools/TexturePacker/Makefile \
@@ -1938,6 +1967,7 @@ AC_SUBST(USE_OPENMAX)
AC_SUBST(USE_PULSE)
AC_SUBST(USE_XRANDR)
AC_SUBST(USE_ALSA)
+AC_SUBST(USE_DIRECTFB)
AC_SUBST(USE_TEXTUREPACKER)
AC_SUBST(USE_TEXTUREPACKER_NATIVE)
AC_SUBST(USE_TEXTUREPACKER_NATIVE_ROOT)
diff --git a/xbmc/system.h b/xbmc/system.h
index 0262fde..0c63414 100644
--- a/xbmc/system.h
+++ b/xbmc/system.h
@@ -236,6 +236,10 @@
#ifdef HAVE_LIBGLESV2
#undef HAS_GL
#define HAS_GLES 2
+#if defined(HAVE_DIRECTFB)
+#define HAS_DIRECTFB
+#define SUPPORT_DIRECTFB_WS
+#endif
#endif
// GLES1.0 detected. Dont use GL!
diff --git a/xbmc/windowing/WinEvents.h b/xbmc/windowing/WinEvents.h
index 65faedb..d270a5e 100644
--- a/xbmc/windowing/WinEvents.h
+++ b/xbmc/windowing/WinEvents.h
@@ -55,6 +55,10 @@ public:
#include "WinEventsLinux.h"
#define CWinEvents CWinEventsLinux
+#elif defined(TARGET_LINUX) && defined(HAS_DIRECTFB)
+#include "dfb/WinEventsDFB.h"
+#define CWinEvents CWinEventsDFB
+
#endif
#endif // WINDOW_EVENTS_H
diff --git a/xbmc/windowing/WinSystem.h b/xbmc/windowing/WinSystem.h
index b408c69..b773a7e 100644
--- a/xbmc/windowing/WinSystem.h
+++ b/xbmc/windowing/WinSystem.h
@@ -33,7 +33,8 @@ typedef enum _WindowSystemType
WINDOW_SYSTEM_IOS,
WINDOW_SYSTEM_X11,
WINDOW_SYSTEM_SDL,
- WINDOW_SYSTEM_EGL
+ WINDOW_SYSTEM_EGL,
+ WINDOW_SYSTEM_DFB
} WindowSystemType;
struct RESOLUTION_WHR
diff --git a/xbmc/windowing/WindowingFactory.h b/xbmc/windowing/WindowingFactory.h
index f1800e5..d0a01ab 100644
--- a/xbmc/windowing/WindowingFactory.h
+++ b/xbmc/windowing/WindowingFactory.h
@@ -36,6 +36,9 @@
#elif defined(TARGET_LINUX) && defined(HAS_GLES) && defined(HAVE_X11)
#include "X11/WinSystemX11GLES.h"
+#elif defined(TARGET_LINUX) && defined(HAS_GLES) && defined(HAS_DIRECTFB)
+#include "dfb/WinSystemDFB.h"
+
#elif defined(TARGET_LINUX) && defined(HAS_GLES) && defined(HAS_EGL)
#include "egl/WinSystemGLES.h"
diff --git a/xbmc/windowing/dfb/Makefile.in b/xbmc/windowing/dfb/Makefile.in
new file mode 100644
index 0000000..a97ba5d
--- /dev/null
+++ b/xbmc/windowing/dfb/Makefile.in
@@ -0,0 +1,14 @@
+INCLUDES= -I. \
+ -I@... \
+ -I@...
+
+CXXFLAGS+= @DIRECTFB_CFLAGS@
+
+SRCS= \
+ WinSystemDFB.cpp \
+ WinEventsDFB.cpp \
+
+LIB=windowing_dfb.a
+
+include @abs_top_srcdir@...
+-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS)))
diff --git a/xbmc/windowing/dfb/WinEventsDFB.cpp b/xbmc/windowing/dfb/WinEventsDFB.cpp
new file mode 100644
index 0000000..a9ada3f
--- /dev/null
+++ b/xbmc/windowing/dfb/WinEventsDFB.cpp
@@ -0,0 +1,145 @@
+/*
+* Copyright (C) 2011 Team XBMC
+* http://www.xbmc.org
+*
+* This Program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2, or (at your option)
+* any later version.
+*
+* This Program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with XBMC; see the file COPYING. If not, write to
+* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+* http://www.gnu.org/copyleft/gpl.html
+*
+*/
+
+#include "system.h"
+#if defined(HAS_DIRECTFB)
+
+#include "WinEvents.h"
+#include "Application.h"
+#include "WindowingFactory.h"
+
+#include <directfb.h>
+
+PHANDLE_EVENT_FUNC CWinEventsBase::m_pEventFunc = NULL;
+
+bool CWinEventsDFB::MessagePump()
+{
+ static IDirectFB *dfb;
+ static IDirectFBEventBuffer *buffer = NULL;
+ static bool m_initialized = false;
+ if (!m_initialized)
+ {
+ dfb = g_Windowing.GetIDirectFB();
+ if (dfb->CreateInputEventBuffer(dfb, DICAPS_ALL, DFB_TRUE, &buffer) != DFB_OK)
+ {
+ fprintf(stderr, "Could not create input event buffer!!!\n");
+ return false;
+ }
+ m_initialized=true;
+ }
+
+ DFBEvent event;
+ bool ret = false;
+
+ while (buffer->HasEvent(buffer) == DFB_OK)
+ {
+ buffer->GetEvent(buffer, &event);
+ if (event.clazz != DFEC_INPUT)
+ return false;
+
+ XBMC_Event newEvent;
+ switch(event.input.type)
+ {
+ case DIET_KEYPRESS:
+ newEvent.type = XBMC_KEYDOWN;
+ break;
+ case DIET_KEYRELEASE:
+ newEvent.type = XBMC_KEYUP;
+ break;
+ default:
+ return false;
+ }
+
+ newEvent.key.keysym.scancode = event.input.key_id;
+ newEvent.key.keysym.unicode = event.input.key_symbol;
+ newEvent.key.keysym.mod = (XBMCMod)event.input.modifiers;
+ if (event.input.key_symbol < 128)
+ {
+ newEvent.key.keysym.sym = (XBMCKey)event.input.key_symbol;
+ }
+ else
+ {
+ switch (event.input.key_symbol)
+ {
+ case DIKS_CURSOR_UP:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_UP;
+ break;
+ case DIKS_CURSOR_DOWN:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_DOWN;
+ break;
+ case DIKS_CURSOR_LEFT:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_LEFT;
+ break;
+ case DIKS_CURSOR_RIGHT:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_RIGHT;
+ break;
+ case DIKS_INSERT:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_INSERT;
+ break;
+ case DIKS_HOME:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_HOME;
+ break;
+ case DIKS_END:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_END;
+ break;
+ case DIKS_PAGE_UP:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_PAGEUP;
+ break;
+ case DIKS_PAGE_DOWN:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_PAGEDOWN;
+ break;
+ case DIKS_VOLUME_UP:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_VOLUME_UP;
+ break;
+ case DIKS_MUTE:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_VOLUME_MUTE;
+ break;
+ case DIKS_PREVIOUS:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_BACKSPACE;
+ break;
+ case DIKS_PLAY:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_MEDIA_PLAY_PAUSE;
+ break;
+ case DIKS_REWIND:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_r;
+ break;
+ case DIKS_STOP:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_MEDIA_STOP;
+ break;
+ case DIKS_FASTFORWARD:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_f;
+ break;
+ case DIKS_PAUSE:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_PAUSE;
+ break;
+ case DIKS_INFO:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_i;
+ break;
+ default:
+ newEvent.key.keysym.sym = (XBMCKey)XBMCK_UNKNOWN;
+ break;
+ }
+ }
+ ret |= g_application.OnEvent(newEvent);
+ }
+ return ret;
+}
+#endif
diff --git a/xbmc/windowing/dfb/WinEventsDFB.h b/xbmc/windowing/dfb/WinEventsDFB.h
new file mode 100644
index 0000000..faed7e3
--- /dev/null
+++ b/xbmc/windowing/dfb/WinEventsDFB.h
@@ -0,0 +1,37 @@
+/*
+* Copyright (C) 2011 Team XBMC
+* http://www.xbmc.org
+*
+* This Program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2, or (at your option)
+* any later version.
+*
+* This Program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with XBMC; see the file COPYING. If not, write to
+* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+* http://www.gnu.org/copyleft/gpl.html
+*
+*/
+#pragma once
+
+#ifndef WINDOW_EVENTS_DFB_H
+#define WINDOW_EVENTS_DFB_H
+
+#include "windowing/WinEvents.h"
+
+class CWinEventsDFB : public CWinEventsBase
+{
+public:
+ CWinEventsDFB();
+ ~CWinEventsDFB();
+
+ static bool MessagePump();
+};
+
+#endif // WINDOW_EVENTS_DFB_H
diff --git a/xbmc/windowing/dfb/WinSystemDFB.cpp b/xbmc/windowing/dfb/WinSystemDFB.cpp
new file mode 100644
index 0000000..1e7e040
--- /dev/null
+++ b/xbmc/windowing/dfb/WinSystemDFB.cpp
@@ -0,0 +1,378 @@
+/*
+ * Copyright (C) 2005-2008 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+#include "system.h"
+
+#ifdef HAS_DIRECTFB
+
+#include "WinSystemDFB.h"
+#include "utils/log.h"
+#include "filesystem/SpecialProtocol.h"
+#include "settings/Settings.h"
+#include "guilib/Texture.h"
+#include "windowing/egl/WinBindingEGL.h"
+
+#include <vector>
+#include <directfb.h>
+
+// based on sigma's directfb definitions.
+// beware, others might be different.
+enum {
+ XBMC_OSD = DSCID_PRIMARY,
+ XBMC_BKGND,
+ XBMC_MAINVIDEO,
+ XBMC_SECVIDEO,
+ XBMC_SECOSD
+};
+
+#define VERBOSE_LOGGING 1
+
+CWinSystemDFB::CWinSystemDFB() : CWinSystemBase()
+{
+ m_dfb = NULL;
+ m_dfb_screen = NULL;
+ m_dfb_layer = NULL;
+ m_dfb_surface = NULL;
+ m_dfb_image_provider = NULL;
+
+ //m_buffermode = DLBM_FRONTONLY; // no backbuffer ( tearing unless we WaitForSync)
+ //m_buffermode = DLBM_BACKVIDEO; // backbuffer in video memory (no tearing but gui fps is slower)
+ m_buffermode = DLBM_TRIPLE;
+ m_eWindowSystem = WINDOW_SYSTEM_DFB;
+ m_eglBinding = new CWinBindingEGL();
+}
+
+CWinSystemDFB::~CWinSystemDFB()
+{
+ DestroyWindowSystem();
+ delete m_eglBinding;
+}
+
+bool CWinSystemDFB::InitWindowSystem()
+{
+ int width, height;
+ DFBDisplayLayerConfig dlcfg;
+
+ DirectFBInit(NULL, NULL);
+ DirectFBCreate(&m_dfb);
+ m_dfb->SetCooperativeLevel(m_dfb, DFSCL_NORMAL);
+
+ m_dfb->GetScreen(m_dfb, DSCID_PRIMARY, &m_dfb_screen);
+
+ // setup GUI layer
+ m_dfb->GetDisplayLayer(m_dfb, DLID_PRIMARY, &m_dfb_layer);
+ m_dfb_layer->SetCooperativeLevel(m_dfb_layer, DLSCL_ADMINISTRATIVE);
+ m_dfb_layer->GetConfiguration(m_dfb_layer, &dlcfg);
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: DisplayLayer width(%d), height(%d)",
+ dlcfg.width, dlcfg.height);
+
+ dlcfg.flags = (DFBDisplayLayerConfigFlags)(DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT);
+ dlcfg.options = DLOP_ALPHACHANNEL;
+ dlcfg.buffermode = (DFBDisplayLayerBufferMode)m_buffermode;
+ dlcfg.pixelformat = DSPF_ARGB;
+ m_dfb_layer->SetConfiguration(m_dfb_layer, &dlcfg);
+ m_dfb_layer->SetOpacity(m_dfb_layer, 0xFF);
+
+ m_dfb_layer->GetSurface(m_dfb_layer, &m_dfb_surface);
+ m_dfb_surface->GetSize(m_dfb_surface, &width, &height);
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: Surface width(%d), height(%d)",
+ width, height);
+
+#if VERBOSE_LOGGING > 0
+ // get and dump the screen descriptor
+ DFBScreenDescription screen_desc;
+ screen_desc.caps = DSCCAPS_ALL;
+ m_dfb_screen->GetDescription(m_dfb_screen, &screen_desc);
+ CLog::Log(LOGDEBUG, "screen_desc caps(0x%x), name(%s), mixers(%d), encoders(%d), outputs(%d)",
+ screen_desc.caps, screen_desc.name, screen_desc.mixers, screen_desc.encoders, screen_desc.outputs);
+
+ // get and dump the mixer descriptors
+ DFBScreenMixerDescription mixer_descs[screen_desc.mixers];
+ m_dfb_screen->GetMixerDescriptions(m_dfb_screen, mixer_descs);
+ for (int i = 0; i < screen_desc.mixers; ++i)
+ {
+ CLog::Log(LOGDEBUG, "i(%d), mixer_descs caps(0x%x), layers(0x%x), "
+ "sub_num(0x%x), sub_layers(0x%x), name(%s)",
+ i, mixer_descs[i].caps, mixer_descs[i].layers,
+ mixer_descs[i].sub_num, mixer_descs[i].sub_layers, mixer_descs[i].name);
+ }
+
+ // get and dump the encoder descriptors
+ DFBScreenEncoderConfig encoder_cfg;
+ DFBScreenOutputSignals out_signal;
+ for (int i = 0; i < screen_desc.encoders; ++i)
+ {
+ m_dfb_screen->GetEncoderConfiguration(m_dfb_screen, i, &encoder_cfg);
+ CLog::Log(LOGDEBUG, "i(%d), enc_cfg flags(0x%x), tv_standard(0x%x), out_signals(0x%x)",
+ i, encoder_cfg.flags, encoder_cfg.tv_standard, encoder_cfg.out_signals);
+ if (encoder_cfg.out_signals & ~DSOS_EDID)
+ {
+ out_signal = (DFBScreenOutputSignals)(encoder_cfg.out_signals & ~DSOS_EDID);
+ //break;
+ }
+ }
+
+ // get and dump the screen descriptors
+ DFBScreenOutputDescription screen_descs[screen_desc.outputs];
+ m_dfb_screen->GetOutputDescriptions(m_dfb_screen, screen_descs);
+ for (int i = 0; i < screen_desc.outputs; ++i)
+ {
+ CLog::Log(LOGDEBUG, "i(%d), screen_descs caps(0x%x), all_connectors(0x%x), all_signals(0x%x), name(%s)",
+ i, screen_descs[i].caps, screen_descs[i].all_connectors, screen_descs[i].all_signals, screen_descs[i].name);
+ }
+
+ DFBScreenOutputConfig output_cfg;
+ output_cfg.flags = DSOCONF_ALL;
+ m_dfb_screen->GetOutputConfiguration(m_dfb_screen, 0, &output_cfg);
+ CLog::Log(LOGDEBUG,
+ "output_cfg flags(0x%x), encoder(0x%x), "
+ "out_signals(0x%x), out_connectors(0x%x), slow_blanking(0x%x)",
+ output_cfg.flags, output_cfg.encoder,
+ output_cfg.out_signals, output_cfg.out_connectors, output_cfg.slow_blanking);
+
+ IDirectFBScreen *screen = NULL;
+ if (m_dfb->GetScreen(m_dfb, DSCID_PRIMARY, &screen) == DFB_OK)
+ {
+ DFBScreenMixerConfig mixcfg;
+ screen->GetMixerConfiguration(screen, 0, &mixcfg);
+ // dump the mixer config
+ for (int n = 0; n < DFB_DISPLAYLAYER_IDS_MAX; n++)
+ {
+ if (DFB_DISPLAYLAYER_IDS_HAVE( mixcfg.layers, n))
+ {
+ switch(n)
+ {
+ case XBMC_OSD:
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) OSD layer (graphic)", n);
+ break;
+ case XBMC_BKGND:
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) Background layer (graphic)", n);
+ if (mixcfg.flags & DSMCONF_BACKGROUND)
+ {
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) Background layer ARGB "
+ "0x%02x, 0x%02x, 0x%02x, 0x%02x",
+ n, mixcfg.background.a, mixcfg.background.r, mixcfg.background.g, mixcfg.background.b );
+ }
+ break;
+ case XBMC_MAINVIDEO:
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) Main video layer", n);
+ break;
+ case XBMC_SECVIDEO:
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) Secondary video layer (video or graphic)", n);
+ break;
+ case XBMC_SECOSD:
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::InitWindowSystem: (%02x) Secondary OSD layer (graphic)", n);
+ break;
+ }
+ }
+ }
+ }
+#endif
+
+ if (!CWinSystemBase::InitWindowSystem())
+ return false;
+
+ return true;
+}
+
+bool CWinSystemDFB::DestroyWindowSystem()
+{
+ if (m_dfb_image_provider)
+ m_dfb_image_provider->Release(m_dfb_image_provider);
+ m_dfb_image_provider = NULL;
+
+ if (m_dfb_surface)
+ m_dfb_surface->Release(m_dfb_surface);
+ m_dfb_surface = NULL;
+ if (m_dfb_layer)
+ m_dfb_layer->Release(m_dfb_layer);
+ m_dfb_layer = NULL;
+
+ if (m_dfb_screen)
+ m_dfb_screen->Release(m_dfb_screen);
+ m_dfb_screen = NULL;
+
+ if (m_dfb)
+ m_dfb->Release(m_dfb);
+ m_dfb = NULL;
+
+ return true;
+}
+
+bool CWinSystemDFB::CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction)
+{
+ m_nWidth = res.iWidth;
+ m_nHeight = res.iHeight;
+ m_bFullScreen = fullScreen;
+
+ if (!m_eglBinding->CreateWindow((EGLNativeDisplayType)m_dfb, (NativeWindowType)m_dfb_surface))
+ return false;
+
+ m_bWindowCreated = true;
+
+ return true;
+}
+
+bool CWinSystemDFB::DestroyWindow()
+{
+ if (!m_eglBinding->DestroyWindow())
+ return false;
+
+ m_bWindowCreated = false;
+
+ return true;
+}
+
+bool CWinSystemDFB::ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop)
+{
+ CRenderSystemGLES::ResetRenderSystem(newWidth, newHeight, true, 0);
+ return true;
+}
+
+bool CWinSystemDFB::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays)
+{
+ CLog::Log(LOGDEBUG, "CWinSystemDFB::SetFullScreen");
+ m_nWidth = res.iWidth;
+ m_nHeight = res.iHeight;
+ m_bFullScreen = fullScreen;
+
+ m_eglBinding->ReleaseSurface();
+ CreateNewWindow("", fullScreen, res, NULL);
+
+ CRenderSystemGLES::ResetRenderSystem(res.iWidth, res.iHeight, true, 0);
+
+ return true;
+}
+
+void CWinSystemDFB::UpdateResolutions()
+{
+ CWinSystemBase::UpdateResolutions();
+
+ int w = 1280;
+ int h = 720;
+ UpdateDesktopResolution(g_settings.m_ResInfo[RES_DESKTOP], 0, w, h, 0.0);
+}
+
+bool CWinSystemDFB::IsExtSupported(const char* extension)
+{
+ if(strncmp(extension, "EGL_", 4) != 0)
+ return CRenderSystemGLES::IsExtSupported(extension);
+
+ return m_eglBinding->IsExtSupported(extension);
+}
+
+bool CWinSystemDFB::PresentRenderImpl(const CDirtyRegionList &dirty)
+{
+ // if we are not running a backbuffer,
+ // then we have to handle the vsync ourselfs
+ if (m_iVSyncMode && (m_buffermode == DLBM_FRONTONLY))
+ m_dfb_layer->WaitForSync(m_dfb_layer);
+
+ m_eglBinding->SwapBuffers();
+
+ return true;
+}
+
+void CWinSystemDFB::SetVSyncImpl(bool enable)
+{
+ m_iVSyncMode = enable ? 10 : 0;
+ if (m_eglBinding->SetVSync(enable) == DFB_FALSE)
+ {
+ // SetVSync will fail if we are DLBM_FRONTONLY
+ if (m_buffermode != DLBM_FRONTONLY)
+ CLog::Log(LOGERROR, "CWinSystemDFB::SetVSyncImpl: Could not set egl vsync");
+ }
+}
+
+void CWinSystemDFB::ShowOSMouse(bool show)
+{
+ //m_dfb_layer->EnableCursor(m_dfb_layer, show ? 1 : 0);
+}
+
+void CWinSystemDFB::NotifyAppActiveChange(bool bActivated)
+{
+}
+
+bool CWinSystemDFB::Minimize()
+{
+ Hide();
+ return true;
+}
+
+bool CWinSystemDFB::Restore()
+{
+ Show(true);
+ return false;
+}
+
+bool CWinSystemDFB::Hide()
+{
+ m_dfb_layer->SetOpacity(m_dfb_layer, 0x00);
+
+ return true;
+}
+
+bool CWinSystemDFB::Show(bool raise)
+{
+ m_dfb_layer->SetOpacity(m_dfb_layer, 0xFF);
+
+ return true;
+}
+
+IDirectFB* CWinSystemDFB::GetIDirectFB() const
+{
+ return m_dfb;
+}
+
+bool CWinSystemDFB::CreateImageProvider(IDirectFBDataBuffer *buffer, IDirectFBImageProvider **provider, bool retain1st)
+{
+ // some hardware accelerated dfb image provider implementations have
+ // lengthy setup overhead and we can avoid this by retaining the 1st
+ // created image provider.
+ DFBResult err;
+ err = buffer->CreateImageProvider(buffer, provider);
+ if (retain1st && !m_dfb_image_provider)
+ {
+ // get the surface description, to check its size
+ DFBSurfaceDescription dsc;
+ memset(&dsc, 0, sizeof(dsc));
+
+ // set the flags to indicate what we want to get back
+ dsc.flags = (DFBSurfaceDescriptionFlags)(DSDESC_WIDTH|DSDESC_HEIGHT);
+ (*provider)->GetSurfaceDescription(*provider, &dsc);
+ if ((dsc.width >= 512) && (dsc.height >= 512))
+ m_dfb_image_provider = *provider;
+ }
+
+ return(err == DFB_OK);
+}
+
+bool CWinSystemDFB::ReleaseImageProvider(IDirectFBImageProvider *provider)
+{
+ // if we have not cached the initial image provider, retain it now.
+ // the initial image provider will get released when we shutdown.
+ DFBResult err = DFB_OK;
+ if (provider && (m_dfb_image_provider != provider))
+ err = provider->Release(provider);
+
+ return(err == DFB_OK);
+}
+
+#endif
diff --git a/xbmc/windowing/dfb/WinSystemDFB.h b/xbmc/windowing/dfb/WinSystemDFB.h
new file mode 100644
index 0000000..a24db32
--- /dev/null
+++ b/xbmc/windowing/dfb/WinSystemDFB.h
@@ -0,0 +1,84 @@
+#ifndef WINDOW_SYSTEM_DFB_H
+#define WINDOW_SYSTEM_DFB_H
+
+#pragma once
+
+/*
+ * Copyright (C) 2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "rendering/gles/RenderSystemGLES.h"
+#include "utils/GlobalsHandling.h"
+#include "windowing/WinSystem.h"
+
+typedef struct _IDirectFB IDirectFB;
+typedef struct _IDirectFBScreen IDirectFBScreen;
+typedef struct _IDirectFBSurface IDirectFBSurface;
+typedef struct _IDirectFBDisplayLayer IDirectFBDisplayLayer;
+typedef struct _IDirectFBDataBuffer IDirectFBDataBuffer;
+typedef struct _IDirectFBImageProvider IDirectFBImageProvider;
+
+class CWinBindingEGL;
+
+class CWinSystemDFB : public CWinSystemBase, public CRenderSystemGLES
+{
+public:
+ CWinSystemDFB();
+ virtual ~CWinSystemDFB();
+
+ virtual bool InitWindowSystem();
+ virtual bool DestroyWindowSystem();
+ virtual bool CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction);
+ virtual bool DestroyWindow();
+ virtual bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop);
+ virtual bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays);
+ virtual void UpdateResolutions();
+ virtual bool IsExtSupported(const char* extension);
+
+ virtual void ShowOSMouse(bool show);
+
+ virtual void NotifyAppActiveChange(bool bActivated);
+
+ virtual bool Minimize();
+ virtual bool Restore() ;
+ virtual bool Hide();
+ virtual bool Show(bool raise = true);
+
+ IDirectFB* GetIDirectFB() const;
+ bool CreateImageProvider(IDirectFBDataBuffer *buffer, IDirectFBImageProvider **provider, bool retain1st);
+ bool ReleaseImageProvider(IDirectFBImageProvider *provider);
+
+protected:
+ virtual bool PresentRenderImpl(const CDirtyRegionList &dirty);
+ virtual void SetVSyncImpl(bool enable);
+
+ CWinBindingEGL *m_eglBinding;
+ IDirectFB *m_dfb;
+ IDirectFBScreen *m_dfb_screen;
+ IDirectFBDisplayLayer *m_dfb_layer;
+ IDirectFBSurface *m_dfb_surface;
+ int m_buffermode;
+ IDirectFBImageProvider *m_dfb_image_provider;
+};
+
+XBMC_GLOBAL_REF(CWinSystemDFB,g_Windowing);
+#define g_Windowing XBMC_GLOBAL_USE(CWinSystemDFB)
+
+#endif // WINDOW_SYSTEM_DFB_H
https://github.com/xbmc/xbmc/commit/2a378b3abb2de87e6dffeaddd4c550165ae2342f
commit 2a378b3abb2de87e6dffeaddd4c550165ae2342f
Author: theuni <theuni-nospam-@...>
Date: Fri Sep 30 06:22:51 2011 -0400
[smp] mips: add configure options
diff --git a/configure.in b/configure.in
index e290828..69693ab 100755
--- a/configure.in
+++ b/configure.in
@@ -510,6 +510,12 @@ case $host in
use_arch="arm"
AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL")
;;
+ mips*-linux-gnu)
+ ARCH="mipsel-linux"
+ use_texturepacker_native=yes
+ AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+ ;;
+
*)
AC_MSG_ERROR(unsupported host ($host))
esac
@@ -592,6 +598,8 @@ elif test "$use_arch" = "arm"; then
CXXFLAGS+=" -Wa,-march=armv7a -mcpu=cortex-a8 -mfpu=neon -mvectorize-with-neon-quad"
FFMPEG_EXTRACFLAGS+=" -mfpu=neon"
fi
+elif expr "X$host_cpu" : 'Xmips.*' > /dev/null; then
+ use_arch=mips
fi
# Checks for library functions.
https://github.com/xbmc/xbmc/commit/c961dd2e9679ba41ee901399def3bc00bd2221fd
commit c961dd2e9679ba41ee901399def3bc00bd2221fd
Author: theuni <theuni-nospam-@...>
Date: Fri Sep 30 06:17:00 2011 -0400
[smp] mips: add atomics
Most taken from the linux kernel.
diff --git a/xbmc/threads/Atomics.cpp b/xbmc/threads/Atomics.cpp
index 5b09f18..24c259b 100644
--- a/xbmc/threads/Atomics.cpp
+++ b/xbmc/threads/Atomics.cpp
@@ -20,6 +20,10 @@
*/
#include "Atomics.h"
+#if defined(__mips__)
+#include "MipsAtomics.h"
+pthread_mutex_t cmpxchg_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif
///////////////////////////////////////////////////////////////////////////
// 32-bit atomic compare-and-swap
@@ -69,7 +73,10 @@ long cas(volatile long* pAddr, long expectedVal, long swapVal)
}
#elif defined(__mips__)
-// TODO:
+long cas(volatile long* pAddr,long expectedVal, long swapVal)
+{
+ return cmpxchg32(pAddr, expectedVal, swapVal);
+}
#elif defined(WIN32)
@@ -115,10 +122,16 @@ long cas(volatile long* pAddr,long expectedVal, long swapVal)
// 64-bit atomic compare-and-swap
// Returns previous value of *pAddr
///////////////////////////////////////////////////////////////////////////
-#if defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || defined(__mips__) // PowerPC, ARM, and MIPS
+#if defined(__ppc__) || defined(__powerpc__) || defined(__arm__)// PowerPC and ARM
// Not available/required
+#elif defined(__mips__)
+long long cas2(volatile long long* pAddr, long long expectedVal, long long swapVal)
+{
+ return cmpxchg64(pAddr, expectedVal, swapVal);
+}
+
#elif defined(WIN32)
long long cas2(volatile long long* pAddr, long long expectedVal, long long swapVal)
@@ -210,7 +223,12 @@ long AtomicIncrement(volatile long* pAddr)
}
#elif defined(__mips__)
-// TODO:
+
+long AtomicIncrement(volatile long* pAddr)
+{
+ return atomic_add(1, pAddr);
+}
+
#elif defined(WIN32)
@@ -289,7 +307,12 @@ long AtomicAdd(volatile long* pAddr, long amount)
}
#elif defined(__mips__)
-// TODO:
+
+long AtomicAdd(volatile long* pAddr, long amount)
+{
+ return atomic_add(amount, pAddr);
+}
+
#elif defined(WIN32)
@@ -368,7 +391,11 @@ long AtomicDecrement(volatile long* pAddr)
}
#elif defined(__mips__)
-// TODO:
+
+long AtomicDecrement(volatile long* pAddr)
+{
+ return atomic_sub(1, pAddr);
+}
#elif defined(WIN32)
@@ -448,7 +475,11 @@ long AtomicSubtract(volatile long* pAddr, long amount)
}
#elif defined(__mips__)
-// TODO:
+
+long AtomicSubtract(volatile long* pAddr, long amount)
+{
+ return atomic_sub(amount, pAddr);
+}
#elif defined(WIN32)
diff --git a/xbmc/threads/MipsAtomics.h b/xbmc/threads/MipsAtomics.h
new file mode 100644
index 0000000..8ff69b6
--- /dev/null
+++ b/xbmc/threads/MipsAtomics.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2005-2011 Team XBMC
+ * http://www.xbmc.org
+ *
+ * This Program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This Program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XBMC; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * Copyright (C) 2003, 06, 07 by Ralf Baechle (ralf@...)
+ *
+ * Most of this file was borrowed from the linux kernel.
+ */
+
+#ifndef __ATOMIC_MIPS_H_
+#define __ATOMIC_MIPS_H_
+
+#include <inttypes.h>
+#include <pthread.h>
+
+extern pthread_mutex_t cmpxchg_mutex;
+
+static inline long cmpxchg32(volatile long *m, long oldval, long newval)
+{
+ long retval;
+ __asm__ __volatile__( \
+ " .set push \n" \
+ " .set noat \n" \
+ " .set mips3 \n" \
+ "1: ll %0, %2 # __cmpxchg_asm \n" \
+ " bne %0, %z3, 2f \n" \
+ " .set mips0 \n" \
+ " move $1, %z4 \n" \
+ " .set mips3 \n" \
+ " sc $1, %1 \n" \
+ " beqz $1, 3f \n" \
+ "2: \n" \
+ " .subsection 2 \n" \
+ "3: b 1b \n" \
+ " .previous \n" \
+ " .set pop \n" \
+ : "=&r" (retval), "=R" (*m) \
+ : "R" (*m), "Jr" (oldval), "Jr" (newval) \
+ : "memory"); \
+
+ return retval;
+}
+
+
+static inline long long cmpxchg64(volatile long long *ptr,
+ long long oldval, long long newval)
+{
+ long long prev;
+
+ pthread_mutex_lock(&cmpxchg_mutex);
+ prev = *(long long *)ptr;
+ if (prev == oldval)
+ *(long long *)ptr = newval;
+ pthread_mutex_unlock(&cmpxchg_mutex);
+ return prev;
+}
+
+
+static __inline__ long atomic_add(int i, volatile long* v)
+{
+ long temp;
+
+ __asm__ __volatile__(
+ " .set mips3 \n"
+ "1: ll %0, %1 # atomic_add \n"
+ " addu %0, %2 \n"
+ " sc %0, %1 \n"
+ " beqz %0, 2f \n"
+ " .subsection 2 \n"
+ "2: b 1b \n"
+ " .previous \n"
+ " .set mips0 \n"
+ : "=&r" (temp), "=m" (*v)
+ : "Ir" (i), "m" (*v));
+
+ return temp;
+}
+
+static __inline__ long atomic_sub(int i, volatile long* v)
+{
+ long temp;
+
+ __asm__ __volatile__(
+ " .set mips3 \n"
+ "1: ll %0, %1 # atomic_sub \n"
+ " subu %0, %2 \n"
+ " sc %0, %1 \n"
+ " beqz %0, 2f \n"
+ " .subsection 2 \n"
+ "2: b 1b \n"
+ " .previous \n"
+ " .set mips0 \n"
+ : "=&r" (temp), "=m" (*v)
+ : "Ir" (i), "m" (*v));
+
+ return temp;
+}
+
+
+#endif
https://github.com/xbmc/xbmc/commit/c608af0e54798b9436e7174125217313e1df9830
commit c608af0e54798b9436e7174125217313e1df9830
Author: theuni <theuni-nospam-@...>
Date: Fri Sep 30 06:16:18 2011 -0400
[smp] mips: add guards
diff --git a/Makefile.in b/Makefile.in
index 8ce6b37..ba0f50a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -433,7 +433,7 @@ ifeq (@USE_ASAP_CODEC@...)
endif
endif
$(MAKE) -C lib/stsound/StSoundLibrary
-ifeq ($(or $(findstring powerpc,@ARCH@... x86_64-linux,@ARCH@... arm, @ARCH@)),)
+ifeq ($(or $(findstring powerpc,@ARCH@... x86_64-linux,@ARCH@... arm, @ARCH@... mips,@ARCH@)),)
$(MAKE) -C lib/snesapu/SNES/SNESAPU
endif
imagelib: dllloader
diff --git a/xbmc/cores/DllLoader/DllLoader.h b/xbmc/cores/DllLoader/DllLoader.h
index c74d58a..0081072 100644
--- a/xbmc/cores/DllLoader/DllLoader.h
+++ b/xbmc/cores/DllLoader/DllLoader.h
@@ -24,7 +24,7 @@
#include "coffldr.h"
#include "LibraryLoader.h"
-#if defined(__linux__) && !defined(__powerpc__) && !defined(__arm__)
+#if defined(__linux__) && !defined(__powerpc__) && !defined(__arm__) && !defined(__mips__)
#define USE_LDT_KEEPER
#include "ldt_keeper.h"
#endif
diff --git a/xbmc/cores/DllLoader/ldt_keeper.c b/xbmc/cores/DllLoader/ldt_keeper.c
index 77a0f99..d982afd 100644
--- a/xbmc/cores/DllLoader/ldt_keeper.c
+++ b/xbmc/cores/DllLoader/ldt_keeper.c
@@ -19,7 +19,7 @@
*/
//#ifndef __powerpc__
-#if !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__)
+#if !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__) && !defined(__mips__)
#include "ldt_keeper.h"
diff --git a/xbmc/linux/PlatformDefs.h b/xbmc/linux/PlatformDefs.h
index 8910bbc..97aa929 100644
--- a/xbmc/linux/PlatformDefs.h
+++ b/xbmc/linux/PlatformDefs.h
@@ -155,7 +155,7 @@
#define __int64 long long
#define __uint64 unsigned long long
-#if defined(__x86_64__) || defined(__powerpc__) || defined(__ppc__) || defined (__arm__) // should this be powerpc64 only?
+#if defined(__x86_64__) || defined(__powerpc__) || defined(__ppc__) || defined (__arm__) || defined(__mips__) // should this be powerpc64 only?
#define __stdcall
#else /* !__x86_64__ */
#define __stdcall __attribute__((__stdcall__))
diff --git a/xbmc/utils/MathUtils.h b/xbmc/utils/MathUtils.h
index 47517b5..df767ed 100644
--- a/xbmc/utils/MathUtils.h
+++ b/xbmc/utils/MathUtils.h
@@ -63,7 +63,7 @@ namespace MathUtils
sar i, 1
}
#else
-#if defined(__powerpc__) || defined(__ppc__)
+#if defined(__powerpc__) || defined(__ppc__) || defined(__mips__)
i = floor(x + round_to_nearest);
#elif defined(__arm__)
// From 'ARM®v7-M Architecture Reference Manual' page A7-569:
@@ -128,7 +128,7 @@ namespace MathUtils
assert(x > static_cast<double>(INT_MIN / 2) - 1.0);
assert(x < static_cast <double>(INT_MAX / 2) + 1.0);
-#if !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__)
+#if !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__) && !defined(__mips__)
const float round_towards_m_i = -0.5f;
#endif
int i;
@@ -144,7 +144,7 @@ namespace MathUtils
sar i, 1
}
#else
-#if defined(__powerpc__) || defined(__ppc__)
+#if defined(__powerpc__) || defined(__ppc__) || defined(__mips__)
return (int)x;
#elif defined(__arm__)
__asm__ __volatile__ (
diff --git a/xbmc/utils/fastmemcpy.c b/xbmc/utils/fastmemcpy.c
index 92c581d..656ca15 100644
--- a/xbmc/utils/fastmemcpy.c
+++ b/xbmc/utils/fastmemcpy.c
@@ -21,7 +21,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#if !defined(_WIN32) && !defined(__ppc__) && !defined(__powerpc__) && !defined(__arm__)
+#if !defined(_WIN32) && !defined(__ppc__) && !defined(__powerpc__) && !defined(__arm__) && !defined(__mips__)
#define HAVE_MMX2
#define HAVE_SSE
diff --git a/xbmc/utils/fastmemcpy.h b/xbmc/utils/fastmemcpy.h
index d7dd936..0814749 100644
--- a/xbmc/utils/fastmemcpy.h
+++ b/xbmc/utils/fastmemcpy.h
@@ -22,7 +22,7 @@
extern "C" {
#endif
-#if !defined(_WIN32) && !defined(__ppc__) && !defined(__powerpc__)
+#if !defined(_WIN32) && !defined(__ppc__) && !defined(__powerpc__) && !defined(__mips__)
void * fast_memcpy(void * to, const void * from, size_t len);
//#define fast_memcpy memcpy
#else
-----------------------------------------------------------------------
hooks/post-receive
--
[xbmc/xbmc]
|