aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia
diff options
context:
space:
mode:
authorJacek Antonelli2009-03-26 01:41:38 -0500
committerJacek Antonelli2009-03-26 01:41:38 -0500
commit0735f182a48966865fc5a198c10b8a7c0a317634 (patch)
tree65696060978a8f6360550ea5856b1476a7e6479a /linden/indra/llmedia
parentLink with some gstreamer core libs on Linux. (diff)
downloadmeta-impy-0735f182a48966865fc5a198c10b8a7c0a317634.zip
meta-impy-0735f182a48966865fc5a198c10b8a7c0a317634.tar.gz
meta-impy-0735f182a48966865fc5a198c10b8a7c0a317634.tar.bz2
meta-impy-0735f182a48966865fc5a198c10b8a7c0a317634.tar.xz
Removed all that llgst and symbol grabbing silliness.
Some symbols require gstreamer >= 0.10.11.
Diffstat (limited to '')
-rw-r--r--linden/indra/llmedia/CMakeLists.txt2
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.cpp118
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamervidplug.cpp57
3 files changed, 71 insertions, 106 deletions
diff --git a/linden/indra/llmedia/CMakeLists.txt b/linden/indra/llmedia/CMakeLists.txt
index 026afc1..0440153 100644
--- a/linden/indra/llmedia/CMakeLists.txt
+++ b/linden/indra/llmedia/CMakeLists.txt
@@ -30,7 +30,6 @@ set(llmedia_SOURCE_FILES
30 llmediaimplfactory.cpp 30 llmediaimplfactory.cpp
31 llmediamanager.cpp 31 llmediamanager.cpp
32 llmediaimplgstreamer.cpp 32 llmediaimplgstreamer.cpp
33 llmediaimplgstreamer_syms.cpp
34 llmediaimplgstreamervidplug.cpp 33 llmediaimplgstreamervidplug.cpp
35 ) 34 )
36 35
@@ -48,7 +47,6 @@ set(llmedia_HEADER_FILES
48 llmediaobserver.h 47 llmediaobserver.h
49 llmediaimplgstreamer.h 48 llmediaimplgstreamer.h
50 llmediaimplgstreamervidplug.h 49 llmediaimplgstreamervidplug.h
51 llmediaimplgstreamer_syms.h
52 ) 50 )
53 51
54 # Work around a bad interaction between broken gstreamer headers and 52 # Work around a bad interaction between broken gstreamer headers and
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp
index 30706f1..5d4d553 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.cpp
+++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp
@@ -44,9 +44,8 @@ extern "C" {
44 44
45#include "llmediaimplgstreamervidplug.h" 45#include "llmediaimplgstreamervidplug.h"
46 46
47#include "llmediaimplgstreamer_syms.h"
48
49#include "llerror.h" 47#include "llerror.h"
48#include "linden_common.h"
50 49
51// register this impl with media manager factory 50// register this impl with media manager factory
52static LLMediaImplRegister sLLMediaImplGStreamerReg( "LLMediaImplGStreamer", new LLMediaImplGStreamerMaker() ); 51static LLMediaImplRegister sLLMediaImplGStreamerReg( "LLMediaImplGStreamer", new LLMediaImplGStreamerMaker() );
@@ -90,7 +89,7 @@ LLMediaImplGStreamer () :
90 } 89 }
91 90
92 // instantiate a playbin element to do the hard work 91 // instantiate a playbin element to do the hard work
93 mPlaybin = llgst_element_factory_make ("playbin", "play"); 92 mPlaybin = gst_element_factory_make ("playbin", "play");
94 if (!mPlaybin) 93 if (!mPlaybin)
95 { 94 {
96 // todo: cleanup pump 95 // todo: cleanup pump
@@ -104,7 +103,7 @@ LLMediaImplGStreamer () :
104 103
105 // Plays inworld instead of in external player 104 // Plays inworld instead of in external player
106 mVideoSink = 105 mVideoSink =
107 GST_SLVIDEO(llgst_element_factory_make ("private-slvideo", "slvideo")); 106 GST_SLVIDEO(gst_element_factory_make ("private-slvideo", "slvideo"));
108 if (!mVideoSink) 107 if (!mVideoSink)
109 { 108 {
110 LL_WARNS("MediaImpl") << "Could not instantiate private-slvideo element." << LL_ENDL; 109 LL_WARNS("MediaImpl") << "Could not instantiate private-slvideo element." << LL_ENDL;
@@ -148,7 +147,7 @@ LLMediaImplGStreamer::
148std::string LLMediaImplGStreamer::getVersion() 147std::string LLMediaImplGStreamer::getVersion()
149{ 148{
150 guint major, minor, micro, nano; 149 guint major, minor, micro, nano;
151 llgst_version(&major, &minor, &micro, &nano); 150 gst_version(&major, &minor, &micro, &nano);
152 std::string version = llformat("%d.%d.%d.%d",major,minor,micro,nano); 151 std::string version = llformat("%d.%d.%d.%d",major,minor,micro,nano);
153 return version; 152 return version;
154} 153}
@@ -165,31 +164,10 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data)
165 // Init the glib type system - we need it. 164 // Init the glib type system - we need it.
166 g_type_init(); 165 g_type_init();
167 166
168 // Get symbols!
169#if LL_WINDOWS
170 if (! grab_gst_syms("libgstreamer-0.10.dll", "libgstvideo-0.10.dll", "libgstaudio-0.10.dll") )
171 {
172 LL_WARNS("MediaImpl") << "Couldn't find suitable GStreamer 0.10 support on this system - video playback disabled." << LL_ENDL;
173 return false;
174 }
175#else
176 if (! grab_gst_syms("libgstreamer-0.10.so.0", "libgstvideo-0.10.so.0", "libgstaudio-0.10.so.0") )
177 {
178 LL_WARNS("MediaImpl") << "Couldn't find suitable GStreamer 0.10 support on this system - video playback disabled." << LL_ENDL;
179 return false;
180 }
181#endif
182 if (llgst_segtrap_set_enabled)
183 llgst_segtrap_set_enabled(FALSE);
184 else
185 {
186 LL_WARNS("MediaImpl") << "gst_segtrap_set_enabled() is not available; Automated crash-reporter may cease to function until next restart." << LL_ENDL;
187 }
188
189 // Protect against GStreamer resetting the locale, yuck. 167 // Protect against GStreamer resetting the locale, yuck.
190 static std::string saved_locale; 168 static std::string saved_locale;
191 saved_locale = setlocale(LC_ALL, NULL); 169 saved_locale = setlocale(LC_ALL, NULL);
192 if (0 == llgst_init_check(NULL, NULL, NULL)) 170 if (0 == gst_init_check(NULL, NULL, NULL))
193 { 171 {
194 LL_WARNS("MediaImpl") << "GStreamer library failed to initialize and load standard plugins." << LL_ENDL; 172 LL_WARNS("MediaImpl") << "GStreamer library failed to initialize and load standard plugins." << LL_ENDL;
195 setlocale(LC_ALL, saved_locale.c_str() ); 173 setlocale(LC_ALL, saved_locale.c_str() );
@@ -208,7 +186,6 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data)
208 186
209bool LLMediaImplGStreamer::closedown() 187bool LLMediaImplGStreamer::closedown()
210{ 188{
211 ungrab_gst_syms();
212 return true; 189 return true;
213} 190}
214 191
@@ -236,7 +213,7 @@ static const char* get_gst_state_name(GstState state)
236gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gpointer data) 213gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gpointer data)
237{ 214{
238#ifdef LL_GST_REPORT_STATE_CHANGES 215#ifdef LL_GST_REPORT_STATE_CHANGES
239 LL_DEBUGS("MediaCallback") << "Got GST message type: " << LLGST_MESSAGE_TYPE_NAME (message) << LL_ENDL; 216 LL_DEBUGS("MediaCallback") << "Got GST message type: " << GST_MESSAGE_TYPE_NAME (message) << LL_ENDL;
240#endif 217#endif
241 218
242 LLMediaImplGStreamer *impl = (LLMediaImplGStreamer*)data; 219 LLMediaImplGStreamer *impl = (LLMediaImplGStreamer*)data;
@@ -245,17 +222,13 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
245 { 222 {
246 case GST_MESSAGE_BUFFERING: 223 case GST_MESSAGE_BUFFERING:
247 { 224 {
248 // NEEDS GST 0.10.11+ 225 gint percent = 0;
249 if (llgst_message_parse_buffering) 226 gst_message_parse_buffering(message, &percent);
250 {
251 gint percent = 0;
252 llgst_message_parse_buffering(message, &percent);
253#ifdef LL_GST_REPORT_STATE_CHANGES 227#ifdef LL_GST_REPORT_STATE_CHANGES
254 LL_DEBUGS("MediaBuffering") << "GST buffering: " << percent << "%%" << LL_ENDL; 228 LL_DEBUGS("MediaBuffering") << "GST buffering: " << percent << "%%" << LL_ENDL;
255#endif 229#endif
256 LLMediaEvent event( impl, percent ); 230 LLMediaEvent event( impl, percent );
257 impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); 231 impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event );
258 }
259 } 232 }
260 break; 233 break;
261 case GST_MESSAGE_STATE_CHANGED: 234 case GST_MESSAGE_STATE_CHANGED:
@@ -263,7 +236,7 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
263 GstState old_state; 236 GstState old_state;
264 GstState new_state; 237 GstState new_state;
265 GstState pending_state; 238 GstState pending_state;
266 llgst_message_parse_state_changed(message, 239 gst_message_parse_state_changed(message,
267 &old_state, 240 &old_state,
268 &new_state, 241 &new_state,
269 &pending_state); 242 &pending_state);
@@ -308,7 +281,7 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
308 GError *err = NULL; 281 GError *err = NULL;
309 gchar *debug = NULL; 282 gchar *debug = NULL;
310 283
311 llgst_message_parse_error (message, &err, &debug); 284 gst_message_parse_error (message, &err, &debug);
312 LL_WARNS("MediaImpl") << "GST Error: " << err->message << LL_ENDL; 285 LL_WARNS("MediaImpl") << "GST Error: " << err->message << LL_ENDL;
313 g_error_free (err); 286 g_error_free (err);
314 g_free (debug); 287 g_free (debug);
@@ -320,17 +293,14 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
320 } 293 }
321 case GST_MESSAGE_INFO: 294 case GST_MESSAGE_INFO:
322 { 295 {
323 if (llgst_message_parse_info) 296 GError *err = NULL;
324 { 297 gchar *debug = NULL;
325 GError *err = NULL;
326 gchar *debug = NULL;
327 298
328 llgst_message_parse_info (message, &err, &debug); 299 gst_message_parse_info (message, &err, &debug);
329 LL_INFOS("MediaImpl") << "GST info: " << err->message 300 LL_INFOS("MediaImpl") << "GST info: " << err->message
330 << LL_ENDL; 301 << LL_ENDL;
331 g_error_free (err); 302 g_error_free (err);
332 g_free (debug); 303 g_free (debug);
333 }
334 break; 304 break;
335 } 305 }
336 case GST_MESSAGE_WARNING: 306 case GST_MESSAGE_WARNING:
@@ -338,7 +308,7 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
338 GError *err = NULL; 308 GError *err = NULL;
339 gchar *debug = NULL; 309 gchar *debug = NULL;
340 310
341 llgst_message_parse_warning (message, &err, &debug); 311 gst_message_parse_warning (message, &err, &debug);
342 LL_WARNS("MediaImpl") << "GST warning: " << err->message 312 LL_WARNS("MediaImpl") << "GST warning: " << err->message
343 << LL_ENDL; 313 << LL_ENDL;
344 g_error_free (err); 314 g_error_free (err);
@@ -351,10 +321,10 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
351 GstTagList *tag_list; 321 GstTagList *tag_list;
352 gchar *title; 322 gchar *title;
353 gchar *artist; 323 gchar *artist;
354 llgst_message_parse_tag(message, &tag_list); 324 gst_message_parse_tag(message, &tag_list);
355 gboolean hazTitle = llgst_tag_list_get_string(tag_list, 325 gboolean hazTitle = gst_tag_list_get_string(tag_list,
356 GST_TAG_TITLE, &title); 326 GST_TAG_TITLE, &title);
357 gboolean hazArtist = llgst_tag_list_get_string(tag_list, 327 gboolean hazArtist = gst_tag_list_get_string(tag_list,
358 GST_TAG_ARTIST, &artist); 328 GST_TAG_ARTIST, &artist);
359 if(hazTitle) 329 if(hazTitle)
360 LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL; 330 LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL;
@@ -408,13 +378,13 @@ bool LLMediaImplGStreamer::navigateTo (const std::string urlIn)
408 g_object_set (G_OBJECT (mPlaybin), "uri", urlIn.c_str(), NULL); 378 g_object_set (G_OBJECT (mPlaybin), "uri", urlIn.c_str(), NULL);
409 379
410 // get playbin's bus - perhaps this can/should be done in ctor 380 // get playbin's bus - perhaps this can/should be done in ctor
411 GstBus *bus = llgst_pipeline_get_bus (GST_PIPELINE (mPlaybin)); 381 GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (mPlaybin));
412 if (!bus) 382 if (!bus)
413 { 383 {
414 return false; 384 return false;
415 } 385 }
416 llgst_bus_add_watch (bus, bus_callback, this); 386 gst_bus_add_watch (bus, bus_callback, this);
417 llgst_object_unref (bus); 387 gst_object_unref (bus);
418 388
419 mState = GST_STATE_READY; 389 mState = GST_STATE_READY;
420 390
@@ -431,9 +401,9 @@ bool LLMediaImplGStreamer::unload()
431 LL_DEBUGS("MediaImpl") << "unloading media..." << LL_ENDL; 401 LL_DEBUGS("MediaImpl") << "unloading media..." << LL_ENDL;
432 if (mPlaybin) 402 if (mPlaybin)
433 { 403 {
434 llgst_element_set_state (mPlaybin, GST_STATE_NULL); 404 gst_element_set_state (mPlaybin, GST_STATE_NULL);
435 mState = GST_STATE_NULL; 405 mState = GST_STATE_NULL;
436 llgst_object_unref (GST_OBJECT (mPlaybin)); 406 gst_object_unref (GST_OBJECT (mPlaybin));
437 mPlaybin = NULL; 407 mPlaybin = NULL;
438 } 408 }
439 409
@@ -591,18 +561,18 @@ bool LLMediaImplGStreamer::stop()
591 if (!mPlaybin || mState == GST_STATE_NULL) 561 if (!mPlaybin || mState == GST_STATE_NULL)
592 return true; 562 return true;
593 563
594 GstElement *pipeline = (GstElement *)llgst_object_ref(GST_OBJECT(mPlaybin)); 564 GstElement *pipeline = (GstElement *)gst_object_ref(GST_OBJECT(mPlaybin));
595 llgst_object_unref(pipeline); 565 gst_object_unref(pipeline);
596 566
597 llgst_element_set_state(pipeline, GST_STATE_READY); 567 gst_element_set_state(pipeline, GST_STATE_READY);
598 568
599 if (mState == GST_STATE_PLAYING) 569 if (mState == GST_STATE_PLAYING)
600 mState = GST_STATE_VOID_PENDING; 570 mState = GST_STATE_VOID_PENDING;
601 else 571 else
602 mState = GST_STATE_READY; 572 mState = GST_STATE_READY;
603 573
604 GstStateChangeReturn state_change = llgst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE); 574 GstStateChangeReturn state_change = gst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE);
605 LL_DEBUGS("MediaImpl") << "get_state: " << llgst_element_state_change_return_get_name(state_change) << LL_ENDL; 575 LL_DEBUGS("MediaImpl") << "get_state: " << gst_element_state_change_return_get_name(state_change) << LL_ENDL;
606 576
607 return true; 577 return true;
608} 578}
@@ -616,16 +586,16 @@ bool LLMediaImplGStreamer::play()
616 if (!mPlaybin || mState == GST_STATE_NULL) 586 if (!mPlaybin || mState == GST_STATE_NULL)
617 return true; 587 return true;
618 588
619 GstElement *pipeline = (GstElement *)llgst_object_ref(GST_OBJECT(mPlaybin)); 589 GstElement *pipeline = (GstElement *)gst_object_ref(GST_OBJECT(mPlaybin));
620 llgst_object_unref(pipeline); 590 gst_object_unref(pipeline);
621 591
622 llgst_element_set_state(pipeline, GST_STATE_PLAYING); 592 gst_element_set_state(pipeline, GST_STATE_PLAYING);
623 mState = GST_STATE_PLAYING; 593 mState = GST_STATE_PLAYING;
624 /*llgst_element_set_state(mPlaybin, GST_STATE_PLAYING); 594 /*gst_element_set_state(mPlaybin, GST_STATE_PLAYING);
625 mState = GST_STATE_PLAYING;*/ 595 mState = GST_STATE_PLAYING;*/
626 596
627 GstStateChangeReturn state_change = llgst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE); 597 GstStateChangeReturn state_change = gst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE);
628 LL_DEBUGS("MediaImpl") << "get_state: " << llgst_element_state_change_return_get_name(state_change) << LL_ENDL; 598 LL_DEBUGS("MediaImpl") << "get_state: " << gst_element_state_change_return_get_name(state_change) << LL_ENDL;
629 599
630 // Check to make sure playing was successful. If not, stop. 600 // Check to make sure playing was successful. If not, stop.
631 if (state_change == GST_STATE_CHANGE_FAILURE) 601 if (state_change == GST_STATE_CHANGE_FAILURE)
@@ -646,11 +616,11 @@ bool LLMediaImplGStreamer::pause()
646 if (!mPlaybin || mState == GST_STATE_NULL) 616 if (!mPlaybin || mState == GST_STATE_NULL)
647 return true; 617 return true;
648 618
649 llgst_element_set_state(mPlaybin, GST_STATE_PAUSED); 619 gst_element_set_state(mPlaybin, GST_STATE_PAUSED);
650 mState = GST_STATE_PAUSED; 620 mState = GST_STATE_PAUSED;
651 621
652 GstStateChangeReturn state_change = llgst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE); 622 GstStateChangeReturn state_change = gst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE);
653 LL_DEBUGS("MediaImpl") << "get_state: " << llgst_element_state_change_return_get_name(state_change) << LL_ENDL; 623 LL_DEBUGS("MediaImpl") << "get_state: " << gst_element_state_change_return_get_name(state_change) << LL_ENDL;
654 624
655 return true; 625 return true;
656}; 626};
@@ -671,7 +641,7 @@ bool LLMediaImplGStreamer::seek(double time)
671 bool success = false; 641 bool success = false;
672 if (mPlaybin) 642 if (mPlaybin)
673 { 643 {
674 success = llgst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME, 644 success = gst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME,
675 GstSeekFlags(GST_SEEK_FLAG_FLUSH | 645 GstSeekFlags(GST_SEEK_FLAG_FLUSH |
676 GST_SEEK_FLAG_KEY_UNIT), 646 GST_SEEK_FLAG_KEY_UNIT),
677 GST_SEEK_TYPE_SET, gint64(time*1000000000.0F), 647 GST_SEEK_TYPE_SET, gint64(time*1000000000.0F),
diff --git a/linden/indra/llmedia/llmediaimplgstreamervidplug.cpp b/linden/indra/llmedia/llmediaimplgstreamervidplug.cpp
index c95ef36..651b1b3 100644
--- a/linden/indra/llmedia/llmediaimplgstreamervidplug.cpp
+++ b/linden/indra/llmedia/llmediaimplgstreamervidplug.cpp
@@ -37,8 +37,6 @@
37#include <gst/video/video.h> 37#include <gst/video/video.h>
38#include <gst/video/gstvideosink.h> 38#include <gst/video/gstvideosink.h>
39 39
40#include "llmediaimplgstreamer_syms.h"
41
42#include "llthread.h" 40#include "llthread.h"
43 41
44#include "llmediaimplgstreamervidplug.h" 42#include "llmediaimplgstreamervidplug.h"
@@ -88,9 +86,9 @@ gst_slvideo_base_init (gpointer gclass)
88 }; 86 };
89 GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); 87 GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
90 88
91 llgst_element_class_add_pad_template (element_class, 89 gst_element_class_add_pad_template (element_class,
92 llgst_static_pad_template_get (&sink_factory)); 90 gst_static_pad_template_get (&sink_factory));
93 llgst_element_class_set_details (element_class, &element_details); 91 gst_element_class_set_details (element_class, &element_details);
94} 92}
95 93
96 94
@@ -101,7 +99,7 @@ gst_slvideo_finalize (GObject * object)
101 slvideo = GST_SLVIDEO (object); 99 slvideo = GST_SLVIDEO (object);
102 if (slvideo->caps) 100 if (slvideo->caps)
103 { 101 {
104 llgst_caps_unref(slvideo->caps); 102 gst_caps_unref(slvideo->caps);
105 } 103 }
106 104
107 G_OBJECT_CLASS(parent_class)->finalize (object); 105 G_OBJECT_CLASS(parent_class)->finalize (object);
@@ -112,7 +110,7 @@ static GstFlowReturn
112gst_slvideo_show_frame (GstBaseSink * bsink, GstBuffer * buf) 110gst_slvideo_show_frame (GstBaseSink * bsink, GstBuffer * buf)
113{ 111{
114 GstSLVideo *slvideo; 112 GstSLVideo *slvideo;
115 llg_return_val_if_fail (buf != NULL, GST_FLOW_ERROR); 113 g_return_val_if_fail (buf != NULL, GST_FLOW_ERROR);
116 114
117 slvideo = GST_SLVIDEO(bsink); 115 slvideo = GST_SLVIDEO(bsink);
118 116
@@ -205,7 +203,7 @@ gst_slvideo_get_caps (GstBaseSink * bsink)
205 GstSLVideo *slvideo; 203 GstSLVideo *slvideo;
206 slvideo = GST_SLVIDEO(bsink); 204 slvideo = GST_SLVIDEO(bsink);
207 205
208 return llgst_caps_ref (slvideo->caps); 206 return gst_caps_ref (slvideo->caps);
209} 207}
210 208
211 209
@@ -221,36 +219,36 @@ gst_slvideo_set_caps (GstBaseSink * bsink, GstCaps * caps)
221 219
222 filter = GST_SLVIDEO(bsink); 220 filter = GST_SLVIDEO(bsink);
223 221
224 intersection = llgst_caps_intersect (filter->caps, caps); 222 intersection = gst_caps_intersect (filter->caps, caps);
225 if (llgst_caps_is_empty (intersection)) 223 if (gst_caps_is_empty (intersection))
226 { 224 {
227 // no overlap between our caps and requested caps 225 // no overlap between our caps and requested caps
228 return FALSE; 226 return FALSE;
229 } 227 }
230 llgst_caps_unref(intersection); 228 gst_caps_unref(intersection);
231 229
232 int width = 0; 230 int width = 0;
233 int height = 0; 231 int height = 0;
234 gboolean ret; 232 gboolean ret;
235 const GValue *fps; 233 const GValue *fps;
236 const GValue *par; 234 const GValue *par;
237 structure = llgst_caps_get_structure (caps, 0); 235 structure = gst_caps_get_structure (caps, 0);
238 ret = llgst_structure_get_int (structure, "width", &width); 236 ret = gst_structure_get_int (structure, "width", &width);
239 ret = ret && llgst_structure_get_int (structure, "height", &height); 237 ret = ret && gst_structure_get_int (structure, "height", &height);
240 fps = llgst_structure_get_value (structure, "framerate"); 238 fps = gst_structure_get_value (structure, "framerate");
241 ret = ret && (fps != NULL); 239 ret = ret && (fps != NULL);
242 par = llgst_structure_get_value (structure, "pixel-aspect-ratio"); 240 par = gst_structure_get_value (structure, "pixel-aspect-ratio");
243 if (!ret) 241 if (!ret)
244 return FALSE; 242 return FALSE;
245 243
246 filter->width = width; 244 filter->width = width;
247 filter->height = height; 245 filter->height = height;
248 filter->fps_n = llgst_value_get_fraction_numerator(fps); 246 filter->fps_n = gst_value_get_fraction_numerator(fps);
249 filter->fps_d = llgst_value_get_fraction_denominator(fps); 247 filter->fps_d = gst_value_get_fraction_denominator(fps);
250 if (par) 248 if (par)
251 { 249 {
252 filter->par_n = llgst_value_get_fraction_numerator(par); 250 filter->par_n = gst_value_get_fraction_numerator(par);
253 filter->par_d = llgst_value_get_fraction_denominator(par); 251 filter->par_d = gst_value_get_fraction_denominator(par);
254 } 252 }
255 else 253 else
256 { 254 {
@@ -261,15 +259,15 @@ gst_slvideo_set_caps (GstBaseSink * bsink, GstCaps * caps)
261 GST_VIDEO_SINK_HEIGHT(filter) = height; 259 GST_VIDEO_SINK_HEIGHT(filter) = height;
262 260
263 filter->format = SLV_PF_UNKNOWN; 261 filter->format = SLV_PF_UNKNOWN;
264 if (0 == strcmp(llgst_structure_get_name(structure), 262 if (0 == strcmp(gst_structure_get_name(structure),
265 "video/x-raw-rgb")) 263 "video/x-raw-rgb"))
266 { 264 {
267 int red_mask; 265 int red_mask;
268 int green_mask; 266 int green_mask;
269 int blue_mask; 267 int blue_mask;
270 llgst_structure_get_int(structure, "red_mask", &red_mask); 268 gst_structure_get_int(structure, "red_mask", &red_mask);
271 llgst_structure_get_int(structure, "green_mask", &green_mask); 269 gst_structure_get_int(structure, "green_mask", &green_mask);
272 llgst_structure_get_int(structure, "blue_mask", &blue_mask); 270 gst_structure_get_int(structure, "blue_mask", &blue_mask);
273 if ((unsigned int)red_mask == 0xFF000000 && 271 if ((unsigned int)red_mask == 0xFF000000 &&
274 (unsigned int)green_mask == 0x00FF0000 && 272 (unsigned int)green_mask == 0x00FF0000 &&
275 (unsigned int)blue_mask == 0x0000FF00) 273 (unsigned int)blue_mask == 0x0000FF00)
@@ -366,9 +364,9 @@ gst_slvideo_update_caps (GstSLVideo * slvideo)
366 // GStreamer will automatically convert colourspace if necessary. 364 // GStreamer will automatically convert colourspace if necessary.
367 // GStreamer will automatically resize media to one of these enumerated 365 // GStreamer will automatically resize media to one of these enumerated
368 // powers-of-two that we ask for (yay GStreamer!) 366 // powers-of-two that we ask for (yay GStreamer!)
369 caps = llgst_caps_from_string (SLV_ALLCAPS); 367 caps = gst_caps_from_string (SLV_ALLCAPS);
370 368
371 llgst_caps_replace (&slvideo->caps, caps); 369 gst_caps_replace (&slvideo->caps, caps);
372} 370}
373 371
374 372
@@ -401,7 +399,7 @@ static void
401gst_slvideo_set_property (GObject * object, guint prop_id, 399gst_slvideo_set_property (GObject * object, guint prop_id,
402 const GValue * value, GParamSpec * pspec) 400 const GValue * value, GParamSpec * pspec)
403{ 401{
404 llg_return_if_fail (GST_IS_SLVIDEO (object)); 402 g_return_if_fail (GST_IS_SLVIDEO (object));
405 403
406 if (prop_id) { 404 if (prop_id) {
407 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); 405 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -412,7 +410,7 @@ static void
412gst_slvideo_get_property (GObject * object, guint prop_id, 410gst_slvideo_get_property (GObject * object, guint prop_id,
413 GValue * value, GParamSpec * pspec) 411 GValue * value, GParamSpec * pspec)
414{ 412{
415 llg_return_if_fail (GST_IS_SLVIDEO (object)); 413 g_return_if_fail (GST_IS_SLVIDEO (object));
416 414
417 if (prop_id) { 415 if (prop_id) {
418 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); 416 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -433,7 +431,7 @@ plugin_init (GstPlugin * plugin)
433 GST_DEBUG_CATEGORY_INIT (gst_slvideo_debug, "private-slvideo-plugin", 431 GST_DEBUG_CATEGORY_INIT (gst_slvideo_debug, "private-slvideo-plugin",
434 0, "Second Life Video Sink"); 432 0, "Second Life Video Sink");
435 433
436 return llgst_element_register (plugin, "private-slvideo", 434 return gst_element_register (plugin, "private-slvideo",
437 GST_RANK_NONE, GST_TYPE_SLVIDEO); 435 GST_RANK_NONE, GST_TYPE_SLVIDEO);
438} 436}
439 437
@@ -455,7 +453,6 @@ plugin_init (GstPlugin * plugin)
455 453
456void gst_slvideo_init_class (void) 454void gst_slvideo_init_class (void)
457{ 455{
458 ll_gst_plugin_register_static (&gst_plugin_desc);
459 //fprintf(stderr, "\n\n\nCLASS INIT\n\n\n"); 456 //fprintf(stderr, "\n\n\nCLASS INIT\n\n\n");
460} 457}
461 458