GstPadTemplate * templ)
{
GstGhostPad *ret;
-
g_return_val_if_fail (dir != GST_PAD_UNKNOWN, NULL);
/* OBJECT CREATION */
if (templ) {
- ret = g_object_new (GST_TYPE_GHOST_PAD, "name", name,
+ GType pad_type =
+ GST_PAD_TEMPLATE_GTYPE (templ) ==
+ G_TYPE_NONE ? GST_TYPE_GHOST_PAD : GST_PAD_TEMPLATE_GTYPE (templ);
+
+ ret = g_object_new (pad_type, "name", name,
"direction", dir, "template", templ, NULL);
} else {
ret = g_object_new (GST_TYPE_GHOST_PAD, "name", name,
gst_pad_new_from_template (GstPadTemplate * templ, const gchar * name)
{
g_return_val_if_fail (GST_IS_PAD_TEMPLATE (templ), NULL);
+ GType pad_type =
+ GST_PAD_TEMPLATE_GTYPE (templ) ==
+ G_TYPE_NONE ? GST_TYPE_PAD : GST_PAD_TEMPLATE_GTYPE (templ);
- return g_object_new (GST_TYPE_PAD,
+ return g_object_new (pad_type,
"name", name, "direction", templ->direction, "template", templ, NULL);
}
GstPadTemplate *new;
GstCaps *caps;
+ g_return_val_if_fail (g_type_is_a (pad_type, GST_TYPE_PAD), NULL);
+
if (!name_is_valid (pad_template->name_template, pad_template->presence))
return NULL;
|| direction == GST_PAD_SINK, NULL);
g_return_val_if_fail (presence == GST_PAD_ALWAYS
|| presence == GST_PAD_SOMETIMES || presence == GST_PAD_REQUEST, NULL);
+ g_return_val_if_fail (g_type_is_a (pad_type, GST_TYPE_PAD), NULL);
if (!name_is_valid (name_template, presence)) {
return NULL;