summaryrefslogtreecommitdiff
path: root/indra/media_plugins
diff options
context:
space:
mode:
Diffstat (limited to 'indra/media_plugins')
-rw-r--r--indra/media_plugins/cef/CMakeLists.txt15
-rw-r--r--indra/media_plugins/libvlc/media_plugin_libvlc.cpp50
2 files changed, 53 insertions, 12 deletions
diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt
index 042b658d75..a815b1cf4f 100644
--- a/indra/media_plugins/cef/CMakeLists.txt
+++ b/indra/media_plugins/cef/CMakeLists.txt
@@ -37,7 +37,8 @@ if (LINUX)
include(FindPipeWire)
include_directories(SYSTEM ${PIPEWIRE_INCLUDE_DIRS} ${SPA_INCLUDE_DIRS})
- message( "Building with Linux volume catcher for PipeWire and PulseAudio" )
+ #message( "Building with Linux volume catcher for PipeWire and PulseAudio" )
+ message( "Building with Linux volume catcher for PulseAudio" )
list(APPEND media_plugin_cef_HEADER_FILES
linux/volume_catcher_linux.h
@@ -46,14 +47,9 @@ if (LINUX)
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 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 )
@@ -76,9 +72,7 @@ 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 ()
+#target_compile_definitions(media_plugin_cef PRIVATE USE_VOLUME_CATCHER_PW=1)
#add_dependencies(media_plugin_cef
# ${MEDIA_PLUGIN_BASE_LIBRARIES}
@@ -214,7 +208,6 @@ if (INSTALL)
${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
)
diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
index 3fe2c2b193..edf93f359a 100644
--- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
+++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
@@ -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;
@@ -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)
{