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 584913 - Some elements have redundant api, e.g. GstBaseSink
Some elements have redundant api, e.g. GstBaseSink
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-sharp
git master
Other All
: Normal normal
: 0.9.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-05 11:58 UTC by Maarten Bosmans
Modified: 2009-09-11 08:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove unnescessary properties from GstBase* (3.34 KB, patch)
2009-06-08 14:06 UTC, Maarten Bosmans
committed Details | Review
Some more changes (5.14 KB, patch)
2009-06-08 14:11 UTC, Maarten Bosmans
committed Details | Review

Description Maarten Bosmans 2009-06-05 11:58:41 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.
Comment 1 Sebastian Dröge (slomo) 2009-06-05 15:24:47 UTC
Makes sense but please check if the functions do additional stuff compared to the properties (like returning something if the setting failed for example).
Comment 2 Maarten Bosmans 2009-06-08 14:06:09 UTC
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;}
 }
Comment 3 Maarten Bosmans 2009-06-08 14:11:12 UTC
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
Comment 4 Sebastian Dröge (slomo) 2009-06-09 08:45:10 UTC
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.