aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJacek Antonelli2009-03-29 15:52:56 -0500
committerJacek Antonelli2009-03-29 15:52:56 -0500
commitae9a2e5859500c19d403ae8c02d073586e4567de (patch)
tree07231699bbf82a6de795ba41f9f509c1b35a752c
parentUsing OpenAL framework on Mac after all. Maybe. (diff)
parentFixed some minor mistakes in set_gst_plugin_path(). (diff)
downloadmeta-impy-ae9a2e5859500c19d403ae8c02d073586e4567de.zip
meta-impy-ae9a2e5859500c19d403ae8c02d073586e4567de.tar.gz
meta-impy-ae9a2e5859500c19d403ae8c02d073586e4567de.tar.bz2
meta-impy-ae9a2e5859500c19d403ae8c02d073586e4567de.tar.xz
Merge commit 'origin/gst-revamp' into mac-1.1.0
-rw-r--r--ChangeLog.txt25
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.cpp71
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.h4
-rw-r--r--linden/indra/newview/llappviewer.cpp26
-rw-r--r--linden/indra/newview/llappviewer.h2
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
152009-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
152009-03-26 Jacek Antonelli <jacek.antonelli@gmail.com> 402009-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
204void 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
187bool LLMediaImplGStreamer::closedown() 258bool 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;
320static std::string gHelperURI; 320static std::string gHelperURI;
321 321
322 322
323void 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
347void idle_afk_check() 323void 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
139protected: 139protected:
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.