diff options
author | Monroe Linden <monroe@lindenlab.com> | 2009-10-28 17:34:03 -0700 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2009-10-28 17:34:03 -0700 |
commit | 8ae2f388b69105b81c49483bdae443aabfa9e26e (patch) | |
tree | 4f2d334e61ce08a05023bffd832d40aa570e16a4 /indra/llplugin | |
parent | 437449044583d50c8cad694e65e5a4a23a55d768 (diff) |
Fixes for DEV-41791 and DEV-41920.
Reworked some of the autoplay logic in LLViewerMediaImpl to try and make it more consistent when media is unloaded and reloaded by the performance manager.
LLViewerMediaImpl will now keep track of the media state and current time of media that it unloads for performance reasons, and attempt to restore playing or paused media to the same playhead time and state (playing or paused) when it reloads.
Added "done" status that time-based media plugins can use to indicate that they've reached the end of the media and stopped.
Added logging of priority transitions, for use in debugging issues with the peformance manager.
Diffstat (limited to 'indra/llplugin')
-rw-r--r-- | indra/llplugin/llpluginclassmedia.cpp | 30 | ||||
-rw-r--r-- | indra/llplugin/llpluginclassmedia.h | 1 | ||||
-rw-r--r-- | indra/llplugin/llpluginclassmediaowner.h | 3 |
3 files changed, 25 insertions, 9 deletions
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 26802bbd1c..457c074ef1 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -552,6 +552,23 @@ void LLPluginClassMedia::loadURI(const std::string &uri) sendMessage(message); } +const char* LLPluginClassMedia::priorityToString(EPriority priority) +{ + const char* result = "UNKNOWN"; + switch(priority) + { + case PRIORITY_UNLOADED: result = "unloaded"; break; + case PRIORITY_STOPPED: result = "stopped"; break; + case PRIORITY_HIDDEN: result = "hidden"; break; + case PRIORITY_SLIDESHOW: result = "slideshow"; break; + case PRIORITY_LOW: result = "low"; break; + case PRIORITY_NORMAL: result = "normal"; break; + case PRIORITY_HIGH: result = "high"; break; + } + + return result; +} + void LLPluginClassMedia::setPriority(EPriority priority) { if(mPriority != priority) @@ -560,35 +577,28 @@ void LLPluginClassMedia::setPriority(EPriority priority) LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_priority"); - std::string priority_string; + std::string priority_string = priorityToString(priority); switch(priority) { case PRIORITY_UNLOADED: - priority_string = "unloaded"; mSleepTime = 1.0f; break; case PRIORITY_STOPPED: - priority_string = "stopped"; mSleepTime = 1.0f; break; case PRIORITY_HIDDEN: - priority_string = "hidden"; mSleepTime = 1.0f; break; case PRIORITY_SLIDESHOW: - priority_string = "slideshow"; mSleepTime = 1.0f; break; case PRIORITY_LOW: - priority_string = "low"; mSleepTime = 1.0f / 50.0f; break; case PRIORITY_NORMAL: - priority_string = "normal"; mSleepTime = 1.0f / 100.0f; break; case PRIORITY_HIGH: - priority_string = "high"; mSleepTime = 1.0f / 100.0f; break; } @@ -794,6 +804,10 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) { mStatus = LLPluginClassMediaOwner::MEDIA_PAUSED; } + else if(status == "done") + { + mStatus = LLPluginClassMediaOwner::MEDIA_DONE; + } else { // empty string or any unknown string diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 4f9763474e..90ecd1e073 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -150,6 +150,7 @@ public: PRIORITY_HIGH // media has user focus and/or is taking up most of the screen }EPriority; + static const char* priorityToString(EPriority priority); void setPriority(EPriority priority); void setLowPrioritySizeLimit(int size); diff --git a/indra/llplugin/llpluginclassmediaowner.h b/indra/llplugin/llpluginclassmediaowner.h index 4690f09172..c798af29ca 100644 --- a/indra/llplugin/llpluginclassmediaowner.h +++ b/indra/llplugin/llpluginclassmediaowner.h @@ -70,7 +70,8 @@ public: MEDIA_ERROR, // navigation/preroll failed MEDIA_PLAYING, // playing (only for time-based media) MEDIA_PAUSED, // paused (only for time-based media) - + MEDIA_DONE // finished playing (only for time-based media) + } EMediaStatus; virtual ~LLPluginClassMediaOwner() {}; |