From a455d3ee7d5ddefcdf008fa86ecc7c80aba758aa Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 3 Feb 2025 11:35:22 -0500 Subject: Introduce build system and preprocessor support for ARM64 --- indra/media_plugins/base/CMakeLists.txt | 9 +-------- indra/media_plugins/base/media_plugin_base.cpp | 4 +--- indra/media_plugins/cef/CMakeLists.txt | 8 -------- indra/media_plugins/example/CMakeLists.txt | 8 -------- indra/media_plugins/libvlc/CMakeLists.txt | 7 ------- 5 files changed, 2 insertions(+), 34 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/base/CMakeLists.txt b/indra/media_plugins/base/CMakeLists.txt index 64b6a4228d..b6748abd47 100644 --- a/indra/media_plugins/base/CMakeLists.txt +++ b/indra/media_plugins/base/CMakeLists.txt @@ -12,13 +12,6 @@ include(PluginAPI) ### media_plugin_base -if(NOT ADDRESS_SIZE EQUAL 32) - if(WINDOWS) - ##add_definitions(/FIXED:NO) - else(WINDOWS) # not windows therefore gcc LINUX and DARWIN - add_definitions(-fPIC) - endif(WINDOWS) -endif(NOT ADDRESS_SIZE EQUAL 32) set(media_plugin_base_SOURCE_FILES media_plugin_base.cpp @@ -34,5 +27,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 545eee25a9..ccaa43cfb5 100644 --- a/indra/media_plugins/base/media_plugin_base.cpp +++ b/indra/media_plugins/base/media_plugin_base.cpp @@ -170,10 +170,8 @@ void MediaPluginBase::sendStatus() #if LL_WINDOWS # define LLSYMEXPORT __declspec(dllexport) -#elif LL_LINUX -# 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 0d1a833936..dbd888a1d2 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -14,14 +14,6 @@ include(CEFPlugin) ### media_plugin_cef -if(NOT ADDRESS_SIZE EQUAL 32) - if(WINDOWS) - ##add_definitions(/FIXED:NO) - else(WINDOWS) # not windows therefore gcc LINUX and DARWIN - add_definitions(-fPIC) - endif(WINDOWS) -endif(NOT ADDRESS_SIZE EQUAL 32) - set(media_plugin_cef_SOURCE_FILES media_plugin_cef.cpp ) diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt index 41e2353f31..71343d5f85 100644 --- a/indra/media_plugins/example/CMakeLists.txt +++ b/indra/media_plugins/example/CMakeLists.txt @@ -13,14 +13,6 @@ include(ExamplePlugin) ### media_plugin_example -if(NOT ADDRESS_SIZE EQUAL 32) - if(WINDOWS) - ##add_definitions(/FIXED:NO) - else(WINDOWS) # not windows therefore gcc LINUX and DARWIN - add_definitions(-fPIC) - endif(WINDOWS) -endif(NOT ADDRESS_SIZE EQUAL 32) - set(media_plugin_example_SOURCE_FILES media_plugin_example.cpp ) diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt index 202cbed96e..863b4617e9 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -13,13 +13,6 @@ include(LibVLCPlugin) ### media_plugin_libvlc -if(NOT ADDRESS_SIZE EQUAL 32) - if(WINDOWS) - ##add_definitions(/FIXED:NO) - else(WINDOWS) # not windows therefore gcc LINUX and DARWIN - add_definitions(-fPIC) - endif(WINDOWS) -endif(NOT ADDRESS_SIZE EQUAL 32) set(media_plugin_libvlc_SOURCE_FILES media_plugin_libvlc.cpp -- cgit v1.2.3 From 356b682f617c708c08de9f87b6f25e7683e701fb Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 7 Aug 2025 15:28:48 -0700 Subject: First part of work for #4498. This change forces each CEF instance to have it's own cache/cookie folder underneath the parent cef_cache folder. The whole cef_cache folder structure is purged at startup (before the parent being created at the first media instance creation) --- indra/media_plugins/cef/media_plugin_cef.cpp | 40 ++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 64fc7e452b..a96187119e 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 +#else +#include +#endif + #include "dullahan.h" //////////////////////////////////////////////////////////////////////////////// @@ -729,17 +736,34 @@ 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; + + 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 + + if (!subfolder.empty()) + { + mCachePath = mRootCachePath + path_separator + subfolder; } else { -- cgit v1.2.3 From 1bbad3fd00a9db28944bab1ec9c0e10fd5d1c2f2 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Mon, 11 Aug 2025 18:45:15 -0700 Subject: This commit introduces CEF 139 which works now that each media instance has its own cache/cookies folder (previous commit). It also changes the Test Bookmarks page to a heavily updated one with new links and a filter/search mechanism --- indra/media_plugins/cef/media_plugin_cef.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index a96187119e..d77eb83b00 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -71,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); @@ -249,15 +249,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 << "Loading error!"; + msg << "Loading error"; msg << "

"; - msg << "Message: " << error_text; - msg << "
"; - msg << "Code: " << status; + msg << "Error message: " << error_text; + msg << "

