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 ++++ linden/indra/newview/llappviewer.cpp | 26 -------------------------- linden/indra/newview/llappviewer.h | 2 -- 4 files changed, 31 insertions(+), 28 deletions(-) (limited to 'linden') 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(); diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 15ce1a3..6d87ca8 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -320,30 +320,6 @@ std::vector gLoginURIs; static std::string gHelperURI; -void LLAppViewer::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 -} - void idle_afk_check() { // check idle timers @@ -643,8 +619,6 @@ bool LLAppViewer::init() LL_VERSION_PATCH, LL_VERSION_BUILD ); - gst_plugin_path(); - ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// diff --git a/linden/indra/newview/llappviewer.h b/linden/indra/newview/llappviewer.h index 2083a93..58dc835 100644 --- a/linden/indra/newview/llappviewer.h +++ b/linden/indra/newview/llappviewer.h @@ -138,8 +138,6 @@ public: protected: - void gst_plugin_path(); // Sets GST_PLUGIN_PATH environment variable for GStreamer. - virtual bool initWindow(); // Initialize the viewer's window. virtual bool initLogging(); // Initialize log files, logging system, return false on failure. virtual void initConsole() {}; // Initialize OS level debugging console. -- cgit v1.1