LLTextureFetchWorker Class Reference

Inheritance diagram for LLTextureFetchWorker:

Inheritance graph
[legend]
Collaboration diagram for LLTextureFetchWorker:

Collaboration graph
[legend]

List of all members.

Public Member Functions

bool doWork (S32 param)
void finishWork (S32 param, bool completed)
bool deleteOK ()
 ~LLTextureFetchWorker ()
void relese ()

Protected Member Functions

 LLTextureFetchWorker (LLTextureFetch *fetcher, const LLUUID &id, const LLHost &host, F32 priority, S32 discard, S32 size)

Private Types

enum  e_state {
  INVALID = 0, INIT, LOAD_FROM_TEXTURE_CACHE, CACHE_POST,
  LOAD_FROM_NETWORK, LOAD_FROM_SIMULATOR, LOAD_FROM_HTTP_GET_URL, LOAD_FROM_HTTP_GET_DATA,
  DECODE_IMAGE, DECODE_IMAGE_UPDATE, WRITE_TO_CACHE, WAIT_ON_WRITE,
  DONE
}
enum  e_request_state {
  UNSENT = 0, QUEUED = 1, SENT_SIM = 2, SENT_URL = 3,
  SENT_HTTP = 4
}

Private Member Functions

void startWork (S32 param)
void endWork (S32 param, bool aborted)
virtual LLString getName ()
void resetFormattedData ()
void setImagePriority (F32 priority)
void setDesiredDiscard (S32 discard, S32 size)
bool insertPacket (S32 index, U8 *data, S32 size)
void clearPackets ()
U32 calcWorkPriority ()
void removeFromCache ()
bool processSimulatorPackets ()
bool decodeImage ()
bool writeToCacheComplete ()
void lockWorkData ()
void unlockWorkData ()
void callbackURLReceived (const LLSD &data, bool success)
void callbackHttpGet (U8 *data, S32 data_size, bool last_block)
void callbackCacheRead (bool success, LLImageFormatted *image, S32 imagesize, BOOL islocal)
void callbackCacheWrite (bool success)
void callbackDecoded (bool success)

Private Attributes

e_state mState
LLTextureFetchmFetcher
LLImageWorkermImageWorker
LLPointer< LLImageFormattedmFormattedImage
LLPointer< LLImageRawmRawImage
LLPointer< LLImageRawmAuxImage
LLUUID mID
LLHost mHost
U8 mType
F32 mImagePriority
U32 mWorkPriority
F32 mRequestedPriority
S32 mDesiredDiscard
S32 mSimRequestedDiscard
S32 mRequestedDiscard
S32 mLoadedDiscard
S32 mDecodedDiscard
LLFrameTimer mRequestedTimer
LLFrameTimer mFetchTimer
LLTextureCache::handle_t mCacheReadHandle
LLTextureCache::handle_t mCacheWriteHandle
U8mBuffer
S32 mBufferSize
S32 mRequestedSize
S32 mDesiredSize
S32 mFileSize
S32 mCachedSize
BOOL mLoaded
e_request_state mSentRequest
BOOL mDecoded
BOOL mWritten
BOOL mNeedsAux
BOOL mHaveAllData
BOOL mInLocalCache
S32 mRetryAttempt
std::string mURL
S32 mActiveCount
LLMutex mWorkMutex
std::vector< PacketData * > mPackets
S32 mFirstPacket
S32 mLastPacket
U16 mTotalPackets
U8 mImageCodec

Static Private Attributes

static const char * sStateDescs []

Friends

class LLTextureFetch

Classes

class  CacheReadResponder
class  CacheWriteResponder
struct  Compare
class  DecodeResponder
struct  PacketData


Detailed Description

Definition at line 53 of file lltexturefetch.cpp.


Member Enumeration Documentation

Enumerator:
INVALID 
INIT 
LOAD_FROM_TEXTURE_CACHE 
CACHE_POST 
LOAD_FROM_NETWORK 
LOAD_FROM_SIMULATOR 
LOAD_FROM_HTTP_GET_URL 
LOAD_FROM_HTTP_GET_DATA 
DECODE_IMAGE 
DECODE_IMAGE_UPDATE 
WRITE_TO_CACHE 
WAIT_ON_WRITE 
DONE 

Definition at line 262 of file lltexturefetch.cpp.

Enumerator:
UNSENT 
QUEUED 
SENT_SIM 
SENT_URL 
SENT_HTTP 

