gstparamspecs.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /* GStreamer - GParamSpecs for some of our types
  2. * Copyright (C) 2007 Tim-Philipp Müller <tim centricular net>
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  17. * Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef __GST_PARAMSPECS_H__
  20. #define __GST_PARAMSPECS_H__
  21. #include <gst/gstvalue.h>
  22. G_BEGIN_DECLS
  23. /* --- paramspec flags */
  24. /**
  25. * GST_PARAM_CONTROLLABLE:
  26. *
  27. * Use this flag on GObject properties to signal they can make sense to be.
  28. * controlled over time. This hint is used by the GstController.
  29. */
  30. #define GST_PARAM_CONTROLLABLE (1 << (G_PARAM_USER_SHIFT + 1))
  31. /**
  32. * GST_PARAM_MUTABLE_READY:
  33. *
  34. * Use this flag on GObject properties of GstElements to indicate that
  35. * they can be changed when the element is in the READY or lower state.
  36. */
  37. #define GST_PARAM_MUTABLE_READY (1 << (G_PARAM_USER_SHIFT + 2))
  38. /**
  39. * GST_PARAM_MUTABLE_PAUSED:
  40. *
  41. * Use this flag on GObject properties of GstElements to indicate that
  42. * they can be changed when the element is in the PAUSED or lower state.
  43. * This flag implies GST_PARAM_MUTABLE_READY.
  44. */
  45. #define GST_PARAM_MUTABLE_PAUSED (1 << (G_PARAM_USER_SHIFT + 3))
  46. /**
  47. * GST_PARAM_MUTABLE_PLAYING:
  48. *
  49. * Use this flag on GObject properties of GstElements to indicate that
  50. * they can be changed when the element is in the PLAYING or lower state.
  51. * This flag implies GST_PARAM_MUTABLE_PAUSED.
  52. */
  53. #define GST_PARAM_MUTABLE_PLAYING (1 << (G_PARAM_USER_SHIFT + 4))
  54. /**
  55. * GST_PARAM_USER_SHIFT:
  56. *
  57. * Bits based on GST_PARAM_USER_SHIFT can be used by 3rd party applications.
  58. */
  59. #define GST_PARAM_USER_SHIFT (1 << (G_PARAM_USER_SHIFT + 8))
  60. /* --- type macros --- */
  61. #define GST_TYPE_PARAM_FRACTION (gst_param_spec_fraction_get_type ())
  62. #define GST_IS_PARAM_SPEC_FRACTION(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GST_TYPE_PARAM_FRACTION))
  63. #define GST_PARAM_SPEC_FRACTION(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GST_TYPE_PARAM_FRACTION, GstParamSpecFraction))
  64. /* --- get_type functions --- */
  65. GType gst_param_spec_fraction_get_type (void);
  66. /* --- typedefs & structures --- */
  67. typedef struct _GstParamSpecFraction GstParamSpecFraction;
  68. /**
  69. * GstParamSpecFraction:
  70. * @parent_instance: super class
  71. * @min_num: minimal numerator
  72. * @min_den: minimal denominator
  73. * @max_num: maximal numerator
  74. * @max_den: maximal denominator
  75. * @def_num: default numerator
  76. * @def_den: default denominator
  77. *
  78. * A GParamSpec derived structure that contains the meta data for fractional
  79. * properties.
  80. */
  81. struct _GstParamSpecFraction {
  82. GParamSpec parent_instance;
  83. gint min_num, min_den;
  84. gint max_num, max_den;
  85. gint def_num, def_den;
  86. };
  87. /* --- GParamSpec prototypes --- */
  88. GParamSpec * gst_param_spec_fraction (const gchar * name,
  89. const gchar * nick,
  90. const gchar * blurb,
  91. gint min_num, gint min_denom,
  92. gint max_num, gint max_denom,
  93. gint default_num, gint default_denom,
  94. GParamFlags flags) G_GNUC_MALLOC;
  95. G_END_DECLS
  96. #endif /* __GST_PARAMSPECS_H__ */