diff options
Diffstat (limited to 'linden')
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.cpp | 13 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.h | 54 |
2 files changed, 36 insertions, 31 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index 7eb2b7b..885ba7f 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp | |||
@@ -591,9 +591,6 @@ bool LLMediaImplGStreamer::navigateTo (const std::string urlIn) | |||
591 | 591 | ||
592 | mState = GST_STATE_READY; | 592 | mState = GST_STATE_READY; |
593 | 593 | ||
594 | // navigateTo implicitly plays, too. | ||
595 | play(); | ||
596 | |||
597 | return true; | 594 | return true; |
598 | } | 595 | } |
599 | 596 | ||
@@ -792,6 +789,13 @@ bool LLMediaImplGStreamer::play() | |||
792 | if (!mPlaybin || mState == GST_STATE_NULL) | 789 | if (!mPlaybin || mState == GST_STATE_NULL) |
793 | return true; | 790 | return true; |
794 | 791 | ||
792 | |||
793 | if( getState() == GST_STATE_PLAYING ) | ||
794 | { | ||
795 | LL_DEBUGS("MediaImpl") << "... but already playing." << LL_ENDL; | ||
796 | return true; | ||
797 | } | ||
798 | |||
795 | // Clean up the existing thread, if any. | 799 | // Clean up the existing thread, if any. |
796 | if( mPlayThread != NULL && mPlayThread->isStopped()) | 800 | if( mPlayThread != NULL && mPlayThread->isStopped()) |
797 | { | 801 | { |
@@ -813,9 +817,6 @@ bool LLMediaImplGStreamer::play() | |||
813 | 817 | ||
814 | void LLMediaImplGStreamer::startPlay() | 818 | void LLMediaImplGStreamer::startPlay() |
815 | { | 819 | { |
816 | GstElement *pipeline = (GstElement *)gst_object_ref(GST_OBJECT(mPlaybin)); | ||
817 | gst_object_unref(pipeline); | ||
818 | |||
819 | GstStateChangeReturn state_change; | 820 | GstStateChangeReturn state_change; |
820 | 821 | ||
821 | state_change = gst_element_set_state(mPlaybin, GST_STATE_PLAYING); | 822 | state_change = gst_element_set_state(mPlaybin, GST_STATE_PLAYING); |
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h index 32e6bd1..d1566e3 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.h +++ b/linden/indra/llmedia/llmediaimplgstreamer.h | |||
@@ -57,6 +57,8 @@ class LLMediaImplMaker; | |||
57 | class LLMediaImplGStreamer: | 57 | class LLMediaImplGStreamer: |
58 | public LLMediaImplCommon | 58 | public LLMediaImplCommon |
59 | { | 59 | { |
60 | friend class LLGstPlayThread; | ||
61 | |||
60 | public: | 62 | public: |
61 | LLMediaImplGStreamer (); | 63 | LLMediaImplGStreamer (); |
62 | virtual ~LLMediaImplGStreamer (); | 64 | virtual ~LLMediaImplGStreamer (); |
@@ -95,33 +97,35 @@ class LLMediaImplGStreamer: | |||
95 | /* virtual */ int getTextureFormatType() const; | 97 | /* virtual */ int getTextureFormatType() const; |
96 | /* virtual */ int getTextureFormatInternal() const; | 98 | /* virtual */ int getTextureFormatInternal() const; |
97 | /* virtual */ bool seek( double time ); | 99 | /* virtual */ bool seek( double time ); |
98 | /* virtual */ bool setVolume( float volume ); | 100 | /* virtual */ bool setVolume( float volume ); |
99 | 101 | ||
100 | void startPlay(); | 102 | LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;}; |
101 | 103 | ||
104 | protected: | ||
105 | |||
106 | void startPlay(); | ||
102 | 107 | ||
103 | LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;}; | ||
104 | 108 | ||
105 | private: | 109 | private: |
106 | 110 | ||
107 | // misc | 111 | // misc |
108 | bool unload(); | 112 | bool unload(); |
109 | bool pause(); | 113 | bool pause(); |
110 | bool stop(); | 114 | bool stop(); |
111 | bool play(); | 115 | bool play(); |
112 | 116 | ||
113 | static gboolean bus_callback (GstBus *bus, | 117 | static gboolean bus_callback (GstBus *bus, |
114 | GstMessage *message, | 118 | GstMessage *message, |
115 | gpointer data); | 119 | gpointer data); |
116 | unsigned char* mediaData; | ||
117 | int mMediaRowbytes; | ||
118 | 120 | ||
119 | int mTextureFormatPrimary; | 121 | unsigned char* mediaData; |
120 | int mTextureFormatType; | 122 | int mMediaRowbytes; |
123 | int mTextureFormatPrimary; | ||
124 | int mTextureFormatType; | ||
121 | 125 | ||
122 | // GStreamer-specific | 126 | // GStreamer-specific |
123 | GMainLoop *mPump; // event pump for this media | 127 | GMainLoop *mPump; // event pump for this media |
124 | GstElement *mPlaybin; | 128 | GstElement *mPlaybin; |
125 | GstSLVideo *mVideoSink; | 129 | GstSLVideo *mVideoSink; |
126 | GstState mState; | 130 | GstState mState; |
127 | GstState getState() const { return mState; } | 131 | GstState getState() const { return mState; } |
@@ -131,12 +135,12 @@ class LLMediaImplGStreamer: | |||
131 | 135 | ||
132 | class LLMediaImplGStreamerMaker : public LLMediaImplMaker | 136 | class LLMediaImplGStreamerMaker : public LLMediaImplMaker |
133 | { | 137 | { |
134 | public: | 138 | public: |
135 | LLMediaImplGStreamerMaker(); | 139 | LLMediaImplGStreamerMaker(); |
136 | LLMediaImplGStreamer* create() | 140 | LLMediaImplGStreamer* create() |
137 | { | 141 | { |
138 | return new LLMediaImplGStreamer(); | 142 | return new LLMediaImplGStreamer(); |
139 | } | 143 | } |
140 | }; | 144 | }; |
141 | 145 | ||
142 | ///////////////////////////////////////////////////////////////////////// | 146 | ///////////////////////////////////////////////////////////////////////// |