Merge branch 'release/2025.08' of https://github.com/secondlife/viewer

# Conflicts:
#	indra/newview/llviewermedia.cpp
#	indra/newview/llviewerwindow.cpp
master
Ansariel 2025-10-29 19:11:13 +01:00
commit ced6a24696
15 changed files with 249 additions and 114 deletions

View File

@ -1952,7 +1952,10 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
image_raw->copyUnscaledAlphaMask(alpha_image_raw, LLColor4U::black); image_raw->copyUnscaledAlphaMask(alpha_image_raw, LLColor4U::black);
} }
tex->createGLTexture(0, image_raw, 0, true, LLGLTexture::LOCAL); if (!tex->createGLTexture(0, image_raw, 0, true, LLGLTexture::LOCAL))
{
LL_WARNS() << "Failed to create GL texture for image: " << file_name << LL_ENDL;
}
gGL.getTexUnit(0)->bind(tex); gGL.getTexUnit(0)->bind(tex);
tex->setAddressMode(LLTexUnit::TAM_CLAMP); tex->setAddressMode(LLTexUnit::TAM_CLAMP);

View File

@ -356,7 +356,10 @@ bool LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
// Create the GL texture, and then hang onto it for future use. // Create the GL texture, and then hang onto it for future use.
if (mNeedsCreateTexture) if (mNeedsCreateTexture)
{ {
mCachedProcessedTexture->createGLTexture(0, mStaticImageRaw); if (!mCachedProcessedTexture->createGLTexture(0, mStaticImageRaw))
{
LL_WARNS() << "Failed to create GL texture for image: " << mCachedProcessedTexture->getID() << LL_ENDL;
}
mNeedsCreateTexture = false; mNeedsCreateTexture = false;
gGL.getTexUnit(0)->bind(mCachedProcessedTexture); gGL.getTexUnit(0)->bind(mCachedProcessedTexture);
mCachedProcessedTexture->setAddressMode(LLTexUnit::TAM_CLAMP); mCachedProcessedTexture->setAddressMode(LLTexUnit::TAM_CLAMP);

View File

@ -86,7 +86,10 @@ void LLCubeMap::initGL()
#endif #endif
mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP); mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP);
mRawImages[i] = new LLImageRaw(RESOLUTION, RESOLUTION, 4); mRawImages[i] = new LLImageRaw(RESOLUTION, RESOLUTION, 4);
mImages[i]->createGLTexture(0, mRawImages[i], texname); if (!mImages[i]->createGLTexture(0, mRawImages[i], texname))
{
LL_WARNS() << "Failed to create GL texture for environment cubemap face " << i << LL_ENDL;
}
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname);
mImages[i]->setAddressMode(LLTexUnit::TAM_CLAMP); mImages[i]->setAddressMode(LLTexUnit::TAM_CLAMP);
@ -203,7 +206,10 @@ void LLCubeMap::initEnvironmentMap(const std::vector<LLPointer<LLImageRaw> >& ra
mImages[i] = new LLImageGL(resolution, resolution, components, true); mImages[i] = new LLImageGL(resolution, resolution, components, true);
mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP); mImages[i]->setTarget(mTargets[i], LLTexUnit::TT_CUBE_MAP);
mRawImages[i] = rawimages[i]; mRawImages[i] = rawimages[i];
mImages[i]->createGLTexture(0, mRawImages[i], texname); if (!mImages[i]->createGLTexture(0, mRawImages[i], texname))
{
LL_WARNS() << "Failed to create GL texture for environment cubemap face " << i << LL_ENDL;
}
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname); gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_CUBE_MAP, texname);
mImages[i]->setAddressMode(LLTexUnit::TAM_CLAMP); mImages[i]->setAddressMode(LLTexUnit::TAM_CLAMP);

View File

@ -577,14 +577,20 @@ void LLWebRTCImpl::workerDeployDevices()
void LLWebRTCImpl::setCaptureDevice(const std::string &id) void LLWebRTCImpl::setCaptureDevice(const std::string &id)
{ {
mRecordingDevice = id; if (mRecordingDevice != id)
deployDevices(); {
mRecordingDevice = id;
deployDevices();
}
} }
void LLWebRTCImpl::setRenderDevice(const std::string &id) void LLWebRTCImpl::setRenderDevice(const std::string &id)
{ {
mPlayoutDevice = id; if (mPlayoutDevice != id)
deployDevices(); {
mPlayoutDevice = id;
deployDevices();
}
} }
// updateDevices needs to happen on the worker thread. // updateDevices needs to happen on the worker thread.

