Commit Graph

25 Commits (180daf3ab83ff9a83200c1952c0f09d20cfcb992)

Author SHA1 Message Date
Rick Pasetto da3ca7c5b9 Allow selection of media faces even if there is no impl. We record
the target object and use that fact to raise its interest level.

This is mostly a pass-off for monroe to take and run with
2009-12-14 12:03:44 -08:00
Rick Pasetto bbfb25077b Fix linux build 2009-12-11 12:10:16 -08:00
Rick Pasetto 2d01d763d5 PARTIAL DEV-43869 - add "isInterestingEnough()" to the queue calculation
This change bumps the queue sizes way up, because we
think that the "isInterestingEnough()" call will prevent
loading more media data than we think is necessary.
Still need to implement it in LLVOVolume, though
2009-12-10 17:03:40 -08:00
Rick Pasetto 248427b8f9 PARTIAL DEV-43869: LLMediaDataClient now uses two queues
This is a fairly major change that addresses the issue of an object
with constantly-updating media.  Before, that object would be put
into our single queue and sorted to a particular spot, and since it
continuously updates, it would "always be there".  That means that
nothing "behind" it would ever get serviced.

This change introduces two queues for each MDC: one is the same
"sorted" queue as before, and the other is unsorted, and
"round-robins".  New objects go into the sorted queue, objects
whose media we already know about get put into the unsorted queue.
The two queues are interleaved when serviced (one then the other is
serviced -- if one is empty we try the other -- until they are both
drained).

The round-robin queue works a little differently: after an item is
fetched from that queue (remember this would be an item we already
know about), that request is marked and put back at the end of the
queue.  If that object gets a UDP update while in the queue, that mark
is "cleared".  When it gets to the front of the queue again, if it
still marked, it is thrown away.  If it is not marked, it is fetched,
and again marked and put at the end.  This makes the queue
self-limiting in how big it can get.

I have also made some other changes:
- The sorting comparator now just delegates to the object for its
"interest" calculation.  A higher value = more interesting.
LLVOVolume now uses its PixelArea for its "interest" calculation,
which seems apparently better (the prior distance calculation was
wrong anyway).
- The score is cached before the sort operation is performed, so that
it won't be expensive to sort
- Now, the media version that is fetched is saved in the LLVOVolume,
and we do not update if it is not newer (this is not very
useful...yet.)
- I've introduced hard limits (settable by debug settings) on the size
of the queues.  The sorted queue will be culled (after sort) to that
count. NOTE: this will probably get removed in a later checkin, as
I've already gotten feedback that this is not desirable
- I've reorganized LLMediaDataClient so it makes more sense.
- I've made the request object a little smaller, so the queue won't take up so
much memory (more work could be done here)
- Added a unit test for the two-queue case (though more tests are needed!)
2009-12-10 14:21:48 -08:00
Rick Pasetto c8519c5a7b Code review feedback:
Don't re-sort when adding to the queue: it isn't really necessary
since we sort every time we pull off the queue.
2009-11-24 15:55:53 -08:00
Rick Pasetto f276b73d97 DEV-41998 - refactor mediadataclient to use a std::list, and re-sort every time an item is pulled off the queue
Review #43

This change refactors mediadataclient to no longer use a PriorityQueue (which sorts only on insertion), but rather just use a std::list which is re-sorted on insert, and also when "popped" (at the time the queue timer goes off).

Also implemented a unit test to make sure re-sorting occurs on timer tick.
2009-11-24 14:26:00 -08:00
Rick Pasetto 3bb86f91bc Clean up some logging 2009-11-20 14:01:49 -08:00
Monroe Linden ba3f7965e3 Made LLMediaDataClient not send requests on behalf of objects that are marked as dead.
When LLMediaDataClient::QueueTimer::tick() encounters an object at the head of the queue that's dead, it will now remove that object and loop, instead of sending a request and waiting for the tick timer to fire again.

Added an isDead() function to LLMediaDataClientObject, and an additional unit test that verifies the handling of dead objects.
2009-11-19 16:35:11 -08:00
Rick Pasetto 353ac3969e FIX DEV-41991: do not allow media settings panel to come up if media data is in flight
Review #33

