aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-05 22:54:33 +0000
committerJustin Clark-Casey (justincc)2012-01-05 22:54:33 +0000
commitb86e7715a8d8f081fa9452d92a9d8f6d52867a12 (patch)
treee1245aebdd898330d89b39a17a5e9a7de09a7fba /OpenSim/Region/CoreModules
parentAdd a "j2k decode" region console command that allows a manual request for a ... (diff)
downloadopensim-SC_OLD-b86e7715a8d8f081fa9452d92a9d8f6d52867a12.zip
opensim-SC_OLD-b86e7715a8d8f081fa9452d92a9d8f6d52867a12.tar.gz
opensim-SC_OLD-b86e7715a8d8f081fa9452d92a9d8f6d52867a12.tar.bz2
opensim-SC_OLD-b86e7715a8d8f081fa9452d92a9d8f6d52867a12.tar.xz
Improve "j2k decode" command to tell us how many layers and components were decoded, instead of just success/failure
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs21
1 files changed, 16 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
index 349d3ac..a1a2501 100644
--- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
@@ -133,13 +133,20 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
133 133
134 // Do Decode! 134 // Do Decode!
135 if (decode) 135 if (decode)
136 DoJ2KDecode(assetID, j2kData); 136 Decode(assetID, j2kData);
137 } 137 }
138 } 138 }
139 139
140 public bool Decode(UUID assetID, byte[] j2kData) 140 public bool Decode(UUID assetID, byte[] j2kData)
141 { 141 {
142 return DoJ2KDecode(assetID, j2kData); 142 OpenJPEG.J2KLayerInfo[] layers;
143 int components;
144 return Decode(assetID, j2kData, out layers, out components);
145 }
146
147 public bool Decode(UUID assetID, byte[] j2kData, out OpenJPEG.J2KLayerInfo[] layers, out int components)
148 {
149 return DoJ2KDecode(assetID, j2kData, out layers, out components);
143 } 150 }
144 151
145 #endregion IJ2KDecoder 152 #endregion IJ2KDecoder
@@ -149,7 +156,10 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
149 /// </summary> 156 /// </summary>
150 /// <param name="assetID">UUID of Asset</param> 157 /// <param name="assetID">UUID of Asset</param>
151 /// <param name="j2kData">JPEG2000 data</param> 158 /// <param name="j2kData">JPEG2000 data</param>
152 private bool DoJ2KDecode(UUID assetID, byte[] j2kData) 159 /// <param name="layers">layer data</param>
160 /// <param name="components">number of components</param>
161 /// <returns>true if decode was successful. false otherwise.</returns>
162 private bool DoJ2KDecode(UUID assetID, byte[] j2kData, out OpenJPEG.J2KLayerInfo[] layers, out int components)
153 { 163 {
154// m_log.DebugFormat( 164// m_log.DebugFormat(
155// "[J2KDecoderModule]: Doing J2K decoding of {0} bytes for asset {1}", j2kData.Length, assetID); 165// "[J2KDecoderModule]: Doing J2K decoding of {0} bytes for asset {1}", j2kData.Length, assetID);
@@ -158,7 +168,9 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
158 168
159 //int DecodeTime = 0; 169 //int DecodeTime = 0;
160 //DecodeTime = Environment.TickCount; 170 //DecodeTime = Environment.TickCount;
161 OpenJPEG.J2KLayerInfo[] layers; 171
172 // We don't get this from CSJ2K. Is it relevant?
173 components = 0;
162 174
163 if (!TryLoadCacheForAsset(assetID, out layers)) 175 if (!TryLoadCacheForAsset(assetID, out layers))
164 { 176 {
@@ -198,7 +210,6 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
198 } 210 }
199 else 211 else
200 { 212 {
201 int components;
202 if (!OpenJPEG.DecodeLayerBoundaries(j2kData, out layers, out components)) 213 if (!OpenJPEG.DecodeLayerBoundaries(j2kData, out layers, out components))
203 { 214 {
204 m_log.Warn("[J2KDecoderModule]: OpenJPEG failed to decode texture " + assetID); 215 m_log.Warn("[J2KDecoderModule]: OpenJPEG failed to decode texture " + assetID);