diff options
Diffstat (limited to 'indra/media_plugins')
| -rw-r--r-- | indra/media_plugins/base/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | indra/media_plugins/base/media_plugin_base.cpp | 4 | ||||
| -rw-r--r-- | indra/media_plugins/cef/CMakeLists.txt | 114 | ||||
| -rw-r--r-- | indra/media_plugins/cef/linux/volume_catcher_linux.cpp | 2 | ||||
| -rw-r--r-- | indra/media_plugins/cef/media_plugin_cef.cpp | 142 | ||||
| -rw-r--r-- | indra/media_plugins/example/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | indra/media_plugins/libvlc/CMakeLists.txt | 33 | ||||
| -rw-r--r-- | indra/media_plugins/libvlc/media_plugin_libvlc.cpp | 6 |
8 files changed, 237 insertions, 70 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 233d03b4ef..aa1c713f17 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -49,6 +49,11 @@ if (LINUX) linux/volume_catcher_pipewire.cpp ) + if (NOT (${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 ) @@ -71,6 +76,10 @@ add_library(media_plugin_cef ${media_plugin_cef_SOURCE_FILES} ) +if (${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} #) @@ -81,11 +90,15 @@ target_link_libraries(media_plugin_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 /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099" + LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099" ) endif (WINDOWS) @@ -96,7 +109,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" ) @@ -111,10 +124,16 @@ if (DARWIN) -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.88/lib/libboost_context-mt.dylib" "@loader_path/../../Frameworks/libboost_context-mt.dylib" + -change "/opt/local/libexec/boost/1.88/lib/libboost_fiber-mt.dylib" "@loader_path/../../Frameworks/libboost_fiber-mt.dylib" + -change "/opt/local/libexec/boost/1.88/lib/libboost_filesystem-mt.dylib" "@loader_path/../../Frameworks/libboost_filesystem-mt.dylib" + -change "/opt/local/libexec/boost/1.88/lib/libboost_program_options-mt.dylib" "@loader_path/../../Frameworks/libboost_program_options-mt.dylib" + -change "/opt/local/libexec/boost/1.88/lib/libboost_regex-mt.dylib" "@loader_path/../../Frameworks/libboost_regex-mt.dylib" + -change "/opt/local/libexec/boost/1.88/lib/libboost_system-mt.dylib" "@loader_path/../../Frameworks/libboost_system-mt.dylib" + -change "/opt/local/libexec/boost/1.88/lib/libboost_thread-mt.dylib" "@loader_path/../../Frameworks/libboost_thread-mt.dylib" + -change "/opt/local/libexec/boost/1.88/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/liburiparser.1.dylib" "@loader_path/../../Frameworks/liburiparser.1.dylib" -change "/opt/local/lib/libnghttp2.14.dylib" "@loader_path/../../Frameworks/libnghttp2.14.dylib" - -change "/usr/local/lib/libxmlrpc-epi.0.dylib" "@loader_path/../../Frameworks/libxmlrpc-epi.0.dylib" "$<TARGET_FILE:media_plugin_cef>" VERBATIM COMMENT "Fixing path to CEF Framework" @@ -126,33 +145,47 @@ if (INSTALL) if (DARWIN) set(_LIB llplugin) install( - DIRECTORY "${AUTOBUILD_INSTALL_DIR}/lib/release/Chromium Embedded Framework.framework" + DIRECTORY "${ARCH_PREBUILT_DIRS_RELEASE}/Chromium Embedded Framework.framework" DESTINATION ../Frameworks ) install( DIRECTORY - "${AUTOBUILD_INSTALL_DIR}/lib/release/DullahanHelper.app" - "${AUTOBUILD_INSTALL_DIR}/lib/release/DullahanHelper (GPU).app" - "${AUTOBUILD_INSTALL_DIR}/lib/release/DullahanHelper (Plugin).app" - "${AUTOBUILD_INSTALL_DIR}/lib/release/DullahanHelper (Renderer).app" + "${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 ) elseif (LINUX) - if (EXISTS ${CMAKE_SYSROOT}/usr/lib/${ARCH}-linux-gnu) + if (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu)) set(_LIB lib/${ARCH}-linux-gnu) - elseif (EXISTS /lib64) - set(_LIB lib64) - endif (EXISTS ${CMAKE_SYSROOT}/usr/lib/${ARCH}-linux-gnu) - 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 - ) + elseif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR (${LINUX_DISTRO} MATCHES gentoo)) + set(_LIB lib${ADDRESS_SIZE}) + else () + set(_LIB lib) + endif () + if (${LINUX_DISTRO} MATCHES arch) + install( + PROGRAMS + ${AUTOBUILD_INSTALL_DIR}/bin/release/chrome-sandbox + ${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) + 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) install( FILES - ${AUTOBUILD_INSTALL_DIR}/lib/release/libcef.so + ${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 @@ -165,8 +198,39 @@ if (INSTALL) DIRECTORY ${AUTOBUILD_INSTALL_DIR}/resources/locales DESTINATION ${_LIB} ) - else (DARWIN) + 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 + ${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 + ${AUTOBUILD_INSTALL_DIR}/bin/release/snapshot_blob.bin + ${AUTOBUILD_INSTALL_DIR}/bin/release/v8_context_snapshot.bin + DESTINATION llplugin + ) + install( + DIRECTORY ${AUTOBUILD_INSTALL_DIR}/resources/locales + DESTINATION llplugin + ) + else () set(_LIB lib) - endif (DARWIN) - install(TARGETS ${PROJECT_NAME} DESTINATION ${_LIB}) -endif (INSTALL) + 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 7d33242063..ba2ed1aa56 100644 --- a/indra/media_plugins/cef/linux/volume_catcher_linux.cpp +++ b/indra/media_plugins/cef/linux/volume_catcher_linux.cpp @@ -37,12 +37,14 @@ 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/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 9c205b558c..a2b664c755 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,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 mCachePath; std::string mContextCachePath; @@ -139,10 +150,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 +256,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 << "Message: " << error_text; - msg << "<br>"; - msg << "Code: " << status; + msg << "Error message: " << error_text; + msg << "<p>"; + msg << "Error URL: <tt>" << error_url << "</tt>"; + msg << "<p>"; + msg << "Error code: " << status; mCEFLib->showBrowserMessage(msg.str()); } @@ -607,7 +623,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 +656,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 +747,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 +957,16 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { authResponse(message_in); } +#if !LL_LINUX + if (message_name == "edit_undo") + { + mCEFLib->editUndo(); + } + if (message_name == "edit_redo") + { + mCEFLib->editRedo(); + } +#endif if (message_name == "edit_cut") { mCEFLib->editCut(); @@ -942,6 +979,20 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mCEFLib->editPaste(); } +#if !LL_LINUX + if (message_name == "edit_delete") + { + mCEFLib->editDelete(); + } + if (message_name == "edit_select_all") + { + mCEFLib->editSelectAll(); + } + if (message_name == "edit_show_source") + { + mCEFLib->viewSource(); + } +#endif } else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER) { @@ -1125,14 +1176,41 @@ void MediaPluginCEF::unicodeInput(std::string event, LLSD native_key_data = LLSD // void MediaPluginCEF::checkEditState() { +#if !LL_LINUX + bool can_undo = mCEFLib->editCanUndo(); + bool can_redo = mCEFLib->editCanRedo(); +#endif bool can_cut = mCEFLib->editCanCut(); bool can_copy = mCEFLib->editCanCopy(); bool can_paste = mCEFLib->editCanPaste(); +#if !LL_LINUX + bool can_delete = mCEFLib->editCanDelete(); + bool can_select_all = mCEFLib->editCanSelectAll(); +#endif +#if LL_LINUX if ((can_cut != mCanCut) || (can_copy != mCanCopy) || (can_paste != mCanPaste)) +#else + if ((can_undo != mCanUndo) || (can_redo != mCanRedo) || (can_cut != mCanCut) || (can_copy != mCanCopy) + || (can_paste != mCanPaste) || (can_delete != mCanDelete) || (can_select_all != mCanSelectAll)) +#endif { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_state"); +#if !LL_LINUX + if (can_undo != mCanUndo) + { + mCanUndo = can_undo; + message.setValueBoolean("undo", can_undo); + } + + if (can_redo != mCanRedo) + { + mCanRedo = can_redo; + message.setValueBoolean("redo", can_redo); + } +#endif + if (can_cut != mCanCut) { mCanCut = can_cut; @@ -1151,6 +1229,20 @@ void MediaPluginCEF::checkEditState() message.setValueBoolean("paste", can_paste); } +#if !LL_LINUX + 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); + } +#endif + sendMessage(message); } } diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt index 86e982fbb4..be8ffe5a40 100644 --- a/indra/media_plugins/example/CMakeLists.txt +++ b/indra/media_plugins/example/CMakeLists.txt @@ -28,7 +28,7 @@ if (WINDOWS) set_target_properties( media_plugin_example PROPERTIES - LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT" + LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB:LIBCMT" ) endif (WINDOWS) @@ -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 2cdfee8250..7a7c87c056 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -32,7 +32,7 @@ if (WINDOWS) set_target_properties( media_plugin_libvlc PROPERTIES - LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT" + LINK_FLAGS "/MANIFEST:NO /NODEFAULTLIB:LIBCMT" ) endif (WINDOWS) @@ -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" ) @@ -57,10 +57,16 @@ if (DARWIN) -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.88/lib/libboost_context-mt.dylib" "@loader_path/../../Frameworks/libboost_context-mt.dylib" + -change "/opt/local/libexec/boost/1.88/lib/libboost_fiber-mt.dylib" "@loader_path/../../Frameworks/libboost_fiber-mt.dylib" + -change "/opt/local/libexec/boost/1.88/lib/libboost_filesystem-mt.dylib" "@loader_path/../../Frameworks/libboost_filesystem-mt.dylib" + -change "/opt/local/libexec/boost/1.88/lib/libboost_program_options-mt.dylib" "@loader_path/../../Frameworks/libboost_program_options-mt.dylib" + -change "/opt/local/libexec/boost/1.88/lib/libboost_regex-mt.dylib" "@loader_path/../../Frameworks/libboost_regex-mt.dylib" + -change "/opt/local/libexec/boost/1.88/lib/libboost_system-mt.dylib" "@loader_path/../../Frameworks/libboost_system-mt.dylib" + -change "/opt/local/libexec/boost/1.88/lib/libboost_thread-mt.dylib" "@loader_path/../../Frameworks/libboost_thread-mt.dylib" + -change "/opt/local/libexec/boost/1.88/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/liburiparser.1.dylib" "@loader_path/../../Frameworks/liburiparser.1.dylib" -change "/opt/local/lib/libnghttp2.14.dylib" "@loader_path/../../Frameworks/libnghttp2.14.dylib" - -change "/usr/local/lib/libxmlrpc-epi.0.dylib" "@loader_path/../../Frameworks/libxmlrpc-epi.0.dylib" -change "@rpath/libvlc.dylib" "@loader_path/plugins/libvlc.dylib" -change "@rpath/libvlccore.dylib" "@loader_path/plugins/libvlccore.dylib" "$<TARGET_FILE:media_plugin_libvlc>" @@ -85,12 +91,17 @@ if (INSTALL) /Volumes/VLC\ media\ player/VLC.app/Contents/MacOS/lib/libvlccore.dylib DESTINATION ${_LIB}/plugins ) - elseif (EXISTS ${CMAKE_SYSROOT}/usr/lib/${ARCH}-linux-gnu) + elseif (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu)) set(_LIB lib/${ARCH}-linux-gnu) - elseif (EXISTS /lib64) - set(_LIB lib64) - else (DARWIN) + elseif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR (${LINUX_DISTRO} MATCHES gentoo)) + set(_LIB lib${ADDRESS_SIZE}) + else () set(_LIB lib) - endif (DARWIN) - install(TARGETS ${PROJECT_NAME} DESTINATION ${_LIB}) -endif (INSTALL) + endif () + if (WINDOWS) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME}.dll DESTINATION llplugin) + install(DIRECTORY ${AUTOBUILD_INSTALL_DIR}/bin/release/plugins DESTINATION llplugin) + else () + install(TARGETS ${PROJECT_NAME} DESTINATION ${_LIB}) + endif () +endif () diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index b090734c72..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); @@ -606,7 +606,7 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string) mTextureWidth = texture_width; mTextureHeight = texture_height; - libvlc_time_t time = 1000.0 * mCurTime; + libvlc_time_t time = (libvlc_time_t)(1000.0 * mCurTime); playMedia(); @@ -676,7 +676,7 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string) { if (mLibVLCMediaPlayer) { - libvlc_time_t time = 1000.0 * message_in.getValueReal("time"); + libvlc_time_t time = (libvlc_time_t)(1000.0 * message_in.getValueReal("time")); libvlc_media_player_set_time(mLibVLCMediaPlayer, time); time = libvlc_media_player_get_time(mLibVLCMediaPlayer); if (time < 0) |
