/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h

https://bitbucket.org/lindenlab/viewer-beta/ · C++ Header · 74 lines · 34 code · 9 blank · 31 comment · 0 complexity · f842fb5b00950b2ea5d43b5bee8c4d93 MD5 · raw file

  1. /**
  2. * @file llmediaimplgstreamer_syms.h
  3. * @brief dynamic GStreamer symbol-grabbing code
  4. *
  5. * @cond
  6. * $LicenseInfo:firstyear=2007&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. * @endcond
  27. */
  28. #include "linden_common.h"
  29. #if LL_GSTREAMER010_ENABLED
  30. extern "C" {
  31. #include <gst/gst.h>
  32. }
  33. bool grab_gst_syms(std::string gst_dso_name,
  34. std::string gst_dso_name_vid);
  35. void ungrab_gst_syms();
  36. #define LL_GST_SYM(REQ, GSTSYM, RTN, ...) extern RTN (*ll##GSTSYM)(__VA_ARGS__)
  37. #include "llmediaimplgstreamer_syms_raw.inc"
  38. #include "llmediaimplgstreamer_syms_rawv.inc"
  39. #undef LL_GST_SYM
  40. // regrettable hacks to give us better runtime compatibility with older systems
  41. #define llg_return_if_fail(COND) do{if (!(COND)) return;}while(0)
  42. #define llg_return_val_if_fail(COND,V) do{if (!(COND)) return V;}while(0)
  43. // regrettable hacks because GStreamer was not designed for runtime loading
  44. #undef GST_TYPE_MESSAGE
  45. #define GST_TYPE_MESSAGE (llgst_message_get_type())
  46. #undef GST_TYPE_OBJECT
  47. #define GST_TYPE_OBJECT (llgst_object_get_type())
  48. #undef GST_TYPE_PIPELINE
  49. #define GST_TYPE_PIPELINE (llgst_pipeline_get_type())
  50. #undef GST_TYPE_ELEMENT
  51. #define GST_TYPE_ELEMENT (llgst_element_get_type())
  52. #undef GST_TYPE_VIDEO_SINK
  53. #define GST_TYPE_VIDEO_SINK (llgst_video_sink_get_type())
  54. // more regrettable hacks to stub-out these .h-exposed GStreamer internals
  55. void ll_gst_debug_register_funcptr(GstDebugFuncPtr func, gchar* ptrname);
  56. #undef _gst_debug_register_funcptr
  57. #define _gst_debug_register_funcptr ll_gst_debug_register_funcptr
  58. GstDebugCategory* ll_gst_debug_category_new(gchar *name, guint color, gchar *description);
  59. #undef _gst_debug_category_new
  60. #define _gst_debug_category_new ll_gst_debug_category_new
  61. #undef __gst_debug_enabled
  62. #define __gst_debug_enabled (0)
  63. // more hacks
  64. #define LLGST_MESSAGE_TYPE_NAME(M) (llgst_message_type_get_name(GST_MESSAGE_TYPE(M)))
  65. #endif // LL_GSTREAMER010_ENABLED