[gstreamer-bugs] [Bug 534208] New: [sortof patch] implement gst_structure_get ()
GStreamer (bugzilla.gnome.org)
bugzilla-daemon at bugzilla.gnome.org
Wed May 21 08:38:35 PDT 2008
If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
http://bugzilla.gnome.org/show_bug.cgi?id=534208
GStreamer | gstreamer (core) | Ver: HEAD CVS
Summary: [sortof patch] implement gst_structure_get ()
Product: GStreamer
Version: HEAD CVS
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: Normal
Component: gstreamer (core)
AssignedTo: gstreamer-bugs at lists.sourceforge.net
ReportedBy: wingo at pobox.com
QAContact: gstreamer-bugs at lists.sourceforge.net
GNOME version: Unspecified
GNOME milestone: Unspecified
Verily, some functions we should have:
You have to #include <gobject/gvaluecollector.h> in the .c file for these.
What think the people?
gboolean
gst_structure_get_valist (GstStructure *s, const char *first_field_name,
va_list args)
{
const char *field_name = first_field_name;
while (field_name) {
GType t;
const GValue *got = NULL;
gchar *error;
t = va_arg (args, GType);
got = gst_structure_get_value (s, field_name);
if (!got)
return FALSE;
if (G_VALUE_TYPE (got) != t)
return FALSE;
G_VALUE_LCOPY (got, args, 0, &error);
if (error) {
g_warning ("%s: %s", G_STRFUNC, error);
g_free (error);
return FALSE;
}
field_name = va_arg (args, const gchar*);
}
return TRUE;
}
gboolean
gst_structure_get (GstStructure *s, const char *first_field_name, ...)
{
gboolean ret;
va_list args;
va_start (args, first_field_name);
ret = gst_structure_get_valist (s, first_field_name, args);
va_end (args);
return ret;
}
--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.
You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=534208.
More information about the Gstreamer-bugs
mailing list