Definition at line 279 of file lltexturefetch.cpp.


Constructor & Destructor Documentation

LLTextureFetchWorker::~LLTextureFetchWorker (  ) 

LLTextureFetchWorker::LLTextureFetchWorker ( LLTextureFetch fetcher,
const LLUUID id,
const LLHost host,
F32  priority,
S32  discard,
S32  size 
) [protected]


Member Function Documentation

bool LLTextureFetchWorker::doWork ( S32  param  )  [virtual]

Implements LLWorkerClass.

Definition at line 548 of file lltexturefetch.cpp.

References LLTextureFetch::addToNetworkQueue(), LLUUID::asString(), CACHE_POST, clearPackets(), DECODE_IMAGE, DECODE_IMAGE_UPDATE, decodeImage(), DONE, FALSE, FIRST_PACKET_SIZE, gAgent, LLViewerRegion::getCapability(), getName(), LLAgent::getRegion(), INIT, LLPointer< Type >::isNull(), llassert_always, llmax(), llwarns, LOAD_FROM_HTTP_GET_DATA, LOAD_FROM_HTTP_GET_URL, LOAD_FROM_NETWORK, LOAD_FROM_SIMULATOR, LOAD_FROM_TEXTURE_CACHE, LLTextureFetch::lockQueue(), mAuxImage, MAX_IMG_PACKET_SIZE, mBuffer, mBufferSize, mCachedSize, mCacheReadHandle, mCacheWriteHandle, LLTextureFetch::mDebugCount, LLTextureFetch::mDebugID, LLTextureFetch::mDebugPause, mDecoded, mDecodedDiscard, mDesiredDiscard, mDesiredSize, mFetcher, mFetchTimer, mFileSize, mFirstPacket, mFormattedImage, mHaveAllData, mID, mImageWorker, mInLocalCache, mLastPacket, mLoaded, mLoadedDiscard, mRawImage, mRequestedDiscard, mRequestedSize, mRetryAttempt, mSentRequest, mState, LLTextureFetch::mTextureCache, mTotalPackets, mURL, mWorkMutex, mWorkPriority, mWritten, LLPointer< Type >::notNull(), NULL, LLQueuedThread::nullHandle(), LLHTTPClient::post(), LLTextureCache::prioritizeWrite(), LLQueuedThread::PRIORITY_HIGH, LLQueuedThread::PRIORITY_LOW, LLQueuedThread::PRIORITY_NORMAL, processSimulatorPackets(), QUEUED, LLTextureCache::readComplete(), LLTextureCache::readFromCache(), removeFromCache(), LLTextureFetch::removeFromNetworkQueue(), LLFrameTimer::reset(), resetFormattedData(), S32, tut::sd(), LLWorkerClass::setPriority(), TRUE, LLTextureFetch::unlockQueue(), UNSENT, WAIT_ON_WRITE, WRITE_TO_CACHE, LLTextureCache::writeToCache(), and writeToCacheComplete().

Here is the call graph for this function:

void LLTextureFetchWorker::finishWork ( S32  param,
bool  completed 
) [virtual]

bool LLTextureFetchWorker::deleteOK (  )  [virtual]

void LLTextureFetchWorker::relese (  )  [inline]

Definition at line 228 of file lltexturefetch.cpp.

References mActiveCount.

void LLTextureFetchWorker::startWork ( S32  param  )  [private, virtual]

Implements LLWorkerClass.

Definition at line 539 of file lltexturefetch.cpp.

References LLPointer< Type >::isNull(), llassert, mFormattedImage, mImageWorker, and NULL.

Here is the call graph for this function:

void LLTextureFetchWorker::endWork ( S32  param,
bool  aborted 
) [private, virtual]

Implements LLWorkerClass.

Definition at line 972 of file lltexturefetch.cpp.

References mFormattedImage, mImageWorker, NULL, and LLWorkerClass::scheduleDelete().

Here is the call graph for this function:

virtual LLString LLTextureFetchWorker::getName ( void   )  [inline, private, virtual]

Reimplemented in LLTextureFetchLocalFileWorker.

Definition at line 238 of file lltexturefetch.cpp.

References LLStringBase< char >::null.

Referenced by doWork().

Here is the caller graph for this function:

void LLTextureFetchWorker::resetFormattedData (  )  [private]

Definition at line 526 of file lltexturefetch.cpp.

