diff options
author | Wim Taymans <wtaymans@redhat.com> | 2015-07-16 18:43:06 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2015-07-16 18:54:50 +0200 |
commit | b4dbb9d7427c27a2297287b5d29b36bd50eb356e (patch) | |
tree | 35315f2fab542c85414dd22f39501c08b04385e7 | |
parent | 8caf9b7a8744a6a6ae617f6d27f8cb7f17acccdc (diff) |
deviceprovider: small cleanups
Protect against wrong arguments.
Clean up the header file indentation.
-rw-r--r-- | gst/gstdeviceprovider.c | 6 | ||||
-rw-r--r-- | gst/gstdeviceprovider.h | 16 |
2 files changed, 14 insertions, 8 deletions
diff --git a/gst/gstdeviceprovider.c b/gst/gstdeviceprovider.c index 8ad737cd4..995c2ff8a 100644 --- a/gst/gstdeviceprovider.c +++ b/gst/gstdeviceprovider.c @@ -543,6 +543,9 @@ gst_device_provider_device_add (GstDeviceProvider * provider, { GstMessage *message; + g_return_if_fail (GST_IS_DEVICE_PROVIDER (provider)); + g_return_if_fail (GST_IS_DEVICE (device)); + if (!gst_object_set_parent (GST_OBJECT (device), GST_OBJECT (provider))) { GST_WARNING_OBJECT (provider, "Could not parent device %p to provider," " it already has a parent", device); @@ -579,6 +582,9 @@ gst_device_provider_device_remove (GstDeviceProvider * provider, GstMessage *message; GList *item; + g_return_if_fail (GST_IS_DEVICE_PROVIDER (provider)); + g_return_if_fail (GST_IS_DEVICE (device)); + GST_OBJECT_LOCK (provider); item = g_list_find (provider->devices, device); if (item) { diff --git a/gst/gstdeviceprovider.h b/gst/gstdeviceprovider.h index 6370afc65..3982f3b89 100644 --- a/gst/gstdeviceprovider.h +++ b/gst/gstdeviceprovider.h @@ -111,31 +111,31 @@ gboolean gst_device_provider_can_monitor (GstDeviceProvider * provider); GstBus * gst_device_provider_get_bus (GstDeviceProvider * provider); void gst_device_provider_device_add (GstDeviceProvider * provider, - GstDevice * device); + GstDevice * device); void gst_device_provider_device_remove (GstDeviceProvider * provider, GstDevice * device); /* device provider class meta data */ -void gst_device_provider_class_set_metadata (GstDeviceProviderClass *klass, +void gst_device_provider_class_set_metadata (GstDeviceProviderClass *klass, const gchar *longname, const gchar *classification, const gchar *description, const gchar *author); -void gst_device_provider_class_set_static_metadata (GstDeviceProviderClass *klass, +void gst_device_provider_class_set_static_metadata (GstDeviceProviderClass *klass, const gchar *longname, const gchar *classification, const gchar *description, const gchar *author); -void gst_device_provider_class_add_metadata (GstDeviceProviderClass * klass, +void gst_device_provider_class_add_metadata (GstDeviceProviderClass * klass, const gchar * key, const gchar * value); -void gst_device_provider_class_add_static_metadata (GstDeviceProviderClass * klass, +void gst_device_provider_class_add_static_metadata (GstDeviceProviderClass * klass, const gchar * key, const gchar * value); -const gchar * gst_device_provider_class_get_metadata (GstDeviceProviderClass * klass, - const gchar * key); +const gchar * gst_device_provider_class_get_metadata (GstDeviceProviderClass * klass, + const gchar * key); /* factory management */ -GstDeviceProviderFactory * gst_device_provider_get_factory (GstDeviceProvider * provider); +GstDeviceProviderFactory * gst_device_provider_get_factory (GstDeviceProvider * provider); G_END_DECLS |