gstdevice.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* GStreamer
  2. * Copyright (C) 2012 Olivier Crete <[email protected]>
  3. *
  4. * gstdevice.c: Device discovery
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. */
  21. #ifndef __GST_DEVICE_H__
  22. #define __GST_DEVICE_H__
  23. typedef struct _GstDevice GstDevice;
  24. typedef struct _GstDeviceClass GstDeviceClass;
  25. #include <gst/gstelement.h>
  26. #include <gst/gstcaps.h>
  27. G_BEGIN_DECLS
  28. typedef struct _GstDevicePrivate GstDevicePrivate;
  29. #define GST_TYPE_DEVICE (gst_device_get_type())
  30. #define GST_IS_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DEVICE))
  31. #define GST_IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_DEVICE))
  32. #define GST_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DEVICE, GstDeviceClass))
  33. #define GST_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DEVICE, GstDevice))
  34. #define GST_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE, GstDeviceClass))
  35. #define GST_DEVICE_CAST(obj) ((GstDevice *)(obj))
  36. /**
  37. * GstDevice:
  38. * @parent: The parent #GstObject strucuture.
  39. *
  40. * A device object.
  41. *
  42. * Since: 1.4
  43. */
  44. struct _GstDevice {
  45. GstObject parent;
  46. /*< private >*/
  47. GstDevicePrivate *priv;
  48. gpointer _gst_reserved[GST_PADDING];
  49. };
  50. /**
  51. * GstDeviceClass:
  52. * @parent_class: The parent #GstObjectClass strucuture.
  53. * @create_element: Creates the fully configured element to access this device.
  54. * Subclasses need to override this and return a new element.
  55. * @reconfigure_element: This only needs to be implemented by subclasses if the
  56. * element can be reconfigured to use a different device. See the documentation
  57. * for gst_device_reconfigure_element().
  58. *
  59. * The class structure for a #GstDevice object.
  60. *
  61. * Since: 1.4
  62. */
  63. struct _GstDeviceClass {
  64. GstObjectClass parent_class;
  65. GstElement * (*create_element) (GstDevice * device, const gchar * name);
  66. gboolean (*reconfigure_element) (GstDevice * device, GstElement * element);
  67. /*< private >*/
  68. gpointer _gst_reserved[GST_PADDING];
  69. };
  70. GType gst_device_get_type (void);
  71. GstElement * gst_device_create_element (GstDevice * device, const gchar * name);
  72. GstCaps * gst_device_get_caps (GstDevice * device);
  73. gchar * gst_device_get_display_name (GstDevice * device);
  74. gchar * gst_device_get_device_class (GstDevice * device);
  75. gboolean gst_device_reconfigure_element (GstDevice * device,
  76. GstElement * element);
  77. gboolean gst_device_has_classesv (GstDevice * device,
  78. gchar ** classes);
  79. gboolean gst_device_has_classes (GstDevice * device,
  80. const gchar * classes);
  81. G_END_DECLS
  82. #endif /* __GST_DEVICE_H__ */