From 2362da2ad03d84569da9cf558a84b9942afac852 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 8 Mar 2010 20:29:26 +0000 Subject: [PATCH] Add config option for switching between CSJ2K and BuggyJPEG. --- .../Agent/TextureSender/J2KDecoderModule.cs | 12 +++++++++--- bin/OpenSim.ini.example | 4 ++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index 5b022acf09..1386e86729 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs @@ -60,6 +60,8 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender #region IRegionModule + private bool m_useCSJ2K = true; + public string Name { get { return "J2KDecoderModule"; } } public bool IsSharedModule { get { return true; } } @@ -73,6 +75,12 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender m_scene = scene; scene.RegisterModuleInterface(this); + + IConfig startupConfig = source.Configs["Startup"]; + if (startupConfig != null) + { + m_useCSJ2K = startupConfig.GetBoolean("UseCSJ2K", m_useCSJ2K); + } } public void PostInitialise() @@ -144,15 +152,13 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender /// JPEG2000 data private void DoJ2KDecode(UUID assetID, byte[] j2kData) { - bool USE_CSJ2K = true; - //int DecodeTime = 0; //DecodeTime = Environment.TickCount; OpenJPEG.J2KLayerInfo[] layers; if (!TryLoadCacheForAsset(assetID, out layers)) { - if (USE_CSJ2K) + if (m_useCSJ2K) { try { diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 309ce880d6..74100f59bd 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -257,6 +257,10 @@ ; to be enabled from the console if this is set ; StartDisabled = false + ; Image decoding. Use CSJ2K for layer boundary decoding if true, + ; OpenJPEG if false + ; UseCSJ2K = true + [SMTP] enabled=false