After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740502 - Add absolute property to GstDirectControlBinding
Add absolute property to GstDirectControlBinding
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 760526 (view as bug list)
Depends on:
Blocks: 749916
 
 
Reported: 2014-11-21 15:11 UTC by Lazar Claudiu
Modified: 2016-01-12 23:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add absolute property patch (3.51 KB, patch)
2014-11-21 15:12 UTC, Lazar Claudiu
needs-work Details | Review
Example usecase (640.00 KB, application/x-tar)
2014-11-21 15:14 UTC, Lazar Claudiu
  Details
fixes after review (9.22 KB, patch)
2014-12-02 13:31 UTC, Lazar Claudiu
none Details | Review
Changed constructor name as per review and added example usage (13.73 KB, patch)
2015-05-25 11:07 UTC, Lazar Claudiu
none Details | Review
Changed constructor name as per review and added example usage ( fixed author ) (13.74 KB, patch)
2015-05-26 09:32 UTC, Lazar Claudiu
none Details | Review
Added unit test (13.64 KB, patch)
2015-06-10 10:38 UTC, Lazar Claudiu
none Details | Review
Fixed header (14.67 KB, patch)
2015-06-10 10:49 UTC, Lazar Claudiu
committed Details | Review
controller: Added absolute direct control binding, example and test (14.73 KB, patch)
2015-06-12 08:07 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Lazar Claudiu 2014-11-21 15:11:59 UTC
Currently you can not slide an image/text overlay in and out of the frame. One fix would be to remove the CLAMP's constricting the values inside the property range and use the relative properties of textoverlay and gdkpixbufoverlay but it doesn't seem right to me.

I propose adding an 'absolute' property that doesn't modify the values being input in the controller at all.
Comment 1 Lazar Claudiu 2014-11-21 15:12:20 UTC
Created attachment 291183 [details] [review]
Add absolute property patch
Comment 2 Lazar Claudiu 2014-11-21 15:14:01 UTC
Created attachment 291185 [details]
Example usecase
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2014-11-24 12:33:45 UTC
Review of attachment 291183 [details] [review]:

The documentation blob at the top needs to be updates as well. 
I would not mind to see the example being turned into a patch for tests/examples/controller/.

::: libs/gst/controller/gstdirectcontrolbinding.c
@@ +191,3 @@
+      g_param_spec_boolean ("absolute", "Absolute",
+      "Whether the control values are absolute",
+      DEFAULT_PROP_ABSOLUTE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);

just put FALSE here and remove the DEFAULT_PROP_ABSOLUTE (please not that G_PARAM_CONSTRUCT can be used to initialize the default).

Also does it make sense to ever switch this at run-time? Can this be G_PARAM_CONSTRUCT_ONLY? If construct-only you can make two sets of mapping functions and avoid the if (self->want_absolute) at runtime - this code is getting called quite often.

@@ +199,3 @@
 gst_direct_control_binding_init (GstDirectControlBinding * self)
 {
+  self->want_absolute = DEFAULT_PROP_ABSOLUTE;

the object is cleared to zero by default.
Comment 4 Lazar Claudiu 2014-12-02 13:31:47 UTC
Created attachment 291987 [details] [review]
fixes after review
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2015-01-21 21:19:27 UTC
Review of attachment 291987 [details] [review]:

I think it looks good (besides the name for the constructor). I still like to see some testing. We also have tests/examples/controller - maybe your example can be merged there? Can you try that as a 2nd patch?

::: libs/gst/controller/gstdirectcontrolbinding.c
@@ +532,3 @@
+ */
+GstControlBinding *
+ *

perhaps
gst_direct_control_binding_new_absolute() ?
Comment 6 Lazar Claudiu 2015-05-25 11:07:14 UTC
Created attachment 303905 [details] [review]
Changed constructor name as per review and added example usage
Comment 7 Lazar Claudiu 2015-05-26 09:32:35 UTC
Created attachment 303977 [details] [review]
Changed constructor name as per review and added example usage ( fixed author )
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2015-05-29 15:12:46 UTC
Review of attachment 303977 [details] [review]:

Please still add unit tests as asked before.

::: libs/gst/controller/gstdirectcontrolbinding.h
@@ +75,3 @@
  */
+struct _GstDirectControlBinding
+{

please don't reformat code unless you change it. especially don't gst-indent header files
Comment 9 Lazar Claudiu 2015-06-10 10:38:19 UTC
Created attachment 304937 [details] [review]
Added unit test
Comment 10 Lazar Claudiu 2015-06-10 10:49:42 UTC
Created attachment 304940 [details] [review]
Fixed header
Comment 11 Stefan Sauer (gstreamer, gtkdoc dev) 2015-06-12 08:07:38 UTC
The following fix has been pushed:
cb2c141 controller: Added absolute direct control binding, example and test
Comment 12 Stefan Sauer (gstreamer, gtkdoc dev) 2015-06-12 08:07:50 UTC
Created attachment 305120 [details] [review]
controller: Added absolute direct control binding, example and test

Fixes: 740502
API: gst_direct_control_binding_new_absolute
Comment 13 Stefan Sauer (gstreamer, gtkdoc dev) 2015-06-12 08:10:32 UTC
I added a Since: marker to the api and updated the example a bit to not set properties that don't exist (anymore).
Comment 14 Tim-Philipp Müller 2015-06-29 09:43:35 UTC
commit 86abdbfb5552a11219275e5b597e7d8b476748b2
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Mon Jun 29 10:41:27 2015 +0100

    directcontrolbinding: fix ABI break
    
    Structure size was increased without adjustment of the padding.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751622
    https://bugzilla.gnome.org/show_bug.cgi?id=740502
Comment 15 Tim-Philipp Müller 2016-01-12 23:49:31 UTC
*** Bug 760526 has been marked as a duplicate of this bug. ***