Henry's Media Fixes

This commit is contained in:
Siana Gearz
2010-11-11 22:00:01 +01:00
parent 5a49ceab6d
commit c06db583a2
11 changed files with 287 additions and 84 deletions

View File

@@ -247,8 +247,7 @@ std::string LLViewerMedia::getCurrentUserAgent()
// Just in case we need to check browser differences in A/B test
// builds.
std::string channel = LL_CHANNEL;
std::string channel = gSavedSettings.getString("VersionChannelName");
// append our magic version number string to the browser user agent id
// See the HTTP 1.0 and 1.1 specifications for allowed formats:
@@ -463,6 +462,19 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
std::string user_data_path = gDirUtilp->getOSUserAppDir();
user_data_path += gDirUtilp->getDirDelimiter();
// Fix for EXT-5960 - make browser profile specific to user (cache, cookies etc.)
// If the linden username returned is blank, that can only mean we are
// at the login page displaying login Web page or Web browser test via Develop menu.
// In this case we just use whatever gDirUtilp->getOSUserAppDir() gives us (this
// is what we always used before this change)
std::string linden_user_dir = gDirUtilp->getLindenUserDir();
if (!linden_user_dir.empty())
{
// gDirUtilp->getLindenUserDir() is whole path, not just Linden name
user_data_path = linden_user_dir;
user_data_path += gDirUtilp->getDirDelimiter();
}
// See if the plugin executable exists
llstat s;
if(LLFile::stat(launcher_name, &s))
@@ -703,8 +715,12 @@ void LLViewerMediaImpl::navigateHome()
}
//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type)
void LLViewerMediaImpl::navigateTo(const std::string& _url, const std::string& mime_type, bool rediscover_type)
{
// trim whitespace from front and back of URL - fixes EXT-5363
std::string url(_url);
LLStringUtil::trim(url);
if(rediscover_type)
{
@@ -713,7 +729,12 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi
if(scheme.empty() || "http" == scheme || "https" == scheme)
{
LLHTTPClient::getHeaderOnly( url, new LLMimeDiscoveryResponder(this));
// If we don't set an Accept header, LLHTTPClient will add one like this:
// Accept: application/llsd+xml
// which is really not what we want.
LLSD headers = LLSD::emptyMap();
headers["Accept"] = "*/*";
LLHTTPClient::getHeaderOnly(url, new LLMimeDiscoveryResponder(this), headers, 10.0f);
}
else if("data" == scheme || "file" == scheme || "about" == scheme)
{

View File

@@ -196,45 +196,34 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
// Debug print
// LL_DEBUGS("Media") << "Play media type : " << mime_type << ", url : " << media_url << LL_ENDL;
if(sMediaImpl)
if (!sMediaImpl || (sMediaImpl &&
(sMediaImpl->getMediaURL() != media_url ||
sMediaImpl->getMimeType() != mime_type ||
sMediaImpl->getMediaTextureID() != placeholder_texture_id)))
{
// If the url and mime type are the same, call play again
if(sMediaImpl->getMediaURL() == media_url
&& sMediaImpl->getMimeType() == mime_type
&& sMediaImpl->getMediaTextureID() == placeholder_texture_id)
if (sMediaImpl)
{
LL_DEBUGS("Media") << "playing with existing url " << media_url << LL_ENDL;
sMediaImpl->play();
}
// Else if the texture id's are the same, navigate and rediscover type
// MBW -- This causes other state from the previous parcel (texture size, autoscale, and looping) to get re-used incorrectly.
// It's also not really necessary -- just creating a new instance is fine.
// else if(sMediaImpl->getMediaTextureID() == placeholder_texture_id)
// {
// sMediaImpl->navigateTo(media_url, mime_type, true);
// }
else
{
// Since the texture id is different, we need to generate a new impl
LL_DEBUGS("Media") << "new media impl with mime type " << mime_type << ", url " << media_url << LL_ENDL;
// Delete the old one first so they don't fight over the texture.
// Delete the old media impl first so they don't fight over the texture.
sMediaImpl->stop();
}
LL_DEBUGS("Media") << "new media impl with mime type " << mime_type << ", url " << media_url << LL_ENDL;
// There is no media impl, or it has just been deprecated, make a new one
sMediaImpl = LLViewerMedia::newMediaImpl(media_url, placeholder_texture_id,
media_width, media_height, media_auto_scale,
media_loop, mime_type);
}
}
else
{
// There is no media impl, make a new one
sMediaImpl = LLViewerMedia::newMediaImpl(media_url, placeholder_texture_id,
media_width, media_height, media_auto_scale,
media_loop, mime_type);
}
// The url, mime type and texture are now the same, call play again
if (sMediaImpl->getMediaURL() == media_url
&& sMediaImpl->getMimeType() == mime_type
&& sMediaImpl->getMediaTextureID() == placeholder_texture_id)
{
LL_DEBUGS("Media") << "playing with existing url " << media_url << LL_ENDL;
sMediaImpl->play();
}
LLFirstUse::useMedia();

View File

@@ -120,7 +120,7 @@
none
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="none/none">
@@ -130,6 +130,9 @@
<widgettype>
none
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="audio/*">
<label name="audio2_label">
@@ -138,6 +141,9 @@
<widgettype>
audio
</widgettype>
<impl>
media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="video/*">
<label name="video2_label">
@@ -146,6 +152,9 @@
<widgettype>
movie
</widgettype>
<impl>
media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="image/*">
<label name="image2_label">
@@ -154,6 +163,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
<label name="vnd.secondlife.qt.legacy_label">
@@ -173,6 +185,9 @@
<widgettype>
web
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/ogg">
<label name="application/ogg_label">
@@ -181,6 +196,9 @@
<widgettype>
audio
</widgettype>
<impl>
media_plugin_gstreamer
</impl>
</mimetype>
<mimetype name="application/pdf">
<label name="application/pdf_label">
@@ -189,6 +207,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/postscript">
<label name="application/postscript_label">
@@ -197,6 +218,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/rtf">
<label name="application/rtf_label">
@@ -205,6 +229,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/smil">
<label name="application/smil_label">
@@ -214,7 +241,7 @@
movie
</widgettype>
<impl>
media_plugin_gstreamer
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/xhtml+xml">
@@ -224,6 +251,9 @@
<widgettype>
web
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/x-director">
<label name="application/x-director_label">
@@ -232,6 +262,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="audio/mid">
<label name="audio/mid_label">

View File

@@ -130,6 +130,9 @@
<widgettype>
none
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="audio/*">
<label name="audio2_label">
@@ -138,6 +141,9 @@
<widgettype>
audio
</widgettype>
<impl>
media_plugin_quicktime
</impl>
</mimetype>
<mimetype name="video/*">
<label name="video2_label">
@@ -146,6 +152,9 @@
<widgettype>
movie
</widgettype>
<impl>
media_plugin_quicktime
</impl>
</mimetype>
<mimetype name="image/*">
<label name="image2_label">
@@ -154,6 +163,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
<label name="vnd.secondlife.qt.legacy_label">
@@ -173,6 +185,9 @@
<widgettype>
web
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/ogg">
<label name="application/ogg_label">
@@ -181,6 +196,9 @@
<widgettype>
audio
</widgettype>
<impl>
media_plugin_quicktime
</impl>
</mimetype>
<mimetype name="application/pdf">
<label name="application/pdf_label">
@@ -189,6 +207,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/postscript">
<label name="application/postscript_label">
@@ -197,6 +218,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/rtf">
<label name="application/rtf_label">
@@ -205,6 +229,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/smil">
<label name="application/smil_label">
@@ -214,7 +241,7 @@
movie
</widgettype>
<impl>
media_plugin_quicktime
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/xhtml+xml">
@@ -224,6 +251,9 @@
<widgettype>
web
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/x-director">
<label name="application/x-director_label">
@@ -232,6 +262,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="audio/mid">
<label name="audio/mid_label">

View File

@@ -120,7 +120,7 @@
none
</widgettype>
<impl>
media_plugin_quicktime
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="none/none">
@@ -130,6 +130,9 @@
<widgettype>
none
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="audio/*">
<label name="audio2_label">
@@ -138,6 +141,9 @@
<widgettype>
audio
</widgettype>
<impl>
media_plugin_quicktime
</impl>
</mimetype>
<mimetype name="video/*">
<label name="video2_label">
@@ -146,6 +152,9 @@
<widgettype>
movie
</widgettype>
<impl>
media_plugin_quicktime
</impl>
</mimetype>
<mimetype name="image/*">
<label name="image2_label">
@@ -154,6 +163,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
<label name="vnd.secondlife.qt.legacy_label">
@@ -173,6 +185,9 @@
<widgettype>
web
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/ogg">
<label name="application/ogg_label">
@@ -181,6 +196,9 @@
<widgettype>
audio
</widgettype>
<impl>
media_plugin_quicktime
</impl>
</mimetype>
<mimetype name="application/pdf">
<label name="application/pdf_label">
@@ -189,6 +207,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/postscript">
<label name="application/postscript_label">
@@ -197,6 +218,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/rtf">
<label name="application/rtf_label">
@@ -205,6 +229,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/smil">
<label name="application/smil_label">
@@ -214,7 +241,7 @@
movie
</widgettype>
<impl>
media_plugin_quicktime
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/xhtml+xml">
@@ -224,6 +251,9 @@
<widgettype>
web
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="application/x-director">
<label name="application/x-director_label">
@@ -232,6 +262,9 @@
<widgettype>
image
</widgettype>
<impl>
media_plugin_webkit
</impl>
</mimetype>
<mimetype name="audio/mid">
<label name="audio/mid_label">