[Bug 746818] v4l2: Improve URI handler

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Oct 31 14:59:43 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=746818

Nicolas Dufresne (ndufresne) <nicolas at ndufresne.ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #374101|none                        |needs-work
             status|                            |

--- Comment #11 from Nicolas Dufresne (ndufresne) <nicolas at ndufresne.ca> ---
Review of attachment 374101:
 --> (https://bugzilla.gnome.org/review?bug=746818&attachment=374101)

::: sys/v4l2/gstv4l2object.c
@@ +542,3 @@
+    v4l2object->uri = gst_uri_from_string (DEFAULT_PROP_URI);
+  else
+    v4l2object->uri = DEFAULT_PROP_URI;

That is not great, DEFAULT_PROP_URI is both a string and a GstUri. You also add
a runtime null check, where NULL is hard coded. If you think NULL is a the
default, drop the default macro, it's not useful.

@@ +573,3 @@
+  if (v4l2object->uri) {
+    gst_uri_unref (v4l2object->uri);
+    v4l2object->uri = NULL;

No need, we g_free the v4l2object next.

@@ +628,3 @@
+        gst_object_set_properties_from_uri_query_parameters (G_OBJECT
(v4l2object->element), v4l2object->uri);
+        path = gst_uri_get_path(v4l2object->uri);
+        if (0 != *(path))

Doc says the return of get_path is nullable, you are missing some checks here.

::: sys/v4l2/gstv4l2src.c
@@ +1047,1 @@
+  g_object_set (G_OBJECT (v4l2src->v4l2object->element), "uri", uri, NULL);

v4l2object->element should be v4l2src, why do you use this indirection ?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list