PageRenderTime 34ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 105 lines | 54 code | 17 blank | 34 comment | 0 complexity | d12af91554e8c789d0f5fdd427a95ebc MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llmediaimplgstreamervidplug.h
  3. * @brief Video-consuming static GStreamer plugin for gst-to-LLMediaImpl
  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. #ifndef __GST_SLVIDEO_H__
  29. #define __GST_SLVIDEO_H__
  30. #if LL_GSTREAMER010_ENABLED
  31. extern "C" {
  32. #include <gst/gst.h>
  33. #include <gst/video/video.h>
  34. #include <gst/video/gstvideosink.h>
  35. }
  36. G_BEGIN_DECLS
  37. /* #defines don't like whitespacey bits */
  38. #define GST_TYPE_SLVIDEO \
  39. (gst_slvideo_get_type())
  40. #define GST_SLVIDEO(obj) \
  41. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SLVIDEO,GstSLVideo))
  42. #define GST_SLVIDEO_CLASS(klass) \
  43. (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SLVIDEO,GstSLVideoClass))
  44. #define GST_IS_SLVIDEO(obj) \
  45. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SLVIDEO))
  46. #define GST_IS_SLVIDEO_CLASS(klass) \
  47. (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SLVIDEO))
  48. typedef struct _GstSLVideo GstSLVideo;
  49. typedef struct _GstSLVideoClass GstSLVideoClass;
  50. typedef enum {
  51. SLV_PF_UNKNOWN = 0,
  52. SLV_PF_RGBX = 1,
  53. SLV_PF_BGRX = 2,
  54. SLV__END = 3
  55. } SLVPixelFormat;
  56. const int SLVPixelFormatBytes[SLV__END] = {1, 4, 4};
  57. struct _GstSLVideo
  58. {
  59. GstVideoSink video_sink;
  60. GstCaps *caps;
  61. int fps_n, fps_d;
  62. int par_n, par_d;
  63. int height, width;
  64. SLVPixelFormat format;
  65. // SHARED WITH APPLICATION:
  66. // Access to the following should be protected by GST_OBJECT_LOCK() on
  67. // the GstSLVideo object, and should be totally consistent upon UNLOCK
  68. // (i.e. all written at once to reflect the current retained frame info
  69. // when the retained frame is updated.)
  70. bool retained_frame_ready; // new frame ready since flag last reset. (*TODO: could get the writer to wait on a semaphore instead of having the reader poll, potentially making dropped frames somewhat cheaper.)
  71. unsigned char* retained_frame_data;
  72. int retained_frame_allocbytes;
  73. int retained_frame_width, retained_frame_height;
  74. SLVPixelFormat retained_frame_format;
  75. // sticky resize info
  76. bool resize_forced_always;
  77. int resize_try_width;
  78. int resize_try_height;
  79. };
  80. struct _GstSLVideoClass
  81. {
  82. GstVideoSinkClass parent_class;
  83. };
  84. GType gst_slvideo_get_type (void);
  85. void gst_slvideo_init_class (void);
  86. G_END_DECLS
  87. #endif // LL_GSTREAMER010_ENABLED
  88. #endif /* __GST_SLVIDEO_H__ */