aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia/llmediaimplgstreamer.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-03-29 22:21:34 -0700
committerMcCabe Maxsted2009-03-29 22:21:34 -0700
commit433abcb5274d62e5c5ef8c8a411db37d55b732f6 (patch)
treeb00461fd0ce532e34bb34d5ddc1ac93b03416ca8 /linden/indra/llmedia/llmediaimplgstreamer.cpp
parentFixed video streams freezing the viewer (diff)
parentFixed some minor mistakes in set_gst_plugin_path(). (diff)
downloadmeta-impy-433abcb5274d62e5c5ef8c8a411db37d55b732f6.zip
meta-impy-433abcb5274d62e5c5ef8c8a411db37d55b732f6.tar.gz
meta-impy-433abcb5274d62e5c5ef8c8a411db37d55b732f6.tar.bz2
meta-impy-433abcb5274d62e5c5ef8c8a411db37d55b732f6.tar.xz
Fixed merge conflicts
Diffstat (limited to 'linden/indra/llmedia/llmediaimplgstreamer.cpp')
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.cpp71
1 files changed, 71 insertions, 0 deletions
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
215void 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
198bool LLMediaImplGStreamer::closedown() 269bool LLMediaImplGStreamer::closedown()
199{ 270{
200 return true; 271 return true;