From 88b7e23cebcb943aa2ce160512f4ff7afe3797a5 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 4 Apr 2009 00:08:19 -0500 Subject: Refactored the heart of the GST play code to startPlay(). --- linden/indra/llmedia/llmediaimplgstreamer.cpp | 11 +++++++---- linden/indra/llmedia/llmediaimplgstreamer.h | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'linden/indra/llmedia') 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() if (!mPlaybin || mState == GST_STATE_NULL) return true; + startPlay(); + + return true; +} + +void LLMediaImplGStreamer::startPlay() +{ GstElement *pipeline = (GstElement *)gst_object_ref(GST_OBJECT(mPlaybin)); gst_object_unref(pipeline); gst_element_set_state(pipeline, GST_STATE_PLAYING); mState = GST_STATE_PLAYING; - /*gst_element_set_state(mPlaybin, GST_STATE_PLAYING); - mState = GST_STATE_PLAYING;*/ GstStateChangeReturn state_change = gst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE); LL_DEBUGS("MediaImpl") << "get_state: " << gst_element_state_change_return_get_name(state_change) << LL_ENDL; @@ -730,8 +735,6 @@ bool LLMediaImplGStreamer::play() setStatus(LLMediaBase::STATUS_STOPPED); stop(); } - - return true; } /////////////////////////////////////////////////////////////////////////////// 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: /* virtual */ bool seek( double time ); /* virtual */ bool setVolume( float volume ); + void startPlay(); + + LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;}; private: -- cgit v1.1