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 | |
parent | 4a46fb0f86a043714ef54d302d790b069f888653 (diff) | |
parent | 1b1dd127a4329cc7fed9d36608f4fc04ff056843 (diff) |
Merge some stuff I'd been saving for viewer 2.1.
-rw-r--r-- | indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp | 40 | ||||
-rw-r--r-- | indra/newview/llurldispatcher.cpp | 60 |
2 files changed, 56 insertions, 44 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); diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 0b6bd4b401..b88069cd48 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -180,6 +180,16 @@ bool LLURLDispatcherImpl::dispatchRegion(const std::string& url, bool right_mous return false; } + std::string sim_string = LLSLURL::stripProtocol(url); + std::string region_name; + S32 x = 128; + S32 y = 128; + S32 z = 0; + if (! LLURLSimString::parse(sim_string, ®ion_name, &x, &y, &z)) + { + return false; + } + // Before we're logged in, need to update the startup screen // to tell the user where they are going. if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) @@ -194,22 +204,15 @@ bool LLURLDispatcherImpl::dispatchRegion(const std::string& url, bool right_mous return true; } - std::string sim_string = LLSLURL::stripProtocol(url); - std::string region_name; - S32 x = 128; - S32 y = 128; - S32 z = 0; - LLURLSimString::parse(sim_string, ®ion_name, &x, &y, &z); - // LLFloaterURLDisplay functionality moved to LLPanelPlaces in Side Tray. //LLFloaterURLDisplay* url_displayp = LLFloaterReg::getTypedInstance<LLFloaterURLDisplay>("preview_url",LLSD()); //if(url_displayp) url_displayp->setName(region_name); // Request a region handle by name LLWorldMapMessage::getInstance()->sendNamedRegionRequest(region_name, - LLURLDispatcherImpl::regionNameCallback, - url, - false); // don't teleport + LLURLDispatcherImpl::regionNameCallback, + url, + false); // don't teleport return true; } @@ -221,34 +224,11 @@ void LLURLDispatcherImpl::regionNameCallback(U64 region_handle, const std::strin S32 x = 128; S32 y = 128; S32 z = 0; - LLURLSimString::parse(sim_string, ®ion_name, &x, &y, &z); - - LLVector3 local_pos; - local_pos.mV[VX] = (F32)x; - local_pos.mV[VY] = (F32)y; - local_pos.mV[VZ] = (F32)z; - - // determine whether the point is in this region - if ((x >= 0) && (x < REGION_WIDTH_UNITS) && - (y >= 0) && (y < REGION_WIDTH_UNITS)) + if (LLURLSimString::parse(sim_string, ®ion_name, &x, &y, &z)) { - // if so, we're done regionHandleCallback(region_handle, url, snapshot_id, teleport); } - - else - { - // otherwise find the new region from the location - - // add the position to get the new region - LLVector3d global_pos = from_region_handle(region_handle) + LLVector3d(local_pos); - - U64 new_region_handle = to_region_handle(global_pos); - LLWorldMapMessage::getInstance()->sendHandleRegionRequest(new_region_handle, - LLURLDispatcherImpl::regionHandleCallback, - url, teleport); - } } /* static */ @@ -261,17 +241,9 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const std::str S32 z = 0; LLURLSimString::parse(sim_string, ®ion_name, &x, &y, &z); - // remap x and y to local coordinates - S32 local_x = x % REGION_WIDTH_UNITS; - S32 local_y = y % REGION_WIDTH_UNITS; - if (local_x < 0) - local_x += REGION_WIDTH_UNITS; - if (local_y < 0) - local_y += REGION_WIDTH_UNITS; - LLVector3 local_pos; - local_pos.mV[VX] = (F32)local_x; - local_pos.mV[VY] = (F32)local_y; + local_pos.mV[VX] = (F32)x; + local_pos.mV[VY] = (F32)y; local_pos.mV[VZ] = (F32)z; LLVector3d global_pos = from_region_handle(region_handle); |