diff options
author | Anders Arnholm | 2008-12-19 10:12:25 +0100 |
---|---|---|
committer | Anders Arnholm | 2008-12-19 10:12:25 +0100 |
commit | 324dfa1561efba6492b72ad4d9306e69b9124776 (patch) | |
tree | ec203e765d20e7e042bbb042cd520f00b3185f43 /linden/indra/llmedia | |
parent | Make openal-1 version info (diff) | |
download | meta-impy-324dfa1561efba6492b72ad4d9306e69b9124776.zip meta-impy-324dfa1561efba6492b72ad4d9306e69b9124776.tar.gz meta-impy-324dfa1561efba6492b72ad4d9306e69b9124776.tar.bz2 meta-impy-324dfa1561efba6492b72ad4d9306e69b9124776.tar.xz |
Clean up logging to used standard LL metods.
Diffstat (limited to 'linden/indra/llmedia')
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.cpp | 119 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.h | 2 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediamanager.cpp | 4 |
3 files changed, 76 insertions, 49 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index 5d6a648..5a8a8e0 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp | |||
@@ -49,6 +49,7 @@ extern "C" { | |||
49 | 49 | ||
50 | #include "llmediaimplgstreamer_syms.h" | 50 | #include "llmediaimplgstreamer_syms.h" |
51 | 51 | ||
52 | #include "llerror.h" | ||
52 | // register this impl with media manager factory | 53 | // register this impl with media manager factory |
53 | static LLMediaImplRegister sLLMediaImplGStreamerReg( "LLMediaImplGStreamer", new LLMediaImplGStreamerMaker() ); | 54 | static LLMediaImplRegister sLLMediaImplGStreamerReg( "LLMediaImplGStreamer", new LLMediaImplGStreamerMaker() ); |
54 | 55 | ||
@@ -73,12 +74,13 @@ LLMediaImplGStreamer () : | |||
73 | mTextureFormatType ( LL_MEDIA_UNSIGNED_INT_8_8_8_8_REV ), | 74 | mTextureFormatType ( LL_MEDIA_UNSIGNED_INT_8_8_8_8_REV ), |
74 | mPump ( NULL ), | 75 | mPump ( NULL ), |
75 | mPlaybin ( NULL ), | 76 | mPlaybin ( NULL ), |
76 | mVideoSink ( NULL ) | 77 | mVideoSink ( NULL ), |
78 | mState( GST_STATE_NULL ) | ||
77 | #ifdef LL_GST_SOUNDSINK | 79 | #ifdef LL_GST_SOUNDSINK |
78 | ,mAudioSink ( NULL ) | 80 | ,mAudioSink ( NULL ) |
79 | #endif // LL_GST_SOUNDSINK | 81 | #endif // LL_GST_SOUNDSINK |
80 | { | 82 | { |
81 | DEBUGMSG("constructing media..."); | 83 | LL_DEBUGS("MediaManager") << "constructing media..." << LL_ENDL; |
82 | 84 | ||
83 | setMediaDepth(4); | 85 | setMediaDepth(4); |
84 | 86 | ||
@@ -99,11 +101,12 @@ LLMediaImplGStreamer () : | |||
99 | 101 | ||
100 | if (NULL == getenv("LL_GSTREAMER_EXTERNAL")) { | 102 | if (NULL == getenv("LL_GSTREAMER_EXTERNAL")) { |
101 | // instantiate and connect a custom video sink | 103 | // instantiate and connect a custom video sink |
104 | LL_DEBUGS("MediaManager") << "extrenal video sink..." << LL_ENDL; | ||
102 | mVideoSink = | 105 | mVideoSink = |
103 | GST_SLVIDEO(llgst_element_factory_make ("private-slvideo", "slvideo")); | 106 | GST_SLVIDEO(llgst_element_factory_make ("private-slvideo", "slvideo")); |
104 | if (!mVideoSink) | 107 | if (!mVideoSink) |
105 | { | 108 | { |
106 | WARNMSG("Could not instantiate private-slvideo element."); | 109 | LL_WARNS("MediaImpl") << "Could not instantiate private-slvideo element." << LL_ENDL; |
107 | // todo: cleanup. | 110 | // todo: cleanup. |
108 | return; // error | 111 | return; // error |
109 | } | 112 | } |
@@ -111,12 +114,13 @@ LLMediaImplGStreamer () : | |||
111 | g_object_set(mPlaybin, "video-sink", mVideoSink, NULL); | 114 | g_object_set(mPlaybin, "video-sink", mVideoSink, NULL); |
112 | 115 | ||
113 | #ifdef LL_GST_SOUNDSINK | 116 | #ifdef LL_GST_SOUNDSINK |
117 | LL_DEBUGS("MediaManager") << "extrenal audio sink..." << LL_ENDL; | ||
114 | // instantiate and connect a custom audio sink | 118 | // instantiate and connect a custom audio sink |
115 | mAudioSink = | 119 | mAudioSink = |
116 | GST_SLSOUND(llgst_element_factory_make ("private-slsound", "slsound")); | 120 | GST_SLSOUND(llgst_element_factory_make ("private-slsound", "slsound")); |
117 | if (!mAudioSink) | 121 | if (!mAudioSink) |
118 | { | 122 | { |
119 | WARNMSG("Could not instantiate private-slsound element."); | 123 | LL_WARN("MediaImpl") << "Could not instantiate private-slsound element." << LL_ENDL; |
120 | // todo: cleanup. | 124 | // todo: cleanup. |
121 | return; // error | 125 | return; // error |
122 | } | 126 | } |
@@ -149,7 +153,7 @@ int LLMediaImplGStreamer::getTextureFormatInternal() const | |||
149 | LLMediaImplGStreamer:: | 153 | LLMediaImplGStreamer:: |
150 | ~LLMediaImplGStreamer () | 154 | ~LLMediaImplGStreamer () |
151 | { | 155 | { |
152 | DEBUGMSG("dtor of media..."); | 156 | LL_DEBUGS("MediaImpl") << ("dtor of media...") << LL_ENDL; |
153 | unload(); | 157 | unload(); |
154 | } | 158 | } |
155 | 159 | ||
@@ -176,21 +180,23 @@ startup ( LLMediaManagerData* init_data ) | |||
176 | "libgstvideo-0.10.so.0", | 180 | "libgstvideo-0.10.so.0", |
177 | "libgstaudio-0.10.so.0") ) | 181 | "libgstaudio-0.10.so.0") ) |
178 | { | 182 | { |
179 | WARNMSG("Couldn't find suitable GStreamer 0.10 support on this system - video playback disabled."); | 183 | LL_WARNS("MediaImpl") << "Couldn't find suitable GStreamer 0.10 support on this system - video playback disabled." << LL_ENDL; |
180 | return false; | 184 | return false; |
181 | } | 185 | } |
182 | 186 | ||
183 | if (llgst_segtrap_set_enabled) | 187 | if (llgst_segtrap_set_enabled) |
184 | llgst_segtrap_set_enabled(FALSE); | 188 | llgst_segtrap_set_enabled(FALSE); |
185 | else | 189 | else |
186 | WARNMSG("gst_segtrap_set_enabled() is not available; Automated crash-reporter may cease to function until next restart."); | 190 | { |
191 | LL_WARNS("MediaImpl") << "gst_segtrap_set_enabled() is not available; Automated crash-reporter may cease to function until next restart." << LL_ENDL; | ||
192 | } | ||
187 | 193 | ||
188 | // Protect against GStreamer resetting the locale, yuck. | 194 | // Protect against GStreamer resetting the locale, yuck. |
189 | static std::string saved_locale; | 195 | static std::string saved_locale; |
190 | saved_locale = setlocale(LC_ALL, NULL); | 196 | saved_locale = setlocale(LC_ALL, NULL); |
191 | if (0 == llgst_init_check(NULL, NULL, NULL)) | 197 | if (0 == llgst_init_check(NULL, NULL, NULL)) |
192 | { | 198 | { |
193 | WARNMSG("GST init failed for unspecified reason."); | 199 | LL_WARNS("MediaImpl") << "GST init failed for unspecified reason." << LL_ENDL; |
194 | setlocale(LC_ALL, saved_locale.c_str() ); | 200 | setlocale(LC_ALL, saved_locale.c_str() ); |
195 | return false; | 201 | return false; |
196 | } | 202 | } |
@@ -222,7 +228,7 @@ closedown() | |||
222 | // | 228 | // |
223 | //#define LL_GST_REPORT_STATE_CHANGES | 229 | //#define LL_GST_REPORT_STATE_CHANGES |
224 | #ifdef LL_GST_REPORT_STATE_CHANGES | 230 | #ifdef LL_GST_REPORT_STATE_CHANGES |
225 | static char* get_gst_state_name(GstState state) | 231 | static const char* get_gst_state_name(GstState state) |
226 | { | 232 | { |
227 | switch (state) { | 233 | switch (state) { |
228 | case GST_STATE_VOID_PENDING: return "VOID_PENDING"; | 234 | case GST_STATE_VOID_PENDING: return "VOID_PENDING"; |
@@ -241,17 +247,7 @@ LLMediaImplGStreamer::bus_callback (GstBus *bus, | |||
241 | GstMessage *message, | 247 | GstMessage *message, |
242 | gpointer data) | 248 | gpointer data) |
243 | { | 249 | { |
244 | if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_STATE_CHANGED && | 250 | LL_DEBUGS("MediaCallback") << "Got GST message type: " << LLGST_MESSAGE_TYPE_NAME (message) << LL_ENDL; |
245 | GST_MESSAGE_TYPE(message) != GST_MESSAGE_BUFFERING) | ||
246 | { | ||
247 | DEBUGMSG("Got GST message type: %s", | ||
248 | LLGST_MESSAGE_TYPE_NAME (message)); | ||
249 | } | ||
250 | else | ||
251 | { | ||
252 | DEBUGMSG("Got GST message type: %s", | ||
253 | LLGST_MESSAGE_TYPE_NAME (message)); | ||
254 | } | ||
255 | 251 | ||
256 | LLMediaImplGStreamer *impl = (LLMediaImplGStreamer*)data; | 252 | LLMediaImplGStreamer *impl = (LLMediaImplGStreamer*)data; |
257 | 253 | ||
@@ -262,7 +258,7 @@ LLMediaImplGStreamer::bus_callback (GstBus *bus, | |||
262 | { | 258 | { |
263 | gint percent = 0; | 259 | gint percent = 0; |
264 | llgst_message_parse_buffering(message, &percent); | 260 | llgst_message_parse_buffering(message, &percent); |
265 | DEBUGMSG("GST buffering: %d%%", percent); | 261 | LL_DEBUGS("MediaBuffering") << "GST buffering: " << percent << "%%" << LL_ENDL; |
266 | LLMediaEvent event( impl, percent ); | 262 | LLMediaEvent event( impl, percent ); |
267 | impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); | 263 | impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); |
268 | 264 | ||
@@ -279,16 +275,18 @@ LLMediaImplGStreamer::bus_callback (GstBus *bus, | |||
279 | &pending_state); | 275 | &pending_state); |
280 | #ifdef LL_GST_REPORT_STATE_CHANGES | 276 | #ifdef LL_GST_REPORT_STATE_CHANGES |
281 | // not generally very useful, and rather spammy. | 277 | // not generally very useful, and rather spammy. |
282 | DEBUGMSG("state change (old,<new>,pending): %s,<%s>,%s", | 278 | LL_DEBUGS("MediaState") << "GST state change (old,<new>,pending): "<< get_gst_state_name(old_state) << ",<" << get_gst_state_name(new_state) << ">," << get_gst_state_name(pending_state) << LL_ENDL; |
283 | get_gst_state_name(old_state), | ||
284 | get_gst_state_name(new_state), | ||
285 | get_gst_state_name(pending_state)); | ||
286 | #endif // LL_GST_REPORT_STATE_CHANGES | 279 | #endif // LL_GST_REPORT_STATE_CHANGES |
287 | 280 | ||
288 | switch (new_state) { | 281 | switch (new_state) { |
289 | case GST_STATE_VOID_PENDING: | 282 | case GST_STATE_VOID_PENDING: |
290 | break; | 283 | break; |
291 | case GST_STATE_NULL: | 284 | case GST_STATE_NULL: |
285 | LL_DEBUGS("MediaImpl") << "State changed to NULL" << LL_ENDL; | ||
286 | if (impl->getState() == GST_STATE_PLAYING) { // We got stoped by gstremer... | ||
287 | impl->play(); | ||
288 | LL_DEBUGS("MediaImpl") << "Trying to restart." << LL_ENDL; | ||
289 | } | ||
292 | break; | 290 | break; |
293 | case GST_STATE_READY: | 291 | case GST_STATE_READY: |
294 | break; | 292 | break; |
@@ -309,11 +307,12 @@ LLMediaImplGStreamer::bus_callback (GstBus *bus, | |||
309 | gchar *debug = NULL; | 307 | gchar *debug = NULL; |
310 | 308 | ||
311 | llgst_message_parse_error (message, &err, &debug); | 309 | llgst_message_parse_error (message, &err, &debug); |
312 | WARNMSG("GST error: %s", err->message); | 310 | LL_WARNS("MediaImpl") << "GST Error: " << err->message << LL_ENDL; |
313 | g_error_free (err); | 311 | g_error_free (err); |
314 | g_free (debug); | 312 | g_free (debug); |
315 | 313 | ||
316 | impl->addCommand(LLMediaBase::COMMAND_STOP); | 314 | impl->addCommand(LLMediaBase::COMMAND_STOP); |
315 | //impl->addCommand(LLMediaBase::COMMAND_START); | ||
317 | 316 | ||
318 | break; | 317 | break; |
319 | } | 318 | } |
@@ -324,7 +323,8 @@ LLMediaImplGStreamer::bus_callback (GstBus *bus, | |||
324 | gchar *debug = NULL; | 323 | gchar *debug = NULL; |
325 | 324 | ||
326 | llgst_message_parse_info (message, &err, &debug); | 325 | llgst_message_parse_info (message, &err, &debug); |
327 | INFOMSG("GST info: %s", err->message); | 326 | LL_INFOS("MediaImpl") << "GST info: " << err->message |
327 | << LL_ENDL; | ||
328 | g_error_free (err); | 328 | g_error_free (err); |
329 | g_free (debug); | 329 | g_free (debug); |
330 | } | 330 | } |
@@ -335,18 +335,36 @@ LLMediaImplGStreamer::bus_callback (GstBus *bus, | |||
335 | gchar *debug = NULL; | 335 | gchar *debug = NULL; |
336 | 336 | ||
337 | llgst_message_parse_warning (message, &err, &debug); | 337 | llgst_message_parse_warning (message, &err, &debug); |
338 | WARNMSG("GST warning: %s", err->message); | 338 | LL_WARNS("MediaImpl") << "GST warning: " << err->message |
339 | << LL_ENDL; | ||
339 | g_error_free (err); | 340 | g_error_free (err); |
340 | g_free (debug); | 341 | g_free (debug); |
341 | 342 | ||
342 | break; | 343 | break; |
343 | } | 344 | } |
345 | case GST_MESSAGE_TAG: { | ||
346 | #if 0 | ||
347 | GstTagList *tag_list; | ||
348 | gchar *title; | ||
349 | gchar *artist; | ||
350 | llgst_message_parse_tag(message, &tag_list); | ||
351 | gboolean hazTitle = llgst_tag_list_get_string(tag_list, | ||
352 | GST_TAG_TITLE, &title); | ||
353 | gboolean hazArtist = llgst_tag_list_get_string(tag_list, | ||
354 | GST_TAG_ARTIST, &artist); | ||
355 | if(hazTitle) | ||
356 | LL_INFOS("MediaInfo") << "Title is " << title << LL_ENDL; | ||
357 | if(hazArtist) | ||
358 | LL_INFOS("MediaInfo") << "Artist is " << artist << LL_ENDL; | ||
359 | #endif | ||
360 | break; | ||
361 | } | ||
344 | case GST_MESSAGE_EOS: | 362 | case GST_MESSAGE_EOS: |
345 | /* end-of-stream */ | 363 | /* end-of-stream */ |
346 | DEBUGMSG("GST end-of-stream."); | 364 | LL_DEBUGS("MediaImpl") << "GST end-of-stream." << LL_ENDL; |
347 | if (impl->isLooping()) | 365 | if (impl->isLooping()) |
348 | { | 366 | { |
349 | DEBUGMSG("looping media..."); | 367 | LL_DEBUGS("MediaImpl") << "looping media..." << LL_ENDL; |
350 | impl->stop(); | 368 | impl->stop(); |
351 | impl->play(); | 369 | impl->play(); |
352 | } | 370 | } |
@@ -374,7 +392,8 @@ bool | |||
374 | LLMediaImplGStreamer:: | 392 | LLMediaImplGStreamer:: |
375 | navigateTo ( const std::string urlIn ) | 393 | navigateTo ( const std::string urlIn ) |
376 | { | 394 | { |
377 | DEBUGMSG("Setting media URI: %s", urlIn.c_str()); | 395 | LL_DEBUGS("MediaImpl") << "Setting media URI: " << urlIn.c_str() |
396 | << LL_ENDL; | ||
378 | 397 | ||
379 | if (NULL == mPump | 398 | if (NULL == mPump |
380 | #ifdef LL_GST_SOUNDSINK | 399 | #ifdef LL_GST_SOUNDSINK |
@@ -412,10 +431,11 @@ bool | |||
412 | LLMediaImplGStreamer:: | 431 | LLMediaImplGStreamer:: |
413 | unload () | 432 | unload () |
414 | { | 433 | { |
415 | DEBUGMSG("unloading media..."); | 434 | LL_DEBUGS("MediaImpl") << "unloading media..." << LL_ENDL; |
416 | if (mPlaybin) | 435 | if (mPlaybin) |
417 | { | 436 | { |
418 | llgst_element_set_state (mPlaybin, GST_STATE_NULL); | 437 | llgst_element_set_state (mPlaybin, GST_STATE_NULL); |
438 | mState = GST_STATE_NULL; | ||
419 | llgst_object_unref (GST_OBJECT (mPlaybin)); | 439 | llgst_object_unref (GST_OBJECT (mPlaybin)); |
420 | mPlaybin = NULL; | 440 | mPlaybin = NULL; |
421 | } | 441 | } |
@@ -443,7 +463,7 @@ bool | |||
443 | LLMediaImplGStreamer:: | 463 | LLMediaImplGStreamer:: |
444 | updateMedia () | 464 | updateMedia () |
445 | { | 465 | { |
446 | DEBUGMSG("updating media..."); | 466 | //LL_DEBUGS("MediaImpl") << "updating media..." << LL_ENDL; |
447 | 467 | ||
448 | // sanity check | 468 | // sanity check |
449 | if (NULL == mPump | 469 | if (NULL == mPump |
@@ -452,7 +472,7 @@ updateMedia () | |||
452 | #endif | 472 | #endif |
453 | || NULL == mPlaybin) | 473 | || NULL == mPlaybin) |
454 | { | 474 | { |
455 | DEBUGMSG("dead media..."); | 475 | LL_DEBUGS("MediaImpl") << "dead media..." << LL_ENDL; |
456 | return false; | 476 | return false; |
457 | } | 477 | } |
458 | 478 | ||
@@ -460,36 +480,33 @@ updateMedia () | |||
460 | switch (nextCommand()) | 480 | switch (nextCommand()) |
461 | { | 481 | { |
462 | case LLMediaBase::COMMAND_START: | 482 | case LLMediaBase::COMMAND_START: |
463 | DEBUGMSG("COMMAND_START"); | 483 | LL_DEBUGS("MediaImpl") << "COMMAND_START" << LL_ENDL; |
464 | if (getStatus() == LLMediaBase::STATUS_PAUSED || | 484 | if (getStatus() == LLMediaBase::STATUS_PAUSED || |
465 | getStatus() == LLMediaBase::STATUS_NAVIGATING || | 485 | getStatus() == LLMediaBase::STATUS_NAVIGATING || |
466 | getStatus() == LLMediaBase::STATUS_STOPPED) | 486 | getStatus() == LLMediaBase::STATUS_STOPPED) |
467 | { | 487 | { |
468 | DEBUGMSG("doing COMMAND_START"); | ||
469 | play(); | 488 | play(); |
470 | setStatus(LLMediaBase::STATUS_STARTED); | 489 | setStatus(LLMediaBase::STATUS_STARTED); |
471 | clearCommand(); | 490 | clearCommand(); |
472 | } | 491 | } |
473 | break; | 492 | break; |
474 | case LLMediaBase::COMMAND_STOP: | 493 | case LLMediaBase::COMMAND_STOP: |
475 | DEBUGMSG("COMMAND_STOP"); | 494 | LL_DEBUGS("MediaImpl") << "COMMAND_STOP" << LL_ENDL; |
476 | DEBUGMSG("doing COMMAND_STOP"); | ||
477 | stop(); | 495 | stop(); |
478 | setStatus(LLMediaBase::STATUS_STOPPED); | 496 | setStatus(LLMediaBase::STATUS_STOPPED); |
479 | clearCommand(); | 497 | clearCommand(); |
480 | break; | 498 | break; |
481 | case LLMediaBase::COMMAND_PAUSE: | 499 | case LLMediaBase::COMMAND_PAUSE: |
482 | DEBUGMSG("COMMAND_PAUSE"); | 500 | LL_DEBUGS("MediaImpl") << "COMMAND_PAUSE" << LL_ENDL; |
483 | if (getStatus() == LLMediaBase::STATUS_STARTED) | 501 | if (getStatus() == LLMediaBase::STATUS_STARTED) |
484 | { | 502 | { |
485 | DEBUGMSG("doing COMMAND_PAUSE"); | ||
486 | pause(); | 503 | pause(); |
487 | setStatus(LLMediaBase::STATUS_PAUSED); | 504 | setStatus(LLMediaBase::STATUS_PAUSED); |
488 | clearCommand(); | 505 | clearCommand(); |
489 | } | 506 | } |
490 | break; | 507 | break; |
491 | default: | 508 | default: |
492 | DEBUGMSG("COMMAND_?"); | 509 | LL_INFOS("MediaImpl") << "Unknown command" << LL_ENDL; |
493 | clearCommand(); | 510 | clearCommand(); |
494 | break; | 511 | break; |
495 | case LLMediaBase::COMMAND_NONE: | 512 | case LLMediaBase::COMMAND_NONE: |
@@ -507,7 +524,7 @@ updateMedia () | |||
507 | GST_OBJECT_LOCK(mVideoSink); | 524 | GST_OBJECT_LOCK(mVideoSink); |
508 | if (mVideoSink->retained_frame_ready) | 525 | if (mVideoSink->retained_frame_ready) |
509 | { | 526 | { |
510 | DEBUGMSG("NEW FRAME "); | 527 | LL_DEBUGS("MediaImpl") <<"NEW FRAME " << LL_ENDL; |
511 | if (mVideoSink->retained_frame_width != getMediaWidth() || | 528 | if (mVideoSink->retained_frame_width != getMediaWidth() || |
512 | mVideoSink->retained_frame_height != getMediaHeight()) | 529 | mVideoSink->retained_frame_height != getMediaHeight()) |
513 | // *TODO: also check for change in format | 530 | // *TODO: also check for change in format |
@@ -527,8 +544,9 @@ updateMedia () | |||
527 | mTextureFormatType = LL_MEDIA_UNSIGNED_INT_8_8_8_8_REV; | 544 | mTextureFormatType = LL_MEDIA_UNSIGNED_INT_8_8_8_8_REV; |
528 | } | 545 | } |
529 | mMediaRowbytes = neww * newd; | 546 | mMediaRowbytes = neww * newd; |
530 | DEBUGMSG("video container resized to %dx%d", | 547 | LL_DEBUGS("MediaImpl") |
531 | neww, newh); | 548 | << "video container resized to " << |
549 | neww <<"x"<< newh << LL_ENDL; | ||
532 | 550 | ||
533 | delete[] mediaData; | 551 | delete[] mediaData; |
534 | mediaData = new unsigned char[mMediaRowbytes * | 552 | mediaData = new unsigned char[mMediaRowbytes * |
@@ -568,9 +586,10 @@ bool | |||
568 | LLMediaImplGStreamer:: | 586 | LLMediaImplGStreamer:: |
569 | stop () | 587 | stop () |
570 | { | 588 | { |
571 | DEBUGMSG("stopping media..."); | 589 | LL_DEBUGS("MediaImpl") << "stopping media..." << LL_ENDL; |
572 | // todo: error-check this? | 590 | // todo: error-check this? |
573 | llgst_element_set_state(mPlaybin, GST_STATE_READY); | 591 | llgst_element_set_state(mPlaybin, GST_STATE_READY); |
592 | mState = GST_STATE_READY; | ||
574 | return true; | 593 | return true; |
575 | } | 594 | } |
576 | 595 | ||
@@ -580,9 +599,10 @@ bool | |||
580 | LLMediaImplGStreamer:: | 599 | LLMediaImplGStreamer:: |
581 | play () | 600 | play () |
582 | { | 601 | { |
583 | DEBUGMSG("playing media..."); | 602 | LL_DEBUGS("MediaImpl") << "playing media..." << LL_ENDL; |
584 | // todo: error-check this? | 603 | // todo: error-check this? |
585 | llgst_element_set_state(mPlaybin, GST_STATE_PLAYING); | 604 | llgst_element_set_state(mPlaybin, GST_STATE_PLAYING); |
605 | mState = GST_STATE_PLAYING; | ||
586 | return true; | 606 | return true; |
587 | } | 607 | } |
588 | 608 | ||
@@ -592,9 +612,10 @@ bool | |||
592 | LLMediaImplGStreamer:: | 612 | LLMediaImplGStreamer:: |
593 | pause () | 613 | pause () |
594 | { | 614 | { |
595 | DEBUGMSG("pausing media..."); | 615 | LL_DEBUGS("MediaImpl") <<"pausing media..." << LL_ENDL; |
596 | // todo: error-check this? | 616 | // todo: error-check this? |
597 | llgst_element_set_state(mPlaybin, GST_STATE_PAUSED); | 617 | llgst_element_set_state(mPlaybin, GST_STATE_PAUSED); |
618 | mState = GST_STATE_PAUSED; | ||
598 | return true; | 619 | return true; |
599 | }; | 620 | }; |
600 | 621 | ||
@@ -624,8 +645,8 @@ seek( double time ) | |||
624 | GST_SEEK_TYPE_SET, gint64(time*1000000000.0F), | 645 | GST_SEEK_TYPE_SET, gint64(time*1000000000.0F), |
625 | GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE); | 646 | GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE); |
626 | } | 647 | } |
627 | DEBUGMSG("MEDIA SEEK REQUEST to %fsec result was %d", | 648 | LL_DEBUGS("MediaImpl") << "MEDIA SEEK REQUEST to " << float(time) |
628 | float(time), int(success)); | 649 | << "sec result was " << int(success) << LL_ENDL; |
629 | return success; | 650 | return success; |
630 | } | 651 | } |
631 | 652 | ||
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h index 247b0ce..4d0638a 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.h +++ b/linden/indra/llmedia/llmediaimplgstreamer.h | |||
@@ -100,9 +100,11 @@ class LLMediaImplGStreamer: | |||
100 | GMainLoop *mPump; // event pump for this media | 100 | GMainLoop *mPump; // event pump for this media |
101 | GstElement *mPlaybin; | 101 | GstElement *mPlaybin; |
102 | GstSLVideo *mVideoSink; | 102 | GstSLVideo *mVideoSink; |
103 | GstState mState; | ||
103 | #ifdef LL_GST_SOUNDSINK | 104 | #ifdef LL_GST_SOUNDSINK |
104 | GstSLSound *mAudioSink; | 105 | GstSLSound *mAudioSink; |
105 | #endif // LL_GST_SOUNDSINK | 106 | #endif // LL_GST_SOUNDSINK |
107 | GstState getState() const { return mState; } | ||
106 | }; | 108 | }; |
107 | 109 | ||
108 | class LLMediaImplGStreamerMaker : public LLMediaImplMaker | 110 | class LLMediaImplGStreamerMaker : public LLMediaImplMaker |
diff --git a/linden/indra/llmedia/llmediamanager.cpp b/linden/indra/llmedia/llmediamanager.cpp index 16c731f..57256e6 100644 --- a/linden/indra/llmedia/llmediamanager.cpp +++ b/linden/indra/llmedia/llmediamanager.cpp | |||
@@ -40,6 +40,7 @@ | |||
40 | # include "llmediaimplllmozlib.h" | 40 | # include "llmediaimplllmozlib.h" |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #include "llerror.h" | ||
43 | LLMediaManager* LLMediaManager::sInstance = 0; | 44 | LLMediaManager* LLMediaManager::sInstance = 0; |
44 | 45 | ||
45 | 46 | ||
@@ -75,6 +76,7 @@ void LLMediaManager::initClass( LLMediaManagerData* init_data ) | |||
75 | if ( ! sInstance ) | 76 | if ( ! sInstance ) |
76 | sInstance = new LLMediaManager(); | 77 | sInstance = new LLMediaManager(); |
77 | 78 | ||
79 | LL_DEBUGS("MediaManager") << "LLMediaManager::initClass" << LL_ENDL; | ||
78 | // Initialize impl classes here - this breaks the encapsulation model | 80 | // Initialize impl classes here - this breaks the encapsulation model |
79 | // but some of the initialization takes a long time and we only want to | 81 | // but some of the initialization takes a long time and we only want to |
80 | // do it once at app startup before any of the impls have been created | 82 | // do it once at app startup before any of the impls have been created |
@@ -84,10 +86,12 @@ void LLMediaManager::initClass( LLMediaManagerData* init_data ) | |||
84 | LLMediaImplExample2::startup( init_data ); | 86 | LLMediaImplExample2::startup( init_data ); |
85 | 87 | ||
86 | #if LL_QUICKTIME_ENABLED | 88 | #if LL_QUICKTIME_ENABLED |
89 | LL_DEBUGS("MediaManager") << "LLMediaManager::initClass: starting quicktime." << LL_ENDL; | ||
87 | LLMediaImplQuickTime::startup( init_data ); | 90 | LLMediaImplQuickTime::startup( init_data ); |
88 | #endif // LL_QUICKTIME_ENABLED | 91 | #endif // LL_QUICKTIME_ENABLED |
89 | 92 | ||
90 | #if LL_GSTREAMER_ENABLED | 93 | #if LL_GSTREAMER_ENABLED |
94 | LL_DEBUGS("MediaManager") << "LLMediaManager::initClass: starting gstreamer" << LL_ENDL; | ||
91 | LLMediaImplGStreamer::startup( init_data ); | 95 | LLMediaImplGStreamer::startup( init_data ); |
92 | #endif // LL_GSTREAMER_ENABLED | 96 | #endif // LL_GSTREAMER_ENABLED |
93 | } | 97 | } |