summaryrefslogtreecommitdiff
path: root/indra/media_plugins/gstreamer10
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2026-09-01 18:35:23 +0800
committerErik Kundiman <erik@megapahit.org>2026-09-04 21:58:53 +0800
commit00bb3bb6f07660bd914d29a1389342bb3060d254 (patch)
tree431f574922494d2201718f13085f17bc6bd7fb42 /indra/media_plugins/gstreamer10
parenta8636720129952c10cf49ab80da21bf8b340b96c (diff)
parent4ef9f8f14b35ed388c294d53767a0dca0e890924 (diff)
Merge remote-tracking branch 'secondlife/release/26.4' into 26.4
Diffstat (limited to 'indra/media_plugins/gstreamer10')
-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
4 files changed, 37 insertions, 102 deletions
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
}