gstdirectcontrolbinding.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* GStreamer
  2. *
  3. * Copyright (C) 2011 Stefan Sauer <[email protected]>
  4. *
  5. * gstdirectcontrolbinding.h: Direct 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_DIRECT_CONTROL_BINDING_H__
  23. #define __GST_DIRECT_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_DIRECT_CONTROL_BINDING \
  29. (gst_direct_control_binding_get_type())
  30. #define GST_DIRECT_CONTROL_BINDING(obj) \
  31. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DIRECT_CONTROL_BINDING,GstDirectControlBinding))
  32. #define GST_DIRECT_CONTROL_BINDING_CLASS(klass) \
  33. (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DIRECT_CONTROL_BINDING,GstDirectControlBindingClass))
  34. #define GST_IS_DIRECT_CONTROL_BINDING(obj) \
  35. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DIRECT_CONTROL_BINDING))
  36. #define GST_IS_DIRECT_CONTROL_BINDING_CLASS(klass) \
  37. (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DIRECT_CONTROL_BINDING))
  38. #define GST_DIRECT_CONTROL_BINDING_GET_CLASS(obj) \
  39. (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_CONTOL_SOURCE, GstDirectControlBindingClass))
  40. typedef struct _GstDirectControlBinding GstDirectControlBinding;
  41. typedef struct _GstDirectControlBindingClass GstDirectControlBindingClass;
  42. /**
  43. * GstDirectControlBindingConvertValue:
  44. * @self: the #GstDirectControlBinding instance
  45. * @src_value: the value returned by the cotnrol source
  46. * @dest_value: the target location
  47. *
  48. * Function to map a control-value to the target plain data type.
  49. */
  50. typedef void (* GstDirectControlBindingConvertValue) (GstDirectControlBinding *self, gdouble src_value, gpointer dest_value);
  51. /**
  52. * GstDirectControlBindingConvertGValue:
  53. * @self: the #GstDirectControlBinding instance
  54. * @src_value: the value returned by the cotnrol source
  55. * @dest_value: the target GValue
  56. *
  57. * Function to map a control-value to the target GValue.
  58. */
  59. typedef void (* GstDirectControlBindingConvertGValue) (GstDirectControlBinding *self, gdouble src_value, GValue *dest_value);
  60. /**
  61. * GstDirectControlBinding:
  62. * @name: name of the property of this binding
  63. *
  64. * The instance structure of #GstDirectControlBinding.
  65. */
  66. struct _GstDirectControlBinding {
  67. GstControlBinding parent;
  68. /*< private >*/
  69. GstControlSource *cs; /* GstControlSource for this property */
  70. GValue cur_value;
  71. gdouble last_value;
  72. gint byte_size;
  73. GstDirectControlBindingConvertValue convert_value;
  74. GstDirectControlBindingConvertGValue convert_g_value;
  75. gpointer _gst_reserved[GST_PADDING];
  76. };
  77. /**
  78. * GstDirectControlBindingClass:
  79. * @parent_class: Parent class
  80. * @convert: Class method to convert control-values
  81. *
  82. * The class structure of #GstDirectControlBinding.
  83. */
  84. struct _GstDirectControlBindingClass
  85. {
  86. GstControlBindingClass parent_class;
  87. /*< private >*/
  88. gpointer _gst_reserved[GST_PADDING];
  89. };
  90. GType gst_direct_control_binding_get_type (void);
  91. /* Functions */
  92. GstControlBinding * gst_direct_control_binding_new (GstObject * object, const gchar * property_name,
  93. GstControlSource * cs);
  94. G_END_DECLS
  95. #endif /* __GST_DIRECT_CONTROL_BINDING_H__ */