aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia/llmediaimplgstreamer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmedia/llmediaimplgstreamer.cpp')
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.cpp58
1 files changed, 57 insertions, 1 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp
index 8ffb7c8..271bb5e 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.cpp
+++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp
@@ -189,7 +189,11 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data)
189 return false; 189 return false;
190 } 190 }
191 setlocale(LC_ALL, saved_locale.c_str() ); 191 setlocale(LC_ALL, saved_locale.c_str() );
192 192
193 // Set up logging facilities
194 gst_debug_remove_log_function( gst_debug_log_default );
195 gst_debug_add_log_function( gstreamer_log, NULL );
196
193 // Init our custom plugins - only really need do this once. 197 // Init our custom plugins - only really need do this once.
194 gst_slvideo_init_class(); 198 gst_slvideo_init_class();
195 199
@@ -276,12 +280,64 @@ void LLMediaImplGStreamer::set_gst_plugin_path()
276} 280}
277 281
278 282
283void LLMediaImplGStreamer::gstreamer_log(GstDebugCategory *category,
284 GstDebugLevel level,
285 const gchar *file,
286 const gchar *function,
287 gint line,
288 GObject *object,
289 GstDebugMessage *message,
290 gpointer data)
291{
292 std::stringstream log(std::stringstream::out);
293
294 // Log format example:
295 //
296 // GST_ELEMENT_PADS: removing pad 'sink' (in gstelement.c:757:gst_element_remove_pad)
297 //
298 log << gst_debug_category_get_name( category ) << ": "
299 << gst_debug_message_get(message) << " "
300 << "(in " << file << ":" << line << ":" << function << ")";
301
302 switch( level )
303 {
304 case GST_LEVEL_ERROR:
305 LL_ERRS("MediaImpl") << log.str() << LL_ENDL;
306 break;
307 case GST_LEVEL_WARNING:
308 LL_WARNS("MediaImpl") << log.str() << LL_ENDL;
309 break;
310 case GST_LEVEL_DEBUG:
311 LL_DEBUGS("MediaImpl") << log.str() << LL_ENDL;
312 break;
313 case GST_LEVEL_INFO:
314 LL_INFOS("MediaImpl") << log.str() << LL_ENDL;
315 break;
316 default:
317 // Do nothing.
318 break;
319 }
320}
321
322
279bool LLMediaImplGStreamer::closedown() 323bool LLMediaImplGStreamer::closedown()
280{ 324{
281 return true; 325 return true;
282} 326}
283 327
284 328
329bool LLMediaImplGStreamer::setDebugLevel( LLMediaBase::EDebugLevel level )
330{
331 // Do parent class stuff.
332 LLMediaImplCommon::setDebugLevel(level);
333
334 // Set GStreamer verbosity.
335 gst_debug_set_default_threshold( (GstDebugLevel)level );
336
337 return true;
338}
339
340
285/////////////////////////////////////////////////////////////////////////////// 341///////////////////////////////////////////////////////////////////////////////
286// 342//
287// Uncomment the line below to enable spammy debug data. 343// Uncomment the line below to enable spammy debug data.