[gst-devel] Re: [gst-cvs] jdahlin gst-plugins: gst-plugins/ gst-plugins/sys/v4l/
Johan Dahlin
johan at fluendo.com
Fri Aug 13 06:39:01 CEST 2004
> I did that because you wouldn't be able to use it anyway. It's not a
> GstTuner at this point. It cannot be used as one. The alternative is to
Depends on your definition of what GstTuner. If you mean that all
GstTuner methods can be called without running into errors I guess
you're right, but on the contrary you're wrong if you mean that it's
GType *says* that it implements the GstTuner interface.
> add fault codes and error handlers to each and every single interface
> function that depends on runtime conditions to be useful or not. I didn't
> want to do that.
You've already done this, for all interface functions (2 for XOverlay, 3
in ColorBalance and 9 for GstTuner) which access internal data ( 2 + 7 )
there is a GST_V4L_IS_OPEN() check. I can't really see why that isn't
enough?
> If you want to do this:
>
> GstImplementsInterface *iface = GST_IMPLEMENTS_INTERFACE (v4lsrc);
> GstTuner *tuner = NULL;
>
> if (gst_implements_interface_supported (iface, GST_TYPE_TUNER)) {
> tuner = GST_TUNER (NULL);
> }
No, that's exactly what I *don't* want to do. But that's exactly how the
GST_TUNER macro is implemented and my code (which I believe is correct)
depends that the return value is not NULL and therefor must tell that it
implements the specific interfaces.
> The interesting thing is that you don't see how the code path works at
> all. If the supports() function always returned a static boolean (which is
> always true, otherwise the whole interface wouldn't be implemented), then
> why does it call that function in the first place? You could just as well
> have removed this function from the casting macro and that'd at least be
> clean.
That's not the way GstInterfaces are implemented, but if you prefer that
solution (to call G_TYPE_CHECK_INSTANCE_CAST instance of
GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST)
Ask. Just fucking ask. Please just ask. And I'd have told you. Don't be
> ignorant and break things. I'm happy to answer such questions. Just *ASK*.
Okay, I apologize for not asking and just committing. And the code
compiled and didn't cause any problems here.
Sorry for being ignorant of issues that seem to matter a lot to you.
> So fix it. Don't break applications, plugins and everything to hide the
> fact that you think GstImplementsInterface should be done differently.
It's not fixable. It's broken by design. Using GInterface directly is
the proper solution.
--
Johan Dahlin <johan at fluendo.com>
More information about the gstreamer-devel
mailing list