summaryrefslogtreecommitdiff
path: root/indra/media_plugins/cef
diff options
context:
space:
mode:
Diffstat (limited to 'indra/media_plugins/cef')
-rw-r--r--indra/media_plugins/cef/CMakeLists.txt236
-rw-r--r--indra/media_plugins/cef/linux/volume_catcher_linux.cpp2
-rw-r--r--[-rwxr-xr-x]indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp14
-rw-r--r--[-rwxr-xr-x]indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp10
-rw-r--r--[-rwxr-xr-x]indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc0
-rw-r--r--[-rwxr-xr-x]indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc0
-rw-r--r--indra/media_plugins/cef/media_plugin_cef.cpp133
-rw-r--r--indra/media_plugins/cef/volume_catcher.h9
-rw-r--r--indra/media_plugins/cef/volume_catcher_null.cpp8
9 files changed, 288 insertions, 124 deletions
diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt
index 9142a4516a..e622cff2e6 100644
--- a/indra/media_plugins/cef/CMakeLists.txt
+++ b/indra/media_plugins/cef/CMakeLists.txt
@@ -23,7 +23,7 @@ set(media_plugin_cef_HEADER_FILES
)
# Select which VolumeCatcher implementation to use
-if (LINUX)
+if (LINUX AND NOT (${LINUX_DISTRO} MATCHES freedesktop)) # Disable linux volume catcher due to issues dlopening with CEF 139
foreach( PULSE_FILE pulse/introspect.h pulse/context.h pulse/subscribe.h pulse/glib-mainloop.h )
find_path( PULSE_FILE_${PULSE_FILE}_FOUND ${PULSE_FILE} NO_CACHE)
if( NOT PULSE_FILE_${PULSE_FILE}_FOUND )
@@ -33,41 +33,34 @@ if (LINUX)
message( "Looking for ${PULSE_FILE} ... found")
endif()
endforeach()
-
+
include(FindPipeWire)
include_directories(SYSTEM ${PIPEWIRE_INCLUDE_DIRS} ${SPA_INCLUDE_DIRS})
-
+
message( "Building with Linux volume catcher for PipeWire and PulseAudio" )
list(APPEND media_plugin_cef_HEADER_FILES
linux/volume_catcher_linux.h
)
- set(LINUX_VOLUME_CATCHER
- linux/volume_catcher_linux.cpp
+ set(LINUX_VOLUME_CATCHER
+ linux/volume_catcher_linux.cpp
linux/volume_catcher_pulseaudio.cpp
- linux/volume_catcher_pipewire.cpp
+ linux/volume_catcher_pipewire.cpp
)
- if (NOT (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu)))
- message( "Building with Linux volume catcher for PulseAudio only and cancelling PipeWire" )
- list(REMOVE_ITEM LINUX_VOLUME_CATCHER linux/volume_catcher_pipewire.cpp)
- endif ()
-
list(APPEND media_plugin_cef_SOURCE_FILES ${LINUX_VOLUME_CATCHER})
- set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id -Wl,-rpath,'$ORIGIN:$ORIGIN/../../lib'")
- list(APPEND media_plugin_cef_LINK_LIBRARIES llwindow )
-elseif (DARWIN)
- list(APPEND media_plugin_cef_SOURCE_FILES volume_catcher_null.cpp)
- find_library(CORESERVICES_LIBRARY CoreServices)
- find_library(AUDIOUNIT_LIBRARY AudioUnit)
- set( media_plugin_cef_LINK_LIBRARIES
- ${CORESERVICES_LIBRARY} # for Component Manager calls
- ${AUDIOUNIT_LIBRARY} # for AudioUnit calls
- )
+ if (${LINUX_DISTRO} MATCHES arch AND (CMAKE_SYSTEM_PROCESSOR MATCHES x86_64) OR (${LINUX_DISTRO} MATCHES fedora))
+ if (${LINUX_DISTRO} MATCHES fedora)
+ set(LIB_SUFFIX ${ADDRESS_SIZE})
+ endif ()
+ set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH};${INSTALL_PREFIX}/lib${LIB_SUFFIX}/cef)
+ endif ()
elseif (WINDOWS)
list(APPEND media_plugin_cef_SOURCE_FILES windows_volume_catcher.cpp)
-endif (LINUX)
+else()
+ list(APPEND media_plugin_cef_SOURCE_FILES volume_catcher_null.cpp)
+endif ()
list(APPEND media_plugin_cef_SOURCE_FILES ${media_plugin_cef_HEADER_FILES})
@@ -76,70 +69,99 @@ add_library(media_plugin_cef
${media_plugin_cef_SOURCE_FILES}
)
-if (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu))
- target_compile_definitions(media_plugin_cef PRIVATE USE_VOLUME_CATCHER_PW=1)
-endif ()
-
-#add_dependencies(media_plugin_cef
-# ${MEDIA_PLUGIN_BASE_LIBRARIES}
-#)
-
target_link_libraries(media_plugin_cef
media_plugin_base
ll::cef
ll::glib_headers
)
+if (LINUX)
+ target_link_libraries(${PROJECT_NAME} glib-2.0)
+endif ()
+
if (WINDOWS)
set_target_properties(
media_plugin_cef
PROPERTIES
LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099"
)
-endif (WINDOWS)
+elseif (DARWIN)
+ find_library(CORESERVICES_LIBRARY CoreServices)
+ find_library(AUDIOUNIT_LIBRARY AudioUnit)
+
+ target_link_libraries(media_plugin_cef
+ ${CORESERVICES_LIBRARY} # for Component Manager calls
+ ${AUDIOUNIT_LIBRARY} # for AudioUnit calls
+ )
-if (DARWIN)
# Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name
set_target_properties(
media_plugin_cef
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"
- -change "/opt/local/lib/libopenjp2.7.dylib" "@loader_path/../../Frameworks/libopenjp2.7.dylib"
- -change "/opt/local/lib/libpng16.16.dylib" "@loader_path/../../Frameworks/libpng16.16.dylib"
- -change "/opt/local/lib/libjpeg.8.dylib" "@loader_path/../../Frameworks/libjpeg.8.dylib"
- -change "/opt/local/lib/libfreetype.6.dylib" "@loader_path/../../Frameworks/libfreetype.6.dylib"
- -change "/opt/local/lib/libaprutil-1.0.dylib" "@loader_path/../../Frameworks/libaprutil-1.0.dylib"
- -change "/opt/local/lib/libiconv.2.dylib" "@loader_path/../../Frameworks/libiconv.2.dylib"
- -change "/opt/local/lib/libapr-1.0.dylib" "@loader_path/../../Frameworks/libapr-1.0.dylib"
- -change "/opt/local/lib/libexpat.1.dylib" "@loader_path/../../Frameworks/libexpat.1.dylib"
- -change "/opt/local/libexec/boost/1.87/lib/libboost_context-mt.dylib" "@loader_path/../../Frameworks/libboost_context-mt.dylib"
- -change "/opt/local/libexec/boost/1.87/lib/libboost_fiber-mt.dylib" "@loader_path/../../Frameworks/libboost_fiber-mt.dylib"
- -change "/opt/local/libexec/boost/1.87/lib/libboost_filesystem-mt.dylib" "@loader_path/../../Frameworks/libboost_filesystem-mt.dylib"
- -change "/opt/local/libexec/boost/1.87/lib/libboost_program_options-mt.dylib" "@loader_path/../../Frameworks/libboost_program_options-mt.dylib"
- -change "/opt/local/libexec/boost/1.87/lib/libboost_regex-mt.dylib" "@loader_path/../../Frameworks/libboost_regex-mt.dylib"
- -change "/opt/local/libexec/boost/1.87/lib/libboost_system-mt.dylib" "@loader_path/../../Frameworks/libboost_system-mt.dylib"
- -change "/opt/local/libexec/boost/1.87/lib/libboost_thread-mt.dylib" "@loader_path/../../Frameworks/libboost_thread-mt.dylib"
- -change "/opt/local/libexec/boost/1.87/lib/libboost_url-mt.dylib" "@loader_path/../../Frameworks/libboost_url-mt.dylib"
- -change "/opt/local/lib/libz.1.dylib" "@loader_path/../../Frameworks/libz.1.dylib"
- -change "/opt/local/lib/libnghttp2.14.dylib" "@loader_path/../../Frameworks/libnghttp2.14.dylib"
- "$<TARGET_FILE:media_plugin_cef>"
- VERBATIM
- COMMENT "Fixing path to CEF Framework"
- )
+ if (DARWIN_USE_HOMEBREW)
+ # Homebrew Boost has no -mt suffix and no libboost_system. iconv, expat,
+ # and zlib resolve to macOS system dylibs and stay absolute.
+ add_custom_command(TARGET ${PROJECT_NAME}
+ POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL}
+ -change "${DARWIN_NGHTTP2_PREFIX}/lib/libnghttp2.14.dylib" "@loader_path/libnghttp2.14.dylib"
+ -change "${DARWIN_APRUTIL_PREFIX}/lib/libaprutil-1.0.dylib" "@loader_path/libaprutil-1.0.dylib"
+ -change "${DARWIN_APR_PREFIX}/lib/libapr-1.0.dylib" "@loader_path/libapr-1.0.dylib"
+ -change "${DARWIN_BOOST_PREFIX}/lib/libboost_context.dylib" "@loader_path/libboost_context.dylib"
+ -change "${DARWIN_BOOST_PREFIX}/lib/libboost_fiber.dylib" "@loader_path/libboost_fiber.dylib"
+ -change "${DARWIN_BOOST_PREFIX}/lib/libboost_filesystem.dylib" "@loader_path/libboost_filesystem.dylib"
+ -change "${DARWIN_BOOST_PREFIX}/lib/libboost_process.dylib" "@loader_path/libboost_process.dylib"
+ -change "${DARWIN_BOOST_PREFIX}/lib/libboost_program_options.dylib" "@loader_path/libboost_program_options.dylib"
+ -change "${DARWIN_BOOST_PREFIX}/lib/libboost_thread.dylib" "@loader_path/libboost_thread.dylib"
+ -change "${DARWIN_BOOST_PREFIX}/lib/libboost_url.dylib" "@loader_path/libboost_url.dylib"
+ -change "${DARWIN_BOOST_PREFIX}/lib/libboost_regex.dylib" "@loader_path/libboost_regex.dylib"
+ "$<TARGET_FILE:${PROJECT_NAME}>"
+ VERBATIM
+ COMMENT "Fixing paths to CEF media plugin dependencies"
+ )
+ else ()
+ add_custom_command(TARGET ${PROJECT_NAME}
+ POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL}
+ -change "/opt/local/lib/libnghttp2.14.dylib" "@loader_path/libnghttp2.14.dylib"
+ -change "/opt/local/lib/libaprutil-1.0.dylib" "@loader_path/libaprutil-1.0.dylib"
+ -change "/opt/local/lib/libiconv.2.dylib" "@loader_path/libiconv.2.dylib"
+ -change "/opt/local/lib/libapr-1.0.dylib" "@loader_path/libapr-1.0.dylib"
+ -change "/opt/local/lib/libz.1.dylib" "@loader_path/libz.1.dylib"
+ -change "/opt/local/libexec/boost/1.88/lib/libboost_context-mt.dylib" "@loader_path/libboost_context-mt.dylib"
+ -change "/opt/local/libexec/boost/1.88/lib/libboost_fiber-mt.dylib" "@loader_path/libboost_fiber-mt.dylib"
+ -change "/opt/local/libexec/boost/1.88/lib/libboost_filesystem-mt.dylib" "@loader_path/libboost_filesystem-mt.dylib"
+ -change "/opt/local/libexec/boost/1.88/lib/libboost_process-mt.dylib" "@loader_path/libboost_process-mt.dylib"
+ -change "/opt/local/libexec/boost/1.88/lib/libboost_program_options-mt.dylib" "@loader_path/libboost_program_options-mt.dylib"
+ -change "/opt/local/libexec/boost/1.88/lib/libboost_thread-mt.dylib" "@loader_path/libboost_thread-mt.dylib"
+ -change "/opt/local/libexec/boost/1.88/lib/libboost_url-mt.dylib" "@loader_path/libboost_url-mt.dylib"
+ -change "/opt/local/libexec/boost/1.88/lib/libboost_regex-mt.dylib" "@loader_path/libboost_regex-mt.dylib"
+ -change "/opt/local/libexec/boost/1.88/lib/libboost_system-mt.dylib" "@loader_path/libboost_system-mt.dylib"
+ -change "/opt/local/lib/libexpat.1.dylib" "@loader_path/libexpat.1.dylib"
+ "$<TARGET_FILE:${PROJECT_NAME}>"
+ VERBATIM
+ COMMENT "Fixing paths to CEF media plugin dependencies"
+ )
+ endif ()
-endif (DARWIN)
+elseif (LINUX)
+ target_link_options(media_plugin_cef PRIVATE "LINKER:--build-id")
+endif ()
+
+if (CMAKE_BUILD_TYPE MATCHES Release AND (CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID MATCHES GNU))
+ add_custom_command(
+ TARGET ${PROJECT_NAME} POST_BUILD
+ COMMAND ${CMAKE_STRIP} "$<TARGET_FILE:${PROJECT_NAME}>"
+ )
+endif ()
if (INSTALL)
if (DARWIN)
- set(_LIB llplugin)
+ set(_LIB SLPlugin.app/Contents/Frameworks)
install(
DIRECTORY "${ARCH_PREBUILT_DIRS_RELEASE}/Chromium Embedded Framework.framework"
DESTINATION ../Frameworks
@@ -147,54 +169,106 @@ 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"
- DESTINATION SLPlugin.app/Contents/Frameworks
+ DESTINATION ${_LIB}
)
elseif (LINUX)
- if (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu))
- set(_LIB lib/${ARCH}-linux-gnu)
+ if (${LINUX_DISTRO} MATCHES freedesktop)
+ set(_LIB lib)
+ elseif (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu))
+ set(_LIB lib/${ARCH}-linux-gnu/${VIEWER_BINARY_NAME})
elseif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR (${LINUX_DISTRO} MATCHES gentoo))
- set(_LIB lib${ADDRESS_SIZE})
+ set(_LIB lib${ADDRESS_SIZE}/${VIEWER_BINARY_NAME})
else ()
- set(_LIB lib)
+ set(_LIB lib/${VIEWER_BINARY_NAME})
endif ()
- if (${LINUX_DISTRO} MATCHES arch)
+ if (${LINUX_DISTRO} MATCHES freedesktop)
install(
PROGRAMS
${AUTOBUILD_INSTALL_DIR}/bin/release/chrome-sandbox
${AUTOBUILD_INSTALL_DIR}/bin/release/dullahan_host
+ DESTINATION libexec
+ )
+ elseif (${LINUX_DISTRO} MATCHES arch)
+ install(
+ PROGRAMS ${AUTOBUILD_INSTALL_DIR}/bin/release/dullahan_host
DESTINATION lib/${VIEWER_BINARY_NAME}
- #PERMISSIONS SETUID OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
- else (${LINUX_DISTRO} MATCHES arch)
+ if (CMAKE_SYSTEM_PROCESSOR MATCHES aarch64)
+ install(
+ PROGRAMS ${AUTOBUILD_INSTALL_DIR}/bin/release/chrome-sandbox
+ DESTINATION lib/${VIEWER_BINARY_NAME}
+ )
+ endif ()
+ elseif (${LINUX_DISTRO} MATCHES fedora)
+ install(
+ PROGRAMS ${AUTOBUILD_INSTALL_DIR}/bin/release/dullahan_host
+ DESTINATION libexec/${VIEWER_BINARY_NAME}
+ )
+ else ()
install(
PROGRAMS
${AUTOBUILD_INSTALL_DIR}/bin/release/chrome-sandbox
${AUTOBUILD_INSTALL_DIR}/bin/release/dullahan_host
DESTINATION libexec/${VIEWER_BINARY_NAME}
- #PERMISSIONS SETUID OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
- endif (${LINUX_DISTRO} MATCHES arch)
+ endif ()
+ if (NOT (${LINUX_DISTRO} MATCHES arch AND (CMAKE_SYSTEM_PROCESSOR MATCHES x86_64) OR (${LINUX_DISTRO} MATCHES fedora)))
+ install(
+ FILES
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libEGL.so
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libGLESv2.so
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libcef.so
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libvk_swiftshader.so
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libvulkan.so.1
+ ${ARCH_PREBUILT_DIRS_RELEASE}/v8_context_snapshot.bin
+ ${ARCH_PREBUILT_DIRS_RELEASE}/vk_swiftshader_icd.json
+ ${AUTOBUILD_INSTALL_DIR}/resources/chrome_100_percent.pak
+ ${AUTOBUILD_INSTALL_DIR}/resources/chrome_200_percent.pak
+ ${AUTOBUILD_INSTALL_DIR}/resources/icudtl.dat
+ ${AUTOBUILD_INSTALL_DIR}/resources/resources.pak
+ DESTINATION ${_LIB}
+ )
+ install(
+ DIRECTORY ${AUTOBUILD_INSTALL_DIR}/resources/locales
+ DESTINATION ${_LIB}
+ )
+ endif ()
+ elseif (WINDOWS)
+ set(_LIB llplugin)
+ install(
+ PROGRAMS
+ ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME}.dll
+ ${AUTOBUILD_INSTALL_DIR}/bin/release/chrome_elf.dll
+ ${AUTOBUILD_INSTALL_DIR}/bin/release/d3dcompiler_47.dll
+ ${AUTOBUILD_INSTALL_DIR}/bin/release/dullahan_host.exe
+ ${AUTOBUILD_INSTALL_DIR}/bin/release/libEGL.dll
+ ${AUTOBUILD_INSTALL_DIR}/bin/release/libGLESv2.dll
+ ${AUTOBUILD_INSTALL_DIR}/bin/release/libcef.dll
+ ${AUTOBUILD_INSTALL_DIR}/bin/release/libvlc.dll
+ ${AUTOBUILD_INSTALL_DIR}/bin/release/libvlccore.dll
+ DESTINATION llplugin
+ )
install(
FILES
- ${ARCH_PREBUILT_DIRS_RELEASE}/libcef.so
- ${ARCH_PREBUILT_DIRS_RELEASE}/libvk_swiftshader.so
- ${AUTOBUILD_INSTALL_DIR}/bin/release/snapshot_blob.bin
- ${AUTOBUILD_INSTALL_DIR}/bin/release/v8_context_snapshot.bin
${AUTOBUILD_INSTALL_DIR}/resources/chrome_100_percent.pak
${AUTOBUILD_INSTALL_DIR}/resources/chrome_200_percent.pak
${AUTOBUILD_INSTALL_DIR}/resources/icudtl.dat
${AUTOBUILD_INSTALL_DIR}/resources/resources.pak
- DESTINATION ${_LIB}
+ ${AUTOBUILD_INSTALL_DIR}/bin/release/v8_context_snapshot.bin
+ DESTINATION llplugin
)
install(
DIRECTORY ${AUTOBUILD_INSTALL_DIR}/resources/locales
- DESTINATION ${_LIB}
+ DESTINATION llplugin
)
- else (DARWIN)
- set(_LIB lib)
- endif (DARWIN)
- install(TARGETS ${PROJECT_NAME} DESTINATION ${_LIB})
-endif (INSTALL)
+ else ()
+ set(_LIB lib/${VIEWER_BINARY_NAME})
+ endif ()
+ if (NOT WINDOWS)
+ install(TARGETS ${PROJECT_NAME} DESTINATION ${_LIB})
+ endif ()
+endif ()
diff --git a/indra/media_plugins/cef/linux/volume_catcher_linux.cpp b/indra/media_plugins/cef/linux/volume_catcher_linux.cpp
index ba2ed1aa56..7d33242063 100644
--- a/indra/media_plugins/cef/linux/volume_catcher_linux.cpp
+++ b/indra/media_plugins/cef/linux/volume_catcher_linux.cpp
@@ -37,14 +37,12 @@ void VolumeCatcher::onEnablePipeWireVolumeCatcher(bool enable)
if (pimpl != nullptr)
return;
-#if USE_VOLUME_CATCHER_PW
if (enable)
{
LL_DEBUGS() << "volume catcher using pipewire" << LL_ENDL;
pimpl = new VolumeCatcherPipeWire();
}
else
-#endif
{
LL_DEBUGS() << "volume catcher using pulseaudio" << LL_ENDL;
pimpl = new VolumeCatcherPulseAudio();
diff --git a/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp b/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp
index 27fea547c9..73ef7fc18c 100755..100644
--- a/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp
+++ b/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp
@@ -1,4 +1,4 @@
-/**
+/**
* @file volume_catcher_pipewire.cpp
* @brief A Linux-specific, PipeWire-specific hack to detect and volume-adjust new audio sources
*
@@ -6,21 +6,21 @@
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* 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.
- *
+ *
* 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.
- *
+ *
* 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$
* @endcond
@@ -207,7 +207,7 @@ void VolumeCatcherPipeWire::ChildNode::updateVolume()
{
std::lock_guard pwLock(*mImpl);
- pw_node_set_param(mProxy, SPA_PARAM_Props, 0, pod);
+ pw_node_set_param((pw_node*)mProxy, SPA_PARAM_Props, 0, pod);
}
}
@@ -303,7 +303,7 @@ void VolumeCatcherPipeWire::handleRegistryEventGlobal(
childNode->mProxy = proxy;
childNode->mImpl = this;
- pw_node_add_listener(proxy, &childNode->mNodeListener, &NODE_EVENTS, childNode);
+ pw_node_add_listener((pw_node*)proxy, &childNode->mNodeListener, &NODE_EVENTS, childNode);
llpw_proxy_add_listener(proxy, &childNode->mProxyListener, &PROXY_EVENTS, childNode);
}
diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp
index 9417c49d38..f8a48a91fd 100755..100644
--- a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp
+++ b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio.cpp
@@ -1,4 +1,4 @@
-/**
+/**
* @file volume_catcher_pulseaudio.cpp
* @brief A Linux-specific, PulseAudio-specific hack to detect and volume-adjust new audio sources
*
@@ -6,21 +6,21 @@
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* 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.
- *
+ *
* 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.
- *
+ *
* 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$
* @endcond
diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc
index e9b7196e51..e9b7196e51 100755..100644
--- a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc
+++ b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_glib_syms.inc
diff --git a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc
index 4859a34405..4859a34405 100755..100644
--- a/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc
+++ b/indra/media_plugins/cef/linux/volume_catcher_pulseaudio_syms.inc
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp
index 9c205b558c..0d7da6bd58 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,14 +106,19 @@ 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;
+ U32 mCefRemoteDebuggingPort;
std::vector<std::string> mPickedFiles;
VolumeCatcher mVolumeCatcher;
F32 mCurVolume;
@@ -139,12 +151,16 @@ 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;
+ mCefRemoteDebuggingPort = 0;
mPickedFiles.clear();
mCurVolume = 0.0;
@@ -242,15 +258,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 +625,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 +658,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
@@ -693,6 +713,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<std::string> custom_schemes(1, "secondlife");
@@ -729,25 +751,35 @@ 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");
+ mCefRemoteDebuggingPort = message_in.getValueU32("cef_remote_debugging_port");
}
else if (message_name == "size_change")
{
@@ -930,6 +962,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 +982,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 +1177,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 +1220,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/cef/volume_catcher.h b/indra/media_plugins/cef/volume_catcher.h
index 6933854e8e..806f2a008a 100644
--- a/indra/media_plugins/cef/volume_catcher.h
+++ b/indra/media_plugins/cef/volume_catcher.h
@@ -39,17 +39,22 @@ public:
VolumeCatcher();
~VolumeCatcher();
- void setVolume(F32 volume);
+ void setVolume(F32 volume); // 0.0 - 1.0
+
+ // Set the left-right pan of audio sources
+ // where -1.0 = left, 0 = center, and 1.0 = right
void setPan(F32 pan);
- void pump();
+ void pump(); // call this at least a few times a second if you can - it affects how quickly we can 'catch' a new audio source and adjust its volume
#if LL_LINUX
void onEnablePipeWireVolumeCatcher(bool enable);
#endif
private:
+#if LL_LINUX || LL_WINDOWS
VolumeCatcherImpl *pimpl;
+#endif
};
#endif // VOLUME_CATCHER_H
diff --git a/indra/media_plugins/cef/volume_catcher_null.cpp b/indra/media_plugins/cef/volume_catcher_null.cpp
index c6028da45b..cd5eccca38 100644
--- a/indra/media_plugins/cef/volume_catcher_null.cpp
+++ b/indra/media_plugins/cef/volume_catcher_null.cpp
@@ -1,4 +1,4 @@
-/**
+/**
* @file volume_catcher_null.cpp
* @brief A null implementation of volume level control of all audio channels opened by a process.
* We are using this for the macOS version for now until we can understand how to make the
@@ -51,3 +51,9 @@ void VolumeCatcher::setPan(F32 pan)
void VolumeCatcher::pump()
{
}
+
+#if LL_LINUX
+void VolumeCatcher::onEnablePipeWireVolumeCatcher(bool enable)
+{
+}
+#endif