Dullasync

Fixes scaling issue
Also fixes the openid cookie
This commit is contained in:
Lirusaito
2019-04-10 06:43:14 -04:00
parent 621a342809
commit 3462f403fe
8 changed files with 570 additions and 502 deletions

View File

@@ -1745,9 +1745,6 @@ bool LLAppViewer::cleanup()
removeDumpDir();
writeDebugInfo();
if(!gDirUtilp->getLindenUserDir(true).empty())
LLViewerMedia::saveCookieFile();
// Stop the plugin read thread if it's running.
LLPluginProcessParent::setUseReadThread(false);
// Stop curl responder call backs.

View File

@@ -70,14 +70,14 @@ LLMediaCtrl::Params::Params()
: start_url("start_url"),
border_visible("border_visible", false),
decouple_texture_size("decouple_texture_size", false),
trusted_content("trusted_content", false),
focus_on_click("focus_on_click", true),
texture_width("texture_width", 1024),
texture_height("texture_height", 1024),
caret_color("caret_color"),
initial_mime_type("initial_mime_type"),
error_page_url("error_page_url"),
media_id("media_id"),
trusted_content("trusted_content", false),
focus_on_click("focus_on_click", true)
error_page_url("error_page_url")
{
}
@@ -85,25 +85,25 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
LLPanel( p.name, p.rect, FALSE),
LLInstanceTracker<LLMediaCtrl, LLUUID>(LLUUID::generateNewID()),
mTextureDepthBytes( 4 ),
mBorder(NULL),
mBorder(nullptr),
mFrequentUpdates( true ),
mForceUpdate( false ),
mHomePageUrl( "" ),
mTrusted(p.trusted_content),
mAlwaysRefresh( false ),
mMediaSource( 0 ),
mTakeFocusOnClick( p.focus_on_click ),
mCurrentNavUrl( "about:blank" ),
mStretchToFill( true ),
mMaintainAspectRatio ( true ),
mClearCache(false),
mHoverTextChanged(false),
mDecoupleTextureSize ( false ),
mUpdateScrolls( false ),
mHomePageUrl( "" ),
mHomePageMimeType(p.initial_mime_type),
mCurrentNavUrl( "about:blank" ),
mErrorPageURL(p.error_page_url),
mMediaSource( nullptr ),
mTextureWidth ( 1024 ),
mTextureHeight ( 1024 ),
mClearCache(false),
mUpdateScrolls( false ),
mHomePageMimeType(p.initial_mime_type),
mErrorPageURL(p.error_page_url),
mTrusted(p.trusted_content),
mHoverTextChanged(false),
mContextMenu()
{
{
@@ -141,6 +141,13 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
LLMediaCtrl::~LLMediaCtrl()
{
auto menu = mContextMenu.get();
if (menu)
{
menu->die();
mContextMenu.markDead();
}
if (mMediaSource)
{
mMediaSource->remObserver( this );
@@ -158,7 +165,9 @@ void LLMediaCtrl::setBorderVisible( BOOL border_visible )
addChild( mBorder );
}
if(mBorder)
{
mBorder->setVisible(border_visible);
}
};
////////////////////////////////////////////////////////////////////////////////
@@ -241,7 +250,7 @@ BOOL LLMediaCtrl::handleMouseUp( S32 x, S32 y, MASK mask )
mMediaSource->mouseUp(x, y, mask);
}
gFocusMgr.setMouseCapture( NULL );
gFocusMgr.setMouseCapture(nullptr );
return TRUE;
}
@@ -286,7 +295,7 @@ BOOL LLMediaCtrl::handleRightMouseUp( S32 x, S32 y, MASK mask )
}
}
gFocusMgr.setMouseCapture( NULL );
gFocusMgr.setMouseCapture(nullptr );
return TRUE;
}
@@ -310,12 +319,19 @@ BOOL LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask )
setFocus( TRUE );
}
LLMenuGL* menu = (LLMenuGL*)mContextMenu.get();
if (menu)
auto con_menu = (LLMenuGL*)mContextMenu.get();
if (con_menu)
{
menu->buildDrawLabels();
menu->updateParent(LLMenuGL::sMenuContainer);
LLMenuGL::showPopup(this,menu, x, y);
/* Singu Note: Share your toys!!
// hide/show debugging options
bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging");
con_menu->setItemVisible("open_webinspector", media_plugin_debugging_enabled );
con_menu->setItemVisible("debug_separator", media_plugin_debugging_enabled );
*/
con_menu->buildDrawLabels();
con_menu->updateParent(LLMenuGL::sMenuContainer);
LLMenuGL::showPopup(this, con_menu, x, y);
}
return TRUE;
@@ -367,7 +383,7 @@ void LLMediaCtrl::onFocusLost()
if( LLEditMenuHandler::gEditMenuHandler == mMediaSource )
{
// Clear focus for edit menu items
LLEditMenuHandler::gEditMenuHandler = NULL;
LLEditMenuHandler::gEditMenuHandler = nullptr;
}
}
@@ -380,13 +396,21 @@ void LLMediaCtrl::onFocusLost()
//
BOOL LLMediaCtrl::postBuild ()
{
LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_media_ctrl.xml",LLMenuGL::sMenuContainer);
/*LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar;
registar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this));
registar.add("Open.ViewSource", boost::bind(&LLMediaCtrl::onShowSource, this));
// stinson 05/05/2014 : use this as the parent of the context menu if the static menu
// container has yet to be created
LLView* menuParent = (gMenuHolder != nullptr) ? dynamic_cast<LLView*>(gMenuHolder) : dynamic_cast<LLView*>(this);
llassert(menuParent != NULL);*/
auto menu = LLUICtrlFactory::getInstance()->buildMenu("menu_media_ctrl.xml",LLMenuGL::sMenuContainer);
if(menu)
{
mContextMenu = menu->getHandle();
}
setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2));
setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChanged, this, _2));
return true;
}
@@ -453,12 +477,9 @@ BOOL LLMediaCtrl::handleUnicodeCharHere(llwchar uni_char)
{
BOOL result = FALSE;
// only accept 'printable' characters, sigh...
if (uni_char >= 32 // discard 'control' characters
&& uni_char != 127) // SDL thinks this is 'delete' - yuck.
if (mMediaSource)
{
if (mMediaSource)
result = mMediaSource->handleUnicodeCharHere(uni_char);
result = mMediaSource->handleUnicodeCharHere(uni_char);
}
if ( ! result )
@@ -469,7 +490,7 @@ BOOL LLMediaCtrl::handleUnicodeCharHere(llwchar uni_char)
////////////////////////////////////////////////////////////////////////////////
//
void LLMediaCtrl::onVisibilityChange ( const LLSD& new_visibility )
void LLMediaCtrl::onVisibilityChanged( const LLSD& new_visibility )
{
// set state of frequent updates automatically if visibility changes
if ( new_visibility.asBoolean() )
@@ -568,7 +589,7 @@ void LLMediaCtrl::clearCache()
////////////////////////////////////////////////////////////////////////////////
//
void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type)
void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type, bool clean_browser)
{
// don't browse to anything that starts with secondlife:// or sl://
const std::string protocol1 = "secondlife://";
@@ -585,7 +606,7 @@ void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type)
{
mCurrentNavUrl = url_in;
mMediaSource->setSize(mTextureWidth, mTextureHeight);
mMediaSource->navigateTo(url_in, mime_type, mime_type.empty());
mMediaSource->navigateTo(url_in, mime_type, mime_type.empty(), false, clean_browser);
}
}
@@ -768,8 +789,8 @@ void LLMediaCtrl::draw()
bool draw_media = false;
LLPluginClassMedia* media_plugin = NULL;
LLViewerMediaTexture* media_texture = NULL;
LLPluginClassMedia* media_plugin = nullptr;
LLViewerMediaTexture* media_texture = nullptr;
if(mMediaSource && mMediaSource->hasMedia())
{
@@ -806,52 +827,8 @@ void LLMediaCtrl::draw()
F32 max_u = ( F32 )media_plugin->getWidth() / ( F32 )media_plugin->getTextureWidth();
F32 max_v = ( F32 )media_plugin->getHeight() / ( F32 )media_plugin->getTextureHeight();
LLRect r = getRect();
S32 width, height;
S32 x_offset = 0;
S32 y_offset = 0;
if(mStretchToFill)
{
if(mMaintainAspectRatio)
{
F32 media_aspect = (F32)(media_plugin->getWidth()) / (F32)(media_plugin->getHeight());
F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight());
if(media_aspect > view_aspect)
{
// max width, adjusted height
width = r.getWidth();
height = llmin(llmax(ll_round(width / media_aspect), 0), r.getHeight());
}
else
{
// max height, adjusted width
height = r.getHeight();
width = llmin(llmax(ll_round(height * media_aspect), 0), r.getWidth());
}
}
else
{
width = r.getWidth();
height = r.getHeight();
}
}
else
{
width = llmin(media_plugin->getWidth(), r.getWidth());
height = llmin(media_plugin->getHeight(), r.getHeight());
}
x_offset = (r.getWidth() - width) / 2;
y_offset = (r.getHeight() - height) / 2;
/*if (mIgnoreUIScale)
{
x_offset = ll_round((F32)x_offset * LLUI::getScaleFactor().mV[VX]);
y_offset = ll_round((F32)y_offset * LLUI::getScaleFactor().mV[VY]);
width = ll_round((F32)width * LLUI::getScaleFactor().mV[VX]);
height = ll_round((F32)height * LLUI::getScaleFactor().mV[VY]);
}*/
S32 x_offset, y_offset, width, height;
calcOffsetsAndSize(&x_offset, &y_offset, &width, &height);
// draw the browser
gGL.setSceneBlendType(LLRender::BT_REPLACE);
@@ -910,6 +887,50 @@ void LLMediaCtrl::draw()
setBackgroundOpaque(background_opaque);
}
////////////////////////////////////////////////////////////////////////////////
//
void LLMediaCtrl::calcOffsetsAndSize(S32 *x_offset, S32 *y_offset, S32 *width, S32 *height)
{
const LLRect &r = getRect();
*x_offset = *y_offset = 0;
const auto& media_plugin = mMediaSource->getMediaPlugin();
if(mStretchToFill)
{
if(mMaintainAspectRatio)
{
F32 media_aspect = (F32)(media_plugin->getWidth()) / (F32)(media_plugin->getHeight());
F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight());
if(media_aspect > view_aspect)
{
// max width, adjusted height
*width = r.getWidth();
*height = llmin(llmax(ll_round(*width / media_aspect), 0), r.getHeight());
}
else
{
// max height, adjusted width
*height = r.getHeight();
*width = llmin(llmax(ll_round(*height * media_aspect), 0), r.getWidth());
}
}
else
{
*width = r.getWidth();
*height = r.getHeight();
}
}
else
{
*width = llmin(media_plugin->getWidth(), r.getWidth());
*height = llmin(media_plugin->getHeight(), r.getHeight());
}
*x_offset = (r.getWidth() - *width) / 2;
*y_offset = (r.getHeight() - *height) / 2;
}
////////////////////////////////////////////////////////////////////////////////
//
void LLMediaCtrl::convertInputCoords(S32& x, S32& y)
@@ -1013,17 +1034,24 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
case MEDIA_EVENT_CLICK_LINK_HREF:
{
LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << self->getClickTarget() << "\", uri is " << self->getClickURL() << LL_ENDL;
// retrieve the event parameters
std::string url = self->getClickURL();
std::string target = self->getClickTarget();
std::string uuid = self->getClickUUID();
LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << target << "\", uri is " << url << LL_ENDL;
LLWeb::loadURL(url, target, std::string());
// try as slurl first
if (!LLURLDispatcher::dispatch(url, "clicked", nullptr, mTrusted))
{
LLWeb::loadURL(url, target, uuid);
}
//LLNotification::Params notify_params("PopupAttempt");
// CP: removing this code because we no longer support popups so this breaks the flow.
// replaced with a bare call to LLWeb::LoadURL(...)
//LLNotification::Params notify_params;
//notify_params.name = "PopupAttempt";
//notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid).with("media_id", mMediaTextureID);
//notify_params.functor(boost::bind(&LLMediaCtrl::onPopup, this, _1, _2));
//notify_params.functor.function = boost::bind(&LLMediaCtrl::onPopup, this, _1, _2);
//if (mTrusted)
//{
@@ -1111,7 +1139,24 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
case MEDIA_EVENT_DEBUG_MESSAGE:
{
LL_INFOS("media") << self->getDebugMessageText() << LL_ENDL;
std::string level = self->getDebugMessageLevel();
if (level == "debug")
{
LL_DEBUGS("Media") << self->getDebugMessageText() << LL_ENDL;
}
else if (level == "info")
{
LL_INFOS("Media") << self->getDebugMessageText() << LL_ENDL;
}
else if (level == "warn")
{
LL_WARNS("Media") << self->getDebugMessageText() << LL_ENDL;
}
else if (level == "error")
{
LL_ERRS("Media") << self->getDebugMessageText() << LL_ENDL;
}
};
break;
@@ -1132,7 +1177,7 @@ std::string LLMediaCtrl::getCurrentNavUrl()
return mCurrentNavUrl;
}
bool LLMediaCtrl::onPopup(const LLSD& notification, const LLSD& response)
void LLMediaCtrl::onPopup(const LLSD& notification, const LLSD& response)
{
if (response["open"])
{
@@ -1143,7 +1188,6 @@ bool LLMediaCtrl::onPopup(const LLSD& notification, const LLSD& response)
// Make sure the opening instance knows its window open request was denied, so it can clean things up.
LLViewerMedia::proxyWindowClosed(notification["payload"]["uuid"]);
}
return FALSE;
}
void LLMediaCtrl::showNotification(LLNotificationPtr notify)

