gstcontrolbinding.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* GStreamer
  2. *
  3. * Copyright (C) 2011 Stefan Sauer <[email protected]>
  4. *
  5. * gstcontrolbinding.h: Attachment for control sources
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  20. * Boston, MA 02110-1301, USA.
  21. */
  22. #ifndef __GST_CONTROL_BINDING_H__
  23. #define __GST_CONTROL_BINDING_H__
  24. #include <gst/gstconfig.h>
  25. #include <glib-object.h>
  26. #include <gst/gstcontrolsource.h>
  27. G_BEGIN_DECLS
  28. #define GST_TYPE_CONTROL_BINDING \
  29. (gst_control_binding_get_type())
  30. #define GST_CONTROL_BINDING(obj) \
  31. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CONTROL_BINDING,GstControlBinding))
  32. #define GST_CONTROL_BINDING_CLASS(klass) \
  33. (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CONTROL_BINDING,GstControlBindingClass))
  34. #define GST_IS_CONTROL_BINDING(obj) \
  35. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CONTROL_BINDING))
  36. #define GST_IS_CONTROL_BINDING_CLASS(klass) \
  37. (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CONTROL_BINDING))
  38. #define GST_CONTROL_BINDING_GET_CLASS(obj) \
  39. (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_CONTOL_SOURCE, GstControlBindingClass))
  40. typedef struct _GstControlBinding GstControlBinding;
  41. typedef struct _GstControlBindingClass GstControlBindingClass;
  42. /* FIXME(2.0): remove, this is unused */
  43. typedef void (* GstControlBindingConvert) (GstControlBinding *binding, gdouble src_value, GValue *dest_value);
  44. /**
  45. * GstControlBinding:
  46. * @name: name of the property of this binding
  47. * @pspec: #GParamSpec for this property
  48. *
  49. * The instance structure of #GstControlBinding.
  50. */
  51. struct _GstControlBinding {
  52. GstObject parent;
  53. /*< public >*/
  54. gchar *name;
  55. GParamSpec *pspec;
  56. /*< private >*/
  57. GstObject *object; /* GstObject owning the property
  58. * (== parent when bound) */
  59. gboolean disabled;
  60. gpointer _gst_reserved[GST_PADDING];
  61. };
  62. /**
  63. * GstControlBindingClass:
  64. * @parent_class: Parent class
  65. * @sync_values: implementation for updating the target values
  66. * @get_value: implementation to fetch a single control-value
  67. * @get_value_array: implementation to fetch a series of control-values
  68. * @get_g_value_array: implementation to fetch a series of control-values
  69. * as g_values
  70. *
  71. * The class structure of #GstControlBinding.
  72. */
  73. struct _GstControlBindingClass
  74. {
  75. GstObjectClass parent_class;
  76. /*< public >*/
  77. gboolean (* sync_values) (GstControlBinding *binding, GstObject *object, GstClockTime timestamp, GstClockTime last_sync);
  78. GValue * (* get_value) (GstControlBinding *binding, GstClockTime timestamp);
  79. gboolean (* get_value_array) (GstControlBinding *binding, GstClockTime timestamp,GstClockTime interval, guint n_values, gpointer values);
  80. gboolean (* get_g_value_array) (GstControlBinding *binding, GstClockTime timestamp,GstClockTime interval, guint n_values, GValue *values);
  81. /*< private >*/
  82. gpointer _gst_reserved[GST_PADDING];
  83. };
  84. #define GST_CONTROL_BINDING_PSPEC(cb) (((GstControlBinding *) cb)->pspec)
  85. GType gst_control_binding_get_type (void);
  86. /* Functions */
  87. gboolean gst_control_binding_sync_values (GstControlBinding * binding, GstObject *object,
  88. GstClockTime timestamp, GstClockTime last_sync);
  89. GValue * gst_control_binding_get_value (GstControlBinding *binding,
  90. GstClockTime timestamp);
  91. gboolean gst_control_binding_get_value_array (GstControlBinding *binding, GstClockTime timestamp,
  92. GstClockTime interval, guint n_values, gpointer values);
  93. gboolean gst_control_binding_get_g_value_array (GstControlBinding *binding, GstClockTime timestamp,
  94. GstClockTime interval, guint n_values, GValue *values);
  95. void gst_control_binding_set_disabled (GstControlBinding * binding, gboolean disabled);
  96. gboolean gst_control_binding_is_disabled (GstControlBinding * binding);
  97. G_END_DECLS
  98. #endif /* __GST_CONTROL_BINDING_H__ */