Blame gst/gstpadtemplate.h

Packit f546b1
/* GStreamer
Packit f546b1
 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
Packit f546b1
 *                    2000 Wim Taymans <wim.taymans@chello.be>
Packit f546b1
 *
Packit f546b1
 * gstpadtemplate.h: Header for GstPadTemplate object
Packit f546b1
 *
Packit f546b1
 * This library is free software; you can redistribute it and/or
Packit f546b1
 * modify it under the terms of the GNU Library General Public
Packit f546b1
 * License as published by the Free Software Foundation; either
Packit f546b1
 * version 2 of the License, or (at your option) any later version.
Packit f546b1
 *
Packit f546b1
 * This library is distributed in the hope that it will be useful,
Packit f546b1
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit f546b1
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit f546b1
 * Library General Public License for more details.
Packit f546b1
 *
Packit f546b1
 * You should have received a copy of the GNU Library General Public
Packit f546b1
 * License along with this library; if not, write to the
Packit f546b1
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit f546b1
 * Boston, MA 02110-1301, USA.
Packit f546b1
 */
Packit f546b1
Packit f546b1
Packit f546b1
#ifndef __GST_PAD_TEMPLATE_H__
Packit f546b1
#define __GST_PAD_TEMPLATE_H__
Packit f546b1
Packit f546b1
#include <gst/gstconfig.h>
Packit f546b1
Packit f546b1
typedef struct _GstPadTemplate GstPadTemplate;
Packit f546b1
typedef struct _GstPadTemplateClass GstPadTemplateClass;
Packit f546b1
typedef struct _GstStaticPadTemplate GstStaticPadTemplate;
Packit f546b1
Packit f546b1
#include <gst/gstobject.h>
Packit f546b1
#include <gst/gstbuffer.h>
Packit f546b1
#include <gst/gstcaps.h>
Packit f546b1
#include <gst/gstevent.h>
Packit f546b1
#include <gst/gstquery.h>
Packit f546b1
#include <gst/gsttask.h>
Packit f546b1
Packit f546b1
G_BEGIN_DECLS
Packit f546b1
Packit f546b1
#define GST_TYPE_STATIC_PAD_TEMPLATE	(gst_static_pad_template_get_type ())
Packit f546b1
Packit f546b1
#define GST_TYPE_PAD_TEMPLATE		(gst_pad_template_get_type ())
Packit f546b1
#define GST_PAD_TEMPLATE(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD_TEMPLATE,GstPadTemplate))
Packit f546b1
#define GST_PAD_TEMPLATE_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD_TEMPLATE,GstPadTemplateClass))
Packit f546b1
#define GST_IS_PAD_TEMPLATE(obj)	(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD_TEMPLATE))
Packit f546b1
#define GST_IS_PAD_TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD_TEMPLATE))
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GstPadPresence:
Packit f546b1
 * @GST_PAD_ALWAYS: the pad is always available
Packit f546b1
 * @GST_PAD_SOMETIMES: the pad will become available depending on the media stream
Packit f546b1
 * @GST_PAD_REQUEST: the pad is only available on request with
Packit f546b1
 *  gst_element_request_pad().
Packit f546b1
 *
Packit f546b1
 * Indicates when this pad will become available.
Packit f546b1
 */
Packit f546b1
typedef enum {
Packit f546b1
  GST_PAD_ALWAYS,
Packit f546b1
  GST_PAD_SOMETIMES,
Packit f546b1
  GST_PAD_REQUEST
Packit f546b1
} GstPadPresence;
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_PAD_TEMPLATE_NAME_TEMPLATE:
Packit f546b1
 * @templ: the template to query
Packit f546b1
 *
Packit f546b1
 * Get the nametemplate of the padtemplate.
Packit f546b1
 */
Packit f546b1
#define GST_PAD_TEMPLATE_NAME_TEMPLATE(templ)	(((GstPadTemplate *)(templ))->name_template)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_PAD_TEMPLATE_DIRECTION:
Packit f546b1
 * @templ: the template to query
Packit f546b1
 *
Packit f546b1
 * Get the #GstPadDirection of the padtemplate.
Packit f546b1
 */
Packit f546b1
#define GST_PAD_TEMPLATE_DIRECTION(templ)	(((GstPadTemplate *)(templ))->direction)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_PAD_TEMPLATE_PRESENCE:
Packit f546b1
 * @templ: the template to query
Packit f546b1
 *
Packit f546b1
 * Get the #GstPadPresence of the padtemplate.
Packit f546b1
 */
Packit f546b1
#define GST_PAD_TEMPLATE_PRESENCE(templ)	(((GstPadTemplate *)(templ))->presence)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_PAD_TEMPLATE_CAPS:
Packit f546b1
 * @templ: the template to query
Packit f546b1
 *
Packit f546b1
 * Get a handle to the padtemplate #GstCaps
Packit f546b1
 */
Packit f546b1
#define GST_PAD_TEMPLATE_CAPS(templ)		(((GstPadTemplate *)(templ))->caps)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_PAD_TEMPLATE_GTYPE:
Packit f546b1
 * @templ: the template to query
Packit f546b1
 *
Packit f546b1
 * Get the #GType of the padtemplate
Packit f546b1
 *
Packit f546b1
 * Since: 1.14
Packit f546b1
 */
Packit f546b1
#define GST_PAD_TEMPLATE_GTYPE(templ)		(((GstPadTemplate *)(templ))->ABI.abi.gtype)
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GstPadTemplateFlags:
Packit f546b1
 * @GST_PAD_TEMPLATE_FLAG_LAST: first flag that can be used by subclasses.
