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 89836 - [API] gst_element_(s|g)et_name are redundant
[API] gst_element_(s|g)et_name are redundant
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.4.0
Other Linux
: Normal trivial
: 0.4.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2002-08-04 14:57 UTC by tim
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description tim 2002-08-04 14:57:37 UTC
The functions gst_element_(s|g)et_name() are redundant, because there is  
already a equivalent in the super class GstObject called 
gst_object_(s|g)et_name().
Comment 1 Steve Baker 2002-08-05 10:53:15 UTC
gst_element_set_name should probably check with its parent bin (if it 
has one) that the name is unique.  There might be extra behaviour 
that we will want to attach in the future so I would be in favour of 
not changing this atm.
Comment 2 tim 2002-08-05 11:10:43 UTC
But in this case shouldn't it be a virtual method? 
 
Comment 3 Thomas Vander Stichele 2002-08-13 14:15:03 UTC
Could you elaborate a bit more on what you mean by that ?
Comment 4 tim 2002-08-13 14:36:47 UTC
If set_name's functionality depends on the class type and should,  
for example, enforce that each name is unique in a GstBin, then the  
function should be virtual/polymorphic. I think with GObjects this is  
done by putting a pointer to the function in the class object. 
Sub-classes can overwrite the pointer if they need a special 
implementation of the function.  
So when you then call set_name on a GstObject that happens to be a 
GstElement, GstElement's implementation will be invoked and not 
GstObject's. Otherwise you could break the Bin's structure by calling 
gst_object_set_name on a GstElement, even though the API allows that. 
Comment 5 Wim Taymans 2002-09-15 17:22:31 UTC
a vmethod is a bit of an overkill for something as simple as setting a
name IMO. This bug is related to gst_element_(s|g)et_parent (which has
different error reporting than its GstObject part, for no reason). We
have to decide if we keep the methods or only use the gstobject
counterparts (look at gtk+ for example). I vote for removal... 
Comment 6 Thomas Vander Stichele 2002-12-08 01:15:29 UTC
changed to macros, feel free to either use or ignore them ;)
in the future if we feel giddy they may even get deprecated