aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJacek Antonelli2009-03-26 14:41:03 -0500
committerJacek Antonelli2009-03-26 14:41:03 -0500
commit421735bdcfc567226278c3d88a2dfd30cd694d87 (patch)
treefdc54cf33aa666b96a435cb815ea2e2fb6da6116
parentSymlinks for Mac glib dylibs (2.0.0 -> 2.0). (diff)
parentFixed/improved how slvideo gst plugin is registered. (diff)
downloadmeta-impy-421735bdcfc567226278c3d88a2dfd30cd694d87.zip
meta-impy-421735bdcfc567226278c3d88a2dfd30cd694d87.tar.gz
meta-impy-421735bdcfc567226278c3d88a2dfd30cd694d87.tar.bz2
meta-impy-421735bdcfc567226278c3d88a2dfd30cd694d87.tar.xz
Merge commit 'gst-revamp' into mac-1.1.0
Conflicts: linden/indra/cmake/GStreamer.cmake linden/indra/llmedia/llmediaimplgstreamer.cpp
-rw-r--r--ChangeLog.txt32
-rw-r--r--linden/indra/cmake/GStreamer.cmake11
-rw-r--r--linden/indra/llmedia/CMakeLists.txt2
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.cpp125
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer_syms.cpp188
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer_syms.h78
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer_syms_raw.inc50
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer_syms_rawa.inc5
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer_syms_rawv.inc5
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamervidplug.cpp83
10 files changed, 116 insertions, 463 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index c45e215..88cb72f 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,34 @@
12009-03-26 Jacek Antonelli <jacek.antonelli@gmail.com>
2
3 * linden/indra/llmedia/llmediaimplgstreamervidplug.cpp:
4 Fixed/improved how slvideo gst plugin is registered.
5
6
7 * linden/indra/llmedia/llmediaimplgstreamer_syms.cpp:
8 Removed obsolete gstreamer_syms files.
9 * linden/indra/llmedia/llmediaimplgstreamer_syms.h:
10 Ditto.
11 * linden/indra/llmedia/llmediaimplgstreamer_syms_raw.inc:
12 Ditto.
13 * linden/indra/llmedia/llmediaimplgstreamer_syms_rawa.inc:
14 Ditto.
15 * linden/indra/llmedia/llmediaimplgstreamer_syms_rawv.inc:
16 Ditto.
17
18
19 * linden/indra/llmedia/llmediaimplgstreamer.cpp:
20 Removed all that llgst and symbol grabbing silliness.
21 Some symbols require gstreamer >= 0.10.11.
22 * linden/indra/llmedia/llmediaimplgstreamervidplug.cpp:
23 Ditto.
24 * linden/indra/llmedia/CMakeLists.txt:
25 Ditto.
26
27
28 * linden/indra/cmake/GStreamer.cmake:
29 Link with some gstreamer core libs on Linux.
30
31
12009-03-16 Jacek Antonelli <jacek.antonelli@gmail.com> 322009-03-16 Jacek Antonelli <jacek.antonelli@gmail.com>
2 33
3 * linden/indra/newview/viewer_manifest.py: 34 * linden/indra/newview/viewer_manifest.py:
@@ -71,7 +102,6 @@
71 Ditto. 102 Ditto.
72 103
73 104
74
75=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 105=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
76=- 1.1.0 RC2 -= 106=- 1.1.0 RC2 -=
77=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 107=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
diff --git a/linden/indra/cmake/GStreamer.cmake b/linden/indra/cmake/GStreamer.cmake
index 8467dcd..f790e19 100644
--- a/linden/indra/cmake/GStreamer.cmake
+++ b/linden/indra/cmake/GStreamer.cmake
@@ -75,14 +75,11 @@ else (WINDOWS)
75 75
76 else (DARWIN) 76 else (DARWIN)
77 77
78 include(FindPkgConfig)
79
80 pkg_check_modules(GSTREAMER REQUIRED gstreamer-0.10)
81 pkg_check_modules(GSTREAMER_PLUGINS_BASE REQUIRED gstreamer-plugins-base-0.10)
82
83 # We don't need to explicitly link against gstreamer itself, because
84 # LLMediaImplGStreamer probes for the system's copy at runtime.
85 set(GSTREAMER_LIBRARIES 78 set(GSTREAMER_LIBRARIES
79 gstvideo-0.10
80 gstaudio-0.10
81 gstbase-0.10
82 gstreamer-0.10
86 gobject-2.0 83 gobject-2.0
87 gmodule-2.0 84 gmodule-2.0
88 dl 85 dl
diff --git a/linden/indra/llmedia/CMakeLists.txt b/linden/indra/llmedia/CMakeLists.txt
index 084a80b..cd4167a 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 cd6c91b..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,38 +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 (
170#if LL_WINDOWS
171 ! grab_gst_syms("libgstreamer-0.10.dll",
172 "libgstvideo-0.10.dll",
173 "libgstaudio-0.10.dll")
174#elif LL_DARWIN
175 ! grab_gst_syms("libgstreamer-0.10.dylib",
176 "libgstvideo-0.10.dylib",
177 "libgstaudio-0.10.dylib")
178#else
179 ! grab_gst_syms("libgstreamer-0.10.so.0",
180 "libgstvideo-0.10.so.0",
181 "libgstaudio-0.10.so.0")
182#endif
183 )
184 {
185 LL_WARNS("MediaImpl") << "Couldn't find suitable GStreamer 0.10 support on this system - video playback disabled." << LL_ENDL;
186 return false;
187 }
188
189 if (llgst_segtrap_set_enabled)
190 llgst_segtrap_set_enabled(FALSE);
191 else
192 {
193 LL_WARNS("MediaImpl") << "gst_segtrap_set_enabled() is not available; Automated crash-reporter may cease to function until next restart." << LL_ENDL;
194 }
195
196 // Protect against GStreamer resetting the locale, yuck. 167 // Protect against GStreamer resetting the locale, yuck.
197 static std::string saved_locale; 168 static std::string saved_locale;
198 saved_locale = setlocale(LC_ALL, NULL); 169 saved_locale = setlocale(LC_ALL, NULL);
199 if (0 == llgst_init_check(NULL, NULL, NULL)) 170 if (0 == gst_init_check(NULL, NULL, NULL))
200 { 171 {
201 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;
202 setlocale(LC_ALL, saved_locale.c_str() ); 173 setlocale(LC_ALL, saved_locale.c_str() );
@@ -215,7 +186,6 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data)
215 186
216bool LLMediaImplGStreamer::closedown() 187bool LLMediaImplGStreamer::closedown()
217{ 188{
218 ungrab_gst_syms();
219 return true; 189 return true;
220} 190}
221 191
@@ -243,7 +213,7 @@ static const char* get_gst_state_name(GstState state)
243gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gpointer data) 213gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gpointer data)
244{ 214{
245#ifdef LL_GST_REPORT_STATE_CHANGES 215#ifdef LL_GST_REPORT_STATE_CHANGES
246 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;
247#endif 217#endif
248 218
249 LLMediaImplGStreamer *impl = (LLMediaImplGStreamer*)data; 219 LLMediaImplGStreamer *impl = (LLMediaImplGStreamer*)data;
@@ -252,17 +222,13 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
252 { 222 {
253 case GST_MESSAGE_BUFFERING: 223 case GST_MESSAGE_BUFFERING:
254 { 224 {
255 // NEEDS GST 0.10.11+ 225 gint percent = 0;
256 if (llgst_message_parse_buffering) 226 gst_message_parse_buffering(message, &percent);
257 {
258 gint percent = 0;
259 llgst_message_parse_buffering(message, &percent);
260#ifdef LL_GST_REPORT_STATE_CHANGES 227#ifdef LL_GST_REPORT_STATE_CHANGES
261 LL_DEBUGS("MediaBuffering") << "GST buffering: " << percent << "%%" << LL_ENDL; 228 LL_DEBUGS("MediaBuffering") << "GST buffering: " << percent << "%%" << LL_ENDL;
262#endif 229#endif
263 LLMediaEvent event( impl, percent ); 230 LLMediaEvent event( impl, percent );
264 impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); 231 impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event );
265 }
266 } 232 }
267 break; 233 break;
268 case GST_MESSAGE_STATE_CHANGED: 234 case GST_MESSAGE_STATE_CHANGED:
@@ -270,7 +236,7 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
270 GstState old_state; 236 GstState old_state;
271 GstState new_state; 237 GstState new_state;
272 GstState pending_state; 238 GstState pending_state;
273 llgst_message_parse_state_changed(message, 239 gst_message_parse_state_changed(message,
274 &old_state, 240 &old_state,
275 &new_state, 241 &new_state,
276 &pending_state); 242 &pending_state);
@@ -315,7 +281,7 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
315 GError *err = NULL; 281 GError *err = NULL;
316 gchar *debug = NULL; 282 gchar *debug = NULL;
317 283
318 llgst_message_parse_error (message, &err, &debug); 284 gst_message_parse_error (message, &err, &debug);
319 LL_WARNS("MediaImpl") << "GST Error: " << err->message << LL_ENDL; 285 LL_WARNS("MediaImpl") << "GST Error: " << err->message << LL_ENDL;
320 g_error_free (err); 286 g_error_free (err);
321 g_free (debug); 287 g_free (debug);
@@ -327,17 +293,14 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
327 } 293 }
328 case GST_MESSAGE_INFO: 294 case GST_MESSAGE_INFO:
329 { 295 {
330 if (llgst_message_parse_info) 296 GError *err = NULL;
331 { 297 gchar *debug = NULL;
332 GError *err = NULL;
333 gchar *debug = NULL;
334 298
335 llgst_message_parse_info (message, &err, &debug); 299 gst_message_parse_info (message, &err, &debug);
336 LL_INFOS("MediaImpl") << "GST info: " << err->message 300 LL_INFOS("MediaImpl") << "GST info: " << err->message
337 << LL_ENDL; 301 << LL_ENDL;
338 g_error_free (err); 302 g_error_free (err);
339 g_free (debug); 303 g_free (debug);
340 }
341 break; 304 break;
342 } 305 }
343 case GST_MESSAGE_WARNING: 306 case GST_MESSAGE_WARNING:
@@ -345,7 +308,7 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
345 GError *err = NULL; 308 GError *err = NULL;
346 gchar *debug = NULL; 309 gchar *debug = NULL;
347 310
348 llgst_message_parse_warning (message, &err, &debug); 311 gst_message_parse_warning (message, &err, &debug);
349 LL_WARNS("MediaImpl") << "GST warning: " << err->message 312 LL_WARNS("MediaImpl") << "GST warning: " << err->message
350 << LL_ENDL; 313 << LL_ENDL;
351 g_error_free (err); 314 g_error_free (err);
@@ -358,10 +321,10 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp
358 GstTagList *tag_list; 321 GstTagList *tag_list;
359 gchar *title; 322 gchar *title;
360 gchar *artist; 323 gchar *artist;
361 llgst_message_parse_tag(message, &tag_list); 324 gst_message_parse_tag(message, &tag_list);
362 gboolean hazTitle = llgst_tag_list_get_string(tag_list, 325 gboolean hazTitle = gst_tag_list_get_string(tag_list,
363 GST_TAG_TITLE, &title); 326 GST_TAG_TITLE, &title);
364 gboolean hazArtist = llgst_tag_list_get_string(tag_list, 327 gboolean hazArtist = gst_tag_list_get_string(tag_list,
365 GST_TAG_ARTIST, &artist); 328 GST_TAG_ARTIST, &artist);
366 if(hazTitle) 329 if(hazTitle)
367 LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL; 330 LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL;
@@ -415,13 +378,13 @@ bool LLMediaImplGStreamer::navigateTo (const std::string urlIn)
415 g_object_set (G_OBJECT (mPlaybin), "uri", urlIn.c_str(), NULL); 378 g_object_set (G_OBJECT (mPlaybin), "uri", urlIn.c_str(), NULL);
416 379
417 // 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
418 GstBus *bus = llgst_pipeline_get_bus (GST_PIPELINE (mPlaybin)); 381 GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (mPlaybin));
419 if (!bus) 382 if (!bus)
420 { 383 {
421 return false; 384 return false;
422 } 385 }
423 llgst_bus_add_watch (bus, bus_callback, this); 386 gst_bus_add_watch (bus, bus_callback, this);
424 llgst_object_unref (bus); 387 gst_object_unref (bus);
425 388
426 mState = GST_STATE_READY; 389 mState = GST_STATE_READY;
427 390
@@ -438,9 +401,9 @@ bool LLMediaImplGStreamer::unload()
438 LL_DEBUGS("MediaImpl") << "unloading media..." << LL_ENDL; 401 LL_DEBUGS("MediaImpl") << "unloading media..." << LL_ENDL;
439 if (mPlaybin) 402 if (mPlaybin)
440 { 403 {
441 llgst_element_set_state (mPlaybin, GST_STATE_NULL); 404 gst_element_set_state (mPlaybin, GST_STATE_NULL);
442 mState = GST_STATE_NULL; 405 mState = GST_STATE_NULL;
443 llgst_object_unref (GST_OBJECT (mPlaybin)); 406 gst_object_unref (GST_OBJECT (mPlaybin));
444 mPlaybin = NULL; 407 mPlaybin = NULL;
445 } 408 }
446 409
@@ -598,18 +561,18 @@ bool LLMediaImplGStreamer::stop()
598 if (!mPlaybin || mState == GST_STATE_NULL) 561 if (!mPlaybin || mState == GST_STATE_NULL)
599 return true; 562 return true;
600 563
601 GstElement *pipeline = (GstElement *)llgst_object_ref(GST_OBJECT(mPlaybin)); 564 GstElement *pipeline = (GstElement *)gst_object_ref(GST_OBJECT(mPlaybin));
602 llgst_object_unref(pipeline); 565 gst_object_unref(pipeline);
603 566
604 llgst_element_set_state(pipeline, GST_STATE_READY); 567 gst_element_set_state(pipeline, GST_STATE_READY);
605 568
606 if (mState == GST_STATE_PLAYING) 569 if (mState == GST_STATE_PLAYING)
607 mState = GST_STATE_VOID_PENDING; 570 mState = GST_STATE_VOID_PENDING;
608 else 571 else
609 mState = GST_STATE_READY; 572 mState = GST_STATE_READY;
610 573
611 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);
612 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;
613 576
614 return true; 577 return true;
615} 578}
@@ -623,16 +586,16 @@ bool LLMediaImplGStreamer::play()
623 if (!mPlaybin || mState == GST_STATE_NULL) 586 if (!mPlaybin || mState == GST_STATE_NULL)
624 return true; 587 return true;
625 588
626 GstElement *pipeline = (GstElement *)llgst_object_ref(GST_OBJECT(mPlaybin)); 589 GstElement *pipeline = (GstElement *)gst_object_ref(GST_OBJECT(mPlaybin));
627 llgst_object_unref(pipeline); 590 gst_object_unref(pipeline);
628 591
629 llgst_element_set_state(pipeline, GST_STATE_PLAYING); 592 gst_element_set_state(pipeline, GST_STATE_PLAYING);
630 mState = GST_STATE_PLAYING; 593 mState = GST_STATE_PLAYING;
631 /*llgst_element_set_state(mPlaybin, GST_STATE_PLAYING); 594 /*gst_element_set_state(mPlaybin, GST_STATE_PLAYING);
632 mState = GST_STATE_PLAYING;*/ 595 mState = GST_STATE_PLAYING;*/
633 596
634 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);
635 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;
636 599
637 // Check to make sure playing was successful. If not, stop. 600 // Check to make sure playing was successful. If not, stop.
638 if (state_change == GST_STATE_CHANGE_FAILURE) 601 if (state_change == GST_STATE_CHANGE_FAILURE)
@@ -653,11 +616,11 @@ bool LLMediaImplGStreamer::pause()
653 if (!mPlaybin || mState == GST_STATE_NULL) 616 if (!mPlaybin || mState == GST_STATE_NULL)
654 return true; 617 return true;
655 618
656 llgst_element_set_state(mPlaybin, GST_STATE_PAUSED); 619 gst_element_set_state(mPlaybin, GST_STATE_PAUSED);
657 mState = GST_STATE_PAUSED; 620 mState = GST_STATE_PAUSED;
658 621
659 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);
660 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;
661 624
662 return true; 625 return true;
663}; 626};
@@ -678,7 +641,7 @@ bool LLMediaImplGStreamer::seek(double time)
678 bool success = false; 641 bool success = false;
679 if (mPlaybin) 642 if (mPlaybin)
680 { 643 {
681 success = llgst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME, 644 success = gst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME,
682 GstSeekFlags(GST_SEEK_FLAG_FLUSH | 645 GstSeekFlags(GST_SEEK_FLAG_FLUSH |
683 GST_SEEK_FLAG_KEY_UNIT), 646 GST_SEEK_FLAG_KEY_UNIT),
684 GST_SEEK_TYPE_SET, gint64(time*1000000000.0F), 647 GST_SEEK_TYPE_SET, gint64(time*1000000000.0F),
diff --git a/linden/indra/llmedia/llmediaimplgstreamer_syms.cpp b/linden/indra/llmedia/llmediaimplgstreamer_syms.cpp
deleted file mode 100644
index fb1949a..0000000
--- a/linden/indra/llmedia/llmediaimplgstreamer_syms.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
1/**
2 * @file llmediaimplgstreamer_syms.cpp
3 * @brief dynamic GStreamer symbol-grabbing code
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32///#if LL_GSTREAMER_ENABLED
33
34extern "C" {
35#include <gst/gst.h>
36
37#include "apr_pools.h"
38#include "apr_dso.h"
39}
40
41#include "llmediaimplgstreamer.h"
42
43#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) RTN (*ll##GSTSYM)(__VA_ARGS__) = NULL
44#include "llmediaimplgstreamer_syms_raw.inc"
45#include "llmediaimplgstreamer_syms_rawa.inc"
46#include "llmediaimplgstreamer_syms_rawv.inc"
47#undef LL_GST_SYM
48
49
50static bool sSymsGrabbed = false;
51static apr_pool_t *sSymGSTDSOMemoryPool = NULL;
52static apr_dso_handle_t *sSymGSTDSOHandleG = NULL;
53static apr_dso_handle_t *sSymGSTDSOHandleV = NULL;
54static apr_dso_handle_t *sSymGSTDSOHandleA = NULL;
55
56
57bool grab_gst_syms(std::string gst_dso_name,
58 std::string gst_dso_name_vid,
59 std::string gst_dso_name_aud)
60{
61 if (sSymsGrabbed)
62 {
63 // already have grabbed good syms
64 return TRUE;
65 }
66
67 bool sym_error = false;
68 bool rtn = false;
69 apr_status_t rv;
70 apr_dso_handle_t *sSymGSTDSOHandle = NULL;
71
72#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) do{rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll##GSTSYM, sSymGSTDSOHandle, #GSTSYM); if (rv != APR_SUCCESS) {INFOMSG("Failed to grab symbol: %s", #GSTSYM); if (REQ) sym_error = true;} else DEBUGMSG("grabbed symbol: %s from %p", #GSTSYM, (void*)ll##GSTSYM);}while(0)
73
74 //attempt to load the shared libraries
75 apr_pool_create(&sSymGSTDSOMemoryPool, NULL);
76
77 if ( APR_SUCCESS == (rv = apr_dso_load(&sSymGSTDSOHandle,
78 gst_dso_name.c_str(),
79 sSymGSTDSOMemoryPool) ))
80 {
81 INFOMSG("Found DSO: %s", gst_dso_name.c_str());
82#include "llmediaimplgstreamer_syms_raw.inc"
83
84 if ( sSymGSTDSOHandle )
85 {
86 sSymGSTDSOHandleG = sSymGSTDSOHandle;
87 sSymGSTDSOHandle = NULL;
88 }
89
90 if ( APR_SUCCESS == (rv = apr_dso_load(&sSymGSTDSOHandle,
91 gst_dso_name_aud.c_str(),
92 sSymGSTDSOMemoryPool) ))
93 {
94 INFOMSG("Found DSO: %s", gst_dso_name_aud.c_str());
95#include "llmediaimplgstreamer_syms_rawa.inc"
96
97 if ( sSymGSTDSOHandle )
98 {
99 sSymGSTDSOHandleA = sSymGSTDSOHandle;
100 sSymGSTDSOHandle = NULL;
101 }
102
103 if ( APR_SUCCESS ==
104 (rv = apr_dso_load(&sSymGSTDSOHandle,
105 gst_dso_name_vid.c_str(),
106 sSymGSTDSOMemoryPool) ))
107 {
108 INFOMSG("Found DSO: %s", gst_dso_name_vid.c_str());
109#include "llmediaimplgstreamer_syms_rawv.inc"
110 }
111 else
112 {
113 INFOMSG("Couldn't load DSO: %s", gst_dso_name_vid.c_str());
114 rtn = false; // failure
115 }
116 }
117 else
118 {
119 INFOMSG("Couldn't load DSO: %s", gst_dso_name_aud.c_str());
120 rtn = false; // failure
121 }
122
123 rtn = !sym_error;
124 }
125 else
126 {
127 INFOMSG("Couldn't load DSO: %s", gst_dso_name.c_str());
128 rtn = false; // failure
129 }
130
131 if (sym_error)
132 {
133 WARNMSG("Failed to find necessary symbols in GStreamer libraries.");
134 }
135
136 if ( sSymGSTDSOHandle )
137 {
138 sSymGSTDSOHandleV = sSymGSTDSOHandle;
139 sSymGSTDSOHandle = NULL;
140 }
141#undef LL_GST_SYM
142
143 sSymsGrabbed = !!rtn;
144 return rtn;
145}
146
147
148void ungrab_gst_syms()
149{
150 // should be safe to call regardless of whether we've
151 // actually grabbed syms.
152
153 if ( sSymGSTDSOHandleG )
154 {
155 apr_dso_unload(sSymGSTDSOHandleG);
156 sSymGSTDSOHandleG = NULL;
157 }
158
159 if ( sSymGSTDSOHandleA )
160 {
161 apr_dso_unload(sSymGSTDSOHandleA);
162 sSymGSTDSOHandleA = NULL;
163 }
164
165 if ( sSymGSTDSOHandleV )
166 {
167 apr_dso_unload(sSymGSTDSOHandleV);
168 sSymGSTDSOHandleV = NULL;
169 }
170
171 if ( sSymGSTDSOMemoryPool )
172 {
173 apr_pool_destroy(sSymGSTDSOMemoryPool);
174 sSymGSTDSOMemoryPool = NULL;
175 }
176
177 // NULL-out all of the symbols we'd grabbed
178#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) do{ll##GSTSYM = NULL;}while(0)
179#include "llmediaimplgstreamer_syms_raw.inc"
180#include "llmediaimplgstreamer_syms_rawa.inc"
181#include "llmediaimplgstreamer_syms_rawv.inc"
182#undef LL_GST_SYM
183
184 sSymsGrabbed = false;
185}
186
187
188///#endif // LL_GSTREAMER_ENABLED
diff --git a/linden/indra/llmedia/llmediaimplgstreamer_syms.h b/linden/indra/llmedia/llmediaimplgstreamer_syms.h
deleted file mode 100644
index ebebd80..0000000
--- a/linden/indra/llmedia/llmediaimplgstreamer_syms.h
+++ /dev/null
@@ -1,78 +0,0 @@
1/**
2 * @file llmediaimplgstreamer_syms.h
3 * @brief dynamic GStreamer symbol-grabbing code
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32#include "linden_common.h"
33
34///#if LL_GSTREAMER_ENABLED
35
36extern "C" {
37#include <gst/gst.h>
38}
39
40bool grab_gst_syms(std::string gst_dso_name,
41 std::string gst_dso_name_vid,
42 std::string gst_dso_name_aud);
43void ungrab_gst_syms();
44
45#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) extern RTN (*ll##GSTSYM)(__VA_ARGS__)
46#include "llmediaimplgstreamer_syms_raw.inc"
47#include "llmediaimplgstreamer_syms_rawa.inc"
48#include "llmediaimplgstreamer_syms_rawv.inc"
49#undef LL_GST_SYM
50
51// regrettable hacks to give us better runtime compatibility with older systems
52#define llg_return_if_fail(COND) do{if (!(COND)) return;}while(0)
53#define llg_return_val_if_fail(COND,V) do{if (!(COND)) return V;}while(0)
54
55// regrettable hacks because GStreamer was not designed for runtime loading
56#undef GST_TYPE_MESSAGE
57#define GST_TYPE_MESSAGE (llgst_message_get_type())
58#undef GST_TYPE_OBJECT
59#define GST_TYPE_OBJECT (llgst_object_get_type())
60#undef GST_TYPE_PIPELINE
61#define GST_TYPE_PIPELINE (llgst_pipeline_get_type())
62#undef GST_TYPE_ELEMENT
63#define GST_TYPE_ELEMENT (llgst_element_get_type())
64#undef GST_TYPE_AUDIO_SINK
65#define GST_TYPE_AUDIO_SINK (llgst_audio_sink_get_type())
66#undef GST_TYPE_VIDEO_SINK
67#define GST_TYPE_VIDEO_SINK (llgst_video_sink_get_type())
68#undef _gst_debug_register_funcptr
69#define _gst_debug_register_funcptr ll_gst_debug_register_funcptr
70#undef _gst_debug_category_new
71#define _gst_debug_category_new ll_gst_debug_category_new
72#undef __gst_debug_enabled
73#define __gst_debug_enabled (0)
74
75// more hacks
76#define LLGST_MESSAGE_TYPE_NAME(M) (llgst_message_type_get_name(GST_MESSAGE_TYPE(M)))
77
78///#endif // LL_GSTREAMER_ENABLED
diff --git a/linden/indra/llmedia/llmediaimplgstreamer_syms_raw.inc b/linden/indra/llmedia/llmediaimplgstreamer_syms_raw.inc
deleted file mode 100644
index 0d0d764..0000000
--- a/linden/indra/llmedia/llmediaimplgstreamer_syms_raw.inc
+++ /dev/null
@@ -1,50 +0,0 @@
1
2// required symbols to grab
3LL_GST_SYM(true, gst_init_check, gboolean, int *argc, char **argv[], GError ** err);
4LL_GST_SYM(true, gst_message_get_type, GType, void);
5LL_GST_SYM(true, gst_message_type_get_name, const gchar*, GstMessageType type);
6LL_GST_SYM(true, gst_message_parse_error, void, GstMessage *message, GError **gerror, gchar **debug);
7LL_GST_SYM(true, gst_message_parse_warning, void, GstMessage *message, GError **gerror, gchar **debug);
8LL_GST_SYM(true, gst_message_parse_state_changed, void, GstMessage *message, GstState *oldstate, GstState *newstate, GstState *pending);
9LL_GST_SYM(true, gst_element_set_state, GstStateChangeReturn, GstElement *element, GstState state);
10LL_GST_SYM(true, gst_element_get_state, GstStateChangeReturn, GstElement *element, GstState *state, GstState *pending, GstClockTime timeout);
11LL_GST_SYM(true, gst_object_unref, void, gpointer object);
12LL_GST_SYM(true, gst_object_ref, gpointer, gpointer object);
13LL_GST_SYM(true, gst_object_get_type, GType, void);
14LL_GST_SYM(true, gst_pipeline_get_type, GType, void);
15LL_GST_SYM(true, gst_pipeline_get_bus, GstBus*, GstPipeline *pipeline);
16LL_GST_SYM(true, gst_bus_add_watch, guint, GstBus * bus, GstBusFunc func, gpointer user_data);
17LL_GST_SYM(true, gst_element_factory_make, GstElement*, const gchar *factoryname, const gchar *name);
18LL_GST_SYM(true, gst_element_get_type, GType, void);
19LL_GST_SYM(true, gst_static_pad_template_get, GstPadTemplate*, GstStaticPadTemplate *pad_template);
20LL_GST_SYM(true, gst_element_class_add_pad_template, void, GstElementClass *klass, GstPadTemplate *temp);
21LL_GST_SYM(true, gst_element_class_set_details, void, GstElementClass *klass, const GstElementDetails *details);
22LL_GST_SYM(true, gst_caps_unref, void, GstCaps* caps);
23LL_GST_SYM(true, gst_caps_ref, GstCaps *, GstCaps* caps);
24LL_GST_SYM(true, _gst_debug_register_funcptr, void, GstDebugFuncPtr func, gchar* ptrname);
25LL_GST_SYM(true, _gst_debug_category_new, GstDebugCategory *, gchar *name, guint color, gchar *description);
26LL_GST_SYM(true, gst_caps_is_empty, gboolean, const GstCaps *caps);
27LL_GST_SYM(true, gst_caps_from_string, GstCaps *, const gchar *string);
28LL_GST_SYM(true, gst_caps_replace, void, GstCaps **caps, GstCaps *newcaps);
29LL_GST_SYM(true, gst_caps_get_structure, GstStructure *, const GstCaps *caps, guint index);
30LL_GST_SYM(true, gst_caps_copy, GstCaps *, const GstCaps * caps);
31LL_GST_SYM(true, gst_caps_intersect, GstCaps *, const GstCaps *caps1, const GstCaps *caps2);
32LL_GST_SYM(true, gst_element_register, gboolean, GstPlugin *plugin, const gchar *name, guint rank, GType type);
33LL_GST_SYM(true, _gst_plugin_register_static, void, GstPluginDesc *desc);
34LL_GST_SYM(true, gst_structure_get_int, gboolean, const GstStructure *structure, const gchar *fieldname, gint *value);
35LL_GST_SYM(true, gst_structure_get_value, G_CONST_RETURN GValue *, const GstStructure *structure, const gchar *fieldname);
36LL_GST_SYM(true, gst_value_get_fraction_numerator, gint, const GValue *value);
37LL_GST_SYM(true, gst_value_get_fraction_denominator, gint, const GValue *value);
38LL_GST_SYM(true, gst_structure_get_name, G_CONST_RETURN gchar *, const GstStructure *structure);
39LL_GST_SYM(true, gst_element_seek, bool, GstElement *, gdouble, GstFormat, GstSeekFlags, GstSeekType, gint64, GstSeekType, gint64);
40LL_GST_SYM(true, gst_version, void, guint *major, guint *minor, guint *micro, guint *nano);
41LL_GST_SYM(true, gst_element_state_change_return_get_name, const gchar *, GstStateChangeReturn state_ret);
42
43// optional symbols to grab
44LL_GST_SYM(false, gst_segtrap_set_enabled, void, gboolean enabled);
45LL_GST_SYM(false, gst_message_parse_buffering, void, GstMessage *message, gint *percent);
46LL_GST_SYM(false, gst_message_parse_info, void, GstMessage *message, GError **gerror, gchar **debug);
47
48//aw tag infos (Artist, Title, ...tbc...)
49LL_GST_SYM(true, gst_message_parse_tag, void, GstMessage *message, GstTagList **tag_list);
50LL_GST_SYM(true, gst_tag_list_get_string, gboolean, const GstTagList *list, const gchar *tag, gchar **value);
diff --git a/linden/indra/llmedia/llmediaimplgstreamer_syms_rawa.inc b/linden/indra/llmedia/llmediaimplgstreamer_syms_rawa.inc
deleted file mode 100644
index 0be99b5..0000000
--- a/linden/indra/llmedia/llmediaimplgstreamer_syms_rawa.inc
+++ /dev/null
@@ -1,5 +0,0 @@
1
2// required symbols to grab
3LL_GST_SYM(true, gst_audio_sink_get_type, GType, void);
4
5// optional symbols to grab
diff --git a/linden/indra/llmedia/llmediaimplgstreamer_syms_rawv.inc b/linden/indra/llmedia/llmediaimplgstreamer_syms_rawv.inc
deleted file mode 100644
index 14fbcb4..0000000
--- a/linden/indra/llmedia/llmediaimplgstreamer_syms_rawv.inc
+++ /dev/null
@@ -1,5 +0,0 @@
1
2// required symbols to grab
3LL_GST_SYM(true, gst_video_sink_get_type, GType, void);
4
5// optional symbols to grab
diff --git a/linden/indra/llmedia/llmediaimplgstreamervidplug.cpp b/linden/indra/llmedia/llmediaimplgstreamervidplug.cpp
index c95ef36..eaf2c84 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,30 +431,23 @@ 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
440/* this is the structure that gstreamer looks for to register plugins
441 */
442/* NOTE: Can't rely upon GST_PLUGIN_DEFINE_STATIC to self-register, since
443 some g++ versions buggily avoid __attribute__((constructor)) functions -
444 so we provide an explicit plugin init function.
445 */
446#define PACKAGE "packagehack"
447 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
448 GST_VERSION_MINOR,
449 "private-slvideoplugin",
450 "SL Video sink plugin",
451 plugin_init, "0.1", GST_LICENSE_UNKNOWN,
452 "Second Life",
453 "http://www.secondlife.com/");
454#undef PACKAGE
455 438
456void gst_slvideo_init_class (void) 439void gst_slvideo_init_class (void)
457{ 440{
458 ll_gst_plugin_register_static (&gst_plugin_desc); 441 gst_plugin_register_static( GST_VERSION_MAJOR,
459 //fprintf(stderr, "\n\n\nCLASS INIT\n\n\n"); 442 GST_VERSION_MINOR,
443 "private-slvideoplugin",
444 "SL Video sink plugin",
445 plugin_init,
446 "0.1",
447 GST_LICENSE_UNKNOWN,
448 "Second Life",
449 "Second Life",
450 "http://www.secondlife.com/" );
460} 451}
461 452
462///#endif // LL_GSTREAMER_ENABLED 453///#endif // LL_GSTREAMER_ENABLED