From 374deb8da13c63f80dc1b245488eb254eb86f5d2 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Mon, 5 Oct 2009 15:48:00 -0700 Subject: Fixes for a different class of plugin failures (where loading the plugin dll fails) causing an error message loop: Made LLPluginProcessParent differentiate between failures launching/loading the plugin and failures after the plugin has been loaded. This allows us to handle launch failures differently, since retrying is unlikely to fix them. Added new media event MEDIA_EVENT_PLUGIN_FAILED_LAUNCH to indicate a launch failure. Added a case for the new event to LLViewerMediaImpl::handleMediaEvent() that sets the "failed init" flag to prevent retries. --- indra/llplugin/llpluginclassmedia.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llplugin/llpluginclassmedia.cpp') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 7299ede22d..e019cdcf21 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -883,6 +883,12 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) } +/* virtual */ +void LLPluginClassMedia::pluginLaunchFailed() +{ + mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PLUGIN_FAILED_LAUNCH); +} + /* virtual */ void LLPluginClassMedia::pluginDied() { -- cgit v1.2.3 From d02906b12ee335676e11ac883981e75f4df2cacc Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Mon, 12 Oct 2009 17:21:26 -0700 Subject: Added an optional "loaded_duration" parameter to the 'updated' message. This is the duration through which the time-based media has loaded, and should be between zero and the value of the "duration" parameter. If the parameter is not supplied, it will be implicitly set to the same value as the "duration" parameter, so the movie will appear fully loaded. This can be queried with LLPluginClassMedia::getLoadedDuration(). Made the "loaded_duration" parameter also implicitly set the progress percentage and send out MEDIA_EVENT_PROGRESS_UPDATED messages when it changes. Made the quicktime plugin set the "loaded_duration" parameter in its update messages. --- indra/llplugin/llpluginclassmedia.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'indra/llplugin/llpluginclassmedia.cpp') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index e019cdcf21..2a343fd0c9 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -133,6 +133,7 @@ void LLPluginClassMedia::reset() mCurrentTime = 0.0f; mDuration = 0.0f; mCurrentRate = 0.0f; + mLoadedDuration = 0.0f; } void LLPluginClassMedia::idle(void) @@ -705,6 +706,7 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) bool time_duration_updated = false; + int previous_percent = mProgressPercent; if(message.hasValue("current_time")) { @@ -722,11 +724,32 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) mCurrentRate = message.getValueReal("current_rate"); } + if(message.hasValue("loaded_duration")) + { + mLoadedDuration = message.getValueReal("loaded_duration"); + time_duration_updated = true; + } + else + { + // If the message doesn't contain a loaded_duration param, assume it's equal to duration + mLoadedDuration = mDuration; + } + + // Calculate a percentage based on the loaded duration and total duration. + if(mDuration != 0.0f) // Don't divide by zero. + { + mProgressPercent = (int)((mLoadedDuration * 100.0f)/mDuration); + } + if(time_duration_updated) { mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_TIME_DURATION_UPDATED); } + if(previous_percent != mProgressPercent) + { + mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PROGRESS_UPDATED); + } } else if(message_name == "media_status") { -- cgit v1.2.3 From 434709680326aa634805afdcf900b7445ef4aac4 Mon Sep 17 00:00:00 2001 From: callum Date: Thu, 15 Oct 2009 11:26:52 -0700 Subject: https://jira.lindenlab.com/jira/browse/DEV-40711 Implement name fetching capabilities for Webkit and Quicktime plugins Adds support for new PluginAPI message (MEDIA_EVENT_NAME_CHANGED) that updates the "title" of the media. In WebKit plugin this is the contents of the tag. In The QuickTime plugin it is the "display name" from the movie meta data --- indra/llplugin/llpluginclassmedia.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llplugin/llpluginclassmedia.cpp') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 2a343fd0c9..fc58b48a7b 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -835,6 +835,11 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) mCanPaste = message.getValueBoolean("paste"); } } + else if(message_name == "name_text") + { + mMediaName = message.getValue("name"); + mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAME_CHANGED); + } else { LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL; -- cgit v1.2.3