summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturefetch.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltexturefetch.h')
-rw-r--r--indra/newview/lltexturefetch.h37
1 files changed, 30 insertions, 7 deletions
diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h
index 97719a9468..373e38a83c 100644
--- a/indra/newview/lltexturefetch.h
+++ b/indra/newview/lltexturefetch.h
@@ -37,26 +37,29 @@
#include "llimage.h"
#include "lluuid.h"
#include "llworkerthread.h"
+#include "llcurl.h"
+#include "lltextureinfo.h"
class LLViewerTexture;
class LLTextureFetchWorker;
+class HTTPGetResponder;
class LLTextureCache;
+class LLImageDecodeThread;
class LLHost;
// Interface class
class LLTextureFetch : public LLWorkerThread
{
friend class LLTextureFetchWorker;
+ friend class HTTPGetResponder;
public:
- LLTextureFetch(LLTextureCache* cache, bool threaded);
+ LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* imagedecodethread, bool threaded);
~LLTextureFetch();
/*virtual*/ S32 update(U32 max_time_ms);
- bool createRequest(const LLUUID& id, const LLHost& host, F32 priority,
- S32 w, S32 h, S32 c, S32 discard, bool needs_aux);
- bool createRequest(const std::string& filename, const LLUUID& id, const LLHost& host, F32 priority,
+ bool createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority,
S32 w, S32 h, S32 c, S32 discard, bool needs_aux);
void deleteRequest(const LLUUID& id, bool cancel);
bool getRequestFinished(const LLUUID& id, S32& discard_level,
@@ -66,25 +69,39 @@ public:
bool receiveImageHeader(const LLHost& host, const LLUUID& id, U8 codec, U16 packets, U32 totalbytes, U16 data_size, U8* data);
bool receiveImagePacket(const LLHost& host, const LLUUID& id, U16 packet_num, U16 data_size, U8* data);
+ void setTextureBandwidth(F32 bandwidth) { mTextureBandwidth = bandwidth; }
+ F32 getTextureBandwidth() { return mTextureBandwidth; }
+
// Debug
BOOL isFromLocalCache(const LLUUID& id);
S32 getFetchState(const LLUUID& id, F32& decode_progress_p, F32& requested_priority_p,
U32& fetch_priority_p, F32& fetch_dtime_p, F32& request_dtime_p);
void dump();
S32 getNumRequests() { return mRequestMap.size(); }
+ S32 getNumHTTPRequests() { return mHTTPTextureQueue.size(); }
// Public for access by callbacks
void lockQueue() { mQueueMutex.lock(); }
void unlockQueue() { mQueueMutex.unlock(); }
LLTextureFetchWorker* getWorker(const LLUUID& id);
+
+ LLTextureInfo* getTextureInfo() { return &mTextureInfo; }
protected:
void addToNetworkQueue(LLTextureFetchWorker* worker);
- void removeFromNetworkQueue(LLTextureFetchWorker* worker);
+ void removeFromNetworkQueue(LLTextureFetchWorker* worker, bool cancel);
+ void addToHTTPQueue(const LLUUID& id);
+ void removeFromHTTPQueue(const LLUUID& id);
+ S32 getHTTPQueueSize() { return (S32)mHTTPTextureQueue.size(); }
void removeRequest(LLTextureFetchWorker* worker, bool cancel);
+ // Called from worker thread (during doWork)
+ void processCurlRequests();
private:
void sendRequestListToSimulators();
+ /*virtual*/ void startThread(void);
+ /*virtual*/ void endThread(void);
+ /*virtual*/ void threadedUpdate(void);
public:
LLUUID mDebugID;
@@ -95,8 +112,11 @@ public:
private:
LLMutex mQueueMutex;
+ LLMutex mNetworkQueueMutex;
LLTextureCache* mTextureCache;
+ LLImageDecodeThread* mImageDecodeThread;
+ LLCurlRequest* mCurlGetRequest;
// Map of all requests by UUID
typedef std::map<LLUUID,LLTextureFetchWorker*> map_t;
@@ -105,10 +125,13 @@ private:
// Set of requests that require network data
typedef std::set<LLUUID> queue_t;
queue_t mNetworkQueue;
+ queue_t mHTTPTextureQueue;
typedef std::map<LLHost,std::set<LLUUID> > cancel_queue_t;
cancel_queue_t mCancelQueue;
-
- LLFrameTimer mNetworkTimer;
+ F32 mTextureBandwidth;
+ F32 mMaxBandwidth;
+ LLTextureInfo mTextureInfo;
};
#endif // LL_LLTEXTUREFETCH_H
+