diff options
-rw-r--r-- | ChangeLog.txt | 25 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.cpp | 71 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.h | 4 | ||||
-rw-r--r-- | linden/indra/newview/llappviewer.cpp | 26 | ||||
-rw-r--r-- | linden/indra/newview/llappviewer.h | 2 |
5 files changed, 100 insertions, 28 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 5513449..74ca768 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt | |||
@@ -12,6 +12,31 @@ | |||
12 | Removed the "2.0.0" named glib libs. Only using "2.0" now. | 12 | Removed the "2.0.0" named glib libs. Only using "2.0" now. |
13 | 13 | ||
14 | 14 | ||
15 | 2009-03-28 Jacek Antonelli <jacek.antonelli@gmail.com> | ||
16 | |||
17 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | ||
18 | Improved set_gst_plugin_path, more comprehensive path. | ||
19 | Also tried to tidy up a bit. | ||
20 | |||
21 | |||
22 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | ||
23 | Moved Windows GST_PLUGIN_PATH setup to LLMediaImplGStreamer. | ||
24 | LLAppViewer::gst_plugin_path --> | ||
25 | LLMediaImplGStreamer::set_gst_plugin_path | ||
26 | |||
27 | |||
28 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | ||
29 | Ditto. | ||
30 | * linden/indra/newview/llappviewer.h: | ||
31 | Ditto. | ||
32 | * linden/indra/newview/llappviewer.cpp: | ||
33 | Ditto. | ||
34 | |||
35 | |||
36 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | ||
37 | Print out the plugins gstreamer finds, for debugging. | ||
38 | |||
39 | |||
15 | 2009-03-26 Jacek Antonelli <jacek.antonelli@gmail.com> | 40 | 2009-03-26 Jacek Antonelli <jacek.antonelli@gmail.com> |
16 | 41 | ||
17 | * linden/indra/llmedia/llmediaimplgstreamervidplug.cpp: | 42 | * linden/indra/llmedia/llmediaimplgstreamervidplug.cpp: |
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index 5d4d553..9a51b7f 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp | |||
@@ -164,6 +164,8 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data) | |||
164 | // Init the glib type system - we need it. | 164 | // Init the glib type system - we need it. |
165 | g_type_init(); | 165 | g_type_init(); |
166 | 166 | ||
167 | set_gst_plugin_path(); | ||
168 | |||
167 | // Protect against GStreamer resetting the locale, yuck. | 169 | // Protect against GStreamer resetting the locale, yuck. |
168 | static std::string saved_locale; | 170 | static std::string saved_locale; |
169 | saved_locale = setlocale(LC_ALL, NULL); | 171 | saved_locale = setlocale(LC_ALL, NULL); |
@@ -178,12 +180,81 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data) | |||
178 | // Init our custom plugins - only really need do this once. | 180 | // Init our custom plugins - only really need do this once. |
179 | gst_slvideo_init_class(); | 181 | gst_slvideo_init_class(); |
180 | 182 | ||
183 | |||
184 | // List the plugins GStreamer can find | ||
185 | LL_DEBUGS("MediaImpl") << "Found GStreamer plugins:" << LL_ENDL; | ||
186 | GList *list; | ||
187 | GstRegistry *registry = gst_registry_get_default(); | ||
188 | for (list = gst_registry_get_plugin_list(registry); | ||
189 | list != NULL; | ||
190 | list = g_list_next(list)) | ||
191 | { | ||
192 | GstPlugin *list_plugin = (GstPlugin *)list->data; | ||
193 | LL_DEBUGS("MediaImpl") << gst_plugin_get_name(list_plugin) << LL_ENDL; | ||
194 | } | ||
195 | gst_plugin_list_free(list); | ||
196 | |||
197 | |||
181 | done_init = true; | 198 | done_init = true; |
182 | } | 199 | } |
183 | return true; | 200 | return true; |
184 | } | 201 | } |
185 | 202 | ||
186 | 203 | ||
204 | void LLMediaImplGStreamer::set_gst_plugin_path() | ||
205 | { | ||
206 | // Only needed for Windows. | ||
207 | // Linux sets in wrapper.sh, Mac sets in Info-Imprudence.plist | ||
208 | #ifdef LL_WINDOWS | ||
209 | |||
210 | char* imp_cwd; | ||
211 | |||
212 | // Get the current working directory: | ||
213 | imp_cwd = _getcwd(NULL,0); | ||
214 | |||
215 | if(imp_cwd == NULL) | ||
216 | { | ||
217 | LL_DEBUGS("LLMediaImpl") << "_getcwd failed, not setting GST_PLUGIN_PATH." | ||
218 | << LL_ENDL; | ||
219 | } | ||
220 | else | ||
221 | { | ||
222 | LL_DEBUGS("LLMediaImpl") << "Imprudence is installed at " | ||
223 | << imp_cwd << LL_ENDL; | ||
224 | |||
225 | // Grab the current path, if it's set. | ||
226 | std::string old_plugin_path = ""; | ||
227 | char *old_path = getenv("GST_PLUGIN_PATH"); | ||
228 | if(old_path == NULL) | ||
229 | { | ||
230 | LL_DEBUGS("LLMediaImpl") << "Did not find user-set GST_PLUGIN_PATH." | ||
231 | << LL_ENDL; | ||
232 | } | ||
233 | else | ||
234 | { | ||
235 | old_plugin_path = std::string( old_path ) + ":"; | ||
236 | } | ||
237 | |||
238 | |||
239 | // Search both Imprudence and Imprudence\lib\gstreamer-plugins. | ||
240 | // But we also want to first search the path the user has set, if any. | ||
241 | std::string plugin_path = | ||
242 | "GST_PLUGIN_PATH=" + | ||
243 | old_plugin_path + | ||
244 | std::string(imp_cwd) + ":" + | ||
245 | std::string(imp_cwd) + "\\lib\\gstreamer-plugins"; | ||
246 | |||
247 | // Place GST_PLUGIN_PATH in the environment settings for imprudence.exe | ||
248 | putenv( (char*)plugin_path.c_str() ); | ||
249 | |||
250 | LL_DEBUGS("LLMediaImpl") << "GST_PLUGIN_PATH set to " | ||
251 | << getenv("GST_PLUGIN_PATH") << LL_ENDL; | ||
252 | } | ||
253 | |||
254 | #endif //LL_WINDOWS | ||
255 | } | ||
256 | |||
257 | |||
187 | bool LLMediaImplGStreamer::closedown() | 258 | bool LLMediaImplGStreamer::closedown() |
188 | { | 259 | { |
189 | return true; | 260 | 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: | |||
66 | static bool startup( LLMediaManagerData* init_data ); | 66 | static bool startup( LLMediaManagerData* init_data ); |
67 | static bool closedown(); | 67 | static bool closedown(); |
68 | 68 | ||
69 | // Sets GST_PLUGIN_PATH env var for GStreamer. | ||
70 | static void set_gst_plugin_path(); | ||
71 | |||
69 | /* virtual */ std::string getVersion(); | 72 | /* virtual */ std::string getVersion(); |
70 | /* virtual */ bool navigateTo( const std::string url ); | 73 | /* virtual */ bool navigateTo( const std::string url ); |
71 | /* virtual */ bool updateMedia(); | 74 | /* virtual */ bool updateMedia(); |
@@ -79,6 +82,7 @@ class LLMediaImplGStreamer: | |||
79 | LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;}; | 82 | LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;}; |
80 | 83 | ||
81 | private: | 84 | private: |
85 | |||
82 | // misc | 86 | // misc |
83 | bool unload(); | 87 | bool unload(); |
84 | bool pause(); | 88 | 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<std::string> gLoginURIs; | |||
320 | static std::string gHelperURI; | 320 | static std::string gHelperURI; |
321 | 321 | ||
322 | 322 | ||
323 | void LLAppViewer::gst_plugin_path() | ||
324 | { | ||
325 | #ifdef LL_WINDOWS | ||
326 | char* buffer; | ||
327 | |||
328 | // Get the current working directory: | ||
329 | if((buffer = _getcwd(NULL,0)) == NULL) | ||
330 | { | ||
331 | LL_INFOS("InitInfo") << "_getcwd error" << LL_ENDL; | ||
332 | } | ||
333 | else | ||
334 | { | ||
335 | LL_INFOS("InitInfo") << "Imprudence is installed at " << buffer << LL_ENDL; | ||
336 | |||
337 | std::string plugin_path = "GST_PLUGIN_PATH=" + std::string(buffer) + "\\lib\\gstreamer-plugins"; | ||
338 | |||
339 | // Place GST_PLUGIN_PATH in the environment settings for imprudence.exe | ||
340 | const char* gst_plugin_path = plugin_path.c_str(); | ||
341 | putenv(gst_plugin_path); | ||
342 | LL_INFOS("InitInfo") << "GST_PLUGIN_PATH set to " << getenv("GST_PLUGIN_PATH") << LL_ENDL; | ||
343 | } | ||
344 | #endif //LL_WINDOWS | ||
345 | } | ||
346 | |||
347 | void idle_afk_check() | 323 | void idle_afk_check() |
348 | { | 324 | { |
349 | // check idle timers | 325 | // check idle timers |
@@ -643,8 +619,6 @@ bool LLAppViewer::init() | |||
643 | LL_VERSION_PATCH, | 619 | LL_VERSION_PATCH, |
644 | LL_VERSION_BUILD ); | 620 | LL_VERSION_BUILD ); |
645 | 621 | ||
646 | gst_plugin_path(); | ||
647 | |||
648 | ////////////////////////////////////////////////////////////////////////////// | 622 | ////////////////////////////////////////////////////////////////////////////// |
649 | ////////////////////////////////////////////////////////////////////////////// | 623 | ////////////////////////////////////////////////////////////////////////////// |
650 | ////////////////////////////////////////////////////////////////////////////// | 624 | ////////////////////////////////////////////////////////////////////////////// |
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: | |||
138 | 138 | ||
139 | protected: | 139 | protected: |
140 | 140 | ||
141 | void gst_plugin_path(); // Sets GST_PLUGIN_PATH environment variable for GStreamer. | ||
142 | |||
143 | virtual bool initWindow(); // Initialize the viewer's window. | 141 | virtual bool initWindow(); // Initialize the viewer's window. |
144 | virtual bool initLogging(); // Initialize log files, logging system, return false on failure. | 142 | virtual bool initLogging(); // Initialize log files, logging system, return false on failure. |
145 | virtual void initConsole() {}; // Initialize OS level debugging console. | 143 | virtual void initConsole() {}; // Initialize OS level debugging console. |