From 348974089c6f5f441deda9cec028210b5a298d50 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 23 Oct 2025 05:47:55 -0400 Subject: Restore linux CEF build support including changes from archive/develop Fix various files missing linden_common Signed-off-by: Rye --- indra/llplugin/llpluginclassmedia.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/llplugin/llpluginclassmedia.cpp') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 77a4b08af5..68c8854a12 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -1015,6 +1015,15 @@ void LLPluginClassMedia::enableMediaPluginDebugging( bool enable ) sendMessage( message ); } +#if LL_LINUX +void LLPluginClassMedia::enablePipeWireVolumeCatcher( bool enable ) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "enable_pipewire_volume_catcher"); + message.setValueBoolean( "enable", enable ); + sendMessage( message ); +} +#endif + void LLPluginClassMedia::setTarget(const std::string &target) { mTarget = target; -- cgit v1.3 From 9661b4ec49ebcb29faf55da71480dffbe17e7295 Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 28 Oct 2025 08:14:17 -0400 Subject: Fix cef scaling on linux hidpi displays Signed-off-by: Rye --- indra/llplugin/llpluginclassmedia.cpp | 4 ++-- indra/newview/app_settings/settings.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llplugin/llpluginclassmedia.cpp') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 68c8854a12..803574f9fa 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -34,7 +34,7 @@ #include "llcontrol.h" extern LLControlGroup gSavedSettings; -#if LL_DARWIN +#if LL_DARWIN || LL_LINUX extern bool gHiDPISupport; #endif @@ -372,7 +372,7 @@ void LLPluginClassMedia::setSizeInternal(void) mRequestedMediaHeight = nextPowerOf2(mRequestedMediaHeight); } -#if LL_DARWIN +#if LL_DARWIN || LL_LINUX if (!gHiDPISupport) #endif { diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 05e3e7aaa2..875f4442a3 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7476,7 +7476,7 @@ RenderHiDPI Comment - Enable support for HiDPI displays, like Retina (macOS ONLY, requires restart) + Enable support for HiDPI displays, like Retina (macOS and Linux ONLY, requires restart) Persist 1 Type -- cgit v1.3 From 8aa0161ed3f370a37a4ae849ce5c8a367d88c3fb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Wed, 15 Jul 2026 22:50:02 +0300 Subject: #6002 Filter out inaudible media volume changes --- indra/llplugin/llpluginclassmedia.cpp | 10 +++++++++- indra/llplugin/llpluginmessagepipe.cpp | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/llplugin/llpluginclassmedia.cpp') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 4e80f4c0ca..94c29d9457 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -33,6 +33,8 @@ #include "llpluginmessageclasses.h" #include "llcontrol.h" +#include + extern LLControlGroup gSavedSettings; #if LL_DARWIN extern bool gHiDPISupport; @@ -1616,7 +1618,13 @@ void LLPluginClassMedia::setLoop(bool loop) void LLPluginClassMedia::setVolume(float volume) { - if(volume != mRequestedVolume) + // VLC's volume is integer, 0 to 100 range. When converted from float, + // changes below 0.01 won't be noticed by VLC. + // CEF's audio range is DWORD, 0 to 65535. But changes so small are + // inaudible and don't warrant the overhead, so use a bigger epsilon + // to avoid extra messages and locking. + constexpr float VOLUME_EPSILON = 0.002f; + if (std::abs(volume - mRequestedVolume) > VOLUME_EPSILON) { mRequestedVolume = volume; diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp index 085afc0944..1e58e6c49b 100644 --- a/indra/llplugin/llpluginmessagepipe.cpp +++ b/indra/llplugin/llpluginmessagepipe.cpp @@ -121,8 +121,9 @@ bool LLPluginMessagePipe::addMessage(const std::string &message) mOutputStartIndex = 0; } + mOutput.reserve(mOutput.size() + message.size() + 1); mOutput += message; - mOutput += MESSAGE_DELIMITER; // message separator + mOutput.push_back(MESSAGE_DELIMITER); // message separator return true; } -- cgit v1.3 From 5986568a23836f9ce448a1912406eaedd3794175 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Mon, 20 Jul 2026 19:21:50 +0300 Subject: #6014 More tracy coverage --- indra/llappearance/llpolymesh.cpp | 1 + indra/llcommon/llcoros.cpp | 1 + indra/llcommon/llwatchdog.cpp | 1 + indra/llfilesystem/lllfsthread.cpp | 1 + indra/llmessage/message.cpp | 1 + indra/llphysicsextensionsos/llphysicsextensions.cpp | 1 + indra/llplugin/llpluginclassmedia.cpp | 1 + indra/llxml/llcontrol.cpp | 2 ++ 8 files changed, 9 insertions(+) (limited to 'indra/llplugin/llpluginclassmedia.cpp') diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index d5323e0b84..1162efb868 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -862,6 +862,7 @@ LLPolyMesh *LLPolyMesh::getMesh(const std::string &name, LLPolyMesh* reference_m //----------------------------------------------------------------------------- void LLPolyMesh::freeAllMeshes() { + LL_PROFILE_ZONE_SCOPED; // delete each item in the global lists for_each(sGlobalSharedMeshList.begin(), sGlobalSharedMeshList.end(), DeletePairedPointer()); sGlobalSharedMeshList.clear(); diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 9e95d9c85f..ae7c50e9a3 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -252,6 +252,7 @@ void LLCoros::setStackSize(S32 stacksize) void LLCoros::printActiveCoroutines(const std::string& when) { + LL_PROFILE_ZONE_SCOPED; LL_INFOS("LLCoros") << "Number of active coroutines " << when << ": " << CoroData::instanceCount() << LL_ENDL; if (CoroData::instanceCount() > 0) diff --git a/indra/llcommon/llwatchdog.cpp b/indra/llcommon/llwatchdog.cpp index 056a0cc940..b17b68dbe7 100644 --- a/indra/llcommon/llwatchdog.cpp +++ b/indra/llcommon/llwatchdog.cpp @@ -236,6 +236,7 @@ void LLWatchdog::shutdown() void LLWatchdog::cleanup() { + LL_PROFILE_ZONE_SCOPED; if (mTimer) { mTimer->stop(); diff --git a/indra/llfilesystem/lllfsthread.cpp b/indra/llfilesystem/lllfsthread.cpp index 6a882f64a8..69f7085290 100644 --- a/indra/llfilesystem/lllfsthread.cpp +++ b/indra/llfilesystem/lllfsthread.cpp @@ -51,6 +51,7 @@ S32 LLLFSThread::updateClass(U32 ms_elapsed) //static void LLLFSThread::cleanupClass() { + LL_PROFILE_ZONE_SCOPED; llassert(sLocal != NULL); sLocal->setQuitting(); while (sLocal->getPending()) diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index b11e4598e7..52180b20f1 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -2906,6 +2906,7 @@ void LLMessageSystem::summarizeLogs(std::ostream& str) void end_messaging_system(bool print_summary) { + LL_PROFILE_ZONE_SCOPED; gTransferManager.cleanup(); LLTransferTargetVFile::updateQueue(true); // shutdown LLTransferTargetVFile if (gMessageSystem) diff --git a/indra/llphysicsextensionsos/llphysicsextensions.cpp b/indra/llphysicsextensionsos/llphysicsextensions.cpp index 3bb8ffbf1a..295ab41a17 100644 --- a/indra/llphysicsextensionsos/llphysicsextensions.cpp +++ b/indra/llphysicsextensionsos/llphysicsextensions.cpp @@ -72,6 +72,7 @@ //============================================================================= /*static */bool LLPhysicsExtensions::quitSystem() { + LL_PROFILE_ZONE_SCOPED; return LLPhysicsExtensionsImpl::quitSystem(); } //============================================================================= diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 94c29d9457..9a1f408b34 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -92,6 +92,7 @@ bool LLPluginClassMedia::init(const std::string &launcher_filename, const std::s void LLPluginClassMedia::reset() { + LL_PROFILE_ZONE_SCOPED; if(mPlugin) { mPlugin->requestShutdown(); diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 5a37167f18..be53a93a2d 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -407,6 +407,7 @@ static bool compareRoutine(settings_pair_t lhs, settings_pair_t rhs) void LLControlGroup::cleanup() { + LL_PROFILE_ZONE_SCOPED; if(mSettingsProfile && getCount.size() != 0) { std::string file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, SETTINGS_PROFILE); @@ -982,6 +983,7 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, bool require U32 LLControlGroup::saveToFile(const std::string& filename, bool nondefault_only) { + LL_PROFILE_ZONE_SCOPED; LLSD settings; int num_saved = 0; for (ctrl_name_table_t::iterator iter = mNameTable.begin(); -- cgit v1.3 From adc5f3cb7819a672c37a73f0c4cd850df536e9da Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Fri, 24 Jul 2026 14:33:11 +0300 Subject: #5796 Add CEF remote debugging port debug setting Increment CEF remote debugging port for each new media plugin instance CEFRemoteDebuggingPort should not persist between sessions --- indra/llplugin/llpluginclassmedia.cpp | 34 ++++++++++++++++++++++++++++ indra/llplugin/llpluginclassmedia.h | 7 ++++++ indra/llplugin/llpluginprocessparent.h | 2 ++ indra/media_plugins/cef/media_plugin_cef.cpp | 5 ++++ indra/newview/app_settings/settings.xml | 11 +++++++++ indra/newview/llmediactrl.cpp | 34 ++++++++++++++++++++++++++++ 6 files changed, 93 insertions(+) (limited to 'indra/llplugin/llpluginclassmedia.cpp') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 9a1f408b34..da5fe08b13 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -41,6 +41,8 @@ extern bool gHiDPISupport; #endif static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256; +static const U32 MIN_DEBUG_PORT = 1024; +static const U32 MAX_DEBUG_PORT = 65535; static int nextPowerOf2( int value ) { @@ -963,6 +965,34 @@ void LLPluginClassMedia::showPageSource() sendMessage(message); } + +static U32 assignCefDebuggingPort() +{ + U32 base_port = gSavedSettings.getU32("CEFRemoteDebuggingPort"); + if (base_port == 0) + { + return 0; + } + base_port = llclamp(base_port, MIN_DEBUG_PORT, MAX_DEBUG_PORT); + + static U32 last_base_port = 0; + static U32 offset = 0; + if (base_port != last_base_port) + { + last_base_port = base_port; + offset = 0; + } + + U32 new_port = base_port + offset; + if (new_port > MAX_DEBUG_PORT) + { + return 0; + } + + ++offset; + return new_port; +} + void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path_cache, const std::string &username, const std::string &user_data_path_cef_log) @@ -974,6 +1004,10 @@ void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path_cache bool cef_verbose_log = gSavedSettings.getBOOL("CefVerboseLog"); message.setValueBoolean("cef_verbose_log", cef_verbose_log); + + U32 cef_remote_debugging_port = assignCefDebuggingPort(); + message.setValueU32("cef_remote_debugging_port", cef_remote_debugging_port); + mCefRemoteDebuggingPort = cef_remote_debugging_port; sendMessage(message); } diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 40f6295e55..1125d530f4 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -165,6 +165,11 @@ public: std::string getPluginVersion() { return mPlugin?mPlugin->getPluginVersion():std::string(""); }; + int getProcessID() { return mPlugin ? (int)mPlugin->getProcessID() : 0; }; + + // 0 means remote debugging is disabled for this plugin instance. + U32 getCefRemoteDebuggingPort() const { return mCefRemoteDebuggingPort; }; + bool getDisableTimeout() { return mPlugin?mPlugin->getDisableTimeout():false; }; void setDisableTimeout(bool disable) { if(mPlugin) mPlugin->setDisableTimeout(disable); }; @@ -434,6 +439,8 @@ protected: F64 mSleepTime; + U32 mCefRemoteDebuggingPort {0}; + bool mCanUndo; bool mCanRedo; bool mCanCut; diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index ea604ca8d7..3cfd4211d7 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -119,6 +119,8 @@ public: bool getDisableTimeout() { return mDisableTimeout; }; void setDisableTimeout(bool disable) { mDisableTimeout = disable; }; + LLProcess::id getProcessID() const { return mProcess ? mProcess->getProcessID() : 0; } + void setLaunchTimeout(F32 timeout) { mPluginLaunchTimeout = timeout; }; void setLockupTimeout(F32 timeout) { mPluginLockupTimeout = timeout; }; diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index caf804f915..96fcc38979 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -116,6 +116,7 @@ private: std::string mRootCachePath; std::string mCefLogFile; bool mCefLogVerbose; + U32 mCefRemoteDebuggingPort; std::vector mPickedFiles; VolumeCatcher mVolumeCatcher; F32 mCurVolume; @@ -157,6 +158,7 @@ MediaPluginBase(host_send_func, host_user_data) mCanSelectAll = false; mCefLogFile = ""; mCefLogVerbose = false; + mCefRemoteDebuggingPort = 0; mPickedFiles.clear(); mCurVolume = 0.0; @@ -709,6 +711,8 @@ void MediaPluginCEF::receiveMessage(const char* message_string) settings.webgl_enabled = true; settings.log_file = mCefLogFile; settings.log_verbose = mCefLogVerbose; + settings.enable_remote_debug = (mCefRemoteDebuggingPort != 0); + settings.remote_debugging_port = mCefRemoteDebuggingPort; settings.autoplay_without_gesture = true; std::vector custom_schemes(1, "secondlife"); @@ -773,6 +777,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mCefLogFile = message_in.getValue("cef_log_file"); mCefLogVerbose = message_in.getValueBoolean("cef_verbose_log"); + mCefRemoteDebuggingPort = message_in.getValueU32("cef_remote_debugging_port"); } else if (message_name == "size_change") { diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 75258cfa79..d34a5b3eab 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16170,6 +16170,17 @@ Value 0 + CEFRemoteDebuggingPort + + Comment + Enable CEF remote debugging on the specified base port (1024 to 65535, 0 to disable). Each new SLPlugin gets base+N. + Persist + 0 + Type + U32 + Value + 0 + 360CaptureJPEGEncodeQuality Comment diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 679157dc1e..26422d7d47 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -1370,6 +1370,7 @@ public: private: void getMediaInfo(const LLSD& request); void getMediaText(const LLSD& request); + void getPluginsList(const LLSD& request); void replyError(const LLSD& request, const std::string& error); LLMediaCtrl* findMediaCtrl(const std::string& path); }; @@ -1388,6 +1389,12 @@ LLMediaCtrlListener::LLMediaCtrlListener(): "Returns the text content of the page or a portion of it.", &LLMediaCtrlListener::getMediaText, llsd::map("path", LLSD(), "reply", LLSD())); + + add("getPluginsList", + "Enumerate the active media plugin (SLPlugin) instances.\n" + "Reply contains [\"plugins\"] an array of { pid, url, mime_type, remote_debugging_port } entries.", + &LLMediaCtrlListener::getPluginsList, + llsd::map("reply", LLSD())); } LLMediaCtrl* LLMediaCtrlListener::findMediaCtrl(const std::string& path) @@ -1457,4 +1464,31 @@ void LLMediaCtrlListener::getMediaText(const LLSD& request) } } +void LLMediaCtrlListener::getPluginsList(const LLSD& request) +{ + Response reply(LLSD(), request); + + LLSD plugins; + + LLViewerMedia::impl_list& impls = LLViewerMedia::getInstance()->getPriorityList(); + for (LLViewerMedia::impl_list::iterator it = impls.begin(); it != impls.end(); ++it) + { + LLViewerMediaImpl* impl = *it; + if (!impl) + { + continue; + } + LLPluginClassMedia* plugin = impl->getMediaPlugin(); + + LLSD entry; + entry["url"] = impl->getCurrentMediaURL(); + entry["mime_type"] = impl->getMimeType(); + entry["pid"] = plugin ? plugin->getProcessID() : 0; + entry["remote_debugging_port"] = plugin ? (S32)plugin->getCefRemoteDebuggingPort() : 0; + + plugins.append(entry); + } + reply["plugins"] = plugins; +} + static LLMediaCtrlListener sMediaCtrlListener; -- cgit v1.3