diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-03-11 17:42:45 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-03-11 17:42:45 +0000 |
commit | 88386000af9fb830e61b29494a568e0fa2355f5a (patch) | |
tree | 435961f02281daf8a8c141865356e8c826595a5f /indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp | |
parent | 4a46fb0f86a043714ef54d302d790b069f888653 (diff) | |
parent | 1b1dd127a4329cc7fed9d36608f4fc04ff056843 (diff) |
Merge some stuff I'd been saving for viewer 2.1.
Diffstat (limited to 'indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp')
-rw-r--r-- | indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp | 40 |
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..4c2dd64bb6 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 (!vis_name || + (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); |