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 0a3a9be..bd95bce 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt | |||
@@ -1,3 +1,28 @@ | |||
1 | 2009-03-28 Jacek Antonelli <jacek.antonelli@gmail.com> | ||
2 | |||
3 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | ||
4 | Improved set_gst_plugin_path, more comprehensive path. | ||
5 | Also tried to tidy up a bit. | ||
6 | |||
7 | |||
8 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | ||
9 | Moved Windows GST_PLUGIN_PATH setup to LLMediaImplGStreamer. | ||
10 | LLAppViewer::gst_plugin_path --> | ||
11 | LLMediaImplGStreamer::set_gst_plugin_path | ||
12 | |||
13 | |||
14 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | ||
15 | Ditto. | ||
16 | * linden/indra/newview/llappviewer.h: | ||
17 | Ditto. | ||
18 | * linden/indra/newview/llappviewer.cpp: | ||
19 | Ditto. | ||
20 | |||
21 | |||
22 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | ||
23 | Print out the plugins gstreamer finds, for debugging. | ||
24 | |||
25 | |||
1 | 2009-03-27 McCabe Maxsted <hakushakukun@gmail.com> | 26 | 2009-03-27 McCabe Maxsted <hakushakukun@gmail.com> |
2 | 27 | ||
3 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | 28 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: |
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index e38dc29..debc95c 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp | |||
@@ -175,6 +175,8 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data) | |||
175 | // Init the glib type system - we need it. | 175 | // Init the glib type system - we need it. |
176 | g_type_init(); | 176 | g_type_init(); |
177 | 177 | ||
178 | set_gst_plugin_path(); | ||
179 | |||
178 | // Protect against GStreamer resetting the locale, yuck. | 180 | // Protect against GStreamer resetting the locale, yuck. |
179 | static std::string saved_locale; | 181 | static std::string saved_locale; |
180 | saved_locale = setlocale(LC_ALL, NULL); | 182 | saved_locale = setlocale(LC_ALL, NULL); |
@@ -189,12 +191,81 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data) | |||
189 | // Init our custom plugins - only really need do this once. | 191 | // Init our custom plugins - only really need do this once. |
190 | gst_slvideo_init_class(); | 192 | gst_slvideo_init_class(); |
191 | 193 | ||
194 | |||
195 | // List the plugins GStreamer can find | ||
196 | LL_DEBUGS("MediaImpl") << "Found GStreamer plugins:" << LL_ENDL; | ||
197 | GList *list; | ||
198 | GstRegistry *registry = gst_registry_get_default(); | ||
199 | for (list = gst_registry_get_plugin_list(registry); | ||
200 | list != NULL; | ||
201 | list = g_list_next(list)) | ||
202 | { | ||
203 | GstPlugin *list_plugin = (GstPlugin *)list->data; | ||
204 | LL_DEBUGS("MediaImpl") << gst_plugin_get_name(list_plugin) << LL_ENDL; | ||
205 | } | ||
206 | gst_plugin_list_free(list); | ||
207 | |||
208 | |||
192 | done_init = true; | 209 | done_init = true; |
193 | } | 210 | } |
194 | return true; | 211 | return true; |
195 | } | 212 | } |
196 | 213 | ||
197 | 214 | ||
215 | void LLMediaImplGStreamer::set_gst_plugin_path() | ||
216 | { | ||
217 | // Only needed for Windows. | ||
218 | // Linux sets in wrapper.sh, Mac sets in Info-Imprudence.plist | ||
219 | #ifdef LL_WINDOWS | ||
220 | |||
221 | char* imp_cwd; | ||
222 | |||
223 | // Get the current working directory: | ||
224 | imp_cwd = _getcwd(NULL,0); | ||
225 | |||
226 | if(imp_cwd == NULL) | ||
227 | { | ||
228 | LL_DEBUGS("LLMediaImpl") << "_getcwd failed, not setting GST_PLUGIN_PATH." | ||
229 | << LL_ENDL; | ||
230 | } | ||
231 | else | ||
232 | { | ||
233 | LL_DEBUGS("LLMediaImpl") << "Imprudence is installed at " | ||
234 | << imp_cwd << LL_ENDL; | ||
235 | |||
236 | // Grab the current path, if it's set. | ||
237 | std::string old_plugin_path = ""; | ||
238 | char *old_path = getenv("GST_PLUGIN_PATH"); | ||
239 | if(old_path == NULL) | ||
240 | { | ||
241 | LL_DEBUGS("LLMediaImpl") << "Did not find user-set GST_PLUGIN_PATH." | ||
242 | << LL_ENDL; | ||
243 | } | ||
244 | else | ||
245 | { | ||
246 | old_plugin_path = std::string( old_path ) + ":"; | ||
247 | } | ||
248 | |||
249 | |||
250 | // Search both Imprudence and Imprudence\lib\gstreamer-plugins. | ||
251 | // But we also want to first search the path the user has set, if any. | ||
252 | std::string plugin_path = | ||
253 | "GST_PLUGIN_PATH=" + | ||
254 | old_plugin_path + | ||
255 | std::string(imp_cwd) + ":" + | ||
256 | std::string(imp_cwd) + "\\lib\\gstreamer-plugins"; | ||
257 | |||
258 | // Place GST_PLUGIN_PATH in the environment settings for imprudence.exe | ||
259 | putenv( (char*)plugin_path.c_str() ); | ||
260 | |||
261 | LL_DEBUGS("LLMediaImpl") << "GST_PLUGIN_PATH set to " | ||
262 | << getenv("GST_PLUGIN_PATH") << LL_ENDL; | ||
263 | } | ||
264 | |||
265 | #endif //LL_WINDOWS | ||
266 | } | ||
267 | |||
268 | |||
198 | bool LLMediaImplGStreamer::closedown() | 269 | bool LLMediaImplGStreamer::closedown() |
199 | { | 270 | { |
200 | return true; | 271 | 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. |