summaryrefslogtreecommitdiff
path: root/indra/media_plugins
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-02-27 17:29:30 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-02-27 17:29:30 +0000
commit753ddd771499257297fa8dfda6749854b4b2eeb9 (patch)
treecc125ec493e11ecc7ac4e086a7aae0a237b78b42 /indra/media_plugins
parent36acc8f2a5fd95991c6fd84fa0480f23c9497e89 (diff)
give audio visualization on faces with audio-only media. linux/gstreamer only.
Diffstat (limited to 'indra/media_plugins')
-rw-r--r--indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp
index 26173314a7..fb13b025c0 100644
--- a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp
+++ b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp
@@ -141,6 +141,7 @@ private:
// Very GStreamer-specific
GMainLoop *mPump; // event pump for this media
GstElement *mPlaybin;
+ GstElement *mVisualizer;
GstSLVideo *mVideoSink;
};
@@ -159,6 +160,7 @@ MediaPluginGStreamer010::MediaPluginGStreamer010(
mSeekDestination(0.0),
mPump ( NULL ),
mPlaybin ( NULL ),
+ mVisualizer ( NULL ),
mVideoSink ( NULL ),
mCommand ( COMMAND_NONE )
{
@@ -686,6 +688,33 @@ MediaPluginGStreamer010::load()
this);
llgst_object_unref (bus);
+ // get a visualizer element (bonus feature!)
+ char* vis_name = getenv("LL_GST_VIS_NAME");
+ if (!visname ||
+ (vis_name && std::string(vis_name)!="none"))
+ {
+ if (vis_name)
+ {
+ mVisualizer = llgst_element_factory_make (vis_name, "vis");
+ }
+ if (!mVisualizer)
+ {
+ mVisualizer = llgst_element_factory_make ("libvisual_jess", "vis");
+ if (!mVisualizer)
+ {
+ mVisualizer = llgst_element_factory_make ("goom", "vis");
+ if (!mVisualizer)
+ {
+ mVisualizer = llgst_element_factory_make ("libvisual_lv_scope", "vis");
+ if (!mVisualizer)
+ {
+ // That's okay, we don't NEED this.
+ }
+ }
+ }
+ }
+ }
+
if (NULL == getenv("LL_GSTREAMER_EXTERNAL")) {
// instantiate a custom video sink
mVideoSink =
@@ -702,6 +731,11 @@ MediaPluginGStreamer010::load()
g_object_set(mPlaybin, "video-sink", mVideoSink, NULL);
}
+ if (mVisualizer)
+ {
+ g_object_set(mPlaybin, "vis-plugin", mVisualizer, NULL);
+ }
+
return true;
}
@@ -724,6 +758,12 @@ MediaPluginGStreamer010::unload ()
mPlaybin = NULL;
}
+ if (mVisualizer)
+ {
+ llgst_object_unref (GST_OBJECT (mVisualizer));
+ mVisualizer = NULL;
+ }
+
if (mPump)
{
g_main_loop_quit(mPump);