aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs36
1 files changed, 12 insertions, 24 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
index 1882005..aef0ada 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
@@ -36,13 +36,13 @@ using System.Reflection;
36 36
37namespace OpenSim.Region.ClientStack.LindenUDP 37namespace OpenSim.Region.ClientStack.LindenUDP
38{ 38{
39 /// <summary> 39 /// <summary>
40 /// We use this class to store image data and associated request data and attributes 40 /// We use this class to store image data and associated request data and attributes
41 /// </summary> 41 /// </summary>
42 public class J2KImage 42 public class J2KImage
43 { 43 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 public double m_designatedPriorityKey; 46 public double m_designatedPriorityKey;
47 public double m_requestedPriority = 0.0d; 47 public double m_requestedPriority = 0.0d;
48 public uint m_lastSequence = 0; 48 public uint m_lastSequence = 0;
@@ -55,7 +55,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
55 public AssetBase m_MissingSubstitute = null; 55 public AssetBase m_MissingSubstitute = null;
56 public bool m_decoded = false; 56 public bool m_decoded = false;
57 public bool m_completedSendAtCurrentDiscardLevel; 57 public bool m_completedSendAtCurrentDiscardLevel;
58 58
59 private sbyte m_discardLevel=-1; 59 private sbyte m_discardLevel=-1;
60 private uint m_packetNumber; 60 private uint m_packetNumber;
61 private bool m_decoderequested = false; 61 private bool m_decoderequested = false;
@@ -135,6 +135,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
135 { 135 {
136 return ((bytePosition - cFirstPacketSize + cImagePacketSize - 1) / cImagePacketSize) + 1; 136 return ((bytePosition - cFirstPacketSize + cImagePacketSize - 1) / cImagePacketSize) + 1;
137 } 137 }
138
138 public int LastPacketSize() 139 public int LastPacketSize()
139 { 140 {
140 if (m_packetNumber == 1) 141 if (m_packetNumber == 1)
@@ -146,8 +147,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
146 lastsize = cImagePacketSize; 147 lastsize = cImagePacketSize;
147 } 148 }
148 return lastsize; 149 return lastsize;
149 } 150 }
150
151 151
152 public int CurrentBytePosition() 152 public int CurrentBytePosition()
153 { 153 {
@@ -215,7 +215,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
215 complete = true; 215 complete = true;
216 } 216 }
217 } 217 }
218 218
219 // It's concievable that the client might request packet one 219 // It's concievable that the client might request packet one
220 // from a one packet image, which is really packet 0, 220 // from a one packet image, which is really packet 0,
221 // which would leave us with a negative imagePacketSize.. 221 // which would leave us with a negative imagePacketSize..
@@ -234,7 +234,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
234 234
235 //Send the packet 235 //Send the packet
236 client.SendImageNextPart((ushort)(m_packetNumber-1), m_requestedUUID, imageData); 236 client.SendImageNextPart((ushort)(m_packetNumber-1), m_requestedUUID, imageData);
237
238 } 237 }
239 if (complete) 238 if (complete)
240 { 239 {
@@ -257,7 +256,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
257 { 256 {
258 if (m_packetNumber <= m_stopPacket) 257 if (m_packetNumber <= m_stopPacket)
259 { 258 {
260
261 bool SendMore = true; 259 bool SendMore = true;
262 if (!m_sentinfo || (m_packetNumber == 0)) 260 if (!m_sentinfo || (m_packetNumber == 0))
263 { 261 {
@@ -273,8 +271,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
273 { 271 {
274 m_packetNumber = 2; 272 m_packetNumber = 2;
275 } 273 }
276 274
277 int count=0; 275 int count = 0;
278 while (SendMore && count < 5 && m_packetNumber <= m_stopPacket) 276 while (SendMore && count < 5 && m_packetNumber <= m_stopPacket)
279 { 277 {
280 count++; 278 count++;
@@ -284,13 +282,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
284 282
285 if (m_packetNumber > m_stopPacket) 283 if (m_packetNumber > m_stopPacket)
286 { 284 {
287
288 return true; 285 return true;
289
290 } 286 }
291
292 } 287 }
293
294 } 288 }
295 return false; 289 return false;
296 } 290 }
@@ -343,12 +337,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
343 } 337 }
344 else 338 else
345 { 339 {
346
347
348 //discardLevel of -1 means just update the priority 340 //discardLevel of -1 means just update the priority
349 if (m_requestedDiscardLevel != -1) 341 if (m_requestedDiscardLevel != -1)
350 { 342 {
351
352 //Evaluate the discard level 343 //Evaluate the discard level
353 //First, is it positive? 344 //First, is it positive?
354 if (m_requestedDiscardLevel >= 0) 345 if (m_requestedDiscardLevel >= 0)
@@ -361,7 +352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
361 { 352 {
362 m_discardLevel = m_requestedDiscardLevel; 353 m_discardLevel = m_requestedDiscardLevel;
363 } 354 }
364 355
365 //Calculate the m_stopPacket 356 //Calculate the m_stopPacket
366 if (Layers.Length > 0) 357 if (Layers.Length > 0)
367 { 358 {
@@ -382,18 +373,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
382 { 373 {
383 m_packetNumber = m_requestedPacketNumber; 374 m_packetNumber = m_requestedPacketNumber;
384 } 375 }
385 376
386 if (m_packetNumber <= m_stopPacket) 377 if (m_packetNumber <= m_stopPacket)
387 { 378 {
388 m_completedSendAtCurrentDiscardLevel = false; 379 m_completedSendAtCurrentDiscardLevel = false;
389 } 380 }
390
391 } 381 }
392
393 } 382 }
394 } 383 }
395 } 384 }
396 } 385 }
397
398 } 386 }
399} 387}