Packit f546b1
 *
Packit f546b1
 * Flags for the padtemplate
Packit f546b1
 */
Packit f546b1
typedef enum {
Packit f546b1
  /* padding */
Packit f546b1
  GST_PAD_TEMPLATE_FLAG_LAST    = (GST_OBJECT_FLAG_LAST << 4)
Packit f546b1
} GstPadTemplateFlags;
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_PAD_TEMPLATE_IS_FIXED:
Packit f546b1
 * @templ: the template to query
Packit f546b1
 *
Packit f546b1
 * Check if the properties of the padtemplate are fixed
Packit f546b1
 */
Packit f546b1
#define GST_PAD_TEMPLATE_IS_FIXED(templ)	(GST_OBJECT_FLAG_IS_SET(templ, GST_PAD_TEMPLATE_FIXED))
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GstPadTemplate:
Packit f546b1
 *
Packit f546b1
 * The padtemplate object.
Packit f546b1
 */
Packit f546b1
struct _GstPadTemplate {
Packit f546b1
  GstObject	   object;
Packit f546b1
Packit f546b1
  gchar           *name_template;
Packit f546b1
  GstPadDirection  direction;
Packit f546b1
  GstPadPresence   presence;
Packit f546b1
  GstCaps	  *caps;
Packit f546b1
Packit f546b1
  /*< private >*/
Packit f546b1
  union {
Packit f546b1
    gpointer _gst_reserved[GST_PADDING];
Packit f546b1
    struct {
Packit f546b1
      GType gtype;
Packit f546b1
    } abi;
Packit f546b1
  } ABI;
Packit f546b1
};
Packit f546b1
Packit f546b1
struct _GstPadTemplateClass {
Packit f546b1
  GstObjectClass   parent_class;
Packit f546b1
Packit f546b1
  /* signal callbacks */
Packit f546b1
  void (*pad_created)	(GstPadTemplate *templ, GstPad *pad);
Packit f546b1
Packit f546b1
  /*< private >*/
Packit f546b1
  gpointer _gst_reserved[GST_PADDING];
Packit f546b1
};
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GstStaticPadTemplate:
Packit f546b1
 * @name_template: the name of the template
Packit f546b1
 * @direction: the direction of the template
Packit f546b1
 * @presence: the presence of the template
Packit f546b1
 * @static_caps: the caps of the template.
Packit f546b1
 *
Packit f546b1
 * Structure describing the #GstStaticPadTemplate.
Packit f546b1
 */
Packit f546b1
struct _GstStaticPadTemplate {
Packit f546b1
  const gchar     *name_template;
Packit f546b1
  GstPadDirection  direction;
Packit f546b1
  GstPadPresence   presence;
Packit f546b1
  GstStaticCaps    static_caps;
Packit f546b1
};
Packit f546b1
Packit f546b1
/**
Packit f546b1
 * GST_STATIC_PAD_TEMPLATE:
Packit f546b1
 * @padname: the name template of the pad
Packit f546b1
 * @dir: the GstPadDirection of the pad
Packit f546b1
 * @pres: the GstPadPresence of the pad
Packit f546b1
 * @caps: the GstStaticCaps of the pad
Packit f546b1
 *
Packit f546b1
 * Convenience macro to fill the values of a GstStaticPadTemplate
Packit f546b1
 * structure.
Packit f546b1
 */
Packit f546b1
#define GST_STATIC_PAD_TEMPLATE(padname, dir, pres, caps) \
Packit f546b1
{ \
Packit f546b1
  /* name_template */    padname, \
Packit f546b1
  /* direction */        dir, \
Packit f546b1
  /* presence */         pres, \
Packit f546b1
  /* caps */             caps \
Packit f546b1
}
Packit f546b1
Packit f546b1
/* templates and factories */
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GType			gst_pad_template_get_type		(void);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GType			gst_static_pad_template_get_type	(void);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstPadTemplate*		gst_pad_template_new			(const gchar *name_template,
Packit f546b1
								 GstPadDirection direction, GstPadPresence presence,
Packit f546b1
								 GstCaps *caps) G_GNUC_MALLOC;
Packit f546b1
GST_API
Packit f546b1
GstPadTemplate*		gst_pad_template_new_with_gtype		(const gchar *name_template,
Packit f546b1
								 GstPadDirection direction, GstPadPresence presence,
Packit f546b1
								 GstCaps *caps, GType pad_type) G_GNUC_MALLOC;
Packit f546b1
GST_API
Packit f546b1
GstPadTemplate *	gst_static_pad_template_get             (GstStaticPadTemplate *pad_template);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstPadTemplate * gst_pad_template_new_from_static_pad_template_with_gtype (
Packit f546b1
    GstStaticPadTemplate * pad_template,
Packit f546b1
    GType pad_type);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstCaps*		gst_static_pad_template_get_caps	(GstStaticPadTemplate *templ);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
GstCaps*		gst_pad_template_get_caps		(GstPadTemplate *templ);
Packit f546b1
Packit f546b1
GST_API
Packit f546b1
void                    gst_pad_template_pad_created            (GstPadTemplate * templ, GstPad * pad);
Packit f546b1
Packit f546b1
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
Packit f546b1
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstPadTemplate, gst_object_unref)
Packit f546b1
#endif
Packit f546b1
Packit f546b1
G_END_DECLS
Packit f546b1
Packit f546b1
#endif /* __GST_PAD_TEMPLATE_H__ */
Packit f546b1