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 334290 - Add interface for "allow-overwrite" signal in sinks
Add interface for "allow-overwrite" signal in sinks
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-03-12 07:34 UTC by James "Doc" Livingston
Modified: 2018-05-04 08:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description James "Doc" Livingston 2006-03-12 07:34:26 UTC
gnomevfssink provides a "allow-overwrite" signal, which can be used to indicate that the destination file should be overwritten if it already exists.

Using this in a situation other than directly creating the sink (e.g. gst_element_make_from_uri) is problematic for two reasons:
1) you have to check the type of the sink, such as with g_type_is_a
2) you can't do it for other sinks.

It would be good if there was an interface for this that sinks could implement, so applications could do this without sink-specific code.
Comment 1 Tim-Philipp Müller 2006-03-12 09:33:17 UTC
Why not just something like

 static gboolean
 element_has_signal (GstElement *e, const chat *signal_name)
 {
   return (g_signal_lookup (signal_name, G_OBJECT_TYPE (e)) != 0);
 }

 if (element_has_signal (sink, "allow-overwrite")) {
   g_signal_connect (...)
 }

This of course makes the assumption that the signatures of the signals are the same where they exist, but I'd expect that to be true for the 2 or 3 elements that will ever have them.

Not sure if we need to introduce interfaces for stuff that's only ever going to be used by 2 or 3 elements, but that's just me.
Comment 2 James "Doc" Livingston 2006-03-12 09:46:15 UTC
I'm not entirely sure it's needed either, but it was suggested to me on IRC as a way of avoiding messy "is this element a gnomevfsink" code.

Another option would be to add signals to the other file sinks, like filesink, with the same prototype. However gnomevfssink's allow-overwrite signal has a parameters of type GnomeVFSURI*, so the new signal would need to be called something else.
Comment 3 Jan Schmidt 2006-05-06 20:11:48 UTC
Blah, GnomeVFSURI as a parameter to the signal sucks. Using a different name for the signal seems as bad as having them conflict - either one requires the application to know.
Comment 4 René Stadler 2007-04-14 13:34:15 UTC
Wouldn't this perfectly fit into the GstURIHandler interface?
Comment 5 Edward Hervey 2013-07-18 04:56:57 UTC
Not 100% certain putting sink-only properties/methods in GstURIHandler is a wise move.

I think this is quite use-case centric and should not require the need for an interface. Also this only applies to sinks that could support such a feature, and we have filesink and giosink ?
Comment 6 Sebastian Dröge (slomo) 2013-07-18 09:00:41 UTC
Potentially any other sinks that create files, like the curl sinks. Just having an implicit interface by a common signal makes sense though.
Comment 7 Sebastian Dröge (slomo) 2018-05-04 08:50:03 UTC
Let's close this then. If anybody ever needs this again, a signal can be added to the relevant sinks. As that didn't happen in the meantime, a common interface for such a thing seems too much :)