diff options
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/llmedia/CMakeLists.txt | 20 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.cpp | 279 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.h | 10 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer_syms.cpp | 4 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer_syms.h | 4 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamervidplug.cpp | 28 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamervidplug.h | 8 | ||||
-rw-r--r-- | linden/indra/llmedia/llmediamanager.cpp | 8 | ||||
-rw-r--r-- | linden/indra/llwindow/llwindowsdl.cpp | 4 |
9 files changed, 178 insertions, 187 deletions
diff --git a/linden/indra/llmedia/CMakeLists.txt b/linden/indra/llmedia/CMakeLists.txt index 8ef8006..026afc1 100644 --- a/linden/indra/llmedia/CMakeLists.txt +++ b/linden/indra/llmedia/CMakeLists.txt | |||
@@ -29,6 +29,9 @@ set(llmedia_SOURCE_FILES | |||
29 | llmediaimplexample2.cpp | 29 | llmediaimplexample2.cpp |
30 | llmediaimplfactory.cpp | 30 | llmediaimplfactory.cpp |
31 | llmediamanager.cpp | 31 | llmediamanager.cpp |
32 | llmediaimplgstreamer.cpp | ||
33 | llmediaimplgstreamer_syms.cpp | ||
34 | llmediaimplgstreamervidplug.cpp | ||
32 | ) | 35 | ) |
33 | 36 | ||
34 | set(llmedia_HEADER_FILES | 37 | set(llmedia_HEADER_FILES |
@@ -43,21 +46,11 @@ set(llmedia_HEADER_FILES | |||
43 | llmediaimplregister.h | 46 | llmediaimplregister.h |
44 | llmediamanager.h | 47 | llmediamanager.h |
45 | llmediaobserver.h | 48 | llmediaobserver.h |
49 | llmediaimplgstreamer.h | ||
50 | llmediaimplgstreamervidplug.h | ||
51 | llmediaimplgstreamer_syms.h | ||
46 | ) | 52 | ) |
47 | 53 | ||
48 | if (GSTREAMER) | ||
49 | list(APPEND llmedia_SOURCE_FILES | ||
50 | llmediaimplgstreamer.cpp | ||
51 | llmediaimplgstreamer_syms.cpp | ||
52 | llmediaimplgstreamervidplug.cpp | ||
53 | ) | ||
54 | |||
55 | list(APPEND llmedia_HEADER_FILES | ||
56 | llmediaimplgstreamer.h | ||
57 | llmediaimplgstreamervidplug.h | ||
58 | llmediaimplgstreamer_syms.h | ||
59 | ) | ||
60 | |||
61 | # Work around a bad interaction between broken gstreamer headers and | 54 | # Work around a bad interaction between broken gstreamer headers and |
62 | # g++ 4.3's increased strictness. | 55 | # g++ 4.3's increased strictness. |
63 | 56 | ||
@@ -65,7 +58,6 @@ if (GSTREAMER) | |||
65 | set_source_files_properties(llmediaimplgstreamervidplug.cpp PROPERTIES | 58 | set_source_files_properties(llmediaimplgstreamervidplug.cpp PROPERTIES |
66 | COMPILE_FLAGS -Wno-error=write-strings) | 59 | COMPILE_FLAGS -Wno-error=write-strings) |
67 | endif (${CXX_VERSION} MATCHES "4.[23]") | 60 | endif (${CXX_VERSION} MATCHES "4.[23]") |
68 | endif (GSTREAMER) | ||
69 | 61 | ||
70 | if (MOZLIB) | 62 | if (MOZLIB) |
71 | list(APPEND llmedia_SOURCE_FILES llmediaimplllmozlib.cpp) | 63 | list(APPEND llmedia_SOURCE_FILES llmediaimplllmozlib.cpp) |
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp index fa42756..f4ff8c2 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | #include "llmediaimplgstreamer.h" | 33 | #include "llmediaimplgstreamer.h" |
34 | 34 | ||
35 | #if LL_GSTREAMER_ENABLED | 35 | ///#if LL_GSTREAMER_ENABLED |
36 | 36 | ||
37 | extern "C" { | 37 | extern "C" { |
38 | #include <gst/gst.h> | 38 | #include <gst/gst.h> |
@@ -50,6 +50,7 @@ extern "C" { | |||
50 | #include "llmediaimplgstreamer_syms.h" | 50 | #include "llmediaimplgstreamer_syms.h" |
51 | 51 | ||
52 | #include "llerror.h" | 52 | #include "llerror.h" |
53 | |||
53 | // register this impl with media manager factory | 54 | // register this impl with media manager factory |
54 | static LLMediaImplRegister sLLMediaImplGStreamerReg( "LLMediaImplGStreamer", new LLMediaImplGStreamerMaker() ); | 55 | static LLMediaImplRegister sLLMediaImplGStreamerReg( "LLMediaImplGStreamer", new LLMediaImplGStreamerMaker() ); |
55 | 56 | ||
@@ -100,7 +101,8 @@ LLMediaImplGStreamer () : | |||
100 | return; // error | 101 | return; // error |
101 | } | 102 | } |
102 | 103 | ||
103 | if (NULL == getenv("LL_GSTREAMER_EXTERNAL")) { | 104 | if (NULL == getenv("LL_GSTREAMER_EXTERNAL")) |
105 | { | ||
104 | // instantiate and connect a custom video sink | 106 | // instantiate and connect a custom video sink |
105 | LL_DEBUGS("MediaManager") << "extrenal video sink..." << LL_ENDL; | 107 | LL_DEBUGS("MediaManager") << "extrenal video sink..." << LL_ENDL; |
106 | mVideoSink = | 108 | mVideoSink = |
@@ -166,25 +168,28 @@ std::string LLMediaImplGStreamer::getVersion() | |||
166 | rtn = "[" + sLLMediaImplGStreamerReg.getImplName() + "] - GStreamer 0.10.x"; | 168 | rtn = "[" + sLLMediaImplGStreamerReg.getImplName() + "] - GStreamer 0.10.x"; |
167 | return rtn; | 169 | return rtn; |
168 | } | 170 | } |
169 | 171 | // | |
172 | //THIS IS THE METHOD THAT'S BREAKING STUFF | ||
170 | /////////////////////////////////////////////////////////////////////////////// | 173 | /////////////////////////////////////////////////////////////////////////////// |
171 | // (static) super-initialization - called once at application startup | 174 | // (static) super-initialization - called once at application startup |
172 | bool | 175 | bool LLMediaImplGStreamer::startup (LLMediaManagerData* init_data) |
173 | LLMediaImplGStreamer:: | ||
174 | startup ( LLMediaManagerData* init_data ) | ||
175 | { | 176 | { |
176 | static bool done_init = false; | 177 | static bool done_init = false; |
177 | if (!done_init) | 178 | if (!done_init) |
178 | { | 179 | { |
180 | // Init the glib type system - we need it. | ||
181 | g_type_init(); | ||
182 | |||
179 | // Get symbols! | 183 | // Get symbols! |
180 | if (! grab_gst_syms("libgstreamer-0.10.so.0", | 184 | #if LL_WINDOWS |
181 | "libgstvideo-0.10.so.0", | 185 | if (! grab_gst_syms("libgstreamer-0.10.dll", "libgstvideo-0.10.dll", "libgstaudio-0.10.dll") ) |
182 | "libgstaudio-0.10.so.0") ) | 186 | #else |
187 | if (! grab_gst_syms("libgstreamer-0.10.so.0", "libgstvideo-0.10.so.0", "libgstaudio-0.10.so.0") ) | ||
183 | { | 188 | { |
184 | LL_WARNS("MediaImpl") << "Couldn't find suitable GStreamer 0.10 support on this system - video playback disabled." << LL_ENDL; | 189 | LL_WARNS("MediaImpl") << "Couldn't find suitable GStreamer 0.10 support on this system - video playback disabled." << LL_ENDL; |
185 | return false; | 190 | return false; |
186 | } | 191 | } |
187 | 192 | #endif | |
188 | if (llgst_segtrap_set_enabled) | 193 | if (llgst_segtrap_set_enabled) |
189 | llgst_segtrap_set_enabled(FALSE); | 194 | llgst_segtrap_set_enabled(FALSE); |
190 | else | 195 | else |
@@ -211,16 +216,13 @@ startup ( LLMediaManagerData* init_data ) | |||
211 | 216 | ||
212 | done_init = true; | 217 | done_init = true; |
213 | } | 218 | } |
214 | |||
215 | return true; | 219 | return true; |
216 | } | 220 | } |
217 | 221 | ||
218 | 222 | ||
219 | bool LLMediaImplGStreamer:: | 223 | bool LLMediaImplGStreamer::closedown() |
220 | closedown() | ||
221 | { | 224 | { |
222 | ungrab_gst_syms(); | 225 | ungrab_gst_syms(); |
223 | |||
224 | return true; | 226 | return true; |
225 | } | 227 | } |
226 | 228 | ||
@@ -228,122 +230,128 @@ closedown() | |||
228 | /////////////////////////////////////////////////////////////////////////////// | 230 | /////////////////////////////////////////////////////////////////////////////// |
229 | // | 231 | // |
230 | //#define LL_GST_REPORT_STATE_CHANGES | 232 | //#define LL_GST_REPORT_STATE_CHANGES |
231 | #ifdef LL_GST_REPORT_STATE_CHANGES | 233 | ///#ifdef LL_GST_REPORT_STATE_CHANGES |
232 | static const char* get_gst_state_name(GstState state) | 234 | static const char* get_gst_state_name(GstState state) |
233 | { | 235 | { |
234 | switch (state) { | 236 | switch (state) |
235 | case GST_STATE_VOID_PENDING: return "VOID_PENDING"; | 237 | { |
236 | case GST_STATE_NULL: return "NULL"; | 238 | case GST_STATE_VOID_PENDING: return "VOID_PENDING"; |
237 | case GST_STATE_READY: return "READY"; | 239 | case GST_STATE_NULL: return "NULL"; |
238 | case GST_STATE_PAUSED: return "PAUSED"; | 240 | case GST_STATE_READY: return "READY"; |
239 | case GST_STATE_PLAYING: return "PLAYING"; | 241 | case GST_STATE_PAUSED: return "PAUSED"; |
242 | case GST_STATE_PLAYING: return "PLAYING"; | ||
240 | } | 243 | } |
241 | return "(unknown)"; | 244 | return "(unknown)"; |
242 | } | 245 | } |
243 | #endif // LL_GST_REPORT_STATE_CHANGES | 246 | ///#endif // LL_GST_REPORT_STATE_CHANGES |
244 | 247 | ||
245 | //static | 248 | //static |
246 | gboolean | 249 | gboolean LLMediaImplGStreamer::bus_callback(GstBus *bus, GstMessage *message, gpointer data) |
247 | LLMediaImplGStreamer::bus_callback (GstBus *bus, | ||
248 | GstMessage *message, | ||
249 | gpointer data) | ||
250 | { | 250 | { |
251 | LL_DEBUGS("MediaCallback") << "Got GST message type: " << LLGST_MESSAGE_TYPE_NAME (message) << LL_ENDL; | 251 | LL_DEBUGS("MediaCallback") << "Got GST message type: " << LLGST_MESSAGE_TYPE_NAME (message) << LL_ENDL; |
252 | 252 | ||
253 | LLMediaImplGStreamer *impl = (LLMediaImplGStreamer*)data; | 253 | LLMediaImplGStreamer *impl = (LLMediaImplGStreamer*)data; |
254 | 254 | ||
255 | switch (GST_MESSAGE_TYPE (message)) { | 255 | switch (GST_MESSAGE_TYPE (message)) |
256 | case GST_MESSAGE_BUFFERING: { | 256 | { |
257 | // NEEDS GST 0.10.11+ | 257 | case GST_MESSAGE_BUFFERING: |
258 | if (llgst_message_parse_buffering) | ||
259 | { | 258 | { |
260 | gint percent = 0; | 259 | // NEEDS GST 0.10.11+ |
261 | llgst_message_parse_buffering(message, &percent); | 260 | if (llgst_message_parse_buffering) |
262 | LL_DEBUGS("MediaBuffering") << "GST buffering: " << percent << "%%" << LL_ENDL; | 261 | { |
263 | LLMediaEvent event( impl, percent ); | 262 | gint percent = 0; |
264 | impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); | 263 | llgst_message_parse_buffering(message, &percent); |
265 | 264 | LL_DEBUGS("MediaBuffering") << "GST buffering: " << percent << "%%" << LL_ENDL; | |
265 | LLMediaEvent event( impl, percent ); | ||
266 | impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); | ||
267 | } | ||
266 | } | 268 | } |
267 | break; | 269 | break; |
268 | } | 270 | case GST_MESSAGE_STATE_CHANGED: |
269 | case GST_MESSAGE_STATE_CHANGED: { | 271 | { |
270 | GstState old_state; | 272 | GstState old_state; |
271 | GstState new_state; | 273 | GstState new_state; |
272 | GstState pending_state; | 274 | GstState pending_state; |
273 | llgst_message_parse_state_changed(message, | 275 | llgst_message_parse_state_changed(message, |
274 | &old_state, | 276 | &old_state, |
275 | &new_state, | 277 | &new_state, |
276 | &pending_state); | 278 | &pending_state); |
277 | #ifdef LL_GST_REPORT_STATE_CHANGES | 279 | ///#ifdef LL_GST_REPORT_STATE_CHANGES |
278 | // not generally very useful, and rather spammy. | 280 | // not generally very useful, and rather spammy. |
279 | LL_DEBUGS("MediaState") << "GST state change (old,<new>,pending): "<< get_gst_state_name(old_state) << ",<" << get_gst_state_name(new_state) << ">," << get_gst_state_name(pending_state) << LL_ENDL; | 281 | LL_DEBUGS("MediaState") << "GST state change (old,<new>,pending): "<< get_gst_state_name(old_state) << ",<" << get_gst_state_name(new_state) << ">," << get_gst_state_name(pending_state) << LL_ENDL; |
280 | #endif // LL_GST_REPORT_STATE_CHANGES | 282 | ///#endif // LL_GST_REPORT_STATE_CHANGES |
281 | 283 | ||
282 | switch (new_state) { | 284 | switch (new_state) |
283 | case GST_STATE_VOID_PENDING: | 285 | { |
284 | break; | 286 | case GST_STATE_VOID_PENDING: |
285 | case GST_STATE_NULL: | 287 | break; |
286 | LL_DEBUGS("MediaImpl") << "State changed to NULL" << LL_ENDL; | 288 | case GST_STATE_NULL: |
287 | if (impl->getState() == GST_STATE_PLAYING) { // We got stoped by gstremer... | 289 | LL_DEBUGS("MediaImpl") << "State changed to NULL" << LL_ENDL; |
288 | impl->play(); | 290 | if (impl->getState() == GST_STATE_PLAYING) |
289 | LL_DEBUGS("MediaImpl") << "Trying to restart." << LL_ENDL; | 291 | { // We got stoped by gstremer... |
292 | impl->play(); | ||
293 | LL_DEBUGS("MediaImpl") << "Trying to restart." << LL_ENDL; | ||
294 | } | ||
295 | break; | ||
296 | case GST_STATE_READY: | ||
297 | break; | ||
298 | case GST_STATE_PAUSED: | ||
299 | break; | ||
300 | case GST_STATE_PLAYING: | ||
301 | LLMediaEvent event( impl, 100 ); | ||
302 | impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); | ||
303 | // emit an event to say that a media source was loaded | ||
304 | LLMediaEvent event2( impl ); | ||
305 | impl->getEventEmitter().update( &LLMediaObserver::onMediaLoaded, event2 ); | ||
306 | break; | ||
290 | } | 307 | } |
291 | break; | 308 | break; |
292 | case GST_STATE_READY: | ||
293 | break; | ||
294 | case GST_STATE_PAUSED: | ||
295 | break; | ||
296 | case GST_STATE_PLAYING: | ||
297 | LLMediaEvent event( impl, 100 ); | ||
298 | impl->getEventEmitter().update( &LLMediaObserver::onUpdateProgress, event ); | ||
299 | // emit an event to say that a media source was loaded | ||
300 | LLMediaEvent event2( impl ); | ||
301 | impl->getEventEmitter().update( &LLMediaObserver::onMediaLoaded, event2 ); | ||
302 | break; | ||
303 | } | 309 | } |
304 | break; | 310 | case GST_MESSAGE_ERROR: |
305 | } | 311 | { |
306 | case GST_MESSAGE_ERROR: { | 312 | GError *err = NULL; |
307 | GError *err = NULL; | 313 | gchar *debug = NULL; |
308 | gchar *debug = NULL; | ||
309 | 314 | ||
310 | llgst_message_parse_error (message, &err, &debug); | 315 | llgst_message_parse_error (message, &err, &debug); |
311 | LL_WARNS("MediaImpl") << "GST Error: " << err->message << LL_ENDL; | 316 | LL_WARNS("MediaImpl") << "GST Error: " << err->message << LL_ENDL; |
312 | g_error_free (err); | 317 | g_error_free (err); |
313 | g_free (debug); | 318 | g_free (debug); |
314 | 319 | ||
315 | impl->addCommand(LLMediaBase::COMMAND_STOP); | 320 | impl->addCommand(LLMediaBase::COMMAND_STOP); |
316 | //impl->addCommand(LLMediaBase::COMMAND_START); | 321 | //impl->addCommand(LLMediaBase::COMMAND_START); |
317 | 322 | ||
318 | break; | 323 | break; |
319 | } | 324 | } |
320 | case GST_MESSAGE_INFO: { | 325 | case GST_MESSAGE_INFO: |
321 | if (llgst_message_parse_info) | ||
322 | { | 326 | { |
323 | GError *err = NULL; | 327 | if (llgst_message_parse_info) |
324 | gchar *debug = NULL; | 328 | { |
329 | GError *err = NULL; | ||
330 | gchar *debug = NULL; | ||
325 | 331 | ||
326 | llgst_message_parse_info (message, &err, &debug); | 332 | llgst_message_parse_info (message, &err, &debug); |
327 | LL_INFOS("MediaImpl") << "GST info: " << err->message | 333 | LL_INFOS("MediaImpl") << "GST info: " << err->message |
328 | << LL_ENDL; | 334 | << LL_ENDL; |
329 | g_error_free (err); | 335 | g_error_free (err); |
330 | g_free (debug); | 336 | g_free (debug); |
337 | } | ||
338 | break; | ||
331 | } | 339 | } |
332 | break; | 340 | case GST_MESSAGE_WARNING: |
333 | } | 341 | { |
334 | case GST_MESSAGE_WARNING: { | 342 | GError *err = NULL; |
335 | GError *err = NULL; | 343 | gchar *debug = NULL; |
336 | gchar *debug = NULL; | ||
337 | 344 | ||
338 | llgst_message_parse_warning (message, &err, &debug); | 345 | llgst_message_parse_warning (message, &err, &debug); |
339 | LL_WARNS("MediaImpl") << "GST warning: " << err->message | 346 | LL_WARNS("MediaImpl") << "GST warning: " << err->message |
340 | << LL_ENDL; | 347 | << LL_ENDL; |
341 | g_error_free (err); | 348 | g_error_free (err); |
342 | g_free (debug); | 349 | g_free (debug); |
343 | 350 | ||
344 | break; | 351 | break; |
345 | } | 352 | } |
346 | case GST_MESSAGE_TAG: { | 353 | case GST_MESSAGE_TAG: |
354 | { | ||
347 | #if 0 | 355 | #if 0 |
348 | GstTagList *tag_list; | 356 | GstTagList *tag_list; |
349 | gchar *title; | 357 | gchar *title; |
@@ -358,28 +366,29 @@ LLMediaImplGStreamer::bus_callback (GstBus *bus, | |||
358 | if(hazArtist) | 366 | if(hazArtist) |
359 | LL_INFOS("MediaInfo") << "Artist is " << artist << LL_ENDL; | 367 | LL_INFOS("MediaInfo") << "Artist is " << artist << LL_ENDL; |
360 | #endif | 368 | #endif |
361 | break; | 369 | break; |
362 | } | ||
363 | case GST_MESSAGE_EOS: | ||
364 | /* end-of-stream */ | ||
365 | LL_DEBUGS("MediaImpl") << "GST end-of-stream." << LL_ENDL; | ||
366 | if (impl->isLooping()) | ||
367 | { | ||
368 | LL_DEBUGS("MediaImpl") << "looping media..." << LL_ENDL; | ||
369 | impl->stop(); | ||
370 | impl->play(); | ||
371 | } | 370 | } |
372 | else | 371 | case GST_MESSAGE_EOS: |
373 | { | 372 | { |
374 | // inject a COMMAND_STOP | 373 | /* end-of-stream */ |
375 | impl->addCommand(LLMediaBase::COMMAND_STOP); | 374 | LL_DEBUGS("MediaImpl") << "GST end-of-stream." << LL_ENDL; |
375 | if (impl->isLooping()) | ||
376 | { | ||
377 | LL_DEBUGS("MediaImpl") << "looping media..." << LL_ENDL; | ||
378 | impl->stop(); | ||
379 | impl->play(); | ||
380 | } | ||
381 | else | ||
382 | { | ||
383 | // inject a COMMAND_STOP | ||
384 | impl->addCommand(LLMediaBase::COMMAND_STOP); | ||
385 | } | ||
386 | break; | ||
387 | default: | ||
388 | /* unhandled message */ | ||
389 | break; | ||
376 | } | 390 | } |
377 | break; | ||
378 | default: | ||
379 | /* unhandled message */ | ||
380 | break; | ||
381 | } | 391 | } |
382 | |||
383 | /* we want to be notified again the next time there is a message | 392 | /* we want to be notified again the next time there is a message |
384 | * on the bus, so return true (false means we want to stop watching | 393 | * on the bus, so return true (false means we want to stop watching |
385 | * for messages on the bus and our callback should not be called again) | 394 | * for messages on the bus and our callback should not be called again) |
@@ -389,9 +398,7 @@ LLMediaImplGStreamer::bus_callback (GstBus *bus, | |||
389 | 398 | ||
390 | /////////////////////////////////////////////////////////// | 399 | /////////////////////////////////////////////////////////// |
391 | // virtual | 400 | // virtual |
392 | bool | 401 | bool LLMediaImplGStreamer::navigateTo (const std::string urlIn) |
393 | LLMediaImplGStreamer:: | ||
394 | navigateTo ( const std::string urlIn ) | ||
395 | { | 402 | { |
396 | LL_DEBUGS("MediaImpl") << "Setting media URI: " << urlIn.c_str() | 403 | LL_DEBUGS("MediaImpl") << "Setting media URI: " << urlIn.c_str() |
397 | << LL_ENDL; | 404 | << LL_ENDL; |
@@ -428,9 +435,7 @@ navigateTo ( const std::string urlIn ) | |||
428 | 435 | ||
429 | /////////////////////////////////////////////////////////////////////////////// | 436 | /////////////////////////////////////////////////////////////////////////////// |
430 | // | 437 | // |
431 | bool | 438 | bool LLMediaImplGStreamer::unload() |
432 | LLMediaImplGStreamer:: | ||
433 | unload () | ||
434 | { | 439 | { |
435 | LL_DEBUGS("MediaImpl") << "unloading media..." << LL_ENDL; | 440 | LL_DEBUGS("MediaImpl") << "unloading media..." << LL_ENDL; |
436 | if (mPlaybin) | 441 | if (mPlaybin) |
@@ -460,9 +465,7 @@ unload () | |||
460 | 465 | ||
461 | /////////////////////////////////////////////////////////////////////////////// | 466 | /////////////////////////////////////////////////////////////////////////////// |
462 | // virtual | 467 | // virtual |
463 | bool | 468 | bool LLMediaImplGStreamer::updateMedia() |
464 | LLMediaImplGStreamer:: | ||
465 | updateMedia () | ||
466 | { | 469 | { |
467 | //LL_DEBUGS("MediaImpl") << "updating media..." << LL_ENDL; | 470 | //LL_DEBUGS("MediaImpl") << "updating media..." << LL_ENDL; |
468 | 471 | ||
@@ -583,9 +586,7 @@ updateMedia () | |||
583 | 586 | ||
584 | /////////////////////////////////////////////////////////////////////////////// | 587 | /////////////////////////////////////////////////////////////////////////////// |
585 | // | 588 | // |
586 | bool | 589 | bool LLMediaImplGStreamer::stop() |
587 | LLMediaImplGStreamer:: | ||
588 | stop () | ||
589 | { | 590 | { |
590 | LL_DEBUGS("MediaImpl") << "stopping media..." << LL_ENDL; | 591 | LL_DEBUGS("MediaImpl") << "stopping media..." << LL_ENDL; |
591 | // todo: error-check this? | 592 | // todo: error-check this? |
@@ -596,9 +597,7 @@ stop () | |||
596 | 597 | ||
597 | /////////////////////////////////////////////////////////////////////////////// | 598 | /////////////////////////////////////////////////////////////////////////////// |
598 | // | 599 | // |
599 | bool | 600 | bool LLMediaImplGStreamer::play() |
600 | LLMediaImplGStreamer:: | ||
601 | play () | ||
602 | { | 601 | { |
603 | LL_DEBUGS("MediaImpl") << "playing media..." << LL_ENDL; | 602 | LL_DEBUGS("MediaImpl") << "playing media..." << LL_ENDL; |
604 | // todo: error-check this? | 603 | // todo: error-check this? |
@@ -609,9 +608,7 @@ play () | |||
609 | 608 | ||
610 | /////////////////////////////////////////////////////////////////////////////// | 609 | /////////////////////////////////////////////////////////////////////////////// |
611 | // | 610 | // |
612 | bool | 611 | bool LLMediaImplGStreamer::pause() |
613 | LLMediaImplGStreamer:: | ||
614 | pause () | ||
615 | { | 612 | { |
616 | LL_DEBUGS("MediaImpl") <<"pausing media..." << LL_ENDL; | 613 | LL_DEBUGS("MediaImpl") <<"pausing media..." << LL_ENDL; |
617 | // todo: error-check this? | 614 | // todo: error-check this? |
@@ -623,9 +620,7 @@ pause () | |||
623 | 620 | ||
624 | /////////////////////////////////////////////////////////////////////////////// | 621 | /////////////////////////////////////////////////////////////////////////////// |
625 | // virtual | 622 | // virtual |
626 | unsigned char* | 623 | unsigned char* LLMediaImplGStreamer::getMediaData() |
627 | LLMediaImplGStreamer:: | ||
628 | getMediaData () | ||
629 | { | 624 | { |
630 | return mediaData; | 625 | return mediaData; |
631 | } | 626 | } |
@@ -633,9 +628,7 @@ getMediaData () | |||
633 | 628 | ||
634 | /////////////////////////////////////////////////////////////////////////////// | 629 | /////////////////////////////////////////////////////////////////////////////// |
635 | // virtual | 630 | // virtual |
636 | bool | 631 | bool LLMediaImplGStreamer::seek(double time) |
637 | LLMediaImplGStreamer:: | ||
638 | seek( double time ) | ||
639 | { | 632 | { |
640 | bool success = false; | 633 | bool success = false; |
641 | if (mPlaybin) | 634 | if (mPlaybin) |
@@ -654,9 +647,7 @@ seek( double time ) | |||
654 | 647 | ||
655 | /////////////////////////////////////////////////////////////////////////////// | 648 | /////////////////////////////////////////////////////////////////////////////// |
656 | // virtual | 649 | // virtual |
657 | bool | 650 | bool LLMediaImplGStreamer::setVolume(float volume) |
658 | LLMediaImplGStreamer:: | ||
659 | setVolume(float volume) | ||
660 | { | 651 | { |
661 | // XXX hack to make volume volume changes less othen | 652 | // XXX hack to make volume volume changes less othen |
662 | // bug in gstreamer 0.10.21 | 653 | // bug in gstreamer 0.10.21 |
@@ -673,4 +664,6 @@ setVolume(float volume) | |||
673 | return false; | 664 | return false; |
674 | } | 665 | } |
675 | 666 | ||
676 | #endif // LL_GSTREAMER_ENABLED | 667 | |
668 | |||
669 | ///#endif // LL_GSTREAMER_ENABLED \ No newline at end of file | ||
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h index 4d0638a..6deb3f4 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer.h +++ b/linden/indra/llmedia/llmediaimplgstreamer.h | |||
@@ -31,13 +31,13 @@ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | // header guard | 33 | // header guard |
34 | #ifndef llmediaimplgstreamer_h | 34 | ///#ifndef llmediaimplgstreamer_h |
35 | #define llmediaimplgstreamer_h | 35 | #define llmediaimplgstreamer_h |
36 | 36 | ||
37 | #include "llmediaimplcommon.h" | 37 | #include "llmediaimplcommon.h" |
38 | #include "llmediaimplfactory.h" | 38 | #include "llmediaimplfactory.h" |
39 | 39 | ||
40 | #if LL_GSTREAMER_ENABLED | 40 | ///#if LL_GSTREAMER_ENABLED |
41 | 41 | ||
42 | extern "C" { | 42 | extern "C" { |
43 | #include <stdio.h> | 43 | #include <stdio.h> |
@@ -46,6 +46,8 @@ extern "C" { | |||
46 | #include "apr_pools.h" | 46 | #include "apr_pools.h" |
47 | #include "apr_dso.h" | 47 | #include "apr_dso.h" |
48 | } | 48 | } |
49 | //#include <glib-object.h> | ||
50 | //#include <gmain.h> | ||
49 | 51 | ||
50 | #include "llmediaimplgstreamervidplug.h" | 52 | #include "llmediaimplgstreamervidplug.h" |
51 | #ifdef LL_GST_SOUNDSINK | 53 | #ifdef LL_GST_SOUNDSINK |
@@ -131,6 +133,6 @@ public: | |||
131 | #define WARNMSG STDERRMSG | 133 | #define WARNMSG STDERRMSG |
132 | ///////////////////////////////////////////////////////////////////////// | 134 | ///////////////////////////////////////////////////////////////////////// |
133 | 135 | ||
134 | #endif // LL_GSTREAMER_ENABLED | 136 | ///#endif // LL_GSTREAMER_ENABLED |
135 | 137 | ||
136 | #endif // llmediaimplgstreamer_h | 138 | ///#endif // llmediaimplgstreamer_h |
diff --git a/linden/indra/llmedia/llmediaimplgstreamer_syms.cpp b/linden/indra/llmedia/llmediaimplgstreamer_syms.cpp index e81d886..fb1949a 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer_syms.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamer_syms.cpp | |||
@@ -29,7 +29,7 @@ | |||
29 | * $/LicenseInfo$ | 29 | * $/LicenseInfo$ |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #if LL_GSTREAMER_ENABLED | 32 | ///#if LL_GSTREAMER_ENABLED |
33 | 33 | ||
34 | extern "C" { | 34 | extern "C" { |
35 | #include <gst/gst.h> | 35 | #include <gst/gst.h> |
@@ -185,4 +185,4 @@ void ungrab_gst_syms() | |||
185 | } | 185 | } |
186 | 186 | ||
187 | 187 | ||
188 | #endif // LL_GSTREAMER_ENABLED | 188 | ///#endif // LL_GSTREAMER_ENABLED |
diff --git a/linden/indra/llmedia/llmediaimplgstreamer_syms.h b/linden/indra/llmedia/llmediaimplgstreamer_syms.h index 92d46b7..ebebd80 100644 --- a/linden/indra/llmedia/llmediaimplgstreamer_syms.h +++ b/linden/indra/llmedia/llmediaimplgstreamer_syms.h | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | #include "linden_common.h" | 32 | #include "linden_common.h" |
33 | 33 | ||
34 | #if LL_GSTREAMER_ENABLED | 34 | ///#if LL_GSTREAMER_ENABLED |
35 | 35 | ||
36 | extern "C" { | 36 | extern "C" { |
37 | #include <gst/gst.h> | 37 | #include <gst/gst.h> |
@@ -75,4 +75,4 @@ void ungrab_gst_syms(); | |||
75 | // more hacks | 75 | // more hacks |
76 | #define LLGST_MESSAGE_TYPE_NAME(M) (llgst_message_type_get_name(GST_MESSAGE_TYPE(M))) | 76 | #define LLGST_MESSAGE_TYPE_NAME(M) (llgst_message_type_get_name(GST_MESSAGE_TYPE(M))) |
77 | 77 | ||
78 | #endif // LL_GSTREAMER_ENABLED | 78 | ///#endif // LL_GSTREAMER_ENABLED |
diff --git a/linden/indra/llmedia/llmediaimplgstreamervidplug.cpp b/linden/indra/llmedia/llmediaimplgstreamervidplug.cpp index f9c2f89..892c50d 100644 --- a/linden/indra/llmedia/llmediaimplgstreamervidplug.cpp +++ b/linden/indra/llmedia/llmediaimplgstreamervidplug.cpp | |||
@@ -29,7 +29,7 @@ | |||
29 | * $/LicenseInfo$ | 29 | * $/LicenseInfo$ |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #if LL_GSTREAMER_ENABLED | 32 | ///#if LL_GSTREAMER_ENABLED |
33 | 33 | ||
34 | #include "linden_common.h" | 34 | #include "linden_common.h" |
35 | 35 | ||
@@ -68,8 +68,10 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ( | |||
68 | GST_STATIC_CAPS (SLV_ALLCAPS) | 68 | GST_STATIC_CAPS (SLV_ALLCAPS) |
69 | ); | 69 | ); |
70 | 70 | ||
71 | GST_BOILERPLATE (GstSLVideo, gst_slvideo, GstVideoSink, | 71 | GST_BOILERPLATE (GstSLVideo, |
72 | GST_TYPE_VIDEO_SINK); | 72 | gst_slvideo, |
73 | GstVideoSink, | ||
74 | GST_TYPE_VIDEO_SINK); | ||
73 | 75 | ||
74 | static void gst_slvideo_set_property (GObject * object, guint prop_id, | 76 | static void gst_slvideo_set_property (GObject * object, guint prop_id, |
75 | const GValue * value, | 77 | const GValue * value, |
@@ -229,7 +231,8 @@ gst_slvideo_set_caps (GstBaseSink * bsink, GstCaps * caps) | |||
229 | } | 231 | } |
230 | llgst_caps_unref(intersection); | 232 | llgst_caps_unref(intersection); |
231 | 233 | ||
232 | int width, height; | 234 | int width = 0; |
235 | int height = 0; | ||
233 | gboolean ret; | 236 | gboolean ret; |
234 | const GValue *fps; | 237 | const GValue *fps; |
235 | const GValue *par; | 238 | const GValue *par; |
@@ -402,10 +405,8 @@ gst_slvideo_set_property (GObject * object, guint prop_id, | |||
402 | { | 405 | { |
403 | llg_return_if_fail (GST_IS_SLVIDEO (object)); | 406 | llg_return_if_fail (GST_IS_SLVIDEO (object)); |
404 | 407 | ||
405 | switch (prop_id) { | 408 | if (prop_id) { |
406 | default: | ||
407 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | 409 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
408 | break; | ||
409 | } | 410 | } |
410 | } | 411 | } |
411 | 412 | ||
@@ -415,10 +416,8 @@ gst_slvideo_get_property (GObject * object, guint prop_id, | |||
415 | { | 416 | { |
416 | llg_return_if_fail (GST_IS_SLVIDEO (object)); | 417 | llg_return_if_fail (GST_IS_SLVIDEO (object)); |
417 | 418 | ||
418 | switch (prop_id) { | 419 | if (prop_id) { |
419 | default: | ||
420 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | 420 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
421 | break; | ||
422 | } | 421 | } |
423 | } | 422 | } |
424 | 423 | ||
@@ -446,10 +445,8 @@ plugin_init (GstPlugin * plugin) | |||
446 | some g++ versions buggily avoid __attribute__((constructor)) functions - | 445 | some g++ versions buggily avoid __attribute__((constructor)) functions - |
447 | so we provide an explicit plugin init function. | 446 | so we provide an explicit plugin init function. |
448 | */ | 447 | */ |
449 | void gst_slvideo_init_class (void) | ||
450 | { | ||
451 | #define PACKAGE "packagehack" | 448 | #define PACKAGE "packagehack" |
452 | static GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, | 449 | GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, |
453 | GST_VERSION_MINOR, | 450 | GST_VERSION_MINOR, |
454 | "private-slvideoplugin", | 451 | "private-slvideoplugin", |
455 | "SL Video sink plugin", | 452 | "SL Video sink plugin", |
@@ -457,8 +454,11 @@ void gst_slvideo_init_class (void) | |||
457 | "Second Life", | 454 | "Second Life", |
458 | "http://www.secondlife.com/"); | 455 | "http://www.secondlife.com/"); |
459 | #undef PACKAGE | 456 | #undef PACKAGE |
457 | |||
458 | void gst_slvideo_init_class (void) | ||
459 | { | ||
460 | ll_gst_plugin_register_static (&gst_plugin_desc); | 460 | ll_gst_plugin_register_static (&gst_plugin_desc); |
461 | //fprintf(stderr, "\n\n\nCLASS INIT\n\n\n"); | 461 | //fprintf(stderr, "\n\n\nCLASS INIT\n\n\n"); |
462 | } | 462 | } |
463 | 463 | ||
464 | #endif // LL_GSTREAMER_ENABLED | 464 | ///#endif // LL_GSTREAMER_ENABLED |
diff --git a/linden/indra/llmedia/llmediaimplgstreamervidplug.h b/linden/indra/llmedia/llmediaimplgstreamervidplug.h index 27957db..da7de6e 100644 --- a/linden/indra/llmedia/llmediaimplgstreamervidplug.h +++ b/linden/indra/llmedia/llmediaimplgstreamervidplug.h | |||
@@ -32,12 +32,13 @@ | |||
32 | #ifndef __GST_SLVIDEO_H__ | 32 | #ifndef __GST_SLVIDEO_H__ |
33 | #define __GST_SLVIDEO_H__ | 33 | #define __GST_SLVIDEO_H__ |
34 | 34 | ||
35 | #if LL_GSTREAMER_ENABLED | 35 | ///#if LL_GSTREAMER_ENABLED |
36 | 36 | ||
37 | extern "C" { | 37 | extern "C" { |
38 | #include <gst/gst.h> | 38 | #include <gst/gst.h> |
39 | #include <gst/video/video.h> | 39 | #include <gst/video/video.h> |
40 | #include <gst/video/gstvideosink.h> | 40 | #include <gst/video/gstvideosink.h> |
41 | #include <gthread.h> | ||
41 | } | 42 | } |
42 | 43 | ||
43 | G_BEGIN_DECLS | 44 | G_BEGIN_DECLS |
@@ -97,8 +98,11 @@ GType gst_slvideo_get_type (void); | |||
97 | 98 | ||
98 | void gst_slvideo_init_class (void); | 99 | void gst_slvideo_init_class (void); |
99 | 100 | ||
101 | bool g_once_init_enter (volatile gsize *value_location); | ||
102 | void g_once_init_leave (volatile gsize *value_location, gsize initialization_value); | ||
103 | |||
100 | G_END_DECLS | 104 | G_END_DECLS |
101 | 105 | ||
102 | #endif // LL_GSTREAMER_ENABLED | 106 | ///#endif // LL_GSTREAMER_ENABLED |
103 | 107 | ||
104 | #endif /* __GST_SLVIDEO_H__ */ | 108 | #endif /* __GST_SLVIDEO_H__ */ |
diff --git a/linden/indra/llmedia/llmediamanager.cpp b/linden/indra/llmedia/llmediamanager.cpp index 57256e6..5394b62 100644 --- a/linden/indra/llmedia/llmediamanager.cpp +++ b/linden/indra/llmedia/llmediamanager.cpp | |||
@@ -90,10 +90,10 @@ void LLMediaManager::initClass( LLMediaManagerData* init_data ) | |||
90 | LLMediaImplQuickTime::startup( init_data ); | 90 | LLMediaImplQuickTime::startup( init_data ); |
91 | #endif // LL_QUICKTIME_ENABLED | 91 | #endif // LL_QUICKTIME_ENABLED |
92 | 92 | ||
93 | #if LL_GSTREAMER_ENABLED | 93 | ///#if LL_GSTREAMER_ENABLED |
94 | LL_DEBUGS("MediaManager") << "LLMediaManager::initClass: starting gstreamer" << LL_ENDL; | 94 | LL_DEBUGS("MediaManager") << "LLMediaManager::initClass: starting gstreamer" << LL_ENDL; |
95 | LLMediaImplGStreamer::startup( init_data ); | 95 | LLMediaImplGStreamer::startup( init_data ); |
96 | #endif // LL_GSTREAMER_ENABLED | 96 | ///#endif // LL_GSTREAMER_ENABLED |
97 | } | 97 | } |
98 | 98 | ||
99 | //////////////////////////////////////////////////////////////////////////////// | 99 | //////////////////////////////////////////////////////////////////////////////// |
@@ -133,9 +133,9 @@ void LLMediaManager::cleanupClass() | |||
133 | LLMediaImplQuickTime::closedown(); | 133 | LLMediaImplQuickTime::closedown(); |
134 | #endif // LL_QUICKTIME_ENABLED | 134 | #endif // LL_QUICKTIME_ENABLED |
135 | 135 | ||
136 | #if LL_GSTREAMER_ENABLED | 136 | ///#if LL_GSTREAMER_ENABLED |
137 | LLMediaImplGStreamer::closedown(); | 137 | LLMediaImplGStreamer::closedown(); |
138 | #endif // LL_QUICKTIME_ENABLED | 138 | ///#endif // LL_QUICKTIME_ENABLED |
139 | 139 | ||
140 | if ( sInstance ) | 140 | if ( sInstance ) |
141 | delete sInstance; | 141 | delete sInstance; |
diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp index f0acee5..0cff44f 100644 --- a/linden/indra/llwindow/llwindowsdl.cpp +++ b/linden/indra/llwindow/llwindowsdl.cpp | |||
@@ -123,9 +123,9 @@ BOOL ll_try_gtk_init(void) | |||
123 | if (!tried_gtk_init) | 123 | if (!tried_gtk_init) |
124 | { | 124 | { |
125 | tried_gtk_init = TRUE; | 125 | tried_gtk_init = TRUE; |
126 | #if LL_GSTREAMER_ENABLED | 126 | ///#if LL_GSTREAMER_ENABLED |
127 | if (!g_thread_supported ()) g_thread_init (NULL); | 127 | if (!g_thread_supported ()) g_thread_init (NULL); |
128 | #endif // LL_GSTREAMER_ENABLED | 128 | ///#endif // LL_GSTREAMER_ENABLED |
129 | maybe_lock_display(); | 129 | maybe_lock_display(); |
130 | gtk_is_good = gtk_init_check(NULL, NULL); | 130 | gtk_is_good = gtk_init_check(NULL, NULL); |
131 | maybe_unlock_display(); | 131 | maybe_unlock_display(); |