View File

@ -805,7 +805,10 @@ void LLBumpImageList::onSourceStandardLoaded( bool success, LLViewerFetchedTextu
} }
src_vi->setExplicitFormat(GL_RGBA, GL_RGBA); src_vi->setExplicitFormat(GL_RGBA, GL_RGBA);
{ {
src_vi->createGLTexture(src_vi->getDiscardLevel(), nrm_image); if (!src_vi->createGLTexture(src_vi->getDiscardLevel(), nrm_image))
{
LL_WARNS() << "Failed to create bump image texture for image " << src_vi->getID() << LL_ENDL;
}
} }
} }
} }
@ -903,7 +906,10 @@ void LLBumpImageList::onSourceUpdated(LLViewerTexture* src, EBumpEffect bump_cod
LLImageGL* src_img = src->getGLTexture(); LLImageGL* src_img = src->getGLTexture();
LLImageGL* dst_img = bump->getGLTexture(); LLImageGL* dst_img = bump->getGLTexture();
dst_img->setSize(src->getWidth(), src->getHeight(), 4, 0); if (!dst_img->setSize(src->getWidth(), src->getHeight(), 4, 0))
{
LL_WARNS() << "Failed to setSize for image " << bump->getID() << LL_ENDL;
}
dst_img->setUseMipMaps(true); dst_img->setUseMipMaps(true);
dst_img->setDiscardLevel(0); dst_img->setDiscardLevel(0);
dst_img->createGLTexture(); dst_img->createGLTexture();

View File

@ -475,7 +475,7 @@ bool LLFeatureManager::loadGPUClass()
} }
#if LL_WINDOWS #if LL_WINDOWS
const F32Gigabytes MIN_PHYSICAL_MEMORY(2); const F32Gigabytes MIN_PHYSICAL_MEMORY(8);
LLMemory::updateMemoryInfo(); LLMemory::updateMemoryInfo();
F32Gigabytes physical_mem = LLMemory::getMaxMemKB(); F32Gigabytes physical_mem = LLMemory::getMaxMemKB();

View File

@ -28,12 +28,15 @@
#include "llviewerprecompiledheaders.h" #include "llviewerprecompiledheaders.h"
#include "llfloateravatarwelcomepack.h" #include "llfloateravatarwelcomepack.h"
#include "lluictrlfactory.h"
#include "llmediactrl.h" #include "llmediactrl.h"
#include "lluictrlfactory.h"
#include "llviewercontrol.h"
#include "llweb.h"
#include "lfsimfeaturehandler.h" #include "lfsimfeaturehandler.h"
#include "llhttpconstants.h" #include "llhttpconstants.h"
#include "llweb.h" #include "lllogininstance.h"
#include "llviewernetwork.h"
LLFloaterAvatarWelcomePack::LLFloaterAvatarWelcomePack(const LLSD& key) LLFloaterAvatarWelcomePack::LLFloaterAvatarWelcomePack(const LLSD& key)
: LLFloater(key), : LLFloater(key),
@ -64,6 +67,34 @@ bool LLFloaterAvatarWelcomePack::postBuild()
if (mAvatarPicker) if (mAvatarPicker)
{ {
mAvatarPicker->clearCache(); mAvatarPicker->clearCache();
mAvatarPicker->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
// <FS:AW> optional opensim support
//std::string url = gSavedSettings.getString("AvatarWelcomePack");
//url = LLWeb::expandURLSubstitutions(url, LLSD());
//mAvatarPicker->navigateTo(url, HTTP_CONTENT_TEXT_HTML);
std::string avatar_picker_url;
#ifdef OPENSIM
if (LLGridManager::getInstance()->isInOpenSim())
{
if (LLLoginInstance::getInstance()->hasResponse("avatar_picker_url"))
{
avatar_picker_url = LLLoginInstance::getInstance()->getResponse("avatar_picker_url").asString();
}
}
else
#endif // OPENSIM
{
avatar_picker_url = gSavedSettings.getString("AvatarWelcomePack");
}
if (!avatar_picker_url.empty())
{
avatar_picker_url = LLWeb::expandURLSubstitutions(avatar_picker_url, LLSD());
LL_DEBUGS("WebApi") << "AvatarPickerURL \"" << avatar_picker_url << "\"" << LL_ENDL;
mAvatarPicker->navigateTo(avatar_picker_url, HTTP_CONTENT_TEXT_HTML);
}
// </FS:AW> optional opensim support
} }
return true; return true;

View File

@ -28,12 +28,15 @@
#include "llviewerprecompiledheaders.h" #include "llviewerprecompiledheaders.h"
#include "llfloaterdestinations.h" #include "llfloaterdestinations.h"
#include "llmediactrl.h"
#include "lluictrlfactory.h" #include "lluictrlfactory.h"
#include "llviewercontrol.h"
#include "llweb.h"
#include "lfsimfeaturehandler.h" #include "lfsimfeaturehandler.h"
#include "llhttpconstants.h" #include "llhttpconstants.h"
#include "llmediactrl.h" #include "lllogininstance.h"
#include "llweb.h" #include "llviewernetwork.h"
LLFloaterDestinations::LLFloaterDestinations(const LLSD& key) LLFloaterDestinations::LLFloaterDestinations(const LLSD& key)
: LLFloater(key), : LLFloater(key),
@ -54,6 +57,39 @@ LLFloaterDestinations::~LLFloaterDestinations()
bool LLFloaterDestinations::postBuild() bool LLFloaterDestinations::postBuild()
{ {
enableResizeCtrls(true, true, false); enableResizeCtrls(true, true, false);
LLMediaCtrl* destinations = getChild<LLMediaCtrl>("destination_guide_contents");
destinations->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
// <FS:AW> optional opensim support
//std::string url = gSavedSettings.getString("DestinationGuideURL");
//url = LLWeb::expandURLSubstitutions(url, LLSD());
//destinations->navigateTo(url, HTTP_CONTENT_TEXT_HTML);
std::string destination_guide_url;
#ifdef OPENSIM
if (LLGridManager::getInstance()->isInOpenSim())
{
if (LLLoginInstance::getInstance()->hasResponse("destination_guide_url"))
{
destination_guide_url = LLLoginInstance::getInstance()->getResponse("destination_guide_url").asString();
}
}
else
#endif // OPENSIM
{
destination_guide_url = gSavedSettings.getString("DestinationGuideURL");
}
if (!destination_guide_url.empty())
{
destination_guide_url = LLWeb::expandURLSubstitutions(destination_guide_url, LLSD());
LL_DEBUGS("WebApi") << "3 DestinationGuideURL \"" << destination_guide_url << "\"" << LL_ENDL;
destinations->navigateTo(destination_guide_url, HTTP_CONTENT_TEXT_HTML);
}
// </FS:AW> optional opensim support
// If cookie is there, will set it now. Otherwise will have to wait for login completion
// which will also update destinations instance if it already exists.
LLViewerMedia::getInstance()->getOpenIDCookie(destinations);
return true; return true;
} }

View File

@ -49,6 +49,13 @@ bool LLFloaterMarketplace::postBuild()
LLFloaterWebContent::postBuild(); LLFloaterWebContent::postBuild();
mWebBrowser = getChild<LLMediaCtrl>("marketplace_contents"); mWebBrowser = getChild<LLMediaCtrl>("marketplace_contents");
mWebBrowser->addObserver(this); mWebBrowser->addObserver(this);
mWebBrowser->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
std::string url = gSavedSettings.getString("MarketplaceURL");
mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML);
// If cookie is there, will set it now, Otherwise will have to wait for login completion
// which will also update marketplace instance if it already exists.
LLViewerMedia::getInstance()->getOpenIDCookie(mWebBrowser);
return true; return true;
} }

View File

@ -188,6 +188,12 @@ bool LLFloaterSearch::postBuild()
LLFloaterWebContent::postBuild(); LLFloaterWebContent::postBuild();
mWebBrowser = getChild<LLMediaCtrl>("search_contents"); mWebBrowser = getChild<LLMediaCtrl>("search_contents");
mWebBrowser->addObserver(this); mWebBrowser->addObserver(this);
mWebBrowser->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
// If cookie is there, will set it now, Otherwise will have to wait for login completion
// which will also update search instance if it already exists.
LLViewerMedia::getInstance()->getOpenIDCookie(mWebBrowser);
getChildView("address")->setEnabled(false); getChildView("address")->setEnabled(false);
getChildView("popexternal")->setEnabled(false); getChildView("popexternal")->setEnabled(false);

View File

@ -219,7 +219,10 @@ bool LLLocalBitmap::updateSelf(EUpdateType optional_firstupdate)
LLPointer<LLViewerFetchedTexture> texture = new LLViewerFetchedTexture LLPointer<LLViewerFetchedTexture> texture = new LLViewerFetchedTexture
("file://"+mFilename, FTT_LOCAL_FILE, mWorldID, LL_LOCAL_USE_MIPMAPS); ("file://"+mFilename, FTT_LOCAL_FILE, mWorldID, LL_LOCAL_USE_MIPMAPS);
texture->createGLTexture(LL_LOCAL_DISCARD_LEVEL, raw_image); if (!texture->createGLTexture(LL_LOCAL_DISCARD_LEVEL, raw_image))
{
LL_WARNS() << "Failed to create GL texture for local bitmap: " << mFilename << " " << mWorldID << LL_ENDL;
}
texture->ref(); texture->ref();
gTextureList.addImage(texture, TEX_LIST_STANDARD); gTextureList.addImage(texture, TEX_LIST_STANDARD);

View File

@ -83,6 +83,8 @@ extern bool gCubeSnapshot;
// *TODO: Consider enabling mipmaps (they have been disabled for a long time). Likely has a significant performance impact for tiled/high texture repeat media. Mip generation in a shader may also be an option if necessary. // *TODO: Consider enabling mipmaps (they have been disabled for a long time). Likely has a significant performance impact for tiled/high texture repeat media. Mip generation in a shader may also be an option if necessary.
constexpr bool USE_MIPMAPS = false; constexpr bool USE_MIPMAPS = false;
constexpr S32 MAX_MEDIA_INSTANCES_DEFAULT = 8;
constexpr S32 MEDIA_INSTANCES_MIN_LIMIT = 6; // 4 'permanent' floaters plus reserve for dynamic ones
void init_threaded_picker_load_dialog(LLPluginClassMedia* plugin, LLFilePicker::ELoadFilter filter, bool get_multiple) void init_threaded_picker_load_dialog(LLPluginClassMedia* plugin, LLFilePicker::ELoadFilter filter, bool get_multiple)
{ {
@ -214,6 +216,7 @@ static bool sViewerMediaMuteListObserverInitialized = false;
LLViewerMedia::LLViewerMedia(): LLViewerMedia::LLViewerMedia():
mAnyMediaShowing(false), mAnyMediaShowing(false),
mAnyMediaPlaying(false), mAnyMediaPlaying(false),
mMaxIntances(MAX_MEDIA_INSTANCES_DEFAULT),
mSpareBrowserMediaSource(NULL) mSpareBrowserMediaSource(NULL)
{ {
} }
@ -222,6 +225,7 @@ LLViewerMedia::~LLViewerMedia()
{ {
gIdleCallbacks.deleteFunction(LLViewerMedia::onIdle, NULL); gIdleCallbacks.deleteFunction(LLViewerMedia::onIdle, NULL);
mTeleportFinishConnection.disconnect(); mTeleportFinishConnection.disconnect();
mMaxInstancesConnection.disconnect();
if (mSpareBrowserMediaSource != NULL) if (mSpareBrowserMediaSource != NULL)
{ {
delete mSpareBrowserMediaSource; delete mSpareBrowserMediaSource;
@ -235,6 +239,35 @@ void LLViewerMedia::initSingleton()
gIdleCallbacks.addFunction(LLViewerMedia::onIdle, NULL); gIdleCallbacks.addFunction(LLViewerMedia::onIdle, NULL);
mTeleportFinishConnection = LLViewerParcelMgr::getInstance()-> mTeleportFinishConnection = LLViewerParcelMgr::getInstance()->
setTeleportFinishedCallback(boost::bind(&LLViewerMedia::onTeleportFinished, this)); setTeleportFinishedCallback(boost::bind(&LLViewerMedia::onTeleportFinished, this));
LLControlVariable* ctrl = gSavedSettings.getControl("PluginInstancesTotal");
if (ctrl)
{
setMaxInstances(ctrl->getValue().asInteger());
mMaxInstancesConnection = ctrl->getSignal()->connect([this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val)
{
setMaxInstances(new_val.asInteger());
});
}
else
{
setMaxInstances(MAX_MEDIA_INSTANCES_DEFAULT);
}
}
void LLViewerMedia::setMaxInstances(S32 max_instances)
{
const F32Gigabytes MIN_PHYSICAL_MEMORY(8);
LLMemory::updateMemoryInfo();
F32Gigabytes physical_mem = LLMemory::getMaxMemKB();
if (MIN_PHYSICAL_MEMORY > physical_mem)
{
mMaxIntances = llmax(max_instances - 2, MEDIA_INSTANCES_MIN_LIMIT);
}
else
{
mMaxIntances = llmax(max_instances, MEDIA_INSTANCES_MIN_LIMIT);
}
} }
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
@ -692,7 +725,6 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
static LLCachedControl<bool> inworld_media_enabled(gSavedSettings, "AudioStreamingMedia", true); static LLCachedControl<bool> inworld_media_enabled(gSavedSettings, "AudioStreamingMedia", true);
static LLCachedControl<bool> inworld_audio_enabled(gSavedSettings, "AudioStreamingMusic", true); static LLCachedControl<bool> inworld_audio_enabled(gSavedSettings, "AudioStreamingMusic", true);
static LLCachedControl<U32> max_instances(gSavedSettings, "PluginInstancesTotal", 8);
static LLCachedControl<U32> max_normal(gSavedSettings, "PluginInstancesNormal", 2); static LLCachedControl<U32> max_normal(gSavedSettings, "PluginInstancesNormal", 2);
static LLCachedControl<U32> max_low(gSavedSettings, "PluginInstancesLow", 4); static LLCachedControl<U32> max_low(gSavedSettings, "PluginInstancesLow", 4);
static LLCachedControl<F32> max_cpu(gSavedSettings, "PluginInstancesCPULimit", 0.9f); // <FS:minerjr> add missing f for float static LLCachedControl<F32> max_cpu(gSavedSettings, "PluginInstancesCPULimit", 0.9f); // <FS:minerjr> add missing f for float
@ -713,7 +745,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
LLPluginClassMedia::EPriority new_priority = LLPluginClassMedia::PRIORITY_NORMAL; LLPluginClassMedia::EPriority new_priority = LLPluginClassMedia::PRIORITY_NORMAL;
if(pimpl->isForcedUnloaded() || (impl_count_total >= (int)max_instances)) if(pimpl->isForcedUnloaded() || (impl_count_total >= mMaxIntances))
{ {
// Never load muted or failed impls. // Never load muted or failed impls.
// Hard limit on the number of instances that will be loaded at one time // Hard limit on the number of instances that will be loaded at one time
@ -873,7 +905,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
sLowestLoadableImplInterest = 0.0f; sLowestLoadableImplInterest = 0.0f;
// Only do this calculation if we've hit the impl count limit -- up until that point we always need to load media data. // Only do this calculation if we've hit the impl count limit -- up until that point we always need to load media data.
if(lowest_interest_loadable && (impl_count_total >= (int)max_instances)) if(lowest_interest_loadable && (impl_count_total >= mMaxIntances))
{ {
// Get the interest value of this impl's object for use by isInterestingEnough // Get the interest value of this impl's object for use by isInterestingEnough
LLVOVolume *object = lowest_interest_loadable->getSomeObject(); LLVOVolume *object = lowest_interest_loadable->getSomeObject();
@ -1209,6 +1241,54 @@ LLCore::HttpHeaders::ptr_t LLViewerMedia::getHttpHeaders()
return headers; return headers;
} }
bool LLViewerMedia::getOpenIDCookie(LLMediaCtrl* media_instance) const
{
if (mOpenIDCookie.empty())
{
return false;
}
std::string authority = mOpenIDURL.mAuthority;
std::string::size_type hostStart = authority.find('@');
if (hostStart == std::string::npos)
{
// no username/password
hostStart = 0;
}
else
{
// Hostname starts after the @.
// (If the hostname part is empty, this may put host_start at the end of the string. In that case, it will end up passing through an empty hostname, which is correct.)
++hostStart;
}
std::string::size_type hostEnd = authority.rfind(':');
if ((hostEnd == std::string::npos) || (hostEnd < hostStart))
{
// no port
hostEnd = authority.size();
}
std::string cookie_host = authority.substr(hostStart, hostEnd - hostStart);
std::string cookie_name = "";
std::string cookie_value = "";
std::string cookie_path = "";
bool httponly = true;
bool secure = true;
if (!parseRawCookie(mOpenIDCookie, cookie_name, cookie_value, cookie_path, httponly, secure))
{
return false;
}
std::string cefUrl(std::string(mOpenIDURL.mURI) + "://" + std::string(mOpenIDURL.mAuthority));
if (media_instance && media_instance->getMediaPlugin())
{
media_instance->getMediaPlugin()->setCookie(cefUrl, cookie_name, cookie_value, cookie_host,
cookie_path, httponly, secure);
media_instance->getMediaPlugin()->storeOpenIDCookie(cefUrl, cookie_name, cookie_value,
cookie_host, cookie_path, httponly, secure);
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMedia::setOpenIDCookie(const std::string& url) void LLViewerMedia::setOpenIDCookie(const std::string& url)
@ -1275,7 +1355,7 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url)
bool secure = true; bool secure = true;
LLViewerMedia* inst = getInstance(); LLViewerMedia* inst = getInstance();
if (inst->parseRawCookie(inst->mOpenIDCookie, cookie_name, cookie_value, cookie_path, httponly, secure)) if (parseRawCookie(inst->mOpenIDCookie, cookie_name, cookie_value, cookie_path, httponly, secure))
{ {
// MAINT-5711 - inexplicably, the CEF setCookie function will no longer set the cookie if the // MAINT-5711 - inexplicably, the CEF setCookie function will no longer set the cookie if the
// url and domain are not the same. This used to be my.sl.com and id.sl.com respectively and worked. // url and domain are not the same. This used to be my.sl.com and id.sl.com respectively and worked.
@ -1298,14 +1378,18 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url)
}; };
for (MediaCookieInstance mci : media_cookie_instances) for (MediaCookieInstance mci : media_cookie_instances)
{ {
LLMediaCtrl* media_instance = LLFloaterReg::getInstance(mci.floater_name)->getChild<LLMediaCtrl>(mci.browser_name); LLFloater *floaterp = LLFloaterReg::findInstance(mci.floater_name);
if (media_instance && media_instance->getMediaPlugin()) if (floaterp)
{ {
media_instance->getMediaPlugin()->setCookie(cefUrl, cookie_name, cookie_value, cookie_host, LLMediaCtrl* media_instance = floaterp->getChild<LLMediaCtrl>(mci.browser_name);
cookie_path, httponly, secure); if (media_instance && media_instance->getMediaPlugin())
{
media_instance->getMediaPlugin()->setCookie(cefUrl, cookie_name, cookie_value, cookie_host,
cookie_path, httponly, secure);
media_instance->getMediaPlugin()->storeOpenIDCookie(cefUrl, cookie_name, cookie_value, media_instance->getMediaPlugin()->storeOpenIDCookie(cefUrl, cookie_name, cookie_value,
cookie_host, cookie_path, httponly, secure); cookie_host, cookie_path, httponly, secure);
}
} }
} }
} }
@ -3046,7 +3130,10 @@ void LLViewerMediaImpl::doMediaTexUpdate(LLViewerMediaTexture* media_tex, U8* da
// -Cosmic,2023-04-04 // -Cosmic,2023-04-04
// Allocate GL texture based on LLImageRaw but do NOT copy to GL // Allocate GL texture based on LLImageRaw but do NOT copy to GL
LLGLuint tex_name = 0; LLGLuint tex_name = 0;
media_tex->createGLTexture(0, raw, 0, true, LLGLTexture::OTHER, true, &tex_name); if (!media_tex->createGLTexture(0, raw, 0, true, LLGLTexture::OTHER, true, &tex_name))
{
LL_WARNS("Media") << "Failed to create media texture" << LL_ENDL;
}
// copy just the subimage covered by the image raw to GL // copy just the subimage covered by the image raw to GL
media_tex->setSubImage(data, data_width, data_height, x_pos, y_pos, width, height, tex_name); media_tex->setSubImage(data, data_width, data_height, x_pos, y_pos, width, height, tex_name);
@ -3122,7 +3209,10 @@ LLViewerMediaTexture* LLViewerMediaImpl::updateMediaImage()
mMediaSource->getTextureFormatSwapBytes()); mMediaSource->getTextureFormatSwapBytes());
int discard_level = 0; int discard_level = 0;
media_tex->createGLTexture(discard_level, raw); if (!media_tex->createGLTexture(discard_level, raw))
{
LL_WARNS("Media") << "Failed to create media texture" << LL_ENDL;
}
//media_tex->setBoostLevel(LLViewerTexture::BOOST_HIGH); //media_tex->setBoostLevel(LLViewerTexture::BOOST_HIGH);
// MEDIAOPT: set this dynamically on play/stop // MEDIAOPT: set this dynamically on play/stop

View File

@ -69,6 +69,7 @@ private:
}; };
class LLViewerMediaImpl; class LLViewerMediaImpl;
class LLMediaCtrl;
class LLViewerMedia: public LLSingleton<LLViewerMedia> class LLViewerMedia: public LLSingleton<LLViewerMedia>
{ {
@ -162,22 +163,26 @@ public:
LLSD getHeaders(); LLSD getHeaders();
LLCore::HttpHeaders::ptr_t getHttpHeaders(); LLCore::HttpHeaders::ptr_t getHttpHeaders();
bool getOpenIDCookie(LLMediaCtrl* media_instance) const;
private: private:
void onAuthSubmit(const LLSD& notification, const LLSD& response); void onAuthSubmit(const LLSD& notification, const LLSD& response);
bool parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path, bool& httponly, bool& secure); static bool parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path, bool& httponly, bool& secure);
void setOpenIDCookie(const std::string& url); void setOpenIDCookie(const std::string& url);
void onTeleportFinished(); void onTeleportFinished();
static void openIDSetupCoro(std::string openidUrl, std::string openidToken); static void openIDSetupCoro(std::string openidUrl, std::string openidToken);
static void getOpenIDCookieCoro(std::string url); static void getOpenIDCookieCoro(std::string url);
void setMaxInstances(S32 max_instances);
bool mAnyMediaShowing; bool mAnyMediaShowing;
bool mAnyMediaPlaying; bool mAnyMediaPlaying;
S32 mMaxIntances = 8;
LLURL mOpenIDURL; LLURL mOpenIDURL;
std::string mOpenIDCookie; std::string mOpenIDCookie;
LLPluginClassMedia* mSpareBrowserMediaSource; LLPluginClassMedia* mSpareBrowserMediaSource;
boost::signals2::connection mTeleportFinishConnection; boost::signals2::connection mTeleportFinishConnection;
boost::signals2::connection mMaxInstancesConnection;
}; };
// Implementation functions not exported into header file // Implementation functions not exported into header file

View File

@ -415,7 +415,10 @@ void LLViewerTextureManager::init()
} }
} }
} }
imagep->createGLTexture(0, image_raw); if (!imagep->createGLTexture(0, image_raw))
{
LL_WARNS() << "Failed to create default texture " << IMG_DEFAULT << LL_ENDL;
}
image_raw = NULL; image_raw = NULL;
#else #else
LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, true, LLGLTexture::BOOST_UI); LLViewerFetchedTexture::sDefaultImagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, true, LLGLTexture::BOOST_UI);

View File

@ -50,7 +50,6 @@
#include "llviewerinput.h" #include "llviewerinput.h"
#include "llviewermenu.h" #include "llviewermenu.h"
//<FS:Beq> physics display changes //<FS:Beq> physics display changes
#include "llspatialpartition.h"
#include "llphysicsshapebuilderutil.h" #include "llphysicsshapebuilderutil.h"
#include "llvolumemgr.h" #include "llvolumemgr.h"
//</FS:Beq> //</FS:Beq>
@ -219,7 +218,6 @@
#include "llviewerwindowlistener.h" #include "llviewerwindowlistener.h"
#include "llcleanup.h" #include "llcleanup.h"
#include "llimview.h" #include "llimview.h"
#include "llviewermenufile.h"
// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c) // [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.2.0c)
#include "rlvactions.h" #include "rlvactions.h"
@ -2532,91 +2530,23 @@ void LLViewerWindow::initWorldUI()
gToolBarView->setVisible(true); gToolBarView->setVisible(true);
} }
if (!gNonInteractive) // Don't preload cef instances on low end hardware
const F32Gigabytes MIN_PHYSICAL_MEMORY(8);
F32Gigabytes physical_mem = LLMemory::getMaxMemKB();
if (physical_mem <= 0)
{ {
// <FS:AW opensim destinations and avatar picker> LLMemory::updateMemoryInfo();
// LLMediaCtrl* destinations = LLFloaterReg::getInstance("destinations")->getChild<LLMediaCtrl>("destination_guide_contents"); physical_mem = LLMemory::getMaxMemKB();
// if (destinations) }
// {
// destinations->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
// std::string url = gSavedSettings.getString("DestinationGuideURL");
// url = LLWeb::expandURLSubstitutions(url, LLSD());
// destinations->navigateTo(url, "text/html");
// }
// LLMediaCtrl* avatar_welcome_pack = LLFloaterReg::getInstance("avatar_welcome_pack")->findChild<LLMediaCtrl>("avatar_picker_contents");
// if (avatar_welcome_pack)
// {
// avatar_welcome_pack->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
// std::string url = gSavedSettings.getString("AvatarWelcomePack");
// url = LLWeb::expandURLSubstitutions(url, LLSD());
// avatar_welcome_pack->navigateTo(url, "text/html");
// }
std::string destination_guide_url;
#ifdef OPENSIM // <FS:AW optional opensim support>
if (LLGridManager::getInstance()->isInOpenSim())
{
if (LLLoginInstance::getInstance()->hasResponse("destination_guide_url"))
{
destination_guide_url = LLLoginInstance::getInstance()->getResponse("destination_guide_url").asString();
}
}
else
#endif // OPENSIM // <FS:AW optional opensim support>
{
destination_guide_url = gSavedSettings.getString("DestinationGuideURL");
}
LLMediaCtrl* search = LLFloaterReg::getInstance("search")->findChild<LLMediaCtrl>("search_contents");
if (search)
{
search->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
}
LLMediaCtrl* marketplace = LLFloaterReg::getInstance("marketplace")->getChild<LLMediaCtrl>("marketplace_contents");
if (marketplace)
{
marketplace->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
std::string url = gSavedSettings.getString("MarketplaceURL");
marketplace->navigateTo(url, HTTP_CONTENT_TEXT_HTML);
}
if(!destination_guide_url.empty()) if (!gNonInteractive && physical_mem > MIN_PHYSICAL_MEMORY)
{ {
LLMediaCtrl* destinations = LLFloaterReg::getInstance("destinations")->getChild<LLMediaCtrl>("destination_guide_contents"); LL_INFOS() << "Preloading cef instances" << LL_ENDL;
if (destinations)
{
destinations->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
destination_guide_url = LLWeb::expandURLSubstitutions(destination_guide_url, LLSD());
LL_DEBUGS("WebApi") << "3 DestinationGuideURL \"" << destination_guide_url << "\"" << LL_ENDL;
destinations->navigateTo(destination_guide_url, HTTP_CONTENT_TEXT_HTML);
}
}
std::string avatar_picker_url; LLFloaterReg::getInstance("destinations");
#ifdef OPENSIM // <FS:AW optional opensim support> LLFloaterReg::getInstance("avatar_welcome_pack");
if (LLGridManager::getInstance()->isInOpenSim()) LLFloaterReg::getInstance("search");
{ LLFloaterReg::getInstance("marketplace");
if (LLLoginInstance::getInstance()->hasResponse("avatar_picker_url"))
{
avatar_picker_url = LLLoginInstance::getInstance()->getResponse("avatar_picker_url").asString();
}
}
else
#endif // OPENSIM // <FS:AW optional opensim support>
{
avatar_picker_url = gSavedSettings.getString("AvatarWelcomePack");
}
if(!avatar_picker_url.empty())
{
LLMediaCtrl* avatar_welcome_pack = LLFloaterReg::getInstance("avatar_welcome_pack")->findChild<LLMediaCtrl>("avatar_picker_contents");
if (avatar_welcome_pack)
{
avatar_welcome_pack->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
avatar_picker_url = LLWeb::expandURLSubstitutions(avatar_picker_url, LLSD());
LL_DEBUGS("WebApi") << "AvatarPickerURL \"" << avatar_picker_url << "\"" << LL_ENDL;
avatar_welcome_pack->navigateTo(avatar_picker_url, HTTP_CONTENT_TEXT_HTML);
}
}
// </FS:AW opensim destinations and avatar picker>
} }
// <FS:Zi> Autohide main chat bar if applicable // <FS:Zi> Autohide main chat bar if applicable