From 93df1af5901576eb16bd6bc4c74100d16ed32870 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 18 Apr 2009 02:00:26 -0500 Subject: Removed some useless code from LLMediaImplGStreamer::startPlay(). --- linden/indra/llmedia/llmediaimplgstreamer.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'linden') diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index 7eb2b7b..5cf7eed 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp @@ -813,9 +813,6 @@ bool LLMediaImplGStreamer::play() void LLMediaImplGStreamer::startPlay() { - GstElement *pipeline = (GstElement *)gst_object_ref(GST_OBJECT(mPlaybin)); - gst_object_unref(pipeline); - GstStateChangeReturn state_change; state_change = gst_element_set_state(mPlaybin, GST_STATE_PLAYING); -- cgit v1.1 From a6c1d49480c27b24ecb0e7778dd44782c5fe20b1 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 18 Apr 2009 02:56:02 -0500 Subject: LLMediaImplGStreamer::play() is no-op if already playing. --- linden/indra/llmedia/llmediaimplgstreamer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'linden') diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index 5cf7eed..3fd6d6e 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp @@ -792,6 +792,13 @@ bool LLMediaImplGStreamer::play() if (!mPlaybin || mState == GST_STATE_NULL) return true; + + if( getState() == GST_STATE_PLAYING ) + { + LL_DEBUGS("MediaImpl") << "... but already playing." << LL_ENDL; + return true; + } + // Clean up the existing thread, if any. if( mPlayThread != NULL && mPlayThread->isStopped()) { -- cgit v1.1 From a84bece4c4ba0a70d469be21cfbfe230f504f801 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 18 Apr 2009 02:56:52 -0500 Subject: Removed redundant play() from LLMediaImplGStreamer::navigateTo(). --- linden/indra/llmedia/llmediaimplgstreamer.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'linden') diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index 3fd6d6e..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) mState = GST_STATE_READY; - // navigateTo implicitly plays, too. - play(); - return true; } -- cgit v1.1 From 0c2b0d0767c48aa3cb02d378c7ff021f66284c40 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 18 Apr 2009 03:20:54 -0500 Subject: LLMediaImplGStreamer::startPlay() is protected, LLGstPlayThread friend. --- linden/indra/llmedia/llmediaimplgstreamer.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'linden') diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h index 32e6bd1..4145f33 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.h +++ b/linden/indra/llmedia/llmediaimplgstreamer.h @@ -57,6 +57,8 @@ class LLMediaImplMaker; class LLMediaImplGStreamer: public LLMediaImplCommon { + friend class LLGstPlayThread; + public: LLMediaImplGStreamer (); virtual ~LLMediaImplGStreamer (); @@ -97,10 +99,12 @@ class LLMediaImplGStreamer: /* virtual */ bool seek( double time ); /* virtual */ bool setVolume( float volume ); - void startPlay(); + LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;}; + protected: + + void startPlay(); - LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;}; private: -- cgit v1.1 From e22a9a793e76459a72afb45e822624d251ff5a50 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 18 Apr 2009 03:32:05 -0500 Subject: Cleaned up indentation in llmediaimplgstreamer.h. --- linden/indra/llmedia/llmediaimplgstreamer.h | 48 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'linden') diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h index 4145f33..d1566e3 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.h +++ b/linden/indra/llmedia/llmediaimplgstreamer.h @@ -97,9 +97,9 @@ class LLMediaImplGStreamer: /* virtual */ int getTextureFormatType() const; /* virtual */ int getTextureFormatInternal() const; /* virtual */ bool seek( double time ); - /* virtual */ bool setVolume( float volume ); + /* virtual */ bool setVolume( float volume ); - LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;}; + LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;}; protected: @@ -108,24 +108,24 @@ class LLMediaImplGStreamer: private: - // misc - bool unload(); - bool pause(); - bool stop(); - bool play(); - - static gboolean bus_callback (GstBus *bus, - GstMessage *message, - gpointer data); - unsigned char* mediaData; - int mMediaRowbytes; + // misc + bool unload(); + bool pause(); + bool stop(); + bool play(); + + static gboolean bus_callback (GstBus *bus, + GstMessage *message, + gpointer data); - int mTextureFormatPrimary; - int mTextureFormatType; + unsigned char* mediaData; + int mMediaRowbytes; + int mTextureFormatPrimary; + int mTextureFormatType; - // GStreamer-specific - GMainLoop *mPump; // event pump for this media - GstElement *mPlaybin; + // GStreamer-specific + GMainLoop *mPump; // event pump for this media + GstElement *mPlaybin; GstSLVideo *mVideoSink; GstState mState; GstState getState() const { return mState; } @@ -135,12 +135,12 @@ class LLMediaImplGStreamer: class LLMediaImplGStreamerMaker : public LLMediaImplMaker { -public: - LLMediaImplGStreamerMaker(); - LLMediaImplGStreamer* create() - { - return new LLMediaImplGStreamer(); - } + public: + LLMediaImplGStreamerMaker(); + LLMediaImplGStreamer* create() + { + return new LLMediaImplGStreamer(); + } }; ///////////////////////////////////////////////////////////////////////// -- cgit v1.1