summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2010-07-29 15:50:20 -0700
committerMonroe Linden <monroe@lindenlab.com>2010-07-29 15:50:20 -0700
commit94655359aaa45ef5849cb589f637331b3bcc394c (patch)
treeb73b66828d4dbec3aad41c80a0d515b07ef349a8 /indra/newview/llvovolume.cpp
parent112abfe8886c49a16ca3a91a10152f7a1d0da000 (diff)
Yet more cleanup around llmediadataclient.
In LLVOVolume, added a count of LLMediaDataClientObjectImpl objects referencing each LLVOVolume object. This allows LLVOVolume::markDead() to skip the relatively expensive calls to removeFromQueue() when the LLVOVolume is known to have no active references. Refactored LLMediaDataClient and its two child classes so that only LLObjectMediaDataClient has the round-robin queue (LLObjectMediaNavigateClient doesn't need it), and cleaned up some of the virtual function hierarchy around queue processing. In LLMediaDataClient, added tracking for requests that aren't currently in a queue (i.e. requests that are in flight or waiting for retries) so they can be found when their objects are marked dead. LLMediaDataClient::Request now directly keeps track of the object ID and face associated with the request. Removed the "markedSent" concept from requests. Requests that have been sent are no longer kept in a queue. The Retry timer now references the Request object instead of the Responder. Replaced LLMediaDataClient::findOrRemove() with separate template functions for find and remove.
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp32
1 files changed, 27 insertions, 5 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index c838e9a28d..00d67a4ea9 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -93,8 +93,14 @@ static LLFastTimer::DeclareTimer FTM_GEN_VOLUME("Generate Volumes");
class LLMediaDataClientObjectImpl : public LLMediaDataClientObject
{
public:
- LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew) {}
- LLMediaDataClientObjectImpl() { mObject = NULL; }
+ LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew)
+ {
+ mObject->addMDCImpl();
+ }
+ ~LLMediaDataClientObjectImpl()
+ {
+ mObject->removeMDCImpl();
+ }
virtual U8 getMediaDataCount() const
{ return mObject->getNumTEs(); }
@@ -119,6 +125,18 @@ public:
}
return result;
}
+ virtual bool isCurrentMediaUrl(U8 index, const std::string &url) const
+ {
+ LLTextureEntry *te = mObject->getTE(index);
+ if (te)
+ {
+ if (te->getMediaData())
+ {
+ return (te->getMediaData()->getCurrentURL() == url);
+ }
+ }
+ return url.empty();
+ }
virtual LLUUID getID() const
{ return mObject->getID(); }
@@ -193,6 +211,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re
mMediaImplList.resize(getNumTEs());
mLastFetchedMediaVersion = -1;
mIndexInTex = 0;
+ mMDCImplCount = 0;
}
LLVOVolume::~LLVOVolume()
@@ -218,9 +237,12 @@ void LLVOVolume::markDead()
{
if (!mDead)
{
- LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false);
- if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj);
- if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj);
+ if(getMDCImplCount() > 0)
+ {
+ LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false);
+ if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj);
+ if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj);
+ }
// Detach all media impls from this object
for(U32 i = 0 ; i < mMediaImplList.size() ; i++)