diff options
Diffstat (limited to '')
-rw-r--r-- | ChangeLog.txt | 31 | ||||
-rw-r--r-- | linden/indra/cmake/GStreamer.cmake | 10 | ||||
-rw-r--r-- | linden/indra/llmedia/CMakeLists.txt | 2 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.cpp | 118 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer_syms.cpp | 198 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer_syms.h | 78 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer_syms_raw.inc | 50 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer_syms_rawa.inc | 5 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer_syms_rawv.inc | 5 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamervidplug.cpp | 83 |
10 files changed, 116 insertions, 464 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index b897c39..1844521 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt | |||
@@ -1,3 +1,34 @@ | |||
1 | 2009-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 | |||
1 | 2009-03-22 McCabe Maxsted <hakushakukun@gmail.com> | 32 | 2009-03-22 McCabe Maxsted <hakushakukun@gmail.com> |
2 | 33 | ||
3 | * linden/indra/newview/llappviewer.cpp: | 34 | * linden/indra/newview/llappviewer.cpp: |
diff --git a/linden/indra/cmake/GStreamer.cmake b/linden/indra/cmake/GStreamer.cmake index b4b984d..7b380a8 100644 --- a/linden/indra/cmake/GStreamer.cmake +++ b/linden/indra/cmake/GStreamer.cmake | |||
@@ -54,10 +54,6 @@ if (WINDOWS) | |||
54 | 54 | ||
55 | else (WINDOWS) | 55 | else (WINDOWS) |
56 | 56 | ||
57 | include(FindPkgConfig) | ||
58 | |||
59 | pkg_check_modules(GSTREAMER REQUIRED gstreamer-0.10) | ||
60 | pkg_check_modules(GSTREAMER_PLUGINS_BASE REQUIRED gstreamer-plugins-base-0.10) | ||
61 | set(GSTREAMER_INCLUDE_DIRS | 57 | set(GSTREAMER_INCLUDE_DIRS |
62 | ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/gstreamer-0.10 | 58 | ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/gstreamer-0.10 |
63 | ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/glib-2.0 | 59 | ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/glib-2.0 |
@@ -66,9 +62,11 @@ else (WINDOWS) | |||
66 | ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/libxml2 | 62 | ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/libxml2 |
67 | ) | 63 | ) |
68 | 64 | ||
69 | # We don't need to explicitly link against gstreamer itself, because | ||
70 | # LLMediaImplGStreamer probes for the system's copy at runtime. | ||
71 | set(GSTREAMER_LIBRARIES | 65 | set(GSTREAMER_LIBRARIES |
66 | gstvideo-0.10 | ||
67 | gstaudio-0.10 | ||
68 | gstbase-0.10 | ||
69 | gstreamer-0.10 | ||
72 | gobject-2.0 | 70 | gobject-2.0 |
73 | gmodule-2.0 | 71 | gmodule-2.0 |
74 | dl | 72 | dl |
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 b37deac..98d6459 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp | |||
@@ -55,9 +55,8 @@ extern "C" { | |||
55 | 55 | ||
56 | #include "llmediaimplgstreamervidplug.h" | 56 | #include "llmediaimplgstreamervidplug.h" |
57 | 57 | ||
58 | #include "llmediaimplgstreamer_syms.h" | ||
59 | |||
60 | #include "llerror.h" | 58 | #include "llerror.h" |
59 | #include "linden_common.h" | ||
61 | 60 | ||
62 | // register this impl with media manager factory | 61 | // register this impl with media manager factory |
63 | static LLMediaImplRegister sLLMediaImplGStreamerReg( "LLMediaImplGStreamer", new LLMediaImplGStreamerMaker() ); | 62 | static LLMediaImplRegister sLLMediaImplGStreamerReg( "LLMediaImplGStreamer", new LLMediaImplGStreamerMaker() ); |
@@ -101,7 +100,7 @@ LLMediaImplGStreamer () : | |||
101 | } | 100 | } |
102 | 101 | ||
103 | // instantiate a playbin element to do the hard work | 102 | // instantiate a playbin element to do the hard work |
104 | mPlaybin = llgst_element_factory_make ("playbin", "play"); | 103 | mPlaybin = gst_element_factory_make ("playbin", "play"); |
105 | if (!mPlaybin) | 104 | if (!mPlaybin) |
106 | { | 105 | { |
107 | // todo: cleanup pump | 106 | // todo: cleanup pump |
@@ -115,7 +114,7 @@ LLMediaImplGStreamer () : | |||
115 | 114 | ||
116 | // Plays inworld instead of in external player | 115 | // Plays inworld instead of in external player |
117 | mVideoSink = | 116 | mVideoSink = |
118 | GST_SLVIDEO(llgst_element_factory_make ("private-slvideo", "slvideo")); | 117 | GST_SLVIDEO(gst_element_factory_make ("private-slvideo", "slvideo")); |
119 | if (!mVideoSink) | 118 | if (!mVideoSink) |
120 | { | 119 | { |
121 | LL_WARNS("MediaImpl") << "Could not instantiate private-slvideo element." << LL_ENDL; | 120 | LL_WARNS("MediaImpl") << "Could not instantiate private-slvideo element." << LL_ENDL; |
@@ -159,7 +158,7 @@ LLMediaImplGStreamer:: | |||
159 | std::string LLMediaImplGStreamer::getVersion() | 158 | std::string LLMediaImplGStreamer::getVersion() |
160 | { | 159 | { |
161 | guint major, minor, micro, nano; | 160 | guint major, minor, micro, nano; |
162 | llgst_version(&major, &minor, µ, &nano); | 161 | gst_version(&major, &minor, µ, &nano); |
163 | std::string version = llformat("%d.%d.%d.%d",major,minor,micro,nano); | 162 | std::string version = llformat("%d.%d.%d.%d",major,minor,micro,nano); |
164 | return version; | 163 | return version; |
165 | } | 164 | } |
@@ -176,31 +175,10 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data) | |||
176 | // Init the glib type system - we need it. | 175 | // Init the glib type system - we need it. |
177 | g_type_init(); | 176 | g_type_init(); |
178 | 177 | ||
179 | // Get symbols! | ||
180 | #if LL_WINDOWS | ||
181 | if (! grab_gst_syms("libgstreamer-0.10.dll", "libgstvideo-0.10.dll", "libgstaudio-0.10.dll") ) | ||
182 | { | ||
183 | LL_WARNS("MediaImpl") << "Couldn't find suitable GStreamer 0.10 support on this system - video playback disabled." << LL_ENDL; | ||
184 | return false; | ||
185 | } | ||
186 | #else | ||
187 | if (! grab_gst_syms("libgstreamer-0.10.so.0", "libgstvideo-0.10.so.0", "libgstaudio-0.10.so.0") ) | ||
188 | { | ||
189 | LL_WARNS("MediaImpl") << "Couldn't find suitable GStreamer 0.10 support on this system - video playback disabled." << LL_ENDL; | ||
190 | return false; | ||
191 | } | ||
192 | #endif | ||
193 | if (llgst_segtrap_set_enabled) | ||
194 | llgst_segtrap_set_enabled(FALSE); | ||
195 | else | ||
196 | { | ||
197 | LL_WARNS("MediaImpl") << "gst_segtrap_set_enabled() is not available; Automated crash-reporter may cease to function until next restart." << LL_ENDL; | ||
198 | } | ||
199 | |||
200 | // Protect against GStreamer resetting the locale, yuck. | 178 | // Protect against GStreamer resetting the locale, yuck. |
201 | static std::string saved_locale; | 179 | static std::string saved_locale; |
202 | saved_locale = setlocale(LC_ALL, NULL); | 180 | saved_locale = setlocale(LC_ALL, NULL); |
203 | if (0 == llgst_init_check(NULL, NULL, NULL)) | 181 | if (0 == gst_init_check(NULL, NULL, NULL)) |
204 | { | 182 | { |
205 | LL_WARNS("MediaImpl") << "GStreamer library failed to initialize and load standard plugins." << LL_ENDL; | 183 | LL_WARNS("MediaImpl") << "GStreamer library failed to initialize and load standard plugins." << LL_ENDL; |
206 | setlocale(LC_ALL, saved_locale.c_str() ); | 184 | setlocale(LC_ALL, saved_locale.c_str() ); |
@@ -219,7 +197,6 @@ bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data) | |||
219 | 197 | ||
220 | bool LLMediaImplGStreamer::closedown() | 198 | bool LLMediaImplGStreamer::closedown() |
221 | { | 199 | { |
222 | ungrab_gst_syms(); | ||
223 | return true; | 200 | return true; |
224 | } | 201 | } |
225 | 202 | ||
@@ -247,7 +224,7 @@ static const char* get_gst_state_name(GstState state) | |||
247 | gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gpointer data) | 224 | gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gpointer data) |
248 | { | 225 | { |
249 | #ifdef LL_GST_REPORT_STATE_CHANGES | 226 | #ifdef LL_GST_REPORT_STATE_CHANGES |
250 | LL_DEBUGS("MediaCallback") << "Got GST message type: " << LLGST_MESSAGE_TYPE_NAME (message) << LL_ENDL; | 227 | LL_DEBUGS("MediaCallback") << "Got GST message type: " << GST_MESSAGE_TYPE_NAME (message) << LL_ENDL; |
251 | #endif | 228 | #endif |
252 | 229 | ||
253 | LLMediaImplGStreamer *impl = (LLMediaImplGStreamer*)data; | 230 | LLMediaImplGStreamer *impl = (LLMediaImplGStreamer*)data; |
@@ -256,17 +233,13 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp | |||
256 | { | 233 | { |
257 | case GST_MESSAGE_BUFFERING: | 234 | case GST_MESSAGE_BUFFERING: |
258 | { | 235 | { |
259 | // NEEDS GST 0.10.11+ | 236 | gint percent = 0; |
260 | if (llgst_message_parse_buffering) | 237 | gst_message_parse_buffering(message, &percent); |
261 | { | ||
262 | gint percent = 0; | ||
263 | llgst_message_parse_buffering(message, &percent); | ||
264 | #ifdef LL_GST_REPORT_STATE_CHANGES | 238 | #ifdef LL_GST_REPORT_STATE_CHANGES |
265 | LL_DEBUGS("MediaBuffering") << "GST buffering: " << percent << "%%" << LL_ENDL; | 239 | LL_DEBUGS("MediaBuffering") << "GST buffering: " << percent << "%%" << LL_ENDL; |
266 | #endif | 240 | #endif |
267 | LLMediaEvent event( impl, percent ); | 241 | LLMediaEvent event( impl, percent ); |
268 | impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); | 242 | impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); |
269 | } | ||
270 | } | 243 | } |
271 | break; | 244 | break; |
272 | case GST_MESSAGE_STATE_CHANGED: | 245 | case GST_MESSAGE_STATE_CHANGED: |
@@ -274,7 +247,7 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp | |||
274 | GstState old_state; | 247 | GstState old_state; |
275 | GstState new_state; | 248 | GstState new_state; |
276 | GstState pending_state; | 249 | GstState pending_state; |
277 | llgst_message_parse_state_changed(message, | 250 | gst_message_parse_state_changed(message, |
278 | &old_state, | 251 | &old_state, |
279 | &new_state, | 252 | &new_state, |
280 | &pending_state); | 253 | &pending_state); |
@@ -319,7 +292,7 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp | |||
319 | GError *err = NULL; | 292 | GError *err = NULL; |
320 | gchar *debug = NULL; | 293 | gchar *debug = NULL; |
321 | 294 | ||
322 | llgst_message_parse_error (message, &err, &debug); | 295 | gst_message_parse_error (message, &err, &debug); |
323 | LL_WARNS("MediaImpl") << "GST Error: " << err->message << LL_ENDL; | 296 | LL_WARNS("MediaImpl") << "GST Error: " << err->message << LL_ENDL; |
324 | g_error_free (err); | 297 | g_error_free (err); |
325 | g_free (debug); | 298 | g_free (debug); |
@@ -331,17 +304,14 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp | |||
331 | } | 304 | } |
332 | case GST_MESSAGE_INFO: | 305 | case GST_MESSAGE_INFO: |
333 | { | 306 | { |
334 | if (llgst_message_parse_info) | 307 | GError *err = NULL; |
335 | { | 308 | gchar *debug = NULL; |
336 | GError *err = NULL; | ||
337 | gchar *debug = NULL; | ||
338 | 309 | ||
339 | llgst_message_parse_info (message, &err, &debug); | 310 | gst_message_parse_info (message, &err, &debug); |
340 | LL_INFOS("MediaImpl") << "GST info: " << err->message | 311 | LL_INFOS("MediaImpl") << "GST info: " << err->message |
341 | << LL_ENDL; | 312 | << LL_ENDL; |
342 | g_error_free (err); | 313 | g_error_free (err); |
343 | g_free (debug); | 314 | g_free (debug); |
344 | } | ||
345 | break; | 315 | break; |
346 | } | 316 | } |
347 | case GST_MESSAGE_WARNING: | 317 | case GST_MESSAGE_WARNING: |
@@ -349,7 +319,7 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp | |||
349 | GError *err = NULL; | 319 | GError *err = NULL; |
350 | gchar *debug = NULL; | 320 | gchar *debug = NULL; |
351 | 321 | ||
352 | llgst_message_parse_warning (message, &err, &debug); | 322 | gst_message_parse_warning (message, &err, &debug); |
353 | LL_WARNS("MediaImpl") << "GST warning: " << err->message | 323 | LL_WARNS("MediaImpl") << "GST warning: " << err->message |
354 | << LL_ENDL; | 324 | << LL_ENDL; |
355 | g_error_free (err); | 325 | g_error_free (err); |
@@ -362,10 +332,10 @@ gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gp | |||
362 | GstTagList *tag_list; | 332 | GstTagList *tag_list; |
363 | gchar *title; | 333 | gchar *title; |
364 | gchar *artist; | 334 | gchar *artist; |
365 | llgst_message_parse_tag(message, &tag_list); | 335 | gst_message_parse_tag(message, &tag_list); |
366 | gboolean hazTitle = llgst_tag_list_get_string(tag_list, | 336 | gboolean hazTitle = gst_tag_list_get_string(tag_list, |
367 | GST_TAG_TITLE, &title); | 337 | GST_TAG_TITLE, &title); |
368 | gboolean hazArtist = llgst_tag_list_get_string(tag_list, | 338 | gboolean hazArtist = gst_tag_list_get_string(tag_list, |
369 | GST_TAG_ARTIST, &artist); | 339 | GST_TAG_ARTIST, &artist); |
370 | if(hazTitle) | 340 | if(hazTitle) |
371 | LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL; | 341 | LL_INFOS("MediaInfo") << "Title: " << title << LL_ENDL; |
@@ -419,13 +389,13 @@ bool LLMediaImplGStreamer::navigateTo (const std::string urlIn) | |||
419 | g_object_set (G_OBJECT (mPlaybin), "uri", urlIn.c_str(), NULL); | 389 | g_object_set (G_OBJECT (mPlaybin), "uri", urlIn.c_str(), NULL); |
420 | 390 | ||
421 | // get playbin's bus - perhaps this can/should be done in ctor | 391 | // get playbin's bus - perhaps this can/should be done in ctor |
422 | GstBus *bus = llgst_pipeline_get_bus (GST_PIPELINE (mPlaybin)); | 392 | GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (mPlaybin)); |
423 | if (!bus) | 393 | if (!bus) |
424 | { | 394 | { |
425 | return false; | 395 | return false; |
426 | } | 396 | } |
427 | llgst_bus_add_watch (bus, bus_callback, this); | 397 | gst_bus_add_watch (bus, bus_callback, this); |
428 | llgst_object_unref (bus); | 398 | gst_object_unref (bus); |
429 | 399 | ||
430 | mState = GST_STATE_READY; | 400 | mState = GST_STATE_READY; |
431 | 401 | ||
@@ -442,9 +412,9 @@ bool LLMediaImplGStreamer::unload() | |||
442 | LL_DEBUGS("MediaImpl") << "unloading media..." << LL_ENDL; | 412 | LL_DEBUGS("MediaImpl") << "unloading media..." << LL_ENDL; |
443 | if (mPlaybin) | 413 | if (mPlaybin) |
444 | { | 414 | { |
445 | llgst_element_set_state (mPlaybin, GST_STATE_NULL); | 415 | gst_element_set_state (mPlaybin, GST_STATE_NULL); |
446 | mState = GST_STATE_NULL; | 416 | mState = GST_STATE_NULL; |
447 | llgst_object_unref (GST_OBJECT (mPlaybin)); | 417 | gst_object_unref (GST_OBJECT (mPlaybin)); |
448 | mPlaybin = NULL; | 418 | mPlaybin = NULL; |
449 | } | 419 | } |
450 | 420 | ||
@@ -602,18 +572,18 @@ bool LLMediaImplGStreamer::stop() | |||
602 | if (!mPlaybin || mState == GST_STATE_NULL) | 572 | if (!mPlaybin || mState == GST_STATE_NULL) |
603 | return true; | 573 | return true; |
604 | 574 | ||
605 | GstElement *pipeline = (GstElement *)llgst_object_ref(GST_OBJECT(mPlaybin)); | 575 | GstElement *pipeline = (GstElement *)gst_object_ref(GST_OBJECT(mPlaybin)); |
606 | llgst_object_unref(pipeline); | 576 | gst_object_unref(pipeline); |
607 | 577 | ||
608 | llgst_element_set_state(pipeline, GST_STATE_READY); | 578 | gst_element_set_state(pipeline, GST_STATE_READY); |
609 | 579 | ||
610 | if (mState == GST_STATE_PLAYING) | 580 | if (mState == GST_STATE_PLAYING) |
611 | mState = GST_STATE_VOID_PENDING; | 581 | mState = GST_STATE_VOID_PENDING; |
612 | else | 582 | else |
613 | mState = GST_STATE_READY; | 583 | mState = GST_STATE_READY; |
614 | 584 | ||
615 | GstStateChangeReturn state_change = llgst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE); | 585 | GstStateChangeReturn state_change = gst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE); |
616 | LL_DEBUGS("MediaImpl") << "get_state: " << llgst_element_state_change_return_get_name(state_change) << LL_ENDL; | 586 | LL_DEBUGS("MediaImpl") << "get_state: " << gst_element_state_change_return_get_name(state_change) << LL_ENDL; |
617 | 587 | ||
618 | return true; | 588 | return true; |
619 | } | 589 | } |
@@ -627,16 +597,16 @@ bool LLMediaImplGStreamer::play() | |||
627 | if (!mPlaybin || mState == GST_STATE_NULL) | 597 | if (!mPlaybin || mState == GST_STATE_NULL) |
628 | return true; | 598 | return true; |
629 | 599 | ||
630 | GstElement *pipeline = (GstElement *)llgst_object_ref(GST_OBJECT(mPlaybin)); | 600 | GstElement *pipeline = (GstElement *)gst_object_ref(GST_OBJECT(mPlaybin)); |
631 | llgst_object_unref(pipeline); | 601 | gst_object_unref(pipeline); |
632 | 602 | ||
633 | llgst_element_set_state(pipeline, GST_STATE_PLAYING); | 603 | gst_element_set_state(pipeline, GST_STATE_PLAYING); |
634 | mState = GST_STATE_PLAYING; | 604 | mState = GST_STATE_PLAYING; |
635 | /*llgst_element_set_state(mPlaybin, GST_STATE_PLAYING); | 605 | /*gst_element_set_state(mPlaybin, GST_STATE_PLAYING); |
636 | mState = GST_STATE_PLAYING;*/ | 606 | mState = GST_STATE_PLAYING;*/ |
637 | 607 | ||
638 | GstStateChangeReturn state_change = llgst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE); | 608 | GstStateChangeReturn state_change = gst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE); |
639 | LL_DEBUGS("MediaImpl") << "get_state: " << llgst_element_state_change_return_get_name(state_change) << LL_ENDL; | 609 | LL_DEBUGS("MediaImpl") << "get_state: " << gst_element_state_change_return_get_name(state_change) << LL_ENDL; |
640 | 610 | ||
641 | // Check to make sure playing was successful. If not, stop. | 611 | // Check to make sure playing was successful. If not, stop. |
642 | if (state_change == GST_STATE_CHANGE_FAILURE) | 612 | if (state_change == GST_STATE_CHANGE_FAILURE) |
@@ -657,11 +627,11 @@ bool LLMediaImplGStreamer::pause() | |||
657 | if (!mPlaybin || mState == GST_STATE_NULL) | 627 | if (!mPlaybin || mState == GST_STATE_NULL) |
658 | return true; | 628 | return true; |
659 | 629 | ||
660 | llgst_element_set_state(mPlaybin, GST_STATE_PAUSED); | 630 | gst_element_set_state(mPlaybin, GST_STATE_PAUSED); |
661 | mState = GST_STATE_PAUSED; | 631 | mState = GST_STATE_PAUSED; |
662 | 632 | ||
663 | GstStateChangeReturn state_change = llgst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE); | 633 | GstStateChangeReturn state_change = gst_element_get_state(mPlaybin, NULL, NULL, GST_CLOCK_TIME_NONE); |
664 | LL_DEBUGS("MediaImpl") << "get_state: " << llgst_element_state_change_return_get_name(state_change) << LL_ENDL; | 634 | LL_DEBUGS("MediaImpl") << "get_state: " << gst_element_state_change_return_get_name(state_change) << LL_ENDL; |
665 | 635 | ||
666 | return true; | 636 | return true; |
667 | }; | 637 | }; |
@@ -682,7 +652,7 @@ bool LLMediaImplGStreamer::seek(double time) | |||
682 | bool success = false; | 652 | bool success = false; |
683 | if (mPlaybin) | 653 | if (mPlaybin) |
684 | { | 654 | { |
685 | success = llgst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME, | 655 | success = gst_element_seek(mPlaybin, 1.0F, GST_FORMAT_TIME, |
686 | GstSeekFlags(GST_SEEK_FLAG_FLUSH | | 656 | GstSeekFlags(GST_SEEK_FLAG_FLUSH | |
687 | GST_SEEK_FLAG_KEY_UNIT), | 657 | GST_SEEK_FLAG_KEY_UNIT), |
688 | GST_SEEK_TYPE_SET, gint64(time*1000000000.0F), | 658 | 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 2f6d09c..0000000 --- a/linden/indra/llmedia/llmediaimplgstreamer_syms.cpp +++ /dev/null | |||
@@ -1,198 +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 | |||
34 | #if LL_WINDOWS | ||
35 | // GStreamer 0.10.22 - gstutils.h - conversion from 'guint64' to 'guint8'. | ||
36 | // This was an intentional change to make GStreamer more threadsafe, and | ||
37 | // is okay. Delete this bit if GStreamer ever gets more VS-friendly -- McCabe | ||
38 | #pragma warning(disable : 4244) | ||
39 | #endif | ||
40 | |||
41 | extern "C" { | ||
42 | #include <gst/gst.h> | ||
43 | |||
44 | #include "apr_pools.h" | ||
45 | #include "apr_dso.h" | ||
46 | } | ||
47 | |||
48 | #include "llmediaimplgstreamer.h" | ||
49 | |||
50 | #if LL_WINDOWS | ||
51 | #pragma warning(default : 4244) | ||
52 | #endif | ||
53 | |||
54 | #define LL_GST_SYM(REQ, GSTSYM, RTN, ...) RTN (*ll##GSTSYM)(__VA_ARGS__) = NULL | ||
55 | #include "llmediaimplgstreamer_syms_raw.inc" | ||
56 | #include "llmediaimplgstreamer_syms_rawa.inc" | ||
57 | #include "llmediaimplgstreamer_syms_rawv.inc" | ||
58 | #undef LL_GST_SYM | ||
59 | |||
60 | |||
61 | static bool sSymsGrabbed = false; | ||
62 | static apr_pool_t *sSymGSTDSOMemoryPool = NULL; | ||
63 | static apr_dso_handle_t *sSymGSTDSOHandleG = NULL; | ||
64 | static apr_dso_handle_t *sSymGSTDSOHandleV = NULL; | ||
65 | static apr_dso_handle_t *sSymGSTDSOHandleA = NULL; | ||
66 | |||
67 | |||
68 | bool grab_gst_syms(std::string gst_dso_name, | ||
69 | std::string gst_dso_name_vid, | ||
70 | std::string gst_dso_name_aud) | ||
71 | { | ||
72 | if (sSymsGrabbed) | ||
73 | { | ||
74 | // already have grabbed good syms | ||
75 | return TRUE; | ||
76 | } | ||
77 | |||
78 | bool sym_error = false; | ||
79 | bool rtn = false; | ||
80 | apr_status_t rv; | ||
81 | apr_dso_handle_t *sSymGSTDSOHandle = NULL; | ||
82 | |||
83 | #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) | ||
84 | |||
85 | //attempt to load the shared libraries | ||
86 | apr_pool_create(&sSymGSTDSOMemoryPool, NULL); | ||
87 | |||
88 | if ( APR_SUCCESS == (rv = apr_dso_load(&sSymGSTDSOHandle, | ||
89 | gst_dso_name.c_str(), | ||
90 | sSymGSTDSOMemoryPool) )) | ||
91 | { | ||
92 | INFOMSG("Found DSO: %s", gst_dso_name.c_str()); | ||
93 | #include "llmediaimplgstreamer_syms_raw.inc" | ||
94 | |||
95 | if ( sSymGSTDSOHandle ) | ||
96 | { | ||
97 | sSymGSTDSOHandleG = sSymGSTDSOHandle; | ||
98 | sSymGSTDSOHandle = NULL; | ||
99 | } | ||
100 | |||
101 | if ( APR_SUCCESS == (rv = apr_dso_load(&sSymGSTDSOHandle, | ||
102 | gst_dso_name_aud.c_str(), | ||
103 | sSymGSTDSOMemoryPool) )) | ||
104 | { | ||
105 | INFOMSG("Found DSO: %s", gst_dso_name_aud.c_str()); | ||
106 | #include "llmediaimplgstreamer_syms_rawa.inc" | ||
107 | |||
108 | if ( sSymGSTDSOHandle ) | ||
109 | { | ||
110 | sSymGSTDSOHandleA = sSymGSTDSOHandle; | ||
111 | sSymGSTDSOHandle = NULL; | ||
112 | } | ||
113 | |||
114 | if ( APR_SUCCESS == | ||
115 | (rv = apr_dso_load(&sSymGSTDSOHandle, | ||
116 | gst_dso_name_vid.c_str(), | ||
117 | sSymGSTDSOMemoryPool) )) | ||
118 | { | ||
119 | INFOMSG("Found DSO: %s", gst_dso_name_vid.c_str()); | ||
120 | #include "llmediaimplgstreamer_syms_rawv.inc" | ||
121 | } | ||
122 | else | ||
123 | { | ||
124 | INFOMSG("Couldn't load DSO: %s", gst_dso_name_vid.c_str()); | ||
125 | rtn = false; // failure | ||
126 | } | ||
127 | } | ||
128 | else | ||
129 | { | ||
130 | INFOMSG("Couldn't load DSO: %s", gst_dso_name_aud.c_str()); | ||
131 | rtn = false; // failure | ||
132 | } | ||
133 | |||
134 | rtn = !sym_error; | ||
135 | } | ||
136 | else | ||
137 | { | ||
138 | INFOMSG("Couldn't load DSO: %s", gst_dso_name.c_str()); | ||
139 | rtn = false; // failure | ||
140 | } | ||
141 | |||
142 | if (sym_error) | ||
143 | { | ||
144 | WARNMSG("Failed to find necessary symbols in GStreamer libraries."); | ||
145 | } | ||
146 | |||
147 | if ( sSymGSTDSOHandle ) | ||
148 | { | ||
149 | sSymGSTDSOHandleV = sSymGSTDSOHandle; | ||
150 | sSymGSTDSOHandle = NULL; | ||
151 | } | ||
152 | #undef LL_GST_SYM | ||
153 | |||
154 | sSymsGrabbed = !!rtn; | ||
155 | return rtn; | ||
156 | } | ||
157 | |||
158 | |||
159 | void ungrab_gst_syms() | ||
160 | { | ||
161 | // should be safe to call regardless of whether we've | ||
162 | // actually grabbed syms. | ||
163 | |||
164 | if ( sSymGSTDSOHandleG ) | ||
165 | { | ||
166 | apr_dso_unload(sSymGSTDSOHandleG); | ||
167 | sSymGSTDSOHandleG = NULL; | ||
168 | } | ||
169 | |||
170 | if ( sSymGSTDSOHandleA ) | ||
171 | { | ||
172 | apr_dso_unload(sSymGSTDSOHandleA); | ||
173 | sSymGSTDSOHandleA = NULL; | ||
174 | } | ||
175 | |||
176 | if ( sSymGSTDSOHandleV ) | ||
177 | { | ||
178 | apr_dso_unload(sSymGSTDSOHandleV); | ||
179 | sSymGSTDSOHandleV = NULL; | ||
180 | } | ||
181 | |||
182 | if ( sSymGSTDSOMemoryPool ) | ||
183 | { | ||
184 | apr_pool_destroy(sSymGSTDSOMemoryPool); | ||
185 | sSymGSTDSOMemoryPool = NULL; | ||
186 | } | ||
187 | |||
188 | // NULL-out all of the symbols we'd grabbed | ||
189 | #define LL_GST_SYM(REQ, GSTSYM, RTN, ...) do{ll##GSTSYM = NULL;}while(0) | ||
190 | #include "llmediaimplgstreamer_syms_raw.inc" | ||
191 | #include "llmediaimplgstreamer_syms_rawa.inc" | ||
192 | #include "llmediaimplgstreamer_syms_rawv.inc" | ||
193 | #undef LL_GST_SYM | ||
194 | |||
195 | sSymsGrabbed = false; | ||
196 | } | ||
197 | |||
198 | ///#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 | |||
36 | extern "C" { | ||
37 | #include <gst/gst.h> | ||
38 | } | ||
39 | |||
40 | bool grab_gst_syms(std::string gst_dso_name, | ||
41 | std::string gst_dso_name_vid, | ||
42 | std::string gst_dso_name_aud); | ||
43 | void 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 | ||
3 | LL_GST_SYM(true, gst_init_check, gboolean, int *argc, char **argv[], GError ** err); | ||
4 | LL_GST_SYM(true, gst_message_get_type, GType, void); | ||
5 | LL_GST_SYM(true, gst_message_type_get_name, const gchar*, GstMessageType type); | ||
6 | LL_GST_SYM(true, gst_message_parse_error, void, GstMessage *message, GError **gerror, gchar **debug); | ||
7 | LL_GST_SYM(true, gst_message_parse_warning, void, GstMessage *message, GError **gerror, gchar **debug); | ||
8 | LL_GST_SYM(true, gst_message_parse_state_changed, void, GstMessage *message, GstState *oldstate, GstState *newstate, GstState *pending); | ||
9 | LL_GST_SYM(true, gst_element_set_state, GstStateChangeReturn, GstElement *element, GstState state); | ||
10 | LL_GST_SYM(true, gst_element_get_state, GstStateChangeReturn, GstElement *element, GstState *state, GstState *pending, GstClockTime timeout); | ||
11 | LL_GST_SYM(true, gst_object_unref, void, gpointer object); | ||
12 | LL_GST_SYM(true, gst_object_ref, gpointer, gpointer object); | ||
13 | LL_GST_SYM(true, gst_object_get_type, GType, void); | ||
14 | LL_GST_SYM(true, gst_pipeline_get_type, GType, void); | ||
15 | LL_GST_SYM(true, gst_pipeline_get_bus, GstBus*, GstPipeline *pipeline); | ||
16 | LL_GST_SYM(true, gst_bus_add_watch, guint, GstBus * bus, GstBusFunc func, gpointer user_data); | ||
17 | LL_GST_SYM(true, gst_element_factory_make, GstElement*, const gchar *factoryname, const gchar *name); | ||
18 | LL_GST_SYM(true, gst_element_get_type, GType, void); | ||
19 | LL_GST_SYM(true, gst_static_pad_template_get, GstPadTemplate*, GstStaticPadTemplate *pad_template); | ||
20 | LL_GST_SYM(true, gst_element_class_add_pad_template, void, GstElementClass *klass, GstPadTemplate *temp); | ||
21 | LL_GST_SYM(true, gst_element_class_set_details, void, GstElementClass *klass, const GstElementDetails *details); | ||
22 | LL_GST_SYM(true, gst_caps_unref, void, GstCaps* caps); | ||
23 | LL_GST_SYM(true, gst_caps_ref, GstCaps *, GstCaps* caps); | ||
24 | LL_GST_SYM(true, _gst_debug_register_funcptr, void, GstDebugFuncPtr func, gchar* ptrname); | ||
25 | LL_GST_SYM(true, _gst_debug_category_new, GstDebugCategory *, gchar *name, guint color, gchar *description); | ||
26 | LL_GST_SYM(true, gst_caps_is_empty, gboolean, const GstCaps *caps); | ||
27 | LL_GST_SYM(true, gst_caps_from_string, GstCaps *, const gchar *string); | ||
28 | LL_GST_SYM(true, gst_caps_replace, void, GstCaps **caps, GstCaps *newcaps); | ||
29 | LL_GST_SYM(true, gst_caps_get_structure, GstStructure *, const GstCaps *caps, guint index); | ||
30 | LL_GST_SYM(true, gst_caps_copy, GstCaps *, const GstCaps * caps); | ||
31 | LL_GST_SYM(true, gst_caps_intersect, GstCaps *, const GstCaps *caps1, const GstCaps *caps2); | ||
32 | LL_GST_SYM(true, gst_element_register, gboolean, GstPlugin *plugin, const gchar *name, guint rank, GType type); | ||
33 | LL_GST_SYM(true, _gst_plugin_register_static, void, GstPluginDesc *desc); | ||
34 | LL_GST_SYM(true, gst_structure_get_int, gboolean, const GstStructure *structure, const gchar *fieldname, gint *value); | ||
35 | LL_GST_SYM(true, gst_structure_get_value, G_CONST_RETURN GValue *, const GstStructure *structure, const gchar *fieldname); | ||
36 | LL_GST_SYM(true, gst_value_get_fraction_numerator, gint, const GValue *value); | ||
37 | LL_GST_SYM(true, gst_value_get_fraction_denominator, gint, const GValue *value); | ||
38 | LL_GST_SYM(true, gst_structure_get_name, G_CONST_RETURN gchar *, const GstStructure *structure); | ||
39 | LL_GST_SYM(true, gst_element_seek, bool, GstElement *, gdouble, GstFormat, GstSeekFlags, GstSeekType, gint64, GstSeekType, gint64); | ||
40 | LL_GST_SYM(true, gst_version, void, guint *major, guint *minor, guint *micro, guint *nano); | ||
41 | LL_GST_SYM(true, gst_element_state_change_return_get_name, const gchar *, GstStateChangeReturn state_ret); | ||
42 | |||
43 | // optional symbols to grab | ||
44 | LL_GST_SYM(false, gst_segtrap_set_enabled, void, gboolean enabled); | ||
45 | LL_GST_SYM(false, gst_message_parse_buffering, void, GstMessage *message, gint *percent); | ||
46 | LL_GST_SYM(false, gst_message_parse_info, void, GstMessage *message, GError **gerror, gchar **debug); | ||
47 | |||
48 | //aw tag infos (Artist, Title, ...tbc...) | ||
49 | LL_GST_SYM(true, gst_message_parse_tag, void, GstMessage *message, GstTagList **tag_list); | ||
50 | LL_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 | ||
3 | LL_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 | ||
3 | LL_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 | |||
112 | gst_slvideo_show_frame (GstBaseSink * bsink, GstBuffer * buf) | 110 | gst_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 | |||
401 | gst_slvideo_set_property (GObject * object, guint prop_id, | 399 | gst_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 | |||
412 | gst_slvideo_get_property (GObject * object, guint prop_id, | 410 | gst_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 | ||
456 | void gst_slvideo_init_class (void) | 439 | void 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 |