View File

@@ -2,31 +2,25 @@
* @file llmediactrl.h
* @brief Web browser UI control
*
* $LicenseInfo:firstyear=2006&license=viewergpl$
*
* Copyright (c) 2006-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -90,7 +84,7 @@ public:
// Defaults to true.
void setTakeFocusOnClick( bool take_focus );
virtual LLXMLNodePtr getXML(bool save_children = true) const;
virtual LLXMLNodePtr getXML(bool save_children = true) const override;
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
// handle mouse related methods
@@ -104,7 +98,7 @@ public:
BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) override;
// navigation
void navigateTo( std::string url_in, std::string mime_type = "");
void navigateTo( std::string url_in, std::string mime_type = "", bool clean_browser = false);
void navigateBack();
void navigateHome();
void navigateForward();
@@ -190,8 +184,11 @@ public:
void convertInputCoords(S32& x, S32& y);
private:
void onVisibilityChange ( const LLSD& new_visibility );
bool onPopup(const LLSD& notification, const LLSD& response);
void calcOffsetsAndSize(S32 *x_offset, S32 *y_offset, S32 *width, S32 *height);
private:
void onVisibilityChanged ( const LLSD& new_visibility );
void onPopup(const LLSD& notification, const LLSD& response);
const S32 mTextureDepthBytes;
LLUUID mMediaTextureID;

View File

@@ -1140,9 +1140,7 @@ bool idle_startup()
// Load URL History File
LLURLHistory::loadFile("url_history.xml");
// Load media plugin cookies
LLViewerMedia::loadCookieFile();
//-------------------------------------------------
// Handle startup progress screen
//-------------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@@ -2,31 +2,25 @@
* @file llviewermedia.h
* @brief Client interface to the media engine
*
* $LicenseInfo:firstyear=2007&license=viewergpl$
*
* Copyright (c) 2007-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -46,7 +40,6 @@
#include "llnotificationptr.h"
#include "llurl.h"
#include "llviewerpluginmanager.h"
class LLViewerMediaImpl;
@@ -55,7 +48,6 @@ class LLViewerMediaTexture;
class LLMediaEntry;
class LLVOVolume;
class LLMimeDiscoveryResponder;
class LLPluginCookieStore;
typedef LLPointer<LLViewerMediaImpl> viewer_media_t;
///////////////////////////////////////////////////////////////////////////////
@@ -111,10 +103,14 @@ public:
// Is any media currently "showing"? Includes Parcel Media. Does not include media in the UI.
static bool isAnyMediaShowing();
// Shows if any media is playing, counts visible non time based media as playing. Does not include media in the UI.
static bool isAnyMediaPlaying();
// Set all media enabled or disabled, depending on val. Does not include media in the UI.
static void setAllMediaEnabled(bool val);
// Set all media paused(stopped for non time based) or playing, depending on val. Does not include media in the UI.
static void setAllMediaPaused(bool val);
static void updateMedia(void* dummy_arg = NULL);
static void updateMedia(void* dummy_arg = nullptr);
static void initClass();
static void cleanupClass();
@@ -151,13 +147,6 @@ public:
// Set the proxy config for all loaded plugins
static void setProxyConfig(bool enable, const std::string &host, int port);
static LLPluginCookieStore *getCookieStore();
static void loadCookieFile();
static void saveCookieFile();
static void addCookie(const std::string &name, const std::string &value, const std::string &domain, const LLDate &expires, const std::string &path = std::string("/"), bool secure = false );
static void addSessionCookie(const std::string &name, const std::string &value, const std::string &domain, const std::string &path = std::string("/"), bool secure = false );
static void removeCookie(const std::string &name, const std::string &domain, const std::string &path = std::string("/") );
static void openIDSetup(const std::string &openid_url, const std::string &openid_token);
static void openIDCookieResponse(const std::string &cookie);
@@ -172,10 +161,12 @@ public:
static class AIHTTPHeaders getHeaders();
private:
static bool parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path, bool& httponly, bool& secure);
static void setOpenIDCookie();
static void onTeleportFinished();
static LLPluginCookieStore *sCookieStore;
static void getOpenIDCookieCoro(std::string url);
static LLURL sOpenIDURL;
static std::string sOpenIDCookie;
static LLPluginClassMedia* sSpareBrowserMediaSource;
@@ -201,7 +192,7 @@ public:
~LLViewerMediaImpl();
// Override inherited version from LLViewerMediaEventEmitter
virtual void emitEvent(LLPluginClassMedia* self, LLViewerMediaObserver::EMediaEvent event);
void emitEvent(LLPluginClassMedia* self, LLViewerMediaObserver::EMediaEvent event) override;
void createMediaSource();
void destroyMediaSource();
@@ -223,6 +214,7 @@ public:
void skipBack(F32 step_scale);
void skipForward(F32 step_scale);
void setVolume(F32 volume);
void setMute(bool mute);
void updateVolume();
F32 getVolume();
void focus(bool focus);
@@ -244,7 +236,7 @@ public:
void navigateReload();
void navigateHome();
void unload();
void navigateTo(const std::string& url, const std::string& mime_type = "", bool rediscover_type = false, bool server_request = false);
void navigateTo(const std::string& url, const std::string& mime_type = "", bool rediscover_type = false, bool server_request = false, bool clean_browser = false);
void navigateInternal();
void navigateStop();
bool handleKeyHere(KEY key, MASK mask);
@@ -301,7 +293,7 @@ public:
void setTarget(const std::string& target) { mTarget = target; }
// utility function to create a ready-to-use media instance from a desired media type.
static LLPluginClassMedia* newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be NULL */, S32 default_width, S32 default_height, const std::string target = LLStringUtil::null);
static LLPluginClassMedia* newSourceFromMediaType(std::string media_type, LLPluginClassMediaOwner *owner /* may be NULL */, S32 default_width, S32 default_height, F64 zoom_factor, const std::string target = LLStringUtil::null, bool clean_browser = false);
// Internally set our desired browser user agent string, including
// the Second Life version and skin name. Used because we can
@@ -313,40 +305,51 @@ public:
static bool handleSkinCurrentChanged(const LLSD& newvalue);
// need these to handle mouseup...
/*virtual*/ void onMouseCaptureLost();
/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask);
/*virtual*/ void onMouseCaptureLost() override;
/*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask) override;
// Grr... the only thing I want as an LLMouseHandler are the onMouseCaptureLost and handleMouseUp calls.
// Sadly, these are all pure virtual, so I have to supply implementations here:
/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; };
/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) { return FALSE; };
/*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) { return FALSE; };
/*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) { return FALSE; };
/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) { return FALSE; };
/*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) { return FALSE; };
/*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) { return FALSE; };
/*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; };
/*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) {return FALSE; };
/*virtual*/ const std::string& getName() const;
/*virtual*/ BOOL isView() const { return FALSE; };
/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask) override { return FALSE; };
/*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override { return FALSE; };
/*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks) override { return FALSE; };
/*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override { return FALSE; };
/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override { return FALSE; };
/*virtual*/ BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) override { return FALSE; };
/*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) override { return FALSE; };
/*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) override { return FALSE; };
/*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) override {return FALSE; };
/*virtual*/ const std::string& getName() const override;
/*virtual*/ BOOL isView() const override { return FALSE; };
/*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const {};
/*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const {};
/*virtual*/ BOOL hasMouseCapture() { return gFocusMgr.getMouseCapture() == this; };
/*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const override {};
/*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const override {};
/*virtual*/ BOOL hasMouseCapture() override { return gFocusMgr.getMouseCapture() == this; };
// Inherited from LLPluginClassMediaOwner
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent);
/*virtual*/ void handleCookieSet(LLPluginClassMedia* self, const std::string &cookie);
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent) override;
// LLEditMenuHandler overrides
/*virtual*/ void cut();
/*virtual*/ BOOL canCut() const;
/*virtual*/ void undo() override;
/*virtual*/ BOOL canUndo() const override;
/*virtual*/ void copy();
/*virtual*/ BOOL canCopy() const;
/*virtual*/ void redo() override;
/*virtual*/ BOOL canRedo() const override;
/*virtual*/ void paste();
/*virtual*/ BOOL canPaste() const;
/*virtual*/ void cut() override;
/*virtual*/ BOOL canCut() const override;
/*virtual*/ void copy() override;
/*virtual*/ BOOL canCopy() const override;
/*virtual*/ void paste() override;
/*virtual*/ BOOL canPaste() const override;
/*virtual*/ void doDelete() override;
/*virtual*/ BOOL canDoDelete() const override;
/*virtual*/ void selectAll() override;
/*virtual*/ BOOL canSelectAll() const override;
void addObject(LLVOVolume* obj) ;
void removeObject(LLVOVolume* obj) ;
@@ -466,6 +469,7 @@ private:
bool mNavigateServerRequest;
bool mMediaSourceFailed;
F32 mRequestedVolume;
F32 mPreviousVolume;
bool mIsMuted;
bool mNeedsMuteCheck;
int mPreviousMediaState;
@@ -475,7 +479,6 @@ private:
S32 mProximity;
F64 mProximityDistance;
F64 mProximityCamera;
LLMimeDiscoveryResponder *mMimeTypeProbe;
bool mMediaAutoPlay;
std::string mMediaEntryURL;
bool mInNearbyMediaList; // used by LLPanelNearbyMedia::refreshList() for performance reasons
@@ -486,11 +489,15 @@ private:
bool mTrustedBrowser;
std::string mTarget;
LLNotificationPtr mNotification;
bool mCleanBrowser; // force the creation of a clean browsing target with full options enabled
static std::vector<std::string> sMimeTypesFailed;
private:
BOOL mIsUpdated ;
std::list< LLVOVolume* > mObjectList ;
LLMimeDiscoveryResponder* mMimeProbe;
private:
LLViewerMediaTexture *updatePlaceholderImage();
};

View File

@@ -162,7 +162,7 @@ LLPluginClassMedia* LLStreamingAudio_MediaPlugins::initializeMedia(const std::st
{
LLPluginClassMediaOwner* owner = NULL;
S32 default_size = 1; // audio-only - be minimal, doesn't matter
LLPluginClassMedia* media_source = LLViewerMediaImpl::newSourceFromMediaType(media_type, owner, default_size, default_size);
LLPluginClassMedia* media_source = LLViewerMediaImpl::newSourceFromMediaType(media_type, owner, default_size, default_size, 1.0);
if (media_source)
{

View File

@@ -1586,6 +1586,19 @@ Unable to download file
<tag>fail</tag>
</notification>
<notification
name="MediaFileDownloadUnsupported"
label=""
type="alert">
<unique/>
<tag>confirm</tag>
You have requested a file download, which is not supported within [SECOND_LIFE].
<usetemplate
ignoretext="Warn about unsupported file downloads"
name="okignore"
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
name="CannotWriteFile"