diff options
author | Mike Mazur | 2009-02-04 00:01:36 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-04 00:01:36 +0000 |
commit | 0c03a48fb2060eda4d288e2d2ca4e650ce000b4b (patch) | |
tree | a90465075960c92367b0a5e62db3121e4e3a139d /OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs | |
parent | * Add another object to the existing save oar test (diff) | |
download | opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.zip opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.gz opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.bz2 opensim-SC-0c03a48fb2060eda4d288e2d2ca4e650ce000b4b.tar.xz |
- add OpenSim.Framework.AssetMetadata class. AssetBase is now composed of it
- trim trailing whitespace
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs index 3b21c85..f903c45 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
47 | /// Priority Queue for images. Contains lots of data | 47 | /// Priority Queue for images. Contains lots of data |
48 | /// </summary> | 48 | /// </summary> |
49 | private readonly IPriorityQueue<Prio<J2KImage>> pq = new IntervalHeap<Prio<J2KImage>>(); | 49 | private readonly IPriorityQueue<Prio<J2KImage>> pq = new IntervalHeap<Prio<J2KImage>>(); |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Dictionary of PriorityQueue handles by AssetId | 52 | /// Dictionary of PriorityQueue handles by AssetId |
53 | /// </summary> | 53 | /// </summary> |
@@ -87,7 +87,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
87 | 87 | ||
88 | //if (req.RequestType == 1) // avatar body texture! | 88 | //if (req.RequestType == 1) // avatar body texture! |
89 | // return; | 89 | // return; |
90 | 90 | ||
91 | AddQueueItem(req.RequestedAssetID, (int)req.Priority + 100000); | 91 | AddQueueItem(req.RequestedAssetID, (int)req.Priority + 100000); |
92 | //if (pq[PQHandles[req.RequestedAssetID]].data.Missing) | 92 | //if (pq[PQHandles[req.RequestedAssetID]].data.Missing) |
93 | //{ | 93 | //{ |
@@ -96,9 +96,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
96 | // | 96 | // |
97 | //if (pq[PQHandles[req.RequestedAssetID]].data.HasData && pq[PQHandles[req.RequestedAssetID]].data.Layers.Length > 0) | 97 | //if (pq[PQHandles[req.RequestedAssetID]].data.HasData && pq[PQHandles[req.RequestedAssetID]].data.Layers.Length > 0) |
98 | //{ | 98 | //{ |
99 | 99 | ||
100 | //} | 100 | //} |
101 | 101 | ||
102 | pq[PQHandles[req.RequestedAssetID]].data.requestedUUID = req.RequestedAssetID; | 102 | pq[PQHandles[req.RequestedAssetID]].data.requestedUUID = req.RequestedAssetID; |
103 | pq[PQHandles[req.RequestedAssetID]].data.Priority = (int)req.Priority; | 103 | pq[PQHandles[req.RequestedAssetID]].data.Priority = (int)req.Priority; |
104 | 104 | ||
@@ -118,7 +118,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
118 | return; | 118 | return; |
119 | 119 | ||
120 | //Console.WriteLine("AssetCallback for assetId" + assetID); | 120 | //Console.WriteLine("AssetCallback for assetId" + assetID); |
121 | 121 | ||
122 | if (asset == null || asset.Data == null) | 122 | if (asset == null || asset.Data == null) |
123 | { | 123 | { |
124 | lock (pq) | 124 | lock (pq) |
@@ -132,12 +132,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
132 | 132 | ||
133 | 133 | ||
134 | pq[PQHandles[assetID]].data.asset = asset; | 134 | pq[PQHandles[assetID]].data.asset = asset; |
135 | 135 | ||
136 | //lock (pq[PQHandles[assetID]].data) | 136 | //lock (pq[PQHandles[assetID]].data) |
137 | pq[PQHandles[assetID]].data.Update((int)pq[PQHandles[assetID]].data.Priority, pq[PQHandles[assetID]].data.CurrentPacket); | 137 | pq[PQHandles[assetID]].data.Update((int)pq[PQHandles[assetID]].data.Priority, pq[PQHandles[assetID]].data.CurrentPacket); |
138 | 138 | ||
139 | 139 | ||
140 | 140 | ||
141 | } | 141 | } |
142 | 142 | ||
143 | /// <summary> | 143 | /// <summary> |
@@ -174,7 +174,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
174 | // Is the asset missing? | 174 | // Is the asset missing? |
175 | if (process.data.Missing) | 175 | if (process.data.Missing) |
176 | { | 176 | { |
177 | 177 | ||
178 | //m_client.sendtextur | 178 | //m_client.sendtextur |
179 | pq[h] -= 90000; | 179 | pq[h] -= 90000; |
180 | /* | 180 | /* |
@@ -191,7 +191,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
191 | // Substitute a blank image | 191 | // Substitute a blank image |
192 | process.data.asset = MissingSubstitute; | 192 | process.data.asset = MissingSubstitute; |
193 | process.data.Missing = false; | 193 | process.data.Missing = false; |
194 | 194 | ||
195 | // If the priority is less then -4billion, the client has forgotten about it. | 195 | // If the priority is less then -4billion, the client has forgotten about it. |
196 | if (pq[h] < -400000000) | 196 | if (pq[h] < -400000000) |
197 | { | 197 | { |
@@ -224,7 +224,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
224 | j2kDecodedCallback(process.data.AssetId, new OpenJPEG.J2KLayerInfo[0]); | 224 | j2kDecodedCallback(process.data.AssetId, new OpenJPEG.J2KLayerInfo[0]); |
225 | } | 225 | } |
226 | 226 | ||
227 | 227 | ||
228 | 228 | ||
229 | } // Are we waiting? | 229 | } // Are we waiting? |
230 | else if (!process.data.J2KDecodeWaiting) | 230 | else if (!process.data.J2KDecodeWaiting) |
@@ -259,10 +259,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
259 | 259 | ||
260 | //pq[h] = process; | 260 | //pq[h] = process; |
261 | } | 261 | } |
262 | 262 | ||
263 | // uncomment the following line to see the upper most asset and the priority | 263 | // uncomment the following line to see the upper most asset and the priority |
264 | //Console.WriteLine(process.ToString()); | 264 | //Console.WriteLine(process.ToString()); |
265 | 265 | ||
266 | // Lower priority to give the next image a chance to bubble up | 266 | // Lower priority to give the next image a chance to bubble up |
267 | pq[h] -= 50000; | 267 | pq[h] -= 50000; |
268 | } | 268 | } |
@@ -318,7 +318,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
318 | } | 318 | } |
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | 322 | ||
323 | /// <summary> | 323 | /// <summary> |
324 | /// Adds an image to the queue and update priority | 324 | /// Adds an image to the queue and update priority |
@@ -336,7 +336,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
336 | { | 336 | { |
337 | h = PQHandles[AssetId]; | 337 | h = PQHandles[AssetId]; |
338 | pq[h] = pq[h].SetPriority(priority); | 338 | pq[h] = pq[h].SetPriority(priority); |
339 | 339 | ||
340 | } | 340 | } |
341 | else | 341 | else |
342 | { | 342 | { |
@@ -354,7 +354,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
354 | public void Close() | 354 | public void Close() |
355 | { | 355 | { |
356 | m_shuttingdown = true; | 356 | m_shuttingdown = true; |
357 | 357 | ||
358 | lock (pq) | 358 | lock (pq) |
359 | { | 359 | { |
360 | while (!pq.IsEmpty) | 360 | while (!pq.IsEmpty) |
@@ -362,7 +362,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
362 | pq.DeleteMin(); | 362 | pq.DeleteMin(); |
363 | } | 363 | } |
364 | } | 364 | } |
365 | 365 | ||
366 | 366 | ||
367 | lock (PQHandles) | 367 | lock (PQHandles) |
368 | PQHandles.Clear(); | 368 | PQHandles.Clear(); |
@@ -423,7 +423,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
423 | /// </summary> | 423 | /// </summary> |
424 | public UUID AssetId | 424 | public UUID AssetId |
425 | { | 425 | { |
426 | get { return m_asset_ref.FullID; } | 426 | get { return m_asset_ref.Metadata.FullID; } |
427 | } | 427 | } |
428 | 428 | ||
429 | /// <summary> | 429 | /// <summary> |
@@ -544,7 +544,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
544 | /// <returns>true if a packet was sent, false if not</returns> | 544 | /// <returns>true if a packet was sent, false if not</returns> |
545 | public bool SendPacket(LLClientView client) | 545 | public bool SendPacket(LLClientView client) |
546 | { | 546 | { |
547 | // If we've hit the end of the send or if the client set -1, return false. | 547 | // If we've hit the end of the send or if the client set -1, return false. |
548 | if (CurrentPacket > StopPacket || StopPacket == -1) | 548 | if (CurrentPacket > StopPacket || StopPacket == -1) |
549 | return false; | 549 | return false; |
550 | 550 | ||
@@ -564,7 +564,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
564 | } | 564 | } |
565 | else | 565 | else |
566 | { | 566 | { |
567 | 567 | ||
568 | // Send first packet | 568 | // Send first packet |
569 | byte[] firstImageData = new byte[FIRST_IMAGE_PACKET_SIZE]; | 569 | byte[] firstImageData = new byte[FIRST_IMAGE_PACKET_SIZE]; |
570 | try { Buffer.BlockCopy(m_asset_ref.Data, 0, firstImageData, 0, FIRST_IMAGE_PACKET_SIZE); } | 570 | try { Buffer.BlockCopy(m_asset_ref.Data, 0, firstImageData, 0, FIRST_IMAGE_PACKET_SIZE); } |
@@ -585,7 +585,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
585 | // figure out if we're on the last packet, if so, use the last packet size. If not, use 1000. | 585 | // figure out if we're on the last packet, if so, use the last packet size. If not, use 1000. |
586 | // we know that the total image size is greater then 1000 if we're here | 586 | // we know that the total image size is greater then 1000 if we're here |
587 | int imagePacketSize = (CurrentPacket == (TexturePacketCount() ) ) ? LastPacketSize() : IMAGE_PACKET_SIZE; | 587 | int imagePacketSize = (CurrentPacket == (TexturePacketCount() ) ) ? LastPacketSize() : IMAGE_PACKET_SIZE; |
588 | 588 | ||
589 | //if (imagePacketSize > 0) | 589 | //if (imagePacketSize > 0) |
590 | // imagePacketSize = IMAGE_PACKET_SIZE; | 590 | // imagePacketSize = IMAGE_PACKET_SIZE; |
591 | //if (imagePacketSize != 1000) | 591 | //if (imagePacketSize != 1000) |
@@ -611,7 +611,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
611 | try { Buffer.BlockCopy(m_asset_ref.Data, CurrentBytePosition(), imageData, 0, imagePacketSize); } | 611 | try { Buffer.BlockCopy(m_asset_ref.Data, CurrentBytePosition(), imageData, 0, imagePacketSize); } |
612 | catch (Exception e) | 612 | catch (Exception e) |
613 | { | 613 | { |
614 | Console.WriteLine(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize:{3}, currpak:{4}, stoppak:{5}, totalpak:{6}", m_asset_ref.Data.Length, CurrentBytePosition(), | 614 | Console.WriteLine(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize:{3}, currpak:{4}, stoppak:{5}, totalpak:{6}", m_asset_ref.Data.Length, CurrentBytePosition(), |
615 | imageData.Length, imagePacketSize, CurrentPacket,StopPacket,TexturePacketCount())); | 615 | imageData.Length, imagePacketSize, CurrentPacket,StopPacket,TexturePacketCount())); |
616 | Console.WriteLine(e.ToString()); | 616 | Console.WriteLine(e.ToString()); |
617 | //m_log.Error("Texture data copy failed for " + m_asset_ref.FullID.ToString()); | 617 | //m_log.Error("Texture data copy failed for " + m_asset_ref.FullID.ToString()); |
@@ -622,7 +622,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
622 | 622 | ||
623 | // Send next packet to the client | 623 | // Send next packet to the client |
624 | client.SendImageNextPart((ushort)(CurrentPacket - 1), requestedUUID, imageData); | 624 | client.SendImageNextPart((ushort)(CurrentPacket - 1), requestedUUID, imageData); |
625 | 625 | ||
626 | ++CurrentPacket; | 626 | ++CurrentPacket; |
627 | 627 | ||
628 | if (atEnd) | 628 | if (atEnd) |
@@ -630,7 +630,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
630 | 630 | ||
631 | return true; | 631 | return true; |
632 | } | 632 | } |
633 | 633 | ||
634 | } | 634 | } |
635 | 635 | ||
636 | /// <summary> | 636 | /// <summary> |
@@ -676,7 +676,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
676 | 676 | ||
677 | public static Prio<D> operator -(Prio<D> tp, int delta) | 677 | public static Prio<D> operator -(Prio<D> tp, int delta) |
678 | { | 678 | { |
679 | if (tp.priority - delta < 0) | 679 | if (tp.priority - delta < 0) |
680 | return new Prio<D>(tp.data, tp.priority - delta); | 680 | return new Prio<D>(tp.data, tp.priority - delta); |
681 | else | 681 | else |
682 | return new Prio<D>(tp.data, 0); | 682 | return new Prio<D>(tp.data, 0); |