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 547525 - alsasrc and alsamixer incorrectly report that GstPropertyProbe is not supported
alsasrc and alsamixer incorrectly report that GstPropertyProbe is not supported
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-08-13 03:06 UTC by Laszlo Pandy
Modified: 2008-08-13 23:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove error, critical assersion and return TRUE for GstPropertyProbe. (1.76 KB, patch)
2008-08-13 03:10 UTC, Laszlo Pandy
none Details | Review

Description Laszlo Pandy 2008-08-13 03:06:44 UTC
Please describe the problem:
Using the implements interface method to check if alsasrc implements an interface other than Mixer results in an Error and program termination. This is despite the fact that alsasrc *does* support the PropertyProbe interface.

Using the same method to check if alsamixer supports an interface except Mixer results in a critical assertion and a return value of false, even though alsamixer also supports the PropertyProbe interface.

Steps to reproduce:
In a python shell:
>>> import gst
>>> aa = gst.element_factory_make("alsasrc")
>>> aa.implements_interface(gst.interfaces.PropertyProbe)
**
** ERROR:(gstalsasrc.c:162):gst_alsasrc_interface_supported: assertion failed: (interface_type == GST_TYPE_MIXER)
Aborted

In a python shell:
>>> import gst
>>> am = gst.element_factory_make("alsamixer")
>>> am.implements_interface(gst.interfaces.PropertyProbe)

** (.:26954): CRITICAL **: file gstalsamixerelement.c: line 69 (gst_alsa_mixer_element_interface_supported): should not be reached
False
>>>



Actual results:


Expected results:
I expect both queries for gst.interfaces.PropertyProbe to return True.

Does this happen every time?


Other information:
Comment 1 Laszlo Pandy 2008-08-13 03:10:05 UTC
Created attachment 116473 [details] [review]
Remove error, critical assersion and return TRUE for GstPropertyProbe.
Comment 2 Tim-Philipp Müller 2008-08-13 08:31:27 UTC
GstPropertyProbe isn't wrapped by GstImplementsInterface, only GstMixer is, so the result is sort of correct, even though the whole GstImplemeentsInterface thing is admittedly quite confusing and probably one of the worst APIs we have. It certainly shouldn't abort. I'm not really convinced whether your patch is right though, since it sort of implies that the property probe *is* wrapped by the implements interface. On the other hand, what are the chances anyone will ever notice ...
Comment 3 Laszlo Pandy 2008-08-13 14:02:06 UTC
How is one supposed to check if GstPropertyProbe is available? I came across the abort problem because I wanted to be able to give my users the ability to switch between "alsasrc" and "pulsesrc" or any other source for that matter.

I would create the element, and then check if it supports GstPropertyProbe before querying for the available device names. I guess if I am using Python I can do hasattr(src, "probe_property_name"), but this isn't the right way to do it, and there has got to be a way to check for this in C code as well.
Comment 4 Laszlo Pandy 2008-08-13 14:36:44 UTC
Okay, I get it now. You are supposed to use g_type_is_a() or gobject.typs_is_a() in Python to check for static interfaces. And the GstImplementsInterface is for static interfaces which have are only conditionally supported. Such as the Mixer interface which may not work depending on which device is currently being used, even though the static GstMixer interface is always there.

If this is correct, you are right it is damn confusing, but feel free to close this bug.
Comment 5 Jan Schmidt 2008-08-13 14:47:51 UTC
Yep, it's horribly confusing, and the best reason why 'ImplementsInterface' has to die. Personally I'd prefer to see all 'conditionally available interfaces' provide an foo_is_available() method.