From 2092754ed1554ed255cfde8df602a4255f14c007 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 1 Jun 2014 16:56:41 +0100 Subject: [PATCH] device: rename "klass" and get_klass() to "device-class" and _get_device_class() There's some precedent in GstElementFactory, but a "klass" property just seems weird. --- docs/gst/gstreamer-sections.txt | 5 +++++ gst/gstdevice.c | 35 +++++++++++++++++++---------------- gst/gstdevice.h | 2 +- win32/common/libgstreamer.def | 2 +- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index d6e1997..60f84fe 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -3344,6 +3344,11 @@ GST_DEVICE_GET_CLASS GST_IS_DEVICE GST_IS_DEVICE_CLASS GST_TYPE_DEVICE + +gst_device_create_element +gst_device_get_caps +gst_device_get_display_name +gst_device_get_device_class gst_device_get_type diff --git a/gst/gstdevice.c b/gst/gstdevice.c index e67ec2c..9119ba9 100644 --- a/gst/gstdevice.c +++ b/gst/gstdevice.c @@ -46,7 +46,7 @@ enum { PROP_DISPLAY_NAME = 1, PROP_CAPS, - PROP_KLASS + PROP_DEVICE_CLASS }; enum @@ -58,7 +58,7 @@ enum struct _GstDevicePrivate { GstCaps *caps; - gchar *klass; + gchar *device_class; gchar *display_name; }; @@ -93,8 +93,8 @@ gst_device_class_init (GstDeviceClass * klass) g_param_spec_boxed ("caps", "Device Caps", "The possible caps of a device", GST_TYPE_CAPS, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property (object_class, PROP_KLASS, - g_param_spec_string ("klass", "Device Class", + g_object_class_install_property (object_class, PROP_DEVICE_CLASS, + g_param_spec_string ("device-class", "Device Class", "The Class of the device", "", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); @@ -117,7 +117,7 @@ gst_device_finalize (GObject * object) gst_caps_replace (&device->priv->caps, NULL); g_free (device->priv->display_name); - g_free (device->priv->klass); + g_free (device->priv->device_class); G_OBJECT_CLASS (gst_device_parent_class)->finalize (object); } @@ -138,8 +138,8 @@ gst_device_get_property (GObject * object, guint prop_id, if (gstdevice->priv->caps) g_value_take_boxed (value, gst_device_get_caps (gstdevice)); break; - case PROP_KLASS: - g_value_take_string (value, gst_device_get_klass (gstdevice)); + case PROP_DEVICE_CLASS: + g_value_take_string (value, gst_device_get_device_class (gstdevice)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -163,8 +163,8 @@ gst_device_set_property (GObject * object, guint prop_id, case PROP_CAPS: gst_caps_replace (&gstdevice->priv->caps, g_value_get_boxed (value)); break; - case PROP_KLASS: - gstdevice->priv->klass = g_value_dup_string (value); + case PROP_DEVICE_CLASS: + gstdevice->priv->device_class = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -234,7 +234,7 @@ gst_device_get_display_name (GstDevice * device) } /** - * gst_device_get_klass: + * gst_device_get_device_class: * @device: a #GstDevice * * Gets the "class" of a device. This is a "/" separated list of @@ -246,9 +246,12 @@ gst_device_get_display_name (GstDevice * device) * Since: 1.4 */ gchar * -gst_device_get_klass (GstDevice * device) +gst_device_get_device_class (GstDevice * device) { - return g_strdup (device->priv->klass ? device->priv->klass : ""); + if (device->priv->device_class != NULL) + return g_strdup (device->priv->device_class); + else + return g_strdup (""); } /** @@ -304,11 +307,11 @@ gst_device_has_classesv (GstDevice * device, gchar ** classes) if (classes[0] == '\0') continue; - found = strstr (device->priv->klass, classes[0]); + found = strstr (device->priv->device_class, classes[0]); if (!found) return FALSE; - if (found != device->priv->klass && *(found - 1) != '/') + if (found != device->priv->device_class && *(found - 1) != '/') return FALSE; len = strlen (classes[0]); @@ -322,8 +325,8 @@ gst_device_has_classesv (GstDevice * device, gchar ** classes) /** * gst_device_has_classes: * @device: a #GstDevice - * @classes: a "/" separate list of klasses to match, only match if all classes - * are matched + * @classes: a "/" separate list of device classes to match, only match if + * all classes are matched * * Check if @device matches all of the given classes * diff --git a/gst/gstdevice.h b/gst/gstdevice.h index 80da209..b055aa0 100644 --- a/gst/gstdevice.h +++ b/gst/gstdevice.h @@ -90,7 +90,7 @@ GstElement * gst_device_create_element (GstDevice * device, const gchar * name); GstCaps * gst_device_get_caps (GstDevice * device); gchar * gst_device_get_display_name (GstDevice * device); -gchar * gst_device_get_klass (GstDevice * device); +gchar * gst_device_get_device_class (GstDevice * device); gboolean gst_device_reconfigure_element (GstDevice * device, GstElement * element); diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index 6ae4ada..fc74f2f 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -410,8 +410,8 @@ EXPORTS gst_deinit gst_device_create_element gst_device_get_caps + gst_device_get_device_class gst_device_get_display_name - gst_device_get_klass gst_device_get_type gst_device_has_classes gst_device_has_classesv -- 2.7.4