This change marks the current selection "not editable" if
any objects in the selection are currently "in flight" (i.e.
their media data has not been fetched yet, or is in the
process of being fetched).  This involved adding API to
LLMediaDataClient to query whether an object is in the
process of being fetched (i.e. in the queue).  I've added
a unit test for this new API.
2009-11-10 17:24:02 -08:00
Rick Pasetto 6698c681fd Add some logging to perhaps discern more information about reported crashes 2009-10-26 14:06:42 -07:00
Rick Pasetto d78520f6b7 Compress logging of media data (but still have it) 2009-10-19 17:08:45 -07:00
Steve Bennetts 65bf35cfed merge 2009-10-19 10:49:48 -07:00
Rick Pasetto 4598a4a621 Another attempt at fixing unit test, this one is weirder.
Don't schedule the queue timer in the tick() of the retry timer.
Instead, schedule it in the RetryTimer's destructor.
This is an artifact of how the LLEventTimer's loop is handled.
2009-10-13 20:52:04 -07:00
Rick Pasetto 780719c14c Add some more logging to help triage media client problems 2009-10-12 17:52:33 -07:00
palange dbe7135cc4 merge of login-api 2009-10-12 19:03:52 -04:00
Rick Pasetto d4b2897700 Unit tests for LLMediaDataClient
This required a bit of refactoring of LLMediaDataClient:
- Created LLMediaDataClientObject ABC, which now has a
  concrete impl in LLVOVolume
- Created unit test with 6 tests (for now), testing
  - LLObjectMediaDataClient::fetchMedia()
  - LLObjectMediaDataClient::updateMedia()
  - LLObjectMediaNavigateClient::navigate()
  - queue ordering
  - retries
  - nav bounce back
- Also ensures that ref counting works properly (this is important, because
  ownership is tricky with smart pointers put into queues, peeled off
  into timers that fire and auto destruct, and HTTP responders that also
  auto-destruct)
- Had to fix LLCurl::Responder's stub, which was not initializing
  the ref count to 0, causing the ref counting tests to fail
  (boy, that was hard to find!).

Reviewed by Callum
2009-10-09 18:56:36 -07:00
brad kittenbrink 902d6676c6 Post-merge cleanup to get things building again. 2009-10-07 19:26:04 -07:00
Rick Pasetto df48e66f7c DEV-39168 - bounce back to the current URL (or, the home URL if current URL is "") if the server denies navigation
This refactors some of the bounceBack code into LLVOVolume.
It also changes an important rule:  the edit panel now *will* send the
current URL to the server when you hit "OK".  This change was done so
that if autoplay is on, we make sure the server gets the right data.
2009-10-07 12:26:42 -07:00
Rick Pasetto d2464757c6 DEV-40896: Don't iteratively pop() the request queue on destroy(). This just logs now and deletes the queue. 2009-10-06 13:20:30 -07:00
Rick Pasetto f0dd8c4603 Back out changes accidentally checked in with last commit 2009-10-05 18:15:43 -07:00
Rick Pasetto aba67da38b FIX DEV-40877: ignore changes from "bad" objects which have an invalid media URL 2009-10-05 18:14:27 -07:00
Rick Pasetto 1658d77b86 DEV-40853: don't bring up a dialog on HTTP errors in the media service 2009-10-05 17:56:33 -07:00
Mark Palange (Mani) 81a63ac088 merge with latest from lindenlab/svn-imports-viewer-20 2009-10-05 13:39:53 -07:00
Rick Pasetto c6a3df44d8 Disable "bounceBack" if nav permissions are refused 2009-10-05 17:44:42 +00:00
Rick Pasetto 349eb393bc DEV-40650: Refactor llmediadataresponder and llmediadatafetcher into a single reusable class
CC Review #7 (monroe)

LLMediaDataResponder and LLMediaDataFetcher were helpful classes that interacted with each other, but they were not general enough to cleanly be used for all media service interaction. This change refactors these classes into one (in fact, it is closer to a complete rewrite): LLMediaDataClient. This class has the following design points:

- You subclass from it when you want to specialize the responder, and then subclass from LLMediaDataClient::Responder if desired
- It has a few inner classes:
- LLMediaDataClient::Request, which now holds all of the data pertaining to a request, including retry counts
- LLMediaDataClient::Responder, which is now the LLHTTPClient::Responder
- LLMediaDataClient::PriorityQueue, which is now a STL priority_queue of Request objects.
- LLMediaDataClient::QueueTimer, which is the timer that fires to peel off queue items
- LLMediaDataClient::Responder::RetryTimer, which is the timer that is used when 503 errors are received.

The encapsulation of these inner classes is a lot cleaner and better reflects the scope of their responsibilities.

By and large, the logic hasn't really changed much. However, now there are two subclasses of LLMediaDataClient: one for the ObjectMedia cap and the other for the ObjectMediaNavigate cap. (I decided it was overkill to make three subclasses, one each for GET, UPDATE, and NAVIGATE, but we could still do that). LLVOVolume now instantiates both of these classes as statics (and destroys them on shutdown). They now have very simple API:

- LLObjectMediaDataClient::fetchMedia(LLVOVolume*) fetches the media for the given object
- LLObjectMediaDataClient::updateMedia(LLVOVolume*) sends an UPDATE of the media from the given object
- LLObjectMediaNavigateClient::navigate(LLVOVolume*, U8 texture_index, const std::string &url) navigates the given face (texture_index) on the given object to the given url.
2009-10-05 17:21:08 +00:00