summaryrefslogtreecommitdiff
path: root/indra/media_plugins
diff options
context:
space:
mode:
Diffstat (limited to 'indra/media_plugins')
-rw-r--r--indra/media_plugins/CMakeLists.txt30
-rw-r--r--indra/media_plugins/base/CMakeLists.txt2
-rw-r--r--indra/media_plugins/base/media_plugin_base.cpp33
-rw-r--r--[-rwxr-xr-x]indra/media_plugins/base/media_plugin_base.exp0
-rw-r--r--indra/media_plugins/base/media_plugin_base.h8
-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
-rw-r--r--indra/media_plugins/example/CMakeLists.txt2
-rw-r--r--indra/media_plugins/gstreamer10/CMakeLists.txt22
-rw-r--r--indra/media_plugins/gstreamer10/llmediaimplgstreamer.h53
-rw-r--r--indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc2
-rw-r--r--indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp62
-rw-r--r--indra/media_plugins/libvlc/CMakeLists.txt119
-rw-r--r--indra/media_plugins/libvlc/media_plugin_libvlc.cpp54
21 files changed, 489 insertions, 310 deletions
diff --git a/indra/media_plugins/CMakeLists.txt b/indra/media_plugins/CMakeLists.txt
index 78bdba8f18..fcb8753c74 100644
--- a/indra/media_plugins/CMakeLists.txt
+++ b/indra/media_plugins/CMakeLists.txt
@@ -1,26 +1,12 @@
# -*- cmake -*-
add_subdirectory(base)
+if (NOT (CMAKE_SYSTEM_NAME MATCHES FreeBSD))
+add_subdirectory(cef)
+endif ()
+add_subdirectory(libvlc)
+add_subdirectory(example)
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
- add_subdirectory(example)
- add_subdirectory(libvlc)
-endif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
-
-if (LINUX)
- add_subdirectory(cef)
- add_subdirectory(example)
- add_subdirectory(libvlc)
-endif (LINUX)
-
-if (DARWIN)
- add_subdirectory(cef)
- add_subdirectory(libvlc)
- add_subdirectory(example)
-endif (DARWIN)
-
-if (WINDOWS)
- add_subdirectory(cef)
- add_subdirectory(libvlc)
- add_subdirectory(example)
-endif (WINDOWS)
+if (FALSE)
+ add_subdirectory(gstreamer10)
+endif ()
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..692c2f6c1c 100644
--- a/indra/media_plugins/base/media_plugin_base.cpp
+++ b/indra/media_plugins/base/media_plugin_base.cpp
@@ -169,6 +169,8 @@ void MediaPluginBase::sendStatus()
#if LL_LINUX || __FreeBSD__
+#include <dlfcn.h>
+
size_t SymbolGrabber::registerSymbol( SymbolToGrab aSymbol )
{
gSymbolsToGrab.emplace_back(aSymbol);
@@ -177,25 +179,22 @@ size_t SymbolGrabber::registerSymbol( SymbolToGrab aSymbol )
bool SymbolGrabber::grabSymbols(std::vector< std::string > const &aDSONames)
{
- std::cerr << "SYMBOLS: " << gSymbolsToGrab.size() << std::endl;
-
if (sSymsGrabbed)
return true;
- //attempt to load the shared libraries
- apr_pool_create(&sSymDSOMemoryPool, nullptr);
-
for( std::vector< std::string >::const_iterator itr = aDSONames.begin(); itr != aDSONames.end(); ++itr )
{
- apr_dso_handle_t *pDSO(NULL);
- std::string strDSO{ *itr };
- if( APR_SUCCESS == apr_dso_load( &pDSO, strDSO.c_str(), sSymDSOMemoryPool ))
- sLoadedLibraries.push_back( pDSO );
+ auto pDSO = dlopen( itr->c_str(), RTLD_NOW );
- for( auto i = 0; i < gSymbolsToGrab.size(); ++i )
+ if( pDSO )
{
- if( !*gSymbolsToGrab[i].mPPFunc )
- apr_dso_sym( gSymbolsToGrab[i].mPPFunc, pDSO, gSymbolsToGrab[i].mName );
+ sLoadedLibraries.push_back(pDSO);
+
+ for (auto i = 0; i < gSymbolsToGrab.size(); ++i)
+ {
+ if (!*gSymbolsToGrab[i].mPPFunc)
+ *gSymbolsToGrab[i].mPPFunc = dlsym(pDSO, gSymbolsToGrab[i].mName);
+ }
}
}
@@ -220,10 +219,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"
@@ -270,13 +267,13 @@ pid_t getParentPid( pid_t aPid )
{
std::string line;
line.resize( 1024, 0 );
- in.getline( &line[0], line.length() );
+ in.getline( &line[0], line.length() );
auto i = line.find( "PPid:" );
-
+
if( i == std::string::npos )
continue;
-
+
char const *pIn = line.c_str() + 5; // Skip over pid;
while( *pIn != 0 && isspace( *pIn ) )
++pIn;
diff --git a/indra/media_plugins/base/media_plugin_base.exp b/indra/media_plugins/base/media_plugin_base.exp
index d8c7bb712a..d8c7bb712a 100755..100644
--- a/indra/media_plugins/base/media_plugin_base.exp
+++ b/indra/media_plugins/base/media_plugin_base.exp
diff --git a/indra/media_plugins/base/media_plugin_base.h b/indra/media_plugins/base/media_plugin_base.h
index a6f3bc7d71..af431e1dc5 100644
--- a/indra/media_plugins/base/media_plugin_base.h
+++ b/indra/media_plugins/base/media_plugin_base.h
@@ -38,7 +38,7 @@ struct SymbolToGrab
{
bool mRequired;
char const *mName;
- apr_dso_handle_sym_t *mPPFunc;
+ void **mPPFunc;
};
class SymbolGrabber
@@ -52,8 +52,7 @@ private:
std::vector< SymbolToGrab > gSymbolsToGrab;
bool sSymsGrabbed = false;
- apr_pool_t *sSymDSOMemoryPool = nullptr;
- std::vector<apr_dso_handle_t *> sLoadedLibraries;
+ std::vector<void *> sLoadedLibraries;
};
extern SymbolGrabber gSymbolGrabber;
@@ -63,7 +62,7 @@ extern SymbolGrabber gSymbolGrabber;
#define LL_GRAB_SYM(SYMBOL_GRABBER, REQUIRED, SYMBOL_NAME, RETURN, ...) \
RETURN (*ll##SYMBOL_NAME)(__VA_ARGS__) = nullptr; \
size_t gRegistered##SYMBOL_NAME = SYMBOL_GRABBER.registerSymbol( \
- { REQUIRED, #SYMBOL_NAME , (apr_dso_handle_sym_t*)&ll##SYMBOL_NAME} \
+ { REQUIRED, #SYMBOL_NAME , (void**)&ll##SYMBOL_NAME} \
);
#endif
@@ -81,6 +80,7 @@ public:
static void staticReceiveMessage(const char *message_string, void **user_data);
protected:
+
/** Plugin status. */
typedef enum
{
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
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/gstreamer10/CMakeLists.txt b/indra/media_plugins/gstreamer10/CMakeLists.txt
index f9898368cc..279e07b226 100644
--- a/indra/media_plugins/gstreamer10/CMakeLists.txt
+++ b/indra/media_plugins/gstreamer10/CMakeLists.txt
@@ -1,6 +1,6 @@
# -*- cmake -*-
-project(media_plugin_gstreamer)
+project(media_plugin_gstreamer10)
include(00-Common)
include(LLCommon)
@@ -16,21 +16,20 @@ include(GStreamer10Plugin)
### media_plugin_gstreamer10
-set(${PROJECT_NAME}_SOURCE_FILES
+set(media_plugin_gstreamer10_SOURCE_FILES
media_plugin_gstreamer10.cpp
)
set(media_plugin_gstreamer10_HEADER_FILES
llmediaimplgstreamer_syms.h
- llmediaimplgstreamertriviallogging.h
)
-add_library(${PROJECT_NAME}
+add_library(media_plugin_gstreamer10
SHARED
- ${${PROJECT_NAME}_SOURCE_FILES}
+ ${media_plugin_gstreamer10_SOURCE_FILES}
)
-target_link_libraries(${PROJECT_NAME} media_plugin_base ll::gstreamer10 )
+target_link_libraries(media_plugin_gstreamer10 media_plugin_base ll::gstreamer10 )
if (WINDOWS)
set_target_properties(
@@ -39,14 +38,3 @@ if (WINDOWS)
LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT"
)
endif (WINDOWS)
-
-if (INSTALL)
- if (EXISTS ${CMAKE_SYSROOT}/usr/lib/${ARCH}-linux-gnu)
- set(_LIB lib/${ARCH}-linux-gnu)
- elseif (EXISTS /lib64)
- set(_LIB lib64)
- else ()
- set(_LIB lib)
- endif ()
- install(TARGETS ${PROJECT_NAME} DESTINATION ${_LIB})
-endif ()
diff --git a/indra/media_plugins/gstreamer10/llmediaimplgstreamer.h b/indra/media_plugins/gstreamer10/llmediaimplgstreamer.h
deleted file mode 100644
index cae11a5cb3..0000000000
--- a/indra/media_plugins/gstreamer10/llmediaimplgstreamer.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * @file llmediaimplgstreamer.h
- * @author Tofu Linden
- * @brief implementation that supports media playback via GStreamer.
- *
- * @cond
- * $LicenseInfo:firstyear=2007&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
- */
-
-// header guard
-#ifndef llmediaimplgstreamer_h
-#define llmediaimplgstreamer_h
-
-#if LL_GSTREAMER010_ENABLED
-
-extern "C" {
-#include <stdio.h>
-#include <gst/gst.h>
-
-#include "apr_pools.h"
-#include "apr_dso.h"
-}
-
-
-extern "C" {
-gboolean llmediaimplgstreamer_bus_callback (GstBus *bus,
- GstMessage *message,
- gpointer data);
-}
-
-#endif // LL_GSTREAMER010_ENABLED
-
-#endif // llmediaimplgstreamer_h
diff --git a/indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc b/indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc
index 6f5bb04bdf..e3b959f2b6 100644
--- a/indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc
+++ b/indra/media_plugins/gstreamer10/llmediaimplgstreamer_syms_raw.inc
@@ -32,7 +32,7 @@ LL_GRAB_SYM(G, false, gst_registry_fork_set_enabled, void, gboolean enabled)
LL_GRAB_SYM(G, false, gst_segtrap_set_enabled, void, gboolean enabled)
LL_GRAB_SYM(G, false, gst_message_parse_buffering, void, GstMessage *message, gint *percent)
LL_GRAB_SYM(G, false, gst_message_parse_info, void, GstMessage *message, GError **gerror, gchar **debug)
-LL_GRAB_SYM(G, false, gst_element_query_position, gboolean, GstElement *element, GstFormat *format, gint64 *cur)
+LL_GRAB_SYM(G, false, gst_element_query_position, gboolean, GstElement *element, GstFormat format, gint64 *cur)
LL_GRAB_SYM(G, false, gst_version, void, guint *major, guint *minor, guint *micro, guint *nano)
LL_GRAB_SYM(G, true, gst_message_parse_tag, void, GstMessage *, GstTagList **)
diff --git a/indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp b/indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp
index 3f636915ea..5fdea56920 100644
--- a/indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp
+++ b/indra/media_plugins/gstreamer10/media_plugin_gstreamer10.cpp
@@ -1,4 +1,4 @@
-/**
+/**
* @file media_plugin_gstreamer10.cpp
* @brief GStreamer-1.0 plugin for LLMedia API plugin system
*
@@ -6,21 +6,21 @@
* $LicenseInfo:firstyear=2016&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2016, Linden Research, Inc. / Nicky Dasmijn
- *
+ *
* 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
@@ -77,7 +77,7 @@ private:
bool navigateTo( const std::string urlIn );
bool seek( double time_sec );
bool setVolume( float volume );
-
+
// misc
bool pause();
bool stop();
@@ -86,7 +86,7 @@ private:
double MIN_LOOP_SEC = 1.0F;
U32 INTERNAL_TEXTURE_SIZE = 1024;
-
+
bool mIsLooping;
enum ECommand {
@@ -110,9 +110,9 @@ private:
void mouseMove( int x, int y );
static bool mDoneInit;
-
+
guint mBusWatchID;
-
+
float mVolume;
int mDepth;
@@ -120,10 +120,10 @@ private:
// padded texture size we need to write into
int mTextureWidth;
int mTextureHeight;
-
+
bool mSeekWanted;
double mSeekDestination;
-
+
// Very GStreamer-specific
GMainLoop *mPump; // event pump for this media
GstElement *mPlaybin;
@@ -148,7 +148,7 @@ MediaPluginGStreamer10::MediaPluginGStreamer10( LLPluginInstance::sendMessageFun
gboolean MediaPluginGStreamer10::processGSTEvents(GstBus *bus, GstMessage *message)
{
- if (!message)
+ if (!message)
return TRUE; // shield against GStreamer bug
switch (GST_MESSAGE_TYPE (message))
@@ -213,7 +213,7 @@ gboolean MediaPluginGStreamer10::processGSTEvents(GstBus *bus, GstMessage *messa
{
GError *err = nullptr;
gchar *debug = nullptr;
-
+
llgst_message_parse_info (message, &err, &debug);
if (err)
llg_error_free (err);
@@ -225,7 +225,7 @@ gboolean MediaPluginGStreamer10::processGSTEvents(GstBus *bus, GstMessage *messa
{
GError *err = nullptr;
gchar *debug = nullptr;
-
+
llgst_message_parse_warning (message, &err, &debug);
if (err)
llg_error_free (err);
@@ -239,7 +239,7 @@ gboolean MediaPluginGStreamer10::processGSTEvents(GstBus *bus, GstMessage *messa
{
double eos_pos_sec = 0.0F;
bool got_eos_position = getTimePos(eos_pos_sec);
-
+
if (got_eos_position && eos_pos_sec < MIN_LOOP_SEC)
{
// if we know that the movie is really short, don't
@@ -326,7 +326,7 @@ bool MediaPluginGStreamer10::update(int milliseconds)
return false; // error
// DEBUGMSG("updating media...");
-
+
// sanity check
if (nullptr == mPump || nullptr == mPlaybin)
{
@@ -353,13 +353,13 @@ bool MediaPluginGStreamer10::update(int milliseconds)
}
// check for availability of a new frame
-
+
if( !mAppSink )
return true;
if( GST_STATE(mPlaybin) != GST_STATE_PLAYING) // Do not try to pull a sample if not in playing state
return true;
-
+
GstSample *pSample = llgst_app_sink_pull_sample( mAppSink );
if(!pSample)
return false; // Done playing
@@ -379,7 +379,7 @@ bool MediaPluginGStreamer10::update(int milliseconds)
if( !mPixels || width == 0 || height == 0)
return true;
-
+
GstBuffer *pBuffer = llgst_sample_get_buffer ( pSample );
GstMapInfo map;
llgst_buffer_map ( pBuffer, &map, GST_MAP_READ);
@@ -396,7 +396,7 @@ bool MediaPluginGStreamer10::update(int milliseconds)
U8 *pTexelOut = mPixels + (row * mTextureWidth * mDepth );
#else
U8 *pTexelOut = mPixels + ((mTextureHeight-row-1) * mTextureWidth * mDepth );
-#endif
+#endif
for( int col = 0; col < mTextureWidth; ++col )
{
pTexelOut[ 0 ] = pTexelIn[0];
@@ -506,7 +506,7 @@ bool MediaPluginGStreamer10::getTimePos(double &sec_out)
got_position =
llgst_element_query_position &&
llgst_element_query_position(mPlaybin,
- &timefmt,
+ timefmt,
&pos);
got_position = got_position
&& (timefmt == GST_FORMAT_TIME);
@@ -527,7 +527,7 @@ bool MediaPluginGStreamer10::getTimePos(double &sec_out)
{
got_position = false;
}
-
+
}
// If all the preconditions succeeded... we can trust the result.
if (got_position)
@@ -592,7 +592,7 @@ bool MediaPluginGStreamer10::load()
setStatus(STATUS_ERROR);
return false;
}
-
+
llg_object_set(mPlaybin, "video-sink", mAppSink, nullptr);
return true;
@@ -677,7 +677,7 @@ bool MediaPluginGStreamer10::startup()
// Protect against GStreamer resetting the locale, yuck.
static std::string saved_locale;
saved_locale = setlocale(LC_ALL, nullptr);
-
+
llgst_debug_set_default_threshold( GST_LEVEL_WARNING );
llgst_debug_add_log_function( LogFunction, nullptr, nullptr );
llgst_debug_set_active( false );
@@ -699,7 +699,7 @@ bool MediaPluginGStreamer10::startup()
llg_error_free(err);
return false;
}
-
+
mDoneInit = true;
}
@@ -771,7 +771,7 @@ void MediaPluginGStreamer10::receiveMessage(const char *message_string)
{
// no response is necessary here.
double time = message_in.getValueReal("time");
-
+
// Convert time to milliseconds for update()
update((int)(time * 1000.0f));
}
@@ -863,7 +863,7 @@ void MediaPluginGStreamer10::receiveMessage(const char *message_string)
mTextureHeight = texture_height;
memset( mPixels, 0, mTextureWidth*mTextureHeight*mDepth );
}
-
+
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_request");
message.setValue("name", mTextureSegmentName);
message.setValueS32("width", INTERNAL_TEXTURE_SIZE );
@@ -876,14 +876,14 @@ void MediaPluginGStreamer10::receiveMessage(const char *message_string)
{
std::string uri = message_in.getValue("uri");
navigateTo( uri );
- sendStatus();
+ sendStatus();
}
else if(message_name == "mouse_event")
{
std::string event = message_in.getValue("event");
S32 x = message_in.getValueS32("x");
S32 y = message_in.getValueS32("y");
-
+
if(event == "down")
{
mouseDown(x, y);
@@ -948,10 +948,10 @@ int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void
MediaPluginGStreamer10 *self = new MediaPluginGStreamer10(host_send_func, host_user_data);
*plugin_send_func = MediaPluginGStreamer10::staticReceiveMessage;
*plugin_user_data = (void*)self;
-
+
return 0; // okay
}
- else
+ else
{
return -1; // failed to init
}
diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt
index e99f25a1df..61801fbcb7 100644
--- a/indra/media_plugins/libvlc/CMakeLists.txt
+++ b/indra/media_plugins/libvlc/CMakeLists.txt
@@ -43,42 +43,70 @@ 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 ${PROJECT_NAME}
- POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL}
- -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"
- -change "@rpath/libvlc.dylib" "@loader_path/plugins/libvlc.dylib"
- -change "@rpath/libvlccore.dylib" "@loader_path/plugins/libvlccore.dylib"
- "$<TARGET_FILE:media_plugin_libvlc>"
- VERBATIM
- COMMENT "Fixing paths to LibVLC media plugin dependencies"
- )
+ 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"
+ -change "@rpath/libvlc.dylib" "@loader_path/plugins/libvlc.dylib"
+ -change "@rpath/libvlccore.dylib" "@loader_path/plugins/libvlccore.dylib"
+ "$<TARGET_FILE:${PROJECT_NAME}>"
+ VERBATIM
+ COMMENT "Fixing paths to LibVLC 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"
+ -change "@rpath/libvlc.dylib" "@loader_path/plugins/libvlc.dylib"
+ -change "@rpath/libvlccore.dylib" "@loader_path/plugins/libvlccore.dylib"
+ "$<TARGET_FILE:${PROJECT_NAME}>"
+ VERBATIM
+ COMMENT "Fixing paths to LibVLC media plugin dependencies"
+ )
+ endif ()
endif (DARWIN)
+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 /Volumes/VLC\ media\ player/VLC.app/Contents/MacOS/plugins
DESTINATION ${_LIB}
@@ -91,12 +119,33 @@ if (INSTALL)
/Volumes/VLC\ media\ player/VLC.app/Contents/MacOS/lib/libvlccore.dylib
DESTINATION ${_LIB}/plugins
)
+ elseif (${LINUX_DISTRO} MATCHES freedesktop)
+ set(_LIB lib)
+ install(
+ DIRECTORY ${ARCH_PREBUILT_DIRS_RELEASE}/vlc
+ DESTINATION ${_LIB}
+ )
+ install(
+ FILES
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libvlc.so
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libvlc.so.5
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libvlc.so.5.6.1
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libvlccore.so
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libvlccore.so.9
+ ${ARCH_PREBUILT_DIRS_RELEASE}/libvlccore.so.9.0.1
+ DESTINATION ${_LIB}
+ )
elseif (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu))
- set(_LIB lib/${ARCH}-linux-gnu)
+ 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})
- else (DARWIN)
- set(_LIB lib)
- endif (DARWIN)
- install(TARGETS ${PROJECT_NAME} DESTINATION ${_LIB})
-endif (INSTALL)
+ set(_LIB lib${ADDRESS_SIZE}/${VIEWER_BINARY_NAME})
+ else ()
+ set(_LIB lib/${VIEWER_BINARY_NAME})
+ 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 e79d474325..f60db02610 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);
@@ -191,7 +191,11 @@ void MediaPluginLibVLC::initVLC()
//
void MediaPluginLibVLC::resetVLC()
{
+#if LIBVLC_VERSION_MAJOR < 4
libvlc_media_player_stop(mLibVLCMediaPlayer);
+#else
+ libvlc_media_player_stop_async(mLibVLCMediaPlayer);
+#endif
libvlc_media_player_release(mLibVLCMediaPlayer);
libvlc_release(mLibVLC);
}
@@ -258,7 +262,11 @@ void MediaPluginLibVLC::eventCallbacks(const libvlc_event_t* event, void* ptr)
parent->mVlcStatus = STATUS_DONE;
break;
+#if LIBVLC_VERSION_MAJOR < 4
case libvlc_MediaPlayerEndReached:
+#else
+ case libvlc_MediaPlayerStopping:
+#endif
parent->mVlcStatus = STATUS_DONE;
parent->mCurTime = parent->mDuration;
parent->setDurationDirty();
@@ -285,6 +293,7 @@ void MediaPluginLibVLC::eventCallbacks(const libvlc_event_t* event, void* ptr)
parent->setDurationDirty();
break;
+#if LIBVLC_VERSION_MAJOR < 4
case libvlc_MediaPlayerTitleChanged:
{
char* title = libvlc_media_get_meta(parent->mLibVLCMedia, libvlc_meta_Title);
@@ -294,6 +303,7 @@ void MediaPluginLibVLC::eventCallbacks(const libvlc_event_t* event, void* ptr)
}
}
break;
+#endif
case libvlc_MediaMetaChanged:
auto title = libvlc_media_get_meta(parent->mLibVLCMedia, libvlc_meta_Title);
if (title)
@@ -331,10 +341,18 @@ void MediaPluginLibVLC::playMedia()
// memory.
if (mLibVLCMediaPlayer)
{
+#if LIBVLC_VERSION_MAJOR < 4
libvlc_media_player_stop(mLibVLCMediaPlayer);
+#else
+ libvlc_media_player_stop_async(mLibVLCMediaPlayer);
+#endif
}
+#if LIBVLC_VERSION_MAJOR < 4
mLibVLCMedia = libvlc_media_new_location(mLibVLC, mURL.c_str());
+#else
+ mLibVLCMedia = libvlc_media_new_location(mURL.c_str());
+#endif
if (!mLibVLCMedia)
{
mLibVLCMediaPlayer = 0;
@@ -342,7 +360,11 @@ void MediaPluginLibVLC::playMedia()
return;
}
+#if LIBVLC_VERSION_MAJOR < 4
mLibVLCMediaPlayer = libvlc_media_player_new_from_media(mLibVLCMedia);
+#else
+ mLibVLCMediaPlayer = libvlc_media_player_new_from_media(mLibVLC, mLibVLCMedia);
+#endif
if (!mLibVLCMediaPlayer)
{
setStatus(STATUS_ERROR);
@@ -357,12 +379,18 @@ void MediaPluginLibVLC::playMedia()
libvlc_event_attach(em, libvlc_MediaPlayerPlaying, eventCallbacks, this);
libvlc_event_attach(em, libvlc_MediaPlayerPaused, eventCallbacks, this);
libvlc_event_attach(em, libvlc_MediaPlayerStopped, eventCallbacks, this);
+#if LIBVLC_VERSION_MAJOR < 4
libvlc_event_attach(em, libvlc_MediaPlayerEndReached, eventCallbacks, this);
+#else
+ libvlc_event_attach(em, libvlc_MediaPlayerStopping, eventCallbacks, this);
+#endif
libvlc_event_attach(em, libvlc_MediaPlayerEncounteredError, eventCallbacks, this);
libvlc_event_attach(em, libvlc_MediaPlayerTimeChanged, eventCallbacks, this);
libvlc_event_attach(em, libvlc_MediaPlayerPositionChanged, eventCallbacks, this);
libvlc_event_attach(em, libvlc_MediaPlayerLengthChanged, eventCallbacks, this);
+#if LIBVLC_VERSION_MAJOR < 4
libvlc_event_attach(em, libvlc_MediaPlayerTitleChanged, eventCallbacks, this);
+#endif
}
auto event_manager = libvlc_media_event_manager(mLibVLCMedia);
if (event_manager)
@@ -548,7 +576,11 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string)
{
if (mPixels == iter->second.mAddress)
{
+#if LIBVLC_VERSION_MAJOR < 4
libvlc_media_player_stop(mLibVLCMediaPlayer);
+#else
+ libvlc_media_player_stop_async(mLibVLCMediaPlayer);
+#endif
libvlc_media_player_release(mLibVLCMediaPlayer);
mLibVLCMediaPlayer = 0;
@@ -581,7 +613,7 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string)
message.setValueS32("default_height", 1024);
message.setValueS32("depth", mDepth);
message.setValueU32("internalformat", GL_RGB);
- message.setValueU32("format", GL_BGRA_EXT);
+ message.setValueU32("format", GL_BGRA);
message.setValueU32("type", GL_UNSIGNED_BYTE);
message.setValueBoolean("coords_opengl", true);
sendMessage(message);
@@ -612,7 +644,11 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string)
if (mLibVLCMediaPlayer)
{
+#if LIBVLC_VERSION_MAJOR < 4
libvlc_media_player_set_time(mLibVLCMediaPlayer, time);
+#else
+ libvlc_media_player_set_time(mLibVLCMediaPlayer, time, true);
+#endif
time = libvlc_media_player_get_time(mLibVLCMediaPlayer);
if (time < 0)
{
@@ -648,7 +684,11 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string)
{
if (mLibVLCMediaPlayer)
{
+#if LIBVLC_VERSION_MAJOR < 4
libvlc_media_player_stop(mLibVLCMediaPlayer);
+#else
+ libvlc_media_player_stop_async(mLibVLCMediaPlayer);
+#endif
}
}
else if (message_name == "start")
@@ -658,9 +698,13 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string)
if (mVlcStatus == STATUS_DONE && !libvlc_media_player_is_playing(mLibVLCMediaPlayer))
{
// stop or vlc will ignore 'play', it will just
- // make an MediaPlayerEndReached event even if
+ // make an MediaPlayerEndReached/MediaPlayerStopping event even if
// seek was used
+#if LIBVLC_VERSION_MAJOR < 4
libvlc_media_player_stop(mLibVLCMediaPlayer);
+#else
+ libvlc_media_player_stop_async(mLibVLCMediaPlayer);
+#endif
}
libvlc_media_player_play(mLibVLCMediaPlayer);
}
@@ -677,7 +721,11 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string)
if (mLibVLCMediaPlayer)
{
libvlc_time_t time = (libvlc_time_t)(1000.0 * message_in.getValueReal("time"));
+#if LIBVLC_VERSION_MAJOR < 4
libvlc_media_player_set_time(mLibVLCMediaPlayer, time);
+#else
+ libvlc_media_player_set_time(mLibVLCMediaPlayer, time, true);
+#endif
time = libvlc_media_player_get_time(mLibVLCMediaPlayer);
if (time < 0)
{