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 | |
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
-rw-r--r-- | ChangeLog.txt | 42 | ||||
-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 | ||||
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | linden/indra/newview/llviewercontrol.cpp | 18 | ||||
-rw-r--r-- | linden/indra/newview/llviewermedia.cpp | 7 |
9 files changed, 180 insertions, 2 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 9d293fb..a4c3415 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt | |||
@@ -1,3 +1,45 @@ | |||
1 | 2009-04-02 Jacek Antonelli <jacek.antonelli@gmail.com> | ||
2 | |||
3 | * linden/indra/newview/llviewermedia.cpp: | ||
4 | Apply saved MediaDebugLevel at media init time. | ||
5 | |||
6 | |||
7 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | ||
8 | Plugged in LLMediaImplGStreamer::gstreamer_log(). | ||
9 | |||
10 | |||
11 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | ||
12 | Implemented LLMediaImplGStreamer::gstreamer_log(). | ||
13 | * linden/indra/llmedia/llmediaimplgstreamer.h: | ||
14 | Ditto. | ||
15 | |||
16 | |||
17 | * linden/indra/newview/llviewercontrol.cpp: | ||
18 | Implemented handleMediaDebugLevelChanged hook. | ||
19 | |||
20 | |||
21 | 2009-04-01 Jacek Antonelli <jacek.antonelli@gmail.com> | ||
22 | |||
23 | * linden/indra/newview/app_settings/settings.xml: | ||
24 | Added MediaDebugLevel setting in XML (does nothing yet). | ||
25 | |||
26 | |||
27 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | ||
28 | Implemented LLMediaImplGstreamer::setDebugLevel(). | ||
29 | * linden/indra/llmedia/llmediaimplgstreamer.h: | ||
30 | Ditto. | ||
31 | |||
32 | |||
33 | * linden/indra/llmedia/llmediaimplcommon.cpp: | ||
34 | Added LLMediaImplCommon::setDebugLevel(). | ||
35 | * linden/indra/llmedia/llmediaimplcommon.h: | ||
36 | Ditto. | ||
37 | |||
38 | |||
39 | * linden/indra/llmedia/llmediabase.h: | ||
40 | Added LLMediaBase::EDebugLevel and setDebugLevel prototype. | ||
41 | |||
42 | |||
1 | 2009-03-30 McCabe Maxsted <hakushakukun@gmail.com> | 43 | 2009-03-30 McCabe Maxsted <hakushakukun@gmail.com> |
2 | 44 | ||
3 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: | 45 | * linden/indra/llmedia/llmediaimplgstreamer.cpp: |
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(); |
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 7405aad..1ecab2b 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -4659,6 +4659,17 @@ | |||
4659 | <key>Value</key> | 4659 | <key>Value</key> |
4660 | <integer>0</integer> | 4660 | <integer>0</integer> |
4661 | </map> | 4661 | </map> |
4662 | <key>MediaDebugLevel</key> | ||
4663 | <map> | ||
4664 | <key>Comment</key> | ||
4665 | <string>How spammy media (GStreamer) debug output should be. (0-4)</string> | ||
4666 | <key>Persist</key> | ||
4667 | <integer>1</integer> | ||
4668 | <key>Type</key> | ||
4669 | <string>U32</string> | ||
4670 | <key>Value</key> | ||
4671 | <integer>0</integer> | ||
4672 | </map> | ||
4662 | <key>MemoryLogFrequency</key> | 4673 | <key>MemoryLogFrequency</key> |
4663 | <map> | 4674 | <map> |
4664 | <key>Comment</key> | 4675 | <key>Comment</key> |
diff --git a/linden/indra/newview/llviewercontrol.cpp b/linden/indra/newview/llviewercontrol.cpp index 7a30b22..a8a3b16 100644 --- a/linden/indra/newview/llviewercontrol.cpp +++ b/linden/indra/newview/llviewercontrol.cpp | |||
@@ -70,6 +70,7 @@ | |||
70 | #include "llvosurfacepatch.h" | 70 | #include "llvosurfacepatch.h" |
71 | #include "llvowlsky.h" | 71 | #include "llvowlsky.h" |
72 | #include "llrender.h" | 72 | #include "llrender.h" |
73 | #include "llmediamanager.h" | ||
73 | 74 | ||
74 | #ifdef TOGGLE_HACKED_GODLIKE_VIEWER | 75 | #ifdef TOGGLE_HACKED_GODLIKE_VIEWER |
75 | BOOL gHackGodmode = FALSE; | 76 | BOOL gHackGodmode = FALSE; |
@@ -429,6 +430,22 @@ bool handleVoiceClientPrefsChanged(const LLSD& newvalue) | |||
429 | return true; | 430 | return true; |
430 | } | 431 | } |
431 | 432 | ||
433 | bool handleMediaDebugLevelChanged(const LLSD& newvalue) | ||
434 | { | ||
435 | LLMediaManager *mgr = LLMediaManager::getInstance(); | ||
436 | if (mgr) | ||
437 | { | ||
438 | LLMediaBase *impl = | ||
439 | mgr->createSourceFromMimeType("http", "audio/mpeg"); | ||
440 | |||
441 | if (impl) | ||
442 | { | ||
443 | impl->setDebugLevel( (LLMediaBase::EDebugLevel)newvalue.asInteger() ); | ||
444 | } | ||
445 | } | ||
446 | return true; | ||
447 | } | ||
448 | |||
432 | //////////////////////////////////////////////////////////////////////////// | 449 | //////////////////////////////////////////////////////////////////////////// |
433 | 450 | ||
434 | void settings_setup_listeners() | 451 | void settings_setup_listeners() |
@@ -556,6 +573,7 @@ void settings_setup_listeners() | |||
556 | gSavedSettings.getControl("VoiceInputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); | 573 | gSavedSettings.getControl("VoiceInputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); |
557 | gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); | 574 | gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); |
558 | gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); | 575 | gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); |
576 | gSavedSettings.getControl("MediaDebugLevel")->getSignal()->connect(boost::bind(&handleMediaDebugLevelChanged, _1)); | ||
559 | } | 577 | } |
560 | 578 | ||
561 | template <> eControlType get_control_type<U32>(const U32& in, LLSD& out) | 579 | template <> eControlType get_control_type<U32>(const U32& in, LLSD& out) |
diff --git a/linden/indra/newview/llviewermedia.cpp b/linden/indra/newview/llviewermedia.cpp index e99c838..d8fcdcb 100644 --- a/linden/indra/newview/llviewermedia.cpp +++ b/linden/indra/newview/llviewermedia.cpp | |||
@@ -496,6 +496,13 @@ void LLViewerMedia::initClass() | |||
496 | const LLMIMETypes::LLMIMEInfo& info = it->second; | 496 | const LLMIMETypes::LLMIMEInfo& info = it->second; |
497 | mm->addMimeTypeImplNameMap( mime_type, info.mImpl ); | 497 | mm->addMimeTypeImplNameMap( mime_type, info.mImpl ); |
498 | } | 498 | } |
499 | |||
500 | LLMediaBase *impl = mm->createSourceFromMimeType("http", "audio/mpeg"); | ||
501 | if (impl) | ||
502 | { | ||
503 | U32 level = gSavedSettings.getU32("MediaDebugLevel"); | ||
504 | impl->setDebugLevel( (LLMediaBase::EDebugLevel)level ); | ||
505 | } | ||
499 | } | 506 | } |
500 | 507 | ||
501 | ////////////////////////////////////////////////////////////////////////////////////////// | 508 | ////////////////////////////////////////////////////////////////////////////////////////// |