References FALSE, mBuffer, mBufferSize, mFormattedImage, mHaveAllData, LLPointer< Type >::notNull(), and NULL.

Referenced by doWork().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLTextureFetchWorker::setImagePriority ( F32  priority  )  [private]

Definition at line 513 of file lltexturefetch.cpp.

References calcWorkPriority(), DONE, LLWorkerClass::getPriority(), mImagePriority, mState, mWorkPriority, LLQueuedThread::PRIORITY_HIGHBITS, and LLWorkerClass::setPriority().

Referenced by LLTextureFetch::createRequest(), and LLTextureFetch::updateRequestPriority().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLTextureFetchWorker::setDesiredDiscard ( S32  discard,
S32  size 
) [private]

bool LLTextureFetchWorker::insertPacket ( S32  index,
U8 data,
S32  size 
) [private]

Definition at line 1722 of file lltexturefetch.cpp.

References MAX_IMG_PACKET_SIZE, mLastPacket, mPackets, mRequestedTimer, mTotalPackets, NULL, LLFrameTimer::reset(), and S32.

Referenced by LLTextureFetch::receiveImageHeader(), and LLTextureFetch::receiveImagePacket().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLTextureFetchWorker::clearPackets (  )  [private]

Definition at line 461 of file lltexturefetch.cpp.

References mFirstPacket, mLastPacket, mPackets, and mTotalPackets.

Referenced by doWork(), and ~LLTextureFetchWorker().

Here is the caller graph for this function:

U32 LLTextureFetchWorker::calcWorkPriority (  )  [private]

Definition at line 470 of file lltexturefetch.cpp.

References LLViewerImage::maxDecodePriority(), mImagePriority, mWorkPriority, and LLQueuedThread::PRIORITY_LOWBITS.

Referenced by LLTextureFetchWorker(), setDesiredDiscard(), and setImagePriority().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLTextureFetchWorker::removeFromCache (  )  [private]

Definition at line 1040 of file lltexturefetch.cpp.

References mFetcher, mID, mInLocalCache, LLTextureFetch::mTextureCache, and LLTextureCache::removeFromCache().

Referenced by decodeImage(), and doWork().

Here is the call graph for this function:

Here is the caller graph for this function:

bool LLTextureFetchWorker::processSimulatorPackets (  )  [private]

We have enough (or all) data

We have new data

Definition at line 1051 of file lltexturefetch.cpp.

References i, llassert_always, mData, mFirstPacket, mFormattedImage, mHaveAllData, mLastPacket, mLoadedDiscard, mPackets, mRequestedDiscard, mRequestedSize, mSize, mTotalPackets, S32, and TRUE.

Referenced by doWork().

Here is the caller graph for this function:

bool LLTextureFetchWorker::decodeImage (  )  [private]

bool LLTextureFetchWorker::writeToCacheComplete (  )  [private]

Definition at line 1271 of file lltexturefetch.cpp.

References mCacheWriteHandle, mFetcher, LLTextureFetch::mTextureCache, mWritten, LLQueuedThread::nullHandle(), and LLTextureCache::writeComplete().

Referenced by doWork().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLTextureFetchWorker::lockWorkData (  )  [inline, private]

void LLTextureFetchWorker::unlockWorkData (  )  [inline, private]

void LLTextureFetchWorker::callbackURLReceived ( const LLSD data,
bool  success 
) [private]

void LLTextureFetchWorker::callbackHttpGet ( U8 data,
S32  data_size,
bool  last_block 
) [private]

void LLTextureFetchWorker::callbackCacheRead ( bool  success,
LLImageFormatted image,
S32  imagesize,
BOOL  islocal 
) [private]

void LLTextureFetchWorker::callbackCacheWrite ( bool  success  )  [private]

Definition at line 1199 of file lltexturefetch.cpp.

References llwarns, mID, mState, mWorkMutex, mWorkPriority, mWritten, LLQueuedThread::PRIORITY_HIGH, LLWorkerClass::setPriority(), TRUE, and WAIT_ON_WRITE.

Referenced by LLTextureFetchWorker::CacheWriteResponder::completed().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLTextureFetchWorker::callbackDecoded ( bool  success  )  [private]

Definition at line 1213 of file lltexturefetch.cpp.

References DECODE_IMAGE_UPDATE, llwarns, mID, mState, mWorkPriority, LLQueuedThread::PRIORITY_HIGH, and LLWorkerClass::setPriority().

Referenced by LLTextureFetchWorker::DecodeResponder::completed().

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class LLTextureFetch [friend]

Reimplemented in LLTextureFetchLocalFileWorker.

Definition at line 55 of file lltexturefetch.cpp.


Member Data Documentation

const char * LLTextureFetchWorker::sStateDescs [static, private]

Initial value:

 {
        "INVALID",
        "INIT",
        "LOAD_FROM_TEXTURE_CACHE",
        "CACHE_POST",
        "LOAD_FROM_NETWORK",
        "LOAD_FROM_SIMULATOR",
        "LOAD_FROM_HTTP_URL",
        "LOAD_FROM_HTTP_DATA",
        "DECODE_IMAGE",
        "DECODE_IMAGE_UPDATE",
        "WRITE_TO_CACHE",
        "WAIT_ON_WRITE",
        "DONE",
}

Definition at line 287 of file lltexturefetch.cpp.

Referenced by LLTextureFetch::dump().

Definition at line 290 of file lltexturefetch.cpp.

Referenced by decodeImage(), doWork(), endWork(), startWork(), and ~LLTextureFetchWorker().

Definition at line 292 of file lltexturefetch.cpp.

Referenced by decodeImage(), doWork(), and LLTextureFetch::getRequestFinished().

Definition at line 293 of file lltexturefetch.cpp.

Referenced by decodeImage(), doWork(), and LLTextureFetch::getRequestFinished().

Definition at line 301 of file lltexturefetch.cpp.

Referenced by LLTextureFetch::sendRequestListToSimulators().

Definition at line 302 of file lltexturefetch.cpp.

Referenced by doWork(), and processSimulatorPackets().

Definition at line 303 of file lltexturefetch.cpp.

Referenced by doWork(), and processSimulatorPackets().

Definition at line 304 of file lltexturefetch.cpp.

Referenced by decodeImage(), doWork(), and LLTextureFetch::getRequestFinished().

Definition at line 306 of file lltexturefetch.cpp.

Referenced by doWork(), and LLTextureFetch::getFetchState().

Definition at line 307 of file lltexturefetch.cpp.

Referenced by deleteOK(), doWork(), finishWork(), and ~LLTextureFetchWorker().

Definition at line 309 of file lltexturefetch.cpp.

Referenced by callbackHttpGet(), doWork(), and resetFormattedData().

Definition at line 310 of file lltexturefetch.cpp.

Referenced by callbackHttpGet(), doWork(), and resetFormattedData().

Definition at line 311 of file lltexturefetch.cpp.

Referenced by callbackHttpGet(), doWork(), and processSimulatorPackets().

Definition at line 312 of file lltexturefetch.cpp.

Referenced by doWork(), and setDesiredDiscard().

Definition at line 314 of file lltexturefetch.cpp.

Referenced by doWork().

Definition at line 317 of file lltexturefetch.cpp.

Referenced by doWork().

Definition at line 318 of file lltexturefetch.cpp.

Referenced by callbackCacheWrite(), doWork(), and writeToCacheComplete().

Definition at line 319 of file lltexturefetch.cpp.

Referenced by LLTextureFetch::createRequest(), and decodeImage().

Definition at line 321 of file lltexturefetch.cpp.

Referenced by callbackCacheRead(), doWork(), and removeFromCache().

Definition at line 322 of file lltexturefetch.cpp.

Referenced by doWork().

std::string LLTextureFetchWorker::mURL [private]

Definition at line 323 of file lltexturefetch.cpp.

Referenced by callbackURLReceived(), and doWork().

Definition at line 324 of file lltexturefetch.cpp.

Referenced by LLTextureFetch::createRequest(), and relese().

std::vector<PacketData*> LLTextureFetchWorker::mPackets [private]

Definition at line 336 of file lltexturefetch.cpp.

Referenced by clearPackets(), insertPacket(), and processSimulatorPackets().

Definition at line 337 of file lltexturefetch.cpp.

Referenced by clearPackets(), doWork(), and processSimulatorPackets().

Definition at line 340 of file lltexturefetch.cpp.

Referenced by callbackCacheRead(), and LLTextureFetch::receiveImageHeader().


The documentation for this class was generated from the following file:

Generated on Fri May 16 09:15:14 2008 for SecondLife by  doxygen 1.5.5