X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgstpadtemplate.c;h=1df8e07f82c08dea94f0eb29223ded5a9215a84b;hb=9fb56a32f51cc5a624d79463ced7ccd74953e3af;hp=77853fdc8311dc9571de971cfa10413f6e1cc8c3;hpb=645840676c4a64717df25b4bd889aa0100d49a01;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gstpadtemplate.c b/gst/gstpadtemplate.c index 77853fd..1df8e07 100644 --- a/gst/gstpadtemplate.c +++ b/gst/gstpadtemplate.c @@ -299,7 +299,7 @@ G_DEFINE_POINTER_TYPE (GstStaticPadTemplate, gst_static_pad_template); * * Converts a #GstStaticPadTemplate into a #GstPadTemplate. * - * Returns: (transfer floating): a new #GstPadTemplate. + * Returns: (transfer floating) (nullable): a new #GstPadTemplate. */ /* FIXME0.11: rename to gst_pad_template_new_from_static_pad_template() */ GstPadTemplate * @@ -369,7 +369,7 @@ gst_pad_template_new_from_static_pad_template_with_gtype (GstStaticPadTemplate * * Creates a new pad template with a name according to the given template * and with the given arguments. * - * Returns: (transfer floating): a new #GstPadTemplate. + * Returns: (transfer floating) (nullable): a new #GstPadTemplate. */ GstPadTemplate * gst_pad_template_new (const gchar * name_template, @@ -396,6 +396,47 @@ gst_pad_template_new (const gchar * name_template, } /** + * gst_pad_template_new_with_gtype: + * @name_template: the name template. + * @direction: the #GstPadDirection of the template. + * @presence: the #GstPadPresence of the pad. + * @caps: (transfer none): a #GstCaps set for the template. + * @pad_type: The #GType of the pad to create + * + * Creates a new pad template with a name according to the given template + * and with the given arguments. + * + * Returns: (transfer floating): a new #GstPadTemplate. + * + * Since: 1.14 + */ +GstPadTemplate * +gst_pad_template_new_with_gtype (const gchar * name_template, + GstPadDirection direction, GstPadPresence presence, GstCaps * caps, + GType pad_type) +{ + 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)) { + return NULL; + } + + new = g_object_new (gst_pad_template_get_type (), + "name", name_template, "name-template", name_template, + "direction", direction, "presence", presence, "caps", caps, + "gtype", pad_type, NULL); + + return new; +} + +/** * gst_static_pad_template_get_caps: * @templ: a #GstStaticPadTemplate to get capabilities of. *