aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJacek Antonelli2009-03-28 19:29:40 -0500
committerJacek Antonelli2009-03-28 19:35:08 -0500
commit9538403155fdc574c8562cdaedbeb09fbdcff55e (patch)
treedfe17d8ae397f85125769eda2d629b1076f60a23
parentMoved Windows GST_PLUGIN_PATH setup to LLMediaImplGStreamer. (diff)
downloadmeta-impy-9538403155fdc574c8562cdaedbeb09fbdcff55e.zip
meta-impy-9538403155fdc574c8562cdaedbeb09fbdcff55e.tar.gz
meta-impy-9538403155fdc574c8562cdaedbeb09fbdcff55e.tar.bz2
meta-impy-9538403155fdc574c8562cdaedbeb09fbdcff55e.tar.xz
Improved set_gst_plugin_path, more comprehensive path.
Also tried to tidy up a bit.
Diffstat (limited to '')
-rw-r--r--ChangeLog.txt7
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.cpp47
2 files changed, 45 insertions, 9 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index eb35e5f..776a451 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,9 +1,16 @@
12009-03-28 Jacek Antonelli <jacek.antonelli@gmail.com> 12009-03-28 Jacek Antonelli <jacek.antonelli@gmail.com>
2 2
3 * linden/indra/llmedia/llmediaimplgstreamer.cpp: 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:
4 Moved Windows GST_PLUGIN_PATH setup to LLMediaImplGStreamer. 9 Moved Windows GST_PLUGIN_PATH setup to LLMediaImplGStreamer.
5 LLAppViewer::gst_plugin_path --> 10 LLAppViewer::gst_plugin_path -->
6 LLMediaImplGStreamer::set_gst_plugin_path 11 LLMediaImplGStreamer::set_gst_plugin_path
12
13
7 * linden/indra/llmedia/llmediaimplgstreamer.cpp: 14 * linden/indra/llmedia/llmediaimplgstreamer.cpp:
8 Ditto. 15 Ditto.
9 * linden/indra/newview/llappviewer.h: 16 * linden/indra/newview/llappviewer.h:
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp
index ed7b36e..0cc1e8f 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.cpp
+++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp
@@ -203,25 +203,54 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data)
203 203
204void LLMediaImplGStreamer::set_gst_plugin_path() 204void LLMediaImplGStreamer::set_gst_plugin_path()
205{ 205{
206 // Only needed for Windows.
207 // Linux sets in wrapper.sh, Mac sets in Info-Imprudence.plist
206#ifdef LL_WINDOWS 208#ifdef LL_WINDOWS
207 char* buffer; 209
210 char* imp_cwd;
208 211
209 // Get the current working directory: 212 // Get the current working directory:
210 if((buffer = _getcwd(NULL,0)) == NULL) 213 imp_cwd = _getcwd(NULL,0);
214
215 if(imp_cwd == NULL)
211 { 216 {
212 LL_INFOS("InitInfo") << "_getcwd error" << LL_ENDL; 217 LL_DEBUGS("LLMediaImpl") << "_getcwd failed, not setting GST_PLUGIN_PATH."
218 << LL_ENDL;
213 } 219 }
214 else 220 else
215 { 221 {
216 LL_INFOS("InitInfo") << "Imprudence is installed at " << buffer << LL_ENDL; 222 LL_DEBUGS("LLMediaImpl") << "Imprudence is installed at "
217 223 << buffer << LL_ENDL;
218 std::string plugin_path = "GST_PLUGIN_PATH=" + std::string(buffer) + "\\lib\\gstreamer-plugins"; 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";
219 246
220 // Place GST_PLUGIN_PATH in the environment settings for imprudence.exe 247 // Place GST_PLUGIN_PATH in the environment settings for imprudence.exe
221 const char* gst_plugin_path = plugin_path.c_str(); 248 putenv( plugin_path.c_str() );
222 putenv(gst_plugin_path); 249
223 LL_INFOS("InitInfo") << "GST_PLUGIN_PATH set to " << getenv("GST_PLUGIN_PATH") << LL_ENDL; 250 LL_DEBUGS("LLMediaImpl") << "GST_PLUGIN_PATH set to "
251 << getenv("GST_PLUGIN_PATH") << LL_ENDL;
224 } 252 }
253
225#endif //LL_WINDOWS 254#endif //LL_WINDOWS
226} 255}
227 256