mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-06-09 09:39:27 +00:00
remove gst_pad_template_newv() and GST_PAD_TEMPLATE_FACTORY()
Original commit message from CVS: remove gst_pad_template_newv() and GST_PAD_TEMPLATE_FACTORY()
This commit is contained in:
parent
888ccf80f2
commit
bb27826e6a
66
gst/gstpad.c
66
gst/gstpad.c
|
@ -2639,54 +2639,6 @@ gst_static_pad_template_get (GstStaticPadTemplate *pad_template)
|
|||
return new;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_pad_template_newv:
|
||||
* @name_template: the name template.
|
||||
* @direction: the #GstPadDirection of the template.
|
||||
* @presence: the #GstPadPresence of the pad.
|
||||
* @caps: a #GstCaps2 set for the template.
|
||||
* @var_args: a NULL-terminated list of #GstCaps2.
|
||||
*
|
||||
* Creates a new pad template with a name according to the given template
|
||||
* and with the given arguments.
|
||||
*
|
||||
* Returns: a new #GstPadTemplate.
|
||||
*/
|
||||
GstPadTemplate*
|
||||
gst_pad_template_newv (const gchar *name_template,
|
||||
GstPadDirection direction, GstPadPresence presence,
|
||||
GstCaps2 *caps, va_list var_args)
|
||||
{
|
||||
GstPadTemplate *new;
|
||||
GstCaps2 *thecaps = gst_caps2_new_empty();
|
||||
|
||||
g_return_val_if_fail (name_template != NULL, NULL);
|
||||
|
||||
if (!name_is_valid (name_template, presence))
|
||||
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_FLAG_SET (GST_OBJECT (new), GST_PAD_TEMPLATE_FIXED);
|
||||
while (caps) {
|
||||
if (!gst_caps2_is_fixed (caps)) {
|
||||
GST_FLAG_UNSET (GST_OBJECT (new), GST_PAD_TEMPLATE_FIXED);
|
||||
}
|
||||
gst_caps2_append (thecaps, gst_caps2_copy(caps));
|
||||
caps = va_arg (var_args, GstCaps2 *);
|
||||
}
|
||||
|
||||
GST_PAD_TEMPLATE_CAPS (new) = thecaps;
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_pad_template_new:
|
||||
* @name_template: the name template.
|
||||
|
@ -2703,17 +2655,23 @@ gst_pad_template_newv (const gchar *name_template,
|
|||
GstPadTemplate*
|
||||
gst_pad_template_new (const gchar *name_template,
|
||||
GstPadDirection direction, GstPadPresence presence,
|
||||
GstCaps2 *caps, ...)
|
||||
GstCaps2 *caps)
|
||||
{
|
||||
GstPadTemplate *new;
|
||||
va_list var_args;
|
||||
|
||||
va_start (var_args, caps);
|
||||
g_return_val_if_fail (name_template != NULL, NULL);
|
||||
|
||||
new = gst_pad_template_newv (name_template, direction, presence,
|
||||
caps, var_args);
|
||||
if (!name_is_valid (name_template, presence))
|
||||
return NULL;
|
||||
|
||||
va_end (var_args);
|
||||
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;
|
||||
}
|
||||
|
|
57
gst/gstpad.h
57
gst/gstpad.h
|
@ -365,57 +365,6 @@ struct _GstStaticPadTemplate {
|
|||
}
|
||||
|
||||
|
||||
#ifdef G_HAVE_ISO_VARARGS
|
||||
#define GST_PAD_TEMPLATE_NEW(padname, dir, pres, ...) \
|
||||
gst_pad_template_new ( \
|
||||
padname, \
|
||||
dir, \
|
||||
pres, \
|
||||
__VA_ARGS__ , \
|
||||
NULL)
|
||||
|
||||
#define GST_PAD_TEMPLATE_FACTORY(name, padname, dir, pres, ...) \
|
||||
static GstPadTemplate* \
|
||||
name (void) \
|
||||
{ \
|
||||
static GstPadTemplate *templ = NULL; \
|
||||
if (!templ) { \
|
||||
templ = GST_PAD_TEMPLATE_NEW ( \
|
||||
padname, \
|
||||
dir, \
|
||||
pres, \
|
||||
__VA_ARGS__ ); \
|
||||
} \
|
||||
return (GstPadTemplate *)g_object_ref((GObject *)templ); \
|
||||
}
|
||||
#elif defined(G_HAVE_GNUC_VARARGS)
|
||||
/* CR1: the space after 'a' is necessary because of preprocessing in gcc */
|
||||
#define GST_PAD_TEMPLATE_NEW(padname, dir, pres, a...) \
|
||||
gst_pad_template_new ( \
|
||||
padname, \
|
||||
dir, \
|
||||
pres, \
|
||||
a , \
|
||||
NULL)
|
||||
|
||||
#define GST_PAD_TEMPLATE_FACTORY(name, padname, dir, pres, a...) \
|
||||
static GstPadTemplate* \
|
||||
name (void) \
|
||||
{ \
|
||||
static GstPadTemplate *templ = NULL; \
|
||||
if (!templ) { \
|
||||
templ = GST_PAD_TEMPLATE_NEW ( \
|
||||
padname, \
|
||||
dir, \
|
||||
pres, \
|
||||
a ); \
|
||||
} \
|
||||
return (GstPadTemplate *)g_object_ref((GObject *)templ); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define GST_PAD_TEMPLATE_GET(fact) (fact)()
|
||||
|
||||
GType gst_pad_get_type (void);
|
||||
GType gst_real_pad_get_type (void);
|
||||
GType gst_ghost_pad_get_type (void);
|
||||
|
@ -554,11 +503,7 @@ GType gst_pad_template_get_type (void);
|
|||
|
||||
GstPadTemplate* gst_pad_template_new (const gchar *name_template,
|
||||
GstPadDirection direction, GstPadPresence presence,
|
||||
GstCaps2 *caps, ...);
|
||||
|
||||
GstPadTemplate* gst_pad_template_newv (const gchar *name_template,
|
||||
GstPadDirection direction, GstPadPresence presence,
|
||||
GstCaps2 *caps, va_list var_args);
|
||||
GstCaps2 *caps);
|
||||
|
||||
GstPadTemplate * gst_static_pad_template_get (GstStaticPadTemplate *templ);
|
||||
const GstCaps2* gst_pad_template_get_caps (GstPadTemplate *templ);
|
||||
|
|
Loading…
Reference in a new issue