diff options
author | McCabe Maxsted | 2009-04-02 08:03:59 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-04-02 08:03:59 -0700 |
commit | f305714a96729f42edecdc3d7a544383bece7ba4 (patch) | |
tree | 24d844d82b77957e763e6bc9a3103e29aa77f5f3 /linden/indra/llmedia | |
parent | Cleaned up logic for bad streams (diff) | |
parent | Apply saved MediaDebugLevel at media init time. (diff) | |
download | meta-impy-f305714a96729f42edecdc3d7a544383bece7ba4.zip meta-impy-f305714a96729f42edecdc3d7a544383bece7ba4.tar.gz meta-impy-f305714a96729f42edecdc3d7a544383bece7ba4.tar.bz2 meta-impy-f305714a96729f42edecdc3d7a544383bece7ba4.tar.xz |
Fixed merge conflicts
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmedia/llmediabase.h | 15 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplcommon.cpp | 12 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplcommon.h | 2 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.cpp | 58 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.h | 17 |
5 files changed, 102 insertions, 2 deletions
diff --git a/linden/indra/llmedia/llmediabase.h b/linden/indra/llmedia/llmediabase.h index b5b9420..bf54a22 100644 --- a/linden/indra/llmedia/llmediabase.h +++ b/linden/indra/llmedia/llmediabase.h | |||
@@ -61,6 +61,21 @@ class LLMediaBase | |||
61 | // undoes everything init() didm called by the media manager when destroying a source | 61 | // undoes everything init() didm called by the media manager when destroying a source |
62 | virtual bool reset() = 0; | 62 | virtual bool reset() = 0; |
63 | 63 | ||
64 | |||
65 | /* Mirrors GStreamer debug levels. */ | ||
66 | enum EDebugLevel { | ||
67 | DEBUG_LEVEL_NONE = 0, | ||
68 | DEBUG_LEVEL_ERROR, | ||
69 | DEBUG_LEVEL_WARNING, | ||
70 | DEBUG_LEVEL_INFO, | ||
71 | DEBUG_LEVEL_DEBUG, | ||
72 | DEBUG_LEVEL_LOG, | ||
73 | DEBUG_LEVEL_COUNT, | ||
74 | }; | ||
75 | |||
76 | /* Set the debug verbosity level. Only implemented for GStreamer. */ | ||
77 | virtual bool setDebugLevel( EDebugLevel level ) = 0; | ||
78 | |||
64 | // accessor for MIME type | 79 | // accessor for MIME type |
65 | virtual bool setMimeType( const std::string mime_type ) = 0; | 80 | virtual bool setMimeType( const std::string mime_type ) = 0; |
66 | virtual std::string getMimeType() const = 0; | 81 | virtual std::string getMimeType() const = 0; |
diff --git a/linden/indra/llmedia/llmediaimplcommon.cpp b/linden/indra/llmedia/llmediaimplcommon.cpp index abb61e1..48b3973 100644 --- a/linden/indra/llmedia/llmediaimplcommon.cpp +++ b/linden/indra/llmedia/llmediaimplcommon.cpp | |||
@@ -66,7 +66,8 @@ LLMediaImplCommon::LLMediaImplCommon() : | |||
66 | mCommand( LLMediaBase::COMMAND_NONE ), | 66 | mCommand( LLMediaBase::COMMAND_NONE ), |
67 | mStatus( LLMediaBase::STATUS_UNKNOWN ), | 67 | mStatus( LLMediaBase::STATUS_UNKNOWN ), |
68 | mVolume( 0 ), | 68 | mVolume( 0 ), |
69 | mLooping( false ) | 69 | mLooping( false ), |
70 | mDebugLevel( LLMediaBase::DEBUG_LEVEL_NONE ) | ||
70 | { | 71 | { |
71 | } | 72 | } |
72 | 73 | ||
@@ -92,6 +93,15 @@ bool LLMediaImplCommon::reset() | |||
92 | 93 | ||
93 | //////////////////////////////////////////////////////////////////////////////// | 94 | //////////////////////////////////////////////////////////////////////////////// |
94 | // virtual (derives from LLMediaBase) | 95 | // virtual (derives from LLMediaBase) |
96 | bool LLMediaImplCommon::setDebugLevel( LLMediaBase::EDebugLevel level ) | ||
97 | { | ||
98 | mDebugLevel = level; | ||
99 | |||
100 | return true; | ||
101 | } | ||
102 | |||
103 | //////////////////////////////////////////////////////////////////////////////// | ||
104 | // virtual (derives from LLMediaBase) | ||
95 | bool LLMediaImplCommon::setMimeType( const std::string mime_type ) | 105 | bool LLMediaImplCommon::setMimeType( const std::string mime_type ) |
96 | { | 106 | { |
97 | mMimeType = mime_type; | 107 | mMimeType = mime_type; |
diff --git a/linden/indra/llmedia/llmediaimplcommon.h b/linden/indra/llmedia/llmediaimplcommon.h index aa6c4d5..8a726f1 100644 --- a/linden/indra/llmedia/llmediaimplcommon.h +++ b/linden/indra/llmedia/llmediaimplcommon.h | |||
@@ -54,6 +54,7 @@ class LLMediaImplCommon : | |||
54 | // housekeeping | 54 | // housekeeping |
55 | virtual bool init(); | 55 | virtual bool init(); |
56 | virtual bool reset(); | 56 | virtual bool reset(); |
57 | virtual bool setDebugLevel( LLMediaBase::EDebugLevel level ); | ||
57 | virtual bool setMimeType( const std::string url ); | 58 | virtual bool setMimeType( const std::string url ); |
58 | virtual std::string getMimeType() const; | 59 | virtual std::string getMimeType() const; |
59 | virtual std::string getMediaURL() const; | 60 | virtual std::string getMediaURL() const; |
@@ -156,6 +157,7 @@ class LLMediaImplCommon : | |||
156 | LLMediaBase::ECommand mCommand; | 157 | LLMediaBase::ECommand mCommand; |
157 | LLMediaBase::EStatus mStatus; | 158 | LLMediaBase::EStatus mStatus; |
158 | bool mLooping; | 159 | bool mLooping; |
160 | LLMediaBase::EDebugLevel mDebugLevel; | ||
159 | }; | 161 | }; |
160 | 162 | ||
161 | #endif // LLMEDIAIMPLCOMMON_H | 163 | #endif // LLMEDIAIMPLCOMMON_H |
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 | ||
283 | void 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 | |||
279 | bool LLMediaImplGStreamer::closedown() | 323 | bool LLMediaImplGStreamer::closedown() |
280 | { | 324 | { |
281 | return true; | 325 | return true; |
282 | } | 326 | } |
283 | 327 | ||
284 | 328 | ||
329 | bool 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. |
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h index 2918416..37eaf53 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.h +++ b/linden/indra/llmedia/llmediaimplgstreamer.h | |||
@@ -69,6 +69,23 @@ class LLMediaImplGStreamer: | |||
69 | // Sets GST_PLUGIN_PATH env var for GStreamer. | 69 | // Sets GST_PLUGIN_PATH env var for GStreamer. |
70 | static void set_gst_plugin_path(); | 70 | static void set_gst_plugin_path(); |
71 | 71 | ||
72 | /* virtual */ bool setDebugLevel( LLMediaBase::EDebugLevel level ); | ||
73 | |||
74 | // Function given to GStreamer for handling debug messages | ||
75 | static void gstreamer_log(GstDebugCategory *category, | ||
76 | GstDebugLevel level, | ||
77 | const gchar *file, | ||
78 | const gchar *function, | ||
79 | gint line, | ||
80 | GObject *object, | ||
81 | GstDebugMessage *message, | ||
82 | gpointer data) | ||
83 | #if __GNUC__ | ||
84 | // recommended by the gstreamer docs | ||
85 | G_GNUC_NO_INSTRUMENT | ||
86 | #endif | ||
87 | ; | ||
88 | |||
72 | /* virtual */ std::string getVersion(); | 89 | /* virtual */ std::string getVersion(); |
73 | /* virtual */ bool navigateTo( const std::string url ); | 90 | /* virtual */ bool navigateTo( const std::string url ); |
74 | /* virtual */ bool updateMedia(); | 91 | /* virtual */ bool updateMedia(); |