From e4792e0768162d07b45f8ed19002f7a13c3bebb4 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Wed, 1 Apr 2009 23:47:05 -0500 Subject: Implemented LLMediaImplGstreamer::setDebugLevel(). --- linden/indra/llmedia/llmediaimplgstreamer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'linden/indra/llmedia/llmediaimplgstreamer.cpp') diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index 9a51b7f..82b1096 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp @@ -261,6 +261,18 @@ bool LLMediaImplGStreamer::closedown() } +bool LLMediaImplGStreamer::setDebugLevel( LLMediaBase::EDebugLevel level ) +{ + // Do parent class stuff. + LLMediaImplCommon::setDebugLevel(level); + + // Set GStreamer verbosity. + gst_debug_set_default_threshold( (GstDebugLevel)level ); + + return true; +} + + /////////////////////////////////////////////////////////////////////////////// // // Uncomment the line below to enable spammy debug data. -- cgit v1.1 From 33e649ca1bca260de474842d30d3bf8178e61be4 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Thu, 2 Apr 2009 02:29:46 -0500 Subject: Implemented LLMediaImplGStreamer::gstreamer_log(). --- linden/indra/llmedia/llmediaimplgstreamer.cpp | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'linden/indra/llmedia/llmediaimplgstreamer.cpp') diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index 82b1096..8cbfb60 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp @@ -255,6 +255,46 @@ void LLMediaImplGStreamer::set_gst_plugin_path() } +void LLMediaImplGStreamer::gstreamer_log(GstDebugCategory *category, + GstDebugLevel level, + const gchar *file, + const gchar *function, + gint line, + GObject *object, + GstDebugMessage *message, + gpointer data) +{ + std::stringstream log(std::stringstream::out); + + // Log format example: + // + // GST_ELEMENT_PADS: removing pad 'sink' (in gstelement.c:757:gst_element_remove_pad) + // + log << gst_debug_category_get_name( category ) << ": " + << gst_debug_message_get(message) << " " + << "(in " << file << ":" << line << ":" << function << ")"; + + switch( level ) + { + case GST_LEVEL_ERROR: + LL_ERRS("MediaImpl") << log.str() << LL_ENDL; + break; + case GST_LEVEL_WARNING: + LL_WARNS("MediaImpl") << log.str() << LL_ENDL; + break; + case GST_LEVEL_DEBUG: + LL_DEBUGS("MediaImpl") << log.str() << LL_ENDL; + break; + case GST_LEVEL_INFO: + LL_INFOS("MediaImpl") << log.str() << LL_ENDL; + break; + default: + // Do nothing. + break; + } +} + + bool LLMediaImplGStreamer::closedown() { return true; -- cgit v1.1 From 42670a609d842affb26bf1dd1ed6b69958655ea9 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Thu, 2 Apr 2009 03:12:02 -0500 Subject: Plugged in LLMediaImplGStreamer::gstreamer_log(). --- linden/indra/llmedia/llmediaimplgstreamer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'linden/indra/llmedia/llmediaimplgstreamer.cpp') diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index 8cbfb60..532ec00 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp @@ -176,7 +176,11 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data) return false; } setlocale(LC_ALL, saved_locale.c_str() ); - + + // Set up logging facilities + gst_debug_remove_log_function( gst_debug_log_default ); + gst_debug_add_log_function( gstreamer_log, NULL ); + // Init our custom plugins - only really need do this once. gst_slvideo_init_class(); -- cgit v1.1