aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml45
-rw-r--r--README.md2
-rw-r--r--addons/library.xbmc.pvr/libXBMC_pvr.h34
-rw-r--r--addons/resource.language.en_gb/resources/strings.po38
-rw-r--r--addons/skin.confluence/media/Makefile.in5
-rw-r--r--addons/xbmc.pvr/addon.xml4
-rw-r--r--configure.ac10
-rw-r--r--docs/README.android4
-rw-r--r--docs/README.raspberrypi10
-rw-r--r--lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp16
-rw-r--r--project/BuildDependencies/scripts/0_package.list4
-rw-r--r--project/VS2010Express/XBMC for Windows.sln2
-rw-r--r--project/VS2010Express/XBMC.vcxproj16
-rw-r--r--project/VS2010Express/XBMC.vcxproj.filters2
-rw-r--r--project/cmake/CMakeLists.txt9
-rw-r--r--project/cmake/README.md22
-rw-r--r--project/cmake/modules/FindCpluff.cmake3
-rw-r--r--project/cmake/modules/FindD3DX11Effects.cmake14
-rw-r--r--project/cmake/modules/FindGLEW.cmake18
-rw-r--r--project/cmake/modules/FindJsonSchemaBuilder.cmake2
-rw-r--r--project/cmake/modules/FindMMAL.cmake4
-rw-r--r--project/cmake/modules/FindSquish.cmake19
-rw-r--r--project/cmake/modules/FindTexturePacker.cmake2
-rw-r--r--project/cmake/scripts/common/archsetup.cmake10
-rw-r--r--project/cmake/scripts/darwin/archsetup.cmake4
-rw-r--r--project/cmake/scripts/rbpi/archsetup.cmake4
-rw-r--r--project/cmake/scripts/windows/macros.cmake1
-rw-r--r--project/cmake/treedata/common/externals.txt1
-rw-r--r--project/cmake/treedata/rbpi/subdirs.txt2
-rw-r--r--tools/android/packaging/xbmc/AndroidManifest.xml.in1
-rw-r--r--tools/darwin/Configurations/App.xcconfig.in2
-rw-r--r--tools/darwin/packaging/ios/mkdeb-ios.sh.in2
-rw-r--r--tools/depends/.gitignore1
-rw-r--r--tools/depends/native/Makefile4
-rw-r--r--tools/depends/native/TexturePacker/CMakeLists.txt3
-rw-r--r--tools/depends/native/TexturePacker/Makefile5
-rw-r--r--tools/depends/native/TexturePacker/src/TexturePacker.cpp83
-rw-r--r--tools/depends/native/TexturePacker/src/Win32/TexturePacker.vcxproj8
-rw-r--r--tools/depends/native/TexturePacker/src/configure.ac8
-rw-r--r--tools/depends/native/libsquish-native/CMakeLists.txt36
-rw-r--r--tools/depends/native/libsquish-native/Makefile46
-rw-r--r--tools/depends/native/libsquish-native/src/ChangeLog52
-rw-r--r--tools/depends/native/libsquish-native/src/Doxyfile223
-rw-r--r--tools/depends/native/libsquish-native/src/Makefile33
-rw-r--r--tools/depends/native/libsquish-native/src/Makefile.target34
-rw-r--r--tools/depends/native/libsquish-native/src/README35
-rw-r--r--tools/depends/native/libsquish-native/src/alpha.cpp349
-rw-r--r--tools/depends/native/libsquish-native/src/alpha.h41
-rw-r--r--tools/depends/native/libsquish-native/src/clusterfit.cpp392
-rw-r--r--tools/depends/native/libsquish-native/src/clusterfit.h61
-rw-r--r--tools/depends/native/libsquish-native/src/colourblock.cpp214
-rw-r--r--tools/depends/native/libsquish-native/src/colourblock.h41
-rw-r--r--tools/depends/native/libsquish-native/src/colourfit.cpp54
-rw-r--r--tools/depends/native/libsquish-native/src/colourfit.h55
-rw-r--r--tools/depends/native/libsquish-native/src/colourset.cpp121
-rw-r--r--tools/depends/native/libsquish-native/src/colourset.h58
-rw-r--r--tools/depends/native/libsquish-native/src/config.h59
-rw-r--r--tools/depends/native/libsquish-native/src/config.in21
-rw-r--r--tools/depends/native/libsquish-native/src/extra/squishgen.cpp151
-rw-r--r--tools/depends/native/libsquish-native/src/extra/squishpng.cpp546
-rw-r--r--tools/depends/native/libsquish-native/src/extra/squishtest.cpp206
-rw-r--r--tools/depends/native/libsquish-native/src/maths.cpp259
-rw-r--r--tools/depends/native/libsquish-native/src/maths.h233
-rw-r--r--tools/depends/native/libsquish-native/src/rangefit.cpp201
-rw-r--r--tools/depends/native/libsquish-native/src/rangefit.h54
-rw-r--r--tools/depends/native/libsquish-native/src/simd.h40
-rw-r--r--tools/depends/native/libsquish-native/src/simd_float.h183
-rw-r--r--tools/depends/native/libsquish-native/src/simd_sse.h180
-rw-r--r--tools/depends/native/libsquish-native/src/simd_ve.h166
-rw-r--r--tools/depends/native/libsquish-native/src/singlecolourfit.cpp172
-rw-r--r--tools/depends/native/libsquish-native/src/singlecolourfit.h58
-rw-r--r--tools/depends/native/libsquish-native/src/singlecolourlookup.inl1040
-rw-r--r--tools/depends/native/libsquish-native/src/squish-Info.plist20
-rw-r--r--tools/depends/native/libsquish-native/src/squish.cpp360
-rw-r--r--tools/depends/native/libsquish-native/src/squish.h295
-rw-r--r--tools/depends/native/libsquish-native/src/squish.pc.in13
-rw-r--r--tools/depends/native/libsquish-native/src/texture_compression_s3tc.txt508
-rw-r--r--tools/depends/native/libsquish-native/src/vs7/squish.sln39
-rw-r--r--tools/depends/native/libsquish-native/src/vs7/squish/squish_2010.vcxproj107
-rw-r--r--tools/depends/native/libsquish-native/src/vs7/squish/squish_2010.vcxproj.filters98
-rw-r--r--tools/depends/native/libsquish-native/src/vs7/squishpng/squishpng.vcproj140
-rw-r--r--tools/depends/native/libsquish-native/src/vs7/squishtest/squishtest.vcproj138
-rw-r--r--tools/depends/target/Makefile4
-rw-r--r--tools/depends/target/libsquish/Makefile28
-rw-r--r--tools/depends/target/mysql/06-fixsslcheck.patch11
-rw-r--r--tools/depends/target/mysql/Makefile4
-rw-r--r--tools/depends/target/sqlite3/Makefile2
-rw-r--r--xbmc/GUIInfoManager.cpp18
-rw-r--r--xbmc/GUILargeTextureManager.cpp2
-rw-r--r--xbmc/LangInfo.cpp4
-rw-r--r--xbmc/SystemGlobals.cpp4
-rw-r--r--xbmc/TextureCache.cpp16
-rw-r--r--xbmc/TextureCache.h4
-rw-r--r--xbmc/TextureCacheJob.cpp35
-rw-r--r--xbmc/TextureCacheJob.h14
-rw-r--r--xbmc/addons/Addon.cpp24
-rw-r--r--xbmc/addons/Addon.h13
-rw-r--r--xbmc/addons/AddonBuilder.h1
-rw-r--r--xbmc/addons/AddonCallbacks.h5
-rw-r--r--xbmc/addons/AddonCallbacksPVR.cpp151
-rw-r--r--xbmc/addons/AddonCallbacksPVR.h23
-rw-r--r--xbmc/addons/AddonDatabase.cpp182
-rw-r--r--xbmc/addons/AddonDatabase.h8
-rw-r--r--xbmc/addons/AddonDll.h7
-rw-r--r--xbmc/addons/AddonInstaller.cpp3
-rw-r--r--xbmc/addons/AddonManager.cpp91
-rw-r--r--xbmc/addons/AddonManager.h19
-rw-r--r--xbmc/addons/AudioDecoder.cpp6
-rw-r--r--xbmc/addons/AudioDecoder.h1
-rw-r--r--xbmc/addons/AudioEncoder.cpp6
-rw-r--r--xbmc/addons/AudioEncoder.h1
-rw-r--r--xbmc/addons/GUIViewStateAddonBrowser.cpp2
-rw-r--r--xbmc/addons/GUIWindowAddonBrowser.cpp40
-rw-r--r--xbmc/addons/GUIWindowAddonBrowser.h10
-rw-r--r--xbmc/addons/IAddon.h2
-rw-r--r--xbmc/addons/ImageResource.cpp5
-rw-r--r--xbmc/addons/ImageResource.h1
-rw-r--r--xbmc/addons/LanguageResource.cpp5
-rw-r--r--xbmc/addons/LanguageResource.h2
-rw-r--r--xbmc/addons/PluginSource.cpp5
-rw-r--r--xbmc/addons/PluginSource.h1
-rw-r--r--xbmc/addons/Repository.cpp5
-rw-r--r--xbmc/addons/Repository.h2
-rw-r--r--xbmc/addons/Resource.h2
-rw-r--r--xbmc/addons/Scraper.cpp14
-rw-r--r--xbmc/addons/Scraper.h2
-rw-r--r--xbmc/addons/ScreenSaver.cpp8
-rw-r--r--xbmc/addons/ScreenSaver.h1
-rw-r--r--xbmc/addons/Service.cpp5
-rw-r--r--xbmc/addons/Service.h1
-rw-r--r--xbmc/addons/Skin.cpp5
-rw-r--r--xbmc/addons/Skin.h2
-rw-r--r--xbmc/addons/UISoundsResource.cpp5
-rw-r--r--xbmc/addons/UISoundsResource.h1
-rw-r--r--xbmc/addons/Webinterface.cpp5
-rw-r--r--xbmc/addons/Webinterface.h3
-rw-r--r--xbmc/addons/include/xbmc_epg_types.h29
-rw-r--r--xbmc/addons/include/xbmc_pvr_dll.h26
-rw-r--r--xbmc/addons/include/xbmc_pvr_types.h42
-rw-r--r--xbmc/addons/test/TestAddonFactory.cpp16
-rw-r--r--xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp7
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp87
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h1
-rw-r--r--xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp2
-rw-r--r--xbmc/cores/AudioEngine/Sinks/osx/CoreAudioChannelLayout.cpp29
-rw-r--r--xbmc/cores/AudioEngine/Sinks/test/CMakeLists.txt2
-rw-r--r--xbmc/cores/ExternalPlayer/CMakeLists.txt4
-rw-r--r--xbmc/cores/VideoPlayer/DVDAudio.cpp14
-rw-r--r--xbmc/cores/VideoPlayer/DVDAudio.h6
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h3
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp63
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h7
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp8
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.h4
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp14
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp6
-rw-r--r--xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp10
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.h7
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.h6
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp20
-rw-r--r--xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h18
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h7
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpeg.h9
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.h6
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.h2
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.cpp2
-rw-r--r--xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.h21
-rw-r--r--xbmc/cores/VideoPlayer/Interfaces/IVPClockCallback.h27
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayer.cpp11
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayerSubtitle.cpp4
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp10
-rw-r--r--xbmc/cores/VideoPlayer/VideoPlayerVideo.h7
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt2
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt3
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp113
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp3
-rw-r--r--xbmc/dbwrappers/dataset.cpp6
-rw-r--r--xbmc/dialogs/CMakeLists.txt4
-rw-r--r--xbmc/dialogs/GUIDialogBoxBase.cpp5
-rw-r--r--xbmc/dialogs/GUIDialogGamepad.cpp4
-rw-r--r--xbmc/dialogs/GUIDialogOK.cpp8
-rw-r--r--xbmc/dialogs/GUIDialogProgress.cpp8
-rw-r--r--xbmc/dialogs/GUIDialogSelect.cpp1
-rw-r--r--xbmc/dialogs/GUIDialogYesNo.cpp8
-rw-r--r--xbmc/epg/Epg.cpp130
-rw-r--r--xbmc/epg/Epg.h35
-rw-r--r--xbmc/epg/EpgContainer.cpp84
-rw-r--r--xbmc/epg/EpgContainer.h14
-rw-r--r--xbmc/epg/EpgDatabase.cpp2
-rw-r--r--xbmc/epg/EpgInfoTag.cpp11
-rw-r--r--xbmc/epg/EpgInfoTag.h22
-rw-r--r--xbmc/epg/GUIEPGGridContainer.cpp295
-rw-r--r--xbmc/epg/GUIEPGGridContainer.h8
-rw-r--r--xbmc/filesystem/AddonsDirectory.cpp15
-rw-r--r--xbmc/filesystem/ImageFile.cpp6
-rw-r--r--xbmc/filesystem/SpecialProtocol.cpp2
-rw-r--r--xbmc/guiinfo/GUIInfoLabels.h4
-rw-r--r--xbmc/guilib/DDSImage.cpp101
-rw-r--r--xbmc/guilib/DDSImage.h34
-rw-r--r--xbmc/guilib/Texture.cpp41
-rw-r--r--xbmc/guilib/TextureBundleXBT.cpp5
-rw-r--r--xbmc/input/CMakeLists.txt4
-rw-r--r--xbmc/interfaces/builtins/AddonBuiltins.cpp2
-rw-r--r--xbmc/interfaces/builtins/CMakeLists.txt4
-rw-r--r--xbmc/interfaces/json-rpc/AddonsOperations.cpp2
-rw-r--r--xbmc/interfaces/json-rpc/AudioLibrary.cpp16
-rw-r--r--xbmc/interfaces/json-rpc/FileItemHandler.cpp2
-rw-r--r--xbmc/interfaces/json-rpc/schema/version.txt2
-rw-r--r--xbmc/interfaces/legacy/Addon.cpp4
-rw-r--r--xbmc/interfaces/legacy/CMakeLists.txt4
-rw-r--r--xbmc/listproviders/DirectoryProvider.cpp1
-rw-r--r--xbmc/music/CMakeLists.txt4
-rw-r--r--xbmc/music/MusicDatabase.cpp70
-rw-r--r--xbmc/music/MusicDatabase.h2
-rw-r--r--xbmc/music/dialogs/GUIDialogMusicInfo.cpp38
-rw-r--r--xbmc/music/dialogs/GUIDialogMusicInfo.h18
-rw-r--r--xbmc/music/tags/TagLoaderTagLib.cpp2
-rw-r--r--xbmc/music/windows/GUIWindowMusicNav.cpp2
-rw-r--r--xbmc/peripherals/Peripherals.cpp12
-rw-r--r--xbmc/peripherals/bus/linux/CMakeLists.txt9
-rw-r--r--xbmc/platform/android/activity/AndroidFeatures.cpp11
-rw-r--r--xbmc/platform/android/activity/AndroidFeatures.h3
-rw-r--r--xbmc/platform/android/jni/AudioFormat.cpp13
-rw-r--r--xbmc/platform/darwin/ios-common/AnnounceReceiver.mm2
-rw-r--r--xbmc/powermanagement/CMakeLists.txt4
-rw-r--r--xbmc/programs/GUIWindowPrograms.cpp18
-rw-r--r--xbmc/programs/GUIWindowPrograms.h1
-rw-r--r--xbmc/pvr/CMakeLists.txt4
-rw-r--r--xbmc/pvr/PVRGUIInfo.cpp24
-rw-r--r--xbmc/pvr/PVRGUIInfo.h3
-rw-r--r--xbmc/pvr/PVRManager.cpp38
-rw-r--r--xbmc/pvr/PVRManager.h3
-rw-r--r--xbmc/pvr/addons/PVRClient.cpp58
-rw-r--r--xbmc/pvr/addons/PVRClient.h31
-rw-r--r--xbmc/pvr/addons/PVRClients.cpp20
-rw-r--r--xbmc/pvr/addons/PVRClients.h9
-rw-r--r--xbmc/pvr/channels/PVRChannel.h2
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp8
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.h4
-rw-r--r--xbmc/pvr/recordings/PVRRecording.cpp42
-rw-r--r--xbmc/pvr/recordings/PVRRecording.h14
-rw-r--r--xbmc/pvr/recordings/PVRRecordings.cpp27
-rw-r--r--xbmc/pvr/recordings/PVRRecordingsPath.cpp99
-rw-r--r--xbmc/pvr/recordings/PVRRecordingsPath.h2
-rw-r--r--xbmc/pvr/timers/PVRTimerInfoTag.cpp83
-rw-r--r--xbmc/pvr/timers/PVRTimerInfoTag.h14
-rw-r--r--xbmc/pvr/timers/PVRTimers.cpp43
-rw-r--r--xbmc/pvr/timers/PVRTimers.h1
-rw-r--r--xbmc/settings/AdvancedSettings.cpp4
-rw-r--r--xbmc/settings/AdvancedSettings.h1
-rw-r--r--xbmc/settings/Settings.cpp1
-rw-r--r--xbmc/test/xbmc-test.cpp12
-rw-r--r--xbmc/threads/platform/pthreads/ThreadImpl.cpp4
-rw-r--r--xbmc/utils/CPUInfo.cpp8
-rw-r--r--xbmc/utils/LabelFormatter.cpp18
-rw-r--r--xbmc/utils/SortUtils.cpp5
-rw-r--r--xbmc/video/VideoDatabase.cpp7
-rw-r--r--xbmc/video/videosync/CMakeLists.txt2
-rw-r--r--xbmc/video/windows/CMakeLists.txt4
-rw-r--r--xbmc/video/windows/GUIWindowVideoBase.cpp89
266 files changed, 1910 insertions, 8929 deletions
diff --git a/.gitignore b/.gitignore
index 920509c0dd..53b7bd1c68 100644
--- a/.gitignore
+++ b/.gitignore
@@ -338,7 +338,6 @@ lib/cpluff/stamp-h1
#/tools/depends
/tools/depends/native/*/*native/
/tools/depends/native/JsonSchemaBuilder/bin/
-/tools/depends/native/libsquish-native/squish-install/
/tools/depends/native/TexturePacker/bin/
/tools/depends/target/ffmpeg/.ffmpeg-installed
/tools/depends/target/ffmpeg/ffmpeg-*-*.tar.gz
diff --git a/.travis.yml b/.travis.yml
index e1ee30f3ef..233251f78d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,7 +20,8 @@ compiler:
- clang
env:
- - BUILD=Kodi
+ - BUILD=Kodi TOOLS=Autotools
+ - BUILD=Kodi TOOLS=CMake
- ADDONS=adsp
- ADDONS=audiodecoder
- ADDONS=audioencoder
@@ -55,6 +56,7 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" ]]; then
sudo add-apt-repository -y ppa:team-xbmc/xbmc-ppa-build-depends &&
sudo add-apt-repository -y ppa:wsnipex/vaapi &&
+ sudo add-apt-repository -y ppa:george-edison55/cmake-3.x &&
sudo apt-get update -qq;
fi
@@ -67,7 +69,7 @@ install:
# Linux dependencies
#
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" ]]; then
- sudo apt-get install -qq automake autopoint build-essential cmake curl dcadec-dev default-jre gawk gdc
+ sudo apt-get install -qq automake autopoint build-essential cmake curl dcadec-dev default-jre gawk gdb gdc
gettext git-core gperf libasound2-dev libass-dev libbz2-dev libcap-dev libcdio-dev libcrossguid-dev libcurl3
libcurl4-openssl-dev libdbus-1-dev libfontconfig-dev libegl1-mesa-dev libfreetype6-dev libfribidi-dev libgif-dev
libiso9660-dev libjpeg-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmodplug-dev libmysqlclient-dev libnfs-dev
@@ -84,14 +86,28 @@ before_script:
# Linux
#
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" ]]; then
- cd $TRAVIS_BUILD_DIR/ &&
- ./bootstrap;
+ ulimit -c unlimited -S;
+ if [[ "$TOOLS" == "Autotools" ]]; then
+ cd $TRAVIS_BUILD_DIR &&
+ ./bootstrap;
+ elif [[ "$TOOLS" == "CMake" ]]; then
+ mkdir $TRAVIS_BUILD_DIR/build &&
+ cd $TRAVIS_BUILD_DIR/build;
+ fi
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" && "$CXX" == "g++" ]]; then
- ./configure;
+ if [[ "$TOOLS" == "Autotools" ]]; then
+ ./configure --enable-debug;
+ elif [[ "$TOOLS" == "CMake" ]]; then
+ cmake -DCMAKE_BUILD_TYPE=Debug ../project/cmake;
+ fi
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" && "$CXX" == "clang++" ]]; then
- CXXFLAGS="-Qunused-arguments" ./configure;
+ if [[ "$TOOLS" == "Autotools" ]]; then
+ CXXFLAGS="-Qunused-arguments" ./configure;
+ elif [[ "$TOOLS" == "CMake" ]]; then
+ cmake -DCMAKE_CXX_FLAGS="-Qunused-arguments" ../project/cmake;
+ fi
fi
- if [[ "$BUILD" != "Kodi" ]] && [[ "$ADDONS" == "adsp" || "$ADDONS" == "audiodecoder" || "$ADDONS" == "audioencoder" ||
"$ADDONS" == "pvr" || "$ADDONS" == "screensaver" || "$ADDONS" == "visualization" ]]; then
@@ -106,9 +122,14 @@ before_script:
#
script:
- if [[ "$BUILD" == "Kodi" ]]; then
- make -j3 &&
- make testsuite &&
- ./kodi-test;
+ if [[ "$TOOLS" == "Autotools" ]]; then
+ make -j3 &&
+ make testsuite &&
+ ./kodi-test;
+ elif [[ "$TOOLS" == "CMake" ]]; then
+ make -j3 &&
+ make check;
+ fi
fi
- if [[ "$BUILD" != "Kodi" ]] && [[ "$ADDONS" == "adsp" || "$ADDONS" == "audiodecoder" || "$ADDONS" == "audioencoder" ||
"$ADDONS" == "pvr" || "$ADDONS" == "screensaver" || "$ADDONS" == "visualization" ]]; then
@@ -118,6 +139,12 @@ script:
make -j3;
fi
+after_failure:
+ - COREFILE=$(find . -maxdepth 1 -name "core*" | head -n 1)
+ - if [[ -f "$COREFILE" ]]; then
+ gdb -c "$COREFILE" kodi-test -ex "thread apply all bt" -ex "set pagination 0" -batch;
+ fi
+
# Disable annoying emails
#
notifications:
diff --git a/README.md b/README.md
index b7d7427c32..3997e357e2 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
[![Build Status](https://travis-ci.org/xbmc/xbmc.svg?branch=master)](https://travis-ci.org/xbmc/xbmc)
![Kodi logo](https://raw.githubusercontent.com/xbmc/xbmc-forum/master/xbmc/images/logo-sbs-black.png)
-# Kodi Home Theatre Software
+# Kodi Home Theater Software
**Welcome to Kodi!**
diff --git a/addons/library.xbmc.pvr/libXBMC_pvr.h b/addons/library.xbmc.pvr/libXBMC_pvr.h
index 311651446e..3e3d479654 100644
--- a/addons/library.xbmc.pvr/libXBMC_pvr.h
+++ b/addons/library.xbmc.pvr/libXBMC_pvr.h
@@ -154,6 +154,14 @@ public:
if (PVR_allocate_demux_packet == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
#endif
+ PVR_connection_state_change = (void (*)(void* HANDLE, void* CB, const char *strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage))
+ dlsym(m_libXBMC_pvr, "PVR_connection_state_change");
+ if (PVR_connection_state_change == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
+
+ PVR_epg_event_state_change = (void (*)(void* HANDLE, void* CB, EPG_TAG* tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState))
+ dlsym(m_libXBMC_pvr, "PVR_epg_event_state_change");
+ if (PVR_epg_event_state_change == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; }
+
m_Callbacks = PVR_register_me(m_Handle);
return m_Callbacks != NULL;
}
@@ -300,6 +308,30 @@ public:
}
#endif
+ /*!
+ * @brief Notify a state change for a PVR backend connection
+ * @param strConnectionString The connection string reported by the backend that can be displayed in the UI.
+ * @param newState The new state.
+ * @param strMessage A localized addon-defined string representing the new state, that can be displayed
+ * in the UI or NULL if the Kodi-defined default string for the new state shall be displayed.
+ */
+ void ConnectionStateChange(const char *strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage)
+ {
+ return PVR_connection_state_change(m_Handle, m_Callbacks, strConnectionString, newState, strMessage);
+ }
+
+ /*!
+ * @brief Notify a state change for an EPG event
+ * @param tag The EPG event.
+ * @param iUniqueChannelId The unique id of the channel for the EPG event
+ * @param newState The new state. For EPG_EVENT_CREATED and EPG_EVENT_UPDATED, tag must be filled with all available
+ * event data, not just a delta. For EPG_EVENT_DELETED, it is sufficient to fill EPG_TAG.iUniqueBroadcastId
+ */
+ void EpgEventStateChange(EPG_TAG *tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState)
+ {
+ return PVR_epg_event_state_change(m_Handle, m_Callbacks, tag, iUniqueChannelId, newState);
+ }
+
protected:
void* (*PVR_register_me)(void*);
void (*PVR_unregister_me)(void*, void*);
@@ -320,6 +352,8 @@ protected:
void (*PVR_free_demux_packet)(void*, void*, DemuxPacket*);
DemuxPacket* (*PVR_allocate_demux_packet)(void*, void*, int);
#endif
+ void (*PVR_connection_state_change)(void*, void*, const char*, PVR_CONNECTION_STATE, const char*);
+ void (*PVR_epg_event_state_change)(void*, void*, EPG_TAG*, unsigned int, EPG_EVENT_STATE);
private:
void* m_libXBMC_pvr;
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 9022527e5d..5ba0497642 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -15245,9 +15245,9 @@ msgctxt "#35003"
msgid "Generic disk"
msgstr ""
-#: addons/skin.confluence/720p/DialogPeripheralSettings.xml
+#: xbmc/peripherals/Peripherals.cpp
msgctxt "#35004"
-msgid "There are no settings available\nfor this peripheral."
+msgid "There are no settings available for this peripheral."
msgstr ""
#: xbmc/peripherals/Peripherals.cpp
@@ -15289,7 +15289,33 @@ msgctxt "#35102"
msgid "Disable joystick when this device is present"
msgstr ""
-#empty strings from id 35103 to 35999
+#empty strings from id 35103 to 35504
+
+#. connection state "host unreachable"
+#: xbmc/addons/AddonCallbacksPVR.cpp
+msgctxt "#35505"
+msgid "Server is unreachable."
+msgstr ""
+
+#. connection state "server type mismatch" (reachable, but maybe an HTTP server where an FTP server is expected)
+#: xbmc/addons/AddonCallbacksPVR.cpp
+msgctxt "#35506"
+msgid "Server does not respond properly."
+msgstr ""
+
+#. connection state "client - server version mismatch (reachable, but maybe server version to low)"
+#: xbmc/addons/AddonCallbacksPVR.cpp
+msgctxt "#35507"
+msgid "Server version is not compatible."
+msgstr ""
+
+#. connection state "access denied" (e.g. due to wrong credentials)
+#: xbmc/addons/AddonCallbacksPVR.cpp
+msgctxt "#35508"
+msgid "Access denied."
+msgstr ""
+
+#empty strings from id 35509 to 35999
#: xbmc/peripherals/devices/PeripheralCecAdapter.cpp
msgctxt "#36000"
@@ -15436,6 +15462,7 @@ msgid "When the TV is switched off"
msgstr ""
#: xbmc/addons/addonstatushandler.cpp
+#: xbmc/addons/AddonCallbacksPVR.cpp
#: xbmc/peripherals/devices/PeripheralCecAdapter.cpp
msgctxt "#36030"
msgid "Connection lost"
@@ -15456,7 +15483,10 @@ msgctxt "#36033"
msgid "Action when switching to another source"
msgstr ""
-#empty string with id 36034
+#: xbmc/addons/AddonCallbacksPVR.cpp
+msgctxt "#36034"
+msgid "Connection established"
+msgstr ""
#. adjust refreshrate
#: system/settings/settings.xml
diff --git a/addons/skin.confluence/media/Makefile.in b/addons/skin.confluence/media/Makefile.in
index a4a6312cbd..0589d4b6aa 100644
--- a/addons/skin.confluence/media/Makefile.in
+++ b/addons/skin.confluence/media/Makefile.in
@@ -9,13 +9,8 @@ all: $(TARGET)
.PHONY: force
$(TARGET): $(IMAGES)
-ifeq (@ARCH@,arm)
- @TEXTUREPACKER@ -dupecheck -use_none -input . -output $(TARGET)
-else
@TEXTUREPACKER@ -dupecheck -input . -output $(TARGET)
-endif
-
clean:
rm -f $(TARGET)
distclean: clean
diff --git a/addons/xbmc.pvr/addon.xml b/addons/xbmc.pvr/addon.xml
index eef8d3d4ad..976b5680fd 100644
--- a/addons/xbmc.pvr/addon.xml
+++ b/addons/xbmc.pvr/addon.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="xbmc.pvr" version="4.2.0" provider-name="Team Kodi">
- <backwards-compatibility abi="4.2.0"/>
+<addon id="xbmc.pvr" version="5.0.0" provider-name="Team-Kodi">
+ <backwards-compatibility abi="5.0.0"/>
<requires>
<import addon="xbmc.core" version="0.1.0"/>
</requires>
diff --git a/configure.ac b/configure.ac
index c2170297d5..9a22b6c01a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1962,16 +1962,6 @@ else
final_message="$final_message\n Bluray:\tNo"
fi
-# we don't compile with default upstream squish, so we use our own one
-# even on non unified deps platforms
-if test "$cross_compiling" != "yes"; then
- make -C ${abs_top_srcdir}/tools/depends/native/libsquish-native CXX=${CXX}
- export PKG_CONFIG_PATH="${abs_top_srcdir}/tools/depends/native/libsquish-native/squish-install/lib/pkgconfig:$PKG_CONFIG_PATH"
-fi
-PKG_CHECK_MODULES([SQUISH], [squish],
- [INCLUDES="$INCLUDES $SQUISH_CFLAGS" LIBS="$LIBS $SQUISH_LIBS"],
- AC_MSG_ERROR("squish not found"))
-
if test "x$use_texturepacker" != "xno"; then
AC_PATH_PROG([TEXTUREPACKER], [TexturePacker], ["none"],
[$PATH$PATH_SEPARATOR${abs_top_srcdir}/tools/depends/native/TexturePacker/bin])
diff --git a/docs/README.android b/docs/README.android
index 752ecd7924..a1cd0626f1 100644
--- a/docs/README.android
+++ b/docs/README.android
@@ -17,9 +17,9 @@ We currently recommend Ubuntu "Trusty Tahr" (14.04) 64Bit. This is what our cont
integration system "jenkins" is using.
Additionally, building from OSX Snow Leopard or Mavericks (others on your own risk ;) ) is working (see 3.1).
-NOTE TO NEW USERS: All lines that are prefixed with the '#'
+NOTE TO NEW USERS: All lines that are prefixed with the '$'
character are commands that need to be typed into a terminal window /
-console (similar to the command prompt for Windows). Note that the '#'
+console (similar to the command prompt for Windows). Note that the '$'
character itself should NOT be typed as part of the command.
-----------------------------------------------------------------------------
diff --git a/docs/README.raspberrypi b/docs/README.raspberrypi
index 3e9b943f57..353dc2236c 100644
--- a/docs/README.raspberrypi
+++ b/docs/README.raspberrypi
@@ -17,7 +17,11 @@ image which includes Linux.
-----------------------------------------------------------------------------
The following steps were tested with Ubuntu 14.04 x64. (Note that building on
-a 32 bit machine requires slightly different setting)
+a 32 bit machine requires slightly different setting).
+
+The following commands build for newer Rapberry Pi 2 generation. In order to
+build for the first Raspberry Pi, the commands have to be adapted to use
+`--with-platform=raspberry-pi` instead of `--with-platform=raspberry-pi2`.
$ sudo apt-get install git autoconf curl g++ zlib1g-dev libcurl4-openssl-dev gawk gperf libtool autopoint swig default-jre
@@ -40,13 +44,13 @@ a 32 bit machine requires slightly different setting)
--prefix=/opt/xbmc-bcm/xbmc-dbg \
--with-toolchain=/usr/local/bcm-gcc/arm-bcm2708hardfp-linux-gnueabi/sysroot \
--with-firmware=/opt/bcm-rootfs \
- --with-platform=raspberry-pi \
+ --with-platform=raspberry-pi2 \
--build=i686-linux
$ make
$ cd ../..
- CONFIG_EXTRA="--with-platform=raspberry-pi \
+ CONFIG_EXTRA="--with-platform=raspberry-pi2 \
--enable-libcec --enable-player=omxplayer \
--disable-x11 --disable-xrandr --disable-openmax \
--disable-optical-drive --disable-dvdcss --disable-joystick \
diff --git a/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp b/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp
index b16a540a1c..2858693e30 100644
--- a/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp
+++ b/lib/addons/library.xbmc.pvr/libXBMC_pvr.cpp
@@ -164,6 +164,22 @@ DLLEXPORT DemuxPacket* PVR_allocate_demux_packet(void *hdl, void* cb, int iDataS
return ((CB_PVRLib*)cb)->AllocateDemuxPacket(((AddonCB*)hdl)->addonData, iDataSize);
}
+DLLEXPORT void PVR_connection_state_change(void *hdl, void* cb, const char *strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage)
+{
+ if (cb == NULL)
+ return;
+
+ ((CB_PVRLib*)cb)->ConnectionStateChange(((AddonCB*)hdl)->addonData, strConnectionString, newState, strMessage);
+}
+
+DLLEXPORT void PVR_epg_event_state_change(void *hdl, void* cb, EPG_TAG *tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState)
+{
+ if (cb == NULL)
+ return;
+
+ ((CB_PVRLib*)cb)->EpgEventStateChange(((AddonCB*)hdl)->addonData, tag, iUniqueChannelId, newState);
+}
+
DLLEXPORT void PVR_transfer_channel_group(void *hdl, void* cb, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group)
{
if (cb == NULL)
diff --git a/project/BuildDependencies/scripts/0_package.list b/project/BuildDependencies/scripts/0_package.list
index 032e261a56..eeb086bf85 100644
--- a/project/BuildDependencies/scripts/0_package.list
+++ b/project/BuildDependencies/scripts/0_package.list
@@ -45,8 +45,8 @@ mysqlclient-6.1.3-win32-vc120.7z
pcre-8.34-win32-vc120.7z
PIL-1.1.7p-win32.7z
python-2.7.10-win32.7z
-sqlite-3.9.2-win32-vc120.7z
+sqlite-3.10.2-win32-vc140.7z
swig-2.0.7-win32-1.7z
taglib-1.10-win32-vc120.7z
-texturepacker-1.0.6-win32.7z
+texturepacker-1.1.0-win32.7z
tinyxml-2.6.2_3-win32-vc120.7z
diff --git a/project/VS2010Express/XBMC for Windows.sln b/project/VS2010Express/XBMC for Windows.sln
index a2e5df19b6..80965bc43f 100644
--- a/project/VS2010Express/XBMC for Windows.sln
+++ b/project/VS2010Express/XBMC for Windows.sln
@@ -14,8 +14,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnrarXLib", "UnrarXLib.vcxp
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libexif_dll", "..\..\lib\libexif\libexif.vcxproj", "{AD20A3E2-09CB-42DB-9A70-27F7CDC886CE}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "squish", "..\..\tools\depends\native\libsquish-native\src\vs7\squish\squish_2010.vcxproj", "{6A8518C3-D81A-4428-BD7F-C37933088AC1}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpluff", "..\..\lib\cpluff\libcpluff\win32\cpluff.vcxproj", "{88968763-3D6B-48A8-B495-CC8C187FAC02}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libXBMC_addon", "..\..\lib\addons\library.xbmc.addon\project\VS2010Express\libXBMC_addon.vcxproj", "{2DCEA60B-4EBC-4DB7-9FBD-297C1EFD95D7}"
diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj
index 0b46cf002d..e0c206faf2 100644
--- a/project/VS2010Express/XBMC.vcxproj
+++ b/project/VS2010Express/XBMC.vcxproj
@@ -75,7 +75,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
- <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\cores\VideoPlayer;..\..\xbmc\win32;..\..\lib;..\..\lib\win32\ffmpeg;..\..\lib\libUPnP;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Platinum\Source\Extras;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\pcre;..\..\lib\win32\Effects11\inc;..\..\lib\win32;..\..\xbmc\cores\AudioEngine\;..\..\addons\library.kodi.guilib;..\..\addons\library.xbmc.addon;..\..\addons\library.xbmc.pvr;..\..\addons\library.xbmc.codec;shaders;..\..\tools\depends\native\libsquish-native\src;%(AdditionalIncludeDirectories);XBMC\$(Configuration);..\..\addons\library.xbmc.adsp</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\cores\VideoPlayer;..\..\xbmc\win32;..\..\lib;..\..\lib\win32\ffmpeg;..\..\lib\libUPnP;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Platinum\Source\Extras;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\pcre;..\..\lib\win32\Effects11\inc;..\..\lib\win32;..\..\xbmc\cores\AudioEngine\;..\..\addons\library.kodi.guilib;..\..\addons\library.xbmc.addon;..\..\addons\library.xbmc.pvr;..\..\addons\library.xbmc.codec;shaders;%(AdditionalIncludeDirectories);XBMC\$(Configuration);..\..\addons\library.xbmc.adsp</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NOMINMAX;_USE_32BIT_TIME_T;HAS_DX;D3D_DEBUG_INFO;__STDC_CONSTANT_MACROS;_SECURE_SCL=0;TAGLIB_STATIC;NPT_CONFIG_ENABLE_LOGGING;PLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi";PLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -111,7 +111,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Testsuite|Win32'">
<ClCompile>
- <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\cores\VideoPlayer;..\..\xbmc\win32;..\..\lib;..\..\lib\win32\ffmpeg;..\..\lib\libUPnP;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Platinum\Source\Extras;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\pcre;..\..\lib\win32\Effects11\inc;..\..\lib\win32;..\..\xbmc\cores\AudioEngine\;..\..\addons\library.kodi.guilib;..\..\addons\library.xbmc.addon;..\..\addons\library.xbmc.pvr;..\..\addons\library.xbmc.codec;shaders;..\..\lib\gtest\include;..\..\tools\depends\native\libsquish-native\src;%(AdditionalIncludeDirectories);XBMC\$(Configuration);..\..\addons\library.xbmc.adsp</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\cores\VideoPlayer;..\..\xbmc\win32;..\..\lib;..\..\lib\win32\ffmpeg;..\..\lib\libUPnP;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Platinum\Source\Extras;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\pcre;..\..\lib\win32\Effects11\inc;..\..\lib\win32;..\..\xbmc\cores\AudioEngine\;..\..\addons\library.kodi.guilib;..\..\addons\library.xbmc.addon;..\..\addons\library.xbmc.pvr;..\..\addons\library.xbmc.codec;shaders;..\..\lib\gtest\include;%(AdditionalIncludeDirectories);XBMC\$(Configuration);..\..\addons\library.xbmc.adsp</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CONSOLE;NOMINMAX;_USE_32BIT_TIME_T;HAS_DX;D3D_DEBUG_INFO;__STDC_CONSTANT_MACROS;_SECURE_SCL=0;TAGLIB_STATIC;NPT_CONFIG_ENABLE_LOGGING;PLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi";PLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -149,7 +149,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
- <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\cores\VideoPlayer;..\..\xbmc\win32;..\..\lib;..\..\lib\win32\ffmpeg;..\..\lib\libUPnP;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Platinum\Source\Extras;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\pcre;..\..\lib\win32\Effects11\inc;..\..\lib\win32;..\..\xbmc\cores\AudioEngine\;..\..\addons\library.kodi.guilib;..\..\addons\library.xbmc.addon;..\..\addons\library.xbmc.pvr;..\..\addons\library.xbmc.codec;shaders;..\..\tools\depends\native\libsquish-native\src;%(AdditionalIncludeDirectories);XBMC\$(Configuration);..\..\addons\library.xbmc.adsp</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\;..\..\xbmc\;..\..\xbmc\cores\VideoPlayer;..\..\xbmc\win32;..\..\lib;..\..\lib\win32\ffmpeg;..\..\lib\libUPnP;..\..\lib\libUPnP\Platinum\Source\Devices\MediaRenderer;..\..\lib\libUPnP\Platinum\Source\Devices\MediaConnect;..\..\lib\libUPnP\Platinum\Source\Devices\MediaServer;..\..\lib\libUPnP\Platinum\Source\Platinum;..\..\lib\libUPnP\Platinum\Source\Core;..\..\lib\libUPnP\Platinum\Source\Extras;..\..\lib\libUPnP\Neptune\Source\Core;..\..\lib\libUPnP\Neptune\Source\System\Win32;..\..\lib\win32\pcre;..\..\lib\win32\Effects11\inc;..\..\lib\win32;..\..\xbmc\cores\AudioEngine\;..\..\addons\library.kodi.guilib;..\..\addons\library.xbmc.addon;..\..\addons\library.xbmc.pvr;..\..\addons\library.xbmc.codec;shaders;%(AdditionalIncludeDirectories);XBMC\$(Configuration);..\..\addons\library.xbmc.adsp</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NOMINMAX;_USE_32BIT_TIME_T;HAS_DX;__STDC_CONSTANT_MACROS;TAGLIB_STATIC;NPT_CONFIG_ENABLE_LOGGING;PLT_HTTP_DEFAULT_USER_AGENT="UPnP/1.0 DLNADOC/1.50 Kodi";PLT_HTTP_DEFAULT_SERVER="UPnP/1.0 DLNADOC/1.50 Kodi";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -2486,14 +2486,6 @@
<ProjectReference Include="..\..\lib\win32\Effects11\Effects11_2013.vcxproj">
<Project>{df460eab-570d-4b50-9089-2e2fc801bf38}</Project>
</ProjectReference>
- <ProjectReference Include="..\..\tools\depends\native\libsquish-native\src\vs7\squish\squish_2010.vcxproj">
- <Project>{6a8518c3-d81a-4428-bd7f-c37933088ac1}</Project>
- <Private>true</Private>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
- <LinkLibraryDependencies>true</LinkLibraryDependencies>
- <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
- </ProjectReference>
<ProjectReference Include="libPlatinum.vcxproj">
<Project>{b2975495-fbe4-4f94-aac5-b21a9842bf50}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
@@ -3027,4 +3019,4 @@
</VisualStudio>
</ProjectExtensions>
<Import Project="$(SolutionDir)\$(ProjectFileName).targets.user" Condition="Exists('$(SolutionDir)\$(ProjectFileName).targets.user')" />
-</Project> \ No newline at end of file
+</Project>
diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters
index 167b3d33be..88159e66af 100644
--- a/project/VS2010Express/XBMC.vcxproj.filters
+++ b/project/VS2010Express/XBMC.vcxproj.filters
@@ -3261,6 +3261,7 @@
</ClCompile>
<ClCompile Include="..\..\xbmc\threads\test\TestHelpers.h">
<Filter>test\threads</Filter>
+ </ClCompile>
<ClCompile Include="..\..\xbmc\pvr\recordings\PVRRecordingsPath.cpp">
<Filter>pvr\recordings</Filter>
</ClCompile>
@@ -6300,6 +6301,7 @@
</ClInclude>
<ClInclude Include="..\..\xbmc\addons\AddonBuilder.h">
<Filter>addons</Filter>
+ </ClInclude>
<ClInclude Include="..\..\xbmc\pvr\recordings\PVRRecordingsPath.h">
<Filter>pvr\recordings</Filter>
</ClInclude>
diff --git a/project/cmake/CMakeLists.txt b/project/cmake/CMakeLists.txt
index fc2adb6a57..a093468fb8 100644
--- a/project/cmake/CMakeLists.txt
+++ b/project/cmake/CMakeLists.txt
@@ -42,7 +42,6 @@ if(UNIX)
option(ENABLE_EGL "Enable EGL?" OFF)
option(ENABLE_VAAPI "Enable VAAPI support?" ON)
option(ENABLE_VDPAU "Enable VDPAU support?" ON)
- option(ENABLE_MMAL "Enable MMAL support?" OFF)
option(ENABLE_OPTICAL "Enable optical support?" ON)
endif()
# System options
@@ -74,7 +73,6 @@ set(INCLUDES ${CORE_SOURCE_DIR}
${CORE_SOURCE_DIR}/xbmc
${CORE_SOURCE_DIR}/xbmc/${PLATFORM_DIR}
${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer
- ${CORE_SOURCE_DIR}/tools/depends/native/libsquish-native/src
${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR})
find_package(PkgConfig)
@@ -83,7 +81,6 @@ if(CMAKE_CROSSCOMPILING)
message(STATUS "CMAKE_CROSSCOMPILING: ${CMAKE_CROSSCOMPILING}")
set(PKG_CONFIG_FOUND TRUE)
endif()
- core_require_dep(Squish)
endif()
find_package(Threads REQUIRED)
@@ -169,10 +166,8 @@ if(NOT WIN32)
core_optional_dep(OpenGl)
if(OPENGL_FOUND)
if(NOT APPLE)
- core_require_dep(GLEW)
core_optional_dep(Sdl)
else()
- core_optional_dep(GLEW)
core_require_dep(Sdl)
endif()
core_optional_dep(X ENABLE_X11)
@@ -187,7 +182,7 @@ if(NOT WIN32)
endif()
endif()
- if(ENABLE_MMAL)
+ if(CORE_SYSTEM_NAME STREQUAL rbpi)
core_require_dep(MMAL)
endif()
endif()
@@ -285,7 +280,7 @@ configure_file(${CORE_SOURCE_DIR}/xbmc/DllPaths_generated.h.in
add_subdirectory(${CORE_SOURCE_DIR}/xbmc/interfaces/swig build/swig)
# Linker flags
-if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+if(NOT APPLE AND NOT WIN32)
set(LD_WHOLEARCHIVE_BEGIN -Wl,--whole-archive)
set(LD_WHOLEARCHIVE_END -Wl,--no-whole-archive)
endif()
diff --git a/project/cmake/README.md b/project/cmake/README.md
index 6ea7275db3..e0de44de85 100644
--- a/project/cmake/README.md
+++ b/project/cmake/README.md
@@ -26,10 +26,17 @@ automatically.
The dependencies required to build on Linux can be found in
[docs/README.xxx](https://github.com/xbmc/xbmc/tree/master/docs).
+### Raspberry Pi
+
+The cross compilation environment for the Raspberry Pi as well as the
+dependencies have to be installed as explained in
+[docs/README.raspberrypi](https://github.com/xbmc/xbmc/tree/master/docs/README.raspberrypi).
+
### Windows
For Windows the dependencies can be found in the
-[Wiki](http://kodi.wiki/view/HOW-TO:Compile_Kodi_for_Windows) (Step 1-4).
+[Wiki](http://kodi.wiki/view/HOW-TO:Compile_Kodi_for_Windows) (Step 1-4). If not already available on your pc, you should
+install the [Windows Software Development Kit (SDK)](https://dev.windows.com/en-us/downloads/sdk-archive) for your Windows version. This is required for HLSL shader offline compiling with the [Effect-Compiler Tool](https://msdn.microsoft.com/de-de/library/windows/desktop/bb232919(v=vs.85).aspx) (fxc.exe).
On Windows, the CMake based buildsystem requires that the binary dependencies
are downloaded using `DownloadBuildDeps.bat` and `DownloadMingwBuildEnv.bat`
@@ -72,14 +79,21 @@ cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc)
./kodi.bin
```
-`CMAKE_BUILD_TYPE` defaults to `Debug`.
+`CMAKE_BUILD_TYPE` defaults to `Release`.
+
+### Raspberry Pi with GNU Makefiles
+
+```
+cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake <KODI_SRC>/project/cmake/
+cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc)
+```
### Windows with NMake Makefiles
```
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release <KODI_SRC>/project/cmake/
cmake --build . # or: nmake
-./kodi.bin
+kodi.exe
```
### Windows with Visual Studio project files
@@ -87,7 +101,7 @@ cmake --build . # or: nmake
```
cmake -G "Visual Studio 12" <KODI_SRC>/project/cmake/
cmake --build . --config "Debug" # or: Build solution with Visual Studio
-KODI_HOME=%CD% Debug/kodi.bin
+set KODI_HOME="%CD%" && Debug\kodi.exe
```
### OSX with GNU Makefiles
diff --git a/project/cmake/modules/FindCpluff.cmake b/project/cmake/modules/FindCpluff.cmake
index 25f34bdb9d..b8fa22d18e 100644
--- a/project/cmake/modules/FindCpluff.cmake
+++ b/project/cmake/modules/FindCpluff.cmake
@@ -22,7 +22,8 @@ if(NOT WIN32)
--prefix=<INSTALL_DIR>
--host=${ARCH}
CFLAGS=${defines}
- LDFLAGS=${ldflags})
+ LDFLAGS=${ldflags}
+ BUILD_COMMAND make V=1)
set(ldflags "${ldflags};-lexpat")
core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/cpluff/lib/libcpluff.a
system/libcpluff libcpluff extras "${ldflags}")
diff --git a/project/cmake/modules/FindD3DX11Effects.cmake b/project/cmake/modules/FindD3DX11Effects.cmake
index 51687695c5..2b2de852bd 100644
--- a/project/cmake/modules/FindD3DX11Effects.cmake
+++ b/project/cmake/modules/FindD3DX11Effects.cmake
@@ -27,11 +27,23 @@ mark_as_advanced(D3DX11EFFECTS_FOUND)
find_file(D3DCOMPILER_DLL
NAMES d3dcompiler_47.dll d3dcompiler_46.dll
PATHS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]/Redist/D3D/x86"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]/Redist/D3D/x86"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]/Redist/D3D/x86"
- "$ENV{WindowsSdkDir}redist/d3d/x86"
+ "$ENV{WindowsSdkDir}Redist/d3d/x86"
NO_DEFAULT_PATH)
if(NOT D3DCOMPILER_DLL)
message(WARNING "Could NOT find Direct3D Compiler")
endif()
mark_as_advanced(D3DCOMPILER_DLL)
+
+find_program(FXC fxc
+ PATHS
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]/bin/x86"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]/bin/x86"
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]/bin/x86"
+ "$ENV{WindowsSdkDir}bin/x86")
+if(NOT FXC)
+ message(WARNING "Could NOT find DirectX Effects Compiler (FXC)")
+endif()
+mark_as_advanced(FXC)
diff --git a/project/cmake/modules/FindGLEW.cmake b/project/cmake/modules/FindGLEW.cmake
deleted file mode 100644
index 2273429acb..0000000000
--- a/project/cmake/modules/FindGLEW.cmake
+++ /dev/null
@@ -1,18 +0,0 @@
-# - Try to find GLEW
-# Once done this will define
-#
-# GLEW_FOUND - system has libGLEW
-# GLEW_INCLUDE_DIRS - the libGLEW include directory
-# GLEW_LIBRARIES - The libGLEW libraries
-
-if(PKG_CONFIG_FOUND)
- pkg_check_modules (GLEW glew)
-else()
- find_path(GLEW_INCLUDE_DIRS GL/glew.h)
- find_library(GLEW_LIBRARIES GLEW)
-endif()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_INCLUDE_DIRS GLEW_LIBRARIES)
-
-mark_as_advanced(GLEW_INCLUDE_DIRS GLEW_LIBRARIES)
diff --git a/project/cmake/modules/FindJsonSchemaBuilder.cmake b/project/cmake/modules/FindJsonSchemaBuilder.cmake
index f2b4a68967..78e8d0a8ee 100644
--- a/project/cmake/modules/FindJsonSchemaBuilder.cmake
+++ b/project/cmake/modules/FindJsonSchemaBuilder.cmake
@@ -8,7 +8,7 @@
# JsonSchemaBuilder::JsonSchemaBuilder - The JsonSchemaBuilder executable
if(NOT TARGET JsonSchemaBuilder::JsonSchemaBuilder)
- if(CMAKE_CROSS_COMPILING)
+ if(CMAKE_CROSSCOMPILING)
add_executable(JsonSchemaBuilder::JsonSchemaBuilder IMPORTED GLOBAL)
set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES
IMPORTED_LOCATION "${NATIVEPREFIX}/bin/JsonSchemaBuilder")
diff --git a/project/cmake/modules/FindMMAL.cmake b/project/cmake/modules/FindMMAL.cmake
index 5369af36c2..704b1aaf58 100644
--- a/project/cmake/modules/FindMMAL.cmake
+++ b/project/cmake/modules/FindMMAL.cmake
@@ -6,7 +6,7 @@
# MMAL_LIBRARIES - The MMAL libraries
if(PKG_CONFIG_FOUND)
- pkg_check_modules (MMAL mmal)
+ pkg_check_modules(MMAL mmal QUIET)
endif()
if(NOT MMAL_FOUND)
@@ -27,7 +27,7 @@ if(NOT MMAL_FOUND)
endif()
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(MMAL DEFAULT_MSG MMAL_INCLUDE_DIRS MMAL_LIBRARIES)
+find_package_handle_standard_args(MMAL DEFAULT_MSG MMAL_LIBRARIES MMAL_INCLUDE_DIRS)
list(APPEND MMAL_DEFINITIONS -DHAVE_MMAL=1 -DHAS_MMAL=1)
diff --git a/project/cmake/modules/FindSquish.cmake b/project/cmake/modules/FindSquish.cmake
deleted file mode 100644
index b1b1ed0046..0000000000
--- a/project/cmake/modules/FindSquish.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
-# - Try to find SQUISH
-# Once done this will define
-#
-# SQUISH - system has libuuid
-# SQUISH_INCLUDE_DIRS - the libuuid include directory
-# SQUISH_LIBRARIES - The libuuid libraries
-
-find_package(PkgConfig)
-if(PKG_CONFIG_FOUND)
- pkg_check_modules (SQUISH squish)
-else()
- find_path(SQUISH_INCLUDE_DIRS squish.h)
- find_library(SQUISH_LIBRARIES squish)
-endif()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(SQUISH DEFAULT_MSG SQUISH_INCLUDE_DIRS SQUISH_LIBRARIES)
-
-mark_as_advanced(SQUISH_INCLUDE_DIRS SQUISH_LIBRARIES)
diff --git a/project/cmake/modules/FindTexturePacker.cmake b/project/cmake/modules/FindTexturePacker.cmake
index 54684f1185..2229ff79de 100644
--- a/project/cmake/modules/FindTexturePacker.cmake
+++ b/project/cmake/modules/FindTexturePacker.cmake
@@ -8,7 +8,7 @@
# TexturePacker::TexturePacker - The TexturePacker executable
if(NOT TARGET TexturePacker::TexturePacker)
- if(CMAKE_CROSS_COMPILING)
+ if(CMAKE_CROSSCOMPILING)
add_executable(TexturePacker::TexturePacker IMPORTED GLOBAL)
set_target_properties(TexturePacker::TexturePacker PROPERTIES
IMPORTED_LOCATION "${NATIVEPREFIX}/bin/TexturePacker")
diff --git a/project/cmake/scripts/common/archsetup.cmake b/project/cmake/scripts/common/archsetup.cmake
index 64577fa14b..26777f3e19 100644
--- a/project/cmake/scripts/common/archsetup.cmake
+++ b/project/cmake/scripts/common/archsetup.cmake
@@ -59,10 +59,18 @@ endif()
if(WITH_CPU)
set(CPU ${WITH_CPU})
-else()
+elseif(NOT CMAKE_TOOLCHAIN_FILE)
set(CPU ${CMAKE_SYSTEM_PROCESSOR})
endif()
+if(CMAKE_TOOLCHAIN_FILE)
+ if(NOT EXISTS "${CMAKE_TOOLCHAIN_FILE}")
+ message(FATAL_ERROR "Toolchain file ${CMAKE_TOOLCHAIN_FILE} does not exist.")
+ elseif(NOT DEPENDS_PATH OR NOT NATIVEPREFIX)
+ message(FATAL_ERROR "Toolchain did not define DEPENDS_PATH or NATIVEPREFIX. Possibly outdated depends.")
+ endif()
+endif()
+
# system specific arch setup
include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/archsetup.cmake)
diff --git a/project/cmake/scripts/darwin/archsetup.cmake b/project/cmake/scripts/darwin/archsetup.cmake
index da2fd940fd..2149f79cbd 100644
--- a/project/cmake/scripts/darwin/archsetup.cmake
+++ b/project/cmake/scripts/darwin/archsetup.cmake
@@ -2,10 +2,6 @@ if(NOT CMAKE_TOOLCHAIN_FILE)
message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for darwin. See ${PROJECT_SOURCE_DIR}/README.md")
endif()
-if(NOT DEPENDS_PATH OR NOT NATIVEPREFIX)
- message(FATAL_ERROR "Toolchain did not define DEPENDS_PATH or NATIVEPREFIX. Possibly outdated depends.")
-endif()
-
set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN)
if(CORE_SYSTEM_NAME STREQUAL "darwin")
list(APPEND ARCH_DEFINES -DTARGET_DARWIN_OSX)
diff --git a/project/cmake/scripts/rbpi/archsetup.cmake b/project/cmake/scripts/rbpi/archsetup.cmake
index c0e0a6b0f0..ac52a9bb8d 100644
--- a/project/cmake/scripts/rbpi/archsetup.cmake
+++ b/project/cmake/scripts/rbpi/archsetup.cmake
@@ -1,3 +1,7 @@
+if(NOT CMAKE_TOOLCHAIN_FILE)
+ message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for rbpi. See ${PROJECT_SOURCE_DIR}/README.md")
+endif()
+
set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_ARMEL -DTARGET_RASPBERRY_PI
-DHAS_EGL -DHAS_EGLGLES -DHAS_OMXPLAYER -DHAVE_OMXLIB)
set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED
diff --git a/project/cmake/scripts/windows/macros.cmake b/project/cmake/scripts/windows/macros.cmake
index f02693288d..6aabf7d5a8 100644
--- a/project/cmake/scripts/windows/macros.cmake
+++ b/project/cmake/scripts/windows/macros.cmake
@@ -108,7 +108,6 @@ endfunction()
# entrypoint Shader entry point
# On return:
# FXC_FILE is set to the name of the generated header file.
-find_program(FXC fxc)
function(add_shader_dx target hlsl profile entrypoint)
get_filename_component(file ${hlsl} NAME_WE)
add_custom_command(OUTPUT ${file}.h
diff --git a/project/cmake/treedata/common/externals.txt b/project/cmake/treedata/common/externals.txt
index 02e0640c55..632b3546c8 100644
--- a/project/cmake/treedata/common/externals.txt
+++ b/project/cmake/treedata/common/externals.txt
@@ -1,4 +1,3 @@
xbmc/contrib/kissfft kissfft
-tools/depends/native/libsquish-native squish
lib/libUPnP upnp
lib/libexif exif
diff --git a/project/cmake/treedata/rbpi/subdirs.txt b/project/cmake/treedata/rbpi/subdirs.txt
index 3245ae34ed..866ec00a6b 100644
--- a/project/cmake/treedata/rbpi/subdirs.txt
+++ b/project/cmake/treedata/rbpi/subdirs.txt
@@ -8,5 +8,5 @@ xbmc/powermanagement/linux powermanagement/linux
xbmc/storage/linux storage/linux
xbmc/filesystem/posix filesystem/posix
xbmc/utils/posix utils_posix
-xbmc/main/posix main_posix
+xbmc/platform/posix posix
xbmc/windowing/egl windowing/egl # EGL
diff --git a/tools/android/packaging/xbmc/AndroidManifest.xml.in b/tools/android/packaging/xbmc/AndroidManifest.xml.in
index 5d276bdd33..82cf82c150 100644
--- a/tools/android/packaging/xbmc/AndroidManifest.xml.in
+++ b/tools/android/packaging/xbmc/AndroidManifest.xml.in
@@ -12,6 +12,7 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.BLUETOOTH" />
+ <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
<uses-feature android:name="android.hardware.screen.landscape" android:required="true" />
diff --git a/tools/darwin/Configurations/App.xcconfig.in b/tools/darwin/Configurations/App.xcconfig.in
index 61b56a19fa..1a15305a74 100644
--- a/tools/darwin/Configurations/App.xcconfig.in
+++ b/tools/darwin/Configurations/App.xcconfig.in
@@ -25,7 +25,7 @@ HEADER_SEARCH_PATHS = $(inherited) $SRCROOT xbmc xbmc/linux xbmc/cores/VideoPlay
LIBRARY_SEARCH_PATHS = $(inherited) $(SRCROOT) $(SRCROOT)/xbmc/interfaces/json-rpc "$(SRCROOT)/xbmc/interfaces/python" "$(SRCROOT)/xbmc/interfaces/legacy"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SDKROOT)/System/Library/PrivateFrameworks/" "$(SDKROOT)/System/Library/Frameworks/"
-XBMC_OTHER_LDFLAGS_COMMON = $(inherited) -Wl,-headerpad_max_install_names -Wl,-all_load -L$XBMC_DEPENDS/lib -lbz2 -lintl -lexpat -lssl -lgpg-error -lresolv -lffi -lssh -llzo2 -lpcre -lpcrecpp -lfribidi -lfreetype -lfontconfig -lsqlite3 -ltinyxml -lmicrohttpd -lsmbclient -lpython2.7 -lyajl -lcrypto -lgcrypt -lavdevice -lavfilter -lavcodec -lavformat -lpostproc -lavutil -ldcadec -lswresample -lswscale -ltag -L$XBMC_DEPENDS/lib/mysql -lmysqlclient -lxml2 -lxslt -lnettle -lgmp -lhogweed -lgnutls -lsquish -lcrossguid -lz -lm -liconv
+XBMC_OTHER_LDFLAGS_COMMON = $(inherited) -Wl,-headerpad_max_install_names -Wl,-all_load -L$XBMC_DEPENDS/lib -lbz2 -lintl -lexpat -lssl -lgpg-error -lresolv -lffi -lssh -llzo2 -lpcre -lpcrecpp -lfribidi -lfreetype -lfontconfig -lsqlite3 -ltinyxml -lmicrohttpd -lsmbclient -lpython2.7 -lyajl -lcrypto -lgcrypt -lavdevice -lavfilter -lavcodec -lavformat -lpostproc -lavutil -ldcadec -lswresample -lswscale -ltag -L$XBMC_DEPENDS/lib/mysql -lmysqlclient -lxml2 -lxslt -lnettle -lgmp -lhogweed -lgnutls -lcrossguid -lz -lm -liconv
CLANG_CXX_LANGUAGE_STANDARD = c++0x
CLANG_CXX_LIBRARY = libc++
diff --git a/tools/darwin/packaging/ios/mkdeb-ios.sh.in b/tools/darwin/packaging/ios/mkdeb-ios.sh.in
index 45931cc037..341b2aab0a 100644
--- a/tools/darwin/packaging/ios/mkdeb-ios.sh.in
+++ b/tools/darwin/packaging/ios/mkdeb-ios.sh.in
@@ -77,7 +77,7 @@ ${SUDO} rm -rf $DIRNAME/$ARCHIVE
# create debian control file.
mkdir -p $DIRNAME/$PACKAGE/DEBIAN
-if [ $ARM64 ]; then
+if $ARM64; then
echo "Package: $PACKAGE_ARM64" > $DIRNAME/$PACKAGE/DEBIAN/control
echo "Name: @APP_NAME@-iOS (64-bit)" >> $DIRNAME/$PACKAGE/DEBIAN/control
echo "Depends: firmware (>= 7.0)" >> $DIRNAME/$PACKAGE/DEBIAN/control
diff --git a/tools/depends/.gitignore b/tools/depends/.gitignore
index d00a4f152d..c6c4d2515b 100644
--- a/tools/depends/.gitignore
+++ b/tools/depends/.gitignore
@@ -40,7 +40,6 @@ config.site
config.site.native
/native/*/*native/
/JsonSchemaBuilder/bin/
-/libsquish-native/squish-install/
/TexturePacker/bin/
/target/ffmpeg/.ffmpeg-installed
/target/ffmpeg/ffmpeg-*-*.tar.gz
diff --git a/tools/depends/native/Makefile b/tools/depends/native/Makefile
index 283e9e43f2..b76dfcced0 100644
--- a/tools/depends/native/Makefile
+++ b/tools/depends/native/Makefile
@@ -7,7 +7,7 @@ endif
NATIVE= m4-native gettext-native autoconf-native automake-native \
libtool-native pkg-config-native yasm-native cmake-native \
gas-preprocessor-native python27-native zlib-native \
- pcre-native swig-native rpl-native libsquish-native \
+ pcre-native swig-native rpl-native \
libpng-native libjpeg-turbo-native liblzo2-native giflib-native \
distribute-native distutilscross-native JsonSchemaBuilder TexturePacker \
google-breakpad-native
@@ -40,7 +40,7 @@ python27-native: zlib-native
#liblzo2 has stale packaged automake files that cause borked host/build detection
liblzo2-native: automake-native
JsonSchemaBuilder: automake-native
-TexturePacker: automake-native pkg-config-native libsquish-native libpng-native liblzo2-native giflib-native libjpeg-turbo-native
+TexturePacker: automake-native pkg-config-native libpng-native liblzo2-native giflib-native libjpeg-turbo-native
native: $(NATIVE)
$(NATIVE):
diff --git a/tools/depends/native/TexturePacker/CMakeLists.txt b/tools/depends/native/TexturePacker/CMakeLists.txt
index 4eaa431fcd..9470bd95f4 100644
--- a/tools/depends/native/TexturePacker/CMakeLists.txt
+++ b/tools/depends/native/TexturePacker/CMakeLists.txt
@@ -44,12 +44,11 @@ target_include_directories(TexturePacker
${GIF_INCLUDE_DIR}
${CORE_SOURCE_DIR}/xbmc
${CORE_SOURCE_DIR}/xbmc/${PLATFORM_DIR}
- ${CORE_SOURCE_DIR}/tools/depends/native/libsquish-native/src
${CORE_SOURCE_DIR}/lib
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/decoder)
target_link_libraries(TexturePacker
- PRIVATE ${SYSTEM_LDFLAGS} squish
+ PRIVATE ${SYSTEM_LDFLAGS}
${GIF_LIBRARIES}
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
diff --git a/tools/depends/native/TexturePacker/Makefile b/tools/depends/native/TexturePacker/Makefile
index 5faeafc9c0..d128d74132 100644
--- a/tools/depends/native/TexturePacker/Makefile
+++ b/tools/depends/native/TexturePacker/Makefile
@@ -32,7 +32,7 @@ APPBIN=$(PREFIX)/bin/TexturePacker
all: .installed-$(PLATFORM)
-$(PLATFORM): ../libsquish-native/.installed-$(PLATFORM)
+$(PLATFORM):
-rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)
cd $(PLATFORM); cp -a $(SOURCE)/* .
cd $(PLATFORM); ./autogen.sh
@@ -42,9 +42,6 @@ $(PLATFORM): ../libsquish-native/.installed-$(PLATFORM)
$(APP): $(PLATFORM)
$(MAKE) -C $(PLATFORM)
-../libsquish-native/.installed-$(PLATFORM):
- $(MAKE) -C ../libsquish-native
-
.installed-$(PLATFORM): $(APP)
$(MAKE) -C $(PLATFORM) install
touch $@
diff --git a/tools/depends/native/TexturePacker/src/TexturePacker.cpp b/tools/depends/native/TexturePacker/src/TexturePacker.cpp
index de3d280b89..2835cdef69 100644
--- a/tools/depends/native/TexturePacker/src/TexturePacker.cpp
+++ b/tools/depends/native/TexturePacker/src/TexturePacker.cpp
@@ -39,7 +39,6 @@
#include "XBTFWriter.h"
#include "md5.h"
#include "cmdlineargs.h"
-#include "squish.h"
#ifdef TARGET_WINDOWS
#define strncasecmp _strnicmp
@@ -56,8 +55,6 @@
using namespace std;
#define FLAGS_USE_LZO 1
-#define FLAGS_ALLOW_YCOCG 2
-#define FLAGS_USE_DXT 4
#define DIR_SEPARATOR "/"
@@ -196,12 +193,6 @@ CXBTFFrame appendContent(CXBTFWriter &writer, int width, int height, unsigned ch
return frame;
}
-void CompressImage(const squish::u8 *brga, int width, int height, squish::u8 *compressed, unsigned int flags, double &colorMSE, double &alphaMSE)
-{
- squish::CompressImage(brga, width, height, compressed, flags | squish::kSourceBGRA);
- squish::ComputeMSE(brga, width, height, compressed, flags | squish::kSourceBGRA, colorMSE, alphaMSE);
-}
-
bool HasAlpha(unsigned char *argb, unsigned int width, unsigned int height)
{
unsigned char *p = argb + 3; // offset of alpha
@@ -219,63 +210,14 @@ CXBTFFrame createXBTFFrame(RGBAImage &image, CXBTFWriter& writer, double maxMSE,
int width, height;
unsigned int format = 0;
unsigned char* argb = (unsigned char*)image.pixels;
- unsigned int compressedSize = 0;
- unsigned char* compressed = NULL;
width = image.width;
height = image.height;
bool hasAlpha = HasAlpha(argb, width, height);
- if (flags & FLAGS_USE_DXT)
- {
- double colorMSE, alphaMSE;
- compressedSize = squish::GetStorageRequirements(width, height, squish::kDxt5);
- compressed = new unsigned char[compressedSize];
- // first try DXT1, which is only 4bits/pixel
- CompressImage(argb, width, height, compressed, squish::kDxt1, colorMSE, alphaMSE);
- if (colorMSE < maxMSE && alphaMSE < maxMSE)
- { // success - use it
- compressedSize = squish::GetStorageRequirements(width, height, squish::kDxt1);
- format = XB_FMT_DXT1;
- }
-
- if (!format)
- { // try DXT3 and DXT5 - use whichever is better (color is the same, but alpha will be different)
- CompressImage(argb, width, height, compressed, squish::kDxt3, colorMSE, alphaMSE);
- if (colorMSE < maxMSE)
- { // color is fine, test DXT5 as well
- double dxt5MSE;
- squish::u8* compressed2 = new squish::u8[squish::GetStorageRequirements(width, height, squish::kDxt5)];
- CompressImage(argb, width, height, compressed2, squish::kDxt5, colorMSE, dxt5MSE);
- if (alphaMSE < maxMSE && alphaMSE < dxt5MSE)
- { // DXT3 passes and is best
- compressedSize = squish::GetStorageRequirements(width, height, squish::kDxt3);
- format = XB_FMT_DXT3;
- }
- else if (dxt5MSE < maxMSE)
- { // DXT5 passes
- compressedSize = squish::GetStorageRequirements(width, height, squish::kDxt5);
- memcpy(compressed, compressed2, compressedSize);
- format = XB_FMT_DXT5;
- }
- delete[] compressed2;
- }
- }
- }
-
CXBTFFrame frame;
- if (format)
- {
- frame = appendContent(writer, width, height, compressed, compressedSize, format, hasAlpha, flags);
- if (compressedSize)
- delete[] compressed;
- }
- else
- {
- // none of the compressed stuff works for us, so we use 32bit texture
- format = XB_FMT_A8R8G8B8;
- frame = appendContent(writer, width, height, argb, (width * height * 4), format, hasAlpha, flags);
- }
+ format = XB_FMT_A8R8G8B8;
+ frame = appendContent(writer, width, height, argb, (width * height * 4), format, hasAlpha, flags);
return frame;
}
@@ -287,9 +229,7 @@ void Usage()
puts(" -input <dir> Input directory. Default: current dir");
puts(" -output <dir> Output directory/filename. Default: Textures.xpr");
puts(" -dupecheck Enable duplicate file detection. Reduces output file size. Default: off");
- puts(" -use_lzo Use lz0 packing. Default: on");
- puts(" -use_dxt Use DXT compression. Default: on");
- puts(" -use_none Use No compression. Default: off");
+ puts(" -disable_lzo Disable lz0 packing");
}
static bool checkDupe(struct MD5Context* ctx,
@@ -426,10 +366,9 @@ int main(int argc, char* argv[])
bool dupecheck = false;
CmdLineArgs args(argc, (const char**)argv);
- // setup some defaults, dxt with lzo post packing,
- flags = FLAGS_USE_DXT;
+ // setup some defaults, lzo packing,
#ifdef USE_LZO_PACKING
- flags |= FLAGS_USE_LZO;
+ flags = FLAGS_USE_LZO;
#endif
if (args.size() == 1)
@@ -466,18 +405,10 @@ int main(int argc, char* argv[])
while ((c = (char *)strchr(OutputFilename.c_str(), '\\')) != NULL) *c = '/';
#endif
}
- else if (!platform_stricmp(args[i], "-use_none"))
- {
- flags &= ~FLAGS_USE_DXT;
- }
- else if (!platform_stricmp(args[i], "-use_dxt"))
- {
- flags |= FLAGS_USE_DXT;
- }
#ifdef USE_LZO_PACKING
- else if (!platform_stricmp(args[i], "-use_lzo"))
+ else if (!platform_stricmp(args[i], "-disable_lzo"))
{
- flags |= FLAGS_USE_LZO;
+ flags &= ~FLAGS_USE_LZO;
}
#endif
else
diff --git a/tools/depends/native/TexturePacker/src/Win32/TexturePacker.vcxproj b/tools/depends/native/TexturePacker/src/Win32/TexturePacker.vcxproj
index 118141f0e5..e0a2f0df6c 100644
--- a/tools/depends/native/TexturePacker/src/Win32/TexturePacker.vcxproj
+++ b/tools/depends/native/TexturePacker/src/Win32/TexturePacker.vcxproj
@@ -53,7 +53,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>.;..;..\decoder;..\..\..\..\..\..\xbmc;..\..\..\..\..\..\lib;..\..\..\libsquish-native\src;$(WindowsSDK_IncludePath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>.;..;..\decoder;..\..\..\..\..\..\xbmc;..\..\..\..\..\..\lib;$(WindowsSDK_IncludePath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;TARGET_WINDOWS;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -64,7 +64,7 @@
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
- <AdditionalDependencies>..\..\..\..\..\..\project\VS2010Express\libs\squish\Debug\squishd.lib;..\..\..\..\..\..\project\BuildDependencies\lib\jpeg-static.lib;..\..\..\..\..\..\project\BuildDependencies\lib\libpng15d.lib;..\..\..\..\..\..\project\BuildDependencies\lib\libgif-static.lib;..\..\..\..\..\..\project\BuildDependencies\lib\zlibd-static.lib;..\..\..\..\..\..\lib\win32\liblzo\lzo.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>..\..\..\..\..\..\project\BuildDependencies\lib\jpeg-static.lib;..\..\..\..\..\..\project\BuildDependencies\lib\libpng15d.lib;..\..\..\..\..\..\project\BuildDependencies\lib\libgif-static.lib;..\..\..\..\..\..\project\BuildDependencies\lib\zlibd-static.lib;..\..\..\..\..\..\lib\win32\liblzo\lzo.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
@@ -77,7 +77,7 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>.;..;..\decoder;..\..\..\..\..\..\xbmc;..\..\..\..\..\..\lib;..\..\..\libsquish-native\src;$(WindowsSDK_IncludePath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>.;..;..\decoder;..\..\..\..\..\..\xbmc;;$(WindowsSDK_IncludePath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;USE_LZO_PACKING;TARGET_WINDOWS;_ITERATOR_DEBUG_LEVEL=0;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -87,7 +87,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
- <AdditionalDependencies>..\..\..\..\..\..\project\VS2010Express\libs\squish\Release\squish.lib;..\..\..\..\..\..\project\BuildDependencies\lib\jpeg-static.lib;..\..\..\..\..\..\project\BuildDependencies\lib\libpng15.lib;..\..\..\..\..\..\project\BuildDependencies\lib\libgif-static.lib;..\..\..\..\..\..\project\BuildDependencies\lib\zlib-static.lib;..\..\..\..\..\..\lib\win32\liblzo\lzo.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>..\..\..\..\..\..\project\BuildDependencies\lib\jpeg-static.lib;..\..\..\..\..\..\project\BuildDependencies\lib\libpng15.lib;..\..\..\..\..\..\project\BuildDependencies\lib\libgif-static.lib;..\..\..\..\..\..\project\BuildDependencies\lib\zlib-static.lib;..\..\..\..\..\..\lib\win32\liblzo\lzo.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>libc.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
diff --git a/tools/depends/native/TexturePacker/src/configure.ac b/tools/depends/native/TexturePacker/src/configure.ac
index a3e9f1e1be..4b83b5e033 100644
--- a/tools/depends/native/TexturePacker/src/configure.ac
+++ b/tools/depends/native/TexturePacker/src/configure.ac
@@ -34,14 +34,6 @@ AC_CHECK_LIB([jpeg],[main],, AC_MSG_ERROR("libjpeg not found"))
AC_CHECK_HEADER([lzo/lzo1x.h],, AC_MSG_ERROR("lzo/lzo1x.h not found"))
AC_CHECK_LIB([lzo2],[main],, AC_MSG_ERROR("liblzo2 not found"))
-# we don't compile with default upstream squish, so we use our own one
-# even on non unified deps platforms
-export PKG_CONFIG_PATH="${abs_top_srcdir}/../../libsquish-native/squish-install/lib/pkgconfig:$PKG_CONFIG_PATH"
-PKG_CHECK_MODULES([SQUISH], [squish],
- [CPPFLAGS="$CPPFLAGS $SQUISH_CFLAGS" LIBS="$LIBS $SQUISH_LIBS"],
- AC_MSG_ERROR("libsquish not found"))
-
-
AC_SUBST(KODI_SRC_DIR)
AC_SUBST(STATIC_FLAG)
AC_SUBST(EXTRA_DEFINES)
diff --git a/tools/depends/native/libsquish-native/CMakeLists.txt b/tools/depends/native/libsquish-native/CMakeLists.txt
deleted file mode 100644
index 1a5589f19b..0000000000
--- a/tools/depends/native/libsquish-native/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-if(CMAKE_CROSSCOMPILING)
- return()
-endif()
-
-set(SOURCES src/alpha.cpp
- src/clusterfit.cpp
- src/colourblock.cpp
- src/colourfit.cpp
- src/colourset.cpp
- src/maths.cpp
- src/rangefit.cpp
- src/singlecolourfit.cpp
- src/squish.cpp)
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
-
-find_package(SSE)
-if(SSE2_FOUND)
- add_definitions(-DSQUISH_USE_SSE=2)
-elseif(SSE_FOUND)
- add_definitions(-DSQUISH_USE_SSE=1)
-endif()
-
-# Always compile release - it's insanely slow in debug
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
-add_definitions(-DNDEBUG)
-
-if(SQUISH_NATIVE)
- core_add_library(squish-native NO_MAIN_DEPENDS)
-else()
- if(NOT BOOTSTRAP_IN_TREE)
- core_add_library(squish)
- else()
- set(core_DEPENDS squish-native ${core_DEPENDS} CACHE STRING "" FORCE)
- endif()
-endif()
diff --git a/tools/depends/native/libsquish-native/Makefile b/tools/depends/native/libsquish-native/Makefile
deleted file mode 100644
index 7bf6e5e5b6..0000000000
--- a/tools/depends/native/libsquish-native/Makefile
+++ /dev/null
@@ -1,46 +0,0 @@
-DEPS= ../../Makefile.include.in Makefile
-ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
--include ../../Makefile.include
-
-ifeq ($(NATIVEPREFIX),)
- PREFIX = $(ROOT_DIR)/squish-install
-else
- PREFIX = $(NATIVEPREFIX)
-endif
-
-ifeq ($(NATIVEPLATFORM),)
- PLATFORM = native
-else
- PLATFORM = $(NATIVEPLATFORM)
-endif
-
-APPNAME=squish
-SOURCE=$(ROOT_DIR)/src
-
-DYLIB=$(PLATFORM)/libsquish.a
-
-all: .installed-$(PLATFORM)
-
-$(PLATFORM):
-ifeq ($(PREFIX),)
- @echo
- @echo "ERROR: please set PREFIX to the xbmc install path e.g. make PREFIX=/usr/local"
- @exit 1
-endif
- -rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)
- cd $(PLATFORM); cp -a $(SOURCE)/* .
- cd $(PLATFORM); sed "s|@PREFIX@|$(PREFIX)|" config.in > config
- cd $(PLATFORM); mkdir -p $(PREFIX)/include; mkdir -p $(PREFIX)/lib/pkgconfig
-
-$(DYLIB): $(PLATFORM)
- $(MAKE) -C $(PLATFORM)
-
-.installed-$(PLATFORM): $(DYLIB)
- $(MAKE) -C $(PLATFORM) install
- touch $@
-
-clean:
- $(MAKE) -C $(PLATFORM) clean
-
-distclean::
- rm -rf $(PLATFORM) .installed-$(PLATFORM)
diff --git a/tools/depends/native/libsquish-native/src/ChangeLog b/tools/depends/native/libsquish-native/src/ChangeLog
deleted file mode 100644
index ba03f4c574..0000000000
--- a/tools/depends/native/libsquish-native/src/ChangeLog
+++ /dev/null
@@ -1,52 +0,0 @@
-1.10
-* Iterative cluster fit is now considered to be a new compression mode
-* The core cluster fit is now 4x faster using contributions by Ignacio
-Castano from NVIDIA
-* The single colour lookup table has been halved by exploiting symmetry
-
-1.9
-* Added contributed SSE1 truncate implementation
-* Changed use of SQUISH_USE_SSE to be 1 for SSE and 2 for SSE2 instructions
-* Cluster fit is now iterative to further reduce image error
-
-1.8
-* Switched from using floor to trunc for much better SSE performance (again)
-* Xcode build now expects libpng in /usr/local for extra/squishpng
-
-1.7
-* Fixed floating-point equality issue in clusterfit sort (x86 affected only)
-* Implemented proper SSE(2) floor function for 50% speedup on SSE builds
-* The range fit implementation now uses the correct colour metric
-
-1.6
-* Fixed bug in CompressImage where masked pixels were not skipped over
-* DXT3 and DXT5 alpha compression now properly use the mask to ignore pixels
-* Fixed major DXT1 bug that can generate unexpected transparent pixels
-
-1.5
-* Added CompressMasked function to handle incomplete DXT blocks more cleanly
-* Added kWeightColourByAlpha flag for better quality images when alpha blending
-
-1.4
-* Fixed stack overflow in rangefit
-
-1.3
-* Worked around SSE floor implementation bug, proper fix needed!
-* This release has visual studio and makefile builds that work
-
-1.2
-* Added provably optimal single colour compressor
-* Added extra/squishgen.cpp that generates single colour lookup tables
-
-1.1
-* Fixed a DXT1 colour output bug
-* Changed argument order for Decompress function to match Compress
-* Added GetStorageRequirements function
-* Added CompressImage function
-* Added DecompressImage function
-* Moved squishtool.cpp to extra/squishpng.cpp
-* Added extra/squishtest.cpp
-
-1.0
-* Initial release
-
diff --git a/tools/depends/native/libsquish-native/src/Doxyfile b/tools/depends/native/libsquish-native/src/Doxyfile
deleted file mode 100644
index 3ec51e4bde..0000000000
--- a/tools/depends/native/libsquish-native/src/Doxyfile
+++ /dev/null
@@ -1,223 +0,0 @@
-# Doxyfile 1.4.6
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = squish
-PROJECT_NUMBER = 1.1
-OUTPUT_DIRECTORY = docs
-CREATE_SUBDIRS = NO
-OUTPUT_LANGUAGE = English
-USE_WINDOWS_ENCODING = NO
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ABBREVIATE_BRIEF =
-ALWAYS_DETAILED_SEC = NO
-INLINE_INHERITED_MEMB = NO
-FULL_PATH_NAMES = YES
-STRIP_FROM_PATH =
-STRIP_FROM_INC_PATH =
-SHORT_NAMES = NO
-JAVADOC_AUTOBRIEF = NO
-MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP = NO
-INHERIT_DOCS = YES
-SEPARATE_MEMBER_PAGES = NO
-TAB_SIZE = 4
-ALIASES =
-OPTIMIZE_OUTPUT_FOR_C = NO
-OPTIMIZE_OUTPUT_JAVA = NO
-BUILTIN_STL_SUPPORT = NO
-DISTRIBUTE_GROUP_DOC = NO
-SUBGROUPING = YES
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-EXTRACT_ALL = YES
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = NO
-EXTRACT_LOCAL_CLASSES = YES
-EXTRACT_LOCAL_METHODS = NO
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_FRIEND_COMPOUNDS = NO
-HIDE_IN_BODY_DOCS = NO
-INTERNAL_DOCS = NO
-CASE_SENSE_NAMES = NO
-HIDE_SCOPE_NAMES = NO
-SHOW_INCLUDE_FILES = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-SORT_BRIEF_DOCS = NO
-SORT_BY_SCOPE_NAME = NO
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-GENERATE_DEPRECATEDLIST= YES
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-SHOW_USED_FILES = YES
-SHOW_DIRECTORIES = NO
-FILE_VERSION_FILTER =
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = YES
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_IF_DOC_ERROR = YES
-WARN_NO_PARAMDOC = NO
-WARN_FORMAT = "$file:$line: $text"
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = squish.h
-FILE_PATTERNS =
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_PATTERNS =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = NO
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
-USE_HTAGS = NO
-VERBATIM_HEADERS = YES
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = NO
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT = html
-HTML_FILE_EXTENSION = .html
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-CHM_FILE =
-HHC_LOCATION =
-GENERATE_CHI = NO
-BINARY_TOC = NO
-TOC_EXPAND = NO
-DISABLE_INDEX = NO
-ENUM_VALUES_PER_LINE = 4
-GENERATE_TREEVIEW = NO
-TREEVIEW_WIDTH = 250
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = NO
-LATEX_OUTPUT = latex
-LATEX_CMD_NAME = latex
-MAKEINDEX_CMD_NAME = makeindex
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-LATEX_HIDE_INDICES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT = rtf
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = NO
-MAN_OUTPUT = man
-MAN_EXTENSION = .3
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = NO
-XML_OUTPUT = xml
-XML_SCHEMA =
-XML_DTD =
-XML_PROGRAMLISTING = YES
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD = NO
-PERLMOD_LATEX = NO
-PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE =
-ALLEXTERNALS = NO
-EXTERNAL_GROUPS = YES
-PERL_PATH = /usr/bin/perl
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = YES
-HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = YES
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-GROUP_GRAPHS = YES
-UML_LOOK = NO
-TEMPLATE_RELATIONS = NO
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-CALL_GRAPH = NO
-GRAPHICAL_HIERARCHY = YES
-DIRECTORY_GRAPH = YES
-DOT_IMAGE_FORMAT = png
-DOT_PATH = /Applications/Graphviz.app/Contents/MacOS
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
-MAX_DOT_GRAPH_DEPTH = 0
-DOT_TRANSPARENT = NO
-DOT_MULTI_TARGETS = NO
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
diff --git a/tools/depends/native/libsquish-native/src/Makefile b/tools/depends/native/libsquish-native/src/Makefile
deleted file mode 100644
index d560e0af6d..0000000000
--- a/tools/depends/native/libsquish-native/src/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-
-include config
-
-SRC = alpha.cpp clusterfit.cpp colourblock.cpp colourfit.cpp colourset.cpp maths.cpp rangefit.cpp singlecolourfit.cpp squish.cpp
-
-OBJ = $(SRC:%.cpp=%.o)
-
-LIB = libsquish.a
-
-all : $(LIB) squish.pc
-
-install : $(LIB) squish.pc
- install squish.h $(INSTALL_DIR)/include
- install libsquish.a $(INSTALL_DIR)/lib
- install squish.pc $(INSTALL_DIR)/lib/pkgconfig
-
-uninstall:
- $(RM) $(INSTALL_DIR)/include/squish.h
- $(RM) $(INSTALL_DIR)/lib/libsquish.a
-
-$(LIB) : $(OBJ)
- $(AR) cr $@ $?
- ranlib $@
-
-%.o : %.cpp
- $(CXX) $(CPPFLAGS) -I. $(CXXFLAGS) -o$@ -c $<
-
-clean :
- $(RM) $(OBJ) $(LIB)
-
-squish.pc:
- sed 's|@PREFIX@|$(INSTALL_DIR)|' $@.in > $@
-
diff --git a/tools/depends/native/libsquish-native/src/Makefile.target b/tools/depends/native/libsquish-native/src/Makefile.target
deleted file mode 100644
index 03d6732764..0000000000
--- a/tools/depends/native/libsquish-native/src/Makefile.target
+++ /dev/null
@@ -1,34 +0,0 @@
-include ../../../Makefile.include
-
-SRCS= \
- alpha.cpp \
- clusterfit.cpp \
- colourblock.cpp \
- colourfit.cpp \
- colourset.cpp \
- maths.cpp \
- rangefit.cpp \
- singlecolourfit.cpp \
- squish.cpp
-
-CXXFLAGS += -I.
-LIB = libsquish.a
-
-OBJ = $(SRCS:%.cpp=%.o)
-
-%.o : %.cpp
- $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o$@ -c $<
-
-$(LIB): $(OBJ)
- $(AR) cr $@ $?
- $(RANLIB) $@
-
-install: $(LIB) squish.pc
- install squish.h $(PREFIX)/include
- install libsquish.a $(PREFIX)/lib
- install squish.pc $(PREFIX)/lib/pkgconfig
-
-squish.pc: squish.pc.in
- sed 's|@PREFIX@|$(PREFIX)|' $@.in > $@
-
-all: $(LIB)
diff --git a/tools/depends/native/libsquish-native/src/README b/tools/depends/native/libsquish-native/src/README
deleted file mode 100644
index d26b72ed5c..0000000000
--- a/tools/depends/native/libsquish-native/src/README
+++ /dev/null
@@ -1,35 +0,0 @@
-LICENSE
--------
-
-The squish library is distributed under the terms and conditions of the MIT
-license. This license is specified at the top of each source file and must be
-preserved in its entirety.
-
-BUILDING AND INSTALLING THE LIBRARY
------------------------------------
-
-If you are using Visual Studio 2003 or above under Windows then load the Visual
-Studio 2003 project in the vs7 folder. By default, the library is built using
-SSE2 optimisations. To change this either change or remove the SQUISH_USE_SSE=2
-from the preprocessor symbols.
-
-If you are using a Mac then load the Xcode 2.2 project in the distribution. By
-default, the library is built using Altivec optimisations. To change this
-either change or remove SQUISH_USE_ALTIVEC=1 from the preprocessor symbols. I
-guess I'll have to think about changing this for the new Intel Macs that are
-rolling out...
-
-If you are using unix then first edit the config file in the base directory of
-the distribution, enabling Altivec or SSE with the USE_ALTIVEC or USE_SSE
-variables, and editing the optimisation flags passed to the C++ compiler if
-necessary. Then make can be used to build the library, and make install (from
-the superuser account) can be used to install (into /usr/local by default).
-
-REPORTING BUGS OR FEATURE REQUESTS
-----------------------------------
-
-Feedback can be sent to Simon Brown (the developer) at si@sjbrown.co.uk
-
-New releases are announced on the squish library homepage at
-http://sjbrown.co.uk/?code=squish
-
diff --git a/tools/depends/native/libsquish-native/src/alpha.cpp b/tools/depends/native/libsquish-native/src/alpha.cpp
deleted file mode 100644
index 30c1f55a01..0000000000
--- a/tools/depends/native/libsquish-native/src/alpha.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#include "alpha.h"
-#include <limits.h>
-#include <algorithm>
-
-namespace squish {
-
-static int FloatToInt( float a, int limit )
-{
- // use ANSI round-to-zero behaviour to get round-to-nearest
- int i = ( int )( a + 0.5f );
-
- // clamp to the limit
- if( i < 0 )
- i = 0;
- else if( i > limit )
- i = limit;
-
- // done
- return i;
-}
-
-void CompressAlphaDxt3( u8 const* rgba, int mask, void* block )
-{
- u8* bytes = reinterpret_cast< u8* >( block );
-
- // quantise and pack the alpha values pairwise
- for( int i = 0; i < 8; ++i )
- {
- // quantise down to 4 bits
- float alpha1 = ( float )rgba[8*i + 3] * ( 15.0f/255.0f );
- float alpha2 = ( float )rgba[8*i + 7] * ( 15.0f/255.0f );
- int quant1 = FloatToInt( alpha1, 15 );
- int quant2 = FloatToInt( alpha2, 15 );
-
- // set alpha to zero where masked
- int bit1 = 1 << ( 2*i );
- int bit2 = 1 << ( 2*i + 1 );
- if( ( mask & bit1 ) == 0 )
- quant1 = 0;
- if( ( mask & bit2 ) == 0 )
- quant2 = 0;
-
- // pack into the byte
- bytes[i] = ( u8 )( quant1 | ( quant2 << 4 ) );
- }
-}
-
-void DecompressAlphaDxt3( u8* rgba, void const* block )
-{
- u8 const* bytes = reinterpret_cast< u8 const* >( block );
-
- // unpack the alpha values pairwise
- for( int i = 0; i < 8; ++i )
- {
- // quantise down to 4 bits
- u8 quant = bytes[i];
-
- // unpack the values
- u8 lo = quant & 0x0f;
- u8 hi = quant & 0xf0;
-
- // convert back up to bytes
- rgba[8*i + 3] = lo | ( lo << 4 );
- rgba[8*i + 7] = hi | ( hi >> 4 );
- }
-}
-
-static void FixRange( int& min, int& max, int steps )
-{
- if( max - min < steps )
- max = std::min( min + steps, 255 );
- if( max - min < steps )
- min = std::max( 0, max - steps );
-}
-
-static int FitCodes( u8 const* rgba, int mask, u8 const* codes, u8* indices )
-{
- // fit each alpha value to the codebook
- int err = 0;
- for( int i = 0; i < 16; ++i )
- {
- // check this pixel is valid
- int bit = 1 << i;
- if( ( mask & bit ) == 0 )
- {
- // use the first code
- indices[i] = 0;
- continue;
- }
-
- // find the least error and corresponding index
- int value = rgba[4*i + 3];
- int least = INT_MAX;
- int index = 0;
- for( int j = 0; j < 8; ++j )
- {
- // get the squared error from this code
- int dist = ( int )value - ( int )codes[j];
- dist *= dist;
-
- // compare with the best so far
- if( dist < least )
- {
- least = dist;
- index = j;
- }
- }
-
- // save this index and accumulate the error
- indices[i] = ( u8 )index;
- err += least;
- }
-
- // return the total error
- return err;
-}
-
-static void WriteAlphaBlock( int alpha0, int alpha1, u8 const* indices, void* block )
-{
- u8* bytes = reinterpret_cast< u8* >( block );
-
- // write the first two bytes
- bytes[0] = ( u8 )alpha0;
- bytes[1] = ( u8 )alpha1;
-
- // pack the indices with 3 bits each
- u8* dest = bytes + 2;
- u8 const* src = indices;
- for( int i = 0; i < 2; ++i )
- {
- // pack 8 3-bit values
- int value = 0;
- for( int j = 0; j < 8; ++j )
- {
- int index = *src++;
- value |= ( index << 3*j );
- }
-
- // store in 3 bytes
- for( int j = 0; j < 3; ++j )
- {
- int byte = ( value >> 8*j ) & 0xff;
- *dest++ = ( u8 )byte;
- }
- }
-}
-
-static void WriteAlphaBlock5( int alpha0, int alpha1, u8 const* indices, void* block )
-{
- // check the relative values of the endpoints
- if( alpha0 > alpha1 )
- {
- // swap the indices
- u8 swapped[16];
- for( int i = 0; i < 16; ++i )
- {
- u8 index = indices[i];
- if( index == 0 )
- swapped[i] = 1;
- else if( index == 1 )
- swapped[i] = 0;
- else if( index <= 5 )
- swapped[i] = 7 - index;
- else
- swapped[i] = index;
- }
-
- // write the block
- WriteAlphaBlock( alpha1, alpha0, swapped, block );
- }
- else
- {
- // write the block
- WriteAlphaBlock( alpha0, alpha1, indices, block );
- }
-}
-
-static void WriteAlphaBlock7( int alpha0, int alpha1, u8 const* indices, void* block )
-{
- // check the relative values of the endpoints
- if( alpha0 < alpha1 )
- {
- // swap the indices
- u8 swapped[16];
- for( int i = 0; i < 16; ++i )
- {
- u8 index = indices[i];
- if( index == 0 )
- swapped[i] = 1;
- else if( index == 1 )
- swapped[i] = 0;
- else
- swapped[i] = 9 - index;
- }
-
- // write the block
- WriteAlphaBlock( alpha1, alpha0, swapped, block );
- }
- else
- {
- // write the block
- WriteAlphaBlock( alpha0, alpha1, indices, block );
- }
-}
-
-void CompressAlphaDxt5( u8 const* rgba, int mask, void* block )
-{
- // get the range for 5-alpha and 7-alpha interpolation
- int min5 = 255;
- int max5 = 0;
- int min7 = 255;
- int max7 = 0;
- for( int i = 0; i < 16; ++i )
- {
- // check this pixel is valid
- int bit = 1 << i;
- if( ( mask & bit ) == 0 )
- continue;
-
- // incorporate into the min/max
- int value = rgba[4*i + 3];
- if( value < min7 )
- min7 = value;
- if( value > max7 )
- max7 = value;
- if( value != 0 && value < min5 )
- min5 = value;
- if( value != 255 && value > max5 )
- max5 = value;
- }
-
- // handle the case that no valid range was found
- if( min5 > max5 )
- min5 = max5;
- if( min7 > max7 )
- min7 = max7;
-
- // fix the range to be the minimum in each case
- FixRange( min5, max5, 5 );
- FixRange( min7, max7, 7 );
-
- // set up the 5-alpha code book
- u8 codes5[8];
- codes5[0] = ( u8 )min5;
- codes5[1] = ( u8 )max5;
- for( int i = 1; i < 5; ++i )
- codes5[1 + i] = ( u8 )( ( ( 5 - i )*min5 + i*max5 )/5 );
- codes5[6] = 0;
- codes5[7] = 255;
-
- // set up the 7-alpha code book
- u8 codes7[8];
- codes7[0] = ( u8 )min7;
- codes7[1] = ( u8 )max7;
- for( int i = 1; i < 7; ++i )
- codes7[1 + i] = ( u8 )( ( ( 7 - i )*min7 + i*max7 )/7 );
-
- // fit the data to both code books
- u8 indices5[16];
- u8 indices7[16];
- int err5 = FitCodes( rgba, mask, codes5, indices5 );
- int err7 = FitCodes( rgba, mask, codes7, indices7 );
-
- // save the block with least error
- if( err5 <= err7 )
- WriteAlphaBlock5( min5, max5, indices5, block );
- else
- WriteAlphaBlock7( min7, max7, indices7, block );
-}
-
-void DecompressAlphaDxt5( u8* rgba, void const* block )
-{
- // get the two alpha values
- u8 const* bytes = reinterpret_cast< u8 const* >( block );
- int alpha0 = bytes[0];
- int alpha1 = bytes[1];
-
- // compare the values to build the codebook
- u8 codes[8];
- codes[0] = ( u8 )alpha0;
- codes[1] = ( u8 )alpha1;
- if( alpha0 <= alpha1 )
- {
- // use 5-alpha codebook
- for( int i = 1; i < 5; ++i )
- codes[1 + i] = ( u8 )( ( ( 5 - i )*alpha0 + i*alpha1 )/5 );
- codes[6] = 0;
- codes[7] = 255;
- }
- else
- {
- // use 7-alpha codebook
- for( int i = 1; i < 7; ++i )
- codes[1 + i] = ( u8 )( ( ( 7 - i )*alpha0 + i*alpha1 )/7 );
- }
-
- // decode the indices
- u8 indices[16];
- u8 const* src = bytes + 2;
- u8* dest = indices;
- for( int i = 0; i < 2; ++i )
- {
- // grab 3 bytes
- int value = 0;
- for( int j = 0; j < 3; ++j )
- {
- int byte = *src++;
- value |= ( byte << 8*j );
- }
-
- // unpack 8 3-bit values from it
- for( int j = 0; j < 8; ++j )
- {
- int index = ( value >> 3*j ) & 0x7;
- *dest++ = ( u8 )index;
- }
- }
-
- // write out the indexed codebook values
- for( int i = 0; i < 16; ++i )
- rgba[4*i + 3] = codes[indices[i]];
-}
-
-} // namespace squish
diff --git a/tools/depends/native/libsquish-native/src/alpha.h b/tools/depends/native/libsquish-native/src/alpha.h
deleted file mode 100644
index 5736052551..0000000000
--- a/tools/depends/native/libsquish-native/src/alpha.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_ALPHA_H
-#define SQUISH_ALPHA_H
-
-#include <squish.h>
-
-namespace squish {
-
-void CompressAlphaDxt3( u8 const* rgba, int mask, void* block );
-void CompressAlphaDxt5( u8 const* rgba, int mask, void* block );
-
-void DecompressAlphaDxt3( u8* rgba, void const* block );
-void DecompressAlphaDxt5( u8* rgba, void const* block );
-
-} // namespace squish
-
-#endif // ndef SQUISH_ALPHA_H
diff --git a/tools/depends/native/libsquish-native/src/clusterfit.cpp b/tools/depends/native/libsquish-native/src/clusterfit.cpp
deleted file mode 100644
index 96704460ec..0000000000
--- a/tools/depends/native/libsquish-native/src/clusterfit.cpp
+++ /dev/null
@@ -1,392 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
- Copyright (c) 2007 Ignacio Castano icastano@nvidia.com
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#include "clusterfit.h"
-#include "colourset.h"
-#include "colourblock.h"
-#include <cfloat>
-
-namespace squish {
-
-ClusterFit::ClusterFit( ColourSet const* colours, int flags, float* metric )
- : ColourFit( colours, flags )
-{
- // set the iteration count
- m_iterationCount = ( m_flags & kColourIterativeClusterFit ) ? kMaxIterations : 1;
-
- // initialise the metric (old perceptual = 0.2126f, 0.7152f, 0.0722f)
- if( metric )
- m_metric = Vec4( metric[0], metric[1], metric[2], 1.0f );
- else
- m_metric = VEC4_CONST( 1.0f );
-
- // initialise the best error
- m_besterror = VEC4_CONST( FLT_MAX );
-
- // cache some values
- int const count = m_colours->GetCount();
- Vec3 const* values = m_colours->GetPoints();
-
- // get the covariance matrix
- Sym3x3 covariance = ComputeWeightedCovariance( count, values, m_colours->GetWeights() );
-
- // compute the principle component
- m_principle = ComputePrincipleComponent( covariance );
-}
-
-bool ClusterFit::ConstructOrdering( Vec3 const& axis, int iteration )
-{
- // cache some values
- int const count = m_colours->GetCount();
- Vec3 const* values = m_colours->GetPoints();
-
- // build the list of dot products
- float dps[16];
- u8* order = ( u8* )m_order + 16*iteration;
- for( int i = 0; i < count; ++i )
- {
- dps[i] = Dot( values[i], axis );
- order[i] = ( u8 )i;
- }
-
- // stable sort using them
- for( int i = 0; i < count; ++i )
- {
- for( int j = i; j > 0 && dps[j] < dps[j - 1]; --j )
- {
- std::swap( dps[j], dps[j - 1] );
- std::swap( order[j], order[j - 1] );
- }
- }
-
- // check this ordering is unique
- for( int it = 0; it < iteration; ++it )
- {
- u8 const* prev = ( u8* )m_order + 16*it;
- bool same = true;
- for( int i = 0; i < count; ++i )
- {
- if( order[i] != prev[i] )
- {
- same = false;
- break;
- }
- }
- if( same )
- return false;
- }
-
- // copy the ordering and weight all the points
- Vec3 const* unweighted = m_colours->GetPoints();
- float const* weights = m_colours->GetWeights();
- m_xsum_wsum = VEC4_CONST( 0.0f );
- for( int i = 0; i < count; ++i )
- {
- int j = order[i];
- Vec4 p( unweighted[j].X(), unweighted[j].Y(), unweighted[j].Z(), 1.0f );
- Vec4 w( weights[j] );
- Vec4 x = p*w;
- m_points_weights[i] = x;
- m_xsum_wsum += x;
- }
- return true;
-}
-
-void ClusterFit::Compress3( void* block )
-{
- // declare variables
- int const count = m_colours->GetCount();
- Vec4 const two = VEC4_CONST( 2.0 );
- Vec4 const one = VEC4_CONST( 1.0f );
- Vec4 const half_half2( 0.5f, 0.5f, 0.5f, 0.25f );
- Vec4 const zero = VEC4_CONST( 0.0f );
- Vec4 const half = VEC4_CONST( 0.5f );
- Vec4 const grid( 31.0f, 63.0f, 31.0f, 0.0f );
- Vec4 const gridrcp( 1.0f/31.0f, 1.0f/63.0f, 1.0f/31.0f, 0.0f );
-
- // prepare an ordering using the principle axis
- ConstructOrdering( m_principle, 0 );
-
- // check all possible clusters and iterate on the total order
- Vec4 beststart = VEC4_CONST( 0.0f );
- Vec4 bestend = VEC4_CONST( 0.0f );
- Vec4 besterror = m_besterror;
- u8 bestindices[16];
- int bestiteration = 0;
- int besti = 0, bestj = 0;
-
- // loop over iterations (we avoid the case that all points in first or last cluster)
- for( int iterationIndex = 0;; )
- {
- // first cluster [0,i) is at the start
- Vec4 part0 = VEC4_CONST( 0.0f );
- for( int i = 0; i < count; ++i )
- {
- // second cluster [i,j) is half along
- Vec4 part1 = ( i == 0 ) ? m_points_weights[0] : VEC4_CONST( 0.0f );
- int jmin = ( i == 0 ) ? 1 : i;
- for( int j = jmin;; )
- {
- // last cluster [j,count) is at the end
- Vec4 part2 = m_xsum_wsum - part1 - part0;
-
- // compute least squares terms directly
- Vec4 alphax_sum = MultiplyAdd( part1, half_half2, part0 );
- Vec4 alpha2_sum = alphax_sum.SplatW();
-
- Vec4 betax_sum = MultiplyAdd( part1, half_half2, part2 );
- Vec4 beta2_sum = betax_sum.SplatW();
-
- Vec4 alphabeta_sum = ( part1*half_half2 ).SplatW();
-
- // compute the least-squares optimal points
- Vec4 factor = Reciprocal( NegativeMultiplySubtract( alphabeta_sum, alphabeta_sum, alpha2_sum*beta2_sum ) );
- Vec4 a = NegativeMultiplySubtract( betax_sum, alphabeta_sum, alphax_sum*beta2_sum )*factor;
- Vec4 b = NegativeMultiplySubtract( alphax_sum, alphabeta_sum, betax_sum*alpha2_sum )*factor;
-
- // clamp to the grid
- a = Min( one, Max( zero, a ) );
- b = Min( one, Max( zero, b ) );
- a = Truncate( MultiplyAdd( grid, a, half ) )*gridrcp;
- b = Truncate( MultiplyAdd( grid, b, half ) )*gridrcp;
-
- // compute the error (we skip the constant xxsum)
- Vec4 e1 = MultiplyAdd( a*a, alpha2_sum, b*b*beta2_sum );
- Vec4 e2 = NegativeMultiplySubtract( a, alphax_sum, a*b*alphabeta_sum );
- Vec4 e3 = NegativeMultiplySubtract( b, betax_sum, e2 );
- Vec4 e4 = MultiplyAdd( two, e3, e1 );
-
- // apply the metric to the error term
- Vec4 e5 = e4*m_metric;
- Vec4 error = e5.SplatX() + e5.SplatY() + e5.SplatZ();
-
- // keep the solution if it wins
- if( CompareAnyLessThan( error, besterror ) )
- {
- beststart = a;
- bestend = b;
- besti = i;
- bestj = j;
- besterror = error;
- bestiteration = iterationIndex;
- }
-
- // advance
- if( j == count )
- break;
- part1 += m_points_weights[j];
- ++j;
- }
-
- // advance
- part0 += m_points_weights[i];
- }
-
- // stop if we didn't improve in this iteration
- if( bestiteration != iterationIndex )
- break;
-
- // advance if possible
- ++iterationIndex;
- if( iterationIndex == m_iterationCount )
- break;
-
- // stop if a new iteration is an ordering that has already been tried
- Vec3 axis = ( bestend - beststart ).GetVec3();
- if( !ConstructOrdering( axis, iterationIndex ) )
- break;
- }
-
- // save the block if necessary
- if( CompareAnyLessThan( besterror, m_besterror ) )
- {
- // remap the indices
- u8 const* order = ( u8* )m_order + 16*bestiteration;
-
- u8 unordered[16];
- for( int m = 0; m < besti; ++m )
- unordered[order[m]] = 0;
- for( int m = besti; m < bestj; ++m )
- unordered[order[m]] = 2;
- for( int m = bestj; m < count; ++m )
- unordered[order[m]] = 1;
-
- m_colours->RemapIndices( unordered, bestindices );
-
- // save the block
- WriteColourBlock3( beststart.GetVec3(), bestend.GetVec3(), bestindices, block );
-
- // save the error
- m_besterror = besterror;
- }
-}
-
-void ClusterFit::Compress4( void* block )
-{
- // declare variables
- int const count = m_colours->GetCount();
- Vec4 const two = VEC4_CONST( 2.0f );
- Vec4 const one = VEC4_CONST( 1.0f );
- Vec4 const onethird_onethird2( 1.0f/3.0f, 1.0f/3.0f, 1.0f/3.0f, 1.0f/9.0f );
- Vec4 const twothirds_twothirds2( 2.0f/3.0f, 2.0f/3.0f, 2.0f/3.0f, 4.0f/9.0f );
- Vec4 const twonineths = VEC4_CONST( 2.0f/9.0f );
- Vec4 const zero = VEC4_CONST( 0.0f );
- Vec4 const half = VEC4_CONST( 0.5f );
- Vec4 const grid( 31.0f, 63.0f, 31.0f, 0.0f );
- Vec4 const gridrcp( 1.0f/31.0f, 1.0f/63.0f, 1.0f/31.0f, 0.0f );
-
- // prepare an ordering using the principle axis
- ConstructOrdering( m_principle, 0 );
-
- // check all possible clusters and iterate on the total order
- Vec4 beststart = VEC4_CONST( 0.0f );
- Vec4 bestend = VEC4_CONST( 0.0f );
- Vec4 besterror = m_besterror;
- u8 bestindices[16];
- int bestiteration = 0;
- int besti = 0, bestj = 0, bestk = 0;
-
- // loop over iterations (we avoid the case that all points in first or last cluster)
- for( int iterationIndex = 0;; )
- {
- // first cluster [0,i) is at the start
- Vec4 part0 = VEC4_CONST( 0.0f );
- for( int i = 0; i < count; ++i )
- {
- // second cluster [i,j) is one third along
- Vec4 part1 = VEC4_CONST( 0.0f );
- for( int j = i;; )
- {
- // third cluster [j,k) is two thirds along
- Vec4 part2 = ( j == 0 ) ? m_points_weights[0] : VEC4_CONST( 0.0f );
- int kmin = ( j == 0 ) ? 1 : j;
- for( int k = kmin;; )
- {
- // last cluster [k,count) is at the end
- Vec4 part3 = m_xsum_wsum - part2 - part1 - part0;
-
- // compute least squares terms directly
- Vec4 const alphax_sum = MultiplyAdd( part2, onethird_onethird2, MultiplyAdd( part1, twothirds_twothirds2, part0 ) );
- Vec4 const alpha2_sum = alphax_sum.SplatW();
-
- Vec4 const betax_sum = MultiplyAdd( part1, onethird_onethird2, MultiplyAdd( part2, twothirds_twothirds2, part3 ) );
- Vec4 const beta2_sum = betax_sum.SplatW();
-
- Vec4 const alphabeta_sum = twonineths*( part1 + part2 ).SplatW();
-
- // compute the least-squares optimal points
- Vec4 factor = Reciprocal( NegativeMultiplySubtract( alphabeta_sum, alphabeta_sum, alpha2_sum*beta2_sum ) );
- Vec4 a = NegativeMultiplySubtract( betax_sum, alphabeta_sum, alphax_sum*beta2_sum )*factor;
- Vec4 b = NegativeMultiplySubtract( alphax_sum, alphabeta_sum, betax_sum*alpha2_sum )*factor;
-
- // clamp to the grid
- a = Min( one, Max( zero, a ) );
- b = Min( one, Max( zero, b ) );
- a = Truncate( MultiplyAdd( grid, a, half ) )*gridrcp;
- b = Truncate( MultiplyAdd( grid, b, half ) )*gridrcp;
-
- // compute the error (we skip the constant xxsum)
- Vec4 e1 = MultiplyAdd( a*a, alpha2_sum, b*b*beta2_sum );
- Vec4 e2 = NegativeMultiplySubtract( a, alphax_sum, a*b*alphabeta_sum );
- Vec4 e3 = NegativeMultiplySubtract( b, betax_sum, e2 );
- Vec4 e4 = MultiplyAdd( two, e3, e1 );
-
- // apply the metric to the error term
- Vec4 e5 = e4*m_metric;
- Vec4 error = e5.SplatX() + e5.SplatY() + e5.SplatZ();
-
- // keep the solution if it wins
- if( CompareAnyLessThan( error, besterror ) )
- {
- beststart = a;
- bestend = b;
- besterror = error;
- besti = i;
- bestj = j;
- bestk = k;
- bestiteration = iterationIndex;
- }
-
- // advance
- if( k == count )
- break;
- part2 += m_points_weights[k];
- ++k;
- }
-
- // advance
- if( j == count )
- break;
- part1 += m_points_weights[j];
- ++j;
- }
-
- // advance
- part0 += m_points_weights[i];
- }
-
- // stop if we didn't improve in this iteration
- if( bestiteration != iterationIndex )
- break;
-
- // advance if possible
- ++iterationIndex;
- if( iterationIndex == m_iterationCount )
- break;
-
- // stop if a new iteration is an ordering that has already been tried
- Vec3 axis = ( bestend - beststart ).GetVec3();
- if( !ConstructOrdering( axis, iterationIndex ) )
- break;
- }
-
- // save the block if necessary
- if( CompareAnyLessThan( besterror, m_besterror ) )
- {
- // remap the indices
- u8 const* order = ( u8* )m_order + 16*bestiteration;
-
- u8 unordered[16];
- for( int m = 0; m < besti; ++m )
- unordered[order[m]] = 0;
- for( int m = besti; m < bestj; ++m )
- unordered[order[m]] = 2;
- for( int m = bestj; m < bestk; ++m )
- unordered[order[m]] = 3;
- for( int m = bestk; m < count; ++m )
- unordered[order[m]] = 1;
-
- m_colours->RemapIndices( unordered, bestindices );
-
- // save the block
- WriteColourBlock4( beststart.GetVec3(), bestend.GetVec3(), bestindices, block );
-
- // save the error
- m_besterror = besterror;
- }
-}
-
-} // namespace squish
diff --git a/tools/depends/native/libsquish-native/src/clusterfit.h b/tools/depends/native/libsquish-native/src/clusterfit.h
deleted file mode 100644
index ef5959c45a..0000000000
--- a/tools/depends/native/libsquish-native/src/clusterfit.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
- Copyright (c) 2007 Ignacio Castano icastano@nvidia.com
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_CLUSTERFIT_H
-#define SQUISH_CLUSTERFIT_H
-
-#include <squish.h>
-#include "maths.h"
-#include "simd.h"
-#include "colourfit.h"
-
-namespace squish {
-
-class ClusterFit : public ColourFit
-{
-public:
- ClusterFit( ColourSet const* colours, int flags, float* metric );
-
-private:
- bool ConstructOrdering( Vec3 const& axis, int iteration );
-
- virtual void Compress3( void* block );
- virtual void Compress4( void* block );
-
- enum { kMaxIterations = 8 };
-
- int m_iterationCount;
- Vec3 m_principle;
- u8 m_order[16*kMaxIterations];
- Vec4 m_points_weights[16];
- Vec4 m_xsum_wsum;
- Vec4 m_metric;
- Vec4 m_besterror;
-};
-
-} // namespace squish
-
-#endif // ndef SQUISH_CLUSTERFIT_H
diff --git a/tools/depends/native/libsquish-native/src/colourblock.cpp b/tools/depends/native/libsquish-native/src/colourblock.cpp
deleted file mode 100644
index e6a5788b74..0000000000
--- a/tools/depends/native/libsquish-native/src/colourblock.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#include "colourblock.h"
-
-namespace squish {
-
-static int FloatToInt( float a, int limit )
-{
- // use ANSI round-to-zero behaviour to get round-to-nearest
- int i = ( int )( a + 0.5f );
-
- // clamp to the limit
- if( i < 0 )
- i = 0;
- else if( i > limit )
- i = limit;
-
- // done
- return i;
-}
-
-static int FloatTo565( Vec3::Arg colour )
-{
- // get the components in the correct range
- int r = FloatToInt( 31.0f*colour.X(), 31 );
- int g = FloatToInt( 63.0f*colour.Y(), 63 );
- int b = FloatToInt( 31.0f*colour.Z(), 31 );
-
- // pack into a single value
- return ( r << 11 ) | ( g << 5 ) | b;
-}
-
-static void WriteColourBlock( int a, int b, u8* indices, void* block )
-{
- // get the block as bytes
- u8* bytes = ( u8* )block;
-
- // write the endpoints
- bytes[0] = ( u8 )( a & 0xff );
- bytes[1] = ( u8 )( a >> 8 );
- bytes[2] = ( u8 )( b & 0xff );
- bytes[3] = ( u8 )( b >> 8 );
-
- // write the indices
- for( int i = 0; i < 4; ++i )
- {
- u8 const* ind = indices + 4*i;
- bytes[4 + i] = ind[0] | ( ind[1] << 2 ) | ( ind[2] << 4 ) | ( ind[3] << 6 );
- }
-}
-
-void WriteColourBlock3( Vec3::Arg start, Vec3::Arg end, u8 const* indices, void* block )
-{
- // get the packed values
- int a = FloatTo565( start );
- int b = FloatTo565( end );
-
- // remap the indices
- u8 remapped[16];
- if( a <= b )
- {
- // use the indices directly
- for( int i = 0; i < 16; ++i )
- remapped[i] = indices[i];
- }
- else
- {
- // swap a and b
- std::swap( a, b );
- for( int i = 0; i < 16; ++i )
- {
- if( indices[i] == 0 )
- remapped[i] = 1;
- else if( indices[i] == 1 )
- remapped[i] = 0;
- else
- remapped[i] = indices[i];
- }
- }
-
- // write the block
- WriteColourBlock( a, b, remapped, block );
-}
-
-void WriteColourBlock4( Vec3::Arg start, Vec3::Arg end, u8 const* indices, void* block )
-{
- // get the packed values
- int a = FloatTo565( start );
- int b = FloatTo565( end );
-
- // remap the indices
- u8 remapped[16];
- if( a < b )
- {
- // swap a and b
- std::swap( a, b );
- for( int i = 0; i < 16; ++i )
- remapped[i] = ( indices[i] ^ 0x1 ) & 0x3;
- }
- else if( a == b )
- {
- // use index 0
- for( int i = 0; i < 16; ++i )
- remapped[i] = 0;
- }
- else
- {
- // use the indices directly
- for( int i = 0; i < 16; ++i )
- remapped[i] = indices[i];
- }
-
- // write the block
- WriteColourBlock( a, b, remapped, block );
-}
-
-static int Unpack565( u8 const* packed, u8* colour )
-{
- // build the packed value
- int value = ( int )packed[0] | ( ( int )packed[1] << 8 );
-
- // get the components in the stored range
- u8 red = ( u8 )( ( value >> 11 ) & 0x1f );
- u8 green = ( u8 )( ( value >> 5 ) & 0x3f );
- u8 blue = ( u8 )( value & 0x1f );
-
- // scale up to 8 bits
- colour[0] = ( red << 3 ) | ( red >> 2 );
- colour[1] = ( green << 2 ) | ( green >> 4 );
- colour[2] = ( blue << 3 ) | ( blue >> 2 );
- colour[3] = 255;
-
- // return the value
- return value;
-}
-
-void DecompressColour( u8* rgba, void const* block, bool isDxt1 )
-{
- // get the block bytes
- u8 const* bytes = reinterpret_cast< u8 const* >( block );
-
- // unpack the endpoints
- u8 codes[16];
- int a = Unpack565( bytes, codes );
- int b = Unpack565( bytes + 2, codes + 4 );
-
- // generate the midpoints
- for( int i = 0; i < 3; ++i )
- {
- int c = codes[i];
- int d = codes[4 + i];
-
- if( isDxt1 && a <= b )
- {
- codes[8 + i] = ( u8 )( ( c + d )/2 );
- codes[12 + i] = 0;
- }
- else
- {
- codes[8 + i] = ( u8 )( ( 2*c + d )/3 );
- codes[12 + i] = ( u8 )( ( c + 2*d )/3 );
- }
- }
-
- // fill in alpha for the intermediate values
- codes[8 + 3] = 255;
- codes[12 + 3] = ( isDxt1 && a <= b ) ? 0 : 255;
-
- // unpack the indices
- u8 indices[16];
- for( int i = 0; i < 4; ++i )
- {
- u8* ind = indices + 4*i;
- u8 packed = bytes[4 + i];
-
- ind[0] = packed & 0x3;
- ind[1] = ( packed >> 2 ) & 0x3;
- ind[2] = ( packed >> 4 ) & 0x3;
- ind[3] = ( packed >> 6 ) & 0x3;
- }
-
- // store out the colours
- for( int i = 0; i < 16; ++i )
- {
- u8 offset = 4*indices[i];
- for( int j = 0; j < 4; ++j )
- rgba[4*i + j] = codes[offset + j];
- }
-}
-
-} // namespace squish
diff --git a/tools/depends/native/libsquish-native/src/colourblock.h b/tools/depends/native/libsquish-native/src/colourblock.h
deleted file mode 100644
index df0a47217f..0000000000
--- a/tools/depends/native/libsquish-native/src/colourblock.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_COLOURBLOCK_H
-#define SQUISH_COLOURBLOCK_H
-
-#include <squish.h>
-#include "maths.h"
-
-namespace squish {
-
-void WriteColourBlock3( Vec3::Arg start, Vec3::Arg end, u8 const* indices, void* block );
-void WriteColourBlock4( Vec3::Arg start, Vec3::Arg end, u8 const* indices, void* block );
-
-void DecompressColour( u8* rgba, void const* block, bool isDxt1 );
-
-} // namespace squish
-
-#endif // ndef SQUISH_COLOURBLOCK_H
diff --git a/tools/depends/native/libsquish-native/src/colourfit.cpp b/tools/depends/native/libsquish-native/src/colourfit.cpp
deleted file mode 100644
index 11efa46748..0000000000
--- a/tools/depends/native/libsquish-native/src/colourfit.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#include "colourfit.h"
-#include "colourset.h"
-
-namespace squish {
-
-ColourFit::ColourFit( ColourSet const* colours, int flags )
- : m_colours( colours ),
- m_flags( flags )
-{
-}
-
-ColourFit::~ColourFit()
-{
-}
-
-void ColourFit::Compress( void* block )
-{
- bool isDxt1 = ( ( m_flags & kDxt1 ) != 0 );
- if( isDxt1 )
- {
- Compress3( block );
- if( !m_colours->IsTransparent() )
- Compress4( block );
- }
- else
- Compress4( block );
-}
-
-} // namespace squish
diff --git a/tools/depends/native/libsquish-native/src/colourfit.h b/tools/depends/native/libsquish-native/src/colourfit.h
deleted file mode 100644
index 5b684a923a..0000000000
--- a/tools/depends/native/libsquish-native/src/colourfit.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_COLOURFIT_H
-#define SQUISH_COLOURFIT_H
-
-#include <squish.h>
-#include <limits.h>
-#include "maths.h"
-
-namespace squish {
-
-class ColourSet;
-
-class ColourFit
-{
-public:
- ColourFit( ColourSet const* colours, int flags );
- virtual ~ColourFit();
-
- void Compress( void* block );
-
-protected:
- virtual void Compress3( void* block ) = 0;
- virtual void Compress4( void* block ) = 0;
-
- ColourSet const* m_colours;
- int m_flags;
-};
-
-} // namespace squish
-
-#endif // ndef SQUISH_COLOURFIT_H
diff --git a/tools/depends/native/libsquish-native/src/colourset.cpp b/tools/depends/native/libsquish-native/src/colourset.cpp
deleted file mode 100644
index 97d29d9873..0000000000
--- a/tools/depends/native/libsquish-native/src/colourset.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#include "colourset.h"
-
-namespace squish {
-
-ColourSet::ColourSet( u8 const* rgba, int mask, int flags )
- : m_count( 0 ),
- m_transparent( false )
-{
- // check the compression mode for dxt1
- bool isDxt1 = ( ( flags & kDxt1 ) != 0 );
- bool weightByAlpha = ( ( flags & kWeightColourByAlpha ) != 0 );
-
- // create the minimal set
- for( int i = 0; i < 16; ++i )
- {
- // check this pixel is enabled
- int bit = 1 << i;
- if( ( mask & bit ) == 0 )
- {
- m_remap[i] = -1;
- continue;
- }
-
- // check for transparent pixels when using dxt1
- if( isDxt1 && rgba[4*i + 3] < 128 )
- {
- m_remap[i] = -1;
- m_transparent = true;
- continue;
- }
-
- // loop over previous points for a match
- for( int j = 0;; ++j )
- {
- // allocate a new point
- if( j == i )
- {
- // normalise coordinates to [0,1]
- float x = ( float )rgba[4*i] / 255.0f;
- float y = ( float )rgba[4*i + 1] / 255.0f;
- float z = ( float )rgba[4*i + 2] / 255.0f;
-
- // ensure there is always non-zero weight even for zero alpha
- float w = ( float )( rgba[4*i + 3] + 1 ) / 256.0f;
-
- // add the point
- m_points[m_count] = Vec3( x, y, z );
- m_weights[m_count] = ( weightByAlpha ? w : 1.0f );
- m_remap[i] = m_count;
-
- // advance
- ++m_count;
- break;
- }
-
- // check for a match
- int oldbit = 1 << j;
- bool match = ( ( mask & oldbit ) != 0 )
- && ( rgba[4*i] == rgba[4*j] )
- && ( rgba[4*i + 1] == rgba[4*j + 1] )
- && ( rgba[4*i + 2] == rgba[4*j + 2] )
- && ( rgba[4*j + 3] >= 128 || !isDxt1 );
- if( match )
- {
- // get the index of the match
- int index = m_remap[j];
-
- // ensure there is always non-zero weight even for zero alpha
- float w = ( float )( rgba[4*i + 3] + 1 ) / 256.0f;
-
- // map to this point and increase the weight
- m_weights[index] += ( weightByAlpha ? w : 1.0f );
- m_remap[i] = index;
- break;
- }
- }
- }
-
- // square root the weights
- for( int i = 0; i < m_count; ++i )
- m_weights[i] = std::sqrt( m_weights[i] );
-}
-
-void ColourSet::RemapIndices( u8 const* source, u8* target ) const
-{
- for( int i = 0; i < 16; ++i )
- {
- int j = m_remap[i];
- if( j == -1 )
- target[i] = 3;
- else
- target[i] = source[j];
- }
-}
-
-} // namespace squish
diff --git a/tools/depends/native/libsquish-native/src/colourset.h b/tools/depends/native/libsquish-native/src/colourset.h
deleted file mode 100644
index dcf56ae28e..0000000000
--- a/tools/depends/native/libsquish-native/src/colourset.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_COLOURSET_H
-#define SQUISH_COLOURSET_H
-
-#include <squish.h>
-#include "maths.h"
-
-namespace squish {
-
-/*! @brief Represents a set of block colours
-*/
-class ColourSet
-{
-public:
- ColourSet( u8 const* rgba, int mask, int flags );
-
- int GetCount() const { return m_count; }
- Vec3 const* GetPoints() const { return m_points; }
- float const* GetWeights() const { return m_weights; }
- bool IsTransparent() const { return m_transparent; }
-
- void RemapIndices( u8 const* source, u8* target ) const;
-
-private:
- int m_count;
- Vec3 m_points[16];
- float m_weights[16];
- int m_remap[16];
- bool m_transparent;
-};
-
-} // namespace sqish
-
-#endif // ndef SQUISH_COLOURSET_H
diff --git a/tools/depends/native/libsquish-native/src/config.h b/tools/depends/native/libsquish-native/src/config.h
deleted file mode 100644
index 00a2d068bf..0000000000
--- a/tools/depends/native/libsquish-native/src/config.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_CONFIG_H
-#define SQUISH_CONFIG_H
-
-// Set to 1 when building squish to use Altivec instructions.
-#ifndef SQUISH_USE_ALTIVEC
-#if defined(__ALTIVEC__)
-#define SQUISH_USE_ALTIVEC 1
-#else
-#define SQUISH_USE_ALTIVEC 0
-#endif
-#endif
-
-// Set to 1 or 2 when building squish to use SSE or SSE2 instructions.
-#ifndef SQUISH_USE_SSE
-#if defined(__SSE2__)
-#define SQUISH_USE_SSE 2
-#elif defined(__SSE__)
-#define SQUISH_USE_SSE 1
-#else
-#define SQUISH_USE_SSE 0
-#endif
-#endif
-
-// Internally set SQUISH_USE_SIMD when either Altivec or SSE is available.
-#if SQUISH_USE_ALTIVEC && SQUISH_USE_SSE
-#error "Cannot enable both Altivec and SSE!"
-#endif
-#if SQUISH_USE_ALTIVEC || SQUISH_USE_SSE
-#define SQUISH_USE_SIMD 1
-#else
-#define SQUISH_USE_SIMD 0
-#endif
-
-#endif // ndef SQUISH_CONFIG_H
diff --git a/tools/depends/native/libsquish-native/src/config.in b/tools/depends/native/libsquish-native/src/config.in
deleted file mode 100644
index fdca022003..0000000000
--- a/tools/depends/native/libsquish-native/src/config.in
+++ /dev/null
@@ -1,21 +0,0 @@
-# config file used for the Makefile only
-
-# define to 1 to use Altivec instructions
-USE_ALTIVEC ?= 0
-
-# define to 1 to use SSE2 instructions
-USE_SSE ?= 0
-
-# default flags
-CXXFLAGS ?= -O2
-ifeq ($(USE_ALTIVEC),1)
-CPPFLAGS += -DSQUISH_USE_ALTIVEC=1
-CXXFLAGS += -maltivec
-endif
-ifeq ($(USE_SSE),1)
-CPPFLAGS += -DSQUISH_USE_SSE=2
-CXXFLAGS += -msse
-endif
-
-# where should we install to
-INSTALL_DIR ?= @PREFIX@
diff --git a/tools/depends/native/libsquish-native/src/extra/squishgen.cpp b/tools/depends/native/libsquish-native/src/extra/squishgen.cpp
deleted file mode 100644
index d7d1ee0d90..0000000000
--- a/tools/depends/native/libsquish-native/src/extra/squishgen.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#include <iostream>
-
-struct SourceBlock
-{
- int start;
- int end;
- int error;
-};
-
-struct TargetValue
-{
- SourceBlock sources[2];
-};
-
-static void GenerateData( std::string const& name, int bits, int colours )
-{
- TargetValue values[256];
-
- // initialise the data
- for( int target = 0; target < 256; ++target )
- for( int index = 0; index < colours; ++index )
- values[target].sources[index].error = 255;
-
- // loop over all possible source points
- int count = ( 1 << bits );
- for( int value1 = 0; value1 < count; ++value1 )
- {
- for( int value2 = 0; value2 < count; ++value2 )
- {
- // compute the 8-bit endpoints
- int a = ( value1 << ( 8 - bits ) ) | ( value1 >> ( 2*bits - 8 ) );
- int b = ( value2 << ( 8 - bits ) ) | ( value2 >> ( 2*bits - 8 ) );
-
- // fill in the codebook with the these and intermediates
- int codes[2];
- codes[0] = a;
- if( colours == 3 )
- codes[1] = ( a + b )/2;
- else
- codes[1] = ( 2*a + b )/3;
-
- // mark each target point with the endpoints and index needed for it
- for( int index = 0; index < 2; ++index )
- {
- int target = codes[index];
-
- SourceBlock& block = values[target].sources[index];
- if( block.error != 0 )
- {
- block.start = value1;
- block.end = value2;
- block.error = 0;
- }
- }
- }
- }
-
- // iteratively fill in the missing values
- for( ;; )
- {
- bool stable = true;
- for( int index = 0; index < 2; ++index )
- {
- for( int target = 0; target < 256; ++target )
- {
- if( target != 255 )
- {
- SourceBlock& current = values[target].sources[index];
- SourceBlock& next = values[target + 1].sources[index];
- if( current.error > next.error + 1 )
- {
- current.start = next.start;
- current.end = next.end;
- current.error = next.error + 1;
- stable = false;
- }
- }
- if( target != 0 )
- {
- SourceBlock& current = values[target].sources[index];
- SourceBlock& previous = values[target - 1].sources[index];
- if( current.error > previous.error + 1 )
- {
- current.start = previous.start;
- current.end = previous.end;
- current.error = previous.error + 1;
- stable = false;
- }
- }
- }
- }
- if( stable )
- break;
- }
-
- // debug
- std::cout << "\nstatic SingleColourLookup const " << name << "[] = \n{\n";
- for( int i = 0;; )
- {
- std::cout << "\t{ { ";
- for( int j = 0;; )
- {
- SourceBlock const& block = values[i].sources[j];
- if( j < colours )
- std::cout << "{ " << block.start << ", " << block.end << ", " << block.error << " }";
- else
- std::cout << "{ 0, 0, 0 }";
- if( ++j == 2 )
- break;
- std::cout << ", ";
- }
- std::cout << " } }";
- if( ++i == 256 )
- break;
- std::cout << ",\n";
- }
- std::cout << "\n};\n";
-}
-
-int main()
-{
- GenerateData( "lookup_5_3", 5, 3 );
- GenerateData( "lookup_6_3", 6, 3 );
- GenerateData( "lookup_5_4", 5, 4 );
- GenerateData( "lookup_6_4", 6, 4 );
-}
diff --git a/tools/depends/native/libsquish-native/src/extra/squishpng.cpp b/tools/depends/native/libsquish-native/src/extra/squishpng.cpp
deleted file mode 100644
index f443656dab..0000000000
--- a/tools/depends/native/libsquish-native/src/extra/squishpng.cpp
+++ /dev/null
@@ -1,546 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-/*! @file
-
- @brief Test program that compresses images loaded using the PNG format.
-
- This program requires libpng for PNG input and output, and is designed to
- test the RMS error for DXT compression for a set of test images.
-
- This program uses the high-level image compression and decompression
- functions that process an entire image at a time.
-*/
-
-#include <iostream>
-#include <string>
-#include <sstream>
-#include <ctime>
-#include <cmath>
-#include <squish.h>
-#include <png.h>
-
-#ifdef _MSC_VER
-#pragma warning( disable: 4511 4512 )
-#endif // def _MSC_VER
-
-using namespace squish;
-
-//! Simple exception class.
-class Error : public std::exception
-{
-public:
- Error( std::string const& excuse ) : m_excuse( excuse ) {}
- ~Error() throw() {}
-
- virtual char const* what() const throw() { return m_excuse.c_str(); }
-
-private:
- std::string m_excuse;
-};
-
-//! Base class to make derived classes non-copyable
-class NonCopyable
-{
-public:
- NonCopyable() {}
-
-private:
- NonCopyable( NonCopyable const& );
- NonCopyable& operator=( NonCopyable const& );
-};
-
-//! Memory object.
-class Mem : NonCopyable
-{
-public:
- Mem() : m_p( 0 ) {}
- explicit Mem( int size ) : m_p( new u8[size] ) {}
- ~Mem() { delete[] m_p; }
-
- void Reset( int size )
- {
- u8 *p = new u8[size];
- delete m_p;
- m_p = p;
- }
-
- u8* Get() const { return m_p; }
-
-private:
- u8* m_p;
-};
-
-//! File object.
-class File : NonCopyable
-{
-public:
- explicit File( FILE* fp ) : m_fp( fp ) {}
- ~File() { if( m_fp ) fclose( m_fp ); }
-
- bool IsValid() const { return m_fp != 0; }
- FILE* Get() const { return m_fp; }
-
-private:
- FILE* m_fp;
-};
-
-//! PNG read object.
-class PngReadStruct : NonCopyable
-{
-public:
- PngReadStruct()
- : m_png( 0 ),
- m_info( 0 ),
- m_end( 0 )
- {
- m_png = png_create_read_struct( PNG_LIBPNG_VER_STRING, 0, 0, 0 );
- if( !m_png )
- throw Error( "failed to create png read struct" );
-
- m_info = png_create_info_struct( m_png );
- m_end = png_create_info_struct( m_png );
- if( !m_info || !m_end )
- {
- png_infopp info = m_info ? &m_info : 0;
- png_infopp end = m_end ? &m_end : 0;
- png_destroy_read_struct( &m_png, info, end );
- throw Error( "failed to create png info structs" );
- }
- }
-
- ~PngReadStruct()
- {
- png_destroy_read_struct( &m_png, &m_info, &m_end );
- }
-
- png_structp GetPng() const { return m_png; }
- png_infop GetInfo() const { return m_info; }
-
-private:
- png_structp m_png;
- png_infop m_info, m_end;
-};
-
-//! PNG write object.
-class PngWriteStruct : NonCopyable
-{
-public:
- PngWriteStruct()
- : m_png( 0 ),
- m_info( 0 )
- {
- m_png = png_create_write_struct( PNG_LIBPNG_VER_STRING, 0, 0, 0 );
- if( !m_png )
- throw Error( "failed to create png read struct" );
-
- m_info = png_create_info_struct( m_png );
- if( !m_info )
- {
- png_infopp info = m_info ? &m_info : 0;
- png_destroy_write_struct( &m_png, info );
- throw Error( "failed to create png info structs" );
- }
- }
-
- ~PngWriteStruct()
- {
- png_destroy_write_struct( &m_png, &m_info );
- }
-
- png_structp GetPng() const { return m_png; }
- png_infop GetInfo() const { return m_info; }
-
-private:
- png_structp m_png;
- png_infop m_info;
-};
-
-//! PNG rows object.
-class PngRows : NonCopyable
-{
-public:
- PngRows( int pitch, int height ) : m_height( height )
- {
- m_rows = new png_bytep[m_height];
- for( int i = 0; i < m_height; ++i )
- m_rows[i] = new png_byte[pitch];
- }
-
- ~PngRows()
- {
- for( int i = 0; i < m_height; ++i )
- delete[] m_rows[i];
- delete[] m_rows;
- }
-
- png_bytep* Get() const { return m_rows; }
-
- png_bytep operator[](int y) const { return m_rows[y]; }
-
-private:
- png_bytep* m_rows;
- int m_height;
-};
-
-//! Represents a DXT compressed image in memory.
-struct DxtData
-{
- int width;
- int height;
- int format; //!< Either kDxt1, kDxt3 or kDxt5.
- Mem data;
- bool isColour;
- bool isAlpha;
-};
-
-//! Represents an uncompressed RGBA image in memory.
-class Image
-{
-public:
- Image();
-
- void LoadPng( std::string const& fileName );
- void SavePng( std::string const& fileName ) const;
-
- void Decompress( DxtData const& dxt );
- void Compress( DxtData& dxt, int flags ) const;
-
- double GetRmsError( Image const& image ) const;
-
-private:
- int m_width;
- int m_height;
- bool m_isColour; //!< Either colour or luminance.
- bool m_isAlpha; //!< Either alpha or not.
- Mem m_pixels;
-};
-
-Image::Image()
- : m_width( 0 ),
- m_height( 0 ),
- m_isColour( false ),
- m_isAlpha( false )
-{
-}
-
-void Image::LoadPng( std::string const& fileName )
-{
- // open the source file
- File file( fopen( fileName.c_str(), "rb" ) );
- if( !file.IsValid() )
- {
- std::ostringstream oss;
- oss << "failed to open \"" << fileName << "\" for reading";
- throw Error( oss.str() );
- }
-
- // check the signature bytes
- png_byte header[8];
- size_t check = fread( header, 1, 8, file.Get() );
- if( check != 8 )
- throw Error( "file read error" );
- if( png_sig_cmp( header, 0, 8 ) )
- {
- std::ostringstream oss;
- oss << "\"" << fileName << "\" does not look like a png file";
- throw Error( oss.str() );
- }
-
- // read the image into memory
- PngReadStruct png;
- png_init_io( png.GetPng(), file.Get() );
- png_set_sig_bytes( png.GetPng(), 8 );
- png_read_png( png.GetPng(), png.GetInfo(), PNG_TRANSFORM_EXPAND, 0 );
-
- // get the image info
- png_uint_32 width;
- png_uint_32 height;
- int bitDepth;
- int colourType;
- png_get_IHDR( png.GetPng(), png.GetInfo(), &width, &height, &bitDepth, &colourType, 0, 0, 0 );
-
- // check the image is 8 bit
- if( bitDepth != 8 )
- {
- std::ostringstream oss;
- oss << "cannot process " << bitDepth << "-bit image (bit depth must be 8)";
- throw Error( oss.str() );
- }
-
- // copy the data into a contiguous array
- m_width = width;
- m_height = height;
- m_isColour = ( ( colourType & PNG_COLOR_MASK_COLOR ) != 0 );
- m_isAlpha = ( ( colourType & PNG_COLOR_MASK_ALPHA ) != 0 );
- m_pixels.Reset(4*width*height);
-
- // get the image rows
- png_bytep const *rows = png_get_rows( png.GetPng(), png.GetInfo() );
- if( !rows )
- throw Error( "failed to get image rows" );
-
- // copy the pixels into the storage
- u8 *dest = m_pixels.Get();
- for( int y = 0; y < m_height; ++y )
- {
- u8 const *src = rows[y];
- for( int x = 0; x < m_width; ++x )
- {
- if( m_isColour )
- {
- dest[0] = src[0];
- dest[1] = src[1];
- dest[2] = src[2];
- src += 3;
- }
- else
- {
- u8 lum = *src++;
- dest[0] = lum;
- dest[1] = lum;
- dest[2] = lum;
- }
-
- if( m_isAlpha )
- dest[3] = *src++;
- else
- dest[3] = 255;
-
- dest += 4;
- }
- }
-}
-
-void Image::SavePng( std::string const& fileName ) const
-{
- // create the target rows
- int const pixelSize = ( m_isColour ? 3 : 1 ) + ( m_isAlpha ? 1 : 0 );
- PngRows rows( m_width*pixelSize, m_height );
-
- // fill the rows with pixel data
- u8 const *src = m_pixels.Get();
- for( int y = 0; y < m_height; ++y )
- {
- u8 *dest = rows[y];
- for( int x = 0; x < m_width; ++x )
- {
- if( m_isColour )
- {
- dest[0] = src[0];
- dest[1] = src[1];
- dest[2] = src[2];
- dest += 3;
- }
- else
- *dest++ = src[1];
-
- if( m_isAlpha )
- *dest++ = src[3];
-
- src += 4;
- }
- }
-
- // set up the image
- PngWriteStruct png;
- png_set_IHDR(
- png.GetPng(), png.GetInfo(), m_width, m_height,
- 8, ( m_isColour ? PNG_COLOR_MASK_COLOR : 0) | ( m_isAlpha ? PNG_COLOR_MASK_ALPHA : 0 ),
- PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT
- );
-
- // open the target file
- File file( fopen( fileName.c_str(), "wb" ) );
- if( !file.IsValid() )
- {
- std::ostringstream oss;
- oss << "failed to open \"" << fileName << "\" for writing";
- throw Error( oss.str() );
- }
-
- // write the image
- png_set_rows( png.GetPng(), png.GetInfo(), rows.Get() );
- png_init_io( png.GetPng(), file.Get() );
- png_write_png( png.GetPng(), png.GetInfo(), PNG_TRANSFORM_IDENTITY, 0 );
-}
-
-void Image::Decompress( DxtData const& dxt )
-{
- // allocate storage
- m_width = dxt.width;
- m_height = dxt.height;
- m_isColour = dxt.isColour;
- m_isAlpha = dxt.isAlpha;
- m_pixels.Reset( 4*m_width*m_height );
-
- // use the whole image decompression function to do the work
- DecompressImage( m_pixels.Get(), m_width, m_height, dxt.data.Get(), dxt.format );
-}
-
-void Image::Compress( DxtData& dxt, int flags ) const
-{
- // work out how much memory we need
- int storageSize = GetStorageRequirements( m_width, m_height, flags );
-
- // set the structure fields and allocate it
- dxt.width = m_width;
- dxt.height = m_height;
- dxt.format = flags & ( kDxt1 | kDxt3 | kDxt5 );
- dxt.isColour = m_isColour;
- dxt.isAlpha = m_isAlpha;
- dxt.data.Reset( storageSize );
-
- // use the whole image compression function to do the work
- CompressImage( m_pixels.Get(), m_width, m_height, dxt.data.Get(), flags );
-}
-
-double Image::GetRmsError( Image const& image ) const
-{
- if( m_width != image.m_width || m_height != image.m_height )
- throw Error( "image dimensions mismatch when computing RMS error" );
-
- // accumulate colour error
- double difference = 0;
- u8 const *a = m_pixels.Get();
- u8 const *b = image.m_pixels.Get();
- for( int y = 0; y < m_height; ++y )
- {
- for( int x = 0; x < m_width; ++x )
- {
- int d0 = ( int )a[0] - ( int )b[0];
- int d1 = ( int )a[1] - ( int )b[1];
- int d2 = ( int )a[2] - ( int )b[2];
- difference += ( double )( d0*d0 + d1*d1 + d2*d2 );
- a += 4;
- b += 4;
- }
- }
- return std::sqrt( difference/( double )( m_width*m_height ) );
-}
-
-int main( int argc, char* argv[] )
-{
- try
- {
- // parse the command-line
- std::string sourceFileName;
- std::string targetFileName;
- int format = kDxt1;
- int fit = kColourClusterFit;
- int extra = 0;
- bool help = false;
- bool arguments = true;
- bool error = false;
- for( int i = 1; i < argc; ++i )
- {
- // check for options
- char const* word = argv[i];
- if( arguments && word[0] == '-' )
- {
- for( int j = 1; word[j] != '\0'; ++j )
- {
- switch( word[j] )
- {
- case 'h': help = true; break;
- case '1': format = kDxt1; break;
- case '3': format = kDxt3; break;
- case '5': format = kDxt5; break;
- case 'r': fit = kColourRangeFit; break;
- case 'i': fit = kColourIterativeClusterFit; break;
- case 'w': extra = kWeightColourByAlpha; break;
- case '-': arguments = false; break;
- default:
- std::cerr << "squishpng error: unknown option '" << word[j] << "'" << std::endl;
- error = true;
- }
- }
- }
- else
- {
- if( sourceFileName.empty() )
- sourceFileName.assign( word );
- else if( targetFileName.empty() )
- targetFileName.assign( word );
- else
- {
- std::cerr << "squishpng error: unexpected argument \"" << word << "\"" << std::endl;
- error = true;
- }
- }
- }
-
- // check arguments
- if( sourceFileName.empty() )
- {
- std::cerr << "squishpng error: no source file given" << std::endl;
- error = true;
- }
- if( help || error )
- {
- std::cout
- << "SYNTAX" << std::endl
- << "\tsquishpng [-135riw] <source> [<target>]" << std::endl
- << "OPTIONS" << std::endl
- << "\t-h\tPrint this help message" << std::endl
- << "\t-135\tSpecifies whether to use DXT1 (default), DXT3 or DXT5 compression" << std::endl
- << "\t-r\tUse the fast but inferior range-based colour compressor" << std::endl
- << "\t-i\tUse the very slow but slightly better iterative colour compressor" << std::endl
- << "\t-w\tWeight colour values by alpha in the cluster colour compressor" << std::endl
- ;
-
- return error ? -1 : 0;
- }
-
- // load the source image
- Image sourceImage;
- sourceImage.LoadPng( sourceFileName );
-
- // compress to DXT
- DxtData dxt;
- sourceImage.Compress( dxt, format | fit | extra );
-
- // decompress back
- Image targetImage;
- targetImage.Decompress( dxt );
-
- // compare the images
- double rmsError = sourceImage.GetRmsError( targetImage );
- std::cout << sourceFileName << " " << rmsError << std::endl;
-
- // save the target image if necessary
- if( !targetFileName.empty() )
- targetImage.SavePng( targetFileName );
- }
- catch( std::exception& excuse )
- {
- // complain
- std::cerr << "squishpng error: " << excuse.what() << std::endl;
- return -1;
- }
-
- // done
- return 0;
-}
diff --git a/tools/depends/native/libsquish-native/src/extra/squishtest.cpp b/tools/depends/native/libsquish-native/src/extra/squishtest.cpp
deleted file mode 100644
index fb09208694..0000000000
--- a/tools/depends/native/libsquish-native/src/extra/squishtest.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-/*! @file
-
- @brief This program tests the error for 1 and 2-colour DXT compression.
-
- This tests the effectiveness of the DXT compression algorithm for all
- possible 1 and 2-colour blocks of pixels.
-*/
-
-#include <squish.h>
-#include <iostream>
-#include <cmath>
-#include <cfloat>
-#include <cstdlib>
-
-using namespace squish;
-
-double GetColourError( u8 const* a, u8 const* b )
-{
- double error = 0.0;
- for( int i = 0; i < 16; ++i )
- {
- for( int j = 0; j < 3; ++j )
- {
- int index = 4*i + j;
- int diff = ( int )a[index] - ( int )b[index];
- error += ( double )( diff*diff );
- }
- }
- return error / 16.0;
-}
-
-void TestOneColour( int flags )
-{
- u8 input[4*16];
- u8 output[4*16];
- u8 block[16];
-
- double avg = 0.0, min = DBL_MAX, max = -DBL_MAX;
- int counter = 0;
-
- // test all single-channel colours
- for( int i = 0; i < 16*4; ++i )
- input[i] = ( ( i % 4 ) == 3 ) ? 255 : 0;
- for( int channel = 0; channel < 3; ++channel )
- {
- for( int value = 0; value < 255; ++value )
- {
- // set the channnel value
- for( int i = 0; i < 16; ++i )
- input[4*i + channel] = ( u8 )value;
-
- // compress and decompress
- Compress( input, block, flags );
- Decompress( output, block, flags );
-
- // test the results
- double rm = GetColourError( input, output );
- double rms = std::sqrt( rm );
-
- // accumulate stats
- min = std::min( min, rms );
- max = std::max( max, rms );
- avg += rm;
- ++counter;
- }
-
- // reset the channel value
- for( int i = 0; i < 16; ++i )
- input[4*i + channel] = 0;
- }
-
- // finish stats
- avg = std::sqrt( avg/counter );
-
- // show stats
- std::cout << "one colour error (min, max, avg): "
- << min << ", " << max << ", " << avg << std::endl;
-}
-
-void TestOneColourRandom( int flags )
-{
- u8 input[4*16];
- u8 output[4*16];
- u8 block[16];
-
- double avg = 0.0, min = DBL_MAX, max = -DBL_MAX;
- int counter = 0;
-
- // test all single-channel colours
- for( int test = 0; test < 1000; ++test )
- {
- // set a constant random colour
- for( int channel = 0; channel < 3; ++channel )
- {
- u8 value = ( u8 )( rand() & 0xff );
- for( int i = 0; i < 16; ++i )
- input[4*i + channel] = value;
- }
- for( int i = 0; i < 16; ++i )
- input[4*i + 3] = 255;
-
- // compress and decompress
- Compress( input, block, flags );
- Decompress( output, block, flags );
-
- // test the results
- double rm = GetColourError( input, output );
- double rms = std::sqrt( rm );
-
- // accumulate stats
- min = std::min( min, rms );
- max = std::max( max, rms );
- avg += rm;
- ++counter;
- }
-
- // finish stats
- avg = std::sqrt( avg/counter );
-
- // show stats
- std::cout << "random one colour error (min, max, avg): "
- << min << ", " << max << ", " << avg << std::endl;
-}
-
-void TestTwoColour( int flags )
-{
- u8 input[4*16];
- u8 output[4*16];
- u8 block[16];
-
- double avg = 0.0, min = DBL_MAX, max = -DBL_MAX;
- int counter = 0;
-
- // test all single-channel colours
- for( int i = 0; i < 16*4; ++i )
- input[i] = ( ( i % 4 ) == 3 ) ? 255 : 0;
- for( int channel = 0; channel < 3; ++channel )
- {
- for( int value1 = 0; value1 < 255; ++value1 )
- {
- for( int value2 = value1 + 1; value2 < 255; ++value2 )
- {
- // set the channnel value
- for( int i = 0; i < 16; ++i )
- input[4*i + channel] = ( u8 )( ( i < 8 ) ? value1 : value2 );
-
- // compress and decompress
- Compress( input, block, flags );
- Decompress( output, block, flags );
-
- // test the results
- double rm = GetColourError( input, output );
- double rms = std::sqrt( rm );
-
- // accumulate stats
- min = std::min( min, rms );
- max = std::max( max, rms );
- avg += rm;
- ++counter;
- }
- }
-
- // reset the channel value
- for( int i = 0; i < 16; ++i )
- input[4*i + channel] = 0;
- }
-
- // finish stats
- avg = std::sqrt( avg/counter );
-
- // show stats
- std::cout << "two colour error (min, max, avg): "
- << min << ", " << max << ", " << avg << std::endl;
-}
-
-int main()
-{
- TestOneColourRandom( kDxt1 | kColourRangeFit );
- TestOneColour( kDxt1 );
- TestTwoColour( kDxt1 );
-}
diff --git a/tools/depends/native/libsquish-native/src/maths.cpp b/tools/depends/native/libsquish-native/src/maths.cpp
deleted file mode 100644
index 9af4197d38..0000000000
--- a/tools/depends/native/libsquish-native/src/maths.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-/*! @file
-
- The symmetric eigensystem solver algorithm is from
- http://www.geometrictools.com/Documentation/EigenSymmetric3x3.pdf
-*/
-
-#include "maths.h"
-#include "simd.h"
-#include <cfloat>
-
-namespace squish {
-
-Sym3x3 ComputeWeightedCovariance( int n, Vec3 const* points, float const* weights )
-{
- // compute the centroid
- float total = 0.0f;
- Vec3 centroid( 0.0f );
- for( int i = 0; i < n; ++i )
- {
- total += weights[i];
- centroid += weights[i]*points[i];
- }
- if( total > FLT_EPSILON )
- centroid /= total;
-
- // accumulate the covariance matrix
- Sym3x3 covariance( 0.0f );
- for( int i = 0; i < n; ++i )
- {
- Vec3 a = points[i] - centroid;
- Vec3 b = weights[i]*a;
-
- covariance[0] += a.X()*b.X();
- covariance[1] += a.X()*b.Y();
- covariance[2] += a.X()*b.Z();
- covariance[3] += a.Y()*b.Y();
- covariance[4] += a.Y()*b.Z();
- covariance[5] += a.Z()*b.Z();
- }
-
- // return it
- return covariance;
-}
-
-#if 0
-
-static Vec3 GetMultiplicity1Evector( Sym3x3 const& matrix, float evalue )
-{
- // compute M
- Sym3x3 m;
- m[0] = matrix[0] - evalue;
- m[1] = matrix[1];
- m[2] = matrix[2];
- m[3] = matrix[3] - evalue;
- m[4] = matrix[4];
- m[5] = matrix[5] - evalue;
-
- // compute U
- Sym3x3 u;
- u[0] = m[3]*m[5] - m[4]*m[4];
- u[1] = m[2]*m[4] - m[1]*m[5];
- u[2] = m[1]*m[4] - m[2]*m[3];
- u[3] = m[0]*m[5] - m[2]*m[2];
- u[4] = m[1]*m[2] - m[4]*m[0];
- u[5] = m[0]*m[3] - m[1]*m[1];
-
- // find the largest component
- float mc = std::fabs( u[0] );
- int mi = 0;
- for( int i = 1; i < 6; ++i )
- {
- float c = std::fabs( u[i] );
- if( c > mc )
- {
- mc = c;
- mi = i;
- }
- }
-
- // pick the column with this component
- switch( mi )
- {
- case 0:
- return Vec3( u[0], u[1], u[2] );
-
- case 1:
- case 3:
- return Vec3( u[1], u[3], u[4] );
-
- default:
- return Vec3( u[2], u[4], u[5] );
- }
-}
-
-static Vec3 GetMultiplicity2Evector( Sym3x3 const& matrix, float evalue )
-{
- // compute M
- Sym3x3 m;
- m[0] = matrix[0] - evalue;
- m[1] = matrix[1];
- m[2] = matrix[2];
- m[3] = matrix[3] - evalue;
- m[4] = matrix[4];
- m[5] = matrix[5] - evalue;
-
- // find the largest component
- float mc = std::fabs( m[0] );
- int mi = 0;
- for( int i = 1; i < 6; ++i )
- {
- float c = std::fabs( m[i] );
- if( c > mc )
- {
- mc = c;
- mi = i;
- }
- }
-
- // pick the first eigenvector based on this index
- switch( mi )
- {
- case 0:
- case 1:
- return Vec3( -m[1], m[0], 0.0f );
-
- case 2:
- return Vec3( m[2], 0.0f, -m[0] );
-
- case 3:
- case 4:
- return Vec3( 0.0f, -m[4], m[3] );
-
- default:
- return Vec3( 0.0f, -m[5], m[4] );
- }
-}
-
-Vec3 ComputePrincipleComponent( Sym3x3 const& matrix )
-{
- // compute the cubic coefficients
- float c0 = matrix[0]*matrix[3]*matrix[5]
- + 2.0f*matrix[1]*matrix[2]*matrix[4]
- - matrix[0]*matrix[4]*matrix[4]
- - matrix[3]*matrix[2]*matrix[2]
- - matrix[5]*matrix[1]*matrix[1];
- float c1 = matrix[0]*matrix[3] + matrix[0]*matrix[5] + matrix[3]*matrix[5]
- - matrix[1]*matrix[1] - matrix[2]*matrix[2] - matrix[4]*matrix[4];
- float c2 = matrix[0] + matrix[3] + matrix[5];
-
- // compute the quadratic coefficients
- float a = c1 - ( 1.0f/3.0f )*c2*c2;
- float b = ( -2.0f/27.0f )*c2*c2*c2 + ( 1.0f/3.0f )*c1*c2 - c0;
-
- // compute the root count check
- float Q = 0.25f*b*b + ( 1.0f/27.0f )*a*a*a;
-
- // test the multiplicity
- if( FLT_EPSILON < Q )
- {
- // only one root, which implies we have a multiple of the identity
- return Vec3( 1.0f );
- }
- else if( Q < -FLT_EPSILON )
- {
- // three distinct roots
- float theta = std::atan2( std::sqrt( -Q ), -0.5f*b );
- float rho = std::sqrt( 0.25f*b*b - Q );
-
- float rt = std::pow( rho, 1.0f/3.0f );
- float ct = std::cos( theta/3.0f );
- float st = std::sin( theta/3.0f );
-
- float l1 = ( 1.0f/3.0f )*c2 + 2.0f*rt*ct;
- float l2 = ( 1.0f/3.0f )*c2 - rt*( ct + ( float )sqrt( 3.0f )*st );
- float l3 = ( 1.0f/3.0f )*c2 - rt*( ct - ( float )sqrt( 3.0f )*st );
-
- // pick the larger
- if( std::fabs( l2 ) > std::fabs( l1 ) )
- l1 = l2;
- if( std::fabs( l3 ) > std::fabs( l1 ) )
- l1 = l3;
-
- // get the eigenvector
- return GetMultiplicity1Evector( matrix, l1 );
- }
- else // if( -FLT_EPSILON <= Q && Q <= FLT_EPSILON )
- {
- // two roots
- float rt;
- if( b < 0.0f )
- rt = -std::pow( -0.5f*b, 1.0f/3.0f );
- else
- rt = std::pow( 0.5f*b, 1.0f/3.0f );
-
- float l1 = ( 1.0f/3.0f )*c2 + rt; // repeated
- float l2 = ( 1.0f/3.0f )*c2 - 2.0f*rt;
-
- // get the eigenvector
- if( std::fabs( l1 ) > std::fabs( l2 ) )
- return GetMultiplicity2Evector( matrix, l1 );
- else
- return GetMultiplicity1Evector( matrix, l2 );
- }
-}
-
-#else
-
-#define POWER_ITERATION_COUNT 8
-
-Vec3 ComputePrincipleComponent( Sym3x3 const& matrix )
-{
- Vec4 const row0( matrix[0], matrix[1], matrix[2], 0.0f );
- Vec4 const row1( matrix[1], matrix[3], matrix[4], 0.0f );
- Vec4 const row2( matrix[2], matrix[4], matrix[5], 0.0f );
- Vec4 v = VEC4_CONST( 1.0f );
- for( int i = 0; i < POWER_ITERATION_COUNT; ++i )
- {
- // matrix multiply
- Vec4 w = row0*v.SplatX();
- w = MultiplyAdd(row1, v.SplatY(), w);
- w = MultiplyAdd(row2, v.SplatZ(), w);
-
- // get max component from xyz in all channels
- Vec4 a = Max(w.SplatX(), Max(w.SplatY(), w.SplatZ()));
-
- // divide through and advance
- v = w*Reciprocal(a);
- }
- return v.GetVec3();
-}
-
-#endif
-
-} // namespace squish
diff --git a/tools/depends/native/libsquish-native/src/maths.h b/tools/depends/native/libsquish-native/src/maths.h
deleted file mode 100644
index 769ae463f7..0000000000
--- a/tools/depends/native/libsquish-native/src/maths.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_MATHS_H
-#define SQUISH_MATHS_H
-
-#include <cmath>
-#include <algorithm>
-#include "config.h"
-
-namespace squish {
-
-class Vec3
-{
-public:
- typedef Vec3 const& Arg;
-
- Vec3()
- {
- }
-
- explicit Vec3( float s )
- {
- m_x = s;
- m_y = s;
- m_z = s;
- }
-
- Vec3( float x, float y, float z )
- {
- m_x = x;
- m_y = y;
- m_z = z;
- }
-
- float X() const { return m_x; }
- float Y() const { return m_y; }
- float Z() const { return m_z; }
-
- Vec3 operator-() const
- {
- return Vec3( -m_x, -m_y, -m_z );
- }
-
- Vec3& operator+=( Arg v )
- {
- m_x += v.m_x;
- m_y += v.m_y;
- m_z += v.m_z;
- return *this;
- }
-
- Vec3& operator-=( Arg v )
- {
- m_x -= v.m_x;
- m_y -= v.m_y;
- m_z -= v.m_z;
- return *this;
- }
-
- Vec3& operator*=( Arg v )
- {
- m_x *= v.m_x;
- m_y *= v.m_y;
- m_z *= v.m_z;
- return *this;
- }
-
- Vec3& operator*=( float s )
- {
- m_x *= s;
- m_y *= s;
- m_z *= s;
- return *this;
- }
-
- Vec3& operator/=( Arg v )
- {
- m_x /= v.m_x;
- m_y /= v.m_y;
- m_z /= v.m_z;
- return *this;
- }
-
- Vec3& operator/=( float s )
- {
- float t = 1.0f/s;
- m_x *= t;
- m_y *= t;
- m_z *= t;
- return *this;
- }
-
- friend Vec3 operator+( Arg left, Arg right )
- {
- Vec3 copy( left );
- return copy += right;
- }
-
- friend Vec3 operator-( Arg left, Arg right )
- {
- Vec3 copy( left );
- return copy -= right;
- }
-
- friend Vec3 operator*( Arg left, Arg right )
- {
- Vec3 copy( left );
- return copy *= right;
- }
-
- friend Vec3 operator*( Arg left, float right )
- {
- Vec3 copy( left );
- return copy *= right;
- }
-
- friend Vec3 operator*( float left, Arg right )
- {
- Vec3 copy( right );
- return copy *= left;
- }
-
- friend Vec3 operator/( Arg left, Arg right )
- {
- Vec3 copy( left );
- return copy /= right;
- }
-
- friend Vec3 operator/( Arg left, float right )
- {
- Vec3 copy( left );
- return copy /= right;
- }
-
- friend float Dot( Arg left, Arg right )
- {
- return left.m_x*right.m_x + left.m_y*right.m_y + left.m_z*right.m_z;
- }
-
- friend Vec3 Min( Arg left, Arg right )
- {
- return Vec3(
- std::min( left.m_x, right.m_x ),
- std::min( left.m_y, right.m_y ),
- std::min( left.m_z, right.m_z )
- );
- }
-
- friend Vec3 Max( Arg left, Arg right )
- {
- return Vec3(
- std::max( left.m_x, right.m_x ),
- std::max( left.m_y, right.m_y ),
- std::max( left.m_z, right.m_z )
- );
- }
-
- friend Vec3 Truncate( Arg v )
- {
- return Vec3(
- v.m_x > 0.0f ? std::floor( v.m_x ) : std::ceil( v.m_x ),
- v.m_y > 0.0f ? std::floor( v.m_y ) : std::ceil( v.m_y ),
- v.m_z > 0.0f ? std::floor( v.m_z ) : std::ceil( v.m_z )
- );
- }
-
-private:
- float m_x;
- float m_y;
- float m_z;
-};
-
-inline float LengthSquared( Vec3::Arg v )
-{
- return Dot( v, v );
-}
-
-class Sym3x3
-{
-public:
- Sym3x3()
- {
- }
-
- Sym3x3( float s )
- {
- for( int i = 0; i < 6; ++i )
- m_x[i] = s;
- }
-
- float operator[]( int index ) const
- {
- return m_x[index];
- }
-
- float& operator[]( int index )
- {
- return m_x[index];
- }
-
-private:
- float m_x[6];
-};
-
-Sym3x3 ComputeWeightedCovariance( int n, Vec3 const* points, float const* weights );
-Vec3 ComputePrincipleComponent( Sym3x3 const& matrix );
-
-} // namespace squish
-
-#endif // ndef SQUISH_MATHS_H
diff --git a/tools/depends/native/libsquish-native/src/rangefit.cpp b/tools/depends/native/libsquish-native/src/rangefit.cpp
deleted file mode 100644
index 3fca1245eb..0000000000
--- a/tools/depends/native/libsquish-native/src/rangefit.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#include "rangefit.h"
-#include "colourset.h"
-#include "colourblock.h"
-#include <cfloat>
-
-namespace squish {
-
-RangeFit::RangeFit( ColourSet const* colours, int flags, float* metric )
- : ColourFit( colours, flags )
-{
- // initialise the metric (old perceptual = 0.2126f, 0.7152f, 0.0722f)
- if( metric )
- m_metric = Vec3( metric[0], metric[1], metric[2] );
- else
- m_metric = Vec3( 1.0f );
-
- // initialise the best error
- m_besterror = FLT_MAX;
-
- // cache some values
- int const count = m_colours->GetCount();
- Vec3 const* values = m_colours->GetPoints();
- float const* weights = m_colours->GetWeights();
-
- // get the covariance matrix
- Sym3x3 covariance = ComputeWeightedCovariance( count, values, weights );
-
- // compute the principle component
- Vec3 principle = ComputePrincipleComponent( covariance );
-
- // get the min and max range as the codebook endpoints
- Vec3 start( 0.0f );
- Vec3 end( 0.0f );
- if( count > 0 )
- {
- float min, max;
-
- // compute the range
- start = end = values[0];
- min = max = Dot( values[0], principle );
- for( int i = 1; i < count; ++i )
- {
- float val = Dot( values[i], principle );
- if( val < min )
- {
- start = values[i];
- min = val;
- }
- else if( val > max )
- {
- end = values[i];
- max = val;
- }
- }
- }
-
- // clamp the output to [0, 1]
- Vec3 const one( 1.0f );
- Vec3 const zero( 0.0f );
- start = Min( one, Max( zero, start ) );
- end = Min( one, Max( zero, end ) );
-
- // clamp to the grid and save
- Vec3 const grid( 31.0f, 63.0f, 31.0f );
- Vec3 const gridrcp( 1.0f/31.0f, 1.0f/63.0f, 1.0f/31.0f );
- Vec3 const half( 0.5f );
- m_start = Truncate( grid*start + half )*gridrcp;
- m_end = Truncate( grid*end + half )*gridrcp;
-}
-
-void RangeFit::Compress3( void* block )
-{
- // cache some values
- int const count = m_colours->GetCount();
- Vec3 const* values = m_colours->GetPoints();
-
- // create a codebook
- Vec3 codes[3];
- codes[0] = m_start;
- codes[1] = m_end;
- codes[2] = 0.5f*m_start + 0.5f*m_end;
-
- // match each point to the closest code
- u8 closest[16];
- float error = 0.0f;
- for( int i = 0; i < count; ++i )
- {
- // find the closest code
- float dist = FLT_MAX;
- int idx = 0;
- for( int j = 0; j < 3; ++j )
- {
- float d = LengthSquared( m_metric*( values[i] - codes[j] ) );
- if( d < dist )
- {
- dist = d;
- idx = j;
- }
- }
-
- // save the index
- closest[i] = ( u8 )idx;
-
- // accumulate the error
- error += dist;
- }
-
- // save this scheme if it wins
- if( error < m_besterror )
- {
- // remap the indices
- u8 indices[16];
- m_colours->RemapIndices( closest, indices );
-
- // save the block
- WriteColourBlock3( m_start, m_end, indices, block );
-
- // save the error
- m_besterror = error;
- }
-}
-
-void RangeFit::Compress4( void* block )
-{
- // cache some values
- int const count = m_colours->GetCount();
- Vec3 const* values = m_colours->GetPoints();
-
- // create a codebook
- Vec3 codes[4];
- codes[0] = m_start;
- codes[1] = m_end;
- codes[2] = ( 2.0f/3.0f )*m_start + ( 1.0f/3.0f )*m_end;
- codes[3] = ( 1.0f/3.0f )*m_start + ( 2.0f/3.0f )*m_end;
-
- // match each point to the closest code
- u8 closest[16];
- float error = 0.0f;
- for( int i = 0; i < count; ++i )
- {
- // find the closest code
- float dist = FLT_MAX;
- int idx = 0;
- for( int j = 0; j < 4; ++j )
- {
- float d = LengthSquared( m_metric*( values[i] - codes[j] ) );
- if( d < dist )
- {
- dist = d;
- idx = j;
- }
- }
-
- // save the index
- closest[i] = ( u8 )idx;
-
- // accumulate the error
- error += dist;
- }
-
- // save this scheme if it wins
- if( error < m_besterror )
- {
- // remap the indices
- u8 indices[16];
- m_colours->RemapIndices( closest, indices );
-
- // save the block
- WriteColourBlock4( m_start, m_end, indices, block );
-
- // save the error
- m_besterror = error;
- }
-}
-
-} // namespace squish
diff --git a/tools/depends/native/libsquish-native/src/rangefit.h b/tools/depends/native/libsquish-native/src/rangefit.h
deleted file mode 100644
index 0207bd1c3f..0000000000
--- a/tools/depends/native/libsquish-native/src/rangefit.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_RANGEFIT_H
-#define SQUISH_RANGEFIT_H
-
-#include <squish.h>
-#include "colourfit.h"
-#include "maths.h"
-
-namespace squish {
-
-class ColourSet;
-
-class RangeFit : public ColourFit
-{
-public:
- RangeFit( ColourSet const* colours, int flags, float* metric );
-
-private:
- virtual void Compress3( void* block );
- virtual void Compress4( void* block );
-
- Vec3 m_metric;
- Vec3 m_start;
- Vec3 m_end;
- float m_besterror;
-};
-
-} // squish
-
-#endif // ndef SQUISH_RANGEFIT_H
diff --git a/tools/depends/native/libsquish-native/src/simd.h b/tools/depends/native/libsquish-native/src/simd.h
deleted file mode 100644
index 22bd10a460..0000000000
--- a/tools/depends/native/libsquish-native/src/simd.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_SIMD_H
-#define SQUISH_SIMD_H
-
-#include "maths.h"
-
-#if SQUISH_USE_ALTIVEC
-#include "simd_ve.h"
-#elif SQUISH_USE_SSE
-#include "simd_sse.h"
-#else
-#include "simd_float.h"
-#endif
-
-
-#endif // ndef SQUISH_SIMD_H
diff --git a/tools/depends/native/libsquish-native/src/simd_float.h b/tools/depends/native/libsquish-native/src/simd_float.h
deleted file mode 100644
index e6351b80eb..0000000000
--- a/tools/depends/native/libsquish-native/src/simd_float.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_SIMD_FLOAT_H
-#define SQUISH_SIMD_FLOAT_H
-
-#include <algorithm>
-
-namespace squish {
-
-#define VEC4_CONST( X ) Vec4( X )
-
-class Vec4
-{
-public:
- typedef Vec4 const& Arg;
-
- Vec4() {}
-
- explicit Vec4( float s )
- : m_x( s ),
- m_y( s ),
- m_z( s ),
- m_w( s )
- {
- }
-
- Vec4( float x, float y, float z, float w )
- : m_x( x ),
- m_y( y ),
- m_z( z ),
- m_w( w )
- {
- }
-
- Vec3 GetVec3() const
- {
- return Vec3( m_x, m_y, m_z );
- }
-
- Vec4 SplatX() const { return Vec4( m_x ); }
- Vec4 SplatY() const { return Vec4( m_y ); }
- Vec4 SplatZ() const { return Vec4( m_z ); }
- Vec4 SplatW() const { return Vec4( m_w ); }
-
- Vec4& operator+=( Arg v )
- {
- m_x += v.m_x;
- m_y += v.m_y;
- m_z += v.m_z;
- m_w += v.m_w;
- return *this;
- }
-
- Vec4& operator-=( Arg v )
- {
- m_x -= v.m_x;
- m_y -= v.m_y;
- m_z -= v.m_z;
- m_w -= v.m_w;
- return *this;
- }
-
- Vec4& operator*=( Arg v )
- {
- m_x *= v.m_x;
- m_y *= v.m_y;
- m_z *= v.m_z;
- m_w *= v.m_w;
- return *this;
- }
-
- friend Vec4 operator+( Vec4::Arg left, Vec4::Arg right )
- {
- Vec4 copy( left );
- return copy += right;
- }
-
- friend Vec4 operator-( Vec4::Arg left, Vec4::Arg right )
- {
- Vec4 copy( left );
- return copy -= right;
- }
-
- friend Vec4 operator*( Vec4::Arg left, Vec4::Arg right )
- {
- Vec4 copy( left );
- return copy *= right;
- }
-
- //! Returns a*b + c
- friend Vec4 MultiplyAdd( Vec4::Arg a, Vec4::Arg b, Vec4::Arg c )
- {
- return a*b + c;
- }
-
- //! Returns -( a*b - c )
- friend Vec4 NegativeMultiplySubtract( Vec4::Arg a, Vec4::Arg b, Vec4::Arg c )
- {
- return c - a*b;
- }
-
- friend Vec4 Reciprocal( Vec4::Arg v )
- {
- return Vec4(
- 1.0f/v.m_x,
- 1.0f/v.m_y,
- 1.0f/v.m_z,
- 1.0f/v.m_w
- );
- }
-
- friend Vec4 Min( Vec4::Arg left, Vec4::Arg right )
- {
- return Vec4(
- std::min( left.m_x, right.m_x ),
- std::min( left.m_y, right.m_y ),
- std::min( left.m_z, right.m_z ),
- std::min( left.m_w, right.m_w )
- );
- }
-
- friend Vec4 Max( Vec4::Arg left, Vec4::Arg right )
- {
- return Vec4(
- std::max( left.m_x, right.m_x ),
- std::max( left.m_y, right.m_y ),
- std::max( left.m_z, right.m_z ),
- std::max( left.m_w, right.m_w )
- );
- }
-
- friend Vec4 Truncate( Vec4::Arg v )
- {
- return Vec4(
- v.m_x > 0.0f ? std::floor( v.m_x ) : std::ceil( v.m_x ),
- v.m_y > 0.0f ? std::floor( v.m_y ) : std::ceil( v.m_y ),
- v.m_z > 0.0f ? std::floor( v.m_z ) : std::ceil( v.m_z ),
- v.m_w > 0.0f ? std::floor( v.m_w ) : std::ceil( v.m_w )
- );
- }
-
- friend bool CompareAnyLessThan( Vec4::Arg left, Vec4::Arg right )
- {
- return left.m_x < right.m_x
- || left.m_y < right.m_y
- || left.m_z < right.m_z
- || left.m_w < right.m_w;
- }
-
-private:
- float m_x;
- float m_y;
- float m_z;
- float m_w;
-};
-
-} // namespace squish
-
-#endif // ndef SQUISH_SIMD_FLOAT_H
-
diff --git a/tools/depends/native/libsquish-native/src/simd_sse.h b/tools/depends/native/libsquish-native/src/simd_sse.h
deleted file mode 100644
index e584f2a0e5..0000000000
--- a/tools/depends/native/libsquish-native/src/simd_sse.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_SIMD_SSE_H
-#define SQUISH_SIMD_SSE_H
-
-#include <xmmintrin.h>
-#if ( SQUISH_USE_SSE > 1 )
-#include <emmintrin.h>
-#endif
-
-#define SQUISH_SSE_SPLAT( a ) \
- ( ( a ) | ( ( a ) << 2 ) | ( ( a ) << 4 ) | ( ( a ) << 6 ) )
-
-#define SQUISH_SSE_SHUF( x, y, z, w ) \
- ( ( x ) | ( ( y ) << 2 ) | ( ( z ) << 4 ) | ( ( w ) << 6 ) )
-
-namespace squish {
-
-#define VEC4_CONST( X ) Vec4( X )
-
-class Vec4
-{
-public:
- typedef Vec4 const& Arg;
-
- Vec4() {}
-
- explicit Vec4( __m128 v ) : m_v( v ) {}
-
- Vec4( Vec4 const& arg ) : m_v( arg.m_v ) {}
-
- Vec4& operator=( Vec4 const& arg )
- {
- m_v = arg.m_v;
- return *this;
- }
-
- explicit Vec4( float s ) : m_v( _mm_set1_ps( s ) ) {}
-
- Vec4( float x, float y, float z, float w ) : m_v( _mm_setr_ps( x, y, z, w ) ) {}
-
- Vec3 GetVec3() const
- {
-#ifdef __GNUC__
- __attribute__ ((__aligned__ (16))) float c[4];
-#else
- __declspec(align(16)) float c[4];
-#endif
- _mm_store_ps( c, m_v );
- return Vec3( c[0], c[1], c[2] );
- }
-
- Vec4 SplatX() const { return Vec4( _mm_shuffle_ps( m_v, m_v, SQUISH_SSE_SPLAT( 0 ) ) ); }
- Vec4 SplatY() const { return Vec4( _mm_shuffle_ps( m_v, m_v, SQUISH_SSE_SPLAT( 1 ) ) ); }
- Vec4 SplatZ() const { return Vec4( _mm_shuffle_ps( m_v, m_v, SQUISH_SSE_SPLAT( 2 ) ) ); }
- Vec4 SplatW() const { return Vec4( _mm_shuffle_ps( m_v, m_v, SQUISH_SSE_SPLAT( 3 ) ) ); }
-
- Vec4& operator+=( Arg v )
- {
- m_v = _mm_add_ps( m_v, v.m_v );
- return *this;
- }
-
- Vec4& operator-=( Arg v )
- {
- m_v = _mm_sub_ps( m_v, v.m_v );
- return *this;
- }
-
- Vec4& operator*=( Arg v )
- {
- m_v = _mm_mul_ps( m_v, v.m_v );
- return *this;
- }
-
- friend Vec4 operator+( Vec4::Arg left, Vec4::Arg right )
- {
- return Vec4( _mm_add_ps( left.m_v, right.m_v ) );
- }
-
- friend Vec4 operator-( Vec4::Arg left, Vec4::Arg right )
- {
- return Vec4( _mm_sub_ps( left.m_v, right.m_v ) );
- }
-
- friend Vec4 operator*( Vec4::Arg left, Vec4::Arg right )
- {
- return Vec4( _mm_mul_ps( left.m_v, right.m_v ) );
- }
-
- //! Returns a*b + c
- friend Vec4 MultiplyAdd( Vec4::Arg a, Vec4::Arg b, Vec4::Arg c )
- {
- return Vec4( _mm_add_ps( _mm_mul_ps( a.m_v, b.m_v ), c.m_v ) );
- }
-
- //! Returns -( a*b - c )
- friend Vec4 NegativeMultiplySubtract( Vec4::Arg a, Vec4::Arg b, Vec4::Arg c )
- {
- return Vec4( _mm_sub_ps( c.m_v, _mm_mul_ps( a.m_v, b.m_v ) ) );
- }
-
- friend Vec4 Reciprocal( Vec4::Arg v )
- {
- // get the reciprocal estimate
- __m128 estimate = _mm_rcp_ps( v.m_v );
-
- // one round of Newton-Rhaphson refinement
- __m128 diff = _mm_sub_ps( _mm_set1_ps( 1.0f ), _mm_mul_ps( estimate, v.m_v ) );
- return Vec4( _mm_add_ps( _mm_mul_ps( diff, estimate ), estimate ) );
- }
-
- friend Vec4 Min( Vec4::Arg left, Vec4::Arg right )
- {
- return Vec4( _mm_min_ps( left.m_v, right.m_v ) );
- }
-
- friend Vec4 Max( Vec4::Arg left, Vec4::Arg right )
- {
- return Vec4( _mm_max_ps( left.m_v, right.m_v ) );
- }
-
- friend Vec4 Truncate( Vec4::Arg v )
- {
-#if ( SQUISH_USE_SSE == 1 )
- // convert to ints
- __m128 input = v.m_v;
- __m64 lo = _mm_cvttps_pi32( input );
- __m64 hi = _mm_cvttps_pi32( _mm_movehl_ps( input, input ) );
-
- // convert to floats
- __m128 part = _mm_movelh_ps( input, _mm_cvtpi32_ps( input, hi ) );
- __m128 truncated = _mm_cvtpi32_ps( part, lo );
-
- // clear out the MMX multimedia state to allow FP calls later
- _mm_empty();
- return Vec4( truncated );
-#else
- // use SSE2 instructions
- return Vec4( _mm_cvtepi32_ps( _mm_cvttps_epi32( v.m_v ) ) );
-#endif
- }
-
- friend bool CompareAnyLessThan( Vec4::Arg left, Vec4::Arg right )
- {
- __m128 bits = _mm_cmplt_ps( left.m_v, right.m_v );
- int value = _mm_movemask_ps( bits );
- return value != 0;
- }
-
-private:
- __m128 m_v;
-};
-
-} // namespace squish
-
-#endif // ndef SQUISH_SIMD_SSE_H
diff --git a/tools/depends/native/libsquish-native/src/simd_ve.h b/tools/depends/native/libsquish-native/src/simd_ve.h
deleted file mode 100644
index 70cb32621e..0000000000
--- a/tools/depends/native/libsquish-native/src/simd_ve.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_SIMD_VE_H
-#define SQUISH_SIMD_VE_H
-
-#include <altivec.h>
-#undef bool
-
-namespace squish {
-
-#define VEC4_CONST( X ) Vec4( ( vector float ){ X } )
-
-class Vec4
-{
-public:
- typedef Vec4 Arg;
-
- Vec4() {}
-
- explicit Vec4( vector float v ) : m_v( v ) {}
-
- Vec4( Vec4 const& arg ) : m_v( arg.m_v ) {}
-
- Vec4& operator=( Vec4 const& arg )
- {
- m_v = arg.m_v;
- return *this;
- }
-
- explicit Vec4( float s )
- {
- union { vector float v; float c[4]; } u;
- u.c[0] = s;
- u.c[1] = s;
- u.c[2] = s;
- u.c[3] = s;
- m_v = u.v;
- }
-
- Vec4( float x, float y, float z, float w )
- {
- union { vector float v; float c[4]; } u;
- u.c[0] = x;
- u.c[1] = y;
- u.c[2] = z;
- u.c[3] = w;
- m_v = u.v;
- }
-
- Vec3 GetVec3() const
- {
- union { vector float v; float c[4]; } u;
- u.v = m_v;
- return Vec3( u.c[0], u.c[1], u.c[2] );
- }
-
- Vec4 SplatX() const { return Vec4( vec_splat( m_v, 0 ) ); }
- Vec4 SplatY() const { return Vec4( vec_splat( m_v, 1 ) ); }
- Vec4 SplatZ() const { return Vec4( vec_splat( m_v, 2 ) ); }
- Vec4 SplatW() const { return Vec4( vec_splat( m_v, 3 ) ); }
-
- Vec4& operator+=( Arg v )
- {
- m_v = vec_add( m_v, v.m_v );
- return *this;
- }
-
- Vec4& operator-=( Arg v )
- {
- m_v = vec_sub( m_v, v.m_v );
- return *this;
- }
-
- Vec4& operator*=( Arg v )
- {
- m_v = vec_madd( m_v, v.m_v, ( vector float ){ -0.0f } );
- return *this;
- }
-
- friend Vec4 operator+( Vec4::Arg left, Vec4::Arg right )
- {
- return Vec4( vec_add( left.m_v, right.m_v ) );
- }
-
- friend Vec4 operator-( Vec4::Arg left, Vec4::Arg right )
- {
- return Vec4( vec_sub( left.m_v, right.m_v ) );
- }
-
- friend Vec4 operator*( Vec4::Arg left, Vec4::Arg right )
- {
- return Vec4( vec_madd( left.m_v, right.m_v, ( vector float ){ -0.0f } ) );
- }
-
- //! Returns a*b + c
- friend Vec4 MultiplyAdd( Vec4::Arg a, Vec4::Arg b, Vec4::Arg c )
- {
- return Vec4( vec_madd( a.m_v, b.m_v, c.m_v ) );
- }
-
- //! Returns -( a*b - c )
- friend Vec4 NegativeMultiplySubtract( Vec4::Arg a, Vec4::Arg b, Vec4::Arg c )
- {
- return Vec4( vec_nmsub( a.m_v, b.m_v, c.m_v ) );
- }
-
- friend Vec4 Reciprocal( Vec4::Arg v )
- {
- // get the reciprocal estimate
- vector float estimate = vec_re( v.m_v );
-
- // one round of Newton-Rhaphson refinement
- vector float diff = vec_nmsub( estimate, v.m_v, ( vector float ){ 1.0f } );
- return Vec4( vec_madd( diff, estimate, estimate ) );
- }
-
- friend Vec4 Min( Vec4::Arg left, Vec4::Arg right )
- {
- return Vec4( vec_min( left.m_v, right.m_v ) );
- }
-
- friend Vec4 Max( Vec4::Arg left, Vec4::Arg right )
- {
- return Vec4( vec_max( left.m_v, right.m_v ) );
- }
-
- friend Vec4 Truncate( Vec4::Arg v )
- {
- return Vec4( vec_trunc( v.m_v ) );
- }
-
- friend bool CompareAnyLessThan( Vec4::Arg left, Vec4::Arg right )
- {
- return vec_any_lt( left.m_v, right.m_v ) != 0;
- }
-
-private:
- vector float m_v;
-};
-
-} // namespace squish
-
-#endif // ndef SQUISH_SIMD_VE_H
diff --git a/tools/depends/native/libsquish-native/src/singlecolourfit.cpp b/tools/depends/native/libsquish-native/src/singlecolourfit.cpp
deleted file mode 100644
index e8a0117698..0000000000
--- a/tools/depends/native/libsquish-native/src/singlecolourfit.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#include "singlecolourfit.h"
-#include "colourset.h"
-#include "colourblock.h"
-
-namespace squish {
-
-struct SourceBlock
-{
- u8 start;
- u8 end;
- u8 error;
-};
-
-struct SingleColourLookup
-{
- SourceBlock sources[2];
-};
-
-#include "singlecolourlookup.inl"
-
-static int FloatToInt( float a, int limit )
-{
- // use ANSI round-to-zero behaviour to get round-to-nearest
- int i = ( int )( a + 0.5f );
-
- // clamp to the limit
- if( i < 0 )
- i = 0;
- else if( i > limit )
- i = limit;
-
- // done
- return i;
-}
-
-SingleColourFit::SingleColourFit( ColourSet const* colours, int flags )
- : ColourFit( colours, flags )
-{
- // grab the single colour
- Vec3 const* values = m_colours->GetPoints();
- m_colour[0] = ( u8 )FloatToInt( 255.0f*values->X(), 255 );
- m_colour[1] = ( u8 )FloatToInt( 255.0f*values->Y(), 255 );
- m_colour[2] = ( u8 )FloatToInt( 255.0f*values->Z(), 255 );
-
- // initialise the best error
- m_besterror = INT_MAX;
-}
-
-void SingleColourFit::Compress3( void* block )
-{
- // build the table of lookups
- SingleColourLookup const* const lookups[] =
- {
- lookup_5_3,
- lookup_6_3,
- lookup_5_3
- };
-
- // find the best end-points and index
- ComputeEndPoints( lookups );
-
- // build the block if we win
- if( m_error < m_besterror )
- {
- // remap the indices
- u8 indices[16];
- m_colours->RemapIndices( &m_index, indices );
-
- // save the block
- WriteColourBlock3( m_start, m_end, indices, block );
-
- // save the error
- m_besterror = m_error;
- }
-}
-
-void SingleColourFit::Compress4( void* block )
-{
- // build the table of lookups
- SingleColourLookup const* const lookups[] =
- {
- lookup_5_4,
- lookup_6_4,
- lookup_5_4
- };
-
- // find the best end-points and index
- ComputeEndPoints( lookups );
-
- // build the block if we win
- if( m_error < m_besterror )
- {
- // remap the indices
- u8 indices[16];
- m_colours->RemapIndices( &m_index, indices );
-
- // save the block
- WriteColourBlock4( m_start, m_end, indices, block );
-
- // save the error
- m_besterror = m_error;
- }
-}
-
-void SingleColourFit::ComputeEndPoints( SingleColourLookup const* const* lookups )
-{
- // check each index combination (endpoint or intermediate)
- m_error = INT_MAX;
- for( int index = 0; index < 2; ++index )
- {
- // check the error for this codebook index
- SourceBlock const* sources[3];
- int error = 0;
- for( int channel = 0; channel < 3; ++channel )
- {
- // grab the lookup table and index for this channel
- SingleColourLookup const* lookup = lookups[channel];
- int target = m_colour[channel];
-
- // store a pointer to the source for this channel
- sources[channel] = lookup[target].sources + index;
-
- // accumulate the error
- int diff = sources[channel]->error;
- error += diff*diff;
- }
-
- // keep it if the error is lower
- if( error < m_error )
- {
- m_start = Vec3(
- ( float )sources[0]->start/31.0f,
- ( float )sources[1]->start/63.0f,
- ( float )sources[2]->start/31.0f
- );
- m_end = Vec3(
- ( float )sources[0]->end/31.0f,
- ( float )sources[1]->end/63.0f,
- ( float )sources[2]->end/31.0f
- );
- m_index = ( u8 )( 2*index );
- m_error = error;
- }
- }
-}
-
-} // namespace squish
diff --git a/tools/depends/native/libsquish-native/src/singlecolourfit.h b/tools/depends/native/libsquish-native/src/singlecolourfit.h
deleted file mode 100644
index 0388fda028..0000000000
--- a/tools/depends/native/libsquish-native/src/singlecolourfit.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_SINGLECOLOURFIT_H
-#define SQUISH_SINGLECOLOURFIT_H
-
-#include <squish.h>
-#include "colourfit.h"
-
-namespace squish {
-
-class ColourSet;
-struct SingleColourLookup;
-
-class SingleColourFit : public ColourFit
-{
-public:
- SingleColourFit( ColourSet const* colours, int flags );
-
-private:
- virtual void Compress3( void* block );
- virtual void Compress4( void* block );
-
- void ComputeEndPoints( SingleColourLookup const* const* lookups );
-
- u8 m_colour[3];
- Vec3 m_start;
- Vec3 m_end;
- u8 m_index;
- int m_error;
- int m_besterror;
-};
-
-} // namespace squish
-
-#endif // ndef SQUISH_SINGLECOLOURFIT_H
diff --git a/tools/depends/native/libsquish-native/src/singlecolourlookup.inl b/tools/depends/native/libsquish-native/src/singlecolourlookup.inl
deleted file mode 100644
index f1c95a1028..0000000000
--- a/tools/depends/native/libsquish-native/src/singlecolourlookup.inl
+++ /dev/null
@@ -1,1040 +0,0 @@
-
-static SingleColourLookup const lookup_5_3[] =
-{
- { { { 0, 0, 0 }, { 0, 0, 0 } } },
- { { { 0, 0, 1 }, { 0, 0, 1 } } },
- { { { 0, 0, 2 }, { 0, 0, 2 } } },
- { { { 0, 0, 3 }, { 0, 1, 1 } } },
- { { { 0, 0, 4 }, { 0, 1, 0 } } },
- { { { 1, 0, 3 }, { 0, 1, 1 } } },
- { { { 1, 0, 2 }, { 0, 1, 2 } } },
- { { { 1, 0, 1 }, { 0, 2, 1 } } },
- { { { 1, 0, 0 }, { 0, 2, 0 } } },
- { { { 1, 0, 1 }, { 0, 2, 1 } } },
- { { { 1, 0, 2 }, { 0, 2, 2 } } },
- { { { 1, 0, 3 }, { 0, 3, 1 } } },
- { { { 1, 0, 4 }, { 0, 3, 0 } } },
- { { { 2, 0, 3 }, { 0, 3, 1 } } },
- { { { 2, 0, 2 }, { 0, 3, 2 } } },
- { { { 2, 0, 1 }, { 0, 4, 1 } } },
- { { { 2, 0, 0 }, { 0, 4, 0 } } },
- { { { 2, 0, 1 }, { 0, 4, 1 } } },
- { { { 2, 0, 2 }, { 0, 4, 2 } } },
- { { { 2, 0, 3 }, { 0, 5, 1 } } },
- { { { 2, 0, 4 }, { 0, 5, 0 } } },
- { { { 3, 0, 3 }, { 0, 5, 1 } } },
- { { { 3, 0, 2 }, { 0, 5, 2 } } },
- { { { 3, 0, 1 }, { 0, 6, 1 } } },
- { { { 3, 0, 0 }, { 0, 6, 0 } } },
- { { { 3, 0, 1 }, { 0, 6, 1 } } },
- { { { 3, 0, 2 }, { 0, 6, 2 } } },
- { { { 3, 0, 3 }, { 0, 7, 1 } } },
- { { { 3, 0, 4 }, { 0, 7, 0 } } },
- { { { 4, 0, 4 }, { 0, 7, 1 } } },
- { { { 4, 0, 3 }, { 0, 7, 2 } } },
- { { { 4, 0, 2 }, { 1, 7, 1 } } },
- { { { 4, 0, 1 }, { 1, 7, 0 } } },
- { { { 4, 0, 0 }, { 0, 8, 0 } } },
- { { { 4, 0, 1 }, { 0, 8, 1 } } },
- { { { 4, 0, 2 }, { 2, 7, 1 } } },
- { { { 4, 0, 3 }, { 2, 7, 0 } } },
- { { { 4, 0, 4 }, { 0, 9, 0 } } },
- { { { 5, 0, 3 }, { 0, 9, 1 } } },
- { { { 5, 0, 2 }, { 3, 7, 1 } } },
- { { { 5, 0, 1 }, { 3, 7, 0 } } },
- { { { 5, 0, 0 }, { 0, 10, 0 } } },
- { { { 5, 0, 1 }, { 0, 10, 1 } } },
- { { { 5, 0, 2 }, { 0, 10, 2 } } },
- { { { 5, 0, 3 }, { 0, 11, 1 } } },
- { { { 5, 0, 4 }, { 0, 11, 0 } } },
- { { { 6, 0, 3 }, { 0, 11, 1 } } },
- { { { 6, 0, 2 }, { 0, 11, 2 } } },
- { { { 6, 0, 1 }, { 0, 12, 1 } } },
- { { { 6, 0, 0 }, { 0, 12, 0 } } },
- { { { 6, 0, 1 }, { 0, 12, 1 } } },
- { { { 6, 0, 2 }, { 0, 12, 2 } } },
- { { { 6, 0, 3 }, { 0, 13, 1 } } },
- { { { 6, 0, 4 }, { 0, 13, 0 } } },
- { { { 7, 0, 3 }, { 0, 13, 1 } } },
- { { { 7, 0, 2 }, { 0, 13, 2 } } },
- { { { 7, 0, 1 }, { 0, 14, 1 } } },
- { { { 7, 0, 0 }, { 0, 14, 0 } } },
- { { { 7, 0, 1 }, { 0, 14, 1 } } },
- { { { 7, 0, 2 }, { 0, 14, 2 } } },
- { { { 7, 0, 3 }, { 0, 15, 1 } } },
- { { { 7, 0, 4 }, { 0, 15, 0 } } },
- { { { 8, 0, 4 }, { 0, 15, 1 } } },
- { { { 8, 0, 3 }, { 0, 15, 2 } } },
- { { { 8, 0, 2 }, { 1, 15, 1 } } },
- { { { 8, 0, 1 }, { 1, 15, 0 } } },
- { { { 8, 0, 0 }, { 0, 16, 0 } } },
- { { { 8, 0, 1 }, { 0, 16, 1 } } },
- { { { 8, 0, 2 }, { 2, 15, 1 } } },
- { { { 8, 0, 3 }, { 2, 15, 0 } } },
- { { { 8, 0, 4 }, { 0, 17, 0 } } },
- { { { 9, 0, 3 }, { 0, 17, 1 } } },
- { { { 9, 0, 2 }, { 3, 15, 1 } } },
- { { { 9, 0, 1 }, { 3, 15, 0 } } },
- { { { 9, 0, 0 }, { 0, 18, 0 } } },
- { { { 9, 0, 1 }, { 0, 18, 1 } } },
- { { { 9, 0, 2 }, { 0, 18, 2 } } },
- { { { 9, 0, 3 }, { 0, 19, 1 } } },
- { { { 9, 0, 4 }, { 0, 19, 0 } } },
- { { { 10, 0, 3 }, { 0, 19, 1 } } },
- { { { 10, 0, 2 }, { 0, 19, 2 } } },
- { { { 10, 0, 1 }, { 0, 20, 1 } } },
- { { { 10, 0, 0 }, { 0, 20, 0 } } },
- { { { 10, 0, 1 }, { 0, 20, 1 } } },
- { { { 10, 0, 2 }, { 0, 20, 2 } } },
- { { { 10, 0, 3 }, { 0, 21, 1 } } },
- { { { 10, 0, 4 }, { 0, 21, 0 } } },
- { { { 11, 0, 3 }, { 0, 21, 1 } } },
- { { { 11, 0, 2 }, { 0, 21, 2 } } },
- { { { 11, 0, 1 }, { 0, 22, 1 } } },
- { { { 11, 0, 0 }, { 0, 22, 0 } } },
- { { { 11, 0, 1 }, { 0, 22, 1 } } },
- { { { 11, 0, 2 }, { 0, 22, 2 } } },
- { { { 11, 0, 3 }, { 0, 23, 1 } } },
- { { { 11, 0, 4 }, { 0, 23, 0 } } },
- { { { 12, 0, 4 }, { 0, 23, 1 } } },
- { { { 12, 0, 3 }, { 0, 23, 2 } } },
- { { { 12, 0, 2 }, { 1, 23, 1 } } },
- { { { 12, 0, 1 }, { 1, 23, 0 } } },
- { { { 12, 0, 0 }, { 0, 24, 0 } } },
- { { { 12, 0, 1 }, { 0, 24, 1 } } },
- { { { 12, 0, 2 }, { 2, 23, 1 } } },
- { { { 12, 0, 3 }, { 2, 23, 0 } } },
- { { { 12, 0, 4 }, { 0, 25, 0 } } },
- { { { 13, 0, 3 }, { 0, 25, 1 } } },
- { { { 13, 0, 2 }, { 3, 23, 1 } } },
- { { { 13, 0, 1 }, { 3, 23, 0 } } },
- { { { 13, 0, 0 }, { 0, 26, 0 } } },
- { { { 13, 0, 1 }, { 0, 26, 1 } } },
- { { { 13, 0, 2 }, { 0, 26, 2 } } },
- { { { 13, 0, 3 }, { 0, 27, 1 } } },
- { { { 13, 0, 4 }, { 0, 27, 0 } } },
- { { { 14, 0, 3 }, { 0, 27, 1 } } },
- { { { 14, 0, 2 }, { 0, 27, 2 } } },
- { { { 14, 0, 1 }, { 0, 28, 1 } } },
- { { { 14, 0, 0 }, { 0, 28, 0 } } },
- { { { 14, 0, 1 }, { 0, 28, 1 } } },
- { { { 14, 0, 2 }, { 0, 28, 2 } } },
- { { { 14, 0, 3 }, { 0, 29, 1 } } },
- { { { 14, 0, 4 }, { 0, 29, 0 } } },
- { { { 15, 0, 3 }, { 0, 29, 1 } } },
- { { { 15, 0, 2 }, { 0, 29, 2 } } },
- { { { 15, 0, 1 }, { 0, 30, 1 } } },
- { { { 15, 0, 0 }, { 0, 30, 0 } } },
- { { { 15, 0, 1 }, { 0, 30, 1 } } },
- { { { 15, 0, 2 }, { 0, 30, 2 } } },
- { { { 15, 0, 3 }, { 0, 31, 1 } } },
- { { { 15, 0, 4 }, { 0, 31, 0 } } },
- { { { 16, 0, 4 }, { 0, 31, 1 } } },
- { { { 16, 0, 3 }, { 0, 31, 2 } } },
- { { { 16, 0, 2 }, { 1, 31, 1 } } },
- { { { 16, 0, 1 }, { 1, 31, 0 } } },
- { { { 16, 0, 0 }, { 4, 28, 0 } } },
- { { { 16, 0, 1 }, { 4, 28, 1 } } },
- { { { 16, 0, 2 }, { 2, 31, 1 } } },
- { { { 16, 0, 3 }, { 2, 31, 0 } } },
- { { { 16, 0, 4 }, { 4, 29, 0 } } },
- { { { 17, 0, 3 }, { 4, 29, 1 } } },
- { { { 17, 0, 2 }, { 3, 31, 1 } } },
- { { { 17, 0, 1 }, { 3, 31, 0 } } },
- { { { 17, 0, 0 }, { 4, 30, 0 } } },
- { { { 17, 0, 1 }, { 4, 30, 1 } } },
- { { { 17, 0, 2 }, { 4, 30, 2 } } },
- { { { 17, 0, 3 }, { 4, 31, 1 } } },
- { { { 17, 0, 4 }, { 4, 31, 0 } } },
- { { { 18, 0, 3 }, { 4, 31, 1 } } },
- { { { 18, 0, 2 }, { 4, 31, 2 } } },
- { { { 18, 0, 1 }, { 5, 31, 1 } } },
- { { { 18, 0, 0 }, { 5, 31, 0 } } },
- { { { 18, 0, 1 }, { 5, 31, 1 } } },
- { { { 18, 0, 2 }, { 5, 31, 2 } } },
- { { { 18, 0, 3 }, { 6, 31, 1 } } },
- { { { 18, 0, 4 }, { 6, 31, 0 } } },
- { { { 19, 0, 3 }, { 6, 31, 1 } } },
- { { { 19, 0, 2 }, { 6, 31, 2 } } },
- { { { 19, 0, 1 }, { 7, 31, 1 } } },
- { { { 19, 0, 0 }, { 7, 31, 0 } } },
- { { { 19, 0, 1 }, { 7, 31, 1 } } },
- { { { 19, 0, 2 }, { 7, 31, 2 } } },
- { { { 19, 0, 3 }, { 8, 31, 1 } } },
- { { { 19, 0, 4 }, { 8, 31, 0 } } },
- { { { 20, 0, 4 }, { 8, 31, 1 } } },
- { { { 20, 0, 3 }, { 8, 31, 2 } } },
- { { { 20, 0, 2 }, { 9, 31, 1 } } },
- { { { 20, 0, 1 }, { 9, 31, 0 } } },
- { { { 20, 0, 0 }, { 12, 28, 0 } } },
- { { { 20, 0, 1 }, { 12, 28, 1 } } },
- { { { 20, 0, 2 }, { 10, 31, 1 } } },
- { { { 20, 0, 3 }, { 10, 31, 0 } } },
- { { { 20, 0, 4 }, { 12, 29, 0 } } },
- { { { 21, 0, 3 }, { 12, 29, 1 } } },
- { { { 21, 0, 2 }, { 11, 31, 1 } } },
- { { { 21, 0, 1 }, { 11, 31, 0 } } },
- { { { 21, 0, 0 }, { 12, 30, 0 } } },
- { { { 21, 0, 1 }, { 12, 30, 1 } } },
- { { { 21, 0, 2 }, { 12, 30, 2 } } },
- { { { 21, 0, 3 }, { 12, 31, 1 } } },
- { { { 21, 0, 4 }, { 12, 31, 0 } } },
- { { { 22, 0, 3 }, { 12, 31, 1 } } },
- { { { 22, 0, 2 }, { 12, 31, 2 } } },
- { { { 22, 0, 1 }, { 13, 31, 1 } } },
- { { { 22, 0, 0 }, { 13, 31, 0 } } },
- { { { 22, 0, 1 }, { 13, 31, 1 } } },
- { { { 22, 0, 2 }, { 13, 31, 2 } } },
- { { { 22, 0, 3 }, { 14, 31, 1 } } },
- { { { 22, 0, 4 }, { 14, 31, 0 } } },
- { { { 23, 0, 3 }, { 14, 31, 1 } } },
- { { { 23, 0, 2 }, { 14, 31, 2 } } },
- { { { 23, 0, 1 }, { 15, 31, 1 } } },
- { { { 23, 0, 0 }, { 15, 31, 0 } } },
- { { { 23, 0, 1 }, { 15, 31, 1 } } },
- { { { 23, 0, 2 }, { 15, 31, 2 } } },
- { { { 23, 0, 3 }, { 16, 31, 1 } } },
- { { { 23, 0, 4 }, { 16, 31, 0 } } },
- { { { 24, 0, 4 }, { 16, 31, 1 } } },
- { { { 24, 0, 3 }, { 16, 31, 2 } } },
- { { { 24, 0, 2 }, { 17, 31, 1 } } },
- { { { 24, 0, 1 }, { 17, 31, 0 } } },
- { { { 24, 0, 0 }, { 20, 28, 0 } } },
- { { { 24, 0, 1 }, { 20, 28, 1 } } },
- { { { 24, 0, 2 }, { 18, 31, 1 } } },
- { { { 24, 0, 3 }, { 18, 31, 0 } } },
- { { { 24, 0, 4 }, { 20, 29, 0 } } },
- { { { 25, 0, 3 }, { 20, 29, 1 } } },
- { { { 25, 0, 2 }, { 19, 31, 1 } } },
- { { { 25, 0, 1 }, { 19, 31, 0 } } },
- { { { 25, 0, 0 }, { 20, 30, 0 } } },
- { { { 25, 0, 1 }, { 20, 30, 1 } } },
- { { { 25, 0, 2 }, { 20, 30, 2 } } },
- { { { 25, 0, 3 }, { 20, 31, 1 } } },
- { { { 25, 0, 4 }, { 20, 31, 0 } } },
- { { { 26, 0, 3 }, { 20, 31, 1 } } },
- { { { 26, 0, 2 }, { 20, 31, 2 } } },
- { { { 26, 0, 1 }, { 21, 31, 1 } } },
- { { { 26, 0, 0 }, { 21, 31, 0 } } },
- { { { 26, 0, 1 }, { 21, 31, 1 } } },
- { { { 26, 0, 2 }, { 21, 31, 2 } } },
- { { { 26, 0, 3 }, { 22, 31, 1 } } },
- { { { 26, 0, 4 }, { 22, 31, 0 } } },
- { { { 27, 0, 3 }, { 22, 31, 1 } } },
- { { { 27, 0, 2 }, { 22, 31, 2 } } },
- { { { 27, 0, 1 }, { 23, 31, 1 } } },
- { { { 27, 0, 0 }, { 23, 31, 0 } } },
- { { { 27, 0, 1 }, { 23, 31, 1 } } },
- { { { 27, 0, 2 }, { 23, 31, 2 } } },
- { { { 27, 0, 3 }, { 24, 31, 1 } } },
- { { { 27, 0, 4 }, { 24, 31, 0 } } },
- { { { 28, 0, 4 }, { 24, 31, 1 } } },
- { { { 28, 0, 3 }, { 24, 31, 2 } } },
- { { { 28, 0, 2 }, { 25, 31, 1 } } },
- { { { 28, 0, 1 }, { 25, 31, 0 } } },
- { { { 28, 0, 0 }, { 28, 28, 0 } } },
- { { { 28, 0, 1 }, { 28, 28, 1 } } },
- { { { 28, 0, 2 }, { 26, 31, 1 } } },
- { { { 28, 0, 3 }, { 26, 31, 0 } } },
- { { { 28, 0, 4 }, { 28, 29, 0 } } },
- { { { 29, 0, 3 }, { 28, 29, 1 } } },
- { { { 29, 0, 2 }, { 27, 31, 1 } } },
- { { { 29, 0, 1 }, { 27, 31, 0 } } },
- { { { 29, 0, 0 }, { 28, 30, 0 } } },
- { { { 29, 0, 1 }, { 28, 30, 1 } } },
- { { { 29, 0, 2 }, { 28, 30, 2 } } },
- { { { 29, 0, 3 }, { 28, 31, 1 } } },
- { { { 29, 0, 4 }, { 28, 31, 0 } } },
- { { { 30, 0, 3 }, { 28, 31, 1 } } },
- { { { 30, 0, 2 }, { 28, 31, 2 } } },
- { { { 30, 0, 1 }, { 29, 31, 1 } } },
- { { { 30, 0, 0 }, { 29, 31, 0 } } },
- { { { 30, 0, 1 }, { 29, 31, 1 } } },
- { { { 30, 0, 2 }, { 29, 31, 2 } } },
- { { { 30, 0, 3 }, { 30, 31, 1 } } },
- { { { 30, 0, 4 }, { 30, 31, 0 } } },
- { { { 31, 0, 3 }, { 30, 31, 1 } } },
- { { { 31, 0, 2 }, { 30, 31, 2 } } },
- { { { 31, 0, 1 }, { 31, 31, 1 } } },
- { { { 31, 0, 0 }, { 31, 31, 0 } } }
-};
-
-static SingleColourLookup const lookup_6_3[] =
-{
- { { { 0, 0, 0 }, { 0, 0, 0 } } },
- { { { 0, 0, 1 }, { 0, 1, 1 } } },
- { { { 0, 0, 2 }, { 0, 1, 0 } } },
- { { { 1, 0, 1 }, { 0, 2, 1 } } },
- { { { 1, 0, 0 }, { 0, 2, 0 } } },
- { { { 1, 0, 1 }, { 0, 3, 1 } } },
- { { { 1, 0, 2 }, { 0, 3, 0 } } },
- { { { 2, 0, 1 }, { 0, 4, 1 } } },
- { { { 2, 0, 0 }, { 0, 4, 0 } } },
- { { { 2, 0, 1 }, { 0, 5, 1 } } },
- { { { 2, 0, 2 }, { 0, 5, 0 } } },
- { { { 3, 0, 1 }, { 0, 6, 1 } } },
- { { { 3, 0, 0 }, { 0, 6, 0 } } },
- { { { 3, 0, 1 }, { 0, 7, 1 } } },
- { { { 3, 0, 2 }, { 0, 7, 0 } } },
- { { { 4, 0, 1 }, { 0, 8, 1 } } },
- { { { 4, 0, 0 }, { 0, 8, 0 } } },
- { { { 4, 0, 1 }, { 0, 9, 1 } } },
- { { { 4, 0, 2 }, { 0, 9, 0 } } },
- { { { 5, 0, 1 }, { 0, 10, 1 } } },
- { { { 5, 0, 0 }, { 0, 10, 0 } } },
- { { { 5, 0, 1 }, { 0, 11, 1 } } },
- { { { 5, 0, 2 }, { 0, 11, 0 } } },
- { { { 6, 0, 1 }, { 0, 12, 1 } } },
- { { { 6, 0, 0 }, { 0, 12, 0 } } },
- { { { 6, 0, 1 }, { 0, 13, 1 } } },
- { { { 6, 0, 2 }, { 0, 13, 0 } } },
- { { { 7, 0, 1 }, { 0, 14, 1 } } },
- { { { 7, 0, 0 }, { 0, 14, 0 } } },
- { { { 7, 0, 1 }, { 0, 15, 1 } } },
- { { { 7, 0, 2 }, { 0, 15, 0 } } },
- { { { 8, 0, 1 }, { 0, 16, 1 } } },
- { { { 8, 0, 0 }, { 0, 16, 0 } } },
- { { { 8, 0, 1 }, { 0, 17, 1 } } },
- { { { 8, 0, 2 }, { 0, 17, 0 } } },
- { { { 9, 0, 1 }, { 0, 18, 1 } } },
- { { { 9, 0, 0 }, { 0, 18, 0 } } },
- { { { 9, 0, 1 }, { 0, 19, 1 } } },
- { { { 9, 0, 2 }, { 0, 19, 0 } } },
- { { { 10, 0, 1 }, { 0, 20, 1 } } },
- { { { 10, 0, 0 }, { 0, 20, 0 } } },
- { { { 10, 0, 1 }, { 0, 21, 1 } } },
- { { { 10, 0, 2 }, { 0, 21, 0 } } },
- { { { 11, 0, 1 }, { 0, 22, 1 } } },
- { { { 11, 0, 0 }, { 0, 22, 0 } } },
- { { { 11, 0, 1 }, { 0, 23, 1 } } },
- { { { 11, 0, 2 }, { 0, 23, 0 } } },
- { { { 12, 0, 1 }, { 0, 24, 1 } } },
- { { { 12, 0, 0 }, { 0, 24, 0 } } },
- { { { 12, 0, 1 }, { 0, 25, 1 } } },
- { { { 12, 0, 2 }, { 0, 25, 0 } } },
- { { { 13, 0, 1 }, { 0, 26, 1 } } },
- { { { 13, 0, 0 }, { 0, 26, 0 } } },
- { { { 13, 0, 1 }, { 0, 27, 1 } } },
- { { { 13, 0, 2 }, { 0, 27, 0 } } },
- { { { 14, 0, 1 }, { 0, 28, 1 } } },
- { { { 14, 0, 0 }, { 0, 28, 0 } } },
- { { { 14, 0, 1 }, { 0, 29, 1 } } },
- { { { 14, 0, 2 }, { 0, 29, 0 } } },
- { { { 15, 0, 1 }, { 0, 30, 1 } } },
- { { { 15, 0, 0 }, { 0, 30, 0 } } },
- { { { 15, 0, 1 }, { 0, 31, 1 } } },
- { { { 15, 0, 2 }, { 0, 31, 0 } } },
- { { { 16, 0, 2 }, { 1, 31, 1 } } },
- { { { 16, 0, 1 }, { 1, 31, 0 } } },
- { { { 16, 0, 0 }, { 0, 32, 0 } } },
- { { { 16, 0, 1 }, { 2, 31, 0 } } },
- { { { 16, 0, 2 }, { 0, 33, 0 } } },
- { { { 17, 0, 1 }, { 3, 31, 0 } } },
- { { { 17, 0, 0 }, { 0, 34, 0 } } },
- { { { 17, 0, 1 }, { 4, 31, 0 } } },
- { { { 17, 0, 2 }, { 0, 35, 0 } } },
- { { { 18, 0, 1 }, { 5, 31, 0 } } },
- { { { 18, 0, 0 }, { 0, 36, 0 } } },
- { { { 18, 0, 1 }, { 6, 31, 0 } } },
- { { { 18, 0, 2 }, { 0, 37, 0 } } },
- { { { 19, 0, 1 }, { 7, 31, 0 } } },
- { { { 19, 0, 0 }, { 0, 38, 0 } } },
- { { { 19, 0, 1 }, { 8, 31, 0 } } },
- { { { 19, 0, 2 }, { 0, 39, 0 } } },
- { { { 20, 0, 1 }, { 9, 31, 0 } } },
- { { { 20, 0, 0 }, { 0, 40, 0 } } },
- { { { 20, 0, 1 }, { 10, 31, 0 } } },
- { { { 20, 0, 2 }, { 0, 41, 0 } } },
- { { { 21, 0, 1 }, { 11, 31, 0 } } },
- { { { 21, 0, 0 }, { 0, 42, 0 } } },
- { { { 21, 0, 1 }, { 12, 31, 0 } } },
- { { { 21, 0, 2 }, { 0, 43, 0 } } },
- { { { 22, 0, 1 }, { 13, 31, 0 } } },
- { { { 22, 0, 0 }, { 0, 44, 0 } } },
- { { { 22, 0, 1 }, { 14, 31, 0 } } },
- { { { 22, 0, 2 }, { 0, 45, 0 } } },
- { { { 23, 0, 1 }, { 15, 31, 0 } } },
- { { { 23, 0, 0 }, { 0, 46, 0 } } },
- { { { 23, 0, 1 }, { 0, 47, 1 } } },
- { { { 23, 0, 2 }, { 0, 47, 0 } } },
- { { { 24, 0, 1 }, { 0, 48, 1 } } },
- { { { 24, 0, 0 }, { 0, 48, 0 } } },
- { { { 24, 0, 1 }, { 0, 49, 1 } } },
- { { { 24, 0, 2 }, { 0, 49, 0 } } },
- { { { 25, 0, 1 }, { 0, 50, 1 } } },
- { { { 25, 0, 0 }, { 0, 50, 0 } } },
- { { { 25, 0, 1 }, { 0, 51, 1 } } },
- { { { 25, 0, 2 }, { 0, 51, 0 } } },
- { { { 26, 0, 1 }, { 0, 52, 1 } } },
- { { { 26, 0, 0 }, { 0, 52, 0 } } },
- { { { 26, 0, 1 }, { 0, 53, 1 } } },
- { { { 26, 0, 2 }, { 0, 53, 0 } } },
- { { { 27, 0, 1 }, { 0, 54, 1 } } },
- { { { 27, 0, 0 }, { 0, 54, 0 } } },
- { { { 27, 0, 1 }, { 0, 55, 1 } } },
- { { { 27, 0, 2 }, { 0, 55, 0 } } },
- { { { 28, 0, 1 }, { 0, 56, 1 } } },
- { { { 28, 0, 0 }, { 0, 56, 0 } } },
- { { { 28, 0, 1 }, { 0, 57, 1 } } },
- { { { 28, 0, 2 }, { 0, 57, 0 } } },
- { { { 29, 0, 1 }, { 0, 58, 1 } } },
- { { { 29, 0, 0 }, { 0, 58, 0 } } },
- { { { 29, 0, 1 }, { 0, 59, 1 } } },
- { { { 29, 0, 2 }, { 0, 59, 0 } } },
- { { { 30, 0, 1 }, { 0, 60, 1 } } },
- { { { 30, 0, 0 }, { 0, 60, 0 } } },
- { { { 30, 0, 1 }, { 0, 61, 1 } } },
- { { { 30, 0, 2 }, { 0, 61, 0 } } },
- { { { 31, 0, 1 }, { 0, 62, 1 } } },
- { { { 31, 0, 0 }, { 0, 62, 0 } } },
- { { { 31, 0, 1 }, { 0, 63, 1 } } },
- { { { 31, 0, 2 }, { 0, 63, 0 } } },
- { { { 32, 0, 2 }, { 1, 63, 1 } } },
- { { { 32, 0, 1 }, { 1, 63, 0 } } },
- { { { 32, 0, 0 }, { 16, 48, 0 } } },
- { { { 32, 0, 1 }, { 2, 63, 0 } } },
- { { { 32, 0, 2 }, { 16, 49, 0 } } },
- { { { 33, 0, 1 }, { 3, 63, 0 } } },
- { { { 33, 0, 0 }, { 16, 50, 0 } } },
- { { { 33, 0, 1 }, { 4, 63, 0 } } },
- { { { 33, 0, 2 }, { 16, 51, 0 } } },
- { { { 34, 0, 1 }, { 5, 63, 0 } } },
- { { { 34, 0, 0 }, { 16, 52, 0 } } },
- { { { 34, 0, 1 }, { 6, 63, 0 } } },
- { { { 34, 0, 2 }, { 16, 53, 0 } } },
- { { { 35, 0, 1 }, { 7, 63, 0 } } },
- { { { 35, 0, 0 }, { 16, 54, 0 } } },
- { { { 35, 0, 1 }, { 8, 63, 0 } } },
- { { { 35, 0, 2 }, { 16, 55, 0 } } },
- { { { 36, 0, 1 }, { 9, 63, 0 } } },
- { { { 36, 0, 0 }, { 16, 56, 0 } } },
- { { { 36, 0, 1 }, { 10, 63, 0 } } },
- { { { 36, 0, 2 }, { 16, 57, 0 } } },
- { { { 37, 0, 1 }, { 11, 63, 0 } } },
- { { { 37, 0, 0 }, { 16, 58, 0 } } },
- { { { 37, 0, 1 }, { 12, 63, 0 } } },
- { { { 37, 0, 2 }, { 16, 59, 0 } } },
- { { { 38, 0, 1 }, { 13, 63, 0 } } },
- { { { 38, 0, 0 }, { 16, 60, 0 } } },
- { { { 38, 0, 1 }, { 14, 63, 0 } } },
- { { { 38, 0, 2 }, { 16, 61, 0 } } },
- { { { 39, 0, 1 }, { 15, 63, 0 } } },
- { { { 39, 0, 0 }, { 16, 62, 0 } } },
- { { { 39, 0, 1 }, { 16, 63, 1 } } },
- { { { 39, 0, 2 }, { 16, 63, 0 } } },
- { { { 40, 0, 1 }, { 17, 63, 1 } } },
- { { { 40, 0, 0 }, { 17, 63, 0 } } },
- { { { 40, 0, 1 }, { 18, 63, 1 } } },
- { { { 40, 0, 2 }, { 18, 63, 0 } } },
- { { { 41, 0, 1 }, { 19, 63, 1 } } },
- { { { 41, 0, 0 }, { 19, 63, 0 } } },
- { { { 41, 0, 1 }, { 20, 63, 1 } } },
- { { { 41, 0, 2 }, { 20, 63, 0 } } },
- { { { 42, 0, 1 }, { 21, 63, 1 } } },
- { { { 42, 0, 0 }, { 21, 63, 0 } } },
- { { { 42, 0, 1 }, { 22, 63, 1 } } },
- { { { 42, 0, 2 }, { 22, 63, 0 } } },
- { { { 43, 0, 1 }, { 23, 63, 1 } } },
- { { { 43, 0, 0 }, { 23, 63, 0 } } },
- { { { 43, 0, 1 }, { 24, 63, 1 } } },
- { { { 43, 0, 2 }, { 24, 63, 0 } } },
- { { { 44, 0, 1 }, { 25, 63, 1 } } },
- { { { 44, 0, 0 }, { 25, 63, 0 } } },
- { { { 44, 0, 1 }, { 26, 63, 1 } } },
- { { { 44, 0, 2 }, { 26, 63, 0 } } },
- { { { 45, 0, 1 }, { 27, 63, 1 } } },
- { { { 45, 0, 0 }, { 27, 63, 0 } } },
- { { { 45, 0, 1 }, { 28, 63, 1 } } },
- { { { 45, 0, 2 }, { 28, 63, 0 } } },
- { { { 46, 0, 1 }, { 29, 63, 1 } } },
- { { { 46, 0, 0 }, { 29, 63, 0 } } },
- { { { 46, 0, 1 }, { 30, 63, 1 } } },
- { { { 46, 0, 2 }, { 30, 63, 0 } } },
- { { { 47, 0, 1 }, { 31, 63, 1 } } },
- { { { 47, 0, 0 }, { 31, 63, 0 } } },
- { { { 47, 0, 1 }, { 32, 63, 1 } } },
- { { { 47, 0, 2 }, { 32, 63, 0 } } },
- { { { 48, 0, 2 }, { 33, 63, 1 } } },
- { { { 48, 0, 1 }, { 33, 63, 0 } } },
- { { { 48, 0, 0 }, { 48, 48, 0 } } },
- { { { 48, 0, 1 }, { 34, 63, 0 } } },
- { { { 48, 0, 2 }, { 48, 49, 0 } } },
- { { { 49, 0, 1 }, { 35, 63, 0 } } },
- { { { 49, 0, 0 }, { 48, 50, 0 } } },
- { { { 49, 0, 1 }, { 36, 63, 0 } } },
- { { { 49, 0, 2 }, { 48, 51, 0 } } },
- { { { 50, 0, 1 }, { 37, 63, 0 } } },
- { { { 50, 0, 0 }, { 48, 52, 0 } } },
- { { { 50, 0, 1 }, { 38, 63, 0 } } },
- { { { 50, 0, 2 }, { 48, 53, 0 } } },
- { { { 51, 0, 1 }, { 39, 63, 0 } } },
- { { { 51, 0, 0 }, { 48, 54, 0 } } },
- { { { 51, 0, 1 }, { 40, 63, 0 } } },
- { { { 51, 0, 2 }, { 48, 55, 0 } } },
- { { { 52, 0, 1 }, { 41, 63, 0 } } },
- { { { 52, 0, 0 }, { 48, 56, 0 } } },
- { { { 52, 0, 1 }, { 42, 63, 0 } } },
- { { { 52, 0, 2 }, { 48, 57, 0 } } },
- { { { 53, 0, 1 }, { 43, 63, 0 } } },
- { { { 53, 0, 0 }, { 48, 58, 0 } } },
- { { { 53, 0, 1 }, { 44, 63, 0 } } },
- { { { 53, 0, 2 }, { 48, 59, 0 } } },
- { { { 54, 0, 1 }, { 45, 63, 0 } } },
- { { { 54, 0, 0 }, { 48, 60, 0 } } },
- { { { 54, 0, 1 }, { 46, 63, 0 } } },
- { { { 54, 0, 2 }, { 48, 61, 0 } } },
- { { { 55, 0, 1 }, { 47, 63, 0 } } },
- { { { 55, 0, 0 }, { 48, 62, 0 } } },
- { { { 55, 0, 1 }, { 48, 63, 1 } } },
- { { { 55, 0, 2 }, { 48, 63, 0 } } },
- { { { 56, 0, 1 }, { 49, 63, 1 } } },
- { { { 56, 0, 0 }, { 49, 63, 0 } } },
- { { { 56, 0, 1 }, { 50, 63, 1 } } },
- { { { 56, 0, 2 }, { 50, 63, 0 } } },
- { { { 57, 0, 1 }, { 51, 63, 1 } } },
- { { { 57, 0, 0 }, { 51, 63, 0 } } },
- { { { 57, 0, 1 }, { 52, 63, 1 } } },
- { { { 57, 0, 2 }, { 52, 63, 0 } } },
- { { { 58, 0, 1 }, { 53, 63, 1 } } },
- { { { 58, 0, 0 }, { 53, 63, 0 } } },
- { { { 58, 0, 1 }, { 54, 63, 1 } } },
- { { { 58, 0, 2 }, { 54, 63, 0 } } },
- { { { 59, 0, 1 }, { 55, 63, 1 } } },
- { { { 59, 0, 0 }, { 55, 63, 0 } } },
- { { { 59, 0, 1 }, { 56, 63, 1 } } },
- { { { 59, 0, 2 }, { 56, 63, 0 } } },
- { { { 60, 0, 1 }, { 57, 63, 1 } } },
- { { { 60, 0, 0 }, { 57, 63, 0 } } },
- { { { 60, 0, 1 }, { 58, 63, 1 } } },
- { { { 60, 0, 2 }, { 58, 63, 0 } } },
- { { { 61, 0, 1 }, { 59, 63, 1 } } },
- { { { 61, 0, 0 }, { 59, 63, 0 } } },
- { { { 61, 0, 1 }, { 60, 63, 1 } } },
- { { { 61, 0, 2 }, { 60, 63, 0 } } },
- { { { 62, 0, 1 }, { 61, 63, 1 } } },
- { { { 62, 0, 0 }, { 61, 63, 0 } } },
- { { { 62, 0, 1 }, { 62, 63, 1 } } },
- { { { 62, 0, 2 }, { 62, 63, 0 } } },
- { { { 63, 0, 1 }, { 63, 63, 1 } } },
- { { { 63, 0, 0 }, { 63, 63, 0 } } }
-};
-
-static SingleColourLookup const lookup_5_4[] =
-{
- { { { 0, 0, 0 }, { 0, 0, 0 } } },
- { { { 0, 0, 1 }, { 0, 1, 1 } } },
- { { { 0, 0, 2 }, { 0, 1, 0 } } },
- { { { 0, 0, 3 }, { 0, 1, 1 } } },
- { { { 0, 0, 4 }, { 0, 2, 1 } } },
- { { { 1, 0, 3 }, { 0, 2, 0 } } },
- { { { 1, 0, 2 }, { 0, 2, 1 } } },
- { { { 1, 0, 1 }, { 0, 3, 1 } } },
- { { { 1, 0, 0 }, { 0, 3, 0 } } },
- { { { 1, 0, 1 }, { 1, 2, 1 } } },
- { { { 1, 0, 2 }, { 1, 2, 0 } } },
- { { { 1, 0, 3 }, { 0, 4, 0 } } },
- { { { 1, 0, 4 }, { 0, 5, 1 } } },
- { { { 2, 0, 3 }, { 0, 5, 0 } } },
- { { { 2, 0, 2 }, { 0, 5, 1 } } },
- { { { 2, 0, 1 }, { 0, 6, 1 } } },
- { { { 2, 0, 0 }, { 0, 6, 0 } } },
- { { { 2, 0, 1 }, { 2, 3, 1 } } },
- { { { 2, 0, 2 }, { 2, 3, 0 } } },
- { { { 2, 0, 3 }, { 0, 7, 0 } } },
- { { { 2, 0, 4 }, { 1, 6, 1 } } },
- { { { 3, 0, 3 }, { 1, 6, 0 } } },
- { { { 3, 0, 2 }, { 0, 8, 0 } } },
- { { { 3, 0, 1 }, { 0, 9, 1 } } },
- { { { 3, 0, 0 }, { 0, 9, 0 } } },
- { { { 3, 0, 1 }, { 0, 9, 1 } } },
- { { { 3, 0, 2 }, { 0, 10, 1 } } },
- { { { 3, 0, 3 }, { 0, 10, 0 } } },
- { { { 3, 0, 4 }, { 2, 7, 1 } } },
- { { { 4, 0, 4 }, { 2, 7, 0 } } },
- { { { 4, 0, 3 }, { 0, 11, 0 } } },
- { { { 4, 0, 2 }, { 1, 10, 1 } } },
- { { { 4, 0, 1 }, { 1, 10, 0 } } },
- { { { 4, 0, 0 }, { 0, 12, 0 } } },
- { { { 4, 0, 1 }, { 0, 13, 1 } } },
- { { { 4, 0, 2 }, { 0, 13, 0 } } },
- { { { 4, 0, 3 }, { 0, 13, 1 } } },
- { { { 4, 0, 4 }, { 0, 14, 1 } } },
- { { { 5, 0, 3 }, { 0, 14, 0 } } },
- { { { 5, 0, 2 }, { 2, 11, 1 } } },
- { { { 5, 0, 1 }, { 2, 11, 0 } } },
- { { { 5, 0, 0 }, { 0, 15, 0 } } },
- { { { 5, 0, 1 }, { 1, 14, 1 } } },
- { { { 5, 0, 2 }, { 1, 14, 0 } } },
- { { { 5, 0, 3 }, { 0, 16, 0 } } },
- { { { 5, 0, 4 }, { 0, 17, 1 } } },
- { { { 6, 0, 3 }, { 0, 17, 0 } } },
- { { { 6, 0, 2 }, { 0, 17, 1 } } },
- { { { 6, 0, 1 }, { 0, 18, 1 } } },
- { { { 6, 0, 0 }, { 0, 18, 0 } } },
- { { { 6, 0, 1 }, { 2, 15, 1 } } },
- { { { 6, 0, 2 }, { 2, 15, 0 } } },
- { { { 6, 0, 3 }, { 0, 19, 0 } } },
- { { { 6, 0, 4 }, { 1, 18, 1 } } },
- { { { 7, 0, 3 }, { 1, 18, 0 } } },
- { { { 7, 0, 2 }, { 0, 20, 0 } } },
- { { { 7, 0, 1 }, { 0, 21, 1 } } },
- { { { 7, 0, 0 }, { 0, 21, 0 } } },
- { { { 7, 0, 1 }, { 0, 21, 1 } } },
- { { { 7, 0, 2 }, { 0, 22, 1 } } },
- { { { 7, 0, 3 }, { 0, 22, 0 } } },
- { { { 7, 0, 4 }, { 2, 19, 1 } } },
- { { { 8, 0, 4 }, { 2, 19, 0 } } },
- { { { 8, 0, 3 }, { 0, 23, 0 } } },
- { { { 8, 0, 2 }, { 1, 22, 1 } } },
- { { { 8, 0, 1 }, { 1, 22, 0 } } },
- { { { 8, 0, 0 }, { 0, 24, 0 } } },
- { { { 8, 0, 1 }, { 0, 25, 1 } } },
- { { { 8, 0, 2 }, { 0, 25, 0 } } },
- { { { 8, 0, 3 }, { 0, 25, 1 } } },
- { { { 8, 0, 4 }, { 0, 26, 1 } } },
- { { { 9, 0, 3 }, { 0, 26, 0 } } },
- { { { 9, 0, 2 }, { 2, 23, 1 } } },
- { { { 9, 0, 1 }, { 2, 23, 0 } } },
- { { { 9, 0, 0 }, { 0, 27, 0 } } },
- { { { 9, 0, 1 }, { 1, 26, 1 } } },
- { { { 9, 0, 2 }, { 1, 26, 0 } } },
- { { { 9, 0, 3 }, { 0, 28, 0 } } },
- { { { 9, 0, 4 }, { 0, 29, 1 } } },
- { { { 10, 0, 3 }, { 0, 29, 0 } } },
- { { { 10, 0, 2 }, { 0, 29, 1 } } },
- { { { 10, 0, 1 }, { 0, 30, 1 } } },
- { { { 10, 0, 0 }, { 0, 30, 0 } } },
- { { { 10, 0, 1 }, { 2, 27, 1 } } },
- { { { 10, 0, 2 }, { 2, 27, 0 } } },
- { { { 10, 0, 3 }, { 0, 31, 0 } } },
- { { { 10, 0, 4 }, { 1, 30, 1 } } },
- { { { 11, 0, 3 }, { 1, 30, 0 } } },
- { { { 11, 0, 2 }, { 4, 24, 0 } } },
- { { { 11, 0, 1 }, { 1, 31, 1 } } },
- { { { 11, 0, 0 }, { 1, 31, 0 } } },
- { { { 11, 0, 1 }, { 1, 31, 1 } } },
- { { { 11, 0, 2 }, { 2, 30, 1 } } },
- { { { 11, 0, 3 }, { 2, 30, 0 } } },
- { { { 11, 0, 4 }, { 2, 31, 1 } } },
- { { { 12, 0, 4 }, { 2, 31, 0 } } },
- { { { 12, 0, 3 }, { 4, 27, 0 } } },
- { { { 12, 0, 2 }, { 3, 30, 1 } } },
- { { { 12, 0, 1 }, { 3, 30, 0 } } },
- { { { 12, 0, 0 }, { 4, 28, 0 } } },
- { { { 12, 0, 1 }, { 3, 31, 1 } } },
- { { { 12, 0, 2 }, { 3, 31, 0 } } },
- { { { 12, 0, 3 }, { 3, 31, 1 } } },
- { { { 12, 0, 4 }, { 4, 30, 1 } } },
- { { { 13, 0, 3 }, { 4, 30, 0 } } },
- { { { 13, 0, 2 }, { 6, 27, 1 } } },
- { { { 13, 0, 1 }, { 6, 27, 0 } } },
- { { { 13, 0, 0 }, { 4, 31, 0 } } },
- { { { 13, 0, 1 }, { 5, 30, 1 } } },
- { { { 13, 0, 2 }, { 5, 30, 0 } } },
- { { { 13, 0, 3 }, { 8, 24, 0 } } },
- { { { 13, 0, 4 }, { 5, 31, 1 } } },
- { { { 14, 0, 3 }, { 5, 31, 0 } } },
- { { { 14, 0, 2 }, { 5, 31, 1 } } },
- { { { 14, 0, 1 }, { 6, 30, 1 } } },
- { { { 14, 0, 0 }, { 6, 30, 0 } } },
- { { { 14, 0, 1 }, { 6, 31, 1 } } },
- { { { 14, 0, 2 }, { 6, 31, 0 } } },
- { { { 14, 0, 3 }, { 8, 27, 0 } } },
- { { { 14, 0, 4 }, { 7, 30, 1 } } },
- { { { 15, 0, 3 }, { 7, 30, 0 } } },
- { { { 15, 0, 2 }, { 8, 28, 0 } } },
- { { { 15, 0, 1 }, { 7, 31, 1 } } },
- { { { 15, 0, 0 }, { 7, 31, 0 } } },
- { { { 15, 0, 1 }, { 7, 31, 1 } } },
- { { { 15, 0, 2 }, { 8, 30, 1 } } },
- { { { 15, 0, 3 }, { 8, 30, 0 } } },
- { { { 15, 0, 4 }, { 10, 27, 1 } } },
- { { { 16, 0, 4 }, { 10, 27, 0 } } },
- { { { 16, 0, 3 }, { 8, 31, 0 } } },
- { { { 16, 0, 2 }, { 9, 30, 1 } } },
- { { { 16, 0, 1 }, { 9, 30, 0 } } },
- { { { 16, 0, 0 }, { 12, 24, 0 } } },
- { { { 16, 0, 1 }, { 9, 31, 1 } } },
- { { { 16, 0, 2 }, { 9, 31, 0 } } },
- { { { 16, 0, 3 }, { 9, 31, 1 } } },
- { { { 16, 0, 4 }, { 10, 30, 1 } } },
- { { { 17, 0, 3 }, { 10, 30, 0 } } },
- { { { 17, 0, 2 }, { 10, 31, 1 } } },
- { { { 17, 0, 1 }, { 10, 31, 0 } } },
- { { { 17, 0, 0 }, { 12, 27, 0 } } },
- { { { 17, 0, 1 }, { 11, 30, 1 } } },
- { { { 17, 0, 2 }, { 11, 30, 0 } } },
- { { { 17, 0, 3 }, { 12, 28, 0 } } },
- { { { 17, 0, 4 }, { 11, 31, 1 } } },
- { { { 18, 0, 3 }, { 11, 31, 0 } } },
- { { { 18, 0, 2 }, { 11, 31, 1 } } },
- { { { 18, 0, 1 }, { 12, 30, 1 } } },
- { { { 18, 0, 0 }, { 12, 30, 0 } } },
- { { { 18, 0, 1 }, { 14, 27, 1 } } },
- { { { 18, 0, 2 }, { 14, 27, 0 } } },
- { { { 18, 0, 3 }, { 12, 31, 0 } } },
- { { { 18, 0, 4 }, { 13, 30, 1 } } },
- { { { 19, 0, 3 }, { 13, 30, 0 } } },
- { { { 19, 0, 2 }, { 16, 24, 0 } } },
- { { { 19, 0, 1 }, { 13, 31, 1 } } },
- { { { 19, 0, 0 }, { 13, 31, 0 } } },
- { { { 19, 0, 1 }, { 13, 31, 1 } } },
- { { { 19, 0, 2 }, { 14, 30, 1 } } },
- { { { 19, 0, 3 }, { 14, 30, 0 } } },
- { { { 19, 0, 4 }, { 14, 31, 1 } } },
- { { { 20, 0, 4 }, { 14, 31, 0 } } },
- { { { 20, 0, 3 }, { 16, 27, 0 } } },
- { { { 20, 0, 2 }, { 15, 30, 1 } } },
- { { { 20, 0, 1 }, { 15, 30, 0 } } },
- { { { 20, 0, 0 }, { 16, 28, 0 } } },
- { { { 20, 0, 1 }, { 15, 31, 1 } } },
- { { { 20, 0, 2 }, { 15, 31, 0 } } },
- { { { 20, 0, 3 }, { 15, 31, 1 } } },
- { { { 20, 0, 4 }, { 16, 30, 1 } } },
- { { { 21, 0, 3 }, { 16, 30, 0 } } },
- { { { 21, 0, 2 }, { 18, 27, 1 } } },
- { { { 21, 0, 1 }, { 18, 27, 0 } } },
- { { { 21, 0, 0 }, { 16, 31, 0 } } },
- { { { 21, 0, 1 }, { 17, 30, 1 } } },
- { { { 21, 0, 2 }, { 17, 30, 0 } } },
- { { { 21, 0, 3 }, { 20, 24, 0 } } },
- { { { 21, 0, 4 }, { 17, 31, 1 } } },
- { { { 22, 0, 3 }, { 17, 31, 0 } } },
- { { { 22, 0, 2 }, { 17, 31, 1 } } },
- { { { 22, 0, 1 }, { 18, 30, 1 } } },
- { { { 22, 0, 0 }, { 18, 30, 0 } } },
- { { { 22, 0, 1 }, { 18, 31, 1 } } },
- { { { 22, 0, 2 }, { 18, 31, 0 } } },
- { { { 22, 0, 3 }, { 20, 27, 0 } } },
- { { { 22, 0, 4 }, { 19, 30, 1 } } },
- { { { 23, 0, 3 }, { 19, 30, 0 } } },
- { { { 23, 0, 2 }, { 20, 28, 0 } } },
- { { { 23, 0, 1 }, { 19, 31, 1 } } },
- { { { 23, 0, 0 }, { 19, 31, 0 } } },
- { { { 23, 0, 1 }, { 19, 31, 1 } } },
- { { { 23, 0, 2 }, { 20, 30, 1 } } },
- { { { 23, 0, 3 }, { 20, 30, 0 } } },
- { { { 23, 0, 4 }, { 22, 27, 1 } } },
- { { { 24, 0, 4 }, { 22, 27, 0 } } },
- { { { 24, 0, 3 }, { 20, 31, 0 } } },
- { { { 24, 0, 2 }, { 21, 30, 1 } } },
- { { { 24, 0, 1 }, { 21, 30, 0 } } },
- { { { 24, 0, 0 }, { 24, 24, 0 } } },
- { { { 24, 0, 1 }, { 21, 31, 1 } } },
- { { { 24, 0, 2 }, { 21, 31, 0 } } },
- { { { 24, 0, 3 }, { 21, 31, 1 } } },
- { { { 24, 0, 4 }, { 22, 30, 1 } } },
- { { { 25, 0, 3 }, { 22, 30, 0 } } },
- { { { 25, 0, 2 }, { 22, 31, 1 } } },
- { { { 25, 0, 1 }, { 22, 31, 0 } } },
- { { { 25, 0, 0 }, { 24, 27, 0 } } },
- { { { 25, 0, 1 }, { 23, 30, 1 } } },
- { { { 25, 0, 2 }, { 23, 30, 0 } } },
- { { { 25, 0, 3 }, { 24, 28, 0 } } },
- { { { 25, 0, 4 }, { 23, 31, 1 } } },
- { { { 26, 0, 3 }, { 23, 31, 0 } } },
- { { { 26, 0, 2 }, { 23, 31, 1 } } },
- { { { 26, 0, 1 }, { 24, 30, 1 } } },
- { { { 26, 0, 0 }, { 24, 30, 0 } } },
- { { { 26, 0, 1 }, { 26, 27, 1 } } },
- { { { 26, 0, 2 }, { 26, 27, 0 } } },
- { { { 26, 0, 3 }, { 24, 31, 0 } } },
- { { { 26, 0, 4 }, { 25, 30, 1 } } },
- { { { 27, 0, 3 }, { 25, 30, 0 } } },
- { { { 27, 0, 2 }, { 28, 24, 0 } } },
- { { { 27, 0, 1 }, { 25, 31, 1 } } },
- { { { 27, 0, 0 }, { 25, 31, 0 } } },
- { { { 27, 0, 1 }, { 25, 31, 1 } } },
- { { { 27, 0, 2 }, { 26, 30, 1 } } },
- { { { 27, 0, 3 }, { 26, 30, 0 } } },
- { { { 27, 0, 4 }, { 26, 31, 1 } } },
- { { { 28, 0, 4 }, { 26, 31, 0 } } },
- { { { 28, 0, 3 }, { 28, 27, 0 } } },
- { { { 28, 0, 2 }, { 27, 30, 1 } } },
- { { { 28, 0, 1 }, { 27, 30, 0 } } },
- { { { 28, 0, 0 }, { 28, 28, 0 } } },
- { { { 28, 0, 1 }, { 27, 31, 1 } } },
- { { { 28, 0, 2 }, { 27, 31, 0 } } },
- { { { 28, 0, 3 }, { 27, 31, 1 } } },
- { { { 28, 0, 4 }, { 28, 30, 1 } } },
- { { { 29, 0, 3 }, { 28, 30, 0 } } },
- { { { 29, 0, 2 }, { 30, 27, 1 } } },
- { { { 29, 0, 1 }, { 30, 27, 0 } } },
- { { { 29, 0, 0 }, { 28, 31, 0 } } },
- { { { 29, 0, 1 }, { 29, 30, 1 } } },
- { { { 29, 0, 2 }, { 29, 30, 0 } } },
- { { { 29, 0, 3 }, { 29, 30, 1 } } },
- { { { 29, 0, 4 }, { 29, 31, 1 } } },
- { { { 30, 0, 3 }, { 29, 31, 0 } } },
- { { { 30, 0, 2 }, { 29, 31, 1 } } },
- { { { 30, 0, 1 }, { 30, 30, 1 } } },
- { { { 30, 0, 0 }, { 30, 30, 0 } } },
- { { { 30, 0, 1 }, { 30, 31, 1 } } },
- { { { 30, 0, 2 }, { 30, 31, 0 } } },
- { { { 30, 0, 3 }, { 30, 31, 1 } } },
- { { { 30, 0, 4 }, { 31, 30, 1 } } },
- { { { 31, 0, 3 }, { 31, 30, 0 } } },
- { { { 31, 0, 2 }, { 31, 30, 1 } } },
- { { { 31, 0, 1 }, { 31, 31, 1 } } },
- { { { 31, 0, 0 }, { 31, 31, 0 } } }
-};
-
-static SingleColourLookup const lookup_6_4[] =
-{
- { { { 0, 0, 0 }, { 0, 0, 0 } } },
- { { { 0, 0, 1 }, { 0, 1, 0 } } },
- { { { 0, 0, 2 }, { 0, 2, 0 } } },
- { { { 1, 0, 1 }, { 0, 3, 1 } } },
- { { { 1, 0, 0 }, { 0, 3, 0 } } },
- { { { 1, 0, 1 }, { 0, 4, 0 } } },
- { { { 1, 0, 2 }, { 0, 5, 0 } } },
- { { { 2, 0, 1 }, { 0, 6, 1 } } },
- { { { 2, 0, 0 }, { 0, 6, 0 } } },
- { { { 2, 0, 1 }, { 0, 7, 0 } } },
- { { { 2, 0, 2 }, { 0, 8, 0 } } },
- { { { 3, 0, 1 }, { 0, 9, 1 } } },
- { { { 3, 0, 0 }, { 0, 9, 0 } } },
- { { { 3, 0, 1 }, { 0, 10, 0 } } },
- { { { 3, 0, 2 }, { 0, 11, 0 } } },
- { { { 4, 0, 1 }, { 0, 12, 1 } } },
- { { { 4, 0, 0 }, { 0, 12, 0 } } },
- { { { 4, 0, 1 }, { 0, 13, 0 } } },
- { { { 4, 0, 2 }, { 0, 14, 0 } } },
- { { { 5, 0, 1 }, { 0, 15, 1 } } },
- { { { 5, 0, 0 }, { 0, 15, 0 } } },
- { { { 5, 0, 1 }, { 0, 16, 0 } } },
- { { { 5, 0, 2 }, { 1, 15, 0 } } },
- { { { 6, 0, 1 }, { 0, 17, 0 } } },
- { { { 6, 0, 0 }, { 0, 18, 0 } } },
- { { { 6, 0, 1 }, { 0, 19, 0 } } },
- { { { 6, 0, 2 }, { 3, 14, 0 } } },
- { { { 7, 0, 1 }, { 0, 20, 0 } } },
- { { { 7, 0, 0 }, { 0, 21, 0 } } },
- { { { 7, 0, 1 }, { 0, 22, 0 } } },
- { { { 7, 0, 2 }, { 4, 15, 0 } } },
- { { { 8, 0, 1 }, { 0, 23, 0 } } },
- { { { 8, 0, 0 }, { 0, 24, 0 } } },
- { { { 8, 0, 1 }, { 0, 25, 0 } } },
- { { { 8, 0, 2 }, { 6, 14, 0 } } },
- { { { 9, 0, 1 }, { 0, 26, 0 } } },
- { { { 9, 0, 0 }, { 0, 27, 0 } } },
- { { { 9, 0, 1 }, { 0, 28, 0 } } },
- { { { 9, 0, 2 }, { 7, 15, 0 } } },
- { { { 10, 0, 1 }, { 0, 29, 0 } } },
- { { { 10, 0, 0 }, { 0, 30, 0 } } },
- { { { 10, 0, 1 }, { 0, 31, 0 } } },
- { { { 10, 0, 2 }, { 9, 14, 0 } } },
- { { { 11, 0, 1 }, { 0, 32, 0 } } },
- { { { 11, 0, 0 }, { 0, 33, 0 } } },
- { { { 11, 0, 1 }, { 2, 30, 0 } } },
- { { { 11, 0, 2 }, { 0, 34, 0 } } },
- { { { 12, 0, 1 }, { 0, 35, 0 } } },
- { { { 12, 0, 0 }, { 0, 36, 0 } } },
- { { { 12, 0, 1 }, { 3, 31, 0 } } },
- { { { 12, 0, 2 }, { 0, 37, 0 } } },
- { { { 13, 0, 1 }, { 0, 38, 0 } } },
- { { { 13, 0, 0 }, { 0, 39, 0 } } },
- { { { 13, 0, 1 }, { 5, 30, 0 } } },
- { { { 13, 0, 2 }, { 0, 40, 0 } } },
- { { { 14, 0, 1 }, { 0, 41, 0 } } },
- { { { 14, 0, 0 }, { 0, 42, 0 } } },
- { { { 14, 0, 1 }, { 6, 31, 0 } } },
- { { { 14, 0, 2 }, { 0, 43, 0 } } },
- { { { 15, 0, 1 }, { 0, 44, 0 } } },
- { { { 15, 0, 0 }, { 0, 45, 0 } } },
- { { { 15, 0, 1 }, { 8, 30, 0 } } },
- { { { 15, 0, 2 }, { 0, 46, 0 } } },
- { { { 16, 0, 2 }, { 0, 47, 0 } } },
- { { { 16, 0, 1 }, { 1, 46, 0 } } },
- { { { 16, 0, 0 }, { 0, 48, 0 } } },
- { { { 16, 0, 1 }, { 0, 49, 0 } } },
- { { { 16, 0, 2 }, { 0, 50, 0 } } },
- { { { 17, 0, 1 }, { 2, 47, 0 } } },
- { { { 17, 0, 0 }, { 0, 51, 0 } } },
- { { { 17, 0, 1 }, { 0, 52, 0 } } },
- { { { 17, 0, 2 }, { 0, 53, 0 } } },
- { { { 18, 0, 1 }, { 4, 46, 0 } } },
- { { { 18, 0, 0 }, { 0, 54, 0 } } },
- { { { 18, 0, 1 }, { 0, 55, 0 } } },
- { { { 18, 0, 2 }, { 0, 56, 0 } } },
- { { { 19, 0, 1 }, { 5, 47, 0 } } },
- { { { 19, 0, 0 }, { 0, 57, 0 } } },
- { { { 19, 0, 1 }, { 0, 58, 0 } } },
- { { { 19, 0, 2 }, { 0, 59, 0 } } },
- { { { 20, 0, 1 }, { 7, 46, 0 } } },
- { { { 20, 0, 0 }, { 0, 60, 0 } } },
- { { { 20, 0, 1 }, { 0, 61, 0 } } },
- { { { 20, 0, 2 }, { 0, 62, 0 } } },
- { { { 21, 0, 1 }, { 8, 47, 0 } } },
- { { { 21, 0, 0 }, { 0, 63, 0 } } },
- { { { 21, 0, 1 }, { 1, 62, 0 } } },
- { { { 21, 0, 2 }, { 1, 63, 0 } } },
- { { { 22, 0, 1 }, { 10, 46, 0 } } },
- { { { 22, 0, 0 }, { 2, 62, 0 } } },
- { { { 22, 0, 1 }, { 2, 63, 0 } } },
- { { { 22, 0, 2 }, { 3, 62, 0 } } },
- { { { 23, 0, 1 }, { 11, 47, 0 } } },
- { { { 23, 0, 0 }, { 3, 63, 0 } } },
- { { { 23, 0, 1 }, { 4, 62, 0 } } },
- { { { 23, 0, 2 }, { 4, 63, 0 } } },
- { { { 24, 0, 1 }, { 13, 46, 0 } } },
- { { { 24, 0, 0 }, { 5, 62, 0 } } },
- { { { 24, 0, 1 }, { 5, 63, 0 } } },
- { { { 24, 0, 2 }, { 6, 62, 0 } } },
- { { { 25, 0, 1 }, { 14, 47, 0 } } },
- { { { 25, 0, 0 }, { 6, 63, 0 } } },
- { { { 25, 0, 1 }, { 7, 62, 0 } } },
- { { { 25, 0, 2 }, { 7, 63, 0 } } },
- { { { 26, 0, 1 }, { 16, 45, 0 } } },
- { { { 26, 0, 0 }, { 8, 62, 0 } } },
- { { { 26, 0, 1 }, { 8, 63, 0 } } },
- { { { 26, 0, 2 }, { 9, 62, 0 } } },
- { { { 27, 0, 1 }, { 16, 48, 0 } } },
- { { { 27, 0, 0 }, { 9, 63, 0 } } },
- { { { 27, 0, 1 }, { 10, 62, 0 } } },
- { { { 27, 0, 2 }, { 10, 63, 0 } } },
- { { { 28, 0, 1 }, { 16, 51, 0 } } },
- { { { 28, 0, 0 }, { 11, 62, 0 } } },
- { { { 28, 0, 1 }, { 11, 63, 0 } } },
- { { { 28, 0, 2 }, { 12, 62, 0 } } },
- { { { 29, 0, 1 }, { 16, 54, 0 } } },
- { { { 29, 0, 0 }, { 12, 63, 0 } } },
- { { { 29, 0, 1 }, { 13, 62, 0 } } },
- { { { 29, 0, 2 }, { 13, 63, 0 } } },
- { { { 30, 0, 1 }, { 16, 57, 0 } } },
- { { { 30, 0, 0 }, { 14, 62, 0 } } },
- { { { 30, 0, 1 }, { 14, 63, 0 } } },
- { { { 30, 0, 2 }, { 15, 62, 0 } } },
- { { { 31, 0, 1 }, { 16, 60, 0 } } },
- { { { 31, 0, 0 }, { 15, 63, 0 } } },
- { { { 31, 0, 1 }, { 24, 46, 0 } } },
- { { { 31, 0, 2 }, { 16, 62, 0 } } },
- { { { 32, 0, 2 }, { 16, 63, 0 } } },
- { { { 32, 0, 1 }, { 17, 62, 0 } } },
- { { { 32, 0, 0 }, { 25, 47, 0 } } },
- { { { 32, 0, 1 }, { 17, 63, 0 } } },
- { { { 32, 0, 2 }, { 18, 62, 0 } } },
- { { { 33, 0, 1 }, { 18, 63, 0 } } },
- { { { 33, 0, 0 }, { 27, 46, 0 } } },
- { { { 33, 0, 1 }, { 19, 62, 0 } } },
- { { { 33, 0, 2 }, { 19, 63, 0 } } },
- { { { 34, 0, 1 }, { 20, 62, 0 } } },
- { { { 34, 0, 0 }, { 28, 47, 0 } } },
- { { { 34, 0, 1 }, { 20, 63, 0 } } },
- { { { 34, 0, 2 }, { 21, 62, 0 } } },
- { { { 35, 0, 1 }, { 21, 63, 0 } } },
- { { { 35, 0, 0 }, { 30, 46, 0 } } },
- { { { 35, 0, 1 }, { 22, 62, 0 } } },
- { { { 35, 0, 2 }, { 22, 63, 0 } } },
- { { { 36, 0, 1 }, { 23, 62, 0 } } },
- { { { 36, 0, 0 }, { 31, 47, 0 } } },
- { { { 36, 0, 1 }, { 23, 63, 0 } } },
- { { { 36, 0, 2 }, { 24, 62, 0 } } },
- { { { 37, 0, 1 }, { 24, 63, 0 } } },
- { { { 37, 0, 0 }, { 32, 47, 0 } } },
- { { { 37, 0, 1 }, { 25, 62, 0 } } },
- { { { 37, 0, 2 }, { 25, 63, 0 } } },
- { { { 38, 0, 1 }, { 26, 62, 0 } } },
- { { { 38, 0, 0 }, { 32, 50, 0 } } },
- { { { 38, 0, 1 }, { 26, 63, 0 } } },
- { { { 38, 0, 2 }, { 27, 62, 0 } } },
- { { { 39, 0, 1 }, { 27, 63, 0 } } },
- { { { 39, 0, 0 }, { 32, 53, 0 } } },
- { { { 39, 0, 1 }, { 28, 62, 0 } } },
- { { { 39, 0, 2 }, { 28, 63, 0 } } },
- { { { 40, 0, 1 }, { 29, 62, 0 } } },
- { { { 40, 0, 0 }, { 32, 56, 0 } } },
- { { { 40, 0, 1 }, { 29, 63, 0 } } },
- { { { 40, 0, 2 }, { 30, 62, 0 } } },
- { { { 41, 0, 1 }, { 30, 63, 0 } } },
- { { { 41, 0, 0 }, { 32, 59, 0 } } },
- { { { 41, 0, 1 }, { 31, 62, 0 } } },
- { { { 41, 0, 2 }, { 31, 63, 0 } } },
- { { { 42, 0, 1 }, { 32, 61, 0 } } },
- { { { 42, 0, 0 }, { 32, 62, 0 } } },
- { { { 42, 0, 1 }, { 32, 63, 0 } } },
- { { { 42, 0, 2 }, { 41, 46, 0 } } },
- { { { 43, 0, 1 }, { 33, 62, 0 } } },
- { { { 43, 0, 0 }, { 33, 63, 0 } } },
- { { { 43, 0, 1 }, { 34, 62, 0 } } },
- { { { 43, 0, 2 }, { 42, 47, 0 } } },
- { { { 44, 0, 1 }, { 34, 63, 0 } } },
- { { { 44, 0, 0 }, { 35, 62, 0 } } },
- { { { 44, 0, 1 }, { 35, 63, 0 } } },
- { { { 44, 0, 2 }, { 44, 46, 0 } } },
- { { { 45, 0, 1 }, { 36, 62, 0 } } },
- { { { 45, 0, 0 }, { 36, 63, 0 } } },
- { { { 45, 0, 1 }, { 37, 62, 0 } } },
- { { { 45, 0, 2 }, { 45, 47, 0 } } },
- { { { 46, 0, 1 }, { 37, 63, 0 } } },
- { { { 46, 0, 0 }, { 38, 62, 0 } } },
- { { { 46, 0, 1 }, { 38, 63, 0 } } },
- { { { 46, 0, 2 }, { 47, 46, 0 } } },
- { { { 47, 0, 1 }, { 39, 62, 0 } } },
- { { { 47, 0, 0 }, { 39, 63, 0 } } },
- { { { 47, 0, 1 }, { 40, 62, 0 } } },
- { { { 47, 0, 2 }, { 48, 46, 0 } } },
- { { { 48, 0, 2 }, { 40, 63, 0 } } },
- { { { 48, 0, 1 }, { 41, 62, 0 } } },
- { { { 48, 0, 0 }, { 41, 63, 0 } } },
- { { { 48, 0, 1 }, { 48, 49, 0 } } },
- { { { 48, 0, 2 }, { 42, 62, 0 } } },
- { { { 49, 0, 1 }, { 42, 63, 0 } } },
- { { { 49, 0, 0 }, { 43, 62, 0 } } },
- { { { 49, 0, 1 }, { 48, 52, 0 } } },
- { { { 49, 0, 2 }, { 43, 63, 0 } } },
- { { { 50, 0, 1 }, { 44, 62, 0 } } },
- { { { 50, 0, 0 }, { 44, 63, 0 } } },
- { { { 50, 0, 1 }, { 48, 55, 0 } } },
- { { { 50, 0, 2 }, { 45, 62, 0 } } },
- { { { 51, 0, 1 }, { 45, 63, 0 } } },
- { { { 51, 0, 0 }, { 46, 62, 0 } } },
- { { { 51, 0, 1 }, { 48, 58, 0 } } },
- { { { 51, 0, 2 }, { 46, 63, 0 } } },
- { { { 52, 0, 1 }, { 47, 62, 0 } } },
- { { { 52, 0, 0 }, { 47, 63, 0 } } },
- { { { 52, 0, 1 }, { 48, 61, 0 } } },
- { { { 52, 0, 2 }, { 48, 62, 0 } } },
- { { { 53, 0, 1 }, { 56, 47, 0 } } },
- { { { 53, 0, 0 }, { 48, 63, 0 } } },
- { { { 53, 0, 1 }, { 49, 62, 0 } } },
- { { { 53, 0, 2 }, { 49, 63, 0 } } },
- { { { 54, 0, 1 }, { 58, 46, 0 } } },
- { { { 54, 0, 0 }, { 50, 62, 0 } } },
- { { { 54, 0, 1 }, { 50, 63, 0 } } },
- { { { 54, 0, 2 }, { 51, 62, 0 } } },
- { { { 55, 0, 1 }, { 59, 47, 0 } } },
- { { { 55, 0, 0 }, { 51, 63, 0 } } },
- { { { 55, 0, 1 }, { 52, 62, 0 } } },
- { { { 55, 0, 2 }, { 52, 63, 0 } } },
- { { { 56, 0, 1 }, { 61, 46, 0 } } },
- { { { 56, 0, 0 }, { 53, 62, 0 } } },
- { { { 56, 0, 1 }, { 53, 63, 0 } } },
- { { { 56, 0, 2 }, { 54, 62, 0 } } },
- { { { 57, 0, 1 }, { 62, 47, 0 } } },
- { { { 57, 0, 0 }, { 54, 63, 0 } } },
- { { { 57, 0, 1 }, { 55, 62, 0 } } },
- { { { 57, 0, 2 }, { 55, 63, 0 } } },
- { { { 58, 0, 1 }, { 56, 62, 1 } } },
- { { { 58, 0, 0 }, { 56, 62, 0 } } },
- { { { 58, 0, 1 }, { 56, 63, 0 } } },
- { { { 58, 0, 2 }, { 57, 62, 0 } } },
- { { { 59, 0, 1 }, { 57, 63, 1 } } },
- { { { 59, 0, 0 }, { 57, 63, 0 } } },
- { { { 59, 0, 1 }, { 58, 62, 0 } } },
- { { { 59, 0, 2 }, { 58, 63, 0 } } },
- { { { 60, 0, 1 }, { 59, 62, 1 } } },
- { { { 60, 0, 0 }, { 59, 62, 0 } } },
- { { { 60, 0, 1 }, { 59, 63, 0 } } },
- { { { 60, 0, 2 }, { 60, 62, 0 } } },
- { { { 61, 0, 1 }, { 60, 63, 1 } } },
- { { { 61, 0, 0 }, { 60, 63, 0 } } },
- { { { 61, 0, 1 }, { 61, 62, 0 } } },
- { { { 61, 0, 2 }, { 61, 63, 0 } } },
- { { { 62, 0, 1 }, { 62, 62, 1 } } },
- { { { 62, 0, 0 }, { 62, 62, 0 } } },
- { { { 62, 0, 1 }, { 62, 63, 0 } } },
- { { { 62, 0, 2 }, { 63, 62, 0 } } },
- { { { 63, 0, 1 }, { 63, 63, 1 } } },
- { { { 63, 0, 0 }, { 63, 63, 0 } } }
-};
diff --git a/tools/depends/native/libsquish-native/src/squish-Info.plist b/tools/depends/native/libsquish-native/src/squish-Info.plist
deleted file mode 100644
index 5cb05e056c..0000000000
--- a/tools/depends/native/libsquish-native/src/squish-Info.plist
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIdentifier</key>
- <string>com.sjbrown.squish</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundlePackageType</key>
- <string>FMWK</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
-</dict>
-</plist>
diff --git a/tools/depends/native/libsquish-native/src/squish.cpp b/tools/depends/native/libsquish-native/src/squish.cpp
deleted file mode 100644
index c0ce058457..0000000000
--- a/tools/depends/native/libsquish-native/src/squish.cpp
+++ /dev/null
@@ -1,360 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#include <string.h>
-#include <squish.h>
-#include "colourset.h"
-#include "maths.h"
-#include "rangefit.h"
-#include "clusterfit.h"
-#include "colourblock.h"
-#include "alpha.h"
-#include "singlecolourfit.h"
-
-namespace squish {
-
-static int FixFlags( int flags )
-{
- // grab the flag bits
- int method = flags & ( kDxt1 | kDxt3 | kDxt5 );
- int fit = flags & ( kColourIterativeClusterFit | kColourClusterFit | kColourRangeFit );
- int extra = flags & ( kWeightColourByAlpha | kSourceBGRA );
-
- // set defaults
- if( method != kDxt3 && method != kDxt5 )
- method = kDxt1;
- if( fit != kColourRangeFit && fit != kColourIterativeClusterFit )
- fit = kColourClusterFit;
-
- // done
- return method | fit | extra;
-}
-
-void CompressMasked( u8 const* rgba, int mask, void* block, int flags, float* metric )
-{
- // fix any bad flags
- flags = FixFlags( flags );
-
- // get the block locations
- void* colourBlock = block;
- void* alphaBock = block;
- if( ( flags & ( kDxt3 | kDxt5 ) ) != 0 )
- colourBlock = reinterpret_cast< u8* >( block ) + 8;
-
- // create the minimal point set
- ColourSet colours( rgba, mask, flags );
-
- // check the compression type and compress colour
- if( colours.GetCount() == 1 )
- {
- // always do a single colour fit
- SingleColourFit fit( &colours, flags );
- fit.Compress( colourBlock );
- }
- else if( ( flags & kColourRangeFit ) != 0 || colours.GetCount() == 0 )
- {
- // do a range fit
- RangeFit fit( &colours, flags, metric );
- fit.Compress( colourBlock );
- }
- else
- {
- // default to a cluster fit (could be iterative or not)
- ClusterFit fit( &colours, flags, metric );
- fit.Compress( colourBlock );
- }
-
- // compress alpha separately if necessary
- if( ( flags & kDxt3 ) != 0 )
- CompressAlphaDxt3( rgba, mask, alphaBock );
- else if( ( flags & kDxt5 ) != 0 )
- CompressAlphaDxt5( rgba, mask, alphaBock );
-}
-
-void Decompress( u8* rgba, void const* block, int flags )
-{
- // fix any bad flags
- flags = FixFlags( flags );
-
- // get the block locations
- void const* colourBlock = block;
- void const* alphaBock = block;
- if( ( flags & ( kDxt3 | kDxt5 ) ) != 0 )
- colourBlock = reinterpret_cast< u8 const* >( block ) + 8;
-
- // decompress colour
- DecompressColour( rgba, colourBlock, ( flags & kDxt1 ) != 0 );
-
- // decompress alpha separately if necessary
- if( ( flags & kDxt3 ) != 0 )
- DecompressAlphaDxt3( rgba, alphaBock );
- else if( ( flags & kDxt5 ) != 0 )
- DecompressAlphaDxt5( rgba, alphaBock );
-}
-
-int GetStorageRequirements( int width, int height, int flags )
-{
- // fix any bad flags
- flags = FixFlags( flags );
-
- // compute the storage requirements
- int blockcount = ( ( width + 3 )/4 ) * ( ( height + 3 )/4 );
- int blocksize = ( ( flags & kDxt1 ) != 0 ) ? 8 : 16;
- return blockcount*blocksize;
-}
-
-void CopyRGBA( u8 const* source, u8* dest, int flags )
-{
- if (flags & kSourceBGRA)
- {
- // convert from bgra to rgba
- dest[0] = source[2];
- dest[1] = source[1];
- dest[2] = source[0];
- dest[3] = source[3];
- }
- else
- {
- for( int i = 0; i < 4; ++i )
- *dest++ = *source++;
- }
-}
-
-void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags, float* metric )
-{
- CompressImage(rgba, width, height, width*4, blocks, flags, metric);
-}
-
-void CompressImage( u8 const* rgba, int width, int height, int pitch, void* blocks, int flags, float* metric )
-{
- // fix any bad flags
- flags = FixFlags( flags );
-
- // initialise the block output
- u8* targetBlock = reinterpret_cast< u8* >( blocks );
- int bytesPerBlock = ( ( flags & kDxt1 ) != 0 ) ? 8 : 16;
-
- // loop over blocks
- for( int y = 0; y < height; y += 4 )
- {
- for( int x = 0; x < width; x += 4 )
- {
- // build the 4x4 block of pixels
- u8 sourceRgba[16*4];
- u8* targetPixel = sourceRgba;
- int mask = 0;
- for( int py = 0; py < 4; ++py )
- {
- for( int px = 0; px < 4; ++px )
- {
- // get the source pixel in the image
- int sx = x + px;
- int sy = y + py;
-
- // enable if we're in the image
- if( sx < width && sy < height )
- {
- // copy the rgba value
- u8 const* sourcePixel = rgba + pitch*sy + 4*sx;
- CopyRGBA(sourcePixel, targetPixel, flags);
- // enable this pixel
- mask |= ( 1 << ( 4*py + px ) );
- }
- targetPixel += 4;
- }
- }
-
- // compress it into the output
- CompressMasked( sourceRgba, mask, targetBlock, flags, metric );
-
- // advance
- targetBlock += bytesPerBlock;
- }
- }
-}
-
-void DecompressImage( u8* rgba, int width, int height, void const* blocks, int flags )
-{
- DecompressImage( rgba, width, height, width*4, blocks, flags );
-}
-
-void DecompressImage( u8* rgba, int width, int height, int pitch, void const* blocks, int flags )
-{
- // fix any bad flags
- flags = FixFlags( flags );
-
- // initialise the block input
- u8 const* sourceBlock = reinterpret_cast< u8 const* >( blocks );
- int bytesPerBlock = ( ( flags & kDxt1 ) != 0 ) ? 8 : 16;
-
- // loop over blocks
- for( int y = 0; y < height; y += 4 )
- {
- for( int x = 0; x < width; x += 4 )
- {
- // decompress the block
- u8 targetRgba[4*16];
- Decompress( targetRgba, sourceBlock, flags );
-
- // write the decompressed pixels to the correct image locations
- u8 const* sourcePixel = targetRgba;
- for( int py = 0; py < 4; ++py )
- {
- for( int px = 0; px < 4; ++px )
- {
- // get the target location
- int sx = x + px;
- int sy = y + py;
- if( sx < width && sy < height )
- {
- u8* targetPixel = rgba + pitch*sy + 4*sx;
-
- // copy the rgba value
- CopyRGBA(sourcePixel, targetPixel, flags);
- }
- sourcePixel += 4;
- }
- }
-
- // advance
- sourceBlock += bytesPerBlock;
- }
- }
-}
-
-static double ErrorSq(double x, double y)
-{
- return (x - y) * (x - y);
-}
-
-static void ComputeBlockWMSE(u8 const *original, u8 const *compressed, unsigned int w, unsigned int h, double &cmse, double &amse)
-{
- // Computes the MSE for the block and weights it by the variance of the original block.
- // If the variance of the original block is less than 4 (i.e. a standard deviation of 1 per channel)
- // then the block is close to being a single colour. Quantisation errors in single colour blocks
- // are easier to see than similar errors in blocks that contain more colours, particularly when there
- // are many such blocks in a large area (eg a blue sky background) as they cause banding. Given that
- // banding is easier to see than small errors in "complex" blocks, we weight the errors by a factor
- // of 5. This implies that images with large, single colour areas will have a higher potential WMSE
- // than images with lots of detail.
-
- cmse = amse = 0;
- unsigned int sum_p[4]; // per channel sum of pixels
- unsigned int sum_p2[4]; // per channel sum of pixels squared
- memset(sum_p, 0, sizeof(sum_p));
- memset(sum_p2, 0, sizeof(sum_p2));
- for( unsigned int py = 0; py < 4; ++py )
- {
- for( unsigned int px = 0; px < 4; ++px )
- {
- if( px < w && py < h )
- {
- double pixelCMSE = 0;
- for( int i = 0; i < 3; ++i )
- {
- pixelCMSE += ErrorSq(original[i], compressed[i]);
- sum_p[i] += original[i];
- sum_p2[i] += (unsigned int)original[i]*original[i];
- }
- if( original[3] == 0 && compressed[3] == 0 )
- pixelCMSE = 0; // transparent in both, so colour is inconsequential
- amse += ErrorSq(original[3], compressed[3]);
- cmse += pixelCMSE;
- sum_p[3] += original[3];
- sum_p2[3] += (unsigned int)original[3]*original[3];
- }
- original += 4;
- compressed += 4;
- }
- }
- unsigned int variance = 0;
- for( int i = 0; i < 4; ++i )
- variance += w*h*sum_p2[i] - sum_p[i]*sum_p[i];
- if( variance < 4 * w * w * h * h )
- {
- amse *= 5;
- cmse *= 5;
- }
-}
-
-void ComputeMSE( u8 const *rgba, int width, int height, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE )
-{
- ComputeMSE(rgba, width, height, width*4, dxt, flags, colourMSE, alphaMSE);
-}
-
-void ComputeMSE( u8 const *rgba, int width, int height, int pitch, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE )
-{
- // fix any bad flags
- flags = FixFlags( flags );
- colourMSE = alphaMSE = 0;
-
- // initialise the block input
- squish::u8 const* sourceBlock = dxt;
- int bytesPerBlock = ( ( flags & squish::kDxt1 ) != 0 ) ? 8 : 16;
-
- // loop over blocks
- for( int y = 0; y < height; y += 4 )
- {
- for( int x = 0; x < width; x += 4 )
- {
- // decompress the block
- u8 targetRgba[4*16];
- Decompress( targetRgba, sourceBlock, flags );
- u8 const* sourcePixel = targetRgba;
-
- // copy across to a similar pixel block
- u8 originalRgba[4*16];
- u8* originalPixel = originalRgba;
-
- for( int py = 0; py < 4; ++py )
- {
- for( int px = 0; px < 4; ++px )
- {
- int sx = x + px;
- int sy = y + py;
- if( sx < width && sy < height )
- {
- u8 const* targetPixel = rgba + pitch*sy + 4*sx;
- CopyRGBA(targetPixel, originalPixel, flags);
- }
- sourcePixel += 4;
- originalPixel += 4;
- }
- }
-
- // compute the weighted MSE of the block
- double blockCMSE, blockAMSE;
- ComputeBlockWMSE(originalRgba, targetRgba, std::min(4, width - x), std::min(4, height - y), blockCMSE, blockAMSE);
- colourMSE += blockCMSE;
- alphaMSE += blockAMSE;
- // advance
- sourceBlock += bytesPerBlock;
- }
- }
- colourMSE /= (width * height * 3);
- alphaMSE /= (width * height);
-}
-
-} // namespace squish
diff --git a/tools/depends/native/libsquish-native/src/squish.h b/tools/depends/native/libsquish-native/src/squish.h
deleted file mode 100644
index c68f5c548e..0000000000
--- a/tools/depends/native/libsquish-native/src/squish.h
+++ /dev/null
@@ -1,295 +0,0 @@
-/* -----------------------------------------------------------------------------
-
- Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- -------------------------------------------------------------------------- */
-
-#ifndef SQUISH_H
-#define SQUISH_H
-
-//! All squish API functions live in this namespace.
-namespace squish {
-
-// -----------------------------------------------------------------------------
-
-//! Typedef a quantity that is a single unsigned byte.
-typedef unsigned char u8;
-
-// -----------------------------------------------------------------------------
-
-enum
-{
- //! Use DXT1 compression.
- kDxt1 = ( 1 << 0 ),
-
- //! Use DXT3 compression.
- kDxt3 = ( 1 << 1 ),
-
- //! Use DXT5 compression.
- kDxt5 = ( 1 << 2 ),
-
- //! Use a very slow but very high quality colour compressor.
- kColourIterativeClusterFit = ( 1 << 8 ),
-
- //! Use a slow but high quality colour compressor (the default).
- kColourClusterFit = ( 1 << 3 ),
-
- //! Use a fast but low quality colour compressor.
- kColourRangeFit = ( 1 << 4 ),
-
- //! Weight the colour by alpha during cluster fit (disabled by default).
- kWeightColourByAlpha = ( 1 << 7 ),
-
- //! Source is BGRA rather than RGBA
- kSourceBGRA = ( 1 << 9 ),
-};
-
-// -----------------------------------------------------------------------------
-
-/*! @brief Compresses a 4x4 block of pixels.
-
- @param rgba The rgba values of the 16 source pixels.
- @param mask The valid pixel mask.
- @param block Storage for the compressed DXT block.
- @param flags Compression flags.
- @param metric An optional perceptual metric.
-
- The source pixels should be presented as a contiguous array of 16 rgba
- values, with each component as 1 byte each. In memory this should be:
-
- { r1, g1, b1, a1, .... , r16, g16, b16, a16 }
-
- The mask parameter enables only certain pixels within the block. The lowest
- bit enables the first pixel and so on up to the 16th bit. Bits beyond the
- 16th bit are ignored. Pixels that are not enabled are allowed to take
- arbitrary colours in the output block. An example of how this can be used
- is in the CompressImage function to disable pixels outside the bounds of
- the image when the width or height is not divisible by 4.
-
- The flags parameter should specify either kDxt1, kDxt3 or kDxt5 compression,
- however, DXT1 will be used by default if none is specified. When using DXT1
- compression, 8 bytes of storage are required for the compressed DXT block.
- DXT3 and DXT5 compression require 16 bytes of storage per block.
-
- The flags parameter can also specify a preferred colour compressor to use
- when fitting the RGB components of the data. Possible colour compressors
- are: kColourClusterFit (the default), kColourRangeFit (very fast, low
- quality) or kColourIterativeClusterFit (slowest, best quality).
-
- When using kColourClusterFit or kColourIterativeClusterFit, an additional
- flag can be specified to weight the importance of each pixel by its alpha
- value. For images that are rendered using alpha blending, this can
- significantly increase the perceived quality.
-
- The metric parameter can be used to weight the relative importance of each
- colour channel, or pass NULL to use the default uniform weight of
- { 1.0f, 1.0f, 1.0f }. This replaces the previous flag-based control that
- allowed either uniform or "perceptual" weights with the fixed values
- { 0.2126f, 0.7152f, 0.0722f }. If non-NULL, the metric should point to a
- contiguous array of 3 floats.
-*/
-void CompressMasked( u8 const* rgba, int mask, void* block, int flags, float* metric = 0 );
-
-// -----------------------------------------------------------------------------
-
-/*! @brief Compresses a 4x4 block of pixels.
-
- @param rgba The rgba values of the 16 source pixels.
- @param block Storage for the compressed DXT block.
- @param flags Compression flags.
- @param metric An optional perceptual metric.
-
- The source pixels should be presented as a contiguous array of 16 rgba
- values, with each component as 1 byte each. In memory this should be:
-
- { r1, g1, b1, a1, .... , r16, g16, b16, a16 }
-
- The flags parameter should specify either kDxt1, kDxt3 or kDxt5 compression,
- however, DXT1 will be used by default if none is specified. When using DXT1
- compression, 8 bytes of storage are required for the compressed DXT block.
- DXT3 and DXT5 compression require 16 bytes of storage per block.
-
- The flags parameter can also specify a preferred colour compressor to use
- when fitting the RGB components of the data. Possible colour compressors
- are: kColourClusterFit (the default), kColourRangeFit (very fast, low
- quality) or kColourIterativeClusterFit (slowest, best quality).
-
- When using kColourClusterFit or kColourIterativeClusterFit, an additional
- flag can be specified to weight the importance of each pixel by its alpha
- value. For images that are rendered using alpha blending, this can
- significantly increase the perceived quality.
-
- The metric parameter can be used to weight the relative importance of each
- colour channel, or pass NULL to use the default uniform weight of
- { 1.0f, 1.0f, 1.0f }. This replaces the previous flag-based control that
- allowed either uniform or "perceptual" weights with the fixed values
- { 0.2126f, 0.7152f, 0.0722f }. If non-NULL, the metric should point to a
- contiguous array of 3 floats.
-
- This method is an inline that calls CompressMasked with a mask of 0xffff,
- provided for compatibility with older versions of squish.
-*/
-inline void Compress( u8 const* rgba, void* block, int flags, float* metric = 0 )
-{
- CompressMasked( rgba, 0xffff, block, flags, metric );
-}
-
-// -----------------------------------------------------------------------------
-
-/*! @brief Decompresses a 4x4 block of pixels.
-
- @param rgba Storage for the 16 decompressed pixels.
- @param block The compressed DXT block.
- @param flags Compression flags.
-
- The decompressed pixels will be written as a contiguous array of 16 rgba
- values, with each component as 1 byte each. In memory this is:
-
- { r1, g1, b1, a1, .... , r16, g16, b16, a16 }
-
- The flags parameter should specify either kDxt1, kDxt3 or kDxt5 compression,
- however, DXT1 will be used by default if none is specified. All other flags
- are ignored.
-*/
-void Decompress( u8* rgba, void const* block, int flags );
-
-// -----------------------------------------------------------------------------
-
-/*! @brief Computes the amount of compressed storage required.
-
- @param width The width of the image.
- @param height The height of the image.
- @param flags Compression flags.
-
- The flags parameter should specify either kDxt1, kDxt3 or kDxt5 compression,
- however, DXT1 will be used by default if none is specified. All other flags
- are ignored.
-
- Most DXT images will be a multiple of 4 in each dimension, but this
- function supports arbitrary size images by allowing the outer blocks to
- be only partially used.
-*/
-int GetStorageRequirements( int width, int height, int flags );
-
-// -----------------------------------------------------------------------------
-
-/*! @brief Compresses an image in memory.
-
- @param rgba The pixels of the source.
- @param width The width of the source image.
- @param height The height of the source image.
- @param pitch The pitch of the source image.
- @param blocks Storage for the compressed output.
- @param flags Compression flags.
- @param metric An optional perceptual metric.
-
- The source pixels should be presented as a contiguous array of width*height
- rgba values, with each component as 1 byte each. In memory this should be:
-
- { r1, g1, b1, a1, .... , rn, gn, bn, an } for n = width*height
-
- The flags parameter should specify either kDxt1, kDxt3 or kDxt5 compression,
- however, DXT1 will be used by default if none is specified. When using DXT1
- compression, 8 bytes of storage are required for each compressed DXT block.
- DXT3 and DXT5 compression require 16 bytes of storage per block.
-
- The flags parameter can also specify a preferred colour compressor to use
- when fitting the RGB components of the data. Possible colour compressors
- are: kColourClusterFit (the default), kColourRangeFit (very fast, low
- quality) or kColourIterativeClusterFit (slowest, best quality).
-
- When using kColourClusterFit or kColourIterativeClusterFit, an additional
- flag can be specified to weight the importance of each pixel by its alpha
- value. For images that are rendered using alpha blending, this can
- significantly increase the perceived quality.
-
- The metric parameter can be used to weight the relative importance of each
- colour channel, or pass NULL to use the default uniform weight of
- { 1.0f, 1.0f, 1.0f }. This replaces the previous flag-based control that
- allowed either uniform or "perceptual" weights with the fixed values
- { 0.2126f, 0.7152f, 0.0722f }. If non-NULL, the metric should point to a
- contiguous array of 3 floats.
-
- Internally this function calls squish::CompressMasked for each block, which
- allows for pixels outside the image to take arbitrary values. The function
- squish::GetStorageRequirements can be called to compute the amount of memory
- to allocate for the compressed output.
-*/
-void CompressImage( u8 const* rgba, int width, int height, void* blocks, int flags, float* metric = 0 );
-void CompressImage( u8 const* rgba, int width, int height, int pitch, void* blocks, int flags, float* metric = 0 );
-
-// -----------------------------------------------------------------------------
-
-/*! @brief Decompresses an image in memory.
-
- @param rgba Storage for the decompressed pixels.
- @param width The width of the source image.
- @param height The height of the source image.
- @param pitch The pitch of the decompressed pixels.
- @param blocks The compressed DXT blocks.
- @param flags Compression flags.
-
- The decompressed pixels will be written as a contiguous array of width*height
- 16 rgba values, with each component as 1 byte each. In memory this is:
-
- { r1, g1, b1, a1, .... , rn, gn, bn, an } for n = width*height
-
- The flags parameter should specify either kDxt1, kDxt3 or kDxt5 compression,
- however, DXT1 will be used by default if none is specified. All other flags
- are ignored.
-
- Internally this function calls squish::Decompress for each block.
-*/
-void DecompressImage( u8* rgba, int width, int height, void const* blocks, int flags );
-void DecompressImage( u8* rgba, int width, int height, int pitch, void const* blocks, int flags );
-
-// -----------------------------------------------------------------------------
-
-/*! @brief Computes MSE of an compressed image in memory.
-
- @param rgba The original image pixels.
- @param width The width of the source image.
- @param height The height of the source image.
- @param pitch The pitch of the source image.
- @param dxt The compressed dxt blocks
- @param flags Compression flags.
- @param colourMSE The MSE of the colour values.
- @param alphaMSE The MSE of the alpha values.
-
- The colour MSE and alpha MSE are computed across all pixels. The colour MSE is
- averaged across all rgb values (i.e. colourMSE = sum sum_k ||dxt.k - rgba.k||/3)
-
- The flags parameter should specify either kDxt1, kDxt3 or kDxt5 compression,
- however, DXT1 will be used by default if none is specified. All other flags
- are ignored.
-
- Internally this function calls squish::Decompress for each block.
-*/
-void ComputeMSE(u8 const *rgba, int width, int height, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE);
-void ComputeMSE(u8 const *rgba, int width, int height, int pitch, u8 const *dxt, int flags, double &colourMSE, double &alphaMSE);
-
-// -----------------------------------------------------------------------------
-
-} // namespace squish
-
-#endif // ndef SQUISH_H
-
diff --git a/tools/depends/native/libsquish-native/src/squish.pc.in b/tools/depends/native/libsquish-native/src/squish.pc.in
deleted file mode 100644
index ca04334393..0000000000
--- a/tools/depends/native/libsquish-native/src/squish.pc.in
+++ /dev/null
@@ -1,13 +0,0 @@
-prefix=@PREFIX@
-exec_prefix=${prefix}
-libdir=${prefix}/lib
-sharedlibdir=${libdir}
-includedir=${prefix}/include
-
-Name: squish
-Description: squish DXT lib
-Version: 1.0.0-kodi
-
-Requires:
-Libs: -L${libdir} -L${sharedlibdir} -lsquish
-Cflags: -I${includedir}
diff --git a/tools/depends/native/libsquish-native/src/texture_compression_s3tc.txt b/tools/depends/native/libsquish-native/src/texture_compression_s3tc.txt
deleted file mode 100644
index f229cf3678..0000000000
--- a/tools/depends/native/libsquish-native/src/texture_compression_s3tc.txt
+++ /dev/null
@@ -1,508 +0,0 @@
-Name
-
- EXT_texture_compression_s3tc
-
-Name Strings
-
- GL_EXT_texture_compression_s3tc
-
-Contact
-
- Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com)
-
-Status
-
- FINAL
-
-Version
-
- 1.1, 16 November 2001 (containing only clarifications relative to
- version 1.0, dated 7 July 2000)
-
-Number
-
- 198
-
-Dependencies
-
- OpenGL 1.1 is required.
-
- GL_ARB_texture_compression is required.
-
- This extension is written against the OpenGL 1.2.1 Specification.
-
-Overview
-
- This extension provides additional texture compression functionality
- specific to S3's S3TC format (called DXTC in Microsoft's DirectX API),
- subject to all the requirements and limitations described by the extension
- GL_ARB_texture_compression.
-
- This extension supports DXT1, DXT3, and DXT5 texture compression formats.
- For the DXT1 image format, this specification supports an RGB-only mode
- and a special RGBA mode with single-bit "transparent" alpha.
-
-IP Status
-
- Contact S3 Incorporated (http://www.s3.com) regarding any intellectual
- property issues associated with implementing this extension.
-
- WARNING: Vendors able to support S3TC texture compression in Direct3D
- drivers do not necessarily have the right to use the same functionality in
- OpenGL.
-
-Issues
-
- (1) Should DXT2 and DXT4 (premultiplied alpha) formats be supported?
-
- RESOLVED: No -- insufficient interest. Supporting DXT2 and DXT4
- would require some rework to the TexEnv definition (maybe add a new
- base internal format RGBA_PREMULTIPLIED_ALPHA) for these formats.
- Note that the EXT_texture_env_combine extension (which extends normal
- TexEnv modes) can be used to support textures with premultipled alpha.
-
- (2) Should generic "RGB_S3TC_EXT" and "RGBA_S3TC_EXT" enums be supported
- or should we use only the DXT<n> enums?
-
- RESOLVED: No. A generic RGBA_S3TC_EXT is problematic because DXT3
- and DXT5 are both nominally RGBA (and DXT1 with the 1-bit alpha is
- also) yet one format must be chosen up front.
-
- (3) Should TexSubImage support all block-aligned edits or just the minimal
- functionality required by the ARB_texture_compression extension?
-
- RESOLVED: Allow all valid block-aligned edits.
-
- (4) A pre-compressed image with a DXT1 format can be used as either an
- RGB_S3TC_DXT1 or an RGBA_S3TC_DXT1 image. If the image has
- transparent texels, how are they treated in each format?
-
- RESOLVED: The renderer has to make sure that an RGB_S3TC_DXT1 format
- is decoded as RGB (where alpha is effectively one for all texels),
- while RGBA_S3TC_DXT1 is decoded as RGBA (where alpha is zero for all
- texels with "transparent" encodings). Otherwise, the formats are
- identical.
-
- (5) Is the encoding of the RGB components for DXT1 formats correct in this
- spec? MSDN documentation does not specify an RGB color for the
- "transparent" encoding. Is it really black?
-
- RESOLVED: Yes. The specification for the DXT1 format initially
- required black, but later changed that requirement to a
- recommendation. All vendors involved in the definition of this
- specification support black. In addition, specifying black has a
- useful behavior.
-
- When blending multiple texels (GL_LINEAR filtering), mixing opaque and
- transparent samples is problematic. Defining a black color on
- transparent texels achieves a sensible result that works like a
- texture with premultiplied alpha. For example, if three opaque white
- and one transparent sample is being averaged, the result would be a
- 75% intensity gray (with an alpha of 75%). This is the same result on
- the color channels as would be obtained using a white color, 75%
- alpha, and a SRC_ALPHA blend factor.
-
- (6) Is the encoding of the RGB components for DXT3 and DXT5 formats
- correct in this spec? MSDN documentation suggests that the RGB blocks
- for DXT3 and DXT5 are decoded as described by the DXT1 format.
-
- RESOLVED: Yes -- this appears to be a bug in the MSDN documentation.
- The specification for the DXT2-DXT5 formats require decoding using the
- opaque block encoding, regardless of the relative values of "color0"
- and "color1".
-
-New Procedures and Functions
-
- None.
-
-New Tokens
-
- Accepted by the <internalformat> parameter of TexImage2D, CopyTexImage2D,
- and CompressedTexImage2DARB and the <format> parameter of
- CompressedTexSubImage2DARB:
-
- COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
- COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
- COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
- COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
-
-Additions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation)
-
- None.
-
-Additions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization)
-
- Add to Table 3.16.1: Specific Compressed Internal Formats
-
- Compressed Internal Format Base Internal Format
- ========================== ====================
- COMPRESSED_RGB_S3TC_DXT1_EXT RGB
- COMPRESSED_RGBA_S3TC_DXT1_EXT RGBA
- COMPRESSED_RGBA_S3TC_DXT3_EXT RGBA
- COMPRESSED_RGBA_S3TC_DXT5_EXT RGBA
-
-
- Modify Section 3.8.2, Alternate Image Specification
-
- (add to end of TexSubImage discussion, p.123 -- after edit from the
- ARB_texture_compression spec)
-
- If the internal format of the texture image being modified is
- COMPRESSED_RGB_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT1_EXT,
- COMPRESSED_RGBA_S3TC_DXT3_EXT, or COMPRESSED_RGBA_S3TC_DXT5_EXT, the
- texture is stored using one of the several S3TC compressed texture image
- formats. Such images are easily edited along 4x4 texel boundaries, so the
- limitations on TexSubImage2D or CopyTexSubImage2D parameters are relaxed.
- TexSubImage2D and CopyTexSubImage2D will result in an INVALID_OPERATION
- error only if one of the following conditions occurs:
-
- * <width> is not a multiple of four or equal to TEXTURE_WIDTH,
- unless <xoffset> and <yoffset> are both zero.
- * <height> is not a multiple of four or equal to TEXTURE_HEIGHT,
- unless <xoffset> and <yoffset> are both zero.
- * <xoffset> or <yoffset> is not a multiple of four.
-
- The contents of any 4x4 block of texels of an S3TC compressed texture
- image that does not intersect the area being modified are preserved during
- valid TexSubImage2D and CopyTexSubImage2D calls.
-
-
- Add to Section 3.8.2, Alternate Image Specification (adding to the end of
- the CompressedTexImage section introduced by the ARB_texture_compression
- spec)
-
- If <internalformat> is COMPRESSED_RGB_S3TC_DXT1_EXT,
- COMPRESSED_RGBA_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT3_EXT, or
- COMPRESSED_RGBA_S3TC_DXT5_EXT, the compressed texture is stored using one
- of several S3TC compressed texture image formats. The S3TC texture
- compression algorithm supports only 2D images without borders.
- CompressedTexImage1DARB and CompressedTexImage3DARB produce an
- INVALID_ENUM error if <internalformat> is an S3TC format.
- CompressedTexImage2DARB will produce an INVALID_OPERATION error if
- <border> is non-zero.
-
-
- Add to Section 3.8.2, Alternate Image Specification (adding to the end of
- the CompressedTexSubImage section introduced by the
- ARB_texture_compression spec)
-
- If the internal format of the texture image being modified is
- COMPRESSED_RGB_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT1_EXT,
- COMPRESSED_RGBA_S3TC_DXT3_EXT, or COMPRESSED_RGBA_S3TC_DXT5_EXT, the
- texture is stored using one of the several S3TC compressed texture image
- formats. Since the S3TC texture compression algorithm supports only 2D
- images, CompressedTexSubImage1DARB and CompressedTexSubImage3DARB produce
- an INVALID_ENUM error if <format> is an S3TC format. Since S3TC images
- are easily edited along 4x4 texel boundaries, the limitations on
- CompressedTexSubImage2D are relaxed. CompressedTexSubImage2D will result
- in an INVALID_OPERATION error only if one of the following conditions
- occurs:
-
- * <width> is not a multiple of four or equal to TEXTURE_WIDTH.
- * <height> is not a multiple of four or equal to TEXTURE_HEIGHT.
- * <xoffset> or <yoffset> is not a multiple of four.
-
- The contents of any 4x4 block of texels of an S3TC compressed texture
- image that does not intersect the area being modified are preserved during
- valid TexSubImage2D and CopyTexSubImage2D calls.
-
-Additions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment
-Operations and the Frame Buffer)
-
- None.
-
-Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions)
-
- None.
-
-Additions to Chapter 6 of the OpenGL 1.2.1 Specification (State and
-State Requests)
-
- None.
-
-Additions to Appendix A of the OpenGL 1.2.1 Specification (Invariance)
-
- None.
-
-Additions to the AGL/GLX/WGL Specifications
-
- None.
-
-GLX Protocol
-
- None.
-
-Errors
-
- INVALID_ENUM is generated by CompressedTexImage1DARB or
- CompressedTexImage3DARB if <internalformat> is
- COMPRESSED_RGB_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT1_EXT,
- COMPRESSED_RGBA_S3TC_DXT3_EXT, or COMPRESSED_RGBA_S3TC_DXT5_EXT.
-
- INVALID_OPERATION is generated by CompressedTexImage2DARB if
- <internalformat> is COMPRESSED_RGB_S3TC_DXT1_EXT,
- COMPRESSED_RGBA_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT3_EXT, or
- COMPRESSED_RGBA_S3TC_DXT5_EXT and <border> is not equal to zero.
-
- INVALID_ENUM is generated by CompressedTexSubImage1DARB or
- CompressedTexSubImage3DARB if <format> is COMPRESSED_RGB_S3TC_DXT1_EXT,
- COMPRESSED_RGBA_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT3_EXT, or
- COMPRESSED_RGBA_S3TC_DXT5_EXT.
-
- INVALID_OPERATION is generated by TexSubImage2D CopyTexSubImage2D, or
- CompressedTexSubImage2D if TEXTURE_INTERNAL_FORMAT is
- COMPRESSED_RGB_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT1_EXT,
- COMPRESSED_RGBA_S3TC_DXT3_EXT, or COMPRESSED_RGBA_S3TC_DXT5_EXT and any of
- the following apply: <width> is not a multiple of four or equal to
- TEXTURE_WIDTH; <height> is not a multiple of four or equal to
- TEXTURE_HEIGHT; <xoffset> or <yoffset> is not a multiple of four.
-
-
- The following restrictions from the ARB_texture_compression specification
- do not apply to S3TC texture formats, since subimage modification is
- straightforward as long as the subimage is properly aligned.
-
- DELETE: INVALID_OPERATION is generated by TexSubImage1D, TexSubImage2D,
- DELETE: TexSubImage3D, CopyTexSubImage1D, CopyTexSubImage2D, or
- DELETE: CopyTexSubImage3D if the internal format of the texture image is
- DELETE: compressed and <xoffset>, <yoffset>, or <zoffset> does not equal
- DELETE: -b, where b is value of TEXTURE_BORDER.
-
- DELETE: INVALID_VALUE is generated by CompressedTexSubImage1DARB,
- DELETE: CompressedTexSubImage2DARB, or CompressedTexSubImage3DARB if the
- DELETE: entire texture image is not being edited: if <xoffset>,
- DELETE: <yoffset>, or <zoffset> is greater than -b, <xoffset> + <width> is
- DELETE: less than w+b, <yoffset> + <height> is less than h+b, or <zoffset>
- DELETE: + <depth> is less than d+b, where b is the value of
- DELETE: TEXTURE_BORDER, w is the value of TEXTURE_WIDTH, h is the value of
- DELETE: TEXTURE_HEIGHT, and d is the value of TEXTURE_DEPTH.
-
- See also errors in the GL_ARB_texture_compression specification.
-
-New State
-
- In the "Textures" state table, increment the TEXTURE_INTERNAL_FORMAT
- subscript for Z by 4 in the "Type" row.
-
-New Implementation Dependent State
-
- None
-
-Appendix
-
- S3TC Compressed Texture Image Formats
-
- Compressed texture images stored using the S3TC compressed image formats
- are represented as a collection of 4x4 texel blocks, where each block
- contains 64 or 128 bits of texel data. The image is encoded as a normal
- 2D raster image in which each 4x4 block is treated as a single pixel. If
- an S3TC image has a width or height less than four, the data corresponding
- to texels outside the image are irrelevant and undefined.
-
- When an S3TC image with a width of <w>, height of <h>, and block size of
- <blocksize> (8 or 16 bytes) is decoded, the corresponding image size (in
- bytes) is:
-
- ceil(<w>/4) * ceil(<h>/4) * blocksize.
-
- When decoding an S3TC image, the block containing the texel at offset
- (<x>, <y>) begins at an offset (in bytes) relative to the base of the
- image of:
-
- blocksize * (ceil(<w>/4) * floor(<y>/4) + floor(<x>/4)).
-
- The data corresponding to a specific texel (<x>, <y>) are extracted from a
- 4x4 texel block using a relative (x,y) value of
-
- (<x> modulo 4, <y> modulo 4).
-
- There are four distinct S3TC image formats:
-
- COMPRESSED_RGB_S3TC_DXT1_EXT: Each 4x4 block of texels consists of 64
- bits of RGB image data.
-
- Each RGB image data block is encoded as a sequence of 8 bytes, called (in
- order of increasing address):
-
- c0_lo, c0_hi, c1_lo, c1_hi, bits_0, bits_1, bits_2, bits_3
-
- The 8 bytes of the block are decoded into three quantities:
-
- color0 = c0_lo + c0_hi * 256
- color1 = c1_lo + c1_hi * 256
- bits = bits_0 + 256 * (bits_1 + 256 * (bits_2 + 256 * bits_3))
-
- color0 and color1 are 16-bit unsigned integers that are unpacked to
- RGB colors RGB0 and RGB1 as though they were 16-bit packed pixels with
- a <format> of RGB and a type of UNSIGNED_SHORT_5_6_5.
-
- bits is a 32-bit unsigned integer, from which a two-bit control code
- is extracted for a texel at location (x,y) in the block using:
-
- code(x,y) = bits[2*(4*y+x)+1..2*(4*y+x)+0]
-
- where bit 31 is the most significant and bit 0 is the least
- significant bit.
-
- The RGB color for a texel at location (x,y) in the block is given by:
-
- RGB0, if color0 > color1 and code(x,y) == 0
- RGB1, if color0 > color1 and code(x,y) == 1
- (2*RGB0+RGB1)/3, if color0 > color1 and code(x,y) == 2
- (RGB0+2*RGB1)/3, if color0 > color1 and code(x,y) == 3
-
- RGB0, if color0 <= color1 and code(x,y) == 0
- RGB1, if color0 <= color1 and code(x,y) == 1
- (RGB0+RGB1)/2, if color0 <= color1 and code(x,y) == 2
- BLACK, if color0 <= color1 and code(x,y) == 3
-
- Arithmetic operations are done per component, and BLACK refers to an
- RGB color where red, green, and blue are all zero.
-
- Since this image has an RGB format, there is no alpha component and the
- image is considered fully opaque.
-
-
- COMPRESSED_RGBA_S3TC_DXT1_EXT: Each 4x4 block of texels consists of 64
- bits of RGB image data and minimal alpha information. The RGB components
- of a texel are extracted in the same way as COMPRESSED_RGB_S3TC_DXT1_EXT.
-
- The alpha component for a texel at location (x,y) in the block is
- given by:
-
- 0.0, if color0 <= color1 and code(x,y) == 3
- 1.0, otherwise
-
- IMPORTANT: When encoding an RGBA image into a format using 1-bit
- alpha, any texels with an alpha component less than 0.5 end up with an
- alpha of 0.0 and any texels with an alpha component greater than or
- equal to 0.5 end up with an alpha of 1.0. When encoding an RGBA image
- into the COMPRESSED_RGBA_S3TC_DXT1_EXT format, the resulting red,
- green, and blue components of any texels with a final alpha of 0.0
- will automatically be zero (black). If this behavior is not desired
- by an application, it should not use COMPRESSED_RGBA_S3TC_DXT1_EXT.
- This format will never be used when a generic compressed internal
- format (Table 3.16.2) is specified, although the nearly identical
- format COMPRESSED_RGB_S3TC_DXT1_EXT (above) may be.
-
-
- COMPRESSED_RGBA_S3TC_DXT3_EXT: Each 4x4 block of texels consists of 64
- bits of uncompressed alpha image data followed by 64 bits of RGB image
- data.
-
- Each RGB image data block is encoded according to the
- COMPRESSED_RGB_S3TC_DXT1_EXT format, with the exception that the two code
- bits always use the non-transparent encodings. In other words, they are
- treated as though color0 > color1, regardless of the actual values of
- color0 and color1.
-
- Each alpha image data block is encoded as a sequence of 8 bytes, called
- (in order of increasing address):
-
- a0, a1, a2, a3, a4, a5, a6, a7
-
- The 8 bytes of the block are decoded into one 64-bit integer:
-
- alpha = a0 + 256 * (a1 + 256 * (a2 + 256 * (a3 + 256 * (a4 +
- 256 * (a5 + 256 * (a6 + 256 * a7))))))
-
- alpha is a 64-bit unsigned integer, from which a four-bit alpha value
- is extracted for a texel at location (x,y) in the block using:
-
- alpha(x,y) = bits[4*(4*y+x)+3..4*(4*y+x)+0]
-
- where bit 63 is the most significant and bit 0 is the least
- significant bit.
-
- The alpha component for a texel at location (x,y) in the block is
- given by alpha(x,y) / 15.
-
-
- COMPRESSED_RGBA_S3TC_DXT5_EXT: Each 4x4 block of texels consists of 64
- bits of compressed alpha image data followed by 64 bits of RGB image data.
-
- Each RGB image data block is encoded according to the
- COMPRESSED_RGB_S3TC_DXT1_EXT format, with the exception that the two code
- bits always use the non-transparent encodings. In other words, they are
- treated as though color0 > color1, regardless of the actual values of
- color0 and color1.
-
- Each alpha image data block is encoded as a sequence of 8 bytes, called
- (in order of increasing address):
-
- alpha0, alpha1, bits_0, bits_1, bits_2, bits_3, bits_4, bits_5
-
- The alpha0 and alpha1 are 8-bit unsigned bytes converted to alpha
- components by multiplying by 1/255.
-
- The 6 "bits" bytes of the block are decoded into one 48-bit integer:
-
- bits = bits_0 + 256 * (bits_1 + 256 * (bits_2 + 256 * (bits_3 +
- 256 * (bits_4 + 256 * bits_5))))
-
- bits is a 48-bit unsigned integer, from which a three-bit control code
- is extracted for a texel at location (x,y) in the block using:
-
- code(x,y) = bits[3*(4*y+x)+1..3*(4*y+x)+0]
-
- where bit 47 is the most significant and bit 0 is the least
- significant bit.
-
- The alpha component for a texel at location (x,y) in the block is
- given by:
-
- alpha0, code(x,y) == 0
- alpha1, code(x,y) == 1
-
- (6*alpha0 + 1*alpha1)/7, alpha0 > alpha1 and code(x,y) == 2
- (5*alpha0 + 2*alpha1)/7, alpha0 > alpha1 and code(x,y) == 3
- (4*alpha0 + 3*alpha1)/7, alpha0 > alpha1 and code(x,y) == 4
- (3*alpha0 + 4*alpha1)/7, alpha0 > alpha1 and code(x,y) == 5
- (2*alpha0 + 5*alpha1)/7, alpha0 > alpha1 and code(x,y) == 6
- (1*alpha0 + 6*alpha1)/7, alpha0 > alpha1 and code(x,y) == 7
-
- (4*alpha0 + 1*alpha1)/5, alpha0 <= alpha1 and code(x,y) == 2
- (3*alpha0 + 2*alpha1)/5, alpha0 <= alpha1 and code(x,y) == 3
- (2*alpha0 + 3*alpha1)/5, alpha0 <= alpha1 and code(x,y) == 4
- (1*alpha0 + 4*alpha1)/5, alpha0 <= alpha1 and code(x,y) == 5
- 0.0, alpha0 <= alpha1 and code(x,y) == 6
- 1.0, alpha0 <= alpha1 and code(x,y) == 7
-
-
-Revision History
-
- 1.1, 11/16/01 pbrown: Updated contact info, clarified where texels
- fall within a single block.
-
- 1.0, 07/07/00 prbrown1: Published final version agreed to by working
- group members.
-
- 0.9, 06/24/00 prbrown1: Documented that block-aligned TexSubImage calls
- do not modify existing texels outside the
- modified blocks. Added caveat to allow for a
- (0,0)-anchored TexSubImage operation of
- arbitrary size.
-
- 0.7, 04/11/00 prbrown1: Added issues on DXT1, DXT3, and DXT5 encodings
- where the MSDN documentation doesn't match what
- is really done. Added enum values from the
- extension registry.
-
- 0.4, 03/28/00 prbrown1: Updated to reflect final version of the
- ARB_texture_compression extension. Allowed
- block-aligned TexSubImage calls.
-
- 0.3, 03/07/00 prbrown1: Resolved issues pertaining to the format of RGB
- blocks in the DXT3 and DXT5 formats (they don't
- ever use the "transparent" encoding). Fixed
- decoding of DXT1 blocks. Pointed out issue of
- "transparent" texels in DXT1 encodings having
- different behaviors for RGB and RGBA internal
- formats.
-
- 0.2, 02/23/00 prbrown1: Minor revisions; added several issues.
-
- 0.11, 02/17/00 prbrown1: Slight modification to error semantics
- (INVALID_ENUM instead of INVALID_OPERATION).
-
- 0.1, 02/15/00 prbrown1: Initial revision.
diff --git a/tools/depends/native/libsquish-native/src/vs7/squish.sln b/tools/depends/native/libsquish-native/src/vs7/squish.sln
deleted file mode 100644
index ae23f85c46..0000000000
--- a/tools/depends/native/libsquish-native/src/vs7/squish.sln
+++ /dev/null
@@ -1,39 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "squish", "squish\squish.vcproj", "{6A8518C3-D81A-4428-BD7F-C37933088AC1}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "squishpng", "squishpng\squishpng.vcproj", "{3BC7CF47-F1C8-4BDA-BE30-92F17B21D2C7}"
- ProjectSection(ProjectDependencies) = postProject
- {6A8518C3-D81A-4428-BD7F-C37933088AC1} = {6A8518C3-D81A-4428-BD7F-C37933088AC1}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "squishtest", "squishtest\squishtest.vcproj", "{77A3F26C-A1D6-4535-9E37-7D3DF34E4B4B}"
- ProjectSection(ProjectDependencies) = postProject
- {6A8518C3-D81A-4428-BD7F-C37933088AC1} = {6A8518C3-D81A-4428-BD7F-C37933088AC1}
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {6A8518C3-D81A-4428-BD7F-C37933088AC1}.Debug.ActiveCfg = Debug|Win32
- {6A8518C3-D81A-4428-BD7F-C37933088AC1}.Debug.Build.0 = Debug|Win32
- {6A8518C3-D81A-4428-BD7F-C37933088AC1}.Release.ActiveCfg = Release|Win32
- {6A8518C3-D81A-4428-BD7F-C37933088AC1}.Release.Build.0 = Release|Win32
- {3BC7CF47-F1C8-4BDA-BE30-92F17B21D2C7}.Debug.ActiveCfg = Debug|Win32
- {3BC7CF47-F1C8-4BDA-BE30-92F17B21D2C7}.Debug.Build.0 = Debug|Win32
- {3BC7CF47-F1C8-4BDA-BE30-92F17B21D2C7}.Release.ActiveCfg = Release|Win32
- {3BC7CF47-F1C8-4BDA-BE30-92F17B21D2C7}.Release.Build.0 = Release|Win32
- {77A3F26C-A1D6-4535-9E37-7D3DF34E4B4B}.Debug.ActiveCfg = Debug|Win32
- {77A3F26C-A1D6-4535-9E37-7D3DF34E4B4B}.Debug.Build.0 = Debug|Win32
- {77A3F26C-A1D6-4535-9E37-7D3DF34E4B4B}.Release.ActiveCfg = Release|Win32
- {77A3F26C-A1D6-4535-9E37-7D3DF34E4B4B}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/tools/depends/native/libsquish-native/src/vs7/squish/squish_2010.vcxproj b/tools/depends/native/libsquish-native/src/vs7/squish/squish_2010.vcxproj
deleted file mode 100644
index dfcecbc8eb..0000000000
--- a/tools/depends/native/libsquish-native/src/vs7/squish/squish_2010.vcxproj
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectName>squish</ProjectName>
- <ProjectGuid>{6A8518C3-D81A-4428-BD7F-C37933088AC1}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(SolutionDir)\XBMC.core-defaults.props" />
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(SolutionDir)\XBMC.defaults.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(SolutionDir)\XBMC.defaults.props" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)libs\$(TargetName)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)objs\$(TargetName)\$(Configuration)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)libs\$(TargetName)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)objs\$(TargetName)\$(Configuration)\</IntDir>
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)d</TargetName>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_LIB;SQUISH_USE_SSE=2;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <WarningLevel>Level4</WarningLevel>
- </ClCompile>
- <Lib>
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
- <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
- </Lib>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <AdditionalIncludeDirectories>..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_LIB;SQUISH_USE_SSE=2;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <WarningLevel>Level4</WarningLevel>
- </ClCompile>
- <Lib>
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
- <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
- <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
- </Lib>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\..\alpha.cpp" />
- <ClCompile Include="..\..\clusterfit.cpp" />
- <ClCompile Include="..\..\colourblock.cpp" />
- <ClCompile Include="..\..\colourfit.cpp" />
- <ClCompile Include="..\..\colourset.cpp" />
- <ClCompile Include="..\..\maths.cpp" />
- <ClCompile Include="..\..\rangefit.cpp" />
- <ClCompile Include="..\..\singlecolourfit.cpp" />
- <ClCompile Include="..\..\squish.cpp" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\..\alpha.h" />
- <ClInclude Include="..\..\clusterfit.h" />
- <ClInclude Include="..\..\colourblock.h" />
- <ClInclude Include="..\..\colourfit.h" />
- <ClInclude Include="..\..\colourset.h" />
- <ClInclude Include="..\..\config.h" />
- <ClInclude Include="..\..\maths.h" />
- <ClInclude Include="..\..\rangefit.h" />
- <ClInclude Include="..\..\simd.h" />
- <ClInclude Include="..\..\simd_float.h" />
- <ClInclude Include="..\..\simd_sse.h" />
- <ClInclude Include="..\..\simd_ve.h" />
- <ClInclude Include="..\..\singlecolourfit.h" />
- <ClInclude Include="..\..\squish.h" />
- </ItemGroup>
- <ItemGroup>
- <None Include="..\..\singlecolourlookup.inl" />
- <None Include="..\..\texture_compression_s3tc.txt" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/tools/depends/native/libsquish-native/src/vs7/squish/squish_2010.vcxproj.filters b/tools/depends/native/libsquish-native/src/vs7/squish/squish_2010.vcxproj.filters
deleted file mode 100644
index a898002d4b..0000000000
--- a/tools/depends/native/libsquish-native/src/vs7/squish/squish_2010.vcxproj.filters
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\..\alpha.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\..\clusterfit.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\..\colourblock.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\..\colourfit.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\..\colourset.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\..\maths.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\..\rangefit.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\..\singlecolourfit.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\..\squish.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\..\alpha.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\clusterfit.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\colourblock.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\colourfit.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\colourset.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\config.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\maths.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\rangefit.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\simd.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\simd_float.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\simd_sse.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\simd_ve.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\singlecolourfit.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\squish.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <None Include="..\..\singlecolourlookup.inl">
- <Filter>Header Files</Filter>
- </None>
- <None Include="..\..\texture_compression_s3tc.txt">
- <Filter>Resource Files</Filter>
- </None>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/tools/depends/native/libsquish-native/src/vs7/squishpng/squishpng.vcproj b/tools/depends/native/libsquish-native/src/vs7/squishpng/squishpng.vcproj
deleted file mode 100644
index 1154d7bc9a..0000000000
--- a/tools/depends/native/libsquish-native/src/vs7/squishpng/squishpng.vcproj
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="squishpng"
- ProjectGUID="{3BC7CF47-F1C8-4BDA-BE30-92F17B21D2C7}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\.."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- WarnAsError="TRUE"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="libpng13d.lib"
- OutputFile="../../bin/squishpngd.exe"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/squishpng.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- WarnAsError="TRUE"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="libpng.lib"
- OutputFile="../../bin/squishpng.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\..\extra\squishpng.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/tools/depends/native/libsquish-native/src/vs7/squishtest/squishtest.vcproj b/tools/depends/native/libsquish-native/src/vs7/squishtest/squishtest.vcproj
deleted file mode 100644
index 930bfc4077..0000000000
--- a/tools/depends/native/libsquish-native/src/vs7/squishtest/squishtest.vcproj
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="squishtest"
- ProjectGUID="{77A3F26C-A1D6-4535-9E37-7D3DF34E4B4B}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..\.."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- ForceConformanceInForLoopScope="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- WarnAsError="TRUE"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="../../bin/squishtestd.exe"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/squishtest.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="..\.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- ForceConformanceInForLoopScope="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- WarnAsError="TRUE"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="../../bin/squishtest.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <File
- RelativePath="..\..\extra\squishtest.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile
index 8226bd1d36..ed625ab642 100644
--- a/tools/depends/target/Makefile
+++ b/tools/depends/target/Makefile
@@ -10,7 +10,7 @@ DEPENDS = \
openssl gmp nettle gnutls curl \
libjpeg-turbo libpng \
libogg libvorbis libflac fribidi \
- libass libsquish \
+ libass \
libmodplug librtmp libxml2 yajl libmicrohttpd mysql libffi \
python27 libshairplay \
libplist libcec libbluray tinyxml dummy-libxbmc \
@@ -89,7 +89,7 @@ libcdio: $(ICONV)
libplist: libxml2 $(ZLIB)
libbluray: $(ICONV) libxml2
libssh: libgcrypt openssl $(ZLIB)
-mysql: openssl
+mysql: openssl $(ZLIB)
libzip: $(ZLIB)
libpng: $(ZLIB)
openssl: $(ZLIB)
diff --git a/tools/depends/target/libsquish/Makefile b/tools/depends/target/libsquish/Makefile
deleted file mode 100644
index 50e9e3c9c4..0000000000
--- a/tools/depends/target/libsquish/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-include ../../Makefile.include
-DEPS = ../../Makefile.include.in Makefile
-
-# reuse native src
-SOURCE=$(abs_top_srcdir)/native/libsquish-native/src
-
-DYLIB=$(PLATFORM)/libsquish.a
-
-all: .installed-$(PLATFORM)
-
-$(PLATFORM):
- -rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)
- cd $(PLATFORM); cp -a $(SOURCE)/* .
- cd $(PLATFORM); mv Makefile.target Makefile
- cd $(PLATFORM); mkdir -p $(PREFIX)/include; mkdir -p $(PREFIX)/lib/pkgconfig
-
-$(DYLIB): $(PLATFORM)
- $(MAKE) -C $(PLATFORM)
-
-.installed-$(PLATFORM): $(DYLIB)
- $(MAKE) -C $(PLATFORM) install
- touch $@
-
-clean:
- $(MAKE) -C $(PLATFORM) clean
-
-distclean::
- rm -rf $(PLATFORM) .installed-$(PLATFORM)
diff --git a/tools/depends/target/mysql/06-fixsslcheck.patch b/tools/depends/target/mysql/06-fixsslcheck.patch
new file mode 100644
index 0000000000..42ef48abbc
--- /dev/null
+++ b/tools/depends/target/mysql/06-fixsslcheck.patch
@@ -0,0 +1,11 @@
+--- config/ac-macros/ssl.m4.orig 2016-02-14 13:47:23.792296242 +0000
++++ config/ac-macros/ssl.m4 2016-02-14 13:47:05.464296846 +0000
+@@ -111,7 +111,7 @@
+ #
+ # Try to link with openSSL libs in <location>
+ #
+- openssl_libs="-L$location/lib/ -lssl -lcrypto"
++ openssl_libs="-L$location/lib/ -lssl -lcrypto -lz -ldl"
+ MYSQL_CHECK_SSL_DIR([$openssl_includes], [$openssl_libs])
+
+ if test "$mysql_ssl_found" == "no"
diff --git a/tools/depends/target/mysql/Makefile b/tools/depends/target/mysql/Makefile
index 31fc44335b..94a81a85e9 100644
--- a/tools/depends/target/mysql/Makefile
+++ b/tools/depends/target/mysql/Makefile
@@ -13,7 +13,8 @@ CONFIGURE=cp -f $(CONFIG_SUB) $(CONFIG_GUESS) .; \
--enable-thread-safe-client --with-extra-charsets=complex \
--with-named-thread-libs=-lc --with-named-curses-libs=-lncurses \
--with-libedit \
- --without-server --without-bench --without-docs --without-man --disable-shared
+ --without-server --without-bench --without-docs --without-man --disable-shared \
+ --with-ssl=$(PREFIX) LIBS="-ldl -lz"
LIBDYLIB=$(PLATFORM)/lib$(LIBNAME)/.libs/lib$(LIBNAME)client.a
@@ -32,6 +33,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
cd $(PLATFORM); patch -Np1 -i ../03-mysqlclient-android.patch
cd $(PLATFORM); patch -p0 < ../04-strnlen.patch
cd $(PLATFORM); patch -p1 < ../05-mysqlclient-ios64.patch
+ cd $(PLATFORM); patch -p0 < ../06-fixsslcheck.patch
cd $(PLATFORM); autoconf
cd $(PLATFORM); $(CONFIGURE)
diff --git a/tools/depends/target/sqlite3/Makefile b/tools/depends/target/sqlite3/Makefile
index eeeab6b872..773830999d 100644
--- a/tools/depends/target/sqlite3/Makefile
+++ b/tools/depends/target/sqlite3/Makefile
@@ -3,7 +3,7 @@ DEPS= ../../Makefile.include Makefile
# lib name, version
LIBNAME=sqlite
-VERSION=3090200
+VERSION=3100200
SOURCE=$(LIBNAME)-autoconf-$(VERSION)
ARCHIVE=$(SOURCE).tar.gz
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index 798779cc9a..8d146d4fd0 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -681,6 +681,7 @@ const infomap skin_labels[] = {{ "currenttheme", SKIN_THEME },
{"aspectratio", SKIN_ASPECT_RATIO}};
const infomap window_bools[] = {{ "ismedia", WINDOW_IS_MEDIA },
+ { "is", WINDOW_IS },
{ "isactive", WINDOW_IS_ACTIVE },
{ "istopmost", WINDOW_IS_TOPMOST },
{ "isvisible", WINDOW_IS_VISIBLE },
@@ -741,9 +742,6 @@ const infomap pvr[] = {{ "isrecording", PVR_IS_RECORDING
{ "actstreamsnr", PVR_ACTUAL_STREAM_SNR },
{ "actstreamber", PVR_ACTUAL_STREAM_BER },
{ "actstreamunc", PVR_ACTUAL_STREAM_UNC },
- { "actstreamvideobitrate", PVR_ACTUAL_STREAM_VIDEO_BR },
- { "actstreamaudiobitrate", PVR_ACTUAL_STREAM_AUDIO_BR },
- { "actstreamdolbybitrate", PVR_ACTUAL_STREAM_DOLBY_BR },
{ "actstreamprogrsignal", PVR_ACTUAL_STREAM_SIG_PROGR },
{ "actstreamprogrsnr", PVR_ACTUAL_STREAM_SNR_PROGR },
{ "actstreamisencrypted", PVR_ACTUAL_STREAM_ENCRYPTED },
@@ -1603,9 +1601,6 @@ std::string CGUIInfoManager::GetLabel(int info, int contextWindow, std::string *
case PVR_ACTUAL_STREAM_SNR_PROGR:
case PVR_ACTUAL_STREAM_BER:
case PVR_ACTUAL_STREAM_UNC:
- case PVR_ACTUAL_STREAM_VIDEO_BR:
- case PVR_ACTUAL_STREAM_AUDIO_BR:
- case PVR_ACTUAL_STREAM_DOLBY_BR:
case PVR_ACTUAL_STREAM_CRYPTION:
case PVR_ACTUAL_STREAM_SERVICE:
case PVR_ACTUAL_STREAM_MUX:
@@ -2924,7 +2919,7 @@ bool CGUIInfoManager::GetBool(int condition1, int contextWindow, const CGUIListI
case VIDEOPLAYER_CAN_RESUME_LIVE_TV:
if (m_currentFile->HasPVRRecordingInfoTag())
{
- EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::GetInstance().GetTagById(m_currentFile->GetPVRRecordingInfoTag()->EpgEvent());
+ EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::GetInstance().GetTagById(m_currentFile->GetPVRRecordingInfoTag()->Channel(), m_currentFile->GetPVRRecordingInfoTag()->BroadcastUid());
bReturn = (epgTag && epgTag->IsActive() && epgTag->ChannelTag());
}
break;
@@ -3178,6 +3173,15 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c
bReturn = true;
}
break;
+ case WINDOW_IS:
+ if (info.GetData1())
+ {
+ CGUIWindow *window = g_windowManager.GetWindow(contextWindow);
+ bReturn = (window && window->GetID() == static_cast<int>(info.GetData1()));
+ }
+ else
+ CLog::Log(LOGERROR, "The window id is required.");
+ break;
case WINDOW_IS_VISIBLE:
if (info.GetData1())
bReturn = g_windowManager.IsWindowVisible(info.GetData1());
diff --git a/xbmc/GUILargeTextureManager.cpp b/xbmc/GUILargeTextureManager.cpp
index 5f5382fe21..f81e0d46dc 100644
--- a/xbmc/GUILargeTextureManager.cpp
+++ b/xbmc/GUILargeTextureManager.cpp
@@ -50,7 +50,7 @@ bool CImageLoader::DoWork()
std::string texturePath = g_TextureManager.GetTexturePath(m_path);
if (m_use_cache)
- loadPath = CTextureCache::GetInstance().CheckCachedImage(texturePath, true, needsChecking);
+ loadPath = CTextureCache::GetInstance().CheckCachedImage(texturePath, needsChecking);
else
loadPath = texturePath;
diff --git a/xbmc/LangInfo.cpp b/xbmc/LangInfo.cpp
index 5e33f9ed87..c6ec938e11 100644
--- a/xbmc/LangInfo.cpp
+++ b/xbmc/LangInfo.cpp
@@ -660,8 +660,10 @@ bool CLangInfo::SetLanguage(bool& fallback, const std::string &strLanguage /* =
ADDON::CRepositoryUpdater::GetInstance().Await();
ADDON::VECADDONS languageAddons;
- if (addondb.GetAddons(languageAddons, ADDON::ADDON_RESOURCE_LANGUAGE) && !languageAddons.empty())
+ if (addondb.GetRepositoryContent(languageAddons) && !languageAddons.empty())
{
+ languageAddons.erase(std::remove_if(languageAddons.begin(), languageAddons.end(),
+ [](const ADDON:: AddonPtr& addon){ return !addon->IsType(ADDON::ADDON_RESOURCE_LANGUAGE); }), languageAddons.end());
// try to get the proper language addon by its name from all available language addons
if (ADDON::CLanguageResource::FindLanguageAddonByName(language, newLanguage, languageAddons))
{
diff --git a/xbmc/SystemGlobals.cpp b/xbmc/SystemGlobals.cpp
index 6a9a4b9b47..1adc2d27e6 100644
--- a/xbmc/SystemGlobals.cpp
+++ b/xbmc/SystemGlobals.cpp
@@ -35,6 +35,10 @@
#include "interfaces/python/XBPython.h"
#endif
+// Guarantee that CSpecialProtocol is initialized before and uninitialized after RarManager
+#include "filesystem/SpecialProtocol.h"
+std::map<std::string, std::string> CSpecialProtocol::m_pathMap;
+
#if defined(HAS_FILESYSTEM_RAR)
#include "filesystem/RarManager.h"
#endif
diff --git a/xbmc/TextureCache.cpp b/xbmc/TextureCache.cpp
index b26430a84d..e0eb5ddb69 100644
--- a/xbmc/TextureCache.cpp
+++ b/xbmc/TextureCache.cpp
@@ -102,23 +102,13 @@ bool CTextureCache::CanCacheImageURL(const CURL &url)
return (url.GetUserName().empty() || url.GetUserName() == "music");
}
-std::string CTextureCache::CheckCachedImage(const std::string &url, bool returnDDS, bool &needsRecaching)
+std::string CTextureCache::CheckCachedImage(const std::string &url, bool &needsRecaching)
{
CTextureDetails details;
std::string path(GetCachedImage(url, details, true));
needsRecaching = !details.hash.empty();
if (!path.empty())
- {
- if (!needsRecaching && returnDDS && !URIUtils::IsInPath(url, "special://skin/")) // TODO: should skin images be .dds'd (currently they're not necessarily writeable)
- { // check for dds version
- std::string ddsPath = URIUtils::ReplaceExtension(path, ".dds");
- if (CFile::Exists(ddsPath))
- return ddsPath;
- if (g_advancedSettings.m_useDDSFanart)
- AddJob(new CTextureDDSJob(path));
- }
return path;
- }
return "";
}
@@ -281,10 +271,6 @@ void CTextureCache::OnCachingComplete(bool success, CTextureCacheJob *job)
}
m_completeEvent.Set();
-
- // TODO: call back to the UI indicating that it can update it's image...
- if (success && g_advancedSettings.m_useDDSFanart && !job->m_details.file.empty())
- AddJob(new CTextureDDSJob(GetCachedPath(job->m_details.file)));
}
void CTextureCache::OnJobComplete(unsigned int jobID, bool success, CJob *job)
diff --git a/xbmc/TextureCache.h b/xbmc/TextureCache.h
index 3c9e8bd67b..b4f07cd9e9 100644
--- a/xbmc/TextureCache.h
+++ b/xbmc/TextureCache.h
@@ -61,15 +61,13 @@ public:
Check and return URL to cached image if it exists; If not, return empty string.
If the image is cached, return URL (for original image or .dds version if requested)
- Creates a .dds of image if requested via returnDDS and the image doesn't need recaching.
\param image url of the image to check
- \param returnDDS if we're allowed to return a DDS version, defaults to true
\param needsRecaching [out] whether the image needs recaching.
\return cached url of this image
\sa GetCachedImage
*/
- std::string CheckCachedImage(const std::string &image, bool returnDDS, bool &needsRecaching);
+ std::string CheckCachedImage(const std::string &image, bool &needsRecaching);
/*! \brief Cache image (if required) using a background job
diff --git a/xbmc/TextureCacheJob.cpp b/xbmc/TextureCacheJob.cpp
index edf8f25690..d1c25fac7b 100644
--- a/xbmc/TextureCacheJob.cpp
+++ b/xbmc/TextureCacheJob.cpp
@@ -21,7 +21,6 @@
#include "TextureCacheJob.h"
#include "TextureCache.h"
#include "guilib/Texture.h"
-#include "guilib/DDSImage.h"
#include "settings/AdvancedSettings.h"
#include "settings/Settings.h"
#include "utils/log.h"
@@ -68,7 +67,7 @@ bool CTextureCacheJob::DoWork()
// check whether we need cache the job anyway
bool needsRecaching = false;
- std::string path(CTextureCache::GetInstance().CheckCachedImage(m_url, false, needsRecaching));
+ std::string path(CTextureCache::GetInstance().CheckCachedImage(m_url, needsRecaching));
if (!path.empty() && !needsRecaching)
return false;
return CacheTexture();
@@ -249,38 +248,6 @@ std::string CTextureCacheJob::GetImageHash(const std::string &url)
return "";
}
-CTextureDDSJob::CTextureDDSJob(const std::string &original):
- m_original(original)
-{
-}
-
-bool CTextureDDSJob::operator==(const CJob* job) const
-{
- if (strcmp(job->GetType(),GetType()) == 0)
- {
- const CTextureDDSJob* ddsJob = dynamic_cast<const CTextureDDSJob*>(job);
- if (ddsJob && ddsJob->m_original == m_original)
- return true;
- }
- return false;
-}
-
-bool CTextureDDSJob::DoWork()
-{
- if (URIUtils::HasExtension(m_original, ".dds"))
- return false;
- CBaseTexture *texture = CBaseTexture::LoadFromFile(m_original);
- if (texture)
- { // convert to DDS
- CDDSImage dds;
- CLog::Log(LOGDEBUG, "Creating DDS version of: %s", m_original.c_str());
- bool ret = dds.Create(URIUtils::ReplaceExtension(m_original, ".dds"), texture->GetWidth(), texture->GetHeight(), texture->GetPitch(), texture->GetPixels(), 40);
- delete texture;
- return ret;
- }
- return false;
-}
-
CTextureUseCountJob::CTextureUseCountJob(const std::vector<CTextureDetails> &textures) : m_textures(textures)
{
}
diff --git a/xbmc/TextureCacheJob.h b/xbmc/TextureCacheJob.h
index a806a9d0fb..dc716eb133 100644
--- a/xbmc/TextureCacheJob.h
+++ b/xbmc/TextureCacheJob.h
@@ -127,20 +127,6 @@ private:
std::string m_cachePath;
};
-/* \brief Job class for creating .dds versions of textures
- */
-class CTextureDDSJob : public CJob
-{
-public:
- CTextureDDSJob(const std::string &original);
-
- virtual const char* GetType() const { return kJobTypeDDSCompress; };
- virtual bool operator==(const CJob *job) const;
- virtual bool DoWork();
-
- std::string m_original;
-};
-
/* \brief Job class for storing the use count of textures
*/
class CTextureUseCountJob : public CJob
diff --git a/xbmc/addons/Addon.cpp b/xbmc/addons/Addon.cpp
index 897b4f9703..5864561800 100644
--- a/xbmc/addons/Addon.cpp
+++ b/xbmc/addons/Addon.cpp
@@ -194,7 +194,7 @@ void AddonProps::Serialize(CVariant &variant) const
info["value"] = it->second;
variant["extrainfo"].push_back(info);
}
- variant["rating"] = stars;
+ variant["rating"] = -1;
}
CAddon::CAddon(AddonProps props)
@@ -207,23 +207,6 @@ CAddon::CAddon(AddonProps props)
m_userSettingsLoaded = false;
}
-CAddon::CAddon(const CAddon &rhs)
- : m_props(rhs.m_props),
- m_settings(rhs.m_settings)
-{
- m_addonXmlDoc = rhs.m_addonXmlDoc;
- m_settingsLoaded = rhs.m_settingsLoaded;
- m_userSettingsLoaded = rhs.m_userSettingsLoaded;
- m_hasSettings = rhs.m_hasSettings;
- BuildProfilePath();
- m_userSettingsPath = URIUtils::AddFileToFolder(Profile(), "settings.xml");
-}
-
-AddonPtr CAddon::Clone() const
-{
- return AddonPtr(new CAddon(*this));
-}
-
bool CAddon::MeetsVersion(const AddonVersion &version) const
{
return m_props.minversion <= version && version <= m_props.version;
@@ -504,11 +487,6 @@ CAddonLibrary::CAddonLibrary(AddonProps props)
{
}
-AddonPtr CAddonLibrary::Clone() const
-{
- return AddonPtr(new CAddonLibrary(*this));
-}
-
TYPE CAddonLibrary::SetAddonType()
{
if (Type() == ADDON_VIZ_LIBRARY)
diff --git a/xbmc/addons/Addon.h b/xbmc/addons/Addon.h
index 7bbad65717..becf55686b 100644
--- a/xbmc/addons/Addon.h
+++ b/xbmc/addons/Addon.h
@@ -61,7 +61,6 @@ public:
, type(type)
, version(versionstr)
, minversion(minversionstr)
- , stars(0)
{
}
@@ -93,8 +92,7 @@ public:
std::string disclaimer;
ADDONDEPS dependencies;
std::string broken;
- InfoMap extrainfo;
- int stars;
+ InfoMap extrainfo;
CDateTime installDate;
CDateTime lastUpdated;
CDateTime lastUsed;
@@ -107,7 +105,6 @@ class CAddon : public IAddon
public:
explicit CAddon(AddonProps props);
virtual ~CAddon() {}
- virtual AddonPtr Clone() const;
/*! \brief Check whether the this addon can be configured or not
\return true if the addon has settings, false otherwise
@@ -162,7 +159,6 @@ public:
const std::string ChangeLog() const { return m_props.changelog; }
const std::string FanArt() const { return m_props.fanart; }
const std::string Icon() const { return m_props.icon; };
- int Stars() const { return m_props.stars; }
const std::string Disclaimer() const { return m_props.disclaimer; }
const std::string Broken() const { return m_props.broken; }
CDateTime InstallDate() const override { return m_props.installDate; }
@@ -208,10 +204,6 @@ public:
protected:
friend class CAddonCallbacksAddon;
- CAddon(const CAddon &rhs); // protected as all copying is handled by Clone()
-
- void BuildLibName();
-
/*! \brief Load the default settings and override these with any previously configured user settings
\param bForce force the load of settings even if they are already loaded (reload)
\return true if settings exist, false otherwise
@@ -257,7 +249,6 @@ private:
bool m_hasSettings;
std::string m_profile;
- CLocalizeStrings m_strings;
std::map<std::string, std::string> m_settings;
};
@@ -266,8 +257,6 @@ class CAddonLibrary : public CAddon
public:
explicit CAddonLibrary(AddonProps props);
- virtual AddonPtr Clone() const;
-
private:
TYPE SetAddonType();
const TYPE m_addonType; // addon type this library enhances
diff --git a/xbmc/addons/AddonBuilder.h b/xbmc/addons/AddonBuilder.h
index fd0f6a41e3..0eef650f1b 100644
--- a/xbmc/addons/AddonBuilder.h
+++ b/xbmc/addons/AddonBuilder.h
@@ -55,6 +55,7 @@ public:
void SetLastUsed(CDateTime lastUsed) { m_props.lastUsed = lastUsed; }
const std::string& GetId() const { return m_props.id; }
+ const AddonVersion& GetVersion() const { return m_props.version; }
private:
static std::shared_ptr<IAddon> FromProps(AddonProps addonProps);
diff --git a/xbmc/addons/AddonCallbacks.h b/xbmc/addons/AddonCallbacks.h
index d12c9a4715..81e8fa9b65 100644
--- a/xbmc/addons/AddonCallbacks.h
+++ b/xbmc/addons/AddonCallbacks.h
@@ -487,6 +487,9 @@ typedef void (*PVRTransferChannelGroupMember)(void *addonData, const ADDON_HANDL
typedef void (*PVRFreeDemuxPacket)(void *addonData, DemuxPacket* pPacket);
typedef DemuxPacket* (*PVRAllocateDemuxPacket)(void *addonData, int iDataSize);
+typedef void (*PVRConnectionStateChange)(void* addonData, const char* strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage);
+typedef void (*PVREpgEventStateChange)(void* addonData, EPG_TAG* tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState);
+
typedef struct CB_PVRLib
{
PVRTransferEpgEntry TransferEpgEntry;
@@ -504,6 +507,8 @@ typedef struct CB_PVRLib
PVRAllocateDemuxPacket AllocateDemuxPacket;
PVRTransferChannelGroup TransferChannelGroup;
PVRTransferChannelGroupMember TransferChannelGroupMember;
+ PVRConnectionStateChange ConnectionStateChange;
+ PVREpgEventStateChange EpgEventStateChange;
} CB_PVRLib;
diff --git a/xbmc/addons/AddonCallbacksPVR.cpp b/xbmc/addons/AddonCallbacksPVR.cpp
index 4a7325f249..63fb8c6f1b 100644
--- a/xbmc/addons/AddonCallbacksPVR.cpp
+++ b/xbmc/addons/AddonCallbacksPVR.cpp
@@ -22,9 +22,11 @@
#include "AddonCallbacksPVR.h"
#include "events/EventLog.h"
#include "events/NotificationEvent.h"
+#include "threads/SingleLock.h"
#include "utils/log.h"
#include "utils/StringUtils.h"
#include "dialogs/GUIDialogKaiToast.h"
+#include "settings/Settings.h"
#include "epg/EpgContainer.h"
#include "pvr/PVRManager.h"
@@ -62,6 +64,8 @@ CAddonCallbacksPVR::CAddonCallbacksPVR(CAddon* addon)
m_callbacks->AllocateDemuxPacket = PVRAllocateDemuxPacket;
m_callbacks->TransferChannelGroup = PVRTransferChannelGroup;
m_callbacks->TransferChannelGroupMember = PVRTransferChannelGroupMember;
+ m_callbacks->ConnectionStateChange = PVRConnectionStateChange;
+ m_callbacks->EpgEventStateChange = PVREpgEventStateChange;
}
CAddonCallbacksPVR::~CAddonCallbacksPVR()
@@ -314,4 +318,151 @@ DemuxPacket* CAddonCallbacksPVR::PVRAllocateDemuxPacket(void *addonData, int iDa
return CDVDDemuxUtils::AllocateDemuxPacket(iDataSize);
}
+void CAddonCallbacksPVR::PVRConnectionStateChange(void* addonData, const char* strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage)
+{
+ CPVRClient *client = GetPVRClient(addonData);
+ if (!client || !strConnectionString)
+ {
+ CLog::Log(LOGERROR, "PVR - %s - invalid handler data", __FUNCTION__);
+ return;
+ }
+
+ const PVR_CONNECTION_STATE prevState(client->GetConnectionState());
+ if (prevState == newState)
+ return;
+
+ CLog::Log(LOGDEBUG, "PVR - %s - state for connection '%s' on client '%s' changed from '%d' to '%d'", __FUNCTION__, strConnectionString, client->Name().c_str(), prevState, newState);
+
+ client->SetConnectionState(newState);
+
+ int iMsg(-1);
+ bool bError(true);
+ bool bNotify(true);
+
+ switch (newState)
+ {
+ case PVR_CONNECTION_STATE_SERVER_UNREACHABLE:
+ iMsg = 35505; // Server is unreachable
+ break;
+ case PVR_CONNECTION_STATE_SERVER_MISMATCH:
+ iMsg = 35506; // Server does not respond properly
+ break;
+ case PVR_CONNECTION_STATE_VERSION_MISMATCH:
+ iMsg = 35507; // Server version is not compatible
+ break;
+ case PVR_CONNECTION_STATE_ACCESS_DENIED:
+ iMsg = 35508; // Access denied
+ break;
+ case PVR_CONNECTION_STATE_CONNECTED:
+ iMsg = 36034; // Connection established
+ bError = false;
+ // No notification for the first successful connect.
+ bNotify = (prevState != PVR_CONNECTION_STATE_UNKNOWN);
+ break;
+ case PVR_CONNECTION_STATE_DISCONNECTED:
+ iMsg = 36030; // Connection lost
+ break;
+ default:
+ CLog::Log(LOGERROR, "PVR - %s - unknown connection state", __FUNCTION__);
+ return;
+ }
+
+ // Use addon-supplied message, if present
+ std::string strMsg;
+ if (strMessage && strlen(strMessage) > 0)
+ strMsg = strMessage;
+ else
+ strMsg = g_localizeStrings.Get(iMsg);
+
+ // Notify user.
+ if (bNotify && !CSettings::GetInstance().GetBool(CSettings::SETTING_PVRMANAGER_HIDECONNECTIONLOSTWARNING))
+ CGUIDialogKaiToast::QueueNotification(
+ bError ? CGUIDialogKaiToast::Error : CGUIDialogKaiToast::Info, client->Name().c_str(), strMsg, 5000, true);
+
+ // Write event log entry.
+ CEventLog::GetInstance().Add(EventPtr(new CNotificationEvent(
+ client->Name(), strMsg, client->Icon(), bError ? EventLevel::Error : EventLevel::Information)));
+}
+
+typedef struct EpgEventStateChange
+{
+ int iClientId;
+ unsigned int iUniqueChannelId;
+ CEpgInfoTagPtr event;
+ EPG_EVENT_STATE state;
+
+ EpgEventStateChange(int _iClientId, unsigned int _iUniqueChannelId, EPG_TAG *_event, EPG_EVENT_STATE _state)
+ : iClientId(_iClientId),
+ iUniqueChannelId(_iUniqueChannelId),
+ event(new CEpgInfoTag(*_event)),
+ state(_state) {}
+
+} EpgEventStateChange;
+
+void CAddonCallbacksPVR::UpdateEpgEvent(const EpgEventStateChange &ch, bool bQueued)
+{
+ const CPVRChannelPtr channel(g_PVRChannelGroups->GetByUniqueID(ch.iUniqueChannelId, ch.iClientId));
+ if (channel)
+ {
+ const CEpgPtr epg(channel->GetEPG());
+ if (epg)
+ {
+ if (!epg->UpdateEntry(ch.event, ch.state))
+ CLog::Log(LOGERROR, "PVR - %s - epg update failed for %sevent change (%d)",
+ __FUNCTION__, bQueued ? "queued " : "", ch.event->UniqueBroadcastID());
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "PVR - %s - channel '%s' does not have an EPG! Unable to deliver %sevent change (%d)!",
+ __FUNCTION__, channel->ChannelName().c_str(), bQueued ? "queued " : "", ch.event->UniqueBroadcastID());
+ }
+ }
+ else
+ CLog::Log(LOGERROR, "PVR - %s - invalid channel (%d)! Unable to deliver %sevent change (%d)!",
+ __FUNCTION__, ch.iUniqueChannelId, bQueued ? "queued " : "", ch.event->UniqueBroadcastID());
+}
+
+void CAddonCallbacksPVR::PVREpgEventStateChange(void* addonData, EPG_TAG* tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState)
+{
+ CPVRClient *client = GetPVRClient(addonData);
+ if (!client || !tag)
+ {
+ CLog::Log(LOGERROR, "PVR - %s - invalid handler data", __FUNCTION__);
+ return;
+ }
+
+ CLog::Log(LOGDEBUG, "PVR - %s - state for epg event '%d' on channel '%d' on client '%s' changed to '%d'.",
+ __FUNCTION__, tag->iUniqueBroadcastId, iUniqueChannelId, client->Name().c_str(), newState);
+
+ static CCriticalSection queueMutex;
+ static std::vector<EpgEventStateChange> queuedChanges;
+
+ // during Kodi startup, addons may push updates very early, even before EPGs are ready to use.
+ if (g_PVRManager.EpgsCreated())
+ {
+ {
+ // deliver queued changes, if any. discard event if delivery fails.
+ CSingleLock lock(queueMutex);
+ if (!queuedChanges.empty())
+ CLog::Log(LOGNOTICE, "PVR - %s - processing %ld queued epg event changes.", __FUNCTION__, queuedChanges.size());
+
+ while (!queuedChanges.empty())
+ {
+ auto it = queuedChanges.begin();
+ UpdateEpgEvent(*it, true);
+ queuedChanges.erase(it);
+ }
+ }
+
+ // deliver current change.
+ UpdateEpgEvent(EpgEventStateChange(client->GetID(), iUniqueChannelId, tag, newState), false);
+ }
+ else
+ {
+ // queue for later delivery.
+ CSingleLock lock(queueMutex);
+ queuedChanges.push_back(EpgEventStateChange(client->GetID(), iUniqueChannelId, tag, newState));
+ }
+}
+
}; /* namespace ADDON */
diff --git a/xbmc/addons/AddonCallbacksPVR.h b/xbmc/addons/AddonCallbacksPVR.h
index 3fa48ecba1..945c789f1a 100644
--- a/xbmc/addons/AddonCallbacksPVR.h
+++ b/xbmc/addons/AddonCallbacksPVR.h
@@ -29,6 +29,7 @@ namespace PVR
namespace ADDON
{
+struct EpgEventStateChange;
/*!
* Callbacks for a PVR add-on to XBMC.
@@ -156,8 +157,30 @@ public:
*/
static DemuxPacket* PVRAllocateDemuxPacket(void* addonData, int iDataSize = 0);
+ /*!
+ * @brief Notify a state change for a PVR backend connection
+ * @param addonData A pointer to the add-on.
+ * @param strConnectionString The connection string reported by the backend that can be displayed in the UI.
+ * @param newState The new state.
+ * @param strMessage A localized addon-defined string representing the new state, that can be displayed
+ * in the UI or NULL if the Kodi-defined default string for the new state shall be displayed.
+ */
+ static void PVRConnectionStateChange(void* addonData, const char* strConnectionString, PVR_CONNECTION_STATE newState, const char *strMessage);
+
+ /*!
+ * @brief Notify a state change for an EPG event
+ * @param addonData A pointer to the add-on.
+ * @param tag The EPG event.
+ * @param iUniqueChannelId The unique id of the channel for the EPG event
+ * @param newState The new state.
+ * @param newState The new state. For EPG_EVENT_CREATED and EPG_EVENT_UPDATED, tag must be filled with all available
+ * event data, not just a delta. For EPG_EVENT_DELETED, it is sufficient to fill EPG_TAG.iUniqueBroadcastId
+ */
+ static void PVREpgEventStateChange(void* addonData, EPG_TAG* tag, unsigned int iUniqueChannelId, EPG_EVENT_STATE newState);
+
private:
static PVR::CPVRClient* GetPVRClient(void* addonData);
+ static void UpdateEpgEvent(const EpgEventStateChange &ch, bool bQueued);
CB_PVRLib *m_callbacks; /*!< callback addresses */
CAddon *m_addon; /*!< the addon */
diff --git a/xbmc/addons/AddonDatabase.cpp b/xbmc/addons/AddonDatabase.cpp
index ea4b456eac..94ebe694f2 100644
--- a/xbmc/addons/AddonDatabase.cpp
+++ b/xbmc/addons/AddonDatabase.cpp
@@ -310,13 +310,13 @@ int CAddonDatabase::AddAddon(const AddonPtr& addon,
if (NULL == m_pDS.get()) return -1;
std::string sql = PrepareSQL("insert into addon (id, type, name, summary,"
- "description, stars, path, icon, changelog, "
+ "description, path, icon, changelog, "
"fanart, addonID, version, author, disclaimer, minversion)"
- " values(NULL, '%s', '%s', '%s', '%s', %i,"
+ " values(NULL, '%s', '%s', '%s', '%s',"
"'%s', '%s', '%s', '%s', '%s','%s','%s','%s','%s')",
TranslateType(addon->Type(),false).c_str(),
addon->Name().c_str(), addon->Summary().c_str(),
- addon->Description().c_str(),addon->Stars(),
+ addon->Description().c_str(),
addon->Path().c_str(), addon->Icon().c_str(),
addon->ChangeLog().c_str(),addon->FanArt().c_str(),
addon->ID().c_str(), addon->Version().asString().c_str(),
@@ -537,37 +537,138 @@ bool CAddonDatabase::GetAddon(int id, AddonPtr &addon)
return false;
}
-bool CAddonDatabase::GetAddons(VECADDONS& addons, const ADDON::TYPE &type /* = ADDON::ADDON_UNKNOWN */)
+bool CAddonDatabase::GetRepositoryContent(VECADDONS& addons)
+{
+ return GetRepositoryContent("", addons);
+}
+
+bool CAddonDatabase::GetRepositoryContent(const std::string& repoId, VECADDONS& addons)
{
try
{
if (NULL == m_pDB.get()) return false;
- if (NULL == m_pDS2.get()) return false;
+ if (NULL == m_pDS.get()) return false;
+
+ auto start = XbmcThreads::SystemClockMillis();
+
+ std::string commonConstraint = PrepareSQL(
+ "JOIN addonlinkrepo ON addon.id=addonlinkrepo.idAddon "
+ "JOIN repo ON addonlinkrepo.idRepo=repo.id "
+ "WHERE repo.checksum IS NOT NULL AND repo.checksum != ''");
- std::string sql = PrepareSQL("SELECT DISTINCT a.addonID FROM addon a, addonlinkrepo b WHERE b.idRepo > 0 AND a.id = b.idAddon AND "
- "NOT EXISTS (SELECT repo.id FROM repo, installed WHERE repo.addonID=installed.addonID AND installed.enabled=0 AND repo.id=b.idRepo)");
- if (type != ADDON_UNKNOWN)
+ if (!repoId.empty())
+ commonConstraint += PrepareSQL(" AND repo.addonId='%s'", repoId.c_str());
+
+ commonConstraint += PrepareSQL(" ORDER BY addon.addonID");
+
+ std::vector<CAddonBuilder> result;
+ // Read basic info from the `addon` table
{
- std::string strType;
- if (type >= ADDON_VIDEO && type <= ADDON_EXECUTABLE)
- strType = TranslateType(ADDON_PLUGIN);
- else
- strType = TranslateType(type);
-
- if (!strType.empty())
- sql += PrepareSQL(" AND a.type = '%s'", strType.c_str());
+ std::string sql = PrepareSQL("SELECT addon.*, broken.reason FROM addon "
+ "LEFT JOIN broken ON broken.addonID=addon.addonID ") + commonConstraint;
+ auto start = XbmcThreads::SystemClockMillis();
+ m_pDS->query(sql);
+ CLog::Log(LOGDEBUG, "CAddonDatabase: query %s returned %d rows in %d ms", sql.c_str(),
+ m_pDS->num_rows(), XbmcThreads::SystemClockMillis() - start);
+
+ while (!m_pDS->eof())
+ {
+ std::string addonId = m_pDS->fv(addon_addonID).get_asString();
+ AddonVersion version(m_pDS->fv(addon_version).get_asString());
+
+ if (!result.empty() && result.back().GetId() == addonId && result.back().GetVersion() >= version)
+ {
+ // We already have a version of this addon in our list which is newer.
+ m_pDS->next();
+ continue;
+ }
+
+ CAddonBuilder builder;
+ builder.SetId(addonId);
+ builder.SetVersion(version);
+ builder.SetType(TranslateType(m_pDS->fv(addon_type).get_asString()));
+ builder.SetMinVersion(AddonVersion(m_pDS->fv(addon_minversion).get_asString()));
+ builder.SetName(m_pDS->fv(addon_name).get_asString());
+ builder.SetSummary(m_pDS->fv(addon_summary).get_asString());
+ builder.SetDescription(m_pDS->fv(addon_description).get_asString());
+ builder.SetChangelog(m_pDS->fv(addon_changelog).get_asString());
+ builder.SetDisclaimer(m_pDS->fv(addon_disclaimer).get_asString());
+ builder.SetAuthor(m_pDS->fv(addon_author).get_asString());
+ builder.SetPath(m_pDS->fv(addon_path).get_asString());
+ builder.SetIcon(m_pDS->fv(addon_icon).get_asString());
+ builder.SetFanart(m_pDS->fv(addon_fanart).get_asString());
+ builder.SetBroken(m_pDS->fv(broken_reason).get_asString());
+ if (!result.empty() && result.back().GetId() == addonId)
+ result.back() = std::move(builder);
+ else
+ result.push_back(std::move(builder));
+ m_pDS->next();
+ }
}
- auto start = XbmcThreads::SystemClockMillis();
- m_pDS->query(sql);
- while (!m_pDS->eof())
+ // Read extra info.
{
- AddonPtr addon;
- if (GetAddon(m_pDS->fv(0).get_asString(),addon))
- addons.push_back(addon);
- m_pDS->next();
+ std::string sql = PrepareSQL(
+ "SELECT addon.addonID as owner, addonextra.key, addonextra.value "
+ "FROM addon JOIN addonextra ON addon.id=addonextra.id ") + commonConstraint;
+
+ auto start = XbmcThreads::SystemClockMillis();
+ m_pDS->query(sql);
+ CLog::Log(LOGDEBUG, "CAddonDatabase: query %s returned %d rows in %d ms", sql.c_str(),
+ m_pDS->num_rows(), XbmcThreads::SystemClockMillis() - start);
+
+ for (auto& builder : result)
+ {
+ //move cursor to current or next addon
+ while (!m_pDS->eof() && m_pDS->fv(0).get_asString() < builder.GetId())
+ m_pDS->next();
+
+ InfoMap extraInfo;
+ while (!m_pDS->eof() && m_pDS->fv(0).get_asString() == builder.GetId())
+ {
+ extraInfo.emplace(m_pDS->fv(1).get_asString(), m_pDS->fv(2).get_asString());
+ m_pDS->next();
+ }
+ builder.SetExtrainfo(std::move(extraInfo));
+ }
+ }
+
+ // Read dependency info.
+ {
+ std::string sql = PrepareSQL(
+ "SELECT addon.addonID as owner, dependencies.addon, dependencies.version, dependencies.optional "
+ "FROM addon JOIN dependencies ON addon.id=dependencies.id ") + commonConstraint;
+
+ auto start = XbmcThreads::SystemClockMillis();
+ m_pDS->query(sql);
+ CLog::Log(LOGDEBUG, "CAddonDatabase: query %s returned %d rows in %d ms", sql.c_str(),
+ m_pDS->num_rows(), XbmcThreads::SystemClockMillis() - start);
+
+ for (auto& builder : result)
+ {
+ //move cursor to the current or next addon
+ while (!m_pDS->eof() && m_pDS->fv(0).get_asString() < builder.GetId())
+ m_pDS->next();
+
+ ADDONDEPS dependencies;
+ while (!m_pDS->eof() && m_pDS->fv(0).get_asString() == builder.GetId())
+ {
+ dependencies.emplace(m_pDS->fv(1).get_asString(),
+ std::make_pair(AddonVersion(m_pDS->fv(2).get_asString()), m_pDS->fv(3).get_asBool()));
+ m_pDS->next();
+ }
+ builder.SetDependencies(std::move(dependencies));
+ }
}
m_pDS->close();
+
+ for (auto& builder : result)
+ {
+ auto addon = builder.Build();
+ if (addon)
+ addons.push_back(std::move(addon));
+ }
+
CLog::Log(LOGDEBUG, "CAddonDatabase::GetAddons took %i ms", XbmcThreads::SystemClockMillis() - start);
return true;
}
@@ -733,41 +834,6 @@ bool CAddonDatabase::SetLastChecked(const std::string& id,
return false;
}
-bool CAddonDatabase::GetRepositoryContent(const std::string& id, VECADDONS& addons)
-{
- try
- {
- if (NULL == m_pDB.get()) return false;
- if (NULL == m_pDS.get()) return false;
-
- std::string query = PrepareSQL("select id from repo where addonID='%s'"
- " AND checksum != '' and lastcheck != ''", id.c_str());
- m_pDS->query(query);
- if (m_pDS->eof())
- return false;
-
- query = PrepareSQL("SELECT addon.id FROM addon "
- "JOIN addonlinkrepo ON addonlinkrepo.idAddon=addon.id "
- "WHERE addonlinkrepo.idRepo=%i GROUP BY addon.addonID",
- m_pDS->fv(0).get_asInt());
-
- m_pDS->query(query);
- while (!m_pDS->eof())
- {
- AddonPtr addon;
- if (GetAddon(m_pDS->fv(0).get_asInt(), addon))
- addons.push_back(addon);
- m_pDS->next();
- }
- return true;
- }
- catch (...)
- {
- CLog::Log(LOGERROR, "%s failed on repo %s", __FUNCTION__, id.c_str());
- }
- return false;
-}
-
bool CAddonDatabase::Search(const std::string& search, VECADDONS& addons)
{
try
diff --git a/xbmc/addons/AddonDatabase.h b/xbmc/addons/AddonDatabase.h
index 43e22dd224..1fb4948e29 100644
--- a/xbmc/addons/AddonDatabase.h
+++ b/xbmc/addons/AddonDatabase.h
@@ -41,8 +41,6 @@ public:
/*! \brief Get an addon with a specific version and repository. */
bool GetAddon(const std::string& addonID, const ADDON::AddonVersion& version, const std::string& repoId, ADDON::AddonPtr& addon);
- bool GetAddons(ADDON::VECADDONS& addons, const ADDON::TYPE &type = ADDON::ADDON_UNKNOWN);
-
/*! Get the addon IDs that has been set to disabled */
bool GetDisabled(std::vector<std::string>& addons);
@@ -63,6 +61,10 @@ public:
\returns true on success, false on error or if repository have never been synced.
*/
bool GetRepositoryContent(const std::string& id, ADDON::VECADDONS& addons);
+
+ /*! Get addons across all repositories */
+ bool GetRepositoryContent(ADDON::VECADDONS& addons);
+
bool SetLastChecked(const std::string& id, const ADDON::AddonVersion& version, const std::string& timestamp);
/*!
@@ -164,7 +166,7 @@ protected:
bool GetAddon(int id, ADDON::AddonPtr& addon);
- /* keep in sync with the select in GetAddon */
+ /* keep in sync with the addon table */
enum AddonFields
{
addon_id=0,
diff --git a/xbmc/addons/AddonDll.h b/xbmc/addons/AddonDll.h
index 44cfc46de4..a18d650b4d 100644
--- a/xbmc/addons/AddonDll.h
+++ b/xbmc/addons/AddonDll.h
@@ -48,7 +48,6 @@ namespace ADDON
//FIXME: does shallow pointer copy. no copy assignment op
CAddonDll(const CAddonDll<TheDll, TheStruct, TheProps> &rhs);
virtual ~CAddonDll();
- virtual AddonPtr Clone() const;
virtual ADDON_STATUS GetStatus();
// addon settings
@@ -124,12 +123,6 @@ CAddonDll<TheDll, TheStruct, TheProps>::~CAddonDll()
}
template<class TheDll, typename TheStruct, typename TheProps>
-AddonPtr CAddonDll<TheDll, TheStruct, TheProps>::Clone() const
-{
- return AddonPtr(new CAddonDll<TheDll, TheStruct, TheProps>(*this));
-}
-
-template<class TheDll, typename TheStruct, typename TheProps>
bool CAddonDll<TheDll, TheStruct, TheProps>::LoadDll()
{
if (m_pDll)
diff --git a/xbmc/addons/AddonInstaller.cpp b/xbmc/addons/AddonInstaller.cpp
index dd0f405716..72b007bf6b 100644
--- a/xbmc/addons/AddonInstaller.cpp
+++ b/xbmc/addons/AddonInstaller.cpp
@@ -637,6 +637,9 @@ bool CAddonInstallJob::DoWork()
});
}
+ // notify any observers that add-ons have changed
+ CAddonMgr::GetInstance().NotifyObservers(ObservableMessageAddons);
+
CEventLog::GetInstance().Add(
EventPtr(new CAddonManagementEvent(m_addon, m_update ? 24065 : 24064)),
!IsModal() && CSettings::GetInstance().GetBool(CSettings::SETTING_ADDONS_NOTIFICATIONS), false);
diff --git a/xbmc/addons/AddonManager.cpp b/xbmc/addons/AddonManager.cpp
index bc96480215..df935e7bac 100644
--- a/xbmc/addons/AddonManager.cpp
+++ b/xbmc/addons/AddonManager.cpp
@@ -109,10 +109,7 @@ AddonPtr CAddonMgr::Factory(const cp_plugin_info_t* plugin, TYPE type, CAddonBui
return nullptr;
if (!PlatformSupportsAddon(plugin))
- {
- CLog::Log(LOGWARNING, "CAddonMgr: %s does not support this platform.", plugin->identifier);
return nullptr;
- }
cp_extension_t* ext = GetFirstExtPoint(plugin, type);
@@ -170,9 +167,12 @@ void CAddonMgr::FillCpluffMetadata(const cp_plugin_info_t* plugin, CAddonBuilder
ADDONDEPS dependencies;
for (unsigned int i = 0; i < plugin->num_imports; ++i)
{
- if (plugin->imports[i].plugin_id && plugin->imports[i].version)
- dependencies.insert(std::make_pair(std::string(plugin->imports[i].plugin_id),
- std::make_pair(AddonVersion(plugin->imports[i].version), plugin->imports[i].optional != 0)));
+ if (plugin->imports[i].plugin_id)
+ {
+ std::string id(plugin->imports[i].plugin_id);
+ AddonVersion version(plugin->imports[i].version ? plugin->imports[i].version : "0.0.0");
+ dependencies.emplace(std::move(id), std::make_pair(version, plugin->imports[i].optional != 0));
+ }
}
builder.SetDependencies(std::move(dependencies));
}
@@ -333,7 +333,7 @@ bool CAddonMgr::Init()
return false;
}
- FindAddons();
+ FindAddonsAndNotify();
// disable some system addons by default because they are optional
VECADDONS addons;
@@ -493,6 +493,36 @@ bool CAddonMgr::GetDisabledAddons(VECADDONS& addons, const TYPE& type)
return false;
}
+bool CAddonMgr::GetInstallableAddons(VECADDONS& addons)
+{
+ return GetInstallableAddons(addons, ADDON_UNKNOWN);
+}
+
+bool CAddonMgr::GetInstallableAddons(VECADDONS& addons, const TYPE &type)
+{
+ CSingleLock lock(m_critSection);
+
+ // get all addons
+ VECADDONS installableAddons;
+ if (!m_database.GetRepositoryContent(installableAddons))
+ return false;
+
+ // go through all addons and remove all that are already installed
+ for (const auto& addon : installableAddons)
+ {
+ // check if the addon matches the provided addon type
+ if (type != ADDON::ADDON_UNKNOWN && addon->Type() != type && !addon->IsType(type))
+ continue;
+
+ if (!CanAddonBeInstalled(addon))
+ continue;
+
+ addons.push_back(addon);
+ }
+
+ return true;
+}
+
bool CAddonMgr::GetAddonsInternal(const TYPE &type, VECADDONS &addons, bool enabledOnly)
{
CSingleLock lock(m_critSection);
@@ -651,30 +681,41 @@ bool CAddonMgr::SetDefault(const TYPE &type, const std::string &addonID)
return true;
}
-void CAddonMgr::FindAddons()
+bool CAddonMgr::FindAddons()
{
+ bool result = false;
+ CSingleLock lock(m_critSection);
+ if (m_cpluff && m_cp_context)
{
- CSingleLock lock(m_critSection);
- if (m_cpluff && m_cp_context)
- {
- m_cpluff->scan_plugins(m_cp_context, CP_SP_UPGRADE);
+ result = true;
+ m_cpluff->scan_plugins(m_cp_context, CP_SP_UPGRADE);
- //Sync with db
- {
- std::set<std::string> installed;
- cp_status_t status;
- int n;
- cp_plugin_info_t** cp_addons = m_cpluff->get_plugins_info(m_cp_context, &status, &n);
- for (int i = 0; i < n; ++i)
- installed.insert(cp_addons[i]->identifier);
- m_cpluff->release_info(m_cp_context, cp_addons);
- m_database.SyncInstalled(installed);
- }
-
- SetChanged();
+ //Sync with db
+ {
+ std::set<std::string> installed;
+ cp_status_t status;
+ int n;
+ cp_plugin_info_t** cp_addons = m_cpluff->get_plugins_info(m_cp_context, &status, &n);
+ for (int i = 0; i < n; ++i)
+ installed.insert(cp_addons[i]->identifier);
+ m_cpluff->release_info(m_cp_context, cp_addons);
+ m_database.SyncInstalled(installed);
}
+
+ SetChanged();
}
+
+ return result;
+}
+
+bool CAddonMgr::FindAddonsAndNotify()
+{
+ if (!FindAddons())
+ return false;
+
NotifyObservers(ObservableMessageAddons);
+
+ return true;
}
void CAddonMgr::UnregisterAddon(const std::string& ID)
diff --git a/xbmc/addons/AddonManager.h b/xbmc/addons/AddonManager.h
index 96f76253a0..84fc017e4b 100644
--- a/xbmc/addons/AddonManager.h
+++ b/xbmc/addons/AddonManager.h
@@ -105,6 +105,11 @@ namespace ADDON
bool GetDisabledAddons(VECADDONS& addons, const TYPE& type);
+ /*! Get all installable addons */
+ bool GetInstallableAddons(VECADDONS& addons);
+
+ bool GetInstallableAddons(VECADDONS& addons, const TYPE &type);
+
void AddToUpdateableAddons(AddonPtr &pAddon);
void RemoveFromUpdateableAddons(AddonPtr &pAddon);
bool ReloadSettings(const std::string &id);
@@ -117,7 +122,17 @@ namespace ADDON
std::string GetTranslatedString(const cp_cfg_element_t *root, const char *tag);
static AddonPtr AddonFromProps(AddonProps& props);
- void FindAddons();
+
+ /*! \brief Checks for new / updated add-ons
+ \return True if everything went ok, false otherwise
+ */
+ bool FindAddons();
+
+ /*! \brief Checks for new / updated add-ons and notifies all observers
+ \return True if everything went ok, false otherwise
+ */
+ bool FindAddonsAndNotify();
+
void UnregisterAddon(const std::string& ID);
/*! Hook for clearing internal state after uninstall. */
@@ -226,8 +241,6 @@ namespace ADDON
static void FillCpluffMetadata(const cp_plugin_info_t* plugin, CAddonBuilder& builder);
private:
- void LoadAddons(const std::string &path,
- std::map<std::string, AddonPtr>& unresolved);
/* libcpluff */
cp_context_t *m_cp_context;
diff --git a/xbmc/addons/AudioDecoder.cpp b/xbmc/addons/AudioDecoder.cpp
index 288a9cefdf..a89c51cb9f 100644
--- a/xbmc/addons/AudioDecoder.cpp
+++ b/xbmc/addons/AudioDecoder.cpp
@@ -46,12 +46,6 @@ CAudioDecoder::CAudioDecoder(AddonProps props, std::string extension, std::strin
m_strExt = std::move(strExt);
}
-AddonPtr CAudioDecoder::Clone() const
-{
- // Copy constructor is generated by compiler and calls parent copy constructor
- return AddonPtr(new CAudioDecoder(*this));
-}
-
bool CAudioDecoder::Init(const std::string& strFile, unsigned int filecache)
{
if (!Initialized())
diff --git a/xbmc/addons/AudioDecoder.h b/xbmc/addons/AudioDecoder.h
index c3600f3972..3c04de2bbb 100644
--- a/xbmc/addons/AudioDecoder.h
+++ b/xbmc/addons/AudioDecoder.h
@@ -57,7 +57,6 @@ namespace ADDON
bool tracks, std::string codecName, std::string strExt);
virtual ~CAudioDecoder() {}
- virtual AddonPtr Clone() const;
// Things that MUST be supplied by the child classes
bool Init(const std::string& strFile, unsigned int filecache);
diff --git a/xbmc/addons/AudioEncoder.cpp b/xbmc/addons/AudioEncoder.cpp
index b5e9f19d88..0b04600460 100644
--- a/xbmc/addons/AudioEncoder.cpp
+++ b/xbmc/addons/AudioEncoder.cpp
@@ -32,12 +32,6 @@ CAudioEncoder::CAudioEncoder(AddonProps props, std::string _extension)
{
}
-AddonPtr CAudioEncoder::Clone() const
-{
- // Copy constructor is generated by compiler and calls parent copy constructor
- return AddonPtr(new CAudioEncoder(*this));
-}
-
bool CAudioEncoder::Init(audioenc_callbacks &callbacks)
{
if (!Initialized())
diff --git a/xbmc/addons/AudioEncoder.h b/xbmc/addons/AudioEncoder.h
index f5411b3cce..b609358503 100644
--- a/xbmc/addons/AudioEncoder.h
+++ b/xbmc/addons/AudioEncoder.h
@@ -36,7 +36,6 @@ namespace ADDON
explicit CAudioEncoder(AddonProps props) : AudioEncoderDll(std::move(props)), m_context{nullptr} {};
CAudioEncoder(AddonProps props, std::string extension);
virtual ~CAudioEncoder() {}
- virtual AddonPtr Clone() const;
// Things that MUST be supplied by the child classes
bool Init(audioenc_callbacks &callbacks);
diff --git a/xbmc/addons/GUIViewStateAddonBrowser.cpp b/xbmc/addons/GUIViewStateAddonBrowser.cpp
index 6490086610..418045f87c 100644
--- a/xbmc/addons/GUIViewStateAddonBrowser.cpp
+++ b/xbmc/addons/GUIViewStateAddonBrowser.cpp
@@ -40,7 +40,7 @@ CGUIViewStateAddonBrowser::CGUIViewStateAddonBrowser(const CFileItemList& items)
}
else
{
- AddSortMethod(SortByLabel, SortAttributeIgnoreFolders, 551, LABEL_MASKS("%L", "%I", "%L", "")); // Filename, Size | Foldername, empty
+ AddSortMethod(SortByLabel, SortAttributeIgnoreFolders, 551, LABEL_MASKS("%L", "%s", "%L", "%s"));
if (URIUtils::PathStarts(items.GetPath(), "addons://sources/"))
AddSortMethod(SortByLastUsed, 12012, LABEL_MASKS("%L", "%u", "%L", "%u"),
diff --git a/xbmc/addons/GUIWindowAddonBrowser.cpp b/xbmc/addons/GUIWindowAddonBrowser.cpp
index c2b9666644..e1adc7481f 100644
--- a/xbmc/addons/GUIWindowAddonBrowser.cpp
+++ b/xbmc/addons/GUIWindowAddonBrowser.cpp
@@ -138,7 +138,7 @@ bool CGUIWindowAddonBrowser::OnMessage(CGUIMessage& message)
CFileItemPtr item = m_vecItems->Get(i);
if (item->GetProperty("Addon.ID") == message.GetStringParam())
{
- SetItemLabel2(item);
+ UpdateStatus(item);
return true;
}
}
@@ -369,14 +369,16 @@ bool CGUIWindowAddonBrowser::GetDirectory(const std::string& strDirectory, CFile
}
for (int i = 0; i < items.Size(); ++i)
- SetItemLabel2(items[i]);
+ UpdateStatus(items[i]);
return result;
}
-void CGUIWindowAddonBrowser::SetItemLabel2(CFileItemPtr item)
+void CGUIWindowAddonBrowser::UpdateStatus(const CFileItemPtr& item)
{
- if (!item || item->m_bIsFolder) return;
+ if (!item || item->m_bIsFolder)
+ return;
+
unsigned int percent;
if (CAddonInstaller::GetInstance().GetProgress(item->GetProperty("Addon.ID").asString(), percent))
{
@@ -386,9 +388,6 @@ void CGUIWindowAddonBrowser::SetItemLabel2(CFileItemPtr item)
}
else
item->ClearProperty("Addon.Downloading");
- item->SetLabel2(item->GetProperty("Addon.Status").asString());
- // to avoid the view state overriding label 2
- item->SetLabelPreformated(true);
}
bool CGUIWindowAddonBrowser::Update(const std::string &strDirectory, bool updateFilterPath /* = true */)
@@ -435,7 +434,7 @@ int CGUIWindowAddonBrowser::SelectAddonID(const std::vector<ADDON::TYPE> &types,
{
// if we shouldn't show neither installed nor installable addons the list will be empty
if (!showInstalled && !showInstallable)
- return 0;
+ return -1;
// can't show the "Get More" button if we already show installable addons
if (showInstallable)
@@ -443,14 +442,14 @@ int CGUIWindowAddonBrowser::SelectAddonID(const std::vector<ADDON::TYPE> &types,
CGUIDialogSelect *dialog = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
if (!dialog)
- return 0;
+ return -1;
// get rid of any invalid addon types
std::vector<ADDON::TYPE> validTypes(types.size());
std::copy_if(types.begin(), types.end(), validTypes.begin(), [](ADDON::TYPE type) { return type != ADDON_UNKNOWN; });
if (validTypes.empty())
- return 0;
+ return -1;
// get all addons to show
VECADDONS addons;
@@ -477,8 +476,7 @@ int CGUIWindowAddonBrowser::SelectAddonID(const std::vector<ADDON::TYPE> &types,
if (showInstallable || showMore)
{
VECADDONS installableAddons;
- CAddonDatabase database;
- if (database.Open() && database.GetAddons(installableAddons))
+ if (CAddonMgr::GetInstance().GetInstallableAddons(installableAddons))
{
for (ADDON::IVECADDONS addon = installableAddons.begin(); addon != installableAddons.end();)
{
@@ -495,18 +493,10 @@ int CGUIWindowAddonBrowser::SelectAddonID(const std::vector<ADDON::TYPE> &types,
}
}
- // only show addons that match one of the provided addon types and that aren't disabled
- if (matchesType && !CAddonMgr::GetInstance().IsAddonDisabled(pAddon->ID()))
+ if (matchesType)
{
- // check if the addon is installed
- bool isInstalled = CAddonMgr::GetInstance().IsAddonInstalled(pAddon->ID());
-
- // check if the addon is installed or can be installed
- if ((showInstallable || showMore) && !isInstalled && CAddonMgr::GetInstance().CanAddonBeInstalled(pAddon))
- {
- ++addon;
- continue;
- }
+ ++addon;
+ continue;
}
addon = installableAddons.erase(addon);
@@ -520,7 +510,7 @@ int CGUIWindowAddonBrowser::SelectAddonID(const std::vector<ADDON::TYPE> &types,
}
if (addons.empty() && !showNone)
- return 0;
+ return -1;
// turn the addons into items
std::map<std::string, AddonPtr> addonMap;
@@ -536,7 +526,7 @@ int CGUIWindowAddonBrowser::SelectAddonID(const std::vector<ADDON::TYPE> &types,
}
if (items.IsEmpty() && !showNone)
- return 0;
+ return -1;
std::string heading;
for (std::vector<ADDON::TYPE>::const_iterator type = validTypes.begin(); type != validTypes.end(); ++type)
diff --git a/xbmc/addons/GUIWindowAddonBrowser.h b/xbmc/addons/GUIWindowAddonBrowser.h
index 9129169a1c..97d7274357 100644
--- a/xbmc/addons/GUIWindowAddonBrowser.h
+++ b/xbmc/addons/GUIWindowAddonBrowser.h
@@ -42,7 +42,7 @@ public:
\param showInstalled whether installed addons should be in the list
\param showInstallable whether installable addons should be in the list
\param showMore whether to show the "Get More" button (only makes sense if showInstalled is true and showInstallable is false)
- \return 1 if an addon was selected, 2 if "Get More" was chosen, or 0 if an error occurred or if the selection process was cancelled
+ \return 1 if an addon was selected or multiple selection was specified, 2 if "Get More" was chosen, 0 if the selection process was cancelled or -1 if an error occurred or
*/
static int SelectAddonID(ADDON::TYPE type, std::string &addonID, bool showNone = false, bool showDetails = true, bool showInstalled = true, bool showInstallable = false, bool showMore = true);
static int SelectAddonID(const std::vector<ADDON::TYPE> &types, std::string &addonID, bool showNone = false, bool showDetails = true, bool showInstalled = true, bool showInstallable = false, bool showMore = true);
@@ -55,17 +55,12 @@ public:
\param showInstalled whether installed addons should be in the list
\param showInstallable whether installable addons should be in the list
\param showMore whether to show the "Get More" button (only makes sense if showInstalled is true and showInstallable is false)
- \return 1 if an addon was selected or multiple selection was specified, 2 if "Get More" was chosen, or 0 if an error occurred or if the selection process was cancelled
+ \return 1 if an addon was selected or multiple selection was specified, 2 if "Get More" was chosen, 0 if the selection process was cancelled or -1 if an error occurred or
*/
static int SelectAddonID(ADDON::TYPE type, std::vector<std::string> &addonIDs, bool showNone = false, bool showDetails = true, bool multipleSelection = true, bool showInstalled = true, bool showInstallable = false, bool showMore = true);
static int SelectAddonID(const std::vector<ADDON::TYPE> &types, std::vector<std::string> &addonIDs, bool showNone = false, bool showDetails = true, bool multipleSelection = true, bool showInstalled = true, bool showInstallable = false, bool showMore = true);
protected:
- /* \brief set label2 of an item based on the Addon.Status property
- \param item the item to update
- */
- void SetItemLabel2(CFileItemPtr item);
-
virtual void GetContextButtons(int itemNumber, CContextButtons &buttons) override;
virtual bool OnContextButton(int itemNumber, CONTEXT_BUTTON button) override;
virtual bool OnClick(int iItem, const std::string &player = "") override;
@@ -76,6 +71,7 @@ protected:
private:
void SetProperties();
+ void UpdateStatus(const CFileItemPtr& item);
CProgramThumbLoader m_thumbLoader;
};
diff --git a/xbmc/addons/IAddon.h b/xbmc/addons/IAddon.h
index de6a93e045..2469a642e0 100644
--- a/xbmc/addons/IAddon.h
+++ b/xbmc/addons/IAddon.h
@@ -89,7 +89,6 @@ namespace ADDON
{
public:
virtual ~IAddon() {};
- virtual AddonPtr Clone() const =0;
virtual TYPE Type() const =0;
virtual TYPE FullType() const =0;
virtual bool IsType(TYPE type) const =0;
@@ -108,7 +107,6 @@ namespace ADDON
virtual const std::string FanArt() const =0;
virtual const std::string Author() const =0;
virtual const std::string Icon() const =0;
- virtual int Stars() const =0;
virtual const std::string Disclaimer() const =0;
virtual const std::string Broken() const =0;
virtual CDateTime InstallDate() const =0;
diff --git a/xbmc/addons/ImageResource.cpp b/xbmc/addons/ImageResource.cpp
index cde99444e0..4b4672b225 100644
--- a/xbmc/addons/ImageResource.cpp
+++ b/xbmc/addons/ImageResource.cpp
@@ -39,11 +39,6 @@ CImageResource::CImageResource(AddonProps props, std::string type)
{
}
-AddonPtr CImageResource::Clone() const
-{
- return AddonPtr(new CImageResource(*this));
-}
-
void CImageResource::OnPreUnInstall()
{
CURL xbtUrl;
diff --git a/xbmc/addons/ImageResource.h b/xbmc/addons/ImageResource.h
index 090f074819..094247248f 100644
--- a/xbmc/addons/ImageResource.h
+++ b/xbmc/addons/ImageResource.h
@@ -37,7 +37,6 @@ public:
explicit CImageResource(AddonProps props) : CResource(std::move(props)) {};
CImageResource(AddonProps props, std::string type);
- virtual AddonPtr Clone() const;
virtual void OnPreUnInstall();
virtual bool IsAllowed(const std::string &file) const;
diff --git a/xbmc/addons/LanguageResource.cpp b/xbmc/addons/LanguageResource.cpp
index ef16941f5c..33c9ed443f 100644
--- a/xbmc/addons/LanguageResource.cpp
+++ b/xbmc/addons/LanguageResource.cpp
@@ -126,11 +126,6 @@ CLanguageResource::CLanguageResource(
m_sortTokens(sortTokens)
{ }
-AddonPtr CLanguageResource::Clone() const
-{
- return AddonPtr(new CLanguageResource(*this));
-}
-
bool CLanguageResource::IsInUse() const
{
return StringUtils::EqualsNoCase(CSettings::GetInstance().GetString(CSettings::SETTING_LOCALE_LANGUAGE), ID());
diff --git a/xbmc/addons/LanguageResource.h b/xbmc/addons/LanguageResource.h
index cba170bd98..87776caa49 100644
--- a/xbmc/addons/LanguageResource.h
+++ b/xbmc/addons/LanguageResource.h
@@ -43,8 +43,6 @@ public:
const std::string& dvdLanguageSubtitle,
const std::set<std::string>& sortTokens);
- virtual AddonPtr Clone() const;
-
virtual bool IsInUse() const;
virtual void OnPostInstall(bool update, bool modal);
diff --git a/xbmc/addons/PluginSource.cpp b/xbmc/addons/PluginSource.cpp
index 677c9153c6..14ca09e4ce 100644
--- a/xbmc/addons/PluginSource.cpp
+++ b/xbmc/addons/PluginSource.cpp
@@ -51,11 +51,6 @@ CPluginSource::CPluginSource(AddonProps props, const std::string& provides)
SetProvides(provides);
}
-AddonPtr CPluginSource::Clone() const
-{
- return AddonPtr(new CPluginSource(*this));
-}
-
void CPluginSource::SetProvides(const std::string &content)
{
if (!content.empty())
diff --git a/xbmc/addons/PluginSource.h b/xbmc/addons/PluginSource.h
index deea2944d4..eafc12be79 100644
--- a/xbmc/addons/PluginSource.h
+++ b/xbmc/addons/PluginSource.h
@@ -35,7 +35,6 @@ public:
explicit CPluginSource(AddonProps props);
CPluginSource(AddonProps props, const std::string& provides);
- virtual AddonPtr Clone() const;
virtual TYPE FullType() const;
virtual bool IsType(TYPE type) const;
bool Provides(const Content& content) const
diff --git a/xbmc/addons/Repository.cpp b/xbmc/addons/Repository.cpp
index 9907e2434e..e2b792ea1d 100644
--- a/xbmc/addons/Repository.cpp
+++ b/xbmc/addons/Repository.cpp
@@ -54,11 +54,6 @@ using namespace KODI::MESSAGING;
using KODI::MESSAGING::HELPERS::DialogResponse;
-AddonPtr CRepository::Clone() const
-{
- return AddonPtr(new CRepository(*this));
-}
-
std::unique_ptr<CRepository> CRepository::FromExtension(AddonProps props, const cp_extension_t* ext)
{
DirList dirs;
diff --git a/xbmc/addons/Repository.h b/xbmc/addons/Repository.h
index 185469bd01..b3cac90c1a 100644
--- a/xbmc/addons/Repository.h
+++ b/xbmc/addons/Repository.h
@@ -49,8 +49,6 @@ namespace ADDON
explicit CRepository(AddonProps props) : CAddon(std::move(props)) {};
CRepository(AddonProps props, DirList dirs);
- virtual AddonPtr Clone() const;
-
/*! \brief Get the md5 hash for an addon.
\param the addon in question.
\return the md5 hash for the given addon, empty if non exists.
diff --git a/xbmc/addons/Resource.h b/xbmc/addons/Resource.h
index 019ddd0047..988bc87fce 100644
--- a/xbmc/addons/Resource.h
+++ b/xbmc/addons/Resource.h
@@ -32,8 +32,6 @@ class CResource : public CAddon
public:
virtual ~CResource() { }
- virtual AddonPtr Clone() const = 0;
-
virtual bool IsAllowed(const std::string &file) const = 0;
virtual std::string GetFullPath(const std::string &filePath) const
diff --git a/xbmc/addons/Scraper.cpp b/xbmc/addons/Scraper.cpp
index 4896cff481..6d839bb0a2 100644
--- a/xbmc/addons/Scraper.cpp
+++ b/xbmc/addons/Scraper.cpp
@@ -180,20 +180,6 @@ CScraper::CScraper(AddonProps props, const std::string& language, bool requiress
{
}
-AddonPtr CScraper::Clone() const
-{
- return AddonPtr(new CScraper(*this));
-}
-
-CScraper::CScraper(const CScraper &rhs)
- : CAddon(rhs), m_fLoaded(false),
- m_language(rhs.m_language),
- m_requiressettings(rhs.m_requiressettings),
- m_persistence(rhs.m_persistence),
- m_pathContent(rhs.m_pathContent)
-{
-}
-
bool CScraper::Supports(const CONTENT_TYPE &content) const
{
return Type() == ScraperTypeFromContent(content);
diff --git a/xbmc/addons/Scraper.h b/xbmc/addons/Scraper.h
index dd1cd8db50..f5c1819462 100644
--- a/xbmc/addons/Scraper.h
+++ b/xbmc/addons/Scraper.h
@@ -87,8 +87,6 @@ public:
explicit CScraper(AddonProps props);
CScraper(AddonProps props, const std::string& language, bool requiressettings, const CDateTimeSpan& persistence);
- virtual AddonPtr Clone() const;
-
/*! \brief Set the scraper settings for a particular path from an XML string
Loads the default and user settings (if not already loaded) and, if the given XML string is non-empty,
overrides the user settings with the XML.
diff --git a/xbmc/addons/ScreenSaver.cpp b/xbmc/addons/ScreenSaver.cpp
index 6879244095..6e2763a5eb 100644
--- a/xbmc/addons/ScreenSaver.cpp
+++ b/xbmc/addons/ScreenSaver.cpp
@@ -37,12 +37,6 @@ CScreenSaver::CScreenSaver(const char *addonID)
{
}
-AddonPtr CScreenSaver::Clone() const
-{
- // Copy constructor is generated by compiler and calls parent copy constructor
- return AddonPtr(new CScreenSaver(*this));
-}
-
bool CScreenSaver::IsInUse() const
{
return CSettings::GetInstance().GetString(CSettings::SETTING_SCREENSAVER_MODE) == ID();
@@ -56,7 +50,7 @@ bool CScreenSaver::CreateScreenSaver()
g_alarmClock.Stop(SCRIPT_ALARM, true);
if (!CScriptInvocationManager::GetInstance().Stop(LibPath()))
- CScriptInvocationManager::GetInstance().ExecuteAsync(LibPath(), Clone());
+ CScriptInvocationManager::GetInstance().ExecuteAsync(LibPath(), AddonPtr(new CScreenSaver(*this)));
return true;
}
// pass it the screen width,height
diff --git a/xbmc/addons/ScreenSaver.h b/xbmc/addons/ScreenSaver.h
index 6e5468de1f..1e6e8d11fa 100644
--- a/xbmc/addons/ScreenSaver.h
+++ b/xbmc/addons/ScreenSaver.h
@@ -34,7 +34,6 @@ public:
explicit CScreenSaver(const char *addonID);
virtual ~CScreenSaver() {}
- virtual AddonPtr Clone() const;
virtual bool IsInUse() const;
// Things that MUST be supplied by the child classes
diff --git a/xbmc/addons/Service.cpp b/xbmc/addons/Service.cpp
index 959cfac971..5ce961dcb2 100644
--- a/xbmc/addons/Service.cpp
+++ b/xbmc/addons/Service.cpp
@@ -42,11 +42,6 @@ CService::CService(AddonProps props, TYPE type, START_OPTION startOption)
BuildServiceType();
}
-AddonPtr CService::Clone() const
-{
- return AddonPtr(new CService(*this));
-}
-
bool CService::Start()
{
bool ret = true;
diff --git a/xbmc/addons/Service.h b/xbmc/addons/Service.h
index e5a5ffab4d..2600b0deb8 100644
--- a/xbmc/addons/Service.h
+++ b/xbmc/addons/Service.h
@@ -43,7 +43,6 @@ namespace ADDON
explicit CService(AddonProps props) : CAddon(std::move(props)), m_type(UNKNOWN), m_startOption(LOGIN) {}
CService(AddonProps props, TYPE type, START_OPTION startOption);
- virtual AddonPtr Clone() const;
bool Start();
bool Stop();
diff --git a/xbmc/addons/Skin.cpp b/xbmc/addons/Skin.cpp
index 061588585c..8eda7202bf 100644
--- a/xbmc/addons/Skin.cpp
+++ b/xbmc/addons/Skin.cpp
@@ -198,11 +198,6 @@ CSkinInfo::CSkinInfo(
m_version = GetDependencyVersion("xbmc.gui");
}
-AddonPtr CSkinInfo::Clone() const
-{
- return AddonPtr(new CSkinInfo(*this));
-}
-
struct closestRes
{
closestRes(const RESOLUTION_INFO &target) : m_target(target) { };
diff --git a/xbmc/addons/Skin.h b/xbmc/addons/Skin.h
index 45ac16c40e..fe48d072d3 100644
--- a/xbmc/addons/Skin.h
+++ b/xbmc/addons/Skin.h
@@ -123,8 +123,6 @@ public:
float effectsSlowDown,
bool debugging);
- virtual AddonPtr Clone() const;
-
/*! \brief Load resultion information from directories in Path().
*/
void Start();
diff --git a/xbmc/addons/UISoundsResource.cpp b/xbmc/addons/UISoundsResource.cpp
index f408be3c12..5dd8113100 100644
--- a/xbmc/addons/UISoundsResource.cpp
+++ b/xbmc/addons/UISoundsResource.cpp
@@ -27,11 +27,6 @@
namespace ADDON
{
-AddonPtr CUISoundsResource::Clone() const
-{
- return AddonPtr(new CUISoundsResource(*this));
-}
-
bool CUISoundsResource::IsAllowed(const std::string& file) const
{
return StringUtils::EqualsNoCase(file, "sounds.xml")
diff --git a/xbmc/addons/UISoundsResource.h b/xbmc/addons/UISoundsResource.h
index 995ecbb5dc..58ead3552a 100644
--- a/xbmc/addons/UISoundsResource.h
+++ b/xbmc/addons/UISoundsResource.h
@@ -28,7 +28,6 @@ class CUISoundsResource : public CResource
{
public:
CUISoundsResource(AddonProps props) : CResource(std::move(props)) {};
- virtual AddonPtr Clone() const;
virtual bool IsAllowed(const std::string &file) const;
virtual bool IsInUse() const;
virtual void OnPostInstall(bool update, bool modal);
diff --git a/xbmc/addons/Webinterface.cpp b/xbmc/addons/Webinterface.cpp
index d3c619a4c2..59c927d31b 100644
--- a/xbmc/addons/Webinterface.cpp
+++ b/xbmc/addons/Webinterface.cpp
@@ -64,8 +64,3 @@ std::string CWebinterface::GetBaseLocation() const
return "";
}
-
-AddonPtr CWebinterface::Clone() const
-{
- return AddonPtr(new CWebinterface(*this));
-} \ No newline at end of file
diff --git a/xbmc/addons/Webinterface.h b/xbmc/addons/Webinterface.h
index f34ac94930..a15e1b9a2d 100644
--- a/xbmc/addons/Webinterface.h
+++ b/xbmc/addons/Webinterface.h
@@ -48,9 +48,6 @@ namespace ADDON
std::string GetEntryPoint(const std::string &path) const;
std::string GetBaseLocation() const;
- // specializations of CAddon
- virtual AddonPtr Clone() const;
-
private:
WebinterfaceType m_type;
std::string m_entryPoint;
diff --git a/xbmc/addons/include/xbmc_epg_types.h b/xbmc/addons/include/xbmc_epg_types.h
index 5ca14295c5..9460952c16 100644
--- a/xbmc/addons/include/xbmc_epg_types.h
+++ b/xbmc/addons/include/xbmc_epg_types.h
@@ -59,21 +59,38 @@
//@}
/* Set EPGTAG.iGenreType to EPG_GENRE_USE_STRING to transfer genre strings to XBMC */
-#define EPG_GENRE_USE_STRING 0x100
-
-/* EPG_TAG.iFlags values */
-const unsigned int EPG_TAG_FLAG_UNDEFINED = 0x00000000; /*!< @brief nothing special to say about this entry */
-const unsigned int EPG_TAG_FLAG_IS_SERIES = 0x00000001; /*!< @brief this EPG entry is part of a series */
+#define EPG_GENRE_USE_STRING 0x100
#ifdef __cplusplus
extern "C" {
#endif
+ /* EPG_TAG.iFlags values */
+ const unsigned int EPG_TAG_FLAG_UNDEFINED = 0x00000000; /*!< @brief nothing special to say about this entry */
+ const unsigned int EPG_TAG_FLAG_IS_SERIES = 0x00000001; /*!< @brief this EPG entry is part of a series */
+
+ /* Special EPG_TAG.iUniqueBroadcastId value */
+
+ /*!
+ * @brief special EPG_TAG.iUniqueBroadcastId value to indicate that a tag has not a valid EPG event uid.
+ */
+ const unsigned int EPG_TAG_INVALID_UID = 0;
+
+ /*!
+ * @brief EPG event states. Used with EpgEventStateChange callback.
+ */
+ typedef enum
+ {
+ EPG_EVENT_CREATED = 0, /*!< @brief event created */
+ EPG_EVENT_UPDATED = 1, /*!< @brief event updated */
+ EPG_EVENT_DELETED = 2, /*!< @brief event deleted */
+ } EPG_EVENT_STATE;
+
/*!
* @brief Representation of an EPG event.
*/
typedef struct EPG_TAG {
- unsigned int iUniqueBroadcastId; /*!< @brief (required) identifier for this event */
+ unsigned int iUniqueBroadcastId; /*!< @brief (required) identifier for this event. Valid uids must be greater than EPG_TAG_INVALID_UID. */
const char * strTitle; /*!< @brief (required) this event's title */
unsigned int iChannelNumber; /*!< @brief (required) the number of the channel this event occurs on */
time_t startTime; /*!< @brief (required) start time in UTC */
diff --git a/xbmc/addons/include/xbmc_pvr_dll.h b/xbmc/addons/include/xbmc_pvr_dll.h
index ae75b281a3..8b54ea682c 100644
--- a/xbmc/addons/include/xbmc_pvr_dll.h
+++ b/xbmc/addons/include/xbmc_pvr_dll.h
@@ -52,16 +52,18 @@ extern "C"
/*!
* Get the XBMC_GUI_API_VERSION that was used to compile this add-on.
* Used to check if this add-on is compatible with XBMC.
- * @return The XBMC_GUI_API_VERSION that was used to compile this add-on.
+ * @return The XBMC_GUI_API_VERSION that was used to compile this add-on or empty string if this add-on does not depend on Kodi GUI API.
* @remarks Valid implementation required.
+ * @note see libKODI_guilib.h about related parts
*/
const char* GetGUIAPIVersion(void);
/*!
* Get the XBMC_GUI_MIN_API_VERSION that was used to compile this add-on.
* Used to check if this add-on is compatible with XBMC.
- * @return The XBMC_GUI_MIN_API_VERSION that was used to compile this add-on.
+ * @return The XBMC_GUI_MIN_API_VERSION that was used to compile this add-on or empty string if this add-on does not depend on Kodi GUI API.
* @remarks Valid implementation required.
+ * @note see libKODI_guilib.h about related parts
*/
const char* GetMininumGUIAPIVersion(void);
@@ -434,12 +436,6 @@ extern "C"
long long LengthLiveStream(void);
/*!
- * @return The channel number on the backend of the live stream that's currently being read.
- * @remarks Required if bHandlesInputStream or bHandlesDemuxing is set to true. Return -1 if this add-on won't provide this function.
- */
- int GetCurrentClientChannel(void);
-
- /*!
* Switch to another channel. Only to be called when a live stream has already been opened.
* @param channel The channel to switch to.
* @return True if the switch was successful, false otherwise.
@@ -641,6 +637,17 @@ extern "C"
bool IsRealTimeStream();
/*!
+ * Tell the client the time frame to use when notifying epg events back to Kodi. The client might push epg events asynchronously
+ * to Kodi using the callback function EpgEventStateChange. To be able to only push events that are actually of interest for Kodi,
+ * client needs to know about the epg time frame Kodi uses. Kodi calls this function once after the client add-on has been sucessfully
+ * initialized and then everytime the time frame value changes.
+ * @param iDays number of days from "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times.
+ * @return PVR_ERROR_NO_ERROR if new value was successfully set.
+ * @remarks Required if bSupportsEPG is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function.
+ */
+ PVR_ERROR SetEPGTimeFrame(int iDays);
+
+ /*!
* Called by XBMC to assign the function pointers of this add-on to pClient.
* @param pClient The struct to assign the function pointers to.
*/
@@ -697,7 +704,6 @@ extern "C"
pClient->SeekLiveStream = SeekLiveStream;
pClient->PositionLiveStream = PositionLiveStream;
pClient->LengthLiveStream = LengthLiveStream;
- pClient->GetCurrentClientChannel = GetCurrentClientChannel;
pClient->SwitchChannel = SwitchChannel;
pClient->SignalStatus = SignalStatus;
pClient->GetLiveStreamURL = GetLiveStreamURL;
@@ -728,6 +734,8 @@ extern "C"
pClient->IsTimeshifting = IsTimeshifting;
pClient->IsRealTimeStream = IsRealTimeStream;
+
+ pClient->SetEPGTimeFrame = SetEPGTimeFrame;
};
};
diff --git a/xbmc/addons/include/xbmc_pvr_types.h b/xbmc/addons/include/xbmc_pvr_types.h
index 18bc331be4..83bb13ac18 100644
--- a/xbmc/addons/include/xbmc_pvr_types.h
+++ b/xbmc/addons/include/xbmc_pvr_types.h
@@ -77,10 +77,10 @@ struct DemuxPacket;
#define PVR_STREAM_MAX_STREAMS 20
/* current PVR API version */
-#define XBMC_PVR_API_VERSION "4.2.0"
+#define XBMC_PVR_API_VERSION "5.0.0"
/* min. PVR API version */
-#define XBMC_PVR_MIN_API_VERSION "4.2.0"
+#define XBMC_PVR_MIN_API_VERSION "5.0.0"
#ifdef __cplusplus
extern "C" {
@@ -104,7 +104,7 @@ extern "C" {
/*!
* @brief special PVR_TIMER.iEpgUid value to indicate that a timer has no EPG event uid.
*/
- const unsigned int PVR_TIMER_NO_EPG_UID = 0; /*!< @brief timer has no EPG event uid. */
+ const unsigned int PVR_TIMER_NO_EPG_UID = EPG_TAG_INVALID_UID; /*!< @brief timer has no EPG event uid. */
/*!
* @brief special PVR_TIMER.iClientChannelUid value to indicate "any channel". Useful for some repeating timer types.
@@ -158,6 +158,16 @@ extern "C" {
PVR_WEEKDAY_SUNDAY;
/*!
+ * @brief timeframe value for use with SetEPGTimeFrame function to indicate "no timeframe".
+ */
+ const int EPG_TIMEFRAME_UNLIMITED = -1;
+
+ /*!
+ * @brief special PVR_TIMER.iClientChannelUid and PVR_RECORDING.iChannelUid value to indicate that no channel uid is available.
+ */
+ const int PVR_CHANNEL_INVALID_UID = -1; /*!< @brief denotes that no channel uid is avaliable. */
+
+ /*!
* @brief PVR add-on error codes
*/
typedef enum
@@ -207,6 +217,20 @@ extern "C" {
} PVR_MENUHOOK_CAT;
/*!
+ * @brief PVR backend connection states. Used with ConnectionStateChange callback.
+ */
+ typedef enum
+ {
+ PVR_CONNECTION_STATE_UNKNOWN = 0, /*!< @brief unknown state (e.g. not yet tried to connect) */
+ PVR_CONNECTION_STATE_SERVER_UNREACHABLE = 1, /*!< @brief backend server is not reachable (e.g. server not existing or network down)*/
+ PVR_CONNECTION_STATE_SERVER_MISMATCH = 2, /*!< @brief backend server is reachable, but there is not the expected type of server running (e.g. HTSP required, but FTP running at given server:port) */
+ PVR_CONNECTION_STATE_VERSION_MISMATCH = 3, /*!< @brief backend server is reachable, but server version does not match client requirements */
+ PVR_CONNECTION_STATE_ACCESS_DENIED = 4, /*!< @brief backend server is reachable, but denies client access (e.g. due to wrong credentials) */
+ PVR_CONNECTION_STATE_CONNECTED = 5, /*!< @brief connection to backend server is established */
+ PVR_CONNECTION_STATE_DISCONNECTED = 6, /*!< @brief no connection to backend server (e.g. due to network errors or client initiated disconnect)*/
+ } PVR_CONNECTION_STATE;
+
+ /*!
* @brief Properties passed to the Create() method of an add-on.
*/
typedef struct PVR_PROPERTIES
@@ -277,9 +301,6 @@ extern "C" {
int iSignal; /*!< @brief (optional) signal strength */
long iBER; /*!< @brief (optional) bit error rate */
long iUNC; /*!< @brief (optional) uncorrected blocks */
- double dVideoBitrate; /*!< @brief (optional) video bitrate */
- double dAudioBitrate; /*!< @brief (optional) audio bitrate */
- double dDolbyBitrate; /*!< @brief (optional) dolby bitrate */
} ATTRIBUTE_PACKED PVR_SIGNAL_STATUS;
/*!
@@ -399,7 +420,7 @@ extern "C" {
Kodi and passed the first time to the client. A valid index must be greater than PVR_TIMER_NO_CLIENT_INDEX. */
unsigned int iParentClientIndex; /*!< @brief (optional) for timers scheduled by a repeating timer, the index of the repeating timer that scheduled this timer (it's PVR_TIMER.iClientIndex value). Use PVR_TIMER_NO_PARENT
to indicate that this timer was no scheduled by a repeating timer. */
- int iClientChannelUid; /*!< @brief (optional) unique identifier of the channel to record on. PVR_TIMER_ANY_CHANNEL will denote "any channel", not a specifoc one. */
+ int iClientChannelUid; /*!< @brief (optional) unique identifier of the channel to record on. PVR_TIMER_ANY_CHANNEL will denote "any channel", not a specific one. PVR_CHANNEL_INVALID_UID denotes that channel uid is not available.*/
time_t startTime; /*!< @brief (optional) start time of the recording in UTC. Instant timers that are sent to the add-on by Kodi will have this value set to 0.*/
time_t endTime; /*!< @brief (optional) end time of the recording in UTC. */
bool bStartAnyTime; /*!< @brief (optional) for EPG based (not Manual) timers indicates startTime does not apply. Default = false */
@@ -421,7 +442,7 @@ extern "C" {
unsigned int iWeekdays; /*!< @brief (optional) week days, for repeating timers */
unsigned int iPreventDuplicateEpisodes; /*!< @brief (optional) 1 if backend should only record new episodes in case of a repeating epg-based timer, 0 if all episodes shall be recorded (no duplicate detection). Actual algorithm for
duplicate detection is defined by the backend. Addons may define own values for different duplicate detection algorithms, thus this is not just a bool.*/
- unsigned int iEpgUid; /*!< @brief (optional) epg event id. Use PVR_TIMER_NO_EPG_UID to state that there is no EPG event id available for this timer. Values greater than PVR_TIMER_NO_EPG_UID represent a valid epg event id. */
+ unsigned int iEpgUid; /*!< @brief (optional) EPG event id associated with this timer. Valid ids must be greater than EPG_TAG_INVALID_UID. */
unsigned int iMarginStart; /*!< @brief (optional) if set, the backend starts the recording iMarginStart minutes before startTime. */
unsigned int iMarginEnd; /*!< @brief (optional) if set, the backend ends the recording iMarginEnd minutes after endTime. */
int iGenreType; /*!< @brief (optional) genre type */
@@ -456,7 +477,8 @@ extern "C" {
int iPlayCount; /*!< @brief (optional) play count of this recording on the client */
int iLastPlayedPosition; /*!< @brief (optional) last played position of this recording on the client */
bool bIsDeleted; /*!< @brief (optional) shows this recording is deleted and can be undelete */
- unsigned int iEpgEventId; /*!< @brief (optional) EPG event id associated with this recording */
+ unsigned int iEpgEventId; /*!< @brief (optional) EPG event id associated with this recording. Valid ids must be greater than EPG_TAG_INVALID_UID. */
+ int iChannelUid; /*!< @brief (optional) unique identifier of the channel for this recording. PVR_CHANNEL_INVALID_UID denotes that channel uid is not available. */
} ATTRIBUTE_PACKED PVR_RECORDING;
/*!
@@ -541,7 +563,6 @@ extern "C" {
long long (__cdecl* SeekLiveStream)(long long, int);
long long (__cdecl* PositionLiveStream)(void);
long long (__cdecl* LengthLiveStream)(void);
- int (__cdecl* GetCurrentClientChannel)(void);
bool (__cdecl* SwitchChannel)(const PVR_CHANNEL&);
PVR_ERROR (__cdecl* SignalStatus)(PVR_SIGNAL_STATUS&);
const char* (__cdecl* GetLiveStreamURL)(const PVR_CHANNEL&);
@@ -567,6 +588,7 @@ extern "C" {
const char* (__cdecl* GetBackendHostname)(void);
bool (__cdecl* IsTimeshifting)(void);
bool (__cdecl* IsRealTimeStream)(void);
+ PVR_ERROR (__cdecl* SetEPGTimeFrame)(int);
} PVRClient;
#ifdef __cplusplus
diff --git a/xbmc/addons/test/TestAddonFactory.cpp b/xbmc/addons/test/TestAddonFactory.cpp
index 2577b36638..a97d1bff33 100644
--- a/xbmc/addons/test/TestAddonFactory.cpp
+++ b/xbmc/addons/test/TestAddonFactory.cpp
@@ -100,7 +100,21 @@ TEST_F(TestAddonFactory, ShouldReturnDependencyInfoWhenNoExtensions)
}
-TEST_F(TestAddonFactory, IconPathShouldBeBuildtFromPluginPath)
+TEST_F(TestAddonFactory, ShouldAcceptUnversionedDependencies)
+{
+ cp_plugin_import_t import{(char*)"a.b", nullptr, 0};
+ plugin.extensions = nullptr;
+ plugin.num_extensions = 0;
+ plugin.num_imports = 1;
+ plugin.imports = &import;
+
+ ADDONDEPS expected = {{"a.b", {AddonVersion{"0.0.0"}, false}}};
+ auto addon = CAddonMgr::Factory(&plugin, ADDON_UNKNOWN);
+ EXPECT_EQ(expected, addon->GetDeps());
+}
+
+
+TEST_F(TestAddonFactory, IconPathShouldBeBuiltFromPluginPath)
{
plugin.plugin_path = strdup("a/b");;
auto addon = CAddonMgr::Factory(&plugin, ADDON_UNKNOWN);
diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
index 88b62fc81b..e3c8813186 100644
--- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
@@ -1103,6 +1103,7 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt)
m_currDevice.compare(device) != 0 ||
m_settings.driver.compare(driver) != 0)
{
+ FlushEngine();
if (!InitSink())
return;
m_settings.driver = driver;
@@ -1244,6 +1245,11 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt)
outputFormat.m_channelLayout.ResolveChannels(m_sinkFormat.m_channelLayout);
}
+ // internally we use ffmpeg layouts, means that layout won't change in resample
+ // stage. preserve correct layout for sink stage where remapping is done
+ uint64_t avlayout = CAEUtil::GetAVChannelLayout(outputFormat.m_channelLayout);
+ outputFormat.m_channelLayout = CAEUtil::GetAEChannelLayout(avlayout);
+
// TODO: adjust to decoder
sinkInputFormat = outputFormat;
}
@@ -2711,6 +2717,7 @@ bool CActiveAE::IsSettingVisible(const std::string &settingId)
AEAudioFormat format;
format.m_dataFormat = AE_FMT_RAW;
format.m_streamInfo.m_type = CAEStreamInfo::STREAM_TYPE_TRUEHD;
+ format.m_streamInfo.m_sampleRate = 192000;
if (m_sink.SupportsFormat(CSettings::GetInstance().GetString(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGHDEVICE), format) &&
CSettings::GetInstance().GetInt(CSettings::SETTING_AUDIOOUTPUT_CONFIG) != AE_CONFIG_FIXED)
return true;
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
index 3d046c9fa2..53e6554f9e 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
@@ -67,6 +67,12 @@ static bool Has71Support()
return CJNIAudioManager::GetSDKVersion() >= 21;
}
+// AMLogic helper for HD Audio
+bool CAESinkAUDIOTRACK::HasAmlHD()
+{
+ return ((CJNIAudioFormat::ENCODING_DOLBY_TRUEHD != -1) && (CJNIAudioFormat::ENCODING_DTS_HD != -1));
+}
+
static int AEStreamFormatToATFormat(const CAEStreamInfo::DataType& dt)
{
switch (dt)
@@ -247,25 +253,37 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
if (m_format.m_dataFormat == AE_FMT_RAW && !CXBMCApp::IsHeadsetPlugged())
{
m_passthrough = true;
+ m_encoding = AEStreamFormatToATFormat(m_format.m_streamInfo.m_type);
+ m_format.m_channelLayout = AE_CH_LAYOUT_2_0;
- if (!m_info.m_wantsIECPassthrough)
+ if (m_format.m_streamInfo.m_type == CAEStreamInfo::STREAM_TYPE_DTSHD ||
+ m_format.m_streamInfo.m_type == CAEStreamInfo::STREAM_TYPE_TRUEHD)
{
- m_encoding = AEStreamFormatToATFormat(m_format.m_streamInfo.m_type);
- m_format.m_channelLayout = AE_CH_LAYOUT_2_0;
+ m_format.m_channelLayout = AE_CH_LAYOUT_7_1;
+ // Shield v5 workaround
+ if (!m_info.m_wantsIECPassthrough && CJNIAudioManager::GetSDKVersion() == 22 && m_sink_sampleRate > 48000)
+ m_sink_sampleRate = 48000;
+ }
+ if (m_info.m_wantsIECPassthrough)
+ {
+ m_format.m_dataFormat = AE_FMT_S16LE;
if (m_format.m_streamInfo.m_type == CAEStreamInfo::STREAM_TYPE_DTSHD ||
m_format.m_streamInfo.m_type == CAEStreamInfo::STREAM_TYPE_TRUEHD)
+ m_sink_sampleRate = 192000;
+
+ if (m_format.m_streamInfo.m_type == CAEStreamInfo::STREAM_TYPE_EAC3)
+ m_sink_sampleRate = m_format.m_streamInfo.m_sampleRate;
+
+ // we are running on an old android version
+ // that does neither know AC3, DTS or whatever
+ // we will fallback to 16BIT passthrough
+ if (m_encoding == -1)
{
- m_format.m_channelLayout = AE_CH_LAYOUT_7_1;
- // Shield v5 workaround
- if (CJNIAudioManager::GetSDKVersion() == 22 && m_sink_sampleRate > 48000)
- m_sink_sampleRate = 48000;
+ m_format.m_channelLayout = AE_CH_LAYOUT_2_0;
+ m_format.m_sampleRate = m_sink_sampleRate;
+ m_encoding = CJNIAudioFormat::ENCODING_PCM_16BIT;
}
}
- else
- {
- m_format.m_dataFormat = AE_FMT_S16LE;
- m_format.m_sampleRate = m_sink_sampleRate;
- }
}
else
{
@@ -361,15 +379,28 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
CLog::Log(LOGDEBUG, "Opening Passthrough RAW Format: %s Sink SampleRate: %u", CAEUtil::StreamTypeToStr(m_format.m_streamInfo.m_type), m_sink_sampleRate);
m_format.m_frameSize = 1;
+ m_sink_frameSize = m_format.m_frameSize;
}
else
{
- m_min_buffer_size *= 2;
- m_format.m_frameSize = m_format.m_channelLayout.Count() *
- (CAEUtil::DataFormatToBits(m_format.m_dataFormat) / 8);
- m_format.m_frames = (int)(m_min_buffer_size / m_format.m_frameSize) / 2;
+ if (m_passthrough)
+ {
+ m_min_buffer_size *= 2;
+ if (m_sink_sampleRate > 48000)
+ m_min_buffer_size *= (m_sink_sampleRate / 48000); // same amount of buffer in seconds as for 48 khz
+ else if (m_sink_sampleRate < m_format.m_sampleRate) // eac3
+ m_min_buffer_size *= (m_format.m_sampleRate / m_sink_sampleRate);
+ }
+ else
+ m_min_buffer_size *= 2;
+
+ m_format.m_frameSize = m_format.m_channelLayout.Count() * (CAEUtil::DataFormatToBits(m_format.m_dataFormat) / 8);
+ if (m_passthrough)
+ m_sink_frameSize = 2 * CAEUtil::DataFormatToBits(AE_FMT_S16LE) / 8; // sending via 2 channels 2 * 16 / 8 = 4
+ else
+ m_sink_frameSize = m_format.m_frameSize;
+ m_format.m_frames = (int)(m_min_buffer_size / m_format.m_frameSize) / 2;
}
- m_sink_frameSize = m_format.m_frameSize;
if (m_passthrough && !m_info.m_wantsIECPassthrough)
m_audiotrackbuffer_sec = rawlength_in_seconds;
@@ -485,6 +516,14 @@ void CAESinkAUDIOTRACK::GetDelay(AEDelayStatus& status)
}
uint32_t normHead_pos = head_pos - m_offset;
+#if defined(HAS_LIBAMCODEC)
+ if (aml_present() &&
+ (m_encoding == CJNIAudioFormat::ENCODING_DTS_HD ||
+ m_encoding == CJNIAudioFormat::ENCODING_E_AC3 ||
+ m_encoding == CJNIAudioFormat::ENCODING_DOLBY_TRUEHD))
+ normHead_pos /= m_sink_frameSize; // AML wants sink in 48k but returns pos in 192k
+#endif
+
if (m_passthrough && !m_info.m_wantsIECPassthrough)
{
if (m_extTimer.MillisLeft() > 0)
@@ -608,7 +647,7 @@ unsigned int CAESinkAUDIOTRACK::AddPackets(uint8_t **data, unsigned int frames,
}
}
else
- m_duration_written += ((double) loop_written / m_sink_frameSize) / m_format.m_sampleRate;
+ m_duration_written += ((double) loop_written / m_format.m_frameSize) / m_format.m_sampleRate;
// just try again to care for fragmentation
if (written < size)
@@ -634,7 +673,7 @@ unsigned int CAESinkAUDIOTRACK::AddPackets(uint8_t **data, unsigned int frames,
}
else
{
- double time_should_ms = written_frames / (double) m_sink_sampleRate * 1000.0;
+ double time_should_ms = written_frames / (double) m_format.m_sampleRate * 1000.0;
double time_off = time_should_ms - time_to_add_ms;
if (time_off > 0 && time_off > time_should_ms / 2.0)
{
@@ -715,7 +754,16 @@ void CAESinkAUDIOTRACK::EnumerateDevicesEx(AEDeviceInfoList &list, bool force)
{
// passthrough
m_info.m_wantsIECPassthrough = true;
+ m_sink_sampleRates.insert(44100);
m_sink_sampleRates.insert(48000);
+ if (HasAmlHD())
+ {
+ m_sink_sampleRates.insert(96000);
+ m_sink_sampleRates.insert(192000);
+ m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_EAC3);
+ m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTSHD);
+ m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_TRUEHD);
+ }
}
else
#endif
@@ -742,6 +790,7 @@ void CAESinkAUDIOTRACK::EnumerateDevicesEx(AEDeviceInfoList &list, bool force)
}
if (StringUtils::StartsWithNoCase(CJNIBuild::DEVICE, "foster")) // SATV is ahead of API
{
+ m_info.m_wantsIECPassthrough = false;
if (CJNIAudioManager::GetSDKVersion() == 22)
m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_DTSHD);
m_info.m_streamTypes.push_back(CAEStreamInfo::STREAM_TYPE_TRUEHD);
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h
index b445c45174..488ed79571 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h
@@ -54,6 +54,7 @@ public:
protected:
static bool IsSupported(int sampleRateInHz, int channelConfig, int audioFormat);
+ static bool HasAmlHD();
private:
jni::CJNIAudioTrack *m_at_jni;
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp
index e27a15b637..750ea75492 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp
@@ -186,7 +186,7 @@ bool CAESinkPi::Initialize(AEAudioFormat &format, std::string &device)
g_RBP.Initialize();
/* if we are raw need to let gpu know */
- m_passthrough = m_format.m_dataFormat == AE_FMT_RAW;
+ m_passthrough = format.m_dataFormat == AE_FMT_RAW;
m_initDevice = device;
m_initFormat = format;
diff --git a/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioChannelLayout.cpp b/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioChannelLayout.cpp
index 6ca5df4770..d73b5abda7 100644
--- a/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioChannelLayout.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioChannelLayout.cpp
@@ -22,7 +22,7 @@
#include <AudioToolbox/AudioToolbox.h>
-#define MAX_CHANNEL_LABEL 15
+#define MAX_CHANNEL_LABEL 45
const char* g_ChannelLabels[] =
{
@@ -39,9 +39,32 @@ const char* g_ChannelLabels[] =
"Back Left", // kAudioChannelLabel_LeftSurroundDirect
"Back Right", // kAudioChannelLabel_RightSurroundDirect
"Top Center", // kAudioChannelLabel_TopCenterSurround
+ "Vertical Back Left", // kAudioChannelLabel_VerticalHeightLeft
+ "Vertical Back Center", // kAudioChannelLabel_VerticalHeightCenter
+ "Vertical Back Right", // kAudioChannelLabel_VerticalHeightRight
"Top Back Left", // kAudioChannelLabel_VerticalHeightLeft
"Top Back Center", // kAudioChannelLabel_VerticalHeightCenter
"Top Back Right", // kAudioChannelLabel_VerticalHeightRight
+
+ // gap
+
+ "unused19", "unused20", "unused21", "unused22", "unused23", "unused24", "unused25",
+ "unused26", "unused27", "unused28", "unused29", "unused30", "unused31", "unused32",
+
+ "Rear Left", // kAudioChannelLabel_RearSurroundLeft
+ "Rear Right", // kAudioChannelLabel_RearSurroundRight
+ "Left Wide", // kAudioChannelLabel_LeftWide
+ "Right Wide", // kAudioChannelLabel_RightWide
+ "LFE2", // kAudioChannelLabel_LFE2
+ "Left Total", // kAudioChannelLabel_LeftTotal
+ "Right Total", // kAudioChannelLabel_RightTotal
+ "HearingImpaired", // kAudioChannelLabel_HearingImpaired
+ "Narration", // kAudioChannelLabel_Narration
+ "Mono", // kAudioChannelLabel_Mono
+ "DialogCentricMix", // kAudioChannelLabel_DialogCentricMix
+ "CenterSurroundDirect", // kAudioChannelLabel_CenterSurroundDirect
+ "Haptic", // kAudioChannelLabel_Haptic
+
};
CCoreAudioChannelLayout::CCoreAudioChannelLayout() :
@@ -201,6 +224,10 @@ const char* CCoreAudioChannelLayout::ChannelLayoutToString(AudioChannelLayout& l
{
str += "[";
str += ChannelLabelToString(pLayout->mChannelDescriptions[c].mChannelLabel);
+ if (pLayout->mChannelDescriptions[c].mChannelLabel > MAX_CHANNEL_LABEL)
+ {
+ str += "(" + std::to_string(pLayout->mChannelDescriptions[c].mChannelLabel) + ")";
+ }
str += "] ";
}
diff --git a/xbmc/cores/AudioEngine/Sinks/test/CMakeLists.txt b/xbmc/cores/AudioEngine/Sinks/test/CMakeLists.txt
index 367af8b6e2..48788a2428 100644
--- a/xbmc/cores/AudioEngine/Sinks/test/CMakeLists.txt
+++ b/xbmc/cores/AudioEngine/Sinks/test/CMakeLists.txt
@@ -1,5 +1,3 @@
-set(SOURCES)
-
if(MACOSX)
list(APPEND SOURCES TestAESinkDARWINOSX.cpp)
endif()
diff --git a/xbmc/cores/ExternalPlayer/CMakeLists.txt b/xbmc/cores/ExternalPlayer/CMakeLists.txt
index 69c71d9904..76064f1fc7 100644
--- a/xbmc/cores/ExternalPlayer/CMakeLists.txt
+++ b/xbmc/cores/ExternalPlayer/CMakeLists.txt
@@ -3,3 +3,7 @@ set(SOURCES ExternalPlayer.cpp)
set(HEADERS ExternalPlayer.h)
core_add_library(externalplayer)
+
+if(ENABLE_INTERNAL_FFMPEG)
+ add_dependencies(externalplayer ffmpeg)
+endif()
diff --git a/xbmc/cores/VideoPlayer/DVDAudio.cpp b/xbmc/cores/VideoPlayer/DVDAudio.cpp
index 6387505200..bbea8c1028 100644
--- a/xbmc/cores/VideoPlayer/DVDAudio.cpp
+++ b/xbmc/cores/VideoPlayer/DVDAudio.cpp
@@ -28,7 +28,7 @@
#include "cores/AudioEngine/Utils/AEAudioFormat.h"
#include "settings/MediaSettings.h"
-CDVDAudio::CDVDAudio(volatile bool &bStop, CDVDClock *clock) : m_bStop(bStop), m_pClock(clock)
+CDVDAudio::CDVDAudio(CDVDClock *clock) : m_pClock(clock)
{
m_pAudioStream = NULL;
m_bPassthrough = false;
@@ -102,6 +102,8 @@ void CDVDAudio::Destroy()
unsigned int CDVDAudio::AddPackets(const DVDAudioFrame &audioframe)
{
+ m_bAbort = false;
+
CSingleLock lock (m_critSection);
if(!m_pAudioStream)
@@ -151,7 +153,7 @@ unsigned int CDVDAudio::AddPackets(const DVDAudioFrame &audioframe)
lock.Leave();
Sleep(1);
lock.Enter();
- } while (!m_bStop);
+ } while (!m_bAbort);
m_playingPts = audioframe.pts + audioframe.duration - GetDelay();
m_timeOfPts = CDVDClock::GetAbsoluteClock();
@@ -219,8 +221,9 @@ double CDVDAudio::GetDelay()
void CDVDAudio::Flush()
{
- CSingleLock lock (m_critSection);
+ m_bAbort = true;
+ CSingleLock lock (m_critSection);
if (m_pAudioStream)
{
m_pAudioStream->Flush();
@@ -231,6 +234,11 @@ void CDVDAudio::Flush()
m_syncErrorTime = 0;
}
+void CDVDAudio::AbortAddPackets()
+{
+ m_bAbort = true;
+}
+
bool CDVDAudio::IsValidFormat(const DVDAudioFrame &audioframe)
{
if(!m_pAudioStream)
diff --git a/xbmc/cores/VideoPlayer/DVDAudio.h b/xbmc/cores/VideoPlayer/DVDAudio.h
index 3981c679cc..48b5c42d29 100644
--- a/xbmc/cores/VideoPlayer/DVDAudio.h
+++ b/xbmc/cores/VideoPlayer/DVDAudio.h
@@ -28,6 +28,7 @@
#include "cores/AudioEngine/Utils/AEChannelInfo.h"
#include "cores/AudioEngine/Interfaces/AEStream.h"
+#include <atomic>
extern "C" {
#include "libavcodec/avcodec.h"
@@ -41,7 +42,7 @@ class CDVDClock;
class CDVDAudio : IAEClockCallback
{
public:
- CDVDAudio(volatile bool& bStop, CDVDClock *clock);
+ CDVDAudio(CDVDClock *clock);
~CDVDAudio();
void SetVolume(float fVolume);
@@ -63,6 +64,7 @@ public:
void SetResampleMode(int mode);
void Flush();
void Drain();
+ void AbortAddPackets();
void SetSpeed(int iSpeed);
void SetResampleRatio(double ratio);
@@ -86,6 +88,6 @@ protected:
CAEChannelInfo m_channelLayout;
bool m_bPaused;
- volatile bool& m_bStop;
+ std::atomic_bool m_bAbort;
CDVDClock *m_pClock;
};
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp
index 99b89c5da7..c6cd41dd8b 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp
@@ -129,7 +129,7 @@ CDVDOverlayCodec* CDVDFactoryCodec::OpenCodec(CDVDOverlayCodec* pCodec, CDVDStre
}
-CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, const CRenderInfo &info, IVPClockCallback* clock)
+CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, const CRenderInfo &info)
{
CDVDVideoCodec* pCodec = nullptr;
CDVDCodecOptions options;
@@ -146,7 +146,7 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, const C
#if defined(HAS_LIBAMCODEC)
// Amlogic can be present on multiple platforms (Linux, Android)
// try this first. if it does not open, we still try other hw decoders
- pCodec = OpenCodec(new CDVDVideoCodecAmlogic(clock), hint, options);
+ pCodec = OpenCodec(new CDVDVideoCodecAmlogic(), hint, options);
if (pCodec)
return pCodec;
#endif
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h
index c2978c8955..06a412420a 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h
@@ -33,12 +33,11 @@ class CDVDStreamInfo;
class CDVDCodecOption;
class CDVDCodecOptions;
-class IVPClockCallback;
class CDVDFactoryCodec
{
public:
- static CDVDVideoCodec* CreateVideoCodec(CDVDStreamInfo &hint, const CRenderInfo &info = CRenderInfo(), IVPClockCallback* clock = NULL);
+ static CDVDVideoCodec* CreateVideoCodec(CDVDStreamInfo &hint, const CRenderInfo &info = CRenderInfo());
static CDVDAudioCodec* CreateAudioCodec(CDVDStreamInfo &hint, bool allowpassthrough = true, bool allowdtshddecode = true);
static CDVDOverlayCodec* CreateOverlayCodec(CDVDStreamInfo &hint );
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
index e9c73ac010..ace255029e 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp
@@ -26,7 +26,6 @@
#include "cores/VideoPlayer/DVDClock.h"
#include "cores/VideoPlayer/VideoRenderers/RenderFlags.h"
#include "cores/VideoPlayer/VideoRenderers/RenderManager.h"
-#include "cores/VideoPlayer/Interfaces/IVPClockCallback.h"
#include "guilib/GraphicContext.h"
#include "settings/DisplaySettings.h"
#include "settings/MediaSettings.h"
@@ -1381,9 +1380,8 @@ int set_header_info(am_private_t *para)
}
/*************************************************************************/
-CAMLCodec::CAMLCodec(IVPClockCallback* clock)
+CAMLCodec::CAMLCodec()
: CThread("CAMLCodec")
- , m_clock(clock)
{
m_opened = false;
am_private = new am_private_t;
@@ -1420,6 +1418,7 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints)
m_speed = DVD_PLAYSPEED_NORMAL;
m_1st_pts = 0;
m_cur_pts = 0;
+ m_player_pts = 0;
m_cur_pictcnt = 0;
m_old_pictcnt = 0;
m_dst_rect.SetRect(0, 0, 0, 0);
@@ -1727,6 +1726,7 @@ int CAMLCodec::Decode(uint8_t *pData, size_t iSize, double dts, double pts)
if (pData)
{
+ m_player_pts = pts;
am_private->am_pkt.data = pData;
am_private->am_pkt.data_size = iSize;
@@ -1815,10 +1815,12 @@ int CAMLCodec::Decode(uint8_t *pData, size_t iSize, double dts, double pts)
// we must return VC_BUFFER or VC_PICTURE,
// default to VC_BUFFER.
int rtn = VC_BUFFER;
+ m_player_pts = DVD_NOPTS_VALUE;
if (m_old_pictcnt != m_cur_pictcnt)
{
m_old_pictcnt++;
rtn = VC_PICTURE;
+ m_player_pts = pts;
// we got a new pict, try and keep hw buffered demux above 2 seconds.
// this, combined with the above 1 second check, keeps hw buffered demux between 1 and 2 seconds.
// we also check to make sure we keep from filling hw buffer.
@@ -1844,15 +1846,9 @@ bool CAMLCodec::GetPicture(DVDVideoPicture *pDvdVideoPicture)
pDvdVideoPicture->dts = DVD_NOPTS_VALUE;
if (m_speed == DVD_PLAYSPEED_NORMAL)
- {
- pDvdVideoPicture->pts = GetPlayerPtsSeconds() * (double)DVD_TIME_BASE;
- // video pts cannot be late or VideoPlayer goes nuts,
- // so run it one frame ahead
- pDvdVideoPicture->pts += 1 * pDvdVideoPicture->iDuration;
- }
+ pDvdVideoPicture->pts = m_player_pts;
else
{
- // We are FF/RW; Do not use the Player clock or it just doesn't work
if (m_cur_pts == 0)
pDvdVideoPicture->pts = (double)m_1st_pts / PTS_FREQ * DVD_TIME_BASE;
else
@@ -1959,39 +1955,6 @@ void CAMLCodec::Process()
m_cur_pts = pts_video;
m_cur_pictcnt++;
m_ready_event.Set();
-
- // correct video pts by starting pts.
- if (m_start_pts != 0)
- pts_video += m_start_pts;
- else if (m_start_dts != 0)
- pts_video += m_start_dts;
-
- double app_pts = GetPlayerPtsSeconds();
- // add in audio delay/display latency contribution
- // FIXME: Replace Video latency?
- double offset = 0 - CMediaSettings::GetInstance().GetCurrentVideoSettings().m_AudioDelay;
- // correct video pts by user set delay and rendering delay
- app_pts += offset;
-
- //CLog::Log(LOGDEBUG, "CAMLCodec::Process: app_pts(%f), pts_video/PTS_FREQ(%f)",
- // app_pts, (double)pts_video/PTS_FREQ);
-
- double error = app_pts - (double)pts_video/PTS_FREQ;
- double abs_error = fabs(error);
- if (abs_error > 0.125)
- {
- //CLog::Log(LOGDEBUG, "CAMLCodec::Process pts diff = %f", error);
- if (abs_error > 0.150)
- {
- // big error so try to reset pts_pcrscr
- SetVideoPtsSeconds(app_pts);
- }
- else
- {
- // small error so try to avoid a frame jump
- SetVideoPtsSeconds((double)pts_video/PTS_FREQ + error/4);
- }
- }
}
}
else
@@ -2003,20 +1966,6 @@ void CAMLCodec::Process()
CLog::Log(LOGDEBUG, "CAMLCodec::Process Stopped");
}
-double CAMLCodec::GetPlayerPtsSeconds()
-{
- double clock_pts = 0.0;
- if (m_clock)
- clock_pts = m_clock->GetInterpolatedClock() / DVD_TIME_BASE;
- else
- {
- CLog::Log(LOGWARNING, "CAMLCodec::GetPlayerPtsSeconds: cannot get player clock");
- clock_pts = CDVDClock::GetAbsoluteClock() / DVD_TIME_BASE;
- }
-
- return clock_pts;
-}
-
void CAMLCodec::SetVideoPtsSeconds(const double pts)
{
//CLog::Log(LOGDEBUG, "CAMLCodec::SetVideoPtsSeconds: pts(%f)", pts);
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h
index 7ae18e714b..5b9ee4f872 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h
@@ -30,12 +30,10 @@ typedef struct am_private_t am_private_t;
class DllLibAmCodec;
-class IVPClockCallback;
-
class CAMLCodec : public CThread
{
public:
- CAMLCodec(IVPClockCallback* clock);
+ CAMLCodec();
virtual ~CAMLCodec();
bool OpenDecoder(CDVDStreamInfo &hints);
@@ -54,7 +52,6 @@ protected:
virtual void Process();
private:
- double GetPlayerPtsSeconds();
void SetVideoPtsSeconds(double pts);
void ShowMainVideo(const bool show);
void SetVideoZoom(const float zoom);
@@ -89,5 +86,5 @@ private:
int m_contrast;
int m_brightness;
- IVPClockCallback* m_clock;
+ double m_player_pts;
};
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
index ed6bd67192..0dfabbe7bf 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp
@@ -39,8 +39,7 @@ typedef struct frame_queue {
struct frame_queue *nextframe;
} frame_queue;
-CDVDVideoCodecAmlogic::CDVDVideoCodecAmlogic(IVPClockCallback* clock) :
- m_clock(clock),
+CDVDVideoCodecAmlogic::CDVDVideoCodecAmlogic() :
m_Codec(NULL),
m_pFormatName("amcodec"),
m_last_pts(0.0),
@@ -50,7 +49,8 @@ CDVDVideoCodecAmlogic::CDVDVideoCodecAmlogic(IVPClockCallback* clock) :
m_video_rate(0),
m_mpeg2_sequence(NULL),
m_bitparser(NULL),
- m_bitstream(NULL)
+ m_bitstream(NULL),
+ m_opened(false)
{
pthread_mutex_init(&m_queue_mutex, NULL);
}
@@ -180,7 +180,7 @@ bool CDVDVideoCodecAmlogic::Open(CDVDStreamInfo &hints, CDVDCodecOptions &option
}
m_aspect_ratio = m_hints.aspect;
- m_Codec = new CAMLCodec(m_clock);
+ m_Codec = new CAMLCodec();
if (!m_Codec)
{
CLog::Log(LOGERROR, "%s: Failed to create Amlogic Codec", __MODULE_NAME__);
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.h
index 5d35a8a1c4..bbcd7d86d6 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.h
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.h
@@ -32,7 +32,6 @@ class CBitstreamParser;
class CBitstreamConverter;
class CDVDVideoCodecAmlogic;
-class IVPClockCallback;
class CDVDAmlogicInfo
{
@@ -59,7 +58,7 @@ class CDVDVideoCodecAmlogic : public CDVDVideoCodec
friend class CDVDAmlogicInfo;
public:
- CDVDVideoCodecAmlogic(IVPClockCallback* clock);
+ CDVDVideoCodecAmlogic();
virtual ~CDVDVideoCodecAmlogic();
// Required overrides
@@ -81,7 +80,6 @@ protected:
void FrameRateTracking(uint8_t *pData, int iSize, double dts, double pts);
void RemoveInfo(CDVDAmlogicInfo* info);
- IVPClockCallback* m_clock;
CAMLCodec *m_Codec;
std::set<CDVDAmlogicInfo*> m_inflight;
const char *m_pFormatName;
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
index 022049208f..479df63b11 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
@@ -1136,14 +1136,16 @@ bool CDecoder::Supports(enum AVPixelFormat fmt)
void CDecoder::RelBuffer(uint8_t *data)
{
- CSingleLock lock(m_section);
- ID3D11VideoDecoderOutputView* view = (ID3D11VideoDecoderOutputView*)(uintptr_t)data;
-
- if (!m_surface_context->IsValid(view))
{
- CLog::Log(LOGWARNING, "%s - return of invalid surface", __FUNCTION__);
+ CSingleLock lock(m_section);
+ ID3D11VideoDecoderOutputView* view = (ID3D11VideoDecoderOutputView*)(uintptr_t)data;
+
+ if (!m_surface_context->IsValid(view))
+ {
+ CLog::Log(LOGWARNING, "%s - return of invalid surface", __FUNCTION__);
+ }
+ m_surface_context->ClearReference(view);
}
- m_surface_context->ClearReference(view);
IHardwareDecoder::Release();
}
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
index c1fab5cf3d..b95b3b777b 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp
@@ -145,7 +145,6 @@ CMMALVideo::~CMMALVideo()
if (m_dec_input && m_dec_input->is_enabled)
mmal_port_disable(m_dec_input);
- m_dec_input = NULL;
if (m_dec_output && m_dec_output->is_enabled)
mmal_port_disable(m_dec_output);
@@ -162,8 +161,9 @@ CMMALVideo::~CMMALVideo()
mmal_component_disable(m_dec);
if (m_dec_input_pool)
- mmal_pool_destroy(m_dec_input_pool);
+ mmal_port_pool_destroy(m_dec_input, m_dec_input_pool);
m_dec_input_pool = NULL;
+ m_dec_input = NULL;
if (m_deint)
mmal_component_destroy(m_deint);
@@ -666,7 +666,7 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
// limit number of callback structures in video_decode to reduce latency. Too low and video hangs.
// negative numbers have special meaning. -1=size of DPB -2=size of DPB+1
- status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS, -3);
+ status = mmal_port_parameter_set_uint32(m_dec_input, MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS, -5);
if (status != MMAL_SUCCESS)
CLog::Log(LOGERROR, "%s::%s Failed to configure max num callbacks on %s (status=%x %s)", CLASSNAME, __func__, m_dec_input->name, status, mmal_status_to_string(status));
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
index 0b23e0216f..1e873b3a34 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
@@ -749,12 +749,14 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic, int flags)
void CDecoder::FFReleaseBuffer(uint8_t *data)
{
- VASurfaceID surf;
+ {
+ VASurfaceID surf;
- CSingleLock lock(m_DecoderSection);
+ CSingleLock lock(m_DecoderSection);
- surf = (VASurfaceID)(uintptr_t)data;
- m_videoSurfaces.ClearReference(surf);
+ surf = (VASurfaceID)(uintptr_t)data;
+ m_videoSurfaces.ClearReference(surf);
+ }
IHardwareDecoder::Release();
}
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.h
index 046fbcf4e3..9cb4bfe84a 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.h
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxBXA.h
@@ -21,13 +21,12 @@
#include "DVDDemux.h"
-#ifdef TARGET_WINDOWS
-#define __attribute__(dummy_val)
-#else
-#include <config.h>
+#if defined(HAVE_CONFIG_H)
+ #include "config.h"
#endif
#ifdef TARGET_WINDOWS
+#define __attribute__(dummy_val)
#pragma pack(push)
#pragma pack(1)
#endif
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.h
index b770e36505..18b8380853 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.h
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxCDDA.h
@@ -23,8 +23,10 @@
#ifdef TARGET_WINDOWS
#define __attribute__(dummy_val)
-#else
-#include <config.h>
+#endif
+
+#if defined(HAVE_CONFIG_H)
+ #include "config.h"
#endif
class CDemuxStreamAudioCDDA;
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp
index 1a798952c7..dea24d5a7a 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp
@@ -164,7 +164,11 @@ bool CDVDDemuxClient::Open(CDVDInputStream* pInput)
if (!m_IDemux)
return false;
- return m_IDemux->OpenDemux();
+ if (!m_IDemux->OpenDemux())
+ return false;
+
+ RequestStreams();
+ return true;
}
void CDVDDemuxClient::Dispose()
@@ -427,6 +431,13 @@ void CDVDDemuxClient::RequestStreams()
st->iBlockAlign = source->iBlockAlign;
st->iBitRate = source->iBitRate;
st->iBitsPerSample = source->iBitsPerSample;
+ if (source->ExtraSize > 0 && source->ExtraData)
+ {
+ st->ExtraData = new uint8_t[source->ExtraSize];
+ st->ExtraSize = source->ExtraSize;
+ for (unsigned int j=0; j<source->ExtraSize; j++)
+ st->ExtraData[j] = source->ExtraData[j];
+ }
m_streams[i] = st;
st->m_parser_split = true;
st->changes++;
@@ -463,6 +474,13 @@ void CDVDDemuxClient::RequestStreams()
st->iWidth = source->iWidth;
st->fAspect = source->fAspect;
st->stereo_mode = "mono";
+ if (source->ExtraSize > 0 && source->ExtraData)
+ {
+ st->ExtraData = new uint8_t[source->ExtraSize];
+ st->ExtraSize = source->ExtraSize;
+ for (unsigned int j=0; j<source->ExtraSize; j++)
+ st->ExtraData[j] = source->ExtraData[j];
+ }
m_streams[i] = st;
st->m_parser_split = true;
}
diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
index f28e055451..18c74be4ba 100644
--- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
@@ -922,10 +922,10 @@ bool CDVDDemuxFFmpeg::SeekTime(int time, bool backwords, double *startpts)
m_pkt.result = -1;
av_free_packet(&m_pkt.pkt);
- CDVDInputStream::ISeekTime* ist = dynamic_cast<CDVDInputStream::ISeekTime*>(m_pInput);
+ CDVDInputStream::IPosTime* ist = m_pInput->GetIPosTime();
if (ist)
{
- if (!ist->SeekTime(time))
+ if (!ist->PosTime(time))
return false;
if(startpts)
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h
index a1b6598a20..8a0d006f39 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h
@@ -68,11 +68,11 @@ public:
virtual int GetTime() = 0;
};
- class ISeekTime
+ class IPosTime
{
public:
- virtual ~ISeekTime() {};
- virtual bool SeekTime(int ms) = 0;
+ virtual ~IPosTime() {};
+ virtual bool PosTime(int ms) = 0;
};
class IChapter
@@ -112,14 +112,6 @@ public:
virtual bool SetState(const std::string &xmlstate) = 0;
};
- class ISeekable
- {
- public:
- virtual ~ISeekable() {};
- virtual bool CanSeek() = 0;
- virtual bool CanPause() = 0;
- };
-
class IDemux
{
public:
@@ -155,6 +147,8 @@ public:
virtual void Abort() {}
virtual int GetBlockSize() { return 0; }
virtual void ResetScanTimeout(unsigned int iTimeoutMs) { }
+ virtual bool CanSeek() { return true; }
+ virtual bool CanPause() { return true; }
/*! \brief Indicate expected read rate in bytes per second.
* This could be used to throttle caching rate. Should
@@ -179,6 +173,8 @@ public:
// interfaces
virtual IDemux* GetIDemux() { return nullptr; }
+ virtual IPosTime* GetIPosTime() { return nullptr; }
+ virtual IDisplayTime* GetIDisplayTime() { return nullptr; }
protected:
DVDStreamType m_streamType;
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp
index 249c4732f2..d437ec34a2 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp
@@ -900,7 +900,7 @@ int CDVDInputStreamBluray::GetTime()
return (int)(m_dll->bd_tell_time(m_bd) / 90);
}
-bool CDVDInputStreamBluray::SeekTime(int ms)
+bool CDVDInputStreamBluray::PosTime(int ms)
{
if(m_dll->bd_seek_time(m_bd, ms * 90) < 0)
return false;
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h
index c4b43ec042..3faec212ab 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.h
@@ -43,7 +43,7 @@ class CDVDInputStreamBluray
: public CDVDInputStream
, public CDVDInputStream::IDisplayTime
, public CDVDInputStream::IChapter
- , public CDVDInputStream::ISeekTime
+ , public CDVDInputStream::IPosTime
, public CDVDInputStream::IMenus
{
public:
@@ -101,9 +101,12 @@ public:
int64_t GetChapterPos(int ch);
bool SeekChapter(int ch);
+ CDVDInputStream::IDisplayTime* GetIDisplayTime() override { return this; }
int GetTotalTime();
int GetTime();
- bool SeekTime(int ms);
+
+ CDVDInputStream::IPosTime* GetIPosTime() override { return this; }
+ bool PosTime(int ms);
void GetStreamInfo(int pid, char* language);
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpeg.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpeg.h
index 1d3f583952..a90507bb98 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpeg.h
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamFFmpeg.h
@@ -24,7 +24,6 @@
class CDVDInputStreamFFmpeg
: public CDVDInputStream
- , public CDVDInputStream::ISeekable
{
public:
CDVDInputStreamFFmpeg(CFileItem& fileitem);
@@ -37,11 +36,11 @@ public:
virtual bool IsEOF();
virtual int64_t GetLength();
- virtual void Abort() { m_aborted = true; }
- bool Aborted() { return m_aborted; }
+ virtual void Abort() { m_aborted = true; }
+ bool Aborted() { return m_aborted; }
- bool CanSeek() { return m_can_seek; }
- bool CanPause() { return m_can_pause; }
+ bool CanSeek() { return m_can_seek; }
+ bool CanPause() { return m_can_pause; }
protected:
bool m_can_pause;
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.cpp
index 0ccfed54a9..7f07bd2e84 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.cpp
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.cpp
@@ -1189,7 +1189,7 @@ int CDVDInputStreamNavigator::GetTime()
return m_iTime;
}
-bool CDVDInputStreamNavigator::SeekTime(int iTimeInMsec)
+bool CDVDInputStreamNavigator::PosTime(int iTimeInMsec)
{
if( m_dll.dvdnav_jump_to_sector_by_time(m_dvdnav, iTimeInMsec * 90, 0) == DVDNAV_STATUS_ERR )
{
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.h
index b1b5f27088..005f11b334 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.h
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamNavigator.h
@@ -104,7 +104,7 @@ class CDVDInputStreamNavigator
: public CDVDInputStream
, public CDVDInputStream::IDisplayTime
, public CDVDInputStream::IChapter
- , public CDVDInputStream::ISeekTime
+ , public CDVDInputStream::IPosTime
, public CDVDInputStream::IMenus
{
public:
@@ -168,12 +168,14 @@ public:
int64_t GetChapterPos(int ch=-1);
bool SeekChapter(int iChapter);
+ CDVDInputStream::IDisplayTime* GetIDisplayTime() override { return this; }
int GetTotalTime(); // the total time in milli seconds
int GetTime(); // the current position in milli seconds
float GetVideoAspectRatio();
- bool SeekTime(int iTimeInMsec); //seek within current pg(c)
+ CDVDInputStream::IPosTime* GetIPosTime() override { return this; }
+ bool PosTime(int iTimeInMsec); //seek within current pg(c)
std::string GetDVDTitleString();
std::string GetDVDSerialString();
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.h
index d231bd4ad0..d1c7e4b6c1 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.h
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.h
@@ -46,7 +46,6 @@ class IDemux;
class CDVDInputStreamPVRManager
: public CDVDInputStream
, public CDVDInputStream::IDisplayTime
- , public CDVDInputStream::ISeekable
, public CDVDInputStream::IDemux
{
public:
@@ -70,6 +69,7 @@ public:
bool PrevChannel(bool preview = false);
PVR::CPVRChannelPtr GetSelectedChannel();
+ CDVDInputStream::IDisplayTime* GetIDisplayTime() override { return this; }
int GetTotalTime() override;
int GetTime() override;
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.cpp
index ae83abd3d4..d44f07f826 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.cpp
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.cpp
@@ -233,7 +233,7 @@ int64_t CDVDInputStreamRTMP::Seek(int64_t offset, int whence)
return -1;
}
-bool CDVDInputStreamRTMP::SeekTime(int iTimeInMsec)
+bool CDVDInputStreamRTMP::PosTime(int iTimeInMsec)
{
CLog::Log(LOGNOTICE, "RTMP Seek to %i requested", iTimeInMsec);
CSingleLock lock(m_RTMPSection);
diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.h
index f02e20d215..a7a1b227dc 100644
--- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.h
+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.h
@@ -26,23 +26,24 @@
class CDVDInputStreamRTMP
: public CDVDInputStream
- , public CDVDInputStream::ISeekTime
- , public CDVDInputStream::ISeekable
+ , public CDVDInputStream::IPosTime
{
public:
CDVDInputStreamRTMP(CFileItem &fileitem);
virtual ~CDVDInputStreamRTMP();
- virtual bool Open();
- virtual void Close();
- virtual int Read(uint8_t* buf, int buf_size);
+ virtual bool Open();
+ virtual void Close();
+ virtual int Read(uint8_t* buf, int buf_size);
virtual int64_t Seek(int64_t offset, int whence);
- bool SeekTime(int iTimeInMsec);
- bool CanSeek() { return m_canSeek; }
- bool CanPause() { return m_canPause; }
- virtual bool Pause(double dTime);
- virtual bool IsEOF();
+ bool PosTime(int iTimeInMsec);
+ bool CanSeek() { return m_canSeek; }
+ bool CanPause() { return m_canPause; }
+ virtual bool Pause(double dTime);
+ virtual bool IsEOF();
virtual int64_t GetLength();
+ CDVDInputStream::IPosTime* GetIPosTime() override { return this; }
+
CCriticalSection m_RTMPSection;
protected:
diff --git a/xbmc/cores/VideoPlayer/Interfaces/IVPClockCallback.h b/xbmc/cores/VideoPlayer/Interfaces/IVPClockCallback.h
deleted file mode 100644
index 1a5b11eb14..0000000000
--- a/xbmc/cores/VideoPlayer/Interfaces/IVPClockCallback.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#pragma once
-
-/*
- * Copyright (C) 2015 Team Kodi
- * http://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, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-class IVPClockCallback
-{
-public:
- virtual double GetInterpolatedClock() = 0;
-};
diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
index c7593dddca..5b76cd5a58 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp
@@ -2430,7 +2430,7 @@ void CVideoPlayer::HandleMessages()
// increasing steadily. For seeking we need to determine the boundaries and offset
// of the desired segment. With the current approach calculated time may point
// to nirvana
- if(dynamic_cast<CDVDInputStream::ISeekTime*>(m_pInputStream) == NULL)
+ if (m_pInputStream->GetIPosTime() == nullptr)
time += DVD_TIME_TO_MSEC(m_offset_pts - m_State.time_offset);
CLog::Log(LOGDEBUG, "demuxer seek to: %d", time);
@@ -4659,7 +4659,7 @@ void CVideoPlayer::UpdatePlayState(double timeout)
state.recording = pvrStream->IsRecording();
}
- CDVDInputStream::IDisplayTime* pDisplayTime = dynamic_cast<CDVDInputStream::IDisplayTime*>(m_pInputStream);
+ CDVDInputStream::IDisplayTime* pDisplayTime = m_pInputStream->GetIDisplayTime();
if (pDisplayTime && pDisplayTime->GetTotalTime() > 0)
{
if (state.dts != DVD_NOPTS_VALUE)
@@ -4692,11 +4692,8 @@ void CVideoPlayer::UpdatePlayState(double timeout)
state.hasMenu = true;
}
- if (CDVDInputStream::ISeekable* ptr = dynamic_cast<CDVDInputStream::ISeekable*>(m_pInputStream))
- {
- state.canpause = ptr->CanPause();
- state.canseek = ptr->CanSeek();
- }
+ state.canpause = m_pInputStream->CanPause();
+ state.canseek = m_pInputStream->CanSeek();
}
if (m_Edl.HasCut())
diff --git a/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp b/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp
index d6e478ba4c..3df68fe290 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp
@@ -60,7 +60,7 @@ CVideoPlayerAudio::CVideoPlayerAudio(CDVDClock* pClock, CDVDMessageQueue& parent
: CThread("VideoPlayerAudio")
, m_messageQueue("audio")
, m_messageParent(parent)
-, m_dvdAudio((bool&)m_bStop, pClock)
+, m_dvdAudio(pClock)
{
m_pClock = pClock;
m_pAudioCodec = NULL;
@@ -583,6 +583,8 @@ void CVideoPlayerAudio::Flush(bool sync)
{
m_messageQueue.Flush();
m_messageQueue.Put( new CDVDMsgBool(CDVDMsg::GENERAL_FLUSH, sync), 1);
+
+ m_dvdAudio.AbortAddPackets();
}
void CVideoPlayerAudio::WaitForBuffers()
diff --git a/xbmc/cores/VideoPlayer/VideoPlayerSubtitle.cpp b/xbmc/cores/VideoPlayer/VideoPlayerSubtitle.cpp
index 472a43efb1..b9828e30d9 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayerSubtitle.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayerSubtitle.cpp
@@ -27,8 +27,8 @@
#include "DVDCodecs/DVDFactoryCodec.h"
#include "utils/log.h"
#include "threads/SingleLock.h"
-#ifdef TARGET_POSIX
-#include "config.h"
+#if defined(HAVE_CONFIG_H)
+ #include "config.h"
#endif
CVideoPlayerSubtitle::CVideoPlayerSubtitle(CDVDOverlayContainer* pOverlayContainer)
diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
index 9fdc1bf661..2a430307a8 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
+++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp
@@ -129,7 +129,7 @@ bool CVideoPlayerVideo::OpenStream( CDVDStreamInfo &hint )
return false;
CLog::Log(LOGNOTICE, "Creating video codec with codec id: %i", hint.codec);
- CDVDVideoCodec* codec = CDVDFactoryCodec::CreateVideoCodec(hint, info, this);
+ CDVDVideoCodec* codec = CDVDFactoryCodec::CreateVideoCodec(hint, info);
if(!codec)
{
CLog::Log(LOGERROR, "Unsupported video codec");
@@ -1210,14 +1210,6 @@ int CVideoPlayerVideo::CalcDropRequirement(double pts, bool updateOnly)
return result;
}
-double CVideoPlayerVideo::GetInterpolatedClock()
-{
- if(m_pClock)
- return m_pClock->GetClock(true);
- else
- return 0.0;
-}
-
void CDroppingStats::Reset()
{
m_gain.clear();
diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.h b/xbmc/cores/VideoPlayer/VideoPlayerVideo.h
index 1cb6cf3c91..3cc7a7e697 100644
--- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.h
+++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.h
@@ -22,7 +22,6 @@
#include "threads/Thread.h"
#include "IVideoPlayer.h"
-#include "Interfaces/IVPClockCallback.h"
#include "DVDMessageQueue.h"
#include "DVDCodecs/Video/DVDVideoCodec.h"
#include "DVDClock.h"
@@ -60,7 +59,7 @@ public:
unsigned int m_dropRequests;
};
-class CVideoPlayerVideo : public CThread, public IDVDStreamPlayerVideo, public IVPClockCallback
+class CVideoPlayerVideo : public CThread, public IDVDStreamPlayerVideo
{
public:
CVideoPlayerVideo(CDVDClock* pClock
@@ -98,9 +97,7 @@ public:
std::string GetStereoMode();
void SetSpeed(int iSpeed);
- // IVPClockCallback interface
- virtual double GetInterpolatedClock();
-
+ // classes
CDVDOverlayContainer* m_pOverlayContainer;
CDVDClock* m_pClock;
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt b/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt
index 24c22a5261..dd18c16590 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/CMakeLists.txt
@@ -39,7 +39,7 @@ if(GLES_FOUND)
OverlayRendererGL.h)
endif()
-if(ARCH STREQUAL arm)
+if(ARCH MATCHES arm)
list(APPEND SOURCES yuv2rgb.neon.S)
list(APPEND HEADERS yuv2rgb.neon.h)
endif()
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt
index 2ed53ce062..7351903099 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt
@@ -1,6 +1,3 @@
-set(SOURCES)
-set(HEADERS)
-
if(CORE_SYSTEM_NAME STREQUAL windows)
list(APPEND SOURCES DXVAHD.cpp)
list(APPEND HEADERS DXVAHD.h)
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp
index a5f84b4775..947e0a26ee 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp
@@ -36,10 +36,6 @@
#define CLASSNAME "CMMALRenderer"
-#ifdef _DEBUG
-#define MMAL_DEBUG_VERBOSE
-#endif
-
CYUVVideoBuffer::CYUVVideoBuffer()
{
@@ -56,9 +52,8 @@ CYUVVideoBuffer::~CYUVVideoBuffer()
CYUVVideoBuffer *CYUVVideoBuffer::Acquire()
{
long count = AtomicIncrement(&m_refs);
-#ifdef MMAL_DEBUG_VERBOSE
- CLog::Log(LOGDEBUG, "%s::%s omvb:%p mmal:%p ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s omvb:%p mmal:%p ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count);
(void)count;
return this;
}
@@ -66,9 +61,8 @@ CYUVVideoBuffer *CYUVVideoBuffer::Acquire()
long CYUVVideoBuffer::Release()
{
long count = AtomicDecrement(&m_refs);
-#ifdef MMAL_DEBUG_VERBOSE
- CLog::Log(LOGDEBUG, "%s::%s omvb:%p mmal:%p ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s omvb:%p mmal:%p ref:%ld", CLASSNAME, __func__, this, mmal_buffer, count);
if (count == 0)
{
mmal_buffer_header_release(mmal_buffer);
@@ -88,9 +82,8 @@ CRenderInfo CMMALRenderer::GetRenderInfo()
if (!m_bMMALConfigured)
m_bMMALConfigured = init_vout(RENDER_FMT_MMAL);
- #if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, (void *)m_vout_input_pool);
- #endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, (void *)m_vout_input_pool);
info.max_buffer_size = NUM_BUFFERS;
info.optimal_buffer_size = NUM_BUFFERS;
@@ -112,18 +105,16 @@ void CMMALRenderer::vout_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *
{
CMMALVideoBuffer *omvb = (CMMALVideoBuffer *)buffer->user_data;
assert(buffer == omvb->mmal_buffer);
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight);
omvb->Release();
}
else if (m_format == RENDER_FMT_YUV420P)
{
CYUVVideoBuffer *omvb = (CYUVVideoBuffer *)buffer->user_data;
assert(buffer == omvb->mmal_buffer);
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight);
m_inflight--;
omvb->Release();
}
@@ -264,9 +255,8 @@ CMMALRenderer::~CMMALRenderer()
void CMMALRenderer::AddVideoPictureHW(DVDVideoPicture& pic, int index)
{
CMMALVideoBuffer *buffer = pic.MMALBuffer;
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - %p (%p) %i", CLASSNAME, __func__, buffer, buffer->mmal_buffer, index);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - %p (%p) %i", CLASSNAME, __func__, buffer, buffer->mmal_buffer, index);
YUVBUFFER &buf = m_buffers[index];
assert(!buf.MMALBuffer);
@@ -312,17 +302,15 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly)
{
if (!image || source < 0)
{
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - invalid: image:%p source:%d ro:%d flight:%d", CLASSNAME, __func__, image, source, readonly, m_inflight);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - invalid: image:%p source:%d ro:%d flight:%d", CLASSNAME, __func__, image, source, readonly, m_inflight);
return -1;
}
if (m_format == RENDER_FMT_MMAL)
{
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - MMAL: image:%p source:%d ro:%d flight:%d", CLASSNAME, __func__, image, source, readonly, m_inflight);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - MMAL: image:%p source:%d ro:%d flight:%d", CLASSNAME, __func__, image, source, readonly, m_inflight);
}
else if (m_format == RENDER_FMT_YUV420P)
{
@@ -365,9 +353,8 @@ int CMMALRenderer::GetImage(YV12Image *image, int source, bool readonly)
if (!buf.YUVBuffer)
return -1;
buf.YUVBuffer->mmal_buffer = buffer;
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - YUV: image:%p source:%d ro:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, image, source, readonly, buf.YUVBuffer, buffer, m_inflight);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - YUV: image:%p source:%d ro:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, image, source, readonly, buf.YUVBuffer, buffer, m_inflight);
buf.YUVBuffer->Acquire();
}
else assert(0);
@@ -380,16 +367,14 @@ void CMMALRenderer::ReleaseBuffer(int idx)
CSingleLock lock(m_sharedSection);
if (!m_bMMALConfigured)
{
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - not configured: source:%d", CLASSNAME, __func__, idx);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - not configured: source:%d", CLASSNAME, __func__, idx);
return;
}
if (m_format == RENDER_FMT_BYPASS)
{
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - bypass: source:%d", CLASSNAME, __func__, idx);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - bypass: source:%d", CLASSNAME, __func__, idx);
return;
}
@@ -397,17 +382,15 @@ void CMMALRenderer::ReleaseBuffer(int idx)
if (m_format == RENDER_FMT_MMAL)
{
CMMALVideoBuffer *omvb = buffer->MMALBuffer;
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - MMAL: source:%d omvb:%p mmal:%p", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - MMAL: source:%d omvb:%p mmal:%p", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL);
SAFE_RELEASE(buffer->MMALBuffer);
}
else if (m_format == RENDER_FMT_YUV420P)
{
CYUVVideoBuffer *omvb = buffer->YUVBuffer;
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - YUV: source:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL, m_inflight);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - YUV: source:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL, m_inflight);
if (omvb && omvb->mmal_buffer)
SAFE_RELEASE(buffer->YUVBuffer);
}
@@ -431,9 +414,8 @@ void CMMALRenderer::Flush()
void CMMALRenderer::Update()
{
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
if (!m_bConfigured) return;
ManageDisplay();
}
@@ -445,9 +427,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha)
if (!m_bConfigured)
{
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - not configured: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - not configured: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source);
return;
}
@@ -455,9 +436,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha)
if (m_format == RENDER_FMT_BYPASS)
{
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - bypass: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - bypass: clear:%d flags:%x alpha:%d source:%d", CLASSNAME, __func__, clear, flags, alpha, source);
return;
}
SetVideoRect(m_sourceRect, m_destRect);
@@ -468,9 +448,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha)
CMMALVideoBuffer *omvb = buffer->MMALBuffer;
if (omvb && omvb->mmal_buffer)
{
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - MMAL: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - MMAL: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags);
// we only want to upload frames once
if (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1)
return;
@@ -486,9 +465,8 @@ void CMMALRenderer::RenderUpdate(bool clear, DWORD flags, DWORD alpha)
CYUVVideoBuffer *omvb = buffer->YUVBuffer;
if (omvb && omvb->mmal_buffer)
{
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - YUV: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - YUV: clear:%d flags:%x alpha:%d source:%d omvb:%p mmal:%p mflags:%x", CLASSNAME, __func__, clear, flags, alpha, source, omvb, omvb->mmal_buffer, omvb->mmal_buffer->flags);
// we only want to upload frames once
if (omvb->mmal_buffer->flags & MMAL_BUFFER_HEADER_FLAG_USER1)
return;
@@ -509,15 +487,13 @@ void CMMALRenderer::FlipPage(int source)
CSingleLock lock(m_sharedSection);
if (!m_bConfigured || m_format == RENDER_FMT_BYPASS)
{
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - not configured: source:%d", CLASSNAME, __func__, source);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - not configured: source:%d", CLASSNAME, __func__, source);
return;
}
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s - source:%d", CLASSNAME, __func__, source);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s - source:%d", CLASSNAME, __func__, source);
m_iYV12RenderBuffer = source;
}
@@ -544,9 +520,8 @@ void CMMALRenderer::PreInit()
void CMMALRenderer::ReleaseBuffers()
{
-#if defined(MMAL_DEBUG_VERBOSE)
- CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
-#endif
+ if (g_advancedSettings.CanLogComponent(LOGVIDEO))
+ CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__);
for (int i=0; i<NUM_BUFFERS; i++)
ReleaseBuffer(i);
}
@@ -565,16 +540,16 @@ void CMMALRenderer::UnInitMMAL()
{
mmal_port_flush(m_vout_input);
mmal_port_disable(m_vout_input);
- m_vout_input = NULL;
}
ReleaseBuffers();
if (m_vout_input_pool)
{
- mmal_pool_destroy(m_vout_input_pool);
+ mmal_port_pool_destroy(m_vout_input, m_vout_input_pool);
m_vout_input_pool = NULL;
}
+ m_vout_input = NULL;
if (m_vout)
{
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp
index e28c625ea2..865fd2729e 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp
@@ -802,7 +802,10 @@ bool CRenderManager::RenderCaptureGetPixels(unsigned int captureId, unsigned int
CSingleExit exitlock(m_captCritSect);
if (!it->second->GetEvent().WaitMSec(millis))
+ {
+ m_captureWaitCounter--;
return false;
+ }
}
m_captureWaitCounter--;
diff --git a/xbmc/dbwrappers/dataset.cpp b/xbmc/dbwrappers/dataset.cpp
index d9ba3f3846..2349573a19 100644
--- a/xbmc/dbwrappers/dataset.cpp
+++ b/xbmc/dbwrappers/dataset.cpp
@@ -393,20 +393,18 @@ const field_value Dataset::get_field_value(const char *f_name) {
const field_value Dataset::get_field_value(int index) {
if (ds_state != dsInactive) {
if (ds_state == dsEdit || ds_state == dsInsert){
- if (index <0 || index >field_count())
+ if (index < 0 || index >= field_count())
throw DbErrors("Field index not found: %d",index);
return (*edit_object)[index].val;
}
else
- if (index <0 || index >field_count())
+ if (index < 0 || index >= field_count())
throw DbErrors("Field index not found: %d",index);
return (*fields_object)[index].val;
}
throw DbErrors("Dataset state is Inactive");
- //field_value fv;
- //return fv;
}
const sql_record* const Dataset::get_sql_record()
diff --git a/xbmc/dialogs/CMakeLists.txt b/xbmc/dialogs/CMakeLists.txt
index ec7331d03e..e780a89dcd 100644
--- a/xbmc/dialogs/CMakeLists.txt
+++ b/xbmc/dialogs/CMakeLists.txt
@@ -58,3 +58,7 @@ set(HEADERS GUIDialogBoxBase.h
core_add_library(dialogs)
add_dependencies(dialogs libcpluff)
+
+if(ENABLE_INTERNAL_FFMPEG)
+ add_dependencies(dialogs ffmpeg)
+endif()
diff --git a/xbmc/dialogs/GUIDialogBoxBase.cpp b/xbmc/dialogs/GUIDialogBoxBase.cpp
index 14963fca0b..2152c5abd6 100644
--- a/xbmc/dialogs/GUIDialogBoxBase.cpp
+++ b/xbmc/dialogs/GUIDialogBoxBase.cpp
@@ -144,11 +144,6 @@ void CGUIDialogBoxBase::Process(unsigned int currentTime, CDirtyRegionList &dirt
void CGUIDialogBoxBase::OnInitWindow()
{
- // hide all controls
- for (int i = 0; i < DIALOG_MAX_CHOICES; ++i)
- SET_CONTROL_HIDDEN(CONTROL_CHOICES_START + i);
- SET_CONTROL_HIDDEN(CONTROL_PROGRESS_BAR);
-
// set focus to default
m_lastControlID = m_defaultControl;
diff --git a/xbmc/dialogs/GUIDialogGamepad.cpp b/xbmc/dialogs/GUIDialogGamepad.cpp
index 0018bbcb82..9d8f6f326d 100644
--- a/xbmc/dialogs/GUIDialogGamepad.cpp
+++ b/xbmc/dialogs/GUIDialogGamepad.cpp
@@ -45,6 +45,10 @@ CGUIDialogGamepad::~CGUIDialogGamepad(void)
void CGUIDialogGamepad::OnInitWindow()
{
+ // hide all controls
+ for (int i = 0; i < DIALOG_MAX_CHOICES; ++i)
+ SET_CONTROL_HIDDEN(CONTROL_CHOICES_START + i);
+ SET_CONTROL_HIDDEN(CONTROL_PROGRESS_BAR);
CGUIDialogBoxBase::OnInitWindow();
}
diff --git a/xbmc/dialogs/GUIDialogOK.cpp b/xbmc/dialogs/GUIDialogOK.cpp
index b907141815..91fc8fe385 100644
--- a/xbmc/dialogs/GUIDialogOK.cpp
+++ b/xbmc/dialogs/GUIDialogOK.cpp
@@ -72,10 +72,12 @@ void CGUIDialogOK::ShowAndGetInput(CVariant heading, CVariant line0, CVariant li
void CGUIDialogOK::OnInitWindow()
{
- CGUIDialogBoxBase::OnInitWindow();
-
- SET_CONTROL_VISIBLE(CONTROL_YES_BUTTON);
+ SET_CONTROL_HIDDEN(CONTROL_NO_BUTTON);
+ SET_CONTROL_HIDDEN(CONTROL_CUSTOM_BUTTON);
+ SET_CONTROL_HIDDEN(CONTROL_PROGRESS_BAR);
SET_CONTROL_FOCUS(CONTROL_YES_BUTTON, 0);
+
+ CGUIDialogBoxBase::OnInitWindow();
}
int CGUIDialogOK::GetDefaultLabelID(int controlId) const
diff --git a/xbmc/dialogs/GUIDialogProgress.cpp b/xbmc/dialogs/GUIDialogProgress.cpp
index 14e81b1259..dc1427150f 100644
--- a/xbmc/dialogs/GUIDialogProgress.cpp
+++ b/xbmc/dialogs/GUIDialogProgress.cpp
@@ -207,11 +207,11 @@ void CGUIDialogProgress::Process(unsigned int currentTime, CDirtyRegionList &dir
void CGUIDialogProgress::OnInitWindow()
{
- CGUIDialogBoxBase::OnInitWindow();
-
- SET_CONTROL_VISIBLE(CONTROL_NO_BUTTON);
- SET_CONTROL_VISIBLE(CONTROL_PROGRESS_BAR);
+ SET_CONTROL_HIDDEN(CONTROL_YES_BUTTON);
+ SET_CONTROL_HIDDEN(CONTROL_CUSTOM_BUTTON);
SET_CONTROL_FOCUS(CONTROL_NO_BUTTON, 0);
+
+ CGUIDialogBoxBase::OnInitWindow();
}
int CGUIDialogProgress::GetDefaultLabelID(int controlId) const
diff --git a/xbmc/dialogs/GUIDialogSelect.cpp b/xbmc/dialogs/GUIDialogSelect.cpp
index 09e269a616..78776389f2 100644
--- a/xbmc/dialogs/GUIDialogSelect.cpp
+++ b/xbmc/dialogs/GUIDialogSelect.cpp
@@ -326,7 +326,6 @@ void CGUIDialogSelect::OnInitWindow()
SET_CONTROL_HIDDEN(CONTROL_EXTRA_BUTTON);
SET_CONTROL_LABEL(CONTROL_CANCEL_BUTTON, g_localizeStrings.Get(222));
- SET_CONTROL_VISIBLE(CONTROL_CANCEL_BUTTON);
CGUIDialogBoxBase::OnInitWindow();
diff --git a/xbmc/dialogs/GUIDialogYesNo.cpp b/xbmc/dialogs/GUIDialogYesNo.cpp
index 35afffab59..8643ba9e01 100644
--- a/xbmc/dialogs/GUIDialogYesNo.cpp
+++ b/xbmc/dialogs/GUIDialogYesNo.cpp
@@ -72,11 +72,11 @@ bool CGUIDialogYesNo::OnBack(int actionID)
void CGUIDialogYesNo::OnInitWindow()
{
- CGUIDialogBoxBase::OnInitWindow();
-
- SET_CONTROL_VISIBLE(CONTROL_YES_BUTTON);
- SET_CONTROL_VISIBLE(CONTROL_NO_BUTTON);
+ SET_CONTROL_HIDDEN(CONTROL_CUSTOM_BUTTON);
+ SET_CONTROL_HIDDEN(CONTROL_PROGRESS_BAR);
SET_CONTROL_FOCUS(CONTROL_NO_BUTTON, 0);
+
+ CGUIDialogBoxBase::OnInitWindow();
}
bool CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2, bool &bCanceled)
diff --git a/xbmc/epg/Epg.cpp b/xbmc/epg/Epg.cpp
index 0de86c0db1..e7233ac1ff 100644
--- a/xbmc/epg/Epg.cpp
+++ b/xbmc/epg/Epg.cpp
@@ -264,6 +264,20 @@ CEpgInfoTagPtr CEpg::GetTag(const CDateTime &StartTime) const
return CEpgInfoTagPtr();
}
+CEpgInfoTagPtr CEpg::GetTagByBroadcastId(unsigned int iUniqueBroadcastId) const
+{
+ if (iUniqueBroadcastId != EPG_TAG_INVALID_UID)
+ {
+ CSingleLock lock(m_critSection);
+ for (const auto &infoTag : m_tags)
+ {
+ if (infoTag.second->UniqueBroadcastID() == iUniqueBroadcastId)
+ return infoTag.second;
+ }
+ }
+ return CEpgInfoTagPtr();
+}
+
CEpgInfoTagPtr CEpg::GetTagBetween(const CDateTime &beginTime, const CDateTime &endTime) const
{
CSingleLock lock(m_critSection);
@@ -309,31 +323,100 @@ void CEpg::AddEntry(const CEpgInfoTag &tag)
}
}
-bool CEpg::UpdateEntry(const CEpgInfoTag &tag, bool bUpdateDatabase /* = false */, bool bSort /* = true */)
+bool CEpg::UpdateEntry(const EPG_TAG *data, bool bUpdateDatabase /* = false */)
+{
+ if (!data)
+ return false;
+
+ CEpgInfoTagPtr tag(new CEpgInfoTag(*data));
+ return UpdateEntry(tag, bUpdateDatabase);
+}
+
+bool CEpg::UpdateEntry(const CEpgInfoTagPtr &tag, bool bUpdateDatabase /* = false */)
+{
+ CSingleLock lock(m_critSection);
+ auto it = m_tags.find(tag->StartAsUTC());
+ EPG_EVENT_STATE state = (it == m_tags.end()) ? EPG_EVENT_CREATED : EPG_EVENT_UPDATED;
+ return UpdateEntry(tag, state, it, bUpdateDatabase);
+}
+
+bool CEpg::UpdateEntry(const CEpgInfoTagPtr &tag, EPG_EVENT_STATE newState, bool bUpdateDatabase /* = false */)
{
- CEpgInfoTagPtr infoTag;
CSingleLock lock(m_critSection);
- std::map<CDateTime, CEpgInfoTagPtr>::iterator it = m_tags.find(tag.StartAsUTC());
+ auto it = m_tags.end();
+ return UpdateEntry(tag, newState, it, bUpdateDatabase);
+}
+
+bool CEpg::UpdateEntry(const CEpgInfoTagPtr &tag, EPG_EVENT_STATE newState, std::map<CDateTime, CEpgInfoTagPtr>::iterator &eit, bool bUpdateDatabase /* = false */)
+{
+ CEpgInfoTagPtr infoTag;
bool bNewTag(false);
- if (it != m_tags.end())
+
+ CSingleLock lock(m_critSection);
+
+ if (newState == EPG_EVENT_CREATED || newState == EPG_EVENT_UPDATED)
+ {
+ // Reuse passed iterator in favor of doing expensive find self
+ auto it = (eit == m_tags.end()) ? m_tags.find(tag->StartAsUTC()) : eit;
+ if (it != m_tags.end())
+ {
+ if (newState == EPG_EVENT_CREATED)
+ CLog::Log(LOGERROR, "EPG - %s - Error: EPG_EVENT_CREATED: uid %d found! Updating existing event.", __FUNCTION__, tag->UniqueBroadcastID());
+
+ infoTag = it->second;
+ }
+ else
+ {
+ if (newState == EPG_EVENT_UPDATED)
+ CLog::Log(LOGERROR, "EPG - %s - Error: EPG_EVENT_UPDATED: uid %d not found. Inserting new event.", __FUNCTION__, tag->UniqueBroadcastID());
+
+ infoTag.reset(new CEpgInfoTag(this, m_pvrChannel, m_strName, m_pvrChannel ? m_pvrChannel->IconPath() : ""));
+ infoTag->SetUniqueBroadcastID(tag->UniqueBroadcastID());
+ m_tags.insert(std::make_pair(tag->StartAsUTC(), infoTag));
+ bNewTag = true;
+ }
+ }
+ else if (newState == EPG_EVENT_DELETED)
{
- infoTag = it->second;
+ // Reuse passed iterator in favor of doing expensive find self
+ auto it = (eit == m_tags.end()) ? m_tags.find(tag->StartAsUTC()) : eit;
+ if (it == m_tags.end())
+ {
+ // not guranteed that deleted tag contains valid start time. search sequential.
+ for (it = m_tags.begin(); it != m_tags.end(); ++it)
+ {
+ if (it->second->UniqueBroadcastID() == tag->UniqueBroadcastID())
+ break;
+ }
+ }
+
+ if (it != m_tags.end())
+ {
+ it->second->ClearTimer();
+ m_tags.erase(it);
+
+ if (bUpdateDatabase)
+ m_deletedTags.insert(std::make_pair(infoTag->UniqueBroadcastID(), infoTag));
+ }
+ else
+ {
+ CLog::Log(LOGERROR, "EPG - %s - Error: EPG_EVENT_DELETED: uid %d not found.", __FUNCTION__, tag->UniqueBroadcastID());
+ return false;
+ }
+ return true;
}
else
{
- /* create a new tag if no tag with this ID exists */
- infoTag.reset(new CEpgInfoTag(this, m_pvrChannel, m_strName, m_pvrChannel ? m_pvrChannel->IconPath() : ""));
- infoTag->SetUniqueBroadcastID(tag.UniqueBroadcastID());
- m_tags.insert(make_pair(tag.StartAsUTC(), infoTag));
- bNewTag = true;
+ CLog::Log(LOGERROR, "EPG - %s - unknownn epg event state '%d'.", __FUNCTION__, newState);
+ return false;
}
- infoTag->Update(tag, bNewTag);
+ infoTag->Update(*tag, bNewTag);
infoTag->SetEpg(this);
infoTag->SetPVRChannel(m_pvrChannel);
if (bUpdateDatabase)
- m_changedTags.insert(make_pair(infoTag->UniqueBroadcastID(), infoTag));
+ m_changedTags.insert(std::make_pair(infoTag->UniqueBroadcastID(), infoTag));
return true;
}
@@ -377,7 +460,7 @@ bool CEpg::UpdateEntries(const CEpg &epg, bool bStoreInDb /* = true */)
#endif
/* copy over tags */
for (std::map<CDateTime, CEpgInfoTagPtr>::const_iterator it = epg.m_tags.begin(); it != epg.m_tags.end(); ++it)
- UpdateEntry(*it->second, bStoreInDb, false);
+ UpdateEntry(it->second, bStoreInDb);
#if EPG_DEBUGGING
CLog::Log(LOGDEBUG, "EPG - %s - %" PRIuS" entries in memory after merging and before fixing", __FUNCTION__, m_tags.size());
@@ -720,15 +803,6 @@ const std::string &CEpg::ConvertGenreIdToString(int iID, int iSubID)
return g_localizeStrings.Get(iLabelId);
}
-bool CEpg::UpdateEntry(const EPG_TAG *data, bool bUpdateDatabase /* = false */)
-{
- if (!data)
- return false;
-
- CEpgInfoTagPtr tag(new CEpgInfoTag(*data));
- return UpdateEntry(*tag, bUpdateDatabase);
-}
-
bool CEpg::IsRadio(void) const
{
CSingleLock lock(m_critSection);
@@ -857,15 +931,3 @@ bool CEpg::IsValid(void) const
return true;
}
-std::vector<CEpgInfoTagPtr> CEpg::GetAllEventsWithBroadcastId() const
-{
- CSingleLock lock(m_critSection);
- std::vector<CEpgInfoTagPtr> events;
- events.reserve(m_tags.size());
- for (const auto &infoTag : m_tags)
- {
- if (infoTag.second->UniqueBroadcastID())
- events.push_back(infoTag.second);
- }
- return events;
-}
diff --git a/xbmc/epg/Epg.h b/xbmc/epg/Epg.h
index 51bf728fa5..f45ed205b4 100644
--- a/xbmc/epg/Epg.h
+++ b/xbmc/epg/Epg.h
@@ -206,13 +206,28 @@ namespace EPG
CEpgInfoTagPtr GetTag(const CDateTime &beginTime) const;
/*!
+ * @brief Get the event matching the given unique broadcast id
+ * @param iUniqueBroadcastId The uid to look up
+ * @return The matching event or NULL if it wasn't found.
+ */
+ CEpgInfoTagPtr GetTagByBroadcastId(unsigned int iUniqueBroadcastId) const;
+
+ /*!
+ * @brief Update an entry in this EPG.
+ * @param tag The tag to update.
+ * @param bUpdateDatabase If set to true, this event will be persisted in the database.
+ * @return True if it was updated successfully, false otherwise.
+ */
+ bool UpdateEntry(const CEpgInfoTagPtr &tag, bool bUpdateDatabase = false);
+
+ /*!
* @brief Update an entry in this EPG.
* @param tag The tag to update.
+ * @param newState the new state of the event.
* @param bUpdateDatabase If set to true, this event will be persisted in the database.
- * @param bSort If set to false, epg entries will not be sorted after updating; used for mass updates
* @return True if it was updated successfully, false otherwise.
*/
- bool UpdateEntry(const CEpgInfoTag &tag, bool bUpdateDatabase = false, bool bSort = true);
+ bool UpdateEntry(const CEpgInfoTagPtr &tag, EPG_EVENT_STATE newState, bool bUpdateDatabase = false);
/*!
* @brief Update the EPG from 'start' till 'end'.
@@ -300,16 +315,20 @@ namespace EPG
*/
bool IsValid(void) const;
- /*!
- * @brief Get all events with a valid broadcast Id
- * @return the table of events
- */
- std::vector<CEpgInfoTagPtr> GetAllEventsWithBroadcastId() const;
-
protected:
CEpg(void);
/*!
+ * @brief Update an entry in this EPG.
+ * @param data The tag to update.
+ * @param newState The new state of the event.
+ * @param it An iterator pointing to m_tags entry for the EPG event to update or m_tags.end().
+ * @param bUpdateDatabase If set to true, this event will be persisted in the database.
+ * @return True if it was updated successfully, false otherwise.
+ */
+ bool UpdateEntry(const CEpgInfoTagPtr &tag, EPG_EVENT_STATE newState, std::map<CDateTime, CEpgInfoTagPtr>::iterator &eit, bool bUpdateDatabase = false);
+
+ /*!
* @brief Update the EPG from a scraper set in the channel tag.
* TODO: not implemented yet for non-pvr EPGs
* @param start Get entries with a start date after this time.
diff --git a/xbmc/epg/EpgContainer.cpp b/xbmc/epg/EpgContainer.cpp
index 279d920164..7811b06b93 100644
--- a/xbmc/epg/EpgContainer.cpp
+++ b/xbmc/epg/EpgContainer.cpp
@@ -109,8 +109,6 @@ void CEpgContainer::Clear(bool bClearDb /* = false */)
{
epgEntry.second->UnregisterObserver(this);
}
- m_epgEvents.clear();
- m_epgScans.clear();
m_epgs.clear();
m_iNextEpgUpdate = 0;
m_bStarted = false;
@@ -206,8 +204,6 @@ bool CEpgContainer::Stop(void)
void CEpgContainer::Notify(const Observable &obs, const ObservableMessage msg)
{
- if (msg == ObservableMessageEpg)
- UpdateEpgEvents();
SetChanged();
NotifyObservers(msg);
}
@@ -396,13 +392,17 @@ CEpgPtr CEpgContainer::GetById(int iEpgId) const
return epgEntry != m_epgs.end() ? epgEntry->second : NULL;
}
-CEpgInfoTagPtr CEpgContainer::GetTagById(unsigned int iBroadcastId) const
+CEpgInfoTagPtr CEpgContainer::GetTagById(const CPVRChannelPtr &channel, unsigned int iBroadcastId) const
{
CEpgInfoTagPtr retval;
- CSingleLock lock(m_critSection);
- const auto &infoTag = m_epgEvents.find(iBroadcastId);
- if (infoTag != m_epgEvents.end())
- retval = infoTag->second;
+
+ if (!channel || iBroadcastId == EPG_TAG_INVALID_UID)
+ return retval;
+
+ const CEpgPtr epg(channel->GetEPG());
+ if (epg)
+ retval = epg->GetTagByBroadcastId(iBroadcastId);
+
return retval;
}
@@ -525,7 +525,6 @@ bool CEpgContainer::DeleteEpg(const CEpg &epg, bool bDeleteFromDatabase /* = fal
m_database.Delete(*epgEntry->second);
epgEntry->second->UnregisterObserver(this);
- CleanupEpgEvents(epgEntry->second);
m_epgs.erase(epgEntry);
return true;
@@ -826,68 +825,3 @@ void CEpgContainer::UpdateRequest(int clientID, unsigned int channelID)
m_updateRequests.push_back(request);
}
-void CEpgContainer::UpdateEpgEvents()
-{
- CLog::Log(LOGDEBUG, "EPGContainer - %s", __FUNCTION__);
- CSingleLock lock(m_critSection);
- CDateTime now = CDateTime::GetUTCDateTime();
- int count = 0;
-
- // Purge old events from the map with daily frequency and in according with EPG setting 'LingerTime'
- if (!m_lastEpgEventPurge.IsValid() || m_lastEpgEventPurge < (now - CDateTimeSpan(1,0,0,0)))
- {
- CDateTime purgeTime = now - CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 0);
- for (auto event = m_epgEvents.begin(); event != m_epgEvents.end();)
- {
- if (event->second->EndAsUTC() < purgeTime)
- {
- event = m_epgEvents.erase(event);
- ++count;
- }
- else
- ++event;
- }
- m_lastEpgEventPurge = now;
- CLog::Log(LOGDEBUG, "EPGContainer - %s - %d item(s) purged", __FUNCTION__, count);
- }
-
- // Fill updated entries
- count = 0;
- for (const auto &epgEntry : m_epgs)
- {
- if (!epgEntry.second->IsValid())
- continue;
-
- int epgId = epgEntry.second->EpgID();
- CDateTime epgScanTime = epgEntry.second->GetLastScanTime();
-
- const auto &scan = m_epgScans.find(epgId);
- if (scan != m_epgScans.end() && scan->second == epgScanTime)
- continue;
-
- if (scan == m_epgScans.end())
- m_epgScans.insert(std::make_pair(epgId, epgScanTime));
- else
- scan->second = epgScanTime;
-
- auto events = epgEntry.second->GetAllEventsWithBroadcastId();
- for (const auto &infoTag : events)
- {
- m_epgEvents[infoTag->UniqueBroadcastID()] = infoTag;
- ++count;
- }
- }
- CLog::Log(LOGDEBUG, "EPGContainer - %s - %d item(s) updated", __FUNCTION__, count);
-}
-
-void CEpgContainer::CleanupEpgEvents(const CEpgPtr& epg)
-{
- CSingleLock lock(m_critSection);
- if (epg)
- {
- m_epgScans.erase(epg->EpgID());
- auto events = epg->GetAllEventsWithBroadcastId();
- for (const auto &infoTag : events)
- m_epgEvents.erase(infoTag->UniqueBroadcastID());
- }
-}
diff --git a/xbmc/epg/EpgContainer.h b/xbmc/epg/EpgContainer.h
index 43dc44dc5b..3b5d3a95e2 100644
--- a/xbmc/epg/EpgContainer.h
+++ b/xbmc/epg/EpgContainer.h
@@ -161,10 +161,11 @@ namespace EPG
/*!
* @brief Get the EPG event with the given event id
+ * @param channel The channel to get the event for.
* @param iBroadcastId The event id to get
* @return The requested event, or an empty tag when not found
*/
- virtual CEpgInfoTagPtr GetTagById(unsigned int iBroadcastId) const;
+ virtual CEpgInfoTagPtr GetTagById(const PVR::CPVRChannelPtr &channel, unsigned int iBroadcastId) const;
/*!
* @brief Get an EPG table given a PVR channel.
@@ -292,13 +293,6 @@ namespace EPG
void InsertFromDatabase(int iEpgID, const std::string &strName, const std::string &strScraperName);
- /*!
- * @brief Update map of epg events
- */
- void UpdateEpgEvents();
-
- void CleanupEpgEvents(const CEpgPtr& epg);
-
CEpgDatabase m_database; /*!< the EPG database */
/** @name Configuration */
@@ -330,9 +324,5 @@ namespace EPG
std::list<SUpdateRequest> m_updateRequests; /*!< list of update requests triggered by addon*/
CCriticalSection m_updateRequestsLock; /*!< protect update requests*/
-
- std::map<unsigned int, CEpgInfoTagPtr> m_epgEvents; /*!< map of EPG events by unique broadcast Id*/
- std::map<unsigned int, CDateTime> m_epgScans; /*!< map of last scan time by EPG Id*/
- CDateTime m_lastEpgEventPurge; /*!< when the last purge has been processed*/
};
}
diff --git a/xbmc/epg/EpgDatabase.cpp b/xbmc/epg/EpgDatabase.cpp
index da1ccf6d33..3954160df4 100644
--- a/xbmc/epg/EpgDatabase.cpp
+++ b/xbmc/epg/EpgDatabase.cpp
@@ -235,7 +235,7 @@ int CEpgDatabase::Get(CEpg &epg)
int iBroadcastUID = m_pDS->fv("iBroadcastUid").get_asInt();
// Compat: null value for broadcast uid changed from numerical -1 to 0 with PVR Addon API v4.0.0
- newTag->m_iUniqueBroadcastID = iBroadcastUID == -1 ? PVR_TIMER_NO_EPG_UID : iBroadcastUID;
+ newTag->m_iUniqueBroadcastID = iBroadcastUID == -1 ? EPG_TAG_INVALID_UID : iBroadcastUID;
newTag->m_iBroadcastId = m_pDS->fv("idBroadcast").get_asInt();
newTag->m_strTitle = m_pDS->fv("sTitle").get_asString().c_str();
diff --git a/xbmc/epg/EpgInfoTag.cpp b/xbmc/epg/EpgInfoTag.cpp
index 4ce11ae46f..23ab035cde 100644
--- a/xbmc/epg/EpgInfoTag.cpp
+++ b/xbmc/epg/EpgInfoTag.cpp
@@ -22,6 +22,7 @@
#include "guilib/LocalizeStrings.h"
#include "pvr/PVRManager.h"
#include "pvr/addons/PVRClients.h"
+#include "pvr/timers/PVRTimers.h"
#include "settings/AdvancedSettings.h"
#include "settings/Settings.h"
#include "utils/log.h"
@@ -51,7 +52,7 @@ CEpgInfoTag::CEpgInfoTag(void) :
m_iSeriesNumber(0),
m_iEpisodeNumber(0),
m_iEpisodePart(0),
- m_iUniqueBroadcastID(0),
+ m_iUniqueBroadcastID(EPG_TAG_INVALID_UID),
m_iYear(0),
m_epg(NULL),
m_iFlags(EPG_TAG_FLAG_UNDEFINED)
@@ -68,7 +69,7 @@ CEpgInfoTag::CEpgInfoTag(CEpg *epg, PVR::CPVRChannelPtr pvrChannel, const std::s
m_iSeriesNumber(0),
m_iEpisodeNumber(0),
m_iEpisodePart(0),
- m_iUniqueBroadcastID(0),
+ m_iUniqueBroadcastID(EPG_TAG_INVALID_UID),
m_iYear(0),
m_strIconPath(strIconPath),
m_epg(epg),
@@ -88,7 +89,7 @@ CEpgInfoTag::CEpgInfoTag(const EPG_TAG &data) :
m_iSeriesNumber(0),
m_iEpisodeNumber(0),
m_iEpisodePart(0),
- m_iUniqueBroadcastID(0),
+ m_iUniqueBroadcastID(EPG_TAG_INVALID_UID),
m_epg(NULL)
{
m_startTime = (data.startTime + g_advancedSettings.m_iPVRTimeCorrection);
@@ -712,9 +713,9 @@ const int CEpgInfoTag::EpgID(void) const
return m_epg ? m_epg->EpgID() : -1;
}
-void CEpgInfoTag::SetTimer(CPVRTimerInfoTagPtr timer)
+void CEpgInfoTag::SetTimer(unsigned int iTimerId)
{
- m_timer = timer;
+ m_timer = g_PVRTimers->GetById(iTimerId);
}
void CEpgInfoTag::ClearTimer(void)
diff --git a/xbmc/epg/EpgInfoTag.h b/xbmc/epg/EpgInfoTag.h
index 03dddd8e82..8ddff69d35 100644
--- a/xbmc/epg/EpgInfoTag.h
+++ b/xbmc/epg/EpgInfoTag.h
@@ -50,6 +50,12 @@ namespace EPG
*/
static CEpgInfoTagPtr CreateDefaultTag();
+ /*!
+ * @brief Create a new EPG infotag with 'data' as content.
+ * @param data The tag's content.
+ */
+ CEpgInfoTag(const EPG_TAG &data);
+
private:
/*!
* @brief Create a new empty event.
@@ -61,12 +67,6 @@ namespace EPG
*/
CEpgInfoTag(CEpg *epg, PVR::CPVRChannelPtr pvrChannel, const std::string &strTableName = "", const std::string &strIconPath = "");
- /*!
- * @brief Create a new EPG infotag with 'data' as content.
- * @param data The tag's content.
- */
- CEpgInfoTag(const EPG_TAG &data);
-
// Prevent copy construction, even for CEpgInfoTag instances and friends.
// Note: Only declared, but intentionally not implemented
// to prevent compiler generated copy ctor and to force
@@ -320,10 +320,14 @@ namespace EPG
std::string Path(void) const;
/*!
- * @brief Set a timer for this event or NULL to clear it.
- * @param newTimer The new timer value.
+ * @brief Set a timer for this event.
+ * @param iTimerId The id of the new timer.
+ */
+ void SetTimer(unsigned int iTimerId);
+
+ /*!
+ * @brief Clear the timer for this event.
*/
- void SetTimer(PVR::CPVRTimerInfoTagPtr newTimer);
void ClearTimer(void);
/*!
diff --git a/xbmc/epg/GUIEPGGridContainer.cpp b/xbmc/epg/GUIEPGGridContainer.cpp
index 8f7a70c870..75c8a989af 100644
--- a/xbmc/epg/GUIEPGGridContainer.cpp
+++ b/xbmc/epg/GUIEPGGridContainer.cpp
@@ -47,6 +47,7 @@ using namespace EPG;
#define MINSPERBLOCK 5 /// would be nice to offer zooming of busy schedules /// performance cost to increase resolution 5 fold?
#define BLOCKJUMP 4 // how many blocks are jumped with each analogue scroll action
#define BLOCK_SCROLL_OFFSET 60 / MINSPERBLOCK // how many blocks are jumped if we are at left/right edge of grid
+static const int PAGE_NOW_OFFSET = 30 / MINSPERBLOCK;
CGUIEPGGridContainer::CGUIEPGGridContainer(int parentID, int controlID, float posX, float posY, float width,
float height, int scrollTime, int preloadItems, int timeBlocks, int rulerUnit,
@@ -841,8 +842,51 @@ void CGUIEPGGridContainer::UpdateItems(CFileItemList *items)
CSingleLock lock(m_critSection);
- /* Safe currently selected epg tag. Selection shall be restored after update. */
+ /* Safe currently selected epg tag and grid coordinates. Selection shall be restored after update. */
const CEpgInfoTagPtr prevSelectedEpgTag(GetSelectedEpgInfoTag());
+ const int oldChannelIndex = m_channelOffset + m_channelCursor;
+ const int oldBlockIndex = m_blockOffset + m_blockCursor;
+ int eventOffset = oldBlockIndex;
+ int newChannelIndex = oldChannelIndex;
+ int newBlockIndex = oldBlockIndex;
+ int channelUid = -1;
+ unsigned int broadcastUid = 0;
+
+ if (prevSelectedEpgTag)
+ {
+ // get the block offset relative to the first block of the selected event
+ while (eventOffset > 0)
+ {
+ if (m_gridIndex[oldChannelIndex][eventOffset - 1].item !=
+ m_gridIndex[oldChannelIndex][oldBlockIndex].item)
+ break;
+
+ eventOffset--;
+ }
+
+ eventOffset = oldBlockIndex - eventOffset;
+
+ if (prevSelectedEpgTag->StartAsUTC().IsValid()) // "normal" tag selected
+ {
+ newBlockIndex = (prevSelectedEpgTag->StartAsUTC() - m_gridStart).GetSecondsTotal() / 60 / MINSPERBLOCK + eventOffset;
+ channelUid = prevSelectedEpgTag->ChannelTag()->UniqueID();
+ broadcastUid = prevSelectedEpgTag->UniqueBroadcastID();
+ }
+ else // "gap" tag seleceted
+ {
+ const GridItemsPtr *prevItem(GetPrevItem(m_channelCursor));
+ if (prevItem)
+ {
+ const CEpgInfoTagPtr tag(prevItem->item->GetEPGInfoTag());
+ if (tag && tag->EndAsUTC().IsValid())
+ {
+ newBlockIndex = (tag->EndAsUTC() - m_gridStart).GetSecondsTotal() / 60 / MINSPERBLOCK + eventOffset;
+ channelUid = tag->ChannelTag()->UniqueID();
+ broadcastUid = tag->UniqueBroadcastID();
+ }
+ }
+ }
+ }
Reset();
@@ -930,6 +974,8 @@ void CGUIEPGGridContainer::UpdateItems(CFileItemList *items)
blockDuration.SetDateTimeSpan(0, 0, MINSPERBLOCK, 0);
long tick(XbmcThreads::SystemClockMillis());
+ bool bFoundPrevTag = false;
+ bool bFoundPrevChannel = false;
for (unsigned int row = 0; row < m_epgItemsPtr.size(); ++row)
{
@@ -959,6 +1005,21 @@ void CGUIEPGGridContainer::UpdateItems(CFileItemList *items)
if (gridCursor < tag->EndAsUTC())
{
m_gridIndex[row][block].item = item;
+
+ if (prevSelectedEpgTag)
+ {
+ if (!bFoundPrevTag && broadcastUid > 0 && tag->UniqueBroadcastID() == broadcastUid)
+ {
+ bFoundPrevTag = true;
+ newChannelIndex = row;
+ newBlockIndex = block + eventOffset;
+ }
+ if (!bFoundPrevTag && !bFoundPrevChannel && channelUid > -1 && tag->ChannelTag()->UniqueID() == channelUid)
+ {
+ bFoundPrevChannel = true;
+ newChannelIndex = row;
+ }
+ }
break;
}
@@ -1019,62 +1080,32 @@ void CGUIEPGGridContainer::UpdateItems(CFileItemList *items)
if (prevSelectedEpgTag)
{
- // Grid index got recreated. Do cursors and offsets still point to the same epg tag?
- if (prevSelectedEpgTag == GetSelectedEpgInfoTag())
+ // restore previous selection.
+ if (newChannelIndex == oldChannelIndex && newBlockIndex == oldBlockIndex)
{
+ // same coordinates, keep current grid view port
m_item = GetItem(m_channelCursor);
- return;
}
-
- int newChannelCursor = GetChannel(prevSelectedEpgTag);
- if (newChannelCursor >= 0)
+ else
{
- int newBlockCursor = GetBlock(prevSelectedEpgTag, newChannelCursor);
- if (newBlockCursor >= 0)
- {
- if (newChannelCursor == m_channelCursor && newBlockCursor == m_blockCursor)
- {
- m_item = GetItem(m_channelCursor);
- return;
- }
+ // new coordinates, move grid view port accordingly
+ SetInvalid();
- if (newBlockCursor > 0 && newBlockCursor != m_blockCursor)
- {
- SetInvalid();
- SetSelectedBlock(newBlockCursor);
- }
-
- if (newChannelCursor != m_channelCursor)
- {
- SetInvalid();
- SetSelectedChannel(newChannelCursor);
- }
+ if (newBlockIndex != oldBlockIndex)
+ GoToBlock(newBlockIndex);
- if (newBlockCursor > 0)
- {
- // Note: m_item guaranteed to be set here.
- return;
- }
- }
+ if (newChannelIndex != oldChannelIndex)
+ GoToChannel(newChannelIndex);
}
}
+ else
+ {
+ // no previous selection, goto now
+ m_item = GetItem(m_channelCursor);
- // Fallback. Goto now.
-
- if (m_channelCursor + m_channelOffset < 0 ||
- m_channelCursor + m_channelOffset >= m_channels)
- m_channelCursor = m_channelOffset = 0;
-
- if (m_blockCursor + m_blockOffset < 0 ||
- m_blockCursor + m_blockOffset >= m_blocks)
- m_blockCursor = m_blockOffset = 0;
-
- m_item = GetItem(m_channelCursor);
- if (m_item)
- SetBlock(GetBlock(m_item->item, m_channelCursor));
-
- SetInvalid();
- GoToNow();
+ SetInvalid();
+ GoToNow();
+ }
}
void CGUIEPGGridContainer::ChannelScroll(int amount)
@@ -1201,43 +1232,37 @@ void CGUIEPGGridContainer::OnRight()
void CGUIEPGGridContainer::SetChannel(const std::string &channel)
{
- int iChannelIndex(-1);
for (unsigned int iIndex = 0; iIndex < m_channelItems.size(); iIndex++)
{
std::string strPath = m_channelItems[iIndex]->GetProperty("path").asString();
if (strPath == channel)
{
- iChannelIndex = iIndex;
+ GoToChannel(iIndex);
break;
}
}
-
- SetSelectedChannel(iChannelIndex);
}
void CGUIEPGGridContainer::SetChannel(const CPVRChannelPtr &channel)
{
assert(channel.get());
- int iChannelIndex(-1);
for (unsigned int iIndex = 0; iIndex < m_channelItems.size(); iIndex++)
{
int iChannelId = (int)m_channelItems[iIndex]->GetProperty("channelid").asInteger(-1);
if (iChannelId == channel->ChannelID())
{
- iChannelIndex = iIndex;
+ GoToChannel(iIndex);
break;
}
}
-
- SetSelectedChannel(iChannelIndex);
}
-void CGUIEPGGridContainer::SetChannel(int channel)
+void CGUIEPGGridContainer::SetChannel(int channel, bool bFindClosestItem /* = true */)
{
CSingleLock lock(m_critSection);
- if (m_blockCursor + m_blockOffset == 0 || m_blockOffset + m_blockCursor + GetItemSize(m_item) == m_blocks)
+ if (!bFindClosestItem || m_blockCursor + m_blockOffset == 0 || m_blockOffset + m_blockCursor + GetItemSize(m_item) == m_blocks)
{
m_item = GetItem(channel);
if (m_item)
@@ -1429,58 +1454,6 @@ CPVRChannelPtr CGUIEPGGridContainer::GetChannel(int iIndex)
return CPVRChannelPtr();
}
-void CGUIEPGGridContainer::SetSelectedChannel(int channelIndex)
-{
- if (channelIndex < 0)
- return;
-
- if (channelIndex - m_channelOffset <= 0)
- {
- ScrollToChannelOffset(0);
- SetChannel(channelIndex);
- }
- else if (channelIndex - m_channelOffset < m_channelsPerPage && channelIndex - m_channelOffset >= 0)
- {
- SetChannel(channelIndex - m_channelOffset);
- }
- else if(channelIndex < m_channels - m_channelsPerPage)
- {
- ScrollToChannelOffset(channelIndex - m_channelsPerPage + 1);
- SetChannel(m_channelsPerPage - 1);
- }
- else
- {
- ScrollToChannelOffset(m_channels - m_channelsPerPage);
- SetChannel(channelIndex - (m_channels - m_channelsPerPage));
- }
-}
-
-void CGUIEPGGridContainer::SetSelectedBlock(int blockIndex)
-{
- if (blockIndex < 0)
- return;
-
- if (blockIndex - m_blockOffset <= 0)
- {
- ScrollToBlockOffset(0);
- SetBlock(blockIndex);
- }
- else if (blockIndex - m_blockOffset < m_blocksPerPage && blockIndex - m_blockOffset >= 0)
- {
- SetBlock(blockIndex - m_blockOffset);
- }
- else if(blockIndex < m_blocks - m_blocksPerPage)
- {
- ScrollToBlockOffset(blockIndex - m_blocksPerPage + 1);
- SetBlock(m_blocksPerPage - 1);
- }
- else
- {
- ScrollToBlockOffset(m_blocks - m_blocksPerPage);
- SetBlock(blockIndex - (m_blocks - m_blocksPerPage));
- }
-}
-
int CGUIEPGGridContainer::GetSelectedItem() const
{
if (m_gridIndex.empty() ||
@@ -1536,50 +1509,6 @@ CEpgInfoTagPtr CGUIEPGGridContainer::GetSelectedEpgInfoTag() const
return tag;
}
-int CGUIEPGGridContainer::GetBlock(const CEpgInfoTagPtr &tag, int channel) const
-{
- for (int block = 0; block < m_blocks; ++block)
- {
- CFileItemPtr item = m_gridIndex[channel + m_channelOffset][block].item;
- if (item)
- {
- CEpgInfoTagPtr currentTag(item->GetEPGInfoTag());
- if (currentTag == tag)
- return (block - m_blockOffset >= 0) ? block - m_blockOffset : 0;
- }
- }
-
- return -1;
-}
-
-int CGUIEPGGridContainer::GetChannel(const CEpgInfoTagPtr &tag) const
-{
- if (tag->HasPVRChannel())
- {
- int channelId = tag->ChannelTag()->ChannelID();
- for (int row = 0; row < m_channels; ++row)
- {
- for (int block = 0; block < m_blocks; ++block)
- {
- CFileItemPtr item = m_gridIndex[row][block].item;
- if (item)
- {
- CEpgInfoTagPtr currentTag(item->GetEPGInfoTag());
- if (currentTag->HasPVRChannel()) // Take care. Gap tags have no channel.
- {
- if (currentTag->ChannelTag()->ChannelID() == channelId)
- return (row - m_channelOffset >= 0) ? row - m_channelOffset : 0;
- else
- break;
- }
- }
- }
- }
- }
-
- return -1;
-}
-
CGUIListItemPtr CGUIEPGGridContainer::GetListItem(int offset, unsigned int flag) const
{
if (m_channelItems.empty())
@@ -1946,36 +1875,10 @@ void CGUIEPGGridContainer::GoToEnd()
void CGUIEPGGridContainer::GoToNow()
{
- if (!m_gridStart.IsValid())
- return;
-
CDateTime currentDate = CDateTime::GetCurrentDateTime().GetAsUTCDateTime();
- int offset = ((currentDate - m_gridStart).GetSecondsTotal() / 60 - 30) / MINSPERBLOCK;
+ int offset = (currentDate - m_gridStart).GetSecondsTotal() / 60 / MINSPERBLOCK - PAGE_NOW_OFFSET;
ScrollToBlockOffset(offset);
-
- if (m_channelCursor + m_channelOffset >= 0 &&
- m_channelCursor + m_channelOffset < m_channels)
- {
- // make sure offset is in valid range
- offset = std::max(0, std::min(offset, m_blocks - m_blocksPerPage));
-
- for (int blockIndex = 0; blockIndex < m_blocksPerPage; blockIndex++)
- {
- if (offset + blockIndex >= m_blocks)
- break;
-
- const CFileItemPtr item = m_gridIndex[m_channelCursor + m_channelOffset][offset + blockIndex].item;
- if (item)
- {
- const CEpgInfoTagPtr tag = item->GetEPGInfoTag();
- if (tag && tag->StartAsUTC() <= currentDate && tag->EndAsUTC() > currentDate)
- {
- SetBlock(blockIndex); // Select currently active epg element
- break;
- }
- }
- }
- }
+ SetBlock(PAGE_NOW_OFFSET);
}
void CGUIEPGGridContainer::SetStartEnd(CDateTime start, CDateTime end)
@@ -1987,6 +1890,34 @@ void CGUIEPGGridContainer::SetStartEnd(CDateTime start, CDateTime end)
__FUNCTION__, m_gridStart.GetAsLocalizedDateTime(false, true).c_str(), m_gridEnd.GetAsLocalizedDateTime(false, true).c_str());
}
+void CGUIEPGGridContainer::GoToChannel(int channelIndex)
+{
+ if (channelIndex > m_channels - m_channelsPerPage)
+ {
+ ScrollToChannelOffset(m_channels - m_channelsPerPage);
+ SetChannel(channelIndex - (m_channels - m_channelsPerPage), false);
+ }
+ else
+ {
+ ScrollToChannelOffset(channelIndex - m_channelCursor);
+ SetChannel(m_channelCursor, false);
+ }
+}
+
+void CGUIEPGGridContainer::GoToBlock(int blockIndex)
+{
+ if (blockIndex > m_blocks - m_blocksPerPage)
+ {
+ ScrollToBlockOffset(m_blocks - m_blocksPerPage);
+ SetBlock(blockIndex - (m_blocks - m_blocksPerPage));
+ }
+ else
+ {
+ ScrollToBlockOffset(blockIndex - m_blockCursor);
+ SetBlock(m_blockCursor);
+ }
+}
+
void CGUIEPGGridContainer::UpdateLayout()
{
CGUIListItemLayout *oldFocusedChannelLayout = m_focusedChannelLayout;
diff --git a/xbmc/epg/GUIEPGGridContainer.h b/xbmc/epg/GUIEPGGridContainer.h
index 962dbfff3b..86d36def4b 100644
--- a/xbmc/epg/GUIEPGGridContainer.h
+++ b/xbmc/epg/GUIEPGGridContainer.h
@@ -66,10 +66,8 @@ namespace EPG
const int GetNumChannels() { return m_channels; };
virtual int GetSelectedItem() const;
const int GetSelectedChannel() const;
- void SetSelectedChannel(int channelIndex);
CFileItemPtr GetSelectedChannelItem() const;
PVR::CPVRChannelPtr GetChannel(int iIndex);
- void SetSelectedBlock(int blockIndex);
virtual EVENT_RESULT OnMouseEvent(const CPoint &point, const CMouseEvent &event);
virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions);
@@ -100,7 +98,7 @@ namespace EPG
bool OnClick(int actionID);
bool SelectItemFromPoint(const CPoint &point, bool justGrid = true);
- void SetChannel(int channel);
+ void SetChannel(int channel, bool bFindClosestItem = true);
void SetBlock(int block);
void ChannelScroll(int amount);
void ProgrammesScroll(int amount);
@@ -123,6 +121,8 @@ namespace EPG
void ScrollToBlockOffset(int offset);
void ScrollToChannelOffset(int offset);
+ void GoToBlock(int blockIndex);
+ void GoToChannel(int channelIndex);
void UpdateScrollOffset(unsigned int currentTime);
void ProcessItem(float posX, float posY, CGUIListItem *item, CGUIListItem *&lastitem, bool focused, CGUIListItemLayout* normallayout, CGUIListItemLayout* focusedlayout, unsigned int currentTime, CDirtyRegionList &dirtyregions, float resize = -1.0f);
void RenderItem(float posX, float posY, CGUIListItem *item, bool focused);
@@ -177,8 +177,6 @@ namespace EPG
void UpdateItems(CFileItemList *items);
EPG::CEpgInfoTagPtr GetSelectedEpgInfoTag() const;
- int GetBlock(const EPG::CEpgInfoTagPtr &tag, int channel) const;
- int GetChannel(const EPG::CEpgInfoTagPtr &tag) const;
int m_rulerUnit; //! number of blocks that makes up one element of the ruler
int m_channels;
diff --git a/xbmc/filesystem/AddonsDirectory.cpp b/xbmc/filesystem/AddonsDirectory.cpp
index f252a46ecd..8b8f00fac5 100644
--- a/xbmc/filesystem/AddonsDirectory.cpp
+++ b/xbmc/filesystem/AddonsDirectory.cpp
@@ -325,8 +325,8 @@ static bool Browse(const CURL& path, CFileItemList &items)
if (repo == "all")
{
CAddonDatabase database;
- database.Open();
- database.GetAddons(addons);
+ if (!database.Open() || !database.GetRepositoryContent(addons))
+ return false;
items.SetProperty("reponame", g_localizeStrings.Get(24087));
items.SetLabel(g_localizeStrings.Get(24087));
}
@@ -501,13 +501,13 @@ void CAddonsDirectory::GenerateAddonListing(const CURL &path,
if (installed)
pItem->SetProperty("Addon.Status", g_localizeStrings.Get(305));
if (disabled)
- pItem->SetProperty("Addon.Status",g_localizeStrings.Get(24023));
+ pItem->SetProperty("Addon.Status", g_localizeStrings.Get(24023));
+ if (hasUpdate)
+ pItem->SetProperty("Addon.Status", g_localizeStrings.Get(24068));
if (addon->Broken() == "DEPSNOTMET")
- pItem->SetProperty("Addon.Status",g_localizeStrings.Get(24049));
+ pItem->SetProperty("Addon.Status", g_localizeStrings.Get(24049));
else if (!addon->Broken().empty())
- pItem->SetProperty("Addon.Status",g_localizeStrings.Get(24098));
- if (hasUpdate)
- pItem->SetProperty("Addon.Status",g_localizeStrings.Get(24068));
+ pItem->SetProperty("Addon.Status", g_localizeStrings.Get(24098));
items.Add(pItem);
}
@@ -528,7 +528,6 @@ CFileItemPtr CAddonsDirectory::FileItemFromAddon(const AddonPtr &addon,
strLabel = StringUtils::Format("%s - %s", TranslateType(addon->Type(), true).c_str(), addon->Name().c_str());
item->SetLabel(strLabel);
item->SetArt("thumb", addon->Icon());
- item->SetLabelPreformated(true);
item->SetIconImage("DefaultAddon.png");
if (URIUtils::IsInternetStream(addon->FanArt()) || CFile::Exists(addon->FanArt()))
item->SetArt("fanart", addon->FanArt());
diff --git a/xbmc/filesystem/ImageFile.cpp b/xbmc/filesystem/ImageFile.cpp
index e3a4a7b637..56de970c21 100644
--- a/xbmc/filesystem/ImageFile.cpp
+++ b/xbmc/filesystem/ImageFile.cpp
@@ -37,7 +37,7 @@ bool CImageFile::Open(const CURL& url)
{
std::string file = url.Get();
bool needsRecaching = false;
- std::string cachedFile = CTextureCache::GetInstance().CheckCachedImage(file, false, needsRecaching);
+ std::string cachedFile = CTextureCache::GetInstance().CheckCachedImage(file, needsRecaching);
if (cachedFile.empty())
{ // not in the cache, so cache it
cachedFile = CTextureCache::GetInstance().CacheImage(file);
@@ -53,7 +53,7 @@ bool CImageFile::Open(const CURL& url)
bool CImageFile::Exists(const CURL& url)
{
bool needsRecaching = false;
- std::string cachedFile = CTextureCache::GetInstance().CheckCachedImage(url.Get(), false, needsRecaching);
+ std::string cachedFile = CTextureCache::GetInstance().CheckCachedImage(url.Get(), needsRecaching);
if (!cachedFile.empty())
return CFile::Exists(cachedFile, false);
@@ -67,7 +67,7 @@ bool CImageFile::Exists(const CURL& url)
int CImageFile::Stat(const CURL& url, struct __stat64* buffer)
{
bool needsRecaching = false;
- std::string cachedFile = CTextureCache::GetInstance().CheckCachedImage(url.Get(), false, needsRecaching);
+ std::string cachedFile = CTextureCache::GetInstance().CheckCachedImage(url.Get(), needsRecaching);
if (!cachedFile.empty())
return CFile::Stat(cachedFile, buffer);
diff --git a/xbmc/filesystem/SpecialProtocol.cpp b/xbmc/filesystem/SpecialProtocol.cpp
index a40879f1a8..80b2581b87 100644
--- a/xbmc/filesystem/SpecialProtocol.cpp
+++ b/xbmc/filesystem/SpecialProtocol.cpp
@@ -34,8 +34,6 @@
#include "utils/StringUtils.h"
#endif
-std::map<std::string, std::string> CSpecialProtocol::m_pathMap;
-
void CSpecialProtocol::SetProfilePath(const std::string &dir)
{
SetPath("profile", dir);
diff --git a/xbmc/guiinfo/GUIInfoLabels.h b/xbmc/guiinfo/GUIInfoLabels.h
index e7fbae1b36..5e309fed56 100644
--- a/xbmc/guiinfo/GUIInfoLabels.h
+++ b/xbmc/guiinfo/GUIInfoLabels.h
@@ -469,9 +469,6 @@
#define PVR_ACTUAL_STREAM_SNR_PROGR (PVR_STRINGS_START + 28)
#define PVR_ACTUAL_STREAM_BER (PVR_STRINGS_START + 29)
#define PVR_ACTUAL_STREAM_UNC (PVR_STRINGS_START + 30)
-#define PVR_ACTUAL_STREAM_VIDEO_BR (PVR_STRINGS_START + 31)
-#define PVR_ACTUAL_STREAM_AUDIO_BR (PVR_STRINGS_START + 32)
-#define PVR_ACTUAL_STREAM_DOLBY_BR (PVR_STRINGS_START + 33)
#define PVR_ACTUAL_STREAM_CRYPTION (PVR_STRINGS_START + 34)
#define PVR_ACTUAL_STREAM_SERVICE (PVR_STRINGS_START + 35)
#define PVR_ACTUAL_STREAM_MUX (PVR_STRINGS_START + 36)
@@ -557,6 +554,7 @@
#define WINDOW_PREVIOUS 9997
#define WINDOW_IS_MEDIA 9998
#define WINDOW_IS_ACTIVE 9999
+#define WINDOW_IS 10000
#define CONTROL_GET_LABEL 29996
#define CONTROL_IS_ENABLED 29997
diff --git a/xbmc/guilib/DDSImage.cpp b/xbmc/guilib/DDSImage.cpp
index c2fd215029..1952c76a12 100644
--- a/xbmc/guilib/DDSImage.cpp
+++ b/xbmc/guilib/DDSImage.cpp
@@ -21,7 +21,6 @@
#include <algorithm>
#include "DDSImage.h"
#include "XBTF.h"
-#include <squish.h>
#include "utils/log.h"
#include <string.h>
@@ -116,33 +115,6 @@ bool CDDSImage::ReadFile(const std::string &inputFile)
return true;
}
-bool CDDSImage::Create(const std::string &outputFile, unsigned int width, unsigned int height, unsigned int pitch, unsigned char const *brga, double maxMSE)
-{
- if (!brga)
- return false;
- if (!Compress(width, height, pitch, brga, maxMSE))
- { // use ARGB
- Allocate(width, height, XB_FMT_A8R8G8B8);
- for (unsigned int i = 0; i < height; i++)
- memcpy(m_data + i * width * 4, brga + i * pitch, std::min(width * 4, pitch));
- }
- return WriteFile(outputFile);
-}
-
-bool CDDSImage::WriteFile(const std::string &outputFile) const
-{
- // open the file
- CFile file;
- if (!file.OpenForWrite(outputFile, true))
- return false;
-
- // write the header
- return file.Write("DDS ", 4) == 4 &&
- file.Write(&m_desc, sizeof(m_desc)) == sizeof(m_desc) &&
- // now the data
- file.Write(m_data, m_desc.linearSize) == m_desc.linearSize;
-}
-
unsigned int CDDSImage::GetStorageRequirements(unsigned int width, unsigned int height, unsigned int format)
{
switch (format)
@@ -158,79 +130,6 @@ unsigned int CDDSImage::GetStorageRequirements(unsigned int width, unsigned int
}
}
-bool CDDSImage::Compress(unsigned int width, unsigned int height, unsigned int pitch, unsigned char const *brga, double maxMSE)
-{
- // first try DXT1, which is only 4bits/pixel
- Allocate(width, height, XB_FMT_DXT1);
-
- squish::CompressImage(brga, width, height, pitch, m_data, squish::kDxt1 | squish::kSourceBGRA);
- const char *fourCC = NULL;
-
- double colorMSE, alphaMSE;
- squish::ComputeMSE(brga, width, height, pitch, m_data, squish::kDxt1 | squish::kSourceBGRA, colorMSE, alphaMSE);
- if (!maxMSE || (colorMSE < maxMSE && alphaMSE < maxMSE))
- fourCC = "DXT1";
- else
- {
- if (alphaMSE == 0)
- { // no alpha channel, so DXT5YCoCg is going to be the best DXT5 format
- /* squish::CompressImage(brga, width, height, pitch, data2, squish::kDxt5 | squish::kSourceBGRA);
- squish::ComputeMSE(brga, width, height, pitch, m_data, squish::kDxt5 | squish::kSourceBGRA, colorMSE, alphaMSE);
- if (colorMSE < maxMSE && alphaMSE < maxMSE)
- { // success - use it
- compressedSize = squish::GetStorageRequirements(width, height, squish::kDxt5);
- format = XB_FMT_DXT5_YCoCg;
- }
- */
- }
- if (alphaMSE > 0)
- { // try DXT3 and DXT5 - use whichever is better (color is the same as DXT1, but alpha will be different)
- Allocate(width, height, XB_FMT_DXT3);
- squish::CompressImage(brga, width, height, pitch, m_data, squish::kDxt3 | squish::kSourceBGRA);
- squish::ComputeMSE(brga, width, height, pitch, m_data, squish::kDxt3 | squish::kSourceBGRA, colorMSE, alphaMSE);
- if (colorMSE < maxMSE)
- { // color is fine, test DXT5 as well
- double dxt5MSE;
- unsigned char *data2 = new unsigned char[GetStorageRequirements(width, height, XB_FMT_DXT5)];
- squish::CompressImage(brga, width, height, pitch, data2, squish::kDxt5 | squish::kSourceBGRA);
- squish::ComputeMSE(brga, width, height, pitch, data2, squish::kDxt5 | squish::kSourceBGRA, colorMSE, dxt5MSE);
- if (alphaMSE < maxMSE && alphaMSE < dxt5MSE)
- fourCC = "DXT3";
- else if (dxt5MSE < maxMSE)
- { // DXT5 passes
- fourCC = "DXT5";
- std::swap(m_data, data2);
- alphaMSE = dxt5MSE;
- }
- delete[] data2;
- }
- }
- }
- if (fourCC)
- {
- memcpy(&m_desc.pixelFormat.fourcc, fourCC, 4);
- CLog::Log(LOGDEBUG, "%s - using %s (min error is: %2.2f:%2.2f)", __FUNCTION__, fourCC, colorMSE, alphaMSE);
- return true;
- }
- CLog::Log(LOGDEBUG, "%s - no format suitable (min error is: %2.2f:%2.2f)", __FUNCTION__, colorMSE, alphaMSE);
- return false;
-}
-
-bool CDDSImage::Decompress(unsigned char *argb, unsigned int width, unsigned int height, unsigned int pitch, unsigned char const *dxt, unsigned int format)
-{
- if (!argb || !dxt || !(format & XB_FMT_DXT_MASK))
- return false;
-
- if (format == XB_FMT_DXT1)
- squish::DecompressImage(argb, width, height, pitch, dxt, squish::kDxt1 | squish::kSourceBGRA);
- else if (format == XB_FMT_DXT3)
- squish::DecompressImage(argb, width, height, pitch, dxt, squish::kDxt3 | squish::kSourceBGRA);
- else if (format == XB_FMT_DXT5)
- squish::DecompressImage(argb, width, height, pitch, dxt, squish::kDxt5 | squish::kSourceBGRA);
-
- return true;
-}
-
void CDDSImage::Allocate(unsigned int width, unsigned int height, unsigned int format)
{
memset(&m_desc, 0, sizeof(m_desc));
diff --git a/xbmc/guilib/DDSImage.h b/xbmc/guilib/DDSImage.h
index 3856ebe843..8499db310b 100644
--- a/xbmc/guilib/DDSImage.h
+++ b/xbmc/guilib/DDSImage.h
@@ -38,43 +38,9 @@ public:
bool ReadFile(const std::string &file);
- /*! \brief Create a DDS image file from the given an ARGB buffer
- \param file name of the file to write
- \param width width of the pixel buffer
- \param height height of the pixel buffer
- \param pitch pitch of the pixel buffer
- \param argb pixel buffer
- \param maxMSE maximum mean square error to allow, ignored if 0 (the default)
- \return true on successful image creation, false otherwise
- */
- bool Create(const std::string &file, unsigned int width, unsigned int height, unsigned int pitch, unsigned char const *argb, double maxMSE = 0);
-
- /*! \brief Decompress a DXT1/3/5 image to the given buffer
- Assumes the buffer has been allocated to at least width*height*4
- \param argb pixel buffer to write to (at least width*height*4 bytes)
- \param width width of the pixel buffer
- \param height height of the pixel buffer
- \param pitch pitch of the pixel buffer
- \param dxt compressed dxt data
- \param format format of the compressed dxt data
- \return true on success, false otherwise
- */
- static bool Decompress(unsigned char *argb, unsigned int width, unsigned int height, unsigned int pitch, unsigned char const *dxt, unsigned int format);
-
private:
void Allocate(unsigned int width, unsigned int height, unsigned int format);
static const char *GetFourCC(unsigned int format);
- bool WriteFile(const std::string &file) const;
-
- /*! \brief Compress an ARGB buffer into a DXT1/3/5 image
- \param width width of the pixel buffer
- \param height height of the pixel buffer
- \param pitch pitch of the pixel buffer
- \param argb pixel buffer
- \param maxMSE maximum mean square error to allow, ignored if 0 (the default)
- \return true on successful compression within the given maxMSE, false otherwise
- */
- bool Compress(unsigned int width, unsigned int height, unsigned int pitch, unsigned char const *argb, double maxMSE = 0);
static unsigned int GetStorageRequirements(unsigned int width, unsigned int height, unsigned int format);
enum {
diff --git a/xbmc/guilib/Texture.cpp b/xbmc/guilib/Texture.cpp
index 6547502a1b..d84d1ef831 100644
--- a/xbmc/guilib/Texture.cpp
+++ b/xbmc/guilib/Texture.cpp
@@ -111,32 +111,27 @@ void CBaseTexture::Update(unsigned int width, unsigned int height, unsigned int
if (pixels == NULL)
return;
- if (format & XB_FMT_DXT_MASK && !g_Windowing.SupportsDXT())
- { // 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);
- }
- else
- {
- Allocate(width, height, format);
+ if (format & XB_FMT_DXT_MASK)
+ return;
+
+ Allocate(width, height, format);
- unsigned int srcPitch = pitch ? pitch : GetPitch(width);
- unsigned int srcRows = GetRows(height);
- unsigned int dstPitch = GetPitch(m_textureWidth);
- unsigned int dstRows = GetRows(m_textureHeight);
+ unsigned int srcPitch = pitch ? pitch : GetPitch(width);
+ unsigned int srcRows = GetRows(height);
+ unsigned int dstPitch = GetPitch(m_textureWidth);
+ unsigned int dstRows = GetRows(m_textureHeight);
- if (srcPitch == dstPitch)
- memcpy(m_pixels, pixels, srcPitch * std::min(srcRows, dstRows));
- else
+ if (srcPitch == dstPitch)
+ memcpy(m_pixels, pixels, srcPitch * std::min(srcRows, dstRows));
+ else
+ {
+ const unsigned char *src = pixels;
+ unsigned char* dst = m_pixels;
+ for (unsigned int y = 0; y < srcRows && y < dstRows; y++)
{
- const unsigned char *src = pixels;
- unsigned char* dst = m_pixels;
- for (unsigned int y = 0; y < srcRows && y < dstRows; y++)
- {
- memcpy(dst, src, std::min(srcPitch, dstPitch));
- src += srcPitch;
- dst += dstPitch;
- }
+ memcpy(dst, src, std::min(srcPitch, dstPitch));
+ src += srcPitch;
+ dst += dstPitch;
}
}
ClampToEdge();
diff --git a/xbmc/guilib/TextureBundleXBT.cpp b/xbmc/guilib/TextureBundleXBT.cpp
index 8a8f0308db..4c06ed3dd5 100644
--- a/xbmc/guilib/TextureBundleXBT.cpp
+++ b/xbmc/guilib/TextureBundleXBT.cpp
@@ -18,7 +18,6 @@
*
*/
-#include "squish.h"
#include "system.h"
#include "TextureBundleXBT.h"
#include "Texture.h"
@@ -192,7 +191,7 @@ int CTextureBundleXBT::LoadAnim(const std::string& Filename, CBaseTexture*** ppT
bool CTextureBundleXBT::ConvertFrameToTexture(const std::string& name, CXBTFFrame& frame, CBaseTexture** ppTexture)
{
// found texture - allocate the necessary buffers
- squish::u8 *buffer = new squish::u8[(size_t)frame.GetPackedSize()];
+ unsigned char *buffer = new unsigned char [(size_t)frame.GetPackedSize()];
if (buffer == NULL)
{
CLog::Log(LOGERROR, "Out of memory loading texture: %s (need %" PRIu64" bytes)", name.c_str(), frame.GetPackedSize());
@@ -210,7 +209,7 @@ bool CTextureBundleXBT::ConvertFrameToTexture(const std::string& name, CXBTFFram
// check if it's packed with lzo
if (frame.IsPacked())
{ // unpack
- squish::u8 *unpacked = new squish::u8[(size_t)frame.GetUnpackedSize()];
+ unsigned char *unpacked = new unsigned char[(size_t)frame.GetUnpackedSize()];
if (unpacked == NULL)
{
CLog::Log(LOGERROR, "Out of memory unpacking texture: %s (need %" PRIu64" bytes)", name.c_str(), frame.GetUnpackedSize());
diff --git a/xbmc/input/CMakeLists.txt b/xbmc/input/CMakeLists.txt
index 479503f1c7..29e84f9098 100644
--- a/xbmc/input/CMakeLists.txt
+++ b/xbmc/input/CMakeLists.txt
@@ -38,3 +38,7 @@ if(SDL_FOUND)
endif()
core_add_library(input)
+
+if(ENABLE_INTERNAL_FFMPEG)
+ add_dependencies(input ffmpeg)
+endif()
diff --git a/xbmc/interfaces/builtins/AddonBuiltins.cpp b/xbmc/interfaces/builtins/AddonBuiltins.cpp
index 41d9974651..4f7b33c705 100644
--- a/xbmc/interfaces/builtins/AddonBuiltins.cpp
+++ b/xbmc/interfaces/builtins/AddonBuiltins.cpp
@@ -302,7 +302,7 @@ static int UpdateRepos(const std::vector<std::string>& params)
*/
static int UpdateLocals(const std::vector<std::string>& params)
{
- CAddonMgr::GetInstance().FindAddons();
+ CAddonMgr::GetInstance().FindAddonsAndNotify();
return 0;
}
diff --git a/xbmc/interfaces/builtins/CMakeLists.txt b/xbmc/interfaces/builtins/CMakeLists.txt
index 94de256f9e..4983338910 100644
--- a/xbmc/interfaces/builtins/CMakeLists.txt
+++ b/xbmc/interfaces/builtins/CMakeLists.txt
@@ -35,3 +35,7 @@ set(HEADERS AddonBuiltins.h
core_add_library(interfaces_builtins)
add_dependencies(interfaces_builtins libcpluff)
+
+if(ENABLE_INTERNAL_FFMPEG)
+ add_dependencies(interfaces_builtins ffmpeg)
+endif()
diff --git a/xbmc/interfaces/json-rpc/AddonsOperations.cpp b/xbmc/interfaces/json-rpc/AddonsOperations.cpp
index 86b8a2633b..1d228fc894 100644
--- a/xbmc/interfaces/json-rpc/AddonsOperations.cpp
+++ b/xbmc/interfaces/json-rpc/AddonsOperations.cpp
@@ -234,7 +234,7 @@ void CAddonsOperations::FillDetails(AddonPtr addon, const CVariant& fields, CVar
// We need to check the existence of fanart and thumbnails as the addon simply
// holds where the art will be, not whether it exists.
bool needsRecaching;
- std::string image = CTextureCache::GetInstance().CheckCachedImage(url, false, needsRecaching);
+ std::string image = CTextureCache::GetInstance().CheckCachedImage(url, needsRecaching);
if (!image.empty() || CFile::Exists(url))
object[field] = CTextureUtils::GetWrappedImageURL(url);
else
diff --git a/xbmc/interfaces/json-rpc/AudioLibrary.cpp b/xbmc/interfaces/json-rpc/AudioLibrary.cpp
index b6d9aab777..ee82abe796 100644
--- a/xbmc/interfaces/json-rpc/AudioLibrary.cpp
+++ b/xbmc/interfaces/json-rpc/AudioLibrary.cpp
@@ -272,8 +272,22 @@ JSONRPC_STATUS CAudioLibrary::GetSongs(const std::string &method, ITransportLaye
if (!ParseSorting(parameterObject, sorting.sortBy, sorting.sortOrder, sorting.sortAttributes))
return InvalidParams;
+ // Check if any properties from songartistview wanted, only then query artist data for songs
+ // "displayArtist" is held in songview
+ std::set<std::string> checkProperties;
+ checkProperties.insert("artist");
+ checkProperties.insert("artistid");
+ checkProperties.insert("musicbrainzartistid");
+ checkProperties.insert("contributors");
+ checkProperties.insert("displaycomposer");
+ checkProperties.insert("displayconductor");
+ checkProperties.insert("displayorchestra");
+ checkProperties.insert("displaylyricist");
+ std::set<std::string> additionalProperties;
+ bool artistData = CheckForAdditionalProperties(parameterObject["properties"], checkProperties, additionalProperties);
+
CFileItemList items;
- if (!musicdatabase.GetSongsFullByWhere(musicUrl.ToString(), CDatabase::Filter(), items, sorting, true))
+ if (!musicdatabase.GetSongsFullByWhere(musicUrl.ToString(), CDatabase::Filter(), items, sorting, artistData, false))
return InternalError;
JSONRPC_STATUS ret = GetAdditionalSongDetails(parameterObject, items, musicdatabase);
diff --git a/xbmc/interfaces/json-rpc/FileItemHandler.cpp b/xbmc/interfaces/json-rpc/FileItemHandler.cpp
index b66a27b74d..ed381a8dec 100644
--- a/xbmc/interfaces/json-rpc/FileItemHandler.cpp
+++ b/xbmc/interfaces/json-rpc/FileItemHandler.cpp
@@ -293,7 +293,7 @@ void CFileItemHandler::HandleFileItem(const char *ID, bool allowFile, const char
{
if (item->HasPVRChannelInfoTag() && item->GetPVRChannelInfoTag()->ChannelID() > 0)
object[ID] = item->GetPVRChannelInfoTag()->ChannelID();
- else if (item->HasEPGInfoTag() && item->GetEPGInfoTag()->UniqueBroadcastID() > 0)
+ else if (item->HasEPGInfoTag() && item->GetEPGInfoTag()->UniqueBroadcastID() > EPG_TAG_INVALID_UID)
object[ID] = item->GetEPGInfoTag()->UniqueBroadcastID();
else if (item->HasPVRRecordingInfoTag() && item->GetPVRRecordingInfoTag()->m_iRecordingId > 0)
object[ID] = item->GetPVRRecordingInfoTag()->m_iRecordingId;
diff --git a/xbmc/interfaces/json-rpc/schema/version.txt b/xbmc/interfaces/json-rpc/schema/version.txt
index 09a6d30847..a8d1f4fb47 100644
--- a/xbmc/interfaces/json-rpc/schema/version.txt
+++ b/xbmc/interfaces/json-rpc/schema/version.txt
@@ -1 +1 @@
-7.8.0
+7.8.1
diff --git a/xbmc/interfaces/legacy/Addon.cpp b/xbmc/interfaces/legacy/Addon.cpp
index 9ca6d7537a..f869970b87 100644
--- a/xbmc/interfaces/legacy/Addon.cpp
+++ b/xbmc/interfaces/legacy/Addon.cpp
@@ -128,9 +128,7 @@ namespace XBMCAddon
else if (strcmpi(id, "profile") == 0)
return pAddon->Profile();
else if (strcmpi(id, "stars") == 0)
- {
- return StringUtils::Format("%d", pAddon->Stars());
- }
+ return StringUtils::Format("-1");
else if (strcmpi(id, "summary") == 0)
return pAddon->Summary();
else if (strcmpi(id, "type") == 0)
diff --git a/xbmc/interfaces/legacy/CMakeLists.txt b/xbmc/interfaces/legacy/CMakeLists.txt
index 0ae6789621..8f257eb6a0 100644
--- a/xbmc/interfaces/legacy/CMakeLists.txt
+++ b/xbmc/interfaces/legacy/CMakeLists.txt
@@ -67,3 +67,7 @@ set(HEADERS Addon.h
core_add_library(legacy_interface)
add_dependencies(legacy_interface libcpluff)
+
+if(ENABLE_INTERNAL_FFMPEG)
+ add_dependencies(legacy_interface ffmpeg)
+endif()
diff --git a/xbmc/listproviders/DirectoryProvider.cpp b/xbmc/listproviders/DirectoryProvider.cpp
index 39d85243b7..9fb36f3642 100644
--- a/xbmc/listproviders/DirectoryProvider.cpp
+++ b/xbmc/listproviders/DirectoryProvider.cpp
@@ -371,6 +371,7 @@ bool CDirectoryProvider::UpdateSort()
m_currentSort.sortBy = sortMethod;
m_currentSort.sortOrder = sortOrder;
+ m_currentSort.sortAttributes = SortAttributeIgnoreFolders;
if (CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING))
m_currentSort.sortAttributes = static_cast<SortAttribute>(m_currentSort.sortAttributes | SortAttributeIgnoreArticle);
diff --git a/xbmc/music/CMakeLists.txt b/xbmc/music/CMakeLists.txt
index 355b9bc62f..e6309b362b 100644
--- a/xbmc/music/CMakeLists.txt
+++ b/xbmc/music/CMakeLists.txt
@@ -21,3 +21,7 @@ set(HEADERS Album.h
core_add_library(music)
add_dependencies(music libcpluff)
+
+if(ENABLE_INTERNAL_FFMPEG)
+ add_dependencies(music ffmpeg)
+endif()
diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp
index dc16b5e951..0059edb6d3 100644
--- a/xbmc/music/MusicDatabase.cpp
+++ b/xbmc/music/MusicDatabase.cpp
@@ -4025,7 +4025,7 @@ bool CMusicDatabase::GetAlbumsByWhere(const std::string &baseDir, const Filter &
return false;
}
-bool CMusicDatabase::GetSongsFullByWhere(const std::string &baseDir, const Filter &filter, CFileItemList &items, const SortDescription &sortDescription /* = SortDescription() */, bool artistData /* = false*/)
+bool CMusicDatabase::GetSongsFullByWhere(const std::string &baseDir, const Filter &filter, CFileItemList &items, const SortDescription &sortDescription /* = SortDescription() */, bool artistData /* = false*/, bool cueSheetData /* = true*/)
{
if (m_pDB.get() == NULL || m_pDS.get() == NULL)
return false;
@@ -4035,12 +4035,6 @@ bool CMusicDatabase::GetSongsFullByWhere(const std::string &baseDir, const Filte
unsigned int time = XbmcThreads::SystemClockMillis();
int total = -1;
- std::string strSQL = "SELECT %s FROM songview ";
- if (artistData)
- // Get data from song and song_artist tables to fully populate songs with artists.
- //Some songs may not have artists so Left join
- strSQL = "SELECT %s FROM songview LEFT JOIN songartistview on songartistview.idsong = songview.idsong ";
-
Filter extFilter = filter;
CMusicDbUrl musicUrl;
SortDescription sorting = sortDescription;
@@ -4068,17 +4062,38 @@ bool CMusicDatabase::GetSongsFullByWhere(const std::string &baseDir, const Filte
if (limited)
strSQLExtra += DatabaseUtils::BuildLimitClause(sortDescription.limitEnd, sortDescription.limitStart);
- if (!artistData)
- strSQL = PrepareSQL(strSQL, !filter.fields.empty() && filter.fields.compare("*") != 0 ? filter.fields.c_str() : "songview.* ") + strSQLExtra;
- else
- {
- strSQL = PrepareSQL(strSQL, !filter.fields.empty() && filter.fields.compare("*") != 0 ? filter.fields.c_str() : "songview.*, songartistview.* ");
- if (!limited)
- strSQL += strSQLExtra;
- else
+ std::string strSQL;
+ if (artistData)
+ { // Get data from song and song_artist tables to fully populate songs with artists
+ // Some songs may not have artists so Left join.
+ // Bug in SQLite optimiser for left join on views means have to use tables not songartistview
+ if (limited)
//Apply where clause and limits to songview, then join as mutiple records in result set per song
- strSQL += " WHERE songview.idsong in (SELECT idsong FROM songview " + strSQLExtra + ")";
+ strSQL = "SELECT sv.*, "
+ "song_artist.idArtist AS idArtist, "
+ "song_artist.idRole AS idRole, "
+ "role.strRole AS strRole, "
+ "artist.strArtist AS strArtist, "
+ "artist.strMusicBrainzArtistID AS strMusicBrainzArtistID, "
+ "song_artist.iOrder AS iOrder "
+ "FROM (SELECT songview.* FROM songview " + strSQLExtra + ") AS sv "
+ "LEFT JOIN song_artist on song_artist.idsong = sv.idsong "
+ "LEFT JOIN artist ON song_artist.idArtist = artist.idArtist "
+ "LEFT JOIN role ON song_artist.idRole = role.idRole ";
+ else
+ strSQL = "SELECT songview.*, "
+ "song_artist.idArtist AS idArtist, "
+ "song_artist.idRole AS idRole, "
+ "role.strRole AS strRole, "
+ "artist.strArtist AS strArtist, "
+ "artist.strMusicBrainzArtistID AS strMusicBrainzArtistID, "
+ "song_artist.iOrder AS iOrder "
+ "FROM songview LEFT JOIN song_artist ON song_artist.idsong = songview.idsong "
+ "LEFT JOIN artist ON song_artist.idArtist = artist.idArtist "
+ "LEFT JOIN role ON song_artist.idRole = role.idRole " + strSQLExtra;
}
+ else
+ strSQL = "SELECT songview.* FROM songview " + strSQLExtra;
CLog::Log(LOGDEBUG, "%s query = %s", __FUNCTION__, strSQL.c_str());
// run query
@@ -4102,7 +4117,7 @@ bool CMusicDatabase::GetSongsFullByWhere(const std::string &baseDir, const Filte
// Get songs from returned rows. If join songartistview then there is a row for every album artist
items.Reserve(total);
- int songArtistOffset = song_enumCount;
+ int songArtistOffset = song_enumCount - 1; // Unlike songartistview, not query idsong from song_artist
int songId = -1;
VECARTISTCREDITS artistCredits;
const dbiplus::query_data &data = m_pDS->get_result_set().records;
@@ -4136,10 +4151,8 @@ bool CMusicDatabase::GetSongsFullByWhere(const std::string &baseDir, const Filte
if (idSongArtistRole == ROLE_ARTIST)
artistCredits.push_back(GetArtistCreditFromDataset(record, songArtistOffset));
else
- items[items.Size() - 1]->GetMusicInfoTag()->AppendArtistRole(GetArtistRoleFromDataset(record, songArtistOffset));
-
+ items[items.Size() - 1]->GetMusicInfoTag()->AppendArtistRole(GetArtistRoleFromDataset(record, songArtistOffset));
}
-
}
catch (...)
{
@@ -4147,8 +4160,6 @@ bool CMusicDatabase::GetSongsFullByWhere(const std::string &baseDir, const Filte
CLog::Log(LOGERROR, "%s: out of memory loading query: %s", __FUNCTION__, filter.where.c_str());
return (items.Size() > 0);
}
-
-
}
if (!artistCredits.empty())
{
@@ -4159,11 +4170,12 @@ bool CMusicDatabase::GetSongsFullByWhere(const std::string &baseDir, const Filte
// cleanup
m_pDS->close();
- // Load some info from embedded cuesheet if present (now only ReplayGain)
- CueInfoLoader cueLoader;
- for (int i = 0; i < items.Size(); ++i)
- cueLoader.Load(LoadCuesheet(items[i]->GetMusicInfoTag()->GetURL()), items[i]);
-
+ if (cueSheetData)
+ { // Load some info from embedded cuesheet if present (now only ReplayGain)
+ CueInfoLoader cueLoader;
+ for (int i = 0; i < items.Size(); ++i)
+ cueLoader.Load(LoadCuesheet(items[i]->GetMusicInfoTag()->GetURL()), items[i]);
+ }
CLog::Log(LOGDEBUG, "%s(%s) - took %d ms", __FUNCTION__, filter.where.c_str(), XbmcThreads::SystemClockMillis() - time);
return true;
}
@@ -5394,7 +5406,7 @@ bool CMusicDatabase::GetScraperForPath(const std::string& strPath, ADDON::Scrape
ADDON::AddonPtr addon;
if (!scraperUUID.empty() && ADDON::CAddonMgr::GetInstance().GetAddon(scraperUUID, addon) && addon)
{
- info = std::dynamic_pointer_cast<ADDON::CScraper>(addon->Clone());
+ info = std::dynamic_pointer_cast<ADDON::CScraper>(addon);
if (!info)
return false;
// store this path's settings
@@ -5406,7 +5418,7 @@ bool CMusicDatabase::GetScraperForPath(const std::string& strPath, ADDON::Scrape
ADDON::AddonPtr defaultScraper;
if (ADDON::CAddonMgr::GetInstance().GetDefault(type, defaultScraper))
{
- info = std::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper->Clone());
+ info = std::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper);
}
}
}
diff --git a/xbmc/music/MusicDatabase.h b/xbmc/music/MusicDatabase.h
index a81233176c..03fe43fa68 100644
--- a/xbmc/music/MusicDatabase.h
+++ b/xbmc/music/MusicDatabase.h
@@ -372,7 +372,7 @@ public:
bool GetSongsNav(const std::string& strBaseDir, CFileItemList& items, int idGenre, int idArtist,int idAlbum, const SortDescription &sortDescription = SortDescription());
bool GetSongsByYear(const std::string& baseDir, CFileItemList& items, int year);
bool GetSongsByWhere(const std::string &baseDir, const Filter &filter, CFileItemList& items, const SortDescription &sortDescription = SortDescription());
- bool GetSongsFullByWhere(const std::string &baseDir, const Filter &filter, CFileItemList& items, const SortDescription &sortDescription = SortDescription(), bool artistData = false);
+ bool GetSongsFullByWhere(const std::string &baseDir, const Filter &filter, CFileItemList& items, const SortDescription &sortDescription = SortDescription(), bool artistData = false, bool cueSheetData = true);
bool GetAlbumsByWhere(const std::string &baseDir, const Filter &filter, CFileItemList &items, const SortDescription &sortDescription = SortDescription(), bool countOnly = false);
bool GetAlbumsByWhere(const std::string &baseDir, const Filter &filter, VECALBUMS& albums, int& total, const SortDescription &sortDescription = SortDescription(), bool countOnly = false);
bool GetArtistsByWhere(const std::string& strBaseDir, const Filter &filter, CFileItemList& items, const SortDescription &sortDescription = SortDescription(), bool countOnly = false);
diff --git a/xbmc/music/dialogs/GUIDialogMusicInfo.cpp b/xbmc/music/dialogs/GUIDialogMusicInfo.cpp
index aad8c912b7..587f8ccad1 100644
--- a/xbmc/music/dialogs/GUIDialogMusicInfo.cpp
+++ b/xbmc/music/dialogs/GUIDialogMusicInfo.cpp
@@ -20,7 +20,6 @@
#include "GUIDialogMusicInfo.h"
#include "guilib/GUIWindowManager.h"
-#include "guilib/GUIImage.h"
#include "dialogs/GUIDialogFileBrowser.h"
#include "dialogs/GUIDialogSelect.h"
#include "GUIPassword.h"
@@ -31,7 +30,6 @@
#include "FileItem.h"
#include "profiles/ProfilesManager.h"
#include "storage/MediaManager.h"
-#include "settings/AdvancedSettings.h"
#include "settings/MediaSourceSettings.h"
#include "input/Key.h"
#include "guilib/LocalizeStrings.h"
@@ -52,13 +50,16 @@ using namespace XFILE;
CGUIDialogMusicInfo::CGUIDialogMusicInfo(void)
: CGUIDialog(WINDOW_DIALOG_MUSIC_INFO, "DialogMusicInfo.xml")
- , m_albumItem(new CFileItem)
+ , m_albumItem(new CFileItem)
{
m_bRefresh = false;
m_albumSongs = new CFileItemList;
m_loadType = KEEP_IN_MEMORY;
m_startUserrating = -1;
m_needsUpdate = false;
+ m_bViewReview = false;
+ m_hasUpdatedThumb = false;
+ m_bArtistInfo = false;
}
CGUIDialogMusicInfo::~CGUIDialogMusicInfo(void)
@@ -83,8 +84,8 @@ bool CGUIDialogMusicInfo::OnMessage(CGUIMessage& message)
}
}
- CGUIMessage message(GUI_MSG_LABEL_RESET, GetID(), CONTROL_LIST);
- OnMessage(message);
+ CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CONTROL_LIST);
+ OnMessage(msg);
m_albumSongs->Clear();
}
break;
@@ -125,7 +126,7 @@ bool CGUIDialogMusicInfo::OnMessage(CGUIMessage& message)
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), iControl);
g_windowManager.SendMessage(msg);
int iItem = msg.GetParam1();
- if (iItem < 0 || iItem >= (int)m_albumSongs->Size())
+ if (iItem < 0 || iItem >= static_cast<int>(m_albumSongs->Size()))
break;
CFileItemPtr item = m_albumSongs->Get(iItem);
OnSearch(item.get());
@@ -226,7 +227,7 @@ void CGUIDialogMusicInfo::SetArtist(const CArtist& artist, const std::string &pa
m_albumSongs->SetContent("artists");
}
-void CGUIDialogMusicInfo::SetSongs(const VECSONGS &songs)
+void CGUIDialogMusicInfo::SetSongs(const VECSONGS &songs) const
{
m_albumSongs->Clear();
for (unsigned int i = 0; i < songs.size(); i++)
@@ -237,7 +238,7 @@ void CGUIDialogMusicInfo::SetSongs(const VECSONGS &songs)
}
}
-void CGUIDialogMusicInfo::SetDiscography()
+void CGUIDialogMusicInfo::SetDiscography() const
{
m_albumSongs->Clear();
CMusicDatabase database;
@@ -246,10 +247,16 @@ void CGUIDialogMusicInfo::SetDiscography()
std::vector<int> albumsByArtist;
database.GetAlbumsByArtist(m_artist.idArtist, albumsByArtist);
- for (unsigned int i=0;i<m_artist.discography.size();++i)
+ // Sort the discography by year
+ auto discography = m_artist.discography;
+ std::sort(discography.begin(), discography.end(), [](const std::pair<std::string, std::string> &left, const std::pair<std::string, std::string> &right) {
+ return left.second < right.second;
+ });
+
+ for (unsigned int i=0; i < discography.size(); ++i)
{
- CFileItemPtr item(new CFileItem(m_artist.discography[i].first));
- item->SetLabel2(m_artist.discography[i].second);
+ CFileItemPtr item(new CFileItem(discography[i].first));
+ item->SetLabel2(discography[i].second);
int idAlbum = -1;
for (std::vector<int>::const_iterator album = albumsByArtist.begin(); album != albumsByArtist.end(); ++album)
@@ -323,7 +330,7 @@ void CGUIDialogMusicInfo::OnInitWindow()
CGUIDialog::OnInitWindow();
}
-void CGUIDialogMusicInfo::SetUserrating(int userrating)
+void CGUIDialogMusicInfo::SetUserrating(int userrating) const
{
if (userrating < 0) userrating = 0;
if (userrating > 10) userrating = 10;
@@ -592,11 +599,14 @@ void CGUIDialogMusicInfo::AddItemPathToFileBrowserSources(VECSOURCES &sources, c
}
}
-void CGUIDialogMusicInfo::OnSetUserrating()
+void CGUIDialogMusicInfo::OnSetUserrating() const
{
- CGUIDialogSelect *dialog = (CGUIDialogSelect *)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
+ CGUIDialogSelect *dialog = static_cast<CGUIDialogSelect *>(g_windowManager.GetWindow(WINDOW_DIALOG_SELECT));
if (dialog)
{
+ // If we refresh and then try to set the rating there will be an items already here...
+ dialog->Reset();
+
dialog->SetHeading(CVariant{ 38023 });
dialog->Add(g_localizeStrings.Get(38022));
for (int i = 1; i <= 10; i++)
diff --git a/xbmc/music/dialogs/GUIDialogMusicInfo.h b/xbmc/music/dialogs/GUIDialogMusicInfo.h
index 54739c0b1a..986981b4c0 100644
--- a/xbmc/music/dialogs/GUIDialogMusicInfo.h
+++ b/xbmc/music/dialogs/GUIDialogMusicInfo.h
@@ -35,29 +35,29 @@ class CGUIDialogMusicInfo :
public:
CGUIDialogMusicInfo(void);
virtual ~CGUIDialogMusicInfo(void);
- virtual bool OnMessage(CGUIMessage& message);
- virtual bool OnAction(const CAction &action);
+ bool OnMessage(CGUIMessage& message) override;
+ bool OnAction(const CAction &action) override;
void SetAlbum(const CAlbum& album, const std::string &path);
void SetArtist(const CArtist& artist, const std::string &path);
bool NeedRefresh() const { return m_bRefresh; };
bool NeedsUpdate() const { return m_needsUpdate; };
bool HasUpdatedThumb() const { return m_hasUpdatedThumb; };
- virtual bool HasListItems() const { return true; };
- virtual CFileItemPtr GetCurrentListItem(int offset = 0);
+ bool HasListItems() const override { return true; };
+ CFileItemPtr GetCurrentListItem(int offset = 0) override;
const CFileItemList& CurrentDirectory() const { return *m_albumSongs; };
static void AddItemPathToFileBrowserSources(VECSOURCES &sources, const CFileItem &item);
protected:
- virtual void OnInitWindow();
+ void OnInitWindow() override;
void Update();
void SetLabel(int iControl, const std::string& strLabel);
void OnGetThumb();
void OnGetFanart();
- void SetSongs(const VECSONGS &songs);
- void SetDiscography();
+ void SetSongs(const VECSONGS &songs) const;
+ void SetDiscography() const;
void OnSearch(const CFileItem* pItem);
- void OnSetUserrating();
- void SetUserrating(int userrating);
+ void OnSetUserrating() const;
+ void SetUserrating(int userrating) const;
CAlbum m_album;
CArtist m_artist;
diff --git a/xbmc/music/tags/TagLoaderTagLib.cpp b/xbmc/music/tags/TagLoaderTagLib.cpp
index e5062f0b2a..12dca7fa6f 100644
--- a/xbmc/music/tags/TagLoaderTagLib.cpp
+++ b/xbmc/music/tags/TagLoaderTagLib.cpp
@@ -938,7 +938,7 @@ void CTagLoaderTagLib::AddArtistRole(CMusicInfoTag &tag, const std::vector<std::
if (values.size() % 2 != 0) // Must contain an even number of entries
return;
- for (size_t i = 0; i < values.size() - 1; i += 2)
+ for (size_t i = 0; i + 1 < values.size(); i += 2)
tag.AddArtistRole(values[i], StringUtils::Split(values[i + 1], ","));
}
diff --git a/xbmc/music/windows/GUIWindowMusicNav.cpp b/xbmc/music/windows/GUIWindowMusicNav.cpp
index f29c34e750..a1a35c761d 100644
--- a/xbmc/music/windows/GUIWindowMusicNav.cpp
+++ b/xbmc/music/windows/GUIWindowMusicNav.cpp
@@ -750,7 +750,7 @@ bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
ADDON::AddonPtr defaultScraper;
if (ADDON::CAddonMgr::GetInstance().GetDefault(ADDON::ScraperTypeFromContent(content), defaultScraper))
{
- scraper = std::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper->Clone());
+ scraper = std::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper);
}
}
diff --git a/xbmc/peripherals/Peripherals.cpp b/xbmc/peripherals/Peripherals.cpp
index 2c85b8274a..9730929e26 100644
--- a/xbmc/peripherals/Peripherals.cpp
+++ b/xbmc/peripherals/Peripherals.cpp
@@ -33,6 +33,7 @@
#include "devices/PeripheralNyxboard.h"
#include "devices/PeripheralTuner.h"
#include "dialogs/GUIDialogKaiToast.h"
+#include "dialogs/GUIDialogOK.h"
#include "dialogs/GUIDialogPeripheralSettings.h"
#include "dialogs/GUIDialogSelect.h"
#include "FileItem.h"
@@ -707,7 +708,7 @@ void CPeripherals::OnSettingChanged(const CSetting *setting)
{
// user set language, no longer use the TV's language
std::vector<CPeripheral *> cecDevices;
- if (g_peripherals.GetPeripheralsWithFeature(cecDevices, FEATURE_CEC) > 0)
+ if (GetPeripheralsWithFeature(cecDevices, FEATURE_CEC) > 0)
{
for (std::vector<CPeripheral *>::iterator it = cecDevices.begin(); it != cecDevices.end(); ++it)
(*it)->SetSetting("use_tv_menu_language", false);
@@ -744,6 +745,15 @@ void CPeripherals::OnSettingAction(const CSetting *setting)
if (iPos >= 0)
{
CFileItemPtr pItem = items.Get(iPos);
+
+ // show an error if the peripheral doesn't have any settings
+ CPeripheral *peripheral = GetByPath(pItem->GetPath());
+ if (peripheral == nullptr || peripheral->GetSettings().empty())
+ {
+ CGUIDialogOK::ShowAndGetInput(CVariant{35000}, CVariant{35004});
+ continue;
+ }
+
CGUIDialogPeripheralSettings *pSettingsDialog = (CGUIDialogPeripheralSettings *)g_windowManager.GetWindow(WINDOW_DIALOG_PERIPHERAL_SETTINGS);
if (pItem && pSettingsDialog)
{
diff --git a/xbmc/peripherals/bus/linux/CMakeLists.txt b/xbmc/peripherals/bus/linux/CMakeLists.txt
index ca8611fed7..42a16a1533 100644
--- a/xbmc/peripherals/bus/linux/CMakeLists.txt
+++ b/xbmc/peripherals/bus/linux/CMakeLists.txt
@@ -1,6 +1,3 @@
-set(SOURCES)
-set(HEADERS)
-
if(UDEV_FOUND)
list(APPEND SOURCES PeripheralBusUSBLibUdev.cpp)
list(APPEND HEADERS PeripheralBusUSBLibUdev.h)
@@ -9,5 +6,7 @@ elseif(LIBUSB_FOUND)
list(APPEND HEADERS PeripheralBusUSBLibUSB.h)
endif()
-core_add_library(peripherals_bus_linux)
-set_target_properties(peripherals_bus_linux PROPERTIES LINKER_LANGUAGE CXX)
+if(SOURCES)
+ core_add_library(peripherals_bus_linux)
+ set_target_properties(peripherals_bus_linux PROPERTIES LINKER_LANGUAGE CXX)
+endif()
diff --git a/xbmc/platform/android/activity/AndroidFeatures.cpp b/xbmc/platform/android/activity/AndroidFeatures.cpp
index 7e0ea55749..1953ed4e05 100644
--- a/xbmc/platform/android/activity/AndroidFeatures.cpp
+++ b/xbmc/platform/android/activity/AndroidFeatures.cpp
@@ -63,3 +63,14 @@ int CAndroidFeatures::GetVersion()
return version;
}
+int CAndroidFeatures::GetCPUCount()
+{
+ static int count = -1;
+
+ if (count == -1)
+ {
+ count = android_getCpuCount();
+ }
+ return count;
+}
+
diff --git a/xbmc/platform/android/activity/AndroidFeatures.h b/xbmc/platform/android/activity/AndroidFeatures.h
index 9d0c20b8cf..98aee45106 100644
--- a/xbmc/platform/android/activity/AndroidFeatures.h
+++ b/xbmc/platform/android/activity/AndroidFeatures.h
@@ -27,4 +27,5 @@ class CAndroidFeatures
static bool HasNeon();
static int GetVersion();
-}; \ No newline at end of file
+ static int GetCPUCount();
+};
diff --git a/xbmc/platform/android/jni/AudioFormat.cpp b/xbmc/platform/android/jni/AudioFormat.cpp
index a7e57a765c..a8e6595057 100644
--- a/xbmc/platform/android/jni/AudioFormat.cpp
+++ b/xbmc/platform/android/jni/AudioFormat.cpp
@@ -94,6 +94,19 @@ void CJNIAudioFormat::PopulateStaticFields()
GetStaticValue(c, CJNIAudioFormat::ENCODING_DTS, "ENCODING_DTS");
GetStaticValue(c, CJNIAudioFormat::ENCODING_DTS_HD, "ENCODING_DTS_HD");
GetStaticValue(c, CJNIAudioFormat::ENCODING_DOLBY_TRUEHD, "ENCODING_DOLBY_TRUEHD");
+
+ // This is ugly and a nicer solution is needed
+ int value = -1;
+ GetStaticValue(c, value, "ENCODING_DTSHD");
+ if (value != -1)
+ CJNIAudioFormat::ENCODING_DTS_HD = value;
+ GetStaticValue(c, value, "ENCODING_DTSHD_MA");
+ if (value != -1)
+ CJNIAudioFormat::ENCODING_DTS_HD = value;
+
+ GetStaticValue(c, value, "ENCODING_TRUEHD");
+ if (value != -1)
+ CJNIAudioFormat::ENCODING_DOLBY_TRUEHD = value;
}
}
}
diff --git a/xbmc/platform/darwin/ios-common/AnnounceReceiver.mm b/xbmc/platform/darwin/ios-common/AnnounceReceiver.mm
index 0ea5c5ccb4..ba204e2bbc 100644
--- a/xbmc/platform/darwin/ios-common/AnnounceReceiver.mm
+++ b/xbmc/platform/darwin/ios-common/AnnounceReceiver.mm
@@ -106,7 +106,7 @@ void AnnounceBridge(ANNOUNCEMENT::AnnouncementFlag flag, const char *sender, con
if (!thumb.empty())
{
bool needsRecaching;
- std::string cachedThumb(CTextureCache::GetInstance().CheckCachedImage(thumb, false, needsRecaching));
+ std::string cachedThumb(CTextureCache::GetInstance().CheckCachedImage(thumb, needsRecaching));
//LOG("thumb: %s, %s", thumb.c_str(), cachedThumb.c_str());
if (!cachedThumb.empty())
{
diff --git a/xbmc/powermanagement/CMakeLists.txt b/xbmc/powermanagement/CMakeLists.txt
index 7ca11f2e2a..a7eded6aad 100644
--- a/xbmc/powermanagement/CMakeLists.txt
+++ b/xbmc/powermanagement/CMakeLists.txt
@@ -7,3 +7,7 @@ set(HEADERS DPMSSupport.h
PowerManager.h)
core_add_library(powermanagement)
+
+if(ENABLE_INTERNAL_FFMPEG)
+ add_dependencies(powermanagement ffmpeg)
+endif()
diff --git a/xbmc/programs/GUIWindowPrograms.cpp b/xbmc/programs/GUIWindowPrograms.cpp
index 381e49b11f..4afa546706 100644
--- a/xbmc/programs/GUIWindowPrograms.cpp
+++ b/xbmc/programs/GUIWindowPrograms.cpp
@@ -173,24 +173,6 @@ bool CGUIWindowPrograms::OnPlayMedia(int iItem)
return false;
}
-bool CGUIWindowPrograms::GetDirectory(const std::string &strDirectory, CFileItemList &items)
-{
- if (!CGUIMediaWindow::GetDirectory(strDirectory, items))
- return false;
-
- // don't allow the view state to change these
- if (StringUtils::StartsWithNoCase(strDirectory, "addons://"))
- {
- for (int i=0;i<items.Size();++i)
- {
- items[i]->SetLabel2(items[i]->GetProperty("Addon.Version").asString());
- items[i]->SetLabelPreformated(true);
- }
- }
-
- return true;
-}
-
std::string CGUIWindowPrograms::GetStartFolder(const std::string &dir)
{
std::string lower(dir); StringUtils::ToLower(lower);
diff --git a/xbmc/programs/GUIWindowPrograms.h b/xbmc/programs/GUIWindowPrograms.h
index dbf840bfc4..4b186e1dc4 100644
--- a/xbmc/programs/GUIWindowPrograms.h
+++ b/xbmc/programs/GUIWindowPrograms.h
@@ -36,7 +36,6 @@ protected:
virtual void OnItemLoaded(CFileItem* pItem) {};
virtual bool Update(const std::string& strDirectory, bool updateFilterPath = true);
virtual bool OnPlayMedia(int iItem);
- virtual bool GetDirectory(const std::string &strDirectory, CFileItemList &items);
virtual void GetContextButtons(int itemNumber, CContextButtons &buttons);
virtual bool OnContextButton(int itemNumber, CONTEXT_BUTTON button);
virtual std::string GetStartFolder(const std::string &dir);
diff --git a/xbmc/pvr/CMakeLists.txt b/xbmc/pvr/CMakeLists.txt
index 7c6ecf0ec7..0384ceeecb 100644
--- a/xbmc/pvr/CMakeLists.txt
+++ b/xbmc/pvr/CMakeLists.txt
@@ -12,3 +12,7 @@ set(HEADERS PVRActionListener.h
core_add_library(pvr)
add_dependencies(pvr libcpluff)
+
+if(ENABLE_INTERNAL_FFMPEG)
+ add_dependencies(pvr ffmpeg)
+endif()
diff --git a/xbmc/pvr/PVRGUIInfo.cpp b/xbmc/pvr/PVRGUIInfo.cpp
index c43f1726a9..ff0733a5c2 100644
--- a/xbmc/pvr/PVRGUIInfo.cpp
+++ b/xbmc/pvr/PVRGUIInfo.cpp
@@ -358,15 +358,6 @@ bool CPVRGUIInfo::TranslateCharInfo(DWORD dwInfo, std::string &strValue) const
case PVR_NEXT_TIMER:
CharInfoNextTimer(strValue);
break;
- case PVR_ACTUAL_STREAM_VIDEO_BR:
- CharInfoVideoBR(strValue);
- break;
- case PVR_ACTUAL_STREAM_AUDIO_BR:
- CharInfoAudioBR(strValue);
- break;
- case PVR_ACTUAL_STREAM_DOLBY_BR:
- CharInfoDolbyBR(strValue);
- break;
case PVR_ACTUAL_STREAM_SIG:
CharInfoSignal(strValue);
break;
@@ -604,21 +595,6 @@ void CPVRGUIInfo::CharInfoTotalDiskSpace(std::string &strValue) const
strValue = StringUtils::SizeToString(m_iBackendDiskTotal).c_str();
}
-void CPVRGUIInfo::CharInfoVideoBR(std::string &strValue) const
-{
- strValue = StringUtils::Format("%.2f Mbit/s", m_qualityInfo.dVideoBitrate);
-}
-
-void CPVRGUIInfo::CharInfoAudioBR(std::string &strValue) const
-{
- strValue = StringUtils::Format("%.0f kbit/s", m_qualityInfo.dAudioBitrate);
-}
-
-void CPVRGUIInfo::CharInfoDolbyBR(std::string &strValue) const
-{
- strValue = StringUtils::Format("%.0f kbit/s", m_qualityInfo.dDolbyBitrate);
-}
-
void CPVRGUIInfo::CharInfoSignal(std::string &strValue) const
{
strValue = StringUtils::Format("%d %%", m_qualityInfo.iSignal / 655);
diff --git a/xbmc/pvr/PVRGUIInfo.h b/xbmc/pvr/PVRGUIInfo.h
index bc451d6dc5..fafa5be9b5 100644
--- a/xbmc/pvr/PVRGUIInfo.h
+++ b/xbmc/pvr/PVRGUIInfo.h
@@ -121,9 +121,6 @@ namespace PVR
void CharInfoNextTimer(std::string &strValue) const;
void CharInfoBackendNumber(std::string &strValue) const;
void CharInfoTotalDiskSpace(std::string &strValue) const;
- void CharInfoVideoBR(std::string &strValue) const;
- void CharInfoAudioBR(std::string &strValue) const;
- void CharInfoDolbyBR(std::string &strValue) const;
void CharInfoSignal(std::string &strValue) const;
void CharInfoSNR(std::string &strValue) const;
void CharInfoBER(std::string &strValue) const;
diff --git a/xbmc/pvr/PVRManager.cpp b/xbmc/pvr/PVRManager.cpp
index 9c27b65b66..f1bca75a3d 100644
--- a/xbmc/pvr/PVRManager.cpp
+++ b/xbmc/pvr/PVRManager.cpp
@@ -57,6 +57,7 @@
#include "settings/MediaSettings.h"
#include "settings/Settings.h"
#include "threads/SingleLock.h"
+#include "threads/SystemClock.h"
#include "Util.h"
#include "utils/JobManager.h"
#include "utils/log.h"
@@ -175,6 +176,10 @@ void CPVRManager::OnSettingChanged(const CSetting *setting)
((CSettingBool*)setting)->SetValue(false);
}
}
+ else if(settingId == CSettings::SETTING_EPG_DAYSTODISPLAY)
+ {
+ m_addons->SetEPGTimeFrame(static_cast<const CSettingInt*>(setting)->GetValue());
+ }
}
void CPVRManager::OnSettingAction(const CSetting *setting)
@@ -335,12 +340,11 @@ bool CPVRManager::UpgradeOutdatedAddons(void)
SetState(ManagerStateStarting);
ResetProperties();
- while (!Load() && IsInitialising())
+ const unsigned int MAX_PROGRESS_DISPLAY_TIME = 30000; // 30 secs
+ XbmcThreads::EndTime progressTimeout(MAX_PROGRESS_DISPLAY_TIME);
+ while (!Load(!progressTimeout.IsTimePast()) && IsInitialising())
{
CLog::Log(LOGERROR, "PVRManager - %s - failed to load PVR data, retrying", __FUNCTION__);
- if (m_guiInfo) m_guiInfo->Stop();
- if (m_addons) m_addons->Stop();
- Cleanup();
Sleep(1000);
}
@@ -514,12 +518,10 @@ void CPVRManager::Process(void)
g_EpgContainer.Stop();
/* load the pvr data from the db and clients if it's not already loaded */
- while (!Load() && IsInitialising())
+ XbmcThreads::EndTime progressTimeout(30000); // 30 secs
+ while (!Load(!progressTimeout.IsTimePast()) && IsInitialising())
{
CLog::Log(LOGERROR, "PVRManager - %s - failed to load PVR data, retrying", __FUNCTION__);
- if (m_guiInfo) m_guiInfo->Stop();
- if (m_addons) m_addons->Stop();
- Cleanup();
Sleep(1000);
}
@@ -630,8 +632,11 @@ void CPVRManager::StopUpdateThreads(void)
m_addons->Stop();
}
-bool CPVRManager::Load(void)
+bool CPVRManager::Load(bool bShowProgress)
{
+ if (!bShowProgress)
+ HideProgressDialog();
+
/* start the add-on update thread */
if (m_addons)
m_addons->Start();
@@ -655,27 +660,32 @@ bool CPVRManager::Load(void)
}
/* load all channels and groups */
- ShowProgressDialog(g_localizeStrings.Get(19236), 0); // Loading channels from clients
+ if (bShowProgress)
+ ShowProgressDialog(g_localizeStrings.Get(19236), 0); // Loading channels from clients
if (!m_channelGroups->Load() || !IsInitialising())
return false;
/* get timers from the backends */
- ShowProgressDialog(g_localizeStrings.Get(19237), 50); // Loading timers from clients
+ if (bShowProgress)
+ ShowProgressDialog(g_localizeStrings.Get(19237), 50); // Loading timers from clients
m_timers->Load();
/* get recordings from the backend */
- ShowProgressDialog(g_localizeStrings.Get(19238), 75); // Loading recordings from clients
+ if (bShowProgress)
+ ShowProgressDialog(g_localizeStrings.Get(19238), 75); // Loading recordings from clients
m_recordings->Load();
if (!IsInitialising())
return false;
/* start the other pvr related update threads */
- ShowProgressDialog(g_localizeStrings.Get(19239), 85); // Starting background threads
+ if (bShowProgress)
+ ShowProgressDialog(g_localizeStrings.Get(19239), 85); // Starting background threads
m_guiInfo->Start();
/* close the progess dialog */
- HideProgressDialog();
+ if (bShowProgress)
+ HideProgressDialog();
return true;
}
diff --git a/xbmc/pvr/PVRManager.h b/xbmc/pvr/PVRManager.h
index 0239abd9fa..5aeba082fa 100644
--- a/xbmc/pvr/PVRManager.h
+++ b/xbmc/pvr/PVRManager.h
@@ -596,9 +596,10 @@ namespace PVR
/*!
* @brief Load at least one client and load all other PVR data after loading the client.
* If some clients failed to load here, the pvrmanager will retry to load them every second.
+ * @param bShowProgress True, to show a progress dialog for the different load stages.
* @return If at least one client and all pvr data was loaded, false otherwise.
*/
- bool Load(void);
+ bool Load(bool bShowProgress);
/*!
* @brief Reset all properties.
diff --git a/xbmc/pvr/addons/PVRClient.cpp b/xbmc/pvr/addons/PVRClient.cpp
index cb0ce0a6fe..d7e414f66a 100644
--- a/xbmc/pvr/addons/PVRClient.cpp
+++ b/xbmc/pvr/addons/PVRClient.cpp
@@ -63,6 +63,7 @@ std::unique_ptr<CPVRClient> CPVRClient::FromExtension(AddonProps props, const cp
CPVRClient::CPVRClient(AddonProps props)
: CAddonDll<DllPVRClient, PVRClient, PVR_PROPERTIES>(std::move(props)),
+ m_bNeedsConfiguration(false),
m_apiVersion("0.0.0"),
m_bAvahiServiceAdded(false)
{
@@ -161,6 +162,7 @@ void CPVRClient::ResetProperties(int iClientId /* = PVR_INVALID_CLIENT_ID */)
m_menuhooks.clear();
m_timertypes.clear();
m_bReadyToUse = false;
+ m_connectionState = PVR_CONNECTION_STATE_UNKNOWN;
m_iClientId = iClientId;
m_strBackendVersion = DEFAULT_INFO_STRING_VALUE;
m_strConnectionString = DEFAULT_INFO_STRING_VALUE;
@@ -194,6 +196,8 @@ ADDON_STATUS CPVRClient::Create(int iClientId)
m_bReadyToUse = bReadyToUse;
+ SetEPGTimeFrame(CSettings::GetInstance().GetInt(CSettings::SETTING_EPG_DAYSTODISPLAY));
+
return status;
}
@@ -236,6 +240,20 @@ bool CPVRClient::ReadyToUse(void) const
return m_bReadyToUse;
}
+void CPVRClient::SetConnectionState(PVR_CONNECTION_STATE state)
+{
+ if (m_connectionState != state)
+ {
+ m_connectionState = state;
+
+ if (state == PVR_CONNECTION_STATE_CONNECTED)
+ {
+ CLog::Log(LOGDEBUG, "PVRClient - %s - refetching addon properties", __FUNCTION__);
+ GetAddonProperties();
+ }
+ }
+}
+
int CPVRClient::GetID(void) const
{
return m_iClientId;
@@ -324,8 +342,8 @@ void CPVRClient::WriteClientTimerInfo(const CPVRTimerInfoTag &xbmcTimer, PVR_TIM
strncpy(addonTimer.strSummary, xbmcTimer.m_strSummary.c_str(), sizeof(addonTimer.strSummary) - 1);
addonTimer.iMarginStart = xbmcTimer.m_iMarginStart;
addonTimer.iMarginEnd = xbmcTimer.m_iMarginEnd;
- addonTimer.iGenreType = xbmcTimer.m_iGenreType;
- addonTimer.iGenreSubType = xbmcTimer.m_iGenreSubType;
+ addonTimer.iGenreType = epgTag ? epgTag->GenreType() : 0;
+ addonTimer.iGenreSubType = epgTag ? epgTag->GenreSubType() : 0;
}
/*!
@@ -384,7 +402,8 @@ bool CPVRClient::CheckAPIVersion(void)
try { guiVersion = AddonVersion(m_pStruct->GetGUIAPIVersion()); }
catch (std::exception &e) { LogException(e, "GetGUIAPIVersion()"); return false; }
- if (!IsCompatibleGUIAPIVersion(minVersion, guiVersion))
+ /* Only do the check, if add-on depends on GUI API. */
+ if (!guiVersion.empty() && !IsCompatibleGUIAPIVersion(minVersion, guiVersion))
{
CLog::Log(LOGERROR, "PVR - Add-on '%s' is using an incompatible GUI API version. XBMC minimum GUI API version = '%s', add-on GUI API version '%s'", Name().c_str(), minVersion.asString().c_str(), guiVersion.asString().c_str());
return false;
@@ -792,6 +811,29 @@ PVR_ERROR CPVRClient::GetEPGForChannel(const CPVRChannelPtr &channel, CEpg *epg,
return retVal;
}
+PVR_ERROR CPVRClient::SetEPGTimeFrame(int iDays)
+{
+ if (!m_bReadyToUse)
+ return PVR_ERROR_SERVER_ERROR;
+
+ if (!m_addonCapabilities.bSupportsEPG)
+ return PVR_ERROR_NOT_IMPLEMENTED;
+
+ PVR_ERROR retVal(PVR_ERROR_UNKNOWN);
+ try
+ {
+ retVal = m_pStruct->SetEPGTimeFrame(iDays);
+
+ LogError(retVal, __FUNCTION__);
+ }
+ catch (std::exception &e)
+ {
+ LogException(e, __FUNCTION__);
+ }
+
+ return retVal;
+}
+
int CPVRClient::GetChannelGroupsAmount(void)
{
int iReturn(-EINVAL);
@@ -1386,16 +1428,6 @@ int64_t CPVRClient::GetStreamLength(void)
return -EINVAL;
}
-int CPVRClient::GetCurrentClientChannel(void)
-{
- if (IsPlayingLiveStream())
- {
- try { return m_pStruct->GetCurrentClientChannel(); }
- catch (std::exception &e) { LogException(e, __FUNCTION__); }
- }
- return -EINVAL;
-}
-
bool CPVRClient::SwitchChannel(const CPVRChannelPtr &channel)
{
bool bSwitched(false);
diff --git a/xbmc/pvr/addons/PVRClient.h b/xbmc/pvr/addons/PVRClient.h
index c6a8f2a7b6..0e6e94bd18 100644
--- a/xbmc/pvr/addons/PVRClient.h
+++ b/xbmc/pvr/addons/PVRClient.h
@@ -102,11 +102,23 @@ namespace PVR
void ReCreate(void);
/*!
- * @return True if this instance is initialised, false otherwise.
+ * @return True if this instance is initialised (ADDON_Create returned true), false otherwise.
*/
bool ReadyToUse(void) const;
/*!
+ * @brief Gets the backend connection state.
+ * @return the backend connection state.
+ */
+ PVR_CONNECTION_STATE GetConnectionState(void) const { return m_connectionState; }
+
+ /*!
+ * @brief Sets the backend connection state.
+ * @param state the new backend connection state.
+ */
+ void SetConnectionState(PVR_CONNECTION_STATE state);
+
+ /*!
* @return The ID of this instance.
*/
int GetID(void) const;
@@ -227,6 +239,15 @@ namespace PVR
*/
PVR_ERROR GetEPGForChannel(const CPVRChannelPtr &channel, EPG::CEpg *epg, time_t start = 0, time_t end = 0, bool bSaveInDb = false);
+ /*!
+ * Tell the client the time frame to use when notifying epg events back to Kodi. The client might push epg events asynchronously
+ * to Kodi using the callback function EpgEventStateChange. To be able to only push events that are actually of interest for Kodi,
+ * client needs to know about the epg time frame Kodi uses.
+ * @param iDays number of days from "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times.
+ * @return PVR_ERROR_NO_ERROR if new value was successfully set.
+ */
+ PVR_ERROR SetEPGTimeFrame(int iDays);
+
//@}
/** @name PVR channel group methods */
//@{
@@ -444,11 +465,6 @@ namespace PVR
void PauseStream(bool bPaused);
/*!
- * @return The channel number on the server of the live stream that's currently being read.
- */
- int GetCurrentClientChannel(void);
-
- /*!
* @brief Switch to another channel. Only to be called when a live stream has already been opened.
* @param channel The channel to switch to.
* @return True if the switch was successful, false otherwise.
@@ -670,7 +686,8 @@ namespace PVR
bool LogError(const PVR_ERROR error, const char *strMethod) const;
void LogException(const std::exception &e, const char *strFunctionName) const;
- bool m_bReadyToUse; /*!< true if this add-on is connected to the backend, false otherwise */
+ bool m_bReadyToUse; /*!< true if this add-on is initialised (ADDON_Create returned true), false otherwise */
+ PVR_CONNECTION_STATE m_connectionState; /*!< the backend connection state */
PVR_MENUHOOKS m_menuhooks; /*!< the menu hooks for this add-on */
CPVRTimerTypes m_timertypes; /*!< timer types supported by this backend */
int m_iClientId; /*!< database ID of the client */
diff --git a/xbmc/pvr/addons/PVRClients.cpp b/xbmc/pvr/addons/PVRClients.cpp
index 0a6a5a9261..19c0aa4a07 100644
--- a/xbmc/pvr/addons/PVRClients.cpp
+++ b/xbmc/pvr/addons/PVRClients.cpp
@@ -795,6 +795,26 @@ PVR_ERROR CPVRClients::GetEPGForChannel(const CPVRChannelPtr &channel, CEpg *epg
return error;
}
+PVR_ERROR CPVRClients::SetEPGTimeFrame(int iDays)
+{
+ PVR_ERROR error(PVR_ERROR_NO_ERROR);
+ PVR_CLIENTMAP clients;
+ GetConnectedClients(clients);
+
+ for (const auto &client : clients)
+ {
+ PVR_ERROR currentError = client.second->SetEPGTimeFrame(iDays);
+ if (currentError != PVR_ERROR_NOT_IMPLEMENTED &&
+ currentError != PVR_ERROR_NO_ERROR)
+ {
+ error = currentError;
+ CLog::Log(LOGERROR, "PVR - %s - cannot set epg time frame for client '%d': %s",__FUNCTION__, client.first, CPVRClient::ToString(error));
+ }
+ }
+
+ return error;
+}
+
PVR_ERROR CPVRClients::GetChannels(CPVRChannelGroupInternal *group)
{
PVR_ERROR error(PVR_ERROR_NO_ERROR);
diff --git a/xbmc/pvr/addons/PVRClients.h b/xbmc/pvr/addons/PVRClients.h
index 971f3a925b..d6cf98a2f5 100644
--- a/xbmc/pvr/addons/PVRClients.h
+++ b/xbmc/pvr/addons/PVRClients.h
@@ -531,6 +531,15 @@ namespace PVR
*/
PVR_ERROR GetEPGForChannel(const CPVRChannelPtr &channel, EPG::CEpg *epg, time_t start, time_t end);
+ /*!
+ * Tell the client the time frame to use when notifying epg events back to Kodi. The client might push epg events asynchronously
+ * to Kodi using the callback function EpgEventStateChange. To be able to only push events that are actually of interest for Kodi,
+ * client needs to know about the epg time frame Kodi uses.
+ * @param iDays number of days from "now". EPG_TIMEFRAME_UNLIMITED means that Kodi is interested in all epg events, regardless of event times.
+ * @return PVR_ERROR_NO_ERROR if new value was successfully set.
+ */
+ PVR_ERROR SetEPGTimeFrame(int iDays);
+
//@}
/*! @name Channel methods */
diff --git a/xbmc/pvr/channels/PVRChannel.h b/xbmc/pvr/channels/PVRChannel.h
index 5db1631d45..8edd3ddc64 100644
--- a/xbmc/pvr/channels/PVRChannel.h
+++ b/xbmc/pvr/channels/PVRChannel.h
@@ -28,8 +28,6 @@
#include "utils/ISerializable.h"
#include "utils/Observer.h"
-#define PVR_INVALID_CHANNEL_UID -1
-
class CVariant;
namespace EPG
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp b/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp
index 25fe6f5b00..9514ab191c 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp
+++ b/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp
@@ -162,7 +162,7 @@ void CGUIDialogPVRTimerSettings::SetTimer(CFileItem *item)
// Channel
m_channel = ChannelDescriptor();
- if (m_timerInfoTag->m_iClientChannelUid == PVR_INVALID_CHANNEL_UID)
+ if (m_timerInfoTag->m_iClientChannelUid == PVR_CHANNEL_INVALID_UID)
{
bool bChannelSet(false);
if (m_timerType && m_timerType->IsRepeatingEpgBased())
@@ -180,7 +180,7 @@ void CGUIDialogPVRTimerSettings::SetTimer(CFileItem *item)
// Select first real (not "Any channel") entry.
for (const auto &channel : m_channelEntries)
{
- if (channel.second.channelUid != PVR_INVALID_CHANNEL_UID)
+ if (channel.second.channelUid != PVR_CHANNEL_INVALID_UID)
{
m_channel = channel.second;
bChannelSet = true;
@@ -190,7 +190,7 @@ void CGUIDialogPVRTimerSettings::SetTimer(CFileItem *item)
}
if (!bChannelSet)
- CLog::Log(LOGERROR, "CGUIDialogPVRTimerSettings::SetTimer - Unable to map PVR_INVALID_CHANNEL_UID to channel entry!");
+ CLog::Log(LOGERROR, "CGUIDialogPVRTimerSettings::SetTimer - Unable to map PVR_CHANNEL_INVALID_UID to channel entry!");
}
else
{
@@ -783,7 +783,7 @@ void CGUIDialogPVRTimerSettings::InitializeChannelsList()
// Add special "any channel" entry (used for epg-based repeating timers).
m_channelEntries.insert(
std::make_pair(
- ENTRY_ANY_CHANNEL, ChannelDescriptor(PVR_INVALID_CHANNEL_UID, 0, g_localizeStrings.Get(809))));
+ ENTRY_ANY_CHANNEL, ChannelDescriptor(PVR_CHANNEL_INVALID_UID, 0, g_localizeStrings.Get(809))));
}
void CGUIDialogPVRTimerSettings::TypesFiller(
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.h b/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.h
index 1647405152..8effc0f936 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.h
+++ b/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.h
@@ -19,7 +19,7 @@
*
*/
-#include "pvr/channels/PVRChannel.h" // PVR_INVALID_CHANNEL_UID
+#include "pvr/channels/PVRChannel.h" // PVR_CHANNEL_INVALID_UID
#include "settings/dialogs/GUIDialogSettingsManualBase.h"
#include <map>
@@ -122,7 +122,7 @@ namespace PVR
int clientId;
std::string description;
- ChannelDescriptor(int _channelUid = PVR_INVALID_CHANNEL_UID,
+ ChannelDescriptor(int _channelUid = PVR_CHANNEL_INVALID_UID,
int _clientId = -1,
const std::string& _description = "")
: channelUid(_channelUid),
diff --git a/xbmc/pvr/recordings/PVRRecording.cpp b/xbmc/pvr/recordings/PVRRecording.cpp
index 20c2d333d6..ba41549726 100644
--- a/xbmc/pvr/recordings/PVRRecording.cpp
+++ b/xbmc/pvr/recordings/PVRRecording.cpp
@@ -29,6 +29,7 @@
#include "pvr/PVRManager.h"
#include "pvr/addons/PVRClients.h"
#include "pvr/recordings/PVRRecordingsPath.h"
+#include "pvr/channels/PVRChannelGroupsContainer.h"
#include "PVRRecording.h"
@@ -112,6 +113,7 @@ CPVRRecording::CPVRRecording(const PVR_RECORDING &recording, unsigned int iClien
m_strFanartPath = recording.strFanartPath;
m_bIsDeleted = recording.bIsDeleted;
m_iEpgEventId = recording.iEpgEventId;
+ m_iChannelUid = recording.iChannelUid;
}
bool CPVRRecording::operator ==(const CPVRRecording& right) const
@@ -139,7 +141,8 @@ bool CPVRRecording::operator ==(const CPVRRecording& right) const
m_strFanartPath == right.m_strFanartPath &&
m_iRecordingId == right.m_iRecordingId &&
m_bIsDeleted == right.m_bIsDeleted &&
- m_iEpgEventId == right.m_iEpgEventId);
+ m_iEpgEventId == right.m_iEpgEventId &&
+ m_iChannelUid == right.m_iChannelUid);
}
bool CPVRRecording::operator !=(const CPVRRecording& right) const
@@ -162,6 +165,7 @@ void CPVRRecording::Serialize(CVariant& value) const
value["recordingid"] = m_iRecordingId;
value["deleted"] = m_bIsDeleted;
value["epgevent"] = m_iEpgEventId;
+ value["channeluid"] = m_iChannelUid;
if (!value.isMember("art"))
value["art"] = CVariant(CVariant::VariantTypeObject);
@@ -187,9 +191,10 @@ void CPVRRecording::Reset(void)
m_bGotMetaData = false;
m_iRecordingId = 0;
m_bIsDeleted = false;
- m_iEpgEventId = 0;
+ m_iEpgEventId = EPG_TAG_INVALID_UID;
m_iSeason = -1;
m_iEpisode = -1;
+ m_iChannelUid = PVR_CHANNEL_INVALID_UID;
m_recordingTime.Reset();
CVideoInfoTag::Reset();
@@ -217,9 +222,16 @@ bool CPVRRecording::Delete(void)
void CPVRRecording::OnDelete(void)
{
- EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::GetInstance().GetTagById(EpgEvent());
- if (epgTag)
- epgTag->ClearRecording();
+ if (m_iEpgEventId != EPG_TAG_INVALID_UID)
+ {
+ const CPVRChannelPtr channel(Channel());
+ if (channel)
+ {
+ const EPG::CEpgInfoTagPtr epgTag(EPG::CEpgContainer::GetInstance().GetTagById(channel, m_iEpgEventId));
+ if (epgTag)
+ epgTag->ClearRecording();
+ }
+ }
}
bool CPVRRecording::Undelete(void)
@@ -361,6 +373,7 @@ void CPVRRecording::Update(const CPVRRecording &tag)
m_strFanartPath = tag.m_strFanartPath;
m_bIsDeleted = tag.m_bIsDeleted;
m_iEpgEventId = tag.m_iEpgEventId;
+ m_iChannelUid = tag.m_iChannelUid;
if (g_PVRClients->SupportsRecordingPlayCount(m_iClientId))
m_playCount = tag.m_playCount;
@@ -431,21 +444,22 @@ void CPVRRecording::CopyClientInfo(CVideoInfoTag *target) const
CPVRChannelPtr CPVRRecording::Channel(void) const
{
- if (m_iEpgEventId)
- {
- EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::GetInstance().GetTagById(m_iEpgEventId);
- if (epgTag)
- return epgTag->ChannelTag();
- }
+ if (m_iChannelUid != PVR_CHANNEL_INVALID_UID)
+ return g_PVRChannelGroups->GetByUniqueID(m_iChannelUid, m_iClientId);
+
return CPVRChannelPtr();
}
bool CPVRRecording::IsBeingRecorded(void) const
{
- if (m_iEpgEventId)
+ if (m_iEpgEventId != EPG_TAG_INVALID_UID)
{
- EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::GetInstance().GetTagById(m_iEpgEventId);
- return epgTag ? epgTag->HasRecording() : false;
+ const CPVRChannelPtr channel(Channel());
+ if (channel)
+ {
+ const EPG::CEpgInfoTagPtr epgTag(EPG::CEpgContainer::GetInstance().GetTagById(channel, m_iEpgEventId));
+ return epgTag ? epgTag->HasRecording() : false;
+ }
}
return false;
}
diff --git a/xbmc/pvr/recordings/PVRRecording.h b/xbmc/pvr/recordings/PVRRecording.h
index 741ea700c6..4357df8b65 100644
--- a/xbmc/pvr/recordings/PVRRecording.h
+++ b/xbmc/pvr/recordings/PVRRecording.h
@@ -203,19 +203,24 @@ namespace PVR
bool IsDeleted() const { return m_bIsDeleted; }
/*!
- * @return Broadcast id of the EPG event associated with this recording
+ * @return Broadcast id of the EPG event associated with this recording or EPG_TAG_INVALID_UID
*/
- unsigned int EpgEvent(void) const { return m_iEpgEventId; }
+ unsigned int BroadcastUid(void) const { return m_iEpgEventId; }
+
+ /*!
+ * @return channel id associated with this recording or PVR_CHANNEL_INVALID_UID
+ */
+ int ChannelUid(void) const { return m_iChannelUid; }
/*!
* @return Get the channel on which this recording is/was running
- * @note Only works if the recording has an EPG id provided by the add-on
+ * @note Only works if the recording has a channel uid provided by the add-on
*/
CPVRChannelPtr Channel(void) const;
/*!
* @return True while the recording is running
- * @note Only works if the recording has an EPG id provided by the add-on
+ * @note Only works if the recording has a channel uid and an EPG id provided by the add-on
*/
bool IsBeingRecorded(void) const;
@@ -230,6 +235,7 @@ namespace PVR
bool m_bGotMetaData;
bool m_bIsDeleted; /*!< set if entry is a deleted recording which can be undelete */
unsigned int m_iEpgEventId; /*!< epg broadcast id associated with this recording */
+ int m_iChannelUid; /*!< channel uid associated with this recording */
void UpdatePath(void);
void DisplayError(PVR_ERROR err) const;
diff --git a/xbmc/pvr/recordings/PVRRecordings.cpp b/xbmc/pvr/recordings/PVRRecordings.cpp
index 84589d2d66..f71f9a1818 100644
--- a/xbmc/pvr/recordings/PVRRecordings.cpp
+++ b/xbmc/pvr/recordings/PVRRecordings.cpp
@@ -462,11 +462,15 @@ void CPVRRecordings::UpdateFromClient(const CPVRRecordingPtr &tag)
{
newTag = CPVRRecordingPtr(new CPVRRecording);
newTag->Update(*tag);
- if (newTag->EpgEvent() > 0)
+ if (newTag->BroadcastUid() != EPG_TAG_INVALID_UID)
{
- EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::GetInstance().GetTagById(newTag->EpgEvent());
- if (epgTag)
- epgTag->SetRecording(newTag);
+ const CPVRChannelPtr channel(newTag->Channel());
+ if (channel)
+ {
+ const EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::GetInstance().GetTagById(channel, newTag->BroadcastUid());
+ if (epgTag)
+ epgTag->SetRecording(newTag);
+ }
}
newTag->m_iRecordingId = ++m_iLastId;
m_recordings.insert(std::make_pair(CPVRRecordingUid(newTag->m_iClientId, newTag->m_strRecordingId), newTag));
@@ -477,14 +481,19 @@ void CPVRRecordings::UpdateEpgTags(void)
{
CSingleLock lock(m_critSection);
unsigned int iEpgEvent;
+ CPVRChannelPtr channel;
for (PVR_RECORDINGMAP_ITR it = m_recordings.begin(); it != m_recordings.end(); ++it)
{
- iEpgEvent = it->second->EpgEvent();
- if (iEpgEvent > 0 && !it->second->IsDeleted())
+ iEpgEvent = it->second->BroadcastUid();
+ if (iEpgEvent != EPG_TAG_INVALID_UID && !it->second->IsDeleted())
{
- EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::GetInstance().GetTagById(iEpgEvent);
- if (epgTag)
- epgTag->SetRecording(it->second);
+ channel = it->second->Channel();
+ if (channel)
+ {
+ const EPG::CEpgInfoTagPtr epgTag = EPG::CEpgContainer::GetInstance().GetTagById(channel, iEpgEvent);
+ if (epgTag)
+ epgTag->SetRecording(it->second);
+ }
}
}
}
diff --git a/xbmc/pvr/recordings/PVRRecordingsPath.cpp b/xbmc/pvr/recordings/PVRRecordingsPath.cpp
index 0c84311fba..6b5c0091fa 100644
--- a/xbmc/pvr/recordings/PVRRecordingsPath.cpp
+++ b/xbmc/pvr/recordings/PVRRecordingsPath.cpp
@@ -33,7 +33,32 @@ const std::string CPVRRecordingsPath::PATH_DELETED_RECORDINGS = "pvr://recording
CPVRRecordingsPath::CPVRRecordingsPath(const std::string &strPath)
{
- Init(strPath);
+ std::string strVarPath(TrimSlashes(strPath));
+ const std::vector<std::string> segments = URIUtils::SplitPath(strVarPath);
+
+ m_bValid = ((segments.size() >= 3) && // at least pvr://recordings/[active|deleted]
+ StringUtils::StartsWith(strVarPath, "pvr://") &&
+ (segments.at(1) == "recordings") &&
+ ((segments.at(2) == "active") || (segments.at(2) == "deleted")));
+ m_bRoot = (m_bValid && (segments.size() == 3));
+ m_bActive = (m_bValid && (segments.at(2) == "active"));
+
+ if (m_bRoot)
+ strVarPath.append("/");
+ else
+ {
+ size_t paramStart = m_path.find(", TV");
+ if (paramStart == std::string::npos)
+ m_directoryPath = strVarPath.substr(m_bActive ? PATH_ACTIVE_RECORDINGS.size() : PATH_DELETED_RECORDINGS.size());
+ else
+ {
+ size_t dirStart = m_bActive ? PATH_ACTIVE_RECORDINGS.size() : PATH_DELETED_RECORDINGS.size();
+ m_directoryPath = strVarPath.substr(dirStart, paramStart - dirStart);
+ m_params = strVarPath.substr(paramStart);
+ }
+ }
+
+ m_path = strVarPath;
}
CPVRRecordingsPath::CPVRRecordingsPath(bool bDeleted)
@@ -53,9 +78,9 @@ CPVRRecordingsPath::CPVRRecordingsPath(bool bDeleted,
m_bRoot(false),
m_bActive(!bDeleted)
{
- std::string strDirectoryN;
- if (!strDirectory.empty() && strDirectory != "/")
- strDirectoryN = StringUtils::Format("%s/", strDirectory.c_str());
+ std::string strDirectoryN(TrimSlashes(strDirectory));
+ if (!strDirectoryN.empty())
+ strDirectoryN = StringUtils::Format("%s/", strDirectoryN.c_str());
std::string strTitleN(strTitle);
StringUtils::Replace(strTitleN, '/', ' ');
@@ -89,46 +114,10 @@ CPVRRecordingsPath::CPVRRecordingsPath(bool bDeleted,
m_path = StringUtils::Format("pvr://recordings/%s/%s%s", bDeleted ? "deleted" : "active", m_directoryPath.c_str(), m_params.c_str());
}
-void CPVRRecordingsPath::Init(const std::string &strPath)
-{
- std::string strVarPath(strPath);
- URIUtils::RemoveSlashAtEnd(strVarPath);
-
- const std::vector<std::string> segments = URIUtils::SplitPath(strVarPath);
-
- m_bValid = ((segments.size() >= 3) && // at least pvr://recordings/[active|deleted]
- (segments.at(1) == "recordings") &&
- ((segments.at(2) == "active") || (segments.at(2) == "deleted")));
- m_bRoot = (m_bValid && (segments.size() == 3));
- m_bActive = (m_bValid && (segments.at(2) == "active"));
-
- if (m_bRoot)
- strVarPath.append("/");
- else
- {
- size_t paramStart = m_path.find(", TV");
- if (paramStart == std::string::npos)
- m_directoryPath = strVarPath.substr(m_bActive ? PATH_ACTIVE_RECORDINGS.size(): PATH_DELETED_RECORDINGS.size());
- else
- {
- size_t dirStart = m_bActive ? PATH_ACTIVE_RECORDINGS.size(): PATH_DELETED_RECORDINGS.size();
- m_directoryPath = strVarPath.substr(dirStart, paramStart - dirStart);
- m_params = strVarPath.substr(paramStart);
- }
- }
-
- m_path = strVarPath;
-}
-
std::string CPVRRecordingsPath::GetSubDirectoryPath(const std::string &strPath) const
{
std::string strReturn;
-
- std::string strUsePath(strPath);
- while (!strUsePath.empty() && strUsePath.at(0) == '/')
- strUsePath.erase(0, 1);
-
- URIUtils::RemoveSlashAtEnd(strUsePath);
+ std::string strUsePath(TrimSlashes(strPath));
/* adding "/" to make sure that base matches the complete folder name and not only parts of it */
if (!m_directoryPath.empty() && (strUsePath.size() <= m_directoryPath.size() || !StringUtils::StartsWith(strUsePath, m_directoryPath + "/")))
@@ -165,17 +154,45 @@ const std::string CPVRRecordingsPath::GetTitle() const
void CPVRRecordingsPath::AppendSegment(const std::string &strSegment)
{
+ if (!m_bValid || strSegment.empty() || strSegment == "/")
+ return;
+
+ std::string strVarSegment(TrimSlashes(strSegment));
+
+ if (!m_directoryPath.empty() && m_directoryPath.back() != '/')
+ m_directoryPath.push_back('/');
+
m_directoryPath += strSegment;
size_t paramStart = m_path.find(", TV");
if (paramStart == std::string::npos)
{
+ if (!m_path.empty() && m_path.back() != '/')
+ m_path.push_back('/');
+
// append the segment
m_path += strSegment;
}
else
{
+ if (m_path.back() != '/')
+ m_path.insert(paramStart, "/");
+
// insert the segment between end of current directory path and parameters
m_path.insert(paramStart, strSegment);
}
+
+ m_bRoot = false;
+}
+
+std::string CPVRRecordingsPath::TrimSlashes(const std::string &strString)
+{
+ std::string strTrimmed(strString);
+ while (!strTrimmed.empty() && strTrimmed.front() == '/')
+ strTrimmed.erase(0, 1);
+
+ while (!strTrimmed.empty() && strTrimmed.back() == '/')
+ strTrimmed.pop_back();
+
+ return strTrimmed;
}
diff --git a/xbmc/pvr/recordings/PVRRecordingsPath.h b/xbmc/pvr/recordings/PVRRecordingsPath.h
index 531413b798..84ebbb7049 100644
--- a/xbmc/pvr/recordings/PVRRecordingsPath.h
+++ b/xbmc/pvr/recordings/PVRRecordingsPath.h
@@ -55,7 +55,7 @@ namespace PVR
void AppendSegment(const std::string &strSegment);
private:
- void Init(const std::string &strPath);
+ static std::string TrimSlashes(const std::string &strString);
bool m_bValid;
bool m_bRoot;
diff --git a/xbmc/pvr/timers/PVRTimerInfoTag.cpp b/xbmc/pvr/timers/PVRTimerInfoTag.cpp
index bf8df114de..c631156c1b 100644
--- a/xbmc/pvr/timers/PVRTimerInfoTag.cpp
+++ b/xbmc/pvr/timers/PVRTimerInfoTag.cpp
@@ -45,12 +45,13 @@ using KODI::MESSAGING::HELPERS::DialogResponse;
CPVRTimerInfoTag::CPVRTimerInfoTag(bool bRadio /* = false */) :
m_strTitle(g_localizeStrings.Get(19056)), // New Timer
- m_bFullTextEpgSearch(false)
+ m_bFullTextEpgSearch(false),
+ m_iEpgUid(EPG_TAG_INVALID_UID)
{
m_iClientId = g_PVRClients->GetFirstConnectedClientID();
m_iClientIndex = PVR_TIMER_NO_CLIENT_INDEX;
m_iParentClientIndex = PVR_TIMER_NO_PARENT;
- m_iClientChannelUid = PVR_INVALID_CHANNEL_UID;
+ m_iClientChannelUid = PVR_CHANNEL_INVALID_UID;
m_iPriority = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_DEFAULTPRIORITY);
m_iLifetime = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_DEFAULTLIFETIME);
m_iMaxRecordings = 0;
@@ -60,8 +61,6 @@ CPVRTimerInfoTag::CPVRTimerInfoTag(bool bRadio /* = false */) :
m_bIsRadio = bRadio;
m_iMarginStart = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_MARGINSTART);
m_iMarginEnd = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_MARGINEND);
- m_iGenreType = 0;
- m_iGenreSubType = 0;
m_StartTime = CDateTime::GetUTCDateTime();
m_StopTime = m_StartTime;
m_bStartAnyTime = false;
@@ -96,7 +95,8 @@ CPVRTimerInfoTag::CPVRTimerInfoTag(const PVR_TIMER &timer, const CPVRChannelPtr
m_strTitle(timer.strTitle),
m_strEpgSearchString(timer.strEpgSearchString),
m_bFullTextEpgSearch(timer.bFullTextEpgSearch),
- m_strDirectory(timer.strDirectory)
+ m_strDirectory(timer.strDirectory),
+ m_iEpgUid(timer.iEpgUid)
{
m_iClientId = iClientId;
m_iClientIndex = timer.iClientIndex;
@@ -105,7 +105,7 @@ CPVRTimerInfoTag::CPVRTimerInfoTag(const PVR_TIMER &timer, const CPVRChannelPtr
CLog::Log(LOGERROR, "%s: invalid client index supplied by client %d (must be > 0)!", __FUNCTION__, m_iClientId);
m_iParentClientIndex = timer.iParentClientIndex;
- m_iClientChannelUid = channel ? channel->UniqueID() : (timer.iClientChannelUid > 0) ? timer.iClientChannelUid : PVR_INVALID_CHANNEL_UID;
+ m_iClientChannelUid = channel ? channel->UniqueID() : (timer.iClientChannelUid > 0) ? timer.iClientChannelUid : PVR_CHANNEL_INVALID_UID;
m_iChannelNumber = channel ? g_PVRChannelGroups->GetGroupAll(channel->IsRadio())->GetChannelNumber(channel) : 0;
m_StartTime = timer.startTime + g_advancedSettings.m_iPVRTimeCorrection;
m_StopTime = timer.endTime + g_advancedSettings.m_iPVRTimeCorrection;
@@ -120,9 +120,6 @@ CPVRTimerInfoTag::CPVRTimerInfoTag(const PVR_TIMER &timer, const CPVRChannelPtr
m_iMaxRecordings = timer.iMaxRecordings;
m_iMarginStart = timer.iMarginStart;
m_iMarginEnd = timer.iMarginEnd;
- m_genre = StringUtils::Split(CEpg::ConvertGenreIdToString(timer.iGenreType, timer.iGenreSubType), g_advancedSettings.m_videoItemSeparator);
- m_iGenreType = timer.iGenreType;
- m_iGenreSubType = timer.iGenreSubType;
m_channel = channel;
m_bIsRadio = channel && channel->IsRadio();
m_state = timer.state;
@@ -169,6 +166,8 @@ CPVRTimerInfoTag::CPVRTimerInfoTag(const PVR_TIMER &timer, const CPVRChannelPtr
if (!m_timerType)
CLog::Log(LOGERROR, "%s: no timer type, although timers are supported by client %d!", __FUNCTION__, m_iClientId);
+ else if (m_iEpgUid == EPG_TAG_INVALID_UID && m_timerType->IsOnetimeEpgBased())
+ CLog::Log(LOGERROR, "%s: no epg tag given for epg based timer type (%d)!", __FUNCTION__, m_timerType->GetTypeId());
}
UpdateSummary();
@@ -210,6 +209,7 @@ bool CPVRTimerInfoTag::operator ==(const CPVRTimerInfoTag& right) const
m_state == right.m_state &&
m_timerType == right.m_timerType &&
m_iTimerId == right.m_iTimerId &&
+ m_iEpgUid == right.m_iEpgUid &&
m_iActiveChildTimers == right.m_iActiveChildTimers &&
m_bHasChildConflictNOK== right.m_bHasChildConflictNOK &&
m_bHasChildRecording == right.m_bHasChildRecording &&
@@ -327,6 +327,7 @@ void CPVRTimerInfoTag::Serialize(CVariant &value) const
value["fulltextepgsearch"] = m_bFullTextEpgSearch;
value["recordinggroup"] = m_iRecordingGroup;
value["maxrecordings"] = m_iMaxRecordings;
+ value["epguid"] = m_iEpgUid;
}
int CPVRTimerInfoTag::Compare(const CPVRTimerInfoTag &timer) const
@@ -623,10 +624,8 @@ bool CPVRTimerInfoTag::UpdateEntry(const CPVRTimerInfoTagPtr &tag)
m_bIsRadio = tag->m_bIsRadio;
m_iMarginStart = tag->m_iMarginStart;
m_iMarginEnd = tag->m_iMarginEnd;
+ m_iEpgUid = tag->m_iEpgUid;
m_epgTag = tag->m_epgTag;
- m_genre = tag->m_genre;
- m_iGenreType = tag->m_iGenreType;
- m_iGenreSubType = tag->m_iGenreSubType;
m_strSummary = tag->m_strSummary;
SetTimerType(tag->m_timerType);
@@ -701,16 +700,6 @@ void CPVRTimerInfoTag::DisplayError(PVR_ERROR err) const
CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19110}); /* print info dialog "Unknown error!" */
}
-void CPVRTimerInfoTag::SetEpgInfoTag(CEpgInfoTagPtr &tag)
-{
- CSingleLock lock(m_critSection);
- if (tag && *m_epgTag != *tag)
- CLog::Log(LOGINFO, "CPVRTimerInfoTag: timer %s set to epg event %s", m_strTitle.c_str(), tag->Title().c_str());
- else if (!tag && m_epgTag)
- CLog::Log(LOGINFO, "CPVRTimerInfoTag: timer %s set to no epg event", m_strTitle.c_str());
- m_epgTag = tag;
-}
-
int CPVRTimerInfoTag::ChannelNumber() const
{
CPVRChannelPtr channeltag = ChannelTag();
@@ -780,9 +769,8 @@ CPVRTimerInfoTagPtr CPVRTimerInfoTag::CreateFromEpg(const CEpgInfoTagPtr &tag, b
newTag->m_iClientChannelUid = channel->UniqueID();
newTag->m_iClientId = channel->ClientID();
newTag->m_bIsRadio = channel->IsRadio();
- newTag->m_iGenreType = tag->GenreType();
- newTag->m_iGenreSubType = tag->GenreSubType();
newTag->m_channel = channel;
+ newTag->m_iEpgUid = tag->UniqueBroadcastID();
newTag->SetStartFromUTC(newStart);
newTag->SetEndFromUTC(newEnd);
@@ -809,7 +797,6 @@ CPVRTimerInfoTagPtr CPVRTimerInfoTag::CreateFromEpg(const CEpgInfoTagPtr &tag, b
newTag->SetTimerType(timerType);
newTag->UpdateSummary();
- newTag->m_epgTag = g_EpgContainer.GetById(tag->EpgID())->GetTag(tag->StartAsUTC());
/* unused only for reference */
newTag->m_strFileNameAndPath = CPVRTimersPath::PATH_NEW;
@@ -921,16 +908,51 @@ std::string CPVRTimerInfoTag::GetDeletedNotificationText() const
CEpgInfoTagPtr CPVRTimerInfoTag::GetEpgInfoTag(void) const
{
+ return GetEpgInfoTag(true);
+}
+
+CEpgInfoTagPtr CPVRTimerInfoTag::GetEpgInfoTag(bool bSetTimer) const
+{
+ CSingleLock lock(m_critSection);
+ if (!m_epgTag)
+ {
+ const CPVRChannelPtr channel(g_PVRChannelGroups->GetByUniqueID(m_iClientChannelUid, m_iClientId));
+ if (channel)
+ {
+ const CEpgPtr epg(channel->GetEPG());
+ if (epg)
+ {
+ if (m_iEpgUid != EPG_TAG_INVALID_UID)
+ {
+ m_epgTag = epg->GetTagByBroadcastId(m_iEpgUid);
+ }
+ else if (!m_bStartAnyTime && !m_bEndAnyTime)
+ {
+ // if no epg uid present, try to find a tag according to timer's start/end time
+ m_epgTag = epg->GetTagBetween(StartAsUTC() - CDateTimeSpan(0, 0, 2, 0), EndAsUTC() + CDateTimeSpan(0, 0, 2, 0));
+ }
+
+ if (m_epgTag && bSetTimer)
+ m_epgTag->SetTimer(m_iTimerId);
+ }
+ }
+ }
+
return m_epgTag;
}
bool CPVRTimerInfoTag::HasEpgInfoTag(void) const
{
- return m_epgTag != NULL;
+ CSingleLock lock(m_critSection);
+ GetEpgInfoTag();
+ return m_epgTag.get() != NULL;
}
bool CPVRTimerInfoTag::HasSeriesEpgInfoTag(void) const
{
+ CSingleLock lock(m_critSection);
+ GetEpgInfoTag();
+
if (m_epgTag &&
(m_epgTag->IsSeries() ||
m_epgTag->SeriesNumber() > 0 ||
@@ -946,11 +968,14 @@ void CPVRTimerInfoTag::ClearEpgTag(void)
CEpgInfoTagPtr deletedTag;
{
+ // important: do not just check for m_epgtag here, but do actually obtain it.
+ // epg tag may have 'this' set as timer. we need to clear the timer explicitely.
+ // otherwise epg tags with dangling timers will float around until kodi restart.
+
CSingleLock lock(m_critSection);
- deletedTag = m_epgTag;
+ deletedTag = GetEpgInfoTag(false); // get the tag, but do not set 'this' as timer at the tag, otherwise stack overflow ;-)
- CEpgInfoTagPtr emptyTag;
- m_epgTag = emptyTag;
+ m_epgTag.reset();
}
if (deletedTag)
diff --git a/xbmc/pvr/timers/PVRTimerInfoTag.h b/xbmc/pvr/timers/PVRTimerInfoTag.h
index 419993abed..9b39a8209a 100644
--- a/xbmc/pvr/timers/PVRTimerInfoTag.h
+++ b/xbmc/pvr/timers/PVRTimerInfoTag.h
@@ -98,7 +98,12 @@ namespace PVR
bool SetDuration(int iDuration);
static CPVRTimerInfoTagPtr CreateFromEpg(const EPG::CEpgInfoTagPtr &tag, bool bRepeating = false);
+
+ /*!
+ * @return Return corresponding epg info tag, NULL otherwise
+ */
EPG::CEpgInfoTagPtr GetEpgInfoTag(void) const;
+
/*!
* @return True if this timer has a corresponding epg info tag, false otherwise
*/
@@ -230,7 +235,6 @@ namespace PVR
bool RenameOnClient(const std::string &strNewName);
bool UpdateOnClient();
- void SetEpgInfoTag(EPG::CEpgInfoTagPtr &tag);
void ClearEpgTag(void);
void UpdateChannel(void);
@@ -276,15 +280,13 @@ namespace PVR
CPVRChannelPtr m_channel;
unsigned int m_iMarginStart; /*!< @brief (optional) if set, the backend starts the recording iMarginStart minutes before startTime. */
unsigned int m_iMarginEnd; /*!< @brief (optional) if set, the backend ends the recording iMarginEnd minutes after endTime. */
- std::vector<std::string> m_genre; /*!< @brief genre of the timer */
- int m_iGenreType; /*!< @brief genre type of the timer */
- int m_iGenreSubType; /*!< @brief genre subtype of the timer */
private:
std::string GetWeekdaysString() const;
+ EPG::CEpgInfoTagPtr GetEpgInfoTag(bool bSetTimer) const;
CCriticalSection m_critSection;
- EPG::CEpgInfoTagPtr m_epgTag;
+ unsigned int m_iEpgUid; /*!< id of epg event associated with this timer, EPG_TAG_INVALID_UID if none. */
CDateTime m_StartTime; /*!< start time */
CDateTime m_StopTime; /*!< stop time */
CDateTime m_FirstDay; /*!< if it is a manual repeating timer the first date it starts */
@@ -294,5 +296,7 @@ namespace PVR
bool m_bHasChildConflictNOK; /*!< @brief Has at least one child timer with status PVR_TIMER_STATE_CONFLICT_NOK */
bool m_bHasChildRecording; /*!< @brief Has at least one child timer with status PVR_TIMER_STATE_RECORDING */
bool m_bHasChildErrors; /*!< @brief Has at least one child timer with status PVR_TIMER_STATE_ERROR */
+
+ mutable EPG::CEpgInfoTagPtr m_epgTag; /*!< epg info tag matching m_iEpgUid. */
};
}
diff --git a/xbmc/pvr/timers/PVRTimers.cpp b/xbmc/pvr/timers/PVRTimers.cpp
index 93ad34a742..6a318ec8a9 100644
--- a/xbmc/pvr/timers/PVRTimers.cpp
+++ b/xbmc/pvr/timers/PVRTimers.cpp
@@ -124,7 +124,6 @@ bool CPVRTimers::UpdateEntries(const CPVRTimers &timers)
if (existingTimer->UpdateEntry(*timerIt))
{
bChanged = true;
- UpdateEpgEvent(existingTimer);
existingTimer->ResetChildState();
if (bStateChanged && g_PVRManager.IsStarted())
@@ -143,7 +142,6 @@ bool CPVRTimers::UpdateEntries(const CPVRTimers &timers)
/* new timer */
CPVRTimerInfoTagPtr newTimer = CPVRTimerInfoTagPtr(new CPVRTimerInfoTag);
newTimer->UpdateEntry(*timerIt);
- UpdateEpgEvent(newTimer);
VecTimerInfoTag* addEntry = NULL;
MapTags::iterator itr = m_tags.find(newTimer->m_bStartAnyTime ? CDateTime() : newTimer->StartAsUTC());
@@ -159,7 +157,6 @@ bool CPVRTimers::UpdateEntries(const CPVRTimers &timers)
newTimer->m_iTimerId = ++m_iLastId;
addEntry->push_back(newTimer);
- UpdateEpgEvent(newTimer);
bChanged = true;
bAddedOrDeleted = true;
@@ -246,7 +243,6 @@ bool CPVRTimers::UpdateEntries(const CPVRTimers &timers)
}
addEntry->push_back(*timerIt);
- UpdateEpgEvent(*timerIt);
}
/* update child information for all parent timers */
@@ -314,8 +310,6 @@ bool CPVRTimers::UpdateFromClient(const CPVRTimerInfoTagPtr &timer)
addEntry->push_back(tag);
}
- UpdateEpgEvent(tag);
-
return tag->UpdateEntry(timer);
}
@@ -818,43 +812,6 @@ CDateTime CPVRTimers::GetNextEventTime(void) const
return retVal;
}
-void CPVRTimers::UpdateEpgEvent(CPVRTimerInfoTagPtr timer)
-{
- CSingleLock lock(timer->m_critSection);
-
- /* repeating timers have no epg event */
- if (timer->IsRepeating())
- return;
-
- /* already got an epg event set */
- if (timer->m_epgTag)
- return;
-
- /* try to get the channel */
- CPVRChannelPtr channel = g_PVRChannelGroups->GetByUniqueID(timer->m_iClientChannelUid, timer->m_iClientId);
- if (!channel)
- return;
-
- /* try to get the EPG table */
- CEpgPtr epg = channel->GetEPG();
- if (!epg)
- return;
-
- /* try to set the timer on the epg tag that matches with a 2 minute margin */
- CEpgInfoTagPtr epgTag = epg->GetTagBetween(timer->StartAsUTC() - CDateTimeSpan(0, 0, 2, 0), timer->EndAsUTC() + CDateTimeSpan(0, 0, 2, 0));
- if (!epgTag)
- epgTag = epg->GetTagAround(timer->StartAsUTC());
-
- if (epgTag)
- {
- timer->m_epgTag = epgTag;
- timer->m_genre = epgTag->Genre();
- timer->m_iGenreType = epgTag->GenreType();
- timer->m_iGenreSubType = epgTag->GenreSubType();
- epgTag->SetTimer(timer);
- }
-}
-
void CPVRTimers::UpdateChannels(void)
{
CSingleLock lock(m_critSection);
diff --git a/xbmc/pvr/timers/PVRTimers.h b/xbmc/pvr/timers/PVRTimers.h
index af10013b42..a71dce08d7 100644
--- a/xbmc/pvr/timers/PVRTimers.h
+++ b/xbmc/pvr/timers/PVRTimers.h
@@ -198,7 +198,6 @@ namespace PVR
typedef std::vector<CPVRTimerInfoTagPtr> VecTimerInfoTag;
void Unload(void);
- void UpdateEpgEvent(CPVRTimerInfoTagPtr timer);
bool UpdateEntries(const CPVRTimers &timers);
CPVRTimerInfoTagPtr GetByClient(int iClientId, unsigned int iClientTimerId) const;
bool GetRootDirectory(const CPVRTimersPath &path, CFileItemList &items) const;
diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp
index 1992dd87d1..3e6231dfb4 100644
--- a/xbmc/settings/AdvancedSettings.cpp
+++ b/xbmc/settings/AdvancedSettings.cpp
@@ -261,7 +261,6 @@ void CAdvancedSettings::Initialize()
m_fanartRes = 1080;
m_imageRes = 720;
- m_useDDSFanart = false;
m_imageScalingAlgorithm = CPictureScalingAlgorithm::Default;
m_sambaclienttimeout = 10;
@@ -961,9 +960,6 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file)
XMLUtils::GetFloat(pRootElement, "controllerdeadzone", m_controllerDeadzone, 0.0f, 1.0f);
XMLUtils::GetUInt(pRootElement, "fanartres", m_fanartRes, 0, 1080);
XMLUtils::GetUInt(pRootElement, "imageres", m_imageRes, 0, 1080);
-#if !defined(TARGET_RASPBERRY_PI)
- XMLUtils::GetBoolean(pRootElement, "useddsfanart", m_useDDSFanart);
-#endif
if (XMLUtils::GetString(pRootElement, "imagescalingalgorithm", tmp))
m_imageScalingAlgorithm = CPictureScalingAlgorithm::FromString(tmp);
XMLUtils::GetBoolean(pRootElement, "playlistasfolders", m_playlistAsFolders);
diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h
index 065e95c20f..a9b8fce3ef 100644
--- a/xbmc/settings/AdvancedSettings.h
+++ b/xbmc/settings/AdvancedSettings.h
@@ -238,7 +238,6 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler
Used for actual thumbs (eg bookmark thumbs, picture thumbs) rather than cover art which uses m_imageRes instead
*/
unsigned int GetThumbSize() const { return m_imageRes / 2; };
- bool m_useDDSFanart;
CPictureScalingAlgorithm::Algorithm m_imageScalingAlgorithm;
int m_sambaclienttimeout;
diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp
index 3c929e70d7..8ef1d0e2ac 100644
--- a/xbmc/settings/Settings.cpp
+++ b/xbmc/settings/Settings.cpp
@@ -1159,6 +1159,7 @@ void CSettings::InitializeISettingCallbacks()
settingSet.insert(CSettings::SETTING_PVRCLIENT_MENUHOOK);
settingSet.insert(CSettings::SETTING_PVRMENU_SEARCHICONS);
settingSet.insert(CSettings::SETTING_EPG_RESETEPG);
+ settingSet.insert(CSettings::SETTING_EPG_DAYSTODISPLAY);
settingSet.insert(CSettings::SETTING_PVRPARENTAL_ENABLED);
m_settingsManager->RegisterCallback(&PVR::g_PVRManager, settingSet);
diff --git a/xbmc/test/xbmc-test.cpp b/xbmc/test/xbmc-test.cpp
index 68a2409aa1..3492301f60 100644
--- a/xbmc/test/xbmc-test.cpp
+++ b/xbmc/test/xbmc-test.cpp
@@ -29,21 +29,11 @@
#include <cstdio>
#include <cstdlib>
-class NullLogger : public XbmcCommons::ILogger
-{
-public:
- void log(int loglevel, const char* message) {}
-};
-
int main(int argc, char **argv)
{
testing::InitGoogleTest(&argc, argv);
CXBMCTestUtils::Instance().ParseArgs(argc, argv);
- // we need to configure CThread to use a dummy logger
- NullLogger* nullLogger = new NullLogger();
- CThread::SetLogger(nullLogger);
-
if (!testing::AddGlobalTestEnvironment(new TestBasicEnvironment()))
{
fprintf(stderr, "Unable to add basic test environment.\n");
@@ -51,7 +41,5 @@ int main(int argc, char **argv)
}
int ret = RUN_ALL_TESTS();
- delete nullLogger;
-
return ret;
}
diff --git a/xbmc/threads/platform/pthreads/ThreadImpl.cpp b/xbmc/threads/platform/pthreads/ThreadImpl.cpp
index 70b6ac0276..99c3dbe448 100644
--- a/xbmc/threads/platform/pthreads/ThreadImpl.cpp
+++ b/xbmc/threads/platform/pthreads/ThreadImpl.cpp
@@ -18,7 +18,9 @@
*
*/
-#include "config.h"
+#if defined(HAVE_CONFIG_H)
+ #include "config.h"
+#endif
#include <limits.h>
#if defined(TARGET_ANDROID)
#include <unistd.h>
diff --git a/xbmc/utils/CPUInfo.cpp b/xbmc/utils/CPUInfo.cpp
index 6b323aa04b..054c9667b0 100644
--- a/xbmc/utils/CPUInfo.cpp
+++ b/xbmc/utils/CPUInfo.cpp
@@ -412,6 +412,14 @@ CCPUInfo::CCPUInfo(void)
}
}
fclose(fCPUInfo);
+ // /proc/cpuinfo is not reliable on some Android platforms
+ // At least we should get the correct cpu count for multithreaded decoding
+#if defined(TARGET_ANDROID)
+ if (CAndroidFeatures::GetCPUCount() > m_cpuCount)
+ {
+ m_cpuCount = CAndroidFeatures::GetCPUCount();
+ }
+#endif
}
else
{
diff --git a/xbmc/utils/LabelFormatter.cpp b/xbmc/utils/LabelFormatter.cpp
index 58c2f6ddf6..cc4fe49b2c 100644
--- a/xbmc/utils/LabelFormatter.cpp
+++ b/xbmc/utils/LabelFormatter.cpp
@@ -108,7 +108,7 @@ using namespace MUSIC_INFO;
* *t - Date Taken (suitable for Pictures)
*/
-#define MASK_CHARS "NSATBGYFLDIJRCKMEPHZOQUVXWacdiprtuv"
+#define MASK_CHARS "NSATBGYFLDIJRCKMEPHZOQUVXWacdiprstuv"
CLabelFormatter::CLabelFormatter(const std::string &mask, const std::string &mask2)
{
@@ -348,17 +348,21 @@ std::string CLabelFormatter::GetMaskContent(const CMaskString &mask, const CFile
if (pic && pic->GetDateTimeTaken().IsValid())
value = pic->GetDateTimeTaken().GetAsLocalizedDate();
break;
+ case 's': // Addon status
+ if (item->HasProperty("Addon.Status"))
+ value = item->GetProperty("Addon.Status").asString();
+ break;
case 'i': // Install date
- if (item->HasAddonInfo())
- value = item->GetAddonInfo()->InstallDate().GetAsLocalizedDateTime();
+ if (item->HasAddonInfo() && item->GetAddonInfo()->InstallDate().IsValid())
+ value = item->GetAddonInfo()->InstallDate().GetAsLocalizedDate();
break;
case 'u': // Last used
- if (item->HasAddonInfo())
- value = item->GetAddonInfo()->LastUsed().GetAsLocalizedDateTime();
+ if (item->HasAddonInfo() && item->GetAddonInfo()->LastUsed().IsValid())
+ value = item->GetAddonInfo()->LastUsed().GetAsLocalizedDate();
break;
case 'v': // Last updated
- if (item->HasAddonInfo())
- value = item->GetAddonInfo()->LastUpdated().GetAsLocalizedDateTime();
+ if (item->HasAddonInfo() && item->GetAddonInfo()->LastUpdated().IsValid())
+ value = item->GetAddonInfo()->LastUpdated().GetAsLocalizedDate();
break;
}
if (!value.empty())
diff --git a/xbmc/utils/SortUtils.cpp b/xbmc/utils/SortUtils.cpp
index 4566917a0d..034cac1cef 100644
--- a/xbmc/utils/SortUtils.cpp
+++ b/xbmc/utils/SortUtils.cpp
@@ -1034,7 +1034,10 @@ const std::map<std::string, SortBy> sortMethods = {
{ "channel", SortByChannel },
{ "channelnumber", SortByChannelNumber },
{ "datetaken", SortByDateTaken },
- { "userrating", SortByUserRating }
+ { "userrating", SortByUserRating },
+ { "installdate", SortByInstallDate },
+ { "lastupdated", SortByLastUpdated },
+ { "lastused", SortByLastUsed },
};
SortBy SortUtils::SortMethodFromString(const std::string& sortMethod)
diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp
index ea42ead3ed..0fd0851ba1 100644
--- a/xbmc/video/VideoDatabase.cpp
+++ b/xbmc/video/VideoDatabase.cpp
@@ -6944,10 +6944,9 @@ ScraperPtr CVideoDatabase::GetScraperForPath(const std::string& strPath, SScanSe
std::string scraperID = m_pDS->fv("path.strScraper").get_asString();
AddonPtr addon;
- if (!scraperID.empty() &&
- CAddonMgr::GetInstance().GetAddon(scraperID, addon))
+ if (!scraperID.empty() && CAddonMgr::GetInstance().GetAddon(scraperID, addon))
{
- scraper = std::dynamic_pointer_cast<CScraper>(addon->Clone());
+ scraper = std::dynamic_pointer_cast<CScraper>(addon);
if (!scraper)
return ScraperPtr();
@@ -6990,7 +6989,7 @@ ScraperPtr CVideoDatabase::GetScraperForPath(const std::string& strPath, SScanSe
if (content != CONTENT_NONE &&
CAddonMgr::GetInstance().GetAddon(m_pDS->fv("path.strScraper").get_asString(), addon))
{
- scraper = std::dynamic_pointer_cast<CScraper>(addon->Clone());
+ scraper = std::dynamic_pointer_cast<CScraper>(addon);
scraper->SetPathSettings(content, m_pDS->fv("path.strSettings").get_asString());
settings.parent_name = m_pDS->fv("path.useFolderNames").get_asBool();
settings.recurse = m_pDS->fv("path.scanRecursive").get_asInt();
diff --git a/xbmc/video/videosync/CMakeLists.txt b/xbmc/video/videosync/CMakeLists.txt
index eee9fa1dfe..d2cec857bb 100644
--- a/xbmc/video/videosync/CMakeLists.txt
+++ b/xbmc/video/videosync/CMakeLists.txt
@@ -1,5 +1,3 @@
-set(SOURCES)
-
set(HEADERS VideoSync.h)
if(CORE_SYSTEM_NAME STREQUAL "rbpi")
diff --git a/xbmc/video/windows/CMakeLists.txt b/xbmc/video/windows/CMakeLists.txt
index efa84c55be..909635aa09 100644
--- a/xbmc/video/windows/CMakeLists.txt
+++ b/xbmc/video/windows/CMakeLists.txt
@@ -12,3 +12,7 @@ set(HEADERS GUIWindowFullScreen.h
core_add_library(video_windows)
add_dependencies(video_windows libcpluff)
+
+if(ENABLE_INTERNAL_FFMPEG)
+ add_dependencies(video_windows ffmpeg)
+endif()
diff --git a/xbmc/video/windows/GUIWindowVideoBase.cpp b/xbmc/video/windows/GUIWindowVideoBase.cpp
index ef24860f62..f0362e7487 100644
--- a/xbmc/video/windows/GUIWindowVideoBase.cpp
+++ b/xbmc/video/windows/GUIWindowVideoBase.cpp
@@ -1127,63 +1127,68 @@ bool CGUIWindowVideoBase::OnPlayMedia(int iItem, const std::string &player)
CLog::Log(LOGDEBUG, "%s %s", __FUNCTION__, CURL::GetRedacted(item.GetPath()).c_str());
- CPVRRecordingsPath path(item.GetPath());
- if (path.IsValid() && path.IsActive())
+ // TODO: delete entire block in v18
+ // m_strStreamURL is deprecated
+ if (item.IsPVR())
{
- if (!g_PVRManager.IsStarted())
- return false;
-
- /* For recordings we check here for a available stream URL */
- CFileItemPtr tag = g_PVRRecordings->GetByPath(item.GetPath());
- if (tag && tag->HasPVRRecordingInfoTag() && !tag->GetPVRRecordingInfoTag()->m_strStreamURL.empty())
+ CPVRRecordingsPath path(item.GetPath());
+ if (path.IsValid() && path.IsActive())
{
- std::string stream = tag->GetPVRRecordingInfoTag()->m_strStreamURL;
-
- /* Isolate the folder from the filename */
- size_t found = stream.find_last_of("/");
- if (found == std::string::npos)
- found = stream.find_last_of("\\");
+ if (!g_PVRManager.IsStarted())
+ return false;
- if (found != std::string::npos)
+ /* For recordings we check here for a available stream URL */
+ CFileItemPtr tag = g_PVRRecordings->GetByPath(item.GetPath());
+ if (tag && tag->HasPVRRecordingInfoTag() && !tag->GetPVRRecordingInfoTag()->m_strStreamURL.empty())
{
- /* Check here for asterix at the begin of the filename */
- if (stream[found+1] == '*')
- {
- /* Create a "stack://" url with all files matching the extension */
- std::string ext = URIUtils::GetExtension(stream);
- std::string dir = stream.substr(0, found).c_str();
+ std::string stream = tag->GetPVRRecordingInfoTag()->m_strStreamURL;
- CFileItemList items;
- CDirectory::GetDirectory(dir, items);
- items.Sort(SortByFile, SortOrderAscending);
+ /* Isolate the folder from the filename */
+ size_t found = stream.find_last_of("/");
+ if (found == std::string::npos)
+ found = stream.find_last_of("\\");
- std::vector<int> stack;
- for (int i = 0; i < items.Size(); ++i)
+ if (found != std::string::npos)
+ {
+ /* Check here for asterix at the begin of the filename */
+ if (stream[found+1] == '*')
{
- if (URIUtils::HasExtension(items[i]->GetPath(), ext))
- stack.push_back(i);
+ /* Create a "stack://" url with all files matching the extension */
+ std::string ext = URIUtils::GetExtension(stream);
+ std::string dir = stream.substr(0, found).c_str();
+
+ CFileItemList items;
+ CDirectory::GetDirectory(dir, items);
+ items.Sort(SortByFile, SortOrderAscending);
+
+ std::vector<int> stack;
+ for (int i = 0; i < items.Size(); ++i)
+ {
+ if (URIUtils::HasExtension(items[i]->GetPath(), ext))
+ stack.push_back(i);
+ }
+
+ if (stack.size() > 0)
+ {
+ /* If we have a stack change the path of the item to it */
+ CStackDirectory dir;
+ std::string stackPath = dir.ConstructStackPath(items, stack);
+ item.SetPath(stackPath);
+ }
}
-
- if (stack.size() > 0)
+ else
{
- /* If we have a stack change the path of the item to it */
- CStackDirectory dir;
- std::string stackPath = dir.ConstructStackPath(items, stack);
- item.SetPath(stackPath);
+ /* If no asterix is present play only the given stream URL */
+ item.SetPath(stream);
}
}
else
{
- /* If no asterix is present play only the given stream URL */
- item.SetPath(stream);
+ CLog::Log(LOGERROR, "CGUIWindowTV: Can't open recording, no valid filename!");
+ CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19036});
+ return false;
}
}
- else
- {
- CLog::Log(LOGERROR, "CGUIWindowTV: Can't open recording, no valid filename!");
- CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19036});
- return false;
- }
}
}