[Bug 747606] v4l2: adding cropping and compose functionality

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Feb 8 16:35:26 UTC 2018


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

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

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

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

I think we need to step back design nicer properties. Here's some possible
solution, hopefully this will open the discussion.

::: sys/v4l2/gstv4l2object.c
@@ +440,3 @@
+   * Video for Linux API
+   * An example command line input:
+   * section=crop,top=150,flags=

The SELECTION API in V4L2 is terribly loaded and complicated, it fits badly
inside a single property. To help reflect that, there is no way a new user will
manage to use your example here to set that property, since a GstStructure have
a name, which in your case seems ignored, so syntax is
"whatever/section=crop,..." which is terribly ugly (just like the extra-control
property).

As per the spec, to detect if the driver supports scaling, you need to be able
to read back the value. This implementation does not allow this, which means
you can only hardcode for your hardware.

Overall, I think it would be much nicer to split into multiple properties,
which then can be read/write. like:
 - "crop-rectangle"
 - "compose-rectangle" (or render-rectangle)

And then you follow videosink path for render-rectangle property, which uses a
list to represent the rectangle (removing the ugly name/ from GstStruct
syntax). In general, a rectangle has the coordinate preceding the size. Then
the naming is all equivalent, our preferred naming is:
  <x, y, width, height>

But it's the same as "left, top, width, height" or "x1, y1, x2, y2". The
exception being videocrop (left, top, right, bottom) which is hard to use.

@@ +442,3 @@
+   * section=crop,top=150,flags=
+   *
+   * Since: 1.13.x

We never set Since marker on dev version. 1.14, even though I doubt this will
be ready for that one.

::: sys/v4l2/gstv4l2src.c
@@ +634,3 @@
       gst_object_unref (allocator);

+    gst_v4l2_object_try_set_selection (src->v4l2object);

Return value ?

-- 
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