GNOME Bugzilla – Bug 584913
Some elements have redundant api, e.g. GstBaseSink
Last modified: 2009-09-11 08:51:30 UTC
Some elements, like Gst.Base.BaseSink have multiple ways of setting/getting properties. For example there is the Qos property and the IsQosEnabled and SetQosEnabled methods. I propose to remove the methods and keep the property by adding the following lines to Gstreamer.metadata: + <attr path="/api/namespace/object[@cname='GstBaseSink']/method[@cname='gst_base_sink_is_qos_enabled']" name="hidden">1</attr> + <attr path="/api/namespace/object[@cname='GstBaseSink']/method[@cname='gst_base_sink_set_qos_enabled']" name="hidden">1</attr> Somewhat similarly, on Gst.Base.BaseSrc there is a writeonly Live property and a readonly IsLive property. I propose to merge them with the following addition to Gstreamer.metadata: + <attr path="/api/namespace/object[@cname='GstBaseSrc']/method[@name='IsLive']" name="name">GetLive</attr> If you agree with these proposals, I can make a patch for all similar cases in gstreamer-sharp.
Makes sense but please check if the functions do additional stuff compared to the properties (like returning something if the setting failed for example).
Created attachment 136147 [details] [review] Remove unnescessary properties from GstBase* This patch changes the api as follows: --- /tmp/gstreamer-sharp.old.dll.api 2009-06-08 16:04:56.703125000 +0200 +++ /tmp/gstreamer-sharp.dll.api 2009-06-08 16:04:58.875000000 +0200 @@ -182,6 +159,3 @@ public class BaseSink : Gst.Element { public bool Async {get;set;} - public bool AsyncEnabled {set;} public uint Blocksize {get;set;} - public bool IsAsyncEnabled {get;} - public bool IsQosEnabled {get;} public Gst.Buffer LastBuffer {get;} @@ -191,3 +165,2 @@ public class BaseSink : Gst.Element { public bool Qos {get;set;} - public bool QosEnabled {set;} public ulong RenderDelay {get;set;} @@ -226,4 +199,3 @@ public class BaseSrc : Gst.Element { public Gst.Format Format {set;} - public bool IsLive {get;} - public bool Live {set;} + public bool Live {get;set;} public int NumBuffers {get;set;} @@ -261,9 +233,5 @@ public class BaseTransform : Gst.Element public bool GapAware {set;} - public bool InPlace {set;} - public bool IsInPlace {get;} - public bool IsPassthrough {get;} - public bool IsQosEnabled {get;} - public bool Passthrough {set;} + public bool InPlace {get;set;} + public bool Passthrough {get;set;} public bool Qos {get;set;} - public bool QosEnabled {set;} }
Created attachment 136148 [details] [review] Some more changes This patch is not really about redundant api, but more about avoiding some warnings when parsing the xml. The warnings where mainly about usage of ellipsis type arguments. For most of the functions hidden by this patch there was already an alternative, for the params[] Caps constructor custom code is added. I think we can close this busg with these two patches
Thanks, committed them. I'll take a look at other places if there is redundant API too later... Could you attach patches in git-format format in the future and include the bug number that will be fixed by them? That makes it slightly easier for me to apply them ;) And as the commit id stays the same then a git pull on your side will work better commit 4285a61e4604f18c82ec756cd64b0c144b0eb54b Author: Maarten Bosmans <mkbosmans@gmail.com> Date: Fri Jun 5 13:38:20 2009 +0200 Cleanup of GstBase - unnescessary properties removed commit e53329406a4efc5a6a408eda739761f817a6f162 Author: Maarten Bosmans <mkbosmans@gmail.com> Date: Tue Jun 9 10:42:21 2009 +0200 Avoid some warnings when parsing the xml. The warnings where mainly about usage of ellipsis type arguments. For most of the functions hidden by this patch there was already an alternative, for the params[] Caps constructor custom code is added. Fixes bug #584913.