mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
deviceproviderfactory: handle NULL classes argument and match any
This commit is contained in:
parent
fc87c5df5e
commit
9b07b935a4
1 changed files with 9 additions and 6 deletions
|
@ -462,8 +462,8 @@ gst_device_provider_factory_get_metadata_keys (GstDeviceProviderFactory *
|
|||
/**
|
||||
* gst_device_provider_factory_has_classesv:
|
||||
* @factory: a #GstDeviceProviderFactory
|
||||
* @classes: (array zero-terminated=1): a %NULL terminated array of
|
||||
* klasses to match, only match if all classes are matched
|
||||
* @classes: (array zero-terminated=1) (allow-none): a %NULL terminated array
|
||||
* of klasses to match, only match if all classes are matched
|
||||
*
|
||||
* Check if @factory matches all of the given classes
|
||||
*
|
||||
|
@ -488,7 +488,7 @@ gst_device_provider_factory_has_classesv (GstDeviceProviderFactory * factory,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
for (; classes[0]; classes++) {
|
||||
for (; classes != NULL && classes[0] != NULL; classes++) {
|
||||
const gchar *found;
|
||||
guint len;
|
||||
|
||||
|
@ -513,12 +513,12 @@ gst_device_provider_factory_has_classesv (GstDeviceProviderFactory * factory,
|
|||
/**
|
||||
* gst_device_provider_factory_has_classes:
|
||||
* @factory: a #GstDeviceProviderFactory
|
||||
* @classes: a "/" separate list of klasses to match, only match if all classes
|
||||
* are matched
|
||||
* @classes: (allow-none): a "/" separate list of klasses to match, only match
|
||||
* if all classes are matched
|
||||
*
|
||||
* Check if @factory matches all of the given @classes
|
||||
*
|
||||
* Returns: %TRUE if @factory matches.
|
||||
* Returns: %TRUE if @factory matches or if @classes is %NULL.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
|
@ -529,6 +529,9 @@ gst_device_provider_factory_has_classes (GstDeviceProviderFactory * factory,
|
|||
gchar **classesv;
|
||||
gboolean res;
|
||||
|
||||
if (classes == NULL)
|
||||
return TRUE;
|
||||
|
||||
classesv = g_strsplit (classes, "/", 0);
|
||||
|
||||
res = gst_device_provider_factory_has_classesv (factory, classesv);
|
||||
|
|
Loading…
Reference in a new issue