summaryrefslogtreecommitdiff
path: root/indra/media_plugins
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-09-29 16:29:19 +0800
committerErik Kundiman <erik@megapahit.org>2025-10-01 16:56:56 +0800
commita954d290674db08ecaf3c1e6484a0cb6647b88b5 (patch)
tree3b672bac3e7d6807cd485ad5f041f69a5c729f46 /indra/media_plugins
parente6eaa7e29990431b5207dbb4f8ae5560cf884acb (diff)
parenta6d4c1d394eef2cea41f6c6bcd751fec746ec17d (diff)
Merge tag 'Second_Life_Release#a6d4c1d3-2025.07' into 2025.07
Diffstat (limited to 'indra/media_plugins')
-rw-r--r--indra/media_plugins/base/CMakeLists.txt2
-rw-r--r--indra/media_plugins/base/media_plugin_base.cpp4
-rw-r--r--indra/media_plugins/cef/CMakeLists.txt3
-rw-r--r--indra/media_plugins/cef/media_plugin_cef.cpp130
-rw-r--r--indra/media_plugins/example/CMakeLists.txt2
-rw-r--r--indra/media_plugins/libvlc/CMakeLists.txt2
-rw-r--r--indra/media_plugins/libvlc/media_plugin_libvlc.cpp2
7 files changed, 109 insertions, 36 deletions
diff --git a/indra/media_plugins/base/CMakeLists.txt b/indra/media_plugins/base/CMakeLists.txt
index 57e3782ada..b98617cc4f 100644
--- a/indra/media_plugins/base/CMakeLists.txt
+++ b/indra/media_plugins/base/CMakeLists.txt
@@ -28,5 +28,5 @@ add_library(media_plugin_base
${media_plugin_base_SOURCE_FILES}
)
-target_link_libraries( media_plugin_base llplugin )
+target_link_libraries( media_plugin_base llplugin ll::pluginlibraries)
target_include_directories( media_plugin_base INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/indra/media_plugins/base/media_plugin_base.cpp b/indra/media_plugins/base/media_plugin_base.cpp
index d54e67c532..2d55f99dbe 100644
--- a/indra/media_plugins/base/media_plugin_base.cpp
+++ b/indra/media_plugins/base/media_plugin_base.cpp
@@ -220,10 +220,8 @@ void SymbolGrabber::ungrabSymbols()
#if LL_WINDOWS
# define LLSYMEXPORT __declspec(dllexport)
-#elif LL_LINUX || __FreeBSD__
-# define LLSYMEXPORT __attribute__ ((visibility("default")))
#else
-# define LLSYMEXPORT /**/
+# define LLSYMEXPORT __attribute__ ((visibility("default")))
#endif
extern "C"
diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt
index 4803b475c5..539bb4e562 100644
--- a/indra/media_plugins/cef/CMakeLists.txt
+++ b/indra/media_plugins/cef/CMakeLists.txt
@@ -105,7 +105,7 @@ if (DARWIN)
PROPERTIES
PREFIX ""
BUILD_WITH_INSTALL_RPATH 1
- INSTALL_NAME_DIR "@executable_path"
+ INSTALL_RPATH "@executable_path/../Frameworks"
LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
)
@@ -147,6 +147,7 @@ if (INSTALL)
install(
DIRECTORY
"${ARCH_PREBUILT_DIRS_RELEASE}/DullahanHelper.app"
+ "${ARCH_PREBUILT_DIRS_RELEASE}/DullahanHelper (Alerts).app"
"${ARCH_PREBUILT_DIRS_RELEASE}/DullahanHelper (GPU).app"
"${ARCH_PREBUILT_DIRS_RELEASE}/DullahanHelper (Plugin).app"
"${ARCH_PREBUILT_DIRS_RELEASE}/DullahanHelper (Renderer).app"
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp
index 9c205b558c..5693420bb6 100644
--- a/indra/media_plugins/cef/media_plugin_cef.cpp
+++ b/indra/media_plugins/cef/media_plugin_cef.cpp
@@ -38,6 +38,13 @@
#include "volume_catcher.h"
#include "media_plugin_base.h"
+// _getpid()/getpid()
+#if LL_WINDOWS
+#include <process.h>
+#else
+#include <unistd.h>
+#endif
+
#include "dullahan.h"
////////////////////////////////////////////////////////////////////////////////
@@ -64,7 +71,7 @@ private:
void onLoadStartCallback();
void onRequestExitCallback();
void onLoadEndCallback(int httpStatusCode, std::string url);
- void onLoadError(int status, const std::string error_text);
+ void onLoadError(int status, const std::string error_text, const std::string error_url);
void onAddressChangeCallback(std::string url);
void onOpenPopupCallback(std::string url, std::string target);
bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password);
@@ -99,12 +106,14 @@ private:
std::string mAuthUsername;
std::string mAuthPassword;
bool mAuthOK;
+ bool mCanUndo;
+ bool mCanRedo;
bool mCanCut;
bool mCanCopy;
bool mCanPaste;
+ bool mCanDelete;
+ bool mCanSelectAll;
std::string mRootCachePath;
- std::string mCachePath;
- std::string mContextCachePath;
std::string mCefLogFile;
bool mCefLogVerbose;
std::vector<std::string> mPickedFiles;
@@ -139,10 +148,13 @@ MediaPluginBase(host_send_func, host_user_data)
mAuthUsername = "";
mAuthPassword = "";
mAuthOK = false;
+ mCanUndo = false;
+ mCanRedo = false;
mCanCut = false;
mCanCopy = false;
mCanPaste = false;
- mCachePath = "";
+ mCanDelete = false;
+ mCanSelectAll = false;
mCefLogFile = "";
mCefLogVerbose = false;
mPickedFiles.clear();
@@ -242,15 +254,17 @@ void MediaPluginCEF::onLoadStartCallback()
/////////////////////////////////////////////////////////////////////////////////
//
-void MediaPluginCEF::onLoadError(int status, const std::string error_text)
+void MediaPluginCEF::onLoadError(int status, const std::string error_text, const std::string error_url)
{
std::stringstream msg;
- msg << "<b>Loading error!</b>";
+ msg << "<b>Loading error</b>";
+ msg << "<p>";
+ msg << "Error message: " << error_text;
msg << "<p>";
- msg << "Message: " << error_text;
- msg << "<br>";
- msg << "Code: " << status;
+ msg << "Error URL: <tt>" << error_url << "</tt>";
+ msg << "<p>";
+ msg << "Error code: " << status;
mCEFLib->showBrowserMessage(msg.str());
}
@@ -607,7 +621,12 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
mCEFLib->setOnTooltipCallback(std::bind(&MediaPluginCEF::onTooltipCallback, this, std::placeholders::_1));
mCEFLib->setOnLoadStartCallback(std::bind(&MediaPluginCEF::onLoadStartCallback, this));
mCEFLib->setOnLoadEndCallback(std::bind(&MediaPluginCEF::onLoadEndCallback, this, std::placeholders::_1, std::placeholders::_2));
- mCEFLib->setOnLoadErrorCallback(std::bind(&MediaPluginCEF::onLoadError, this, std::placeholders::_1, std::placeholders::_2));
+
+ // CEF 139 seems to have introduced a loading failure at the login page (only?) I haven't seen it on
+ // any other page and it only happens about 1 in 8 times. Without this handler for the error page
+ // (red box, error message/code/url) the page load recovers after display a brief built in error.
+ // Not ideal but better than stopping altgoether. Will restore this once I discover the error.
+ //mCEFLib->setOnLoadErrorCallback(std::bind(&MediaPluginCEF::onLoadError, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
mCEFLib->setOnAddressChangeCallback(std::bind(&MediaPluginCEF::onAddressChangeCallback, this, std::placeholders::_1));
mCEFLib->setOnOpenPopupCallback(std::bind(&MediaPluginCEF::onOpenPopupCallback, this, std::placeholders::_1, std::placeholders::_2));
mCEFLib->setOnHTTPAuthCallback(std::bind(&MediaPluginCEF::onHTTPAuthCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));
@@ -635,10 +654,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
// and set it to white
settings.background_color = 0xffffffff; // white
- settings.cache_enabled = true;
settings.root_cache_path = mRootCachePath;
- settings.cache_path = mCachePath;
- settings.context_cache_path = mContextCachePath;
settings.cookies_enabled = mCookiesEnabled;
// configure proxy argument if enabled and valid
@@ -729,23 +745,32 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
std::string user_data_path_cache = message_in.getValue("cache_path");
std::string subfolder = message_in.getValue("username");
- mRootCachePath = user_data_path_cache + "cef_cache";
- if (!subfolder.empty())
- {
- std::string delim;
+ // media plugin doesn't have access to gDirUtilp
+ std::string path_separator;
#if LL_WINDOWS
- // media plugin doesn't have access to gDirUtilp
- delim = "\\";
+ path_separator = "\\";
#else
- delim = "/";
+ path_separator = "/";
#endif
- mCachePath = mRootCachePath + delim + subfolder;
- }
- else
- {
- mCachePath = mRootCachePath;
- }
- mContextCachePath = ""; // disabled by ""
+
+ mRootCachePath = user_data_path_cache + "cef_cache";
+
+ // Issue #4498 Introduce an additional sub-folder underneath the main cache
+ // folder so that each CEF media instance gets its own (as per the CEF API
+ // official position). These folders will be removed at startup by Viewer code
+ // so that their non-trivial size does not exhaust available disk space. This
+ // begs the question - why turn on the cache at all? There are 2 reasons - firstly
+ // some of the instances will benefit from per Viewer session caching and will
+ // use the injected SL cookie and secondly, it's not clear how having no cache
+ // interacts with the multiple simultaneous paradigm we use.
+ mRootCachePath += path_separator;
+# if LL_WINDOWS
+ mRootCachePath += std::to_string(_getpid());
+# else
+ mRootCachePath += std::to_string(getpid());
+# endif
+
+
mCefLogFile = message_in.getValue("cef_log_file");
mCefLogVerbose = message_in.getValueBoolean("cef_verbose_log");
}
@@ -930,6 +955,14 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
{
authResponse(message_in);
}
+ if (message_name == "edit_undo")
+ {
+ mCEFLib->editUndo();
+ }
+ if (message_name == "edit_redo")
+ {
+ mCEFLib->editRedo();
+ }
if (message_name == "edit_cut")
{
mCEFLib->editCut();
@@ -942,6 +975,18 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
{
mCEFLib->editPaste();
}
+ if (message_name == "edit_delete")
+ {
+ mCEFLib->editDelete();
+ }
+ if (message_name == "edit_select_all")
+ {
+ mCEFLib->editSelectAll();
+ }
+ if (message_name == "edit_show_source")
+ {
+ mCEFLib->viewSource();
+ }
}
else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER)
{
@@ -1125,14 +1170,31 @@ void MediaPluginCEF::unicodeInput(std::string event, LLSD native_key_data = LLSD
//
void MediaPluginCEF::checkEditState()
{
+ bool can_undo = mCEFLib->editCanUndo();
+ bool can_redo = mCEFLib->editCanRedo();
bool can_cut = mCEFLib->editCanCut();
bool can_copy = mCEFLib->editCanCopy();
bool can_paste = mCEFLib->editCanPaste();
+ bool can_delete = mCEFLib->editCanDelete();
+ bool can_select_all = mCEFLib->editCanSelectAll();
- if ((can_cut != mCanCut) || (can_copy != mCanCopy) || (can_paste != mCanPaste))
+ if ((can_undo != mCanUndo) || (can_redo != mCanRedo) || (can_cut != mCanCut) || (can_copy != mCanCopy)
+ || (can_paste != mCanPaste) || (can_delete != mCanDelete) || (can_select_all != mCanSelectAll))
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_state");
+ if (can_undo != mCanUndo)
+ {
+ mCanUndo = can_undo;
+ message.setValueBoolean("undo", can_undo);
+ }
+
+ if (can_redo != mCanRedo)
+ {
+ mCanRedo = can_redo;
+ message.setValueBoolean("redo", can_redo);
+ }
+
if (can_cut != mCanCut)
{
mCanCut = can_cut;
@@ -1151,6 +1213,18 @@ void MediaPluginCEF::checkEditState()
message.setValueBoolean("paste", can_paste);
}
+ if (can_delete != mCanDelete)
+ {
+ mCanDelete = can_delete;
+ message.setValueBoolean("delete", can_delete);
+ }
+
+ if (can_select_all != mCanSelectAll)
+ {
+ mCanSelectAll = can_select_all;
+ message.setValueBoolean("select_all", can_select_all);
+ }
+
sendMessage(message);
}
}
diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt
index 71343d5f85..be8ffe5a40 100644
--- a/indra/media_plugins/example/CMakeLists.txt
+++ b/indra/media_plugins/example/CMakeLists.txt
@@ -39,7 +39,7 @@ if (DARWIN)
PROPERTIES
PREFIX ""
BUILD_WITH_INSTALL_RPATH 1
- INSTALL_NAME_DIR "@executable_path"
+ INSTALL_RPATH "@executable_path/../Frameworks"
LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
)
diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt
index 1919f54a82..7c69a3ea58 100644
--- a/indra/media_plugins/libvlc/CMakeLists.txt
+++ b/indra/media_plugins/libvlc/CMakeLists.txt
@@ -43,7 +43,7 @@ if (DARWIN)
PROPERTIES
PREFIX ""
BUILD_WITH_INSTALL_RPATH 1
- INSTALL_NAME_DIR "@executable_path"
+ INSTALL_RPATH "@executable_path/../Frameworks"
LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
)
diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
index e79d474325..3fe2c2b193 100644
--- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
+++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
@@ -174,7 +174,7 @@ void MediaPluginLibVLC::initVLC()
};
#if LL_DARWIN
- setenv("VLC_PLUGIN_PATH", ".", 1);
+ setenv("VLC_PLUGIN_PATH", "./plugins", 1);
#endif
int vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv);