diff options
| author | Erik Kundiman <erik@megapahit.org> | 2026-09-01 18:35:23 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2026-09-04 21:58:53 +0800 |
| commit | 00bb3bb6f07660bd914d29a1389342bb3060d254 (patch) | |
| tree | 431f574922494d2201718f13085f17bc6bd7fb42 /indra/media_plugins | |
| parent | a8636720129952c10cf49ab80da21bf8b340b96c (diff) | |
| parent | 4ef9f8f14b35ed388c294d53767a0dca0e890924 (diff) | |
Merge remote-tracking branch 'secondlife/release/26.4' into 26.4
Diffstat (limited to 'indra/media_plugins')
18 files changed, 115 insertions, 181 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/media_plugin_base.cpp b/indra/media_plugins/base/media_plugin_base.cpp index 2d55f99dbe..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); + } } } @@ -268,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 666826dc89..88ce911dc4 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,42 +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 ) list(APPEND media_plugin_cef_SOURCE_FILES ${LINUX_VOLUME_CATCHER}) - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id") 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 () - 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 - ) 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}) @@ -77,10 +69,6 @@ add_library(media_plugin_cef ${media_plugin_cef_SOURCE_FILES} ) -#add_dependencies(media_plugin_cef -# ${MEDIA_PLUGIN_BASE_LIBRARIES} -#) - target_link_libraries(media_plugin_cef media_plugin_base ll::cef @@ -97,9 +85,15 @@ if (WINDOWS) 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 @@ -120,6 +114,7 @@ if (DARWIN) -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" @@ -131,7 +126,9 @@ if (DARWIN) COMMENT "Fixing paths to CEF media plugin dependencies" ) -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( diff --git a/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp b/indra/media_plugins/cef/linux/volume_catcher_pipewire.cpp index 04bbbcff6c..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 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 d5ec3dbb20..0d7da6bd58 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -118,6 +118,7 @@ private: std::string mContextCachePath; std::string mCefLogFile; bool mCefLogVerbose; + U32 mCefRemoteDebuggingPort; std::vector<std::string> mPickedFiles; VolumeCatcher mVolumeCatcher; F32 mCurVolume; @@ -159,6 +160,7 @@ MediaPluginBase(host_send_func, host_user_data) mCanSelectAll = false; mCefLogFile = ""; mCefLogVerbose = false; + mCefRemoteDebuggingPort = 0; mPickedFiles.clear(); mCurVolume = 0.0; @@ -711,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"); @@ -775,6 +779,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) 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") { 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/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 ae0b35b1b0..32a108429e 100644 --- a/indra/media_plugins/libvlc/CMakeLists.txt +++ b/indra/media_plugins/libvlc/CMakeLists.txt @@ -57,6 +57,7 @@ if (DARWIN) -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" diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index edf93f359a..f60db02610 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -613,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); |