"; + msg << "Error URL: " << error_url << ""; + msg << "

"; + msg << "Error code: " << status; mCEFLib->showBrowserMessage(msg.str()); } @@ -614,7 +616,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)); -- cgit v1.2.3 From 454f93eaf8adeb7a9102b44674a3288000e004a8 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Mon, 11 Aug 2025 18:50:34 -0700 Subject: A ??) sequence was mis-interpreted by the pre-commit hooks as a trigraph sequence. --- indra/media_plugins/cef/media_plugin_cef.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index d77eb83b00..3f45ac971a 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -617,7 +617,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mCEFLib->setOnLoadStartCallback(std::bind(&MediaPluginCEF::onLoadStartCallback, this)); mCEFLib->setOnLoadEndCallback(std::bind(&MediaPluginCEF::onLoadEndCallback, 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 + // 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. -- cgit v1.2.3 From bebd1b208e1b342fabf59844851124a91513e83b Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Fri, 22 Aug 2025 17:10:29 -0700 Subject: Bring in Dullahan 1.20.0 and by that, CEF 139.0.28. Update the CEF media plugin accordingly to take account of Dullahan cache changes --- indra/media_plugins/cef/media_plugin_cef.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 3f45ac971a..52df4a9685 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -110,8 +110,6 @@ private: bool mCanCopy; bool mCanPaste; std::string mRootCachePath; - std::string mCachePath; - std::string mContextCachePath; std::string mCefLogFile; bool mCefLogVerbose; std::vector mPickedFiles; @@ -149,7 +147,6 @@ MediaPluginBase(host_send_func, host_user_data) mCanCut = false; mCanCopy = false; mCanPaste = false; - mCachePath = ""; mCefLogFile = ""; mCefLogVerbose = false; mPickedFiles.clear(); @@ -649,10 +646,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 @@ -768,15 +762,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mRootCachePath += std::to_string(getpid()); # endif - if (!subfolder.empty()) - { - mCachePath = mRootCachePath + path_separator + subfolder; - } - else - { - mCachePath = mRootCachePath; - } - mContextCachePath = ""; // disabled by "" + mCefLogFile = message_in.getValue("cef_log_file"); mCefLogVerbose = message_in.getValueBoolean("cef_verbose_log"); } -- cgit v1.2.3 From e629bf05d6212613083c8ccb2858085926f38902 Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 27 Aug 2025 22:36:55 -0400 Subject: Changes to support dullahan 1.21 undo/redo/delete/select all edit handlers --- indra/media_plugins/cef/media_plugin_cef.cpp | 59 +++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 52df4a9685..caf804f915 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -106,9 +106,13 @@ 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 mCefLogFile; bool mCefLogVerbose; @@ -144,9 +148,13 @@ MediaPluginBase(host_send_func, host_user_data) mAuthUsername = ""; mAuthPassword = ""; mAuthOK = false; + mCanUndo = false; + mCanRedo = false; mCanCut = false; mCanCopy = false; mCanPaste = false; + mCanDelete = false; + mCanSelectAll = false; mCefLogFile = ""; mCefLogVerbose = false; mPickedFiles.clear(); @@ -940,6 +948,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(); @@ -952,6 +968,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) { @@ -1103,14 +1131,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; @@ -1129,6 +1174,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); } } -- cgit v1.2.3 From 536c821c091be7020c614857e1fd220203f6ab23 Mon Sep 17 00:00:00 2001 From: Rye Date: Wed, 27 Aug 2025 23:05:40 -0400 Subject: MacOS companion changes for dullahan 1.21 including package structure and linkage fixes --- indra/media_plugins/base/CMakeLists.txt | 2 +- indra/media_plugins/cef/CMakeLists.txt | 10 +--------- indra/media_plugins/example/CMakeLists.txt | 2 +- indra/media_plugins/libvlc/CMakeLists.txt | 2 +- indra/media_plugins/libvlc/media_plugin_libvlc.cpp | 2 +- 5 files changed, 5 insertions(+), 13 deletions(-) (limited to 'indra/media_plugins') diff --git a/indra/media_plugins/base/CMakeLists.txt b/indra/media_plugins/base/CMakeLists.txt index 64b6a4228d..23f503c345 100644 --- a/indra/media_plugins/base/CMakeLists.txt +++ b/indra/media_plugins/base/CMakeLists.txt @@ -34,5 +34,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/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 0d1a833936..ebcf67576d 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -77,16 +77,8 @@ 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" ) - add_custom_command(TARGET media_plugin_cef - POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change "@executable_path/Chromium Embedded Framework" - "@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" - "$" - VERBATIM - COMMENT "Fixing path to CEF Framework" - ) - endif (DARWIN) diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt index 41e2353f31..278dac8c33 100644 --- a/indra/media_plugins/example/CMakeLists.txt +++ b/indra/media_plugins/example/CMakeLists.txt @@ -47,7 +47,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 202cbed96e..f9e0810df2 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -50,7 +50,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 4240613a0c..ad0ecaf4ab 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); -- cgit v1.2.3