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 333779 - New API: add gst_uri_has_protocol
New API: add gst_uri_has_protocol
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-03-07 18:29 UTC by Tim-Philipp Müller
Modified: 2006-03-09 12:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed addition (1.76 KB, patch)
2006-03-07 18:40 UTC, Tim-Philipp Müller
committed Details | Review

Description Tim-Philipp Müller 2006-03-07 18:29:57 UTC
I'd like to add the following API:

  gboolean  gst_uri_has_protocol (const gchar * uri, const gchar * protocol);


Almost all GstUriHandler implementations have overly complicated code blocks like

  gchar *proto;

  proto = gst_uri_get_protocol (uri);
  if (!proto || strcmp (proto, "myproto") != 0) {
    g_free (proto);
    return FALSE;
  }

  g_free (proto);


Would be much nicer to have just a simple

  if (!gst_uri_has_protocol (uri, "myproto"))
    return FASLE;
Comment 1 Tim-Philipp Müller 2006-03-07 18:40:02 UTC
Created attachment 60853 [details] [review]
proposed addition
Comment 2 Michael Smith 2006-03-09 11:15:48 UTC
Patch looks good, API looks useful. Go ahead.
Comment 3 Tim-Philipp Müller 2006-03-09 12:09:35 UTC
Thanks, committed:

2006-03-09  Tim-Philipp Müller  <tim at centricular dot net>

       * docs/gst/gstreamer-sections.txt:
       * gst/gsturi.c: (gst_uri_has_protocol):
       * gst/gsturi.h:
          Add new API: gst_uri_has_protocol() (#333779).