aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-04 00:08:19 -0500
committerJacek Antonelli2009-04-04 22:45:50 -0500
commit88b7e23cebcb943aa2ce160512f4ff7afe3797a5 (patch)
tree7df338f2ba6436d44dab92206fa2a12b4aa9cf1f /linden
parentApply saved MediaDebugLevel at media init time. (diff)
downloadmeta-impy-88b7e23cebcb943aa2ce160512f4ff7afe3797a5.zip
meta-impy-88b7e23cebcb943aa2ce160512f4ff7afe3797a5.tar.gz
meta-impy-88b7e23cebcb943aa2ce160512f4ff7afe3797a5.tar.bz2
meta-impy-88b7e23cebcb943aa2ce160512f4ff7afe3797a5.tar.xz
Refactored the heart of the GST play code to startPlay().
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.cpp11
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.h3
2 files changed, 10 insertions, 4 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp
index 532ec00..2ba33a1 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.cpp
+++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp
@@ -713,13 +713,18 @@ bool LLMediaImplGStreamer::play()
713 if (!mPlaybin || mState == GST_STATE_NULL) 713 if (!mPlaybin || mState == GST_STATE_NULL)
714 return true; 714 return true;
715 715
716 startPlay();
717
718 return true;
719}
720
721void LLMediaImplGStreamer::startPlay()
722{
716 GstElement *pipeline = (GstElement *)gst_object_ref(GST_OBJECT(mPlaybin)); 723 GstElement *pipeline = (GstElement *)gst_object_ref(GST_OBJECT(mPlaybin));
717 gst_object_unref(pipeline); 724 gst_object_unref(pipeline);
718 725
719 gst_element_set_state(pipeline, GST_STATE_PLAYING); 726 gst_element_set_state(pipeline, GST_STATE_PLAYING);
720 mState = GST_STATE_PLAYING; 727 mState = GST_STATE_PLAYING;
721 /*gst_element_set_state(mPlaybin, GST_STATE_PLAYING);
722 mState = GST_STATE_PLAYING;*/
723 728
724 GstStateChangeReturn state_change = gst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE); 729 GstStateChangeReturn state_change = gst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE);
725 LL_DEBUGS("MediaImpl") << "get_state: " << gst_element_state_change_return_get_name(state_change) << LL_ENDL; 730 LL_DEBUGS("MediaImpl") << "get_state: " << gst_element_state_change_return_get_name(state_change) << LL_ENDL;
@@ -730,8 +735,6 @@ bool LLMediaImplGStreamer::play()
730 setStatus(LLMediaBase::STATUS_STOPPED); 735 setStatus(LLMediaBase::STATUS_STOPPED);
731 stop(); 736 stop();
732 } 737 }
733
734 return true;
735} 738}
736 739
737/////////////////////////////////////////////////////////////////////////////// 740///////////////////////////////////////////////////////////////////////////////
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h
index 37eaf53..be4b3c0 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.h
+++ b/linden/indra/llmedia/llmediaimplgstreamer.h
@@ -96,6 +96,9 @@ class LLMediaImplGStreamer:
96 /* virtual */ bool seek( double time ); 96 /* virtual */ bool seek( double time );
97 /* virtual */ bool setVolume( float volume ); 97 /* virtual */ bool setVolume( float volume );
98 98
99 void startPlay();
100
101
99 LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;}; 102 LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;};
100 103
101 private: 104 private: