[gstreamer-bugs] [Bug 539772] New: gst_pad_template_new() does more than call g_object_new()
GStreamer (bugzilla.gnome.org)
bugzilla-daemon at bugzilla.gnome.org
Mon Jun 23 09:06:55 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=539772
GStreamer | gstreamer (core) | Ver: HEAD CVS
Summary: gst_pad_template_new() does more than call
g_object_new()
Product: GStreamer
Version: HEAD CVS
Platform: Other
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: gstreamer (core)
AssignedTo: gstreamer-bugs at lists.sourceforge.net
ReportedBy: jaalburqu at svn.gnome.org
QAContact: gstreamer-bugs at lists.sourceforge.net
GNOME version: 2.21/2.22
GNOME milestone: Unspecified
gst_pad_template_new() does a few more things than just calling g_object_new().
I also noticed that its parameters don't correspond to the construction
properties used in the call to g_object_new(). This is the code:
GstPadTemplate *
gst_pad_template_new (const gchar * name_template,
GstPadDirection direction, GstPadPresence presence, GstCaps * caps)
{
GstPadTemplate *new;
g_return_val_if_fail (name_template != NULL, NULL);
g_return_val_if_fail (caps != NULL, NULL);
g_return_val_if_fail (direction == GST_PAD_SRC
|| direction == GST_PAD_SINK, NULL);
g_return_val_if_fail (presence == GST_PAD_ALWAYS
|| presence == GST_PAD_SOMETIMES || presence == GST_PAD_REQUEST, NULL);
if (!name_is_valid (name_template, presence)) {
gst_caps_unref (caps);
return NULL;
}
new = g_object_new (gst_pad_template_get_type (),
"name", name_template, NULL);
GST_PAD_TEMPLATE_NAME_TEMPLATE (new) = g_strdup (name_template);
GST_PAD_TEMPLATE_DIRECTION (new) = direction;
GST_PAD_TEMPLATE_PRESENCE (new) = presence;
GST_PAD_TEMPLATE_CAPS (new) = caps;
return new;
}
As in bug #539108, I suppose the extra code would be better placed in an
_init() function also. Thanks.
--
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=539772.
More information about the Gstreamer-bugs
mailing list