diff options
Diffstat (limited to 'linden/indra/llmedia')
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.cpp | 39 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.h | 6 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaobserver.h | 1 |
3 files changed, 31 insertions, 15 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index d1bab29..a9e0004 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp | |||
@@ -89,6 +89,7 @@ LLMediaImplGStreamer () : | |||
89 | mPump ( NULL ), | 89 | mPump ( NULL ), |
90 | mPlaybin ( NULL ), | 90 | mPlaybin ( NULL ), |
91 | mVideoSink ( NULL ), | 91 | mVideoSink ( NULL ), |
92 | mLastTitle ( "" ), | ||
92 | mState( GST_STATE_NULL ), | 93 | mState( GST_STATE_NULL ), |
93 | mPlayThread ( NULL ) | 94 | mPlayThread ( NULL ) |
94 | { | 95 | { |
@@ -470,6 +471,8 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp | |||
470 | case GST_STATE_PAUSED: | 471 | case GST_STATE_PAUSED: |
471 | break; | 472 | break; |
472 | case GST_STATE_PLAYING: | 473 | case GST_STATE_PLAYING: |
474 | //impl->mLastTitle = ""; | ||
475 | |||
473 | LLMediaEvent event( impl, 100 ); | 476 | LLMediaEvent event( impl, 100 ); |
474 | impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); | 477 | impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); |
475 | // emit an event to say that a media source was loaded | 478 | // emit an event to say that a media source was loaded |
@@ -521,18 +524,28 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp | |||
521 | } | 524 | } |
522 | case GST_MESSAGE_TAG: | 525 | case GST_MESSAGE_TAG: |
523 | { | 526 | { |
524 | GstTagList *tag_list; | 527 | GstTagList *new_tags; |
525 | gchar *title; | 528 | |
526 | gchar *artist; | 529 | gst_message_parse_tag( message, &new_tags ); |
527 | gst_message_parse_tag(message, &tag_list); | 530 | |
528 | gboolean hazTitle = gst_tag_list_get_string(tag_list, | 531 | gchar *title; |
529 | GST_TAG_TITLE, &title); | 532 | |
530 | gboolean hazArtist = gst_tag_list_get_string(tag_list, | 533 | if ( gst_tag_list_get_string(new_tags, GST_TAG_TITLE, &title) ) |
531 | GST_TAG_ARTIST, &artist); | 534 | { |
532 | if(hazTitle) | 535 | LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL; |
533 | LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL; | 536 | std::string newtitle(title); |
534 | if(hazArtist) | 537 | gst_tag_list_free(new_tags); |
535 | LL_INFOS("MediaInfo") << "Artist: " << artist << LL_ENDL; | 538 | |
539 | if ( newtitle != impl->mLastTitle && newtitle != "" ) | ||
540 | { | ||
541 | impl->mLastTitle = newtitle; | ||
542 | LLMediaEvent event( impl, impl->mLastTitle ); | ||
543 | impl->getEventEmitter().update( &LLMediaObserver::onMediaTitleChange, event ); | ||
544 | } | ||
545 | |||
546 | g_free(title); | ||
547 | } | ||
548 | |||
536 | break; | 549 | break; |
537 | } | 550 | } |
538 | case GST_MESSAGE_EOS: | 551 | case GST_MESSAGE_EOS: |
@@ -551,10 +564,10 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp | |||
551 | impl->addCommand(LLMediaBase::COMMAND_STOP); | 564 | impl->addCommand(LLMediaBase::COMMAND_STOP); |
552 | } | 565 | } |
553 | break; | 566 | break; |
567 | } | ||
554 | default: | 568 | default: |
555 | /* unhandled message */ | 569 | /* unhandled message */ |
556 | break; | 570 | break; |
557 | } | ||
558 | } | 571 | } |
559 | /* we want to be notified again the next time there is a message | 572 | /* we want to be notified again the next time there is a message |
560 | * on the bus, so return true (false means we want to stop watching | 573 | * on the bus, so return true (false means we want to stop watching |
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h index baefdaf..8d2e756 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.h +++ b/linden/indra/llmedia/llmediaimplgstreamer.h | |||
@@ -40,12 +40,13 @@ | |||
40 | ///#if LL_GSTREAMER_ENABLED | 40 | ///#if LL_GSTREAMER_ENABLED |
41 | 41 | ||
42 | extern "C" { | 42 | extern "C" { |
43 | #include <stdio.h> | ||
44 | #include <gst/gst.h> | 43 | #include <gst/gst.h> |
44 | } | ||
45 | 45 | ||
46 | #include <stdio.h> | ||
46 | #include "apr_pools.h" | 47 | #include "apr_pools.h" |
47 | #include "apr_dso.h" | 48 | #include "apr_dso.h" |
48 | } | 49 | |
49 | 50 | ||
50 | #include "llmediaimplgstreamervidplug.h" | 51 | #include "llmediaimplgstreamervidplug.h" |
51 | #include "llgstplaythread.h" | 52 | #include "llgstplaythread.h" |
@@ -127,6 +128,7 @@ class LLMediaImplGStreamer: | |||
127 | GMainLoop *mPump; // event pump for this media | 128 | GMainLoop *mPump; // event pump for this media |
128 | GstElement *mPlaybin; | 129 | GstElement *mPlaybin; |
129 | GstSLVideo *mVideoSink; | 130 | GstSLVideo *mVideoSink; |
131 | std::string mLastTitle; | ||
130 | GstState mState; | 132 | GstState mState; |
131 | GstState getState() const { return mState; } | 133 | GstState getState() const { return mState; } |
132 | 134 | ||
diff --git a/linden/indra/llmedia/llmediaobserver.h b/linden/indra/llmedia/llmediaobserver.h index 5f794bb..ab8d755 100644 --- a/linden/indra/llmedia/llmediaobserver.h +++ b/linden/indra/llmedia/llmediaobserver.h | |||
@@ -103,6 +103,7 @@ class LLMediaObserver | |||
103 | virtual void onMediaSizeChange( const EventType& event_in ) { } | 103 | virtual void onMediaSizeChange( const EventType& event_in ) { } |
104 | virtual void onMediaContentsChange( const EventType& event_in ) { } | 104 | virtual void onMediaContentsChange( const EventType& event_in ) { } |
105 | virtual void onMediaStatusTextChange( const EventType& event_in ) { } | 105 | virtual void onMediaStatusTextChange( const EventType& event_in ) { } |
106 | virtual void onMediaTitleChange( const EventType &event_in ) { } | ||
106 | virtual void onNavigateBegin( const EventType& event_in ) { } | 107 | virtual void onNavigateBegin( const EventType& event_in ) { } |
107 | virtual void onNavigateComplete( const EventType& event_in ) { } | 108 | virtual void onNavigateComplete( const EventType& event_in ) { } |
108 | virtual void onUpdateProgress( const EventType& event_in ) { } | 109 | virtual void onUpdateProgress( const EventType& event_in ) { } |