From 6542894a75f826203cab1ae482fdf5187be09205 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 28 Mar 2009 18:53:52 -0500 Subject: Moved Windows GST_PLUGIN_PATH setup to LLMediaImplGStreamer. LLAppViewer::gst_plugin_path --> LLMediaImplGStreamer::set_gst_plugin_path --- linden/indra/llmedia/llmediaimplgstreamer.cpp | 27 +++++++++++++++++++++++++++ linden/indra/llmedia/llmediaimplgstreamer.h | 4 ++++ 2 files changed, 31 insertions(+) (limited to 'linden/indra/llmedia') diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index d661f74..ed7b36e 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp @@ -164,6 +164,8 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data) // Init the glib type system - we need it. g_type_init(); + set_gst_plugin_path(); + // Protect against GStreamer resetting the locale, yuck. static std::string saved_locale; saved_locale = setlocale(LC_ALL, NULL); @@ -199,6 +201,31 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data) } +void LLMediaImplGStreamer::set_gst_plugin_path() +{ +#ifdef LL_WINDOWS + char* buffer; + + // Get the current working directory: + if((buffer = _getcwd(NULL,0)) == NULL) + { + LL_INFOS("InitInfo") << "_getcwd error" << LL_ENDL; + } + else + { + LL_INFOS("InitInfo") << "Imprudence is installed at " << buffer << LL_ENDL; + + std::string plugin_path = "GST_PLUGIN_PATH=" + std::string(buffer) + "\\lib\\gstreamer-plugins"; + + // Place GST_PLUGIN_PATH in the environment settings for imprudence.exe + const char* gst_plugin_path = plugin_path.c_str(); + putenv(gst_plugin_path); + LL_INFOS("InitInfo") << "GST_PLUGIN_PATH set to " << getenv("GST_PLUGIN_PATH") << LL_ENDL; + } +#endif //LL_WINDOWS +} + + bool LLMediaImplGStreamer::closedown() { return true; diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h index dec970a..2918416 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.h +++ b/linden/indra/llmedia/llmediaimplgstreamer.h @@ -66,6 +66,9 @@ class LLMediaImplGStreamer: static bool startup( LLMediaManagerData* init_data ); static bool closedown(); + // Sets GST_PLUGIN_PATH env var for GStreamer. + static void set_gst_plugin_path(); + /* virtual */ std::string getVersion(); /* virtual */ bool navigateTo( const std::string url ); /* virtual */ bool updateMedia(); @@ -79,6 +82,7 @@ class LLMediaImplGStreamer: LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;}; private: + // misc bool unload(); bool pause(); -- cgit v1.1