aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-02-18 12:24:17 -0700
committerMcCabe Maxsted2009-02-18 12:24:17 -0700
commit3d8d2e63eb60fc2268bd81b0f972ac9825b7214f (patch)
treefb78a26cd8cdc24158dba78dc51ee34186259b58
parentAdded GStreamer version info to About > Imprudence (diff)
downloadmeta-impy-3d8d2e63eb60fc2268bd81b0f972ac9825b7214f.zip
meta-impy-3d8d2e63eb60fc2268bd81b0f972ac9825b7214f.tar.gz
meta-impy-3d8d2e63eb60fc2268bd81b0f972ac9825b7214f.tar.bz2
meta-impy-3d8d2e63eb60fc2268bd81b0f972ac9825b7214f.tar.xz
Updated GStreamer comments
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.cpp36
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.h1
2 files changed, 32 insertions, 5 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp
index c7f2b4a..b17dbb9 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.cpp
+++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp
@@ -73,7 +73,7 @@ LLMediaImplGStreamer () :
73 mPump ( NULL ), 73 mPump ( NULL ),
74 mPlaybin ( NULL ), 74 mPlaybin ( NULL ),
75 mVideoSink ( NULL ), 75 mVideoSink ( NULL ),
76 mState( GST_STATE_NULL ) 76 mState( GST_STATE_NULL )
77{ 77{
78 LL_DEBUGS("MediaManager") << "constructing media..." << LL_ENDL; 78 LL_DEBUGS("MediaManager") << "constructing media..." << LL_ENDL;
79 mVolume = -1.0; // XXX Hack to make the vould change happend first time 79 mVolume = -1.0; // XXX Hack to make the vould change happend first time
@@ -94,6 +94,24 @@ LLMediaImplGStreamer () :
94 // todo: cleanup pump 94 // todo: cleanup pump
95 return; // error 95 return; // error
96 } 96 }
97
98 if (NULL == getenv("LL_GSTREAMER_EXTERNAL"))
99 {
100 // instantiate and connect a custom video sink
101 LL_DEBUGS("MediaManager") << "extrenal video sink..." << LL_ENDL;
102
103 // Plays inworld instead of in external player
104 mVideoSink =
105 GST_SLVIDEO(llgst_element_factory_make ("private-slvideo", "slvideo"));
106 if (!mVideoSink)
107 {
108 LL_WARNS("MediaImpl") << "Could not instantiate private-slvideo element." << LL_ENDL;
109 // todo: cleanup.
110 return; // error
111 }
112
113 g_object_set(mPlaybin, "video-sink", mVideoSink, NULL);
114 }
97} 115}
98 116
99// virtual 117// virtual
@@ -134,7 +152,7 @@ std::string LLMediaImplGStreamer::getVersion()
134} 152}
135 153
136// 154//
137//THIS IS THE METHOD THAT'S BREAKING STUFF 155// STARTUP
138/////////////////////////////////////////////////////////////////////////////// 156///////////////////////////////////////////////////////////////////////////////
139// (static) super-initialization - called once at application startup 157// (static) super-initialization - called once at application startup
140bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data) 158bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data)
@@ -148,6 +166,10 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data)
148 // Get symbols! 166 // Get symbols!
149#if LL_WINDOWS 167#if LL_WINDOWS
150 if (! grab_gst_syms("libgstreamer-0.10.dll", "libgstvideo-0.10.dll", "libgstaudio-0.10.dll") ) 168 if (! grab_gst_syms("libgstreamer-0.10.dll", "libgstvideo-0.10.dll", "libgstaudio-0.10.dll") )
169 {
170 LL_WARNS("MediaImpl") << "Couldn't find suitable GStreamer 0.10 support on this system - video playback disabled." << LL_ENDL;
171 return false;
172 }
151#else 173#else
152 if (! grab_gst_syms("libgstreamer-0.10.so.0", "libgstvideo-0.10.so.0", "libgstaudio-0.10.so.0") ) 174 if (! grab_gst_syms("libgstreamer-0.10.so.0", "libgstvideo-0.10.so.0", "libgstaudio-0.10.so.0") )
153 { 175 {
@@ -167,7 +189,7 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data)
167 saved_locale = setlocale(LC_ALL, NULL); 189 saved_locale = setlocale(LC_ALL, NULL);
168 if (0 == llgst_init_check(NULL, NULL, NULL)) 190 if (0 == llgst_init_check(NULL, NULL, NULL))
169 { 191 {
170 LL_WARNS("MediaImpl") << "GST init failed for unspecified reason." << LL_ENDL; 192 LL_WARNS("MediaImpl") << "GStreamer library failed to initialize and load standard plugins." << LL_ENDL;
171 setlocale(LC_ALL, saved_locale.c_str() ); 193 setlocale(LC_ALL, saved_locale.c_str() );
172 return false; 194 return false;
173 } 195 }
@@ -191,6 +213,7 @@ bool LLMediaImplGStreamer::closedown()
191 213
192/////////////////////////////////////////////////////////////////////////////// 214///////////////////////////////////////////////////////////////////////////////
193// 215//
216// Uncomment the line below to enable spammy debug data.
194//#define LL_GST_REPORT_STATE_CHANGES 217//#define LL_GST_REPORT_STATE_CHANGES
195#ifdef LL_GST_REPORT_STATE_CHANGES 218#ifdef LL_GST_REPORT_STATE_CHANGES
196static const char* get_gst_state_name(GstState state) 219static const char* get_gst_state_name(GstState state)
@@ -256,7 +279,8 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
256 LL_DEBUGS("MediaImpl") << "State changed to NULL" << LL_ENDL; 279 LL_DEBUGS("MediaImpl") << "State changed to NULL" << LL_ENDL;
257#endif 280#endif
258 if (impl->getState() == GST_STATE_PLAYING) 281 if (impl->getState() == GST_STATE_PLAYING)
259 { // We got stoped by gstremer... 282 {
283 // Stream was probably dropped, trying to restart
260 impl->play(); 284 impl->play();
261#ifdef LL_GST_REPORT_STATE_CHANGES 285#ifdef LL_GST_REPORT_STATE_CHANGES
262 LL_DEBUGS("MediaImpl") << "Trying to restart." << LL_ENDL; 286 LL_DEBUGS("MediaImpl") << "Trying to restart." << LL_ENDL;
@@ -590,7 +614,9 @@ bool LLMediaImplGStreamer::play()
590 614
591 // Check to make sure playing was successful. If not, stop. 615 // Check to make sure playing was successful. If not, stop.
592 if (state_change == GST_STATE_CHANGE_FAILURE) 616 if (state_change == GST_STATE_CHANGE_FAILURE)
617 {
593 stop(); 618 stop();
619 }
594 620
595 return true; 621 return true;
596} 622}
@@ -644,7 +670,7 @@ bool LLMediaImplGStreamer::seek(double time)
644// virtual 670// virtual
645bool LLMediaImplGStreamer::setVolume(float volume) 671bool LLMediaImplGStreamer::setVolume(float volume)
646{ 672{
647 // XXX hack to make volume volume changes less othen 673 // XXX hack to make volume volume changes less othen
648 // bug in gstreamer 0.10.21 674 // bug in gstreamer 0.10.21
649 if(mVolume == volume) 675 if(mVolume == volume)
650 return true; 676 return true;
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h
index 5b493ad..10b01dd 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.h
+++ b/linden/indra/llmedia/llmediaimplgstreamer.h
@@ -84,6 +84,7 @@ class LLMediaImplGStreamer:
84 bool pause(); 84 bool pause();
85 bool stop(); 85 bool stop();
86 bool play(); 86 bool play();
87
87 static gboolean bus_callback (GstBus *bus, 88 static gboolean bus_callback (GstBus *bus,
88 GstMessage *message, 89 GstMessage *message,
89 gpointer data); 90 gpointer data);