/*
 * This file was generated automatically by ExtUtils::ParseXS version 3.22 from the
 * contents of GstElement.xs. Do not edit this file, edit GstElement.xs instead.
 *
 *    ANY CHANGES MADE HERE WILL BE LOST!
 *
 */

#line 1 "xs/GstElement.xs"
/*
 * Copyright (C) 2005 by the gtk2-perl team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * $Id$
 */

#include "gst2perl.h"

#line 34 "xs/GstElement.c"
#ifndef PERL_UNUSED_VAR
#  define PERL_UNUSED_VAR(var) if (0) var = var
#endif

#ifndef dVAR
#  define dVAR		dNOOP
#endif


/* This stuff is not part of the API! You have been warned. */
#ifndef PERL_VERSION_DECIMAL
#  define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
#endif
#ifndef PERL_DECIMAL_VERSION
#  define PERL_DECIMAL_VERSION \
	  PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
#endif
#ifndef PERL_VERSION_GE
#  define PERL_VERSION_GE(r,v,s) \
	  (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
#endif
#ifndef PERL_VERSION_LE
#  define PERL_VERSION_LE(r,v,s) \
	  (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
#endif

/* XS_INTERNAL is the explicit static-linkage variant of the default
 * XS macro.
 *
 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
 * for anything but the BOOT XSUB.
 *
 * See XSUB.h in core!
 */


/* TODO: This might be compatible further back than 5.10.0. */
#if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
#  undef XS_EXTERNAL
#  undef XS_INTERNAL
#  if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
#    define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
#    define XS_INTERNAL(name) STATIC XSPROTO(name)
#  endif
#  if defined(__SYMBIAN32__)
#    define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
#    define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
#  endif
#  ifndef XS_EXTERNAL
#    if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
#      define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
#      define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
#    else
#      ifdef __cplusplus
#        define XS_EXTERNAL(name) extern "C" XSPROTO(name)
#        define XS_INTERNAL(name) static XSPROTO(name)
#      else
#        define XS_EXTERNAL(name) XSPROTO(name)
#        define XS_INTERNAL(name) STATIC XSPROTO(name)
#      endif
#    endif
#  endif
#endif

/* perl >= 5.10.0 && perl <= 5.15.1 */


/* The XS_EXTERNAL macro is used for functions that must not be static
 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
 * macro defined, the best we can do is assume XS is the same.
 * Dito for XS_INTERNAL.
 */
#ifndef XS_EXTERNAL
#  define XS_EXTERNAL(name) XS(name)
#endif
#ifndef XS_INTERNAL
#  define XS_INTERNAL(name) XS(name)
#endif

/* Now, finally, after all this mess, we want an ExtUtils::ParseXS
 * internal macro that we're free to redefine for varying linkage due
 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
 */

#undef XS_EUPXS
#if defined(PERL_EUPXS_ALWAYS_EXPORT)
#  define XS_EUPXS(name) XS_EXTERNAL(name)
#else
   /* default to internal */
#  define XS_EUPXS(name) XS_INTERNAL(name)
#endif

#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)

/* prototype to pass -Wmissing-prototypes */
STATIC void
S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params);

STATIC void
S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
{
    const GV *const gv = CvGV(cv);

    PERL_ARGS_ASSERT_CROAK_XS_USAGE;

    if (gv) {
        const char *const gvname = GvNAME(gv);
        const HV *const stash = GvSTASH(gv);
        const char *const hvname = stash ? HvNAME(stash) : NULL;

        if (hvname)
            Perl_croak(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params);
        else
            Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params);
    } else {
        /* Pants. I don't think that it should be possible to get here. */
        Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
    }
}
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE

#ifdef PERL_IMPLICIT_CONTEXT
#define croak_xs_usage(a,b)    S_croak_xs_usage(aTHX_ a,b)
#else
#define croak_xs_usage        S_croak_xs_usage
#endif

#endif

/* NOTE: the prototype of newXSproto() is different in versions of perls,
 * so we define a portable version of newXSproto()
 */
#ifdef newXS_flags
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
#else
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
#endif /* !defined(newXS_flags) */

#line 176 "xs/GstElement.c"

XS_EUPXS(XS_GStreamer__Element_requires_clock); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_requires_clock)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	gboolean	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_requires_clock(element);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_provides_clock); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_provides_clock)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	gboolean	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_provides_clock(element);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_provide_clock); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_provide_clock)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	GstClock_ornull *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_provide_clock(element);
	ST(0) = newSVGstClock_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_get_clock); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_get_clock)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	GstClock_ornull *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_get_clock(element);
	ST(0) = newSVGstClock_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_set_clock); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_set_clock)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, clock");
    {
	GstElement *	element = SvGstElement (ST(0))
;
	GstClock_ornull *	clock = SvGstClock_ornull (ST(1))
;

	gst_element_set_clock(element, clock);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_GStreamer__Element_set_base_time); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_set_base_time)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, time");
    {
	GstElement *	element = SvGstElement (ST(0))
;
	GstClockTime	time = SvGstClockTime (ST(1))
;

	gst_element_set_base_time(element, time);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_GStreamer__Element_get_base_time); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_get_base_time)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	GstClockTime	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_get_base_time(element);
	ST(0) = newSVGstClockTime (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_no_more_pads); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_no_more_pads)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	GstElement *	element = SvGstElement (ST(0))
;

	gst_element_no_more_pads(element);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_GStreamer__Element_is_indexable); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_is_indexable)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	gboolean	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_is_indexable(element);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_set_index); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_set_index)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, index");
    {
	GstElement *	element = SvGstElement (ST(0))
;
	GstIndex *	index = SvGstIndex (ST(1))
;

	gst_element_set_index(element, index);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_GStreamer__Element_get_index); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_get_index)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	GstIndex_ornull *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_get_index(element);
	ST(0) = newSVGstIndex_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_get_bus); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_get_bus)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	GstBus_ornull *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_get_bus(element);
	ST(0) = newSVGstBus_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_add_pad); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_add_pad)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, pad");
    {
	gboolean	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	GstPad *	pad = SvGstPad (ST(1))
;

	RETVAL = gst_element_add_pad(element, pad);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_remove_pad); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_remove_pad)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, pad");
    {
	gboolean	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	GstPad *	pad = SvGstPad (ST(1))
;

	RETVAL = gst_element_remove_pad(element, pad);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_get_pad); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_get_pad)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, name");
    {
	GstPad_ornull *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	const gchar *	name;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	name = (const gchar *)SvPV_nolen (ST(1))
;

	RETVAL = gst_element_get_pad(element, name);
	ST(0) = newSVGstPad_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_get_static_pad); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_get_static_pad)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, name");
    {
	GstPad_ornull *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	const gchar *	name;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	name = (const gchar *)SvPV_nolen (ST(1))
;

	RETVAL = gst_element_get_static_pad(element, name);
	ST(0) = newSVGstPad_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_get_request_pad); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_get_request_pad)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, name");
    {
	GstPad_ornull *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	const gchar *	name;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	name = (const gchar *)SvPV_nolen (ST(1))
;

	RETVAL = gst_element_get_request_pad(element, name);
	ST(0) = newSVGstPad_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_iterate_pads); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_iterate_pads)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	GstIterator *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_iterate_pads(element);
	ST(0) = newSVGstIterator (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_iterate_src_pads); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_iterate_src_pads)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	GstIterator *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_iterate_src_pads(element);
	ST(0) = newSVGstIterator (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_iterate_sink_pads); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_iterate_sink_pads)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	GstIterator *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_iterate_sink_pads(element);
	ST(0) = newSVGstIterator (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_get_compatible_pad); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_get_compatible_pad)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "element, pad, caps");
    {
	GstPad *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	GstPad *	pad = SvGstPad (ST(1))
;
	const GstCaps *	caps = SvGstCaps (ST(2))
;

	RETVAL = gst_element_get_compatible_pad(element, pad, caps);
	ST(0) = newSVGstPad (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_get_compatible_pad_template); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_get_compatible_pad_template)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, compattempl");
    {
	GstPadTemplate_ornull *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	GstPadTemplate *	compattempl = SvGstPadTemplate (ST(1))
;

	RETVAL = gst_element_get_compatible_pad_template(element, compattempl);
	ST(0) = newSVGstPadTemplate_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_link); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_link)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "src, dest, ...");
    {
	GstElement *	src = SvGstElement (ST(0))
;
	GstElement *	dest = SvGstElement (ST(1))
;
#line 88 "xs/GstElement.xs"
	int i;
#line 626 "xs/GstElement.c"
	gboolean	RETVAL;
#line 90 "xs/GstElement.xs"
	RETVAL = TRUE;

	for (i = 1; i < items && RETVAL != FALSE; i++) {
		dest = SvGstElement (ST (i));
		if (!gst_element_link (src, dest))
			RETVAL = FALSE;
		src = dest;
	}
#line 637 "xs/GstElement.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_link_filtered); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_link_filtered)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "src, dest, filtercaps");
    {
	gboolean	RETVAL;
	GstElement *	src = SvGstElement (ST(0))
;
	GstElement *	dest = SvGstElement (ST(1))
;
	GstCaps_ornull *	filtercaps = SvGstCaps_ornull (ST(2))
;

	RETVAL = gst_element_link_filtered(src, dest, filtercaps);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_unlink); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_unlink)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "src, dest, ...");
    {
	GstElement *	src = SvGstElement (ST(0))
;
	GstElement *	dest = SvGstElement (ST(1))
;
#line 109 "xs/GstElement.xs"
	int i;
#line 679 "xs/GstElement.c"
#line 111 "xs/GstElement.xs"
	for (i = 1; i < items; i++) {
		dest = SvGstElement (ST (i));
		gst_element_unlink (src, dest);
		src = dest;
	}
#line 686 "xs/GstElement.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_GStreamer__Element_link_pads); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_link_pads)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "src, srcpadname, dest, destpadname");
    {
	gboolean	RETVAL;
	GstElement *	src = SvGstElement (ST(0))
;
	const gchar *	srcpadname;
	GstElement *	dest = SvGstElement (ST(2))
;
	const gchar *	destpadname;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	srcpadname = (const gchar *)SvPV_nolen (ST(1))
;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(3));
	destpadname = (const gchar *)SvPV_nolen (ST(3))
;

	RETVAL = gst_element_link_pads(src, srcpadname, dest, destpadname);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_link_pads_filtered); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_link_pads_filtered)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "src, srcpadname, dest, destpadname, filtercaps");
    {
	gboolean	RETVAL;
	GstElement *	src = SvGstElement (ST(0))
;
	const gchar *	srcpadname;
	GstElement *	dest = SvGstElement (ST(2))
;
	const gchar *	destpadname;
	GstCaps_ornull *	filtercaps = SvGstCaps_ornull (ST(4))
;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	srcpadname = (const gchar *)SvPV_nolen (ST(1))
;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(3));
	destpadname = (const gchar *)SvPV_nolen (ST(3))
;

	RETVAL = gst_element_link_pads_filtered(src, srcpadname, dest, destpadname, filtercaps);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_unlink_pads); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_unlink_pads)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "src, srcpadname, dest, destpadname");
    {
	GstElement *	src = SvGstElement (ST(0))
;
	const gchar *	srcpadname;
	GstElement *	dest = SvGstElement (ST(2))
;
	const gchar *	destpadname;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(1));
	srcpadname = (const gchar *)SvPV_nolen (ST(1))
;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(3));
	destpadname = (const gchar *)SvPV_nolen (ST(3))
;

	gst_element_unlink_pads(src, srcpadname, dest, destpadname);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_GStreamer__Element_send_event); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_send_event)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, event");
    {
	GstElement *	element = SvGstElement (ST(0))
;
	GstEvent *	event = SvGstEvent (ST(1))
;
	gboolean	RETVAL;

	RETVAL = gst_element_send_event(/* event gets unref'ed, we need to keep it alive. */
	element, gst_event_ref (event));
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_seek); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_seek)
{
    dVAR; dXSARGS;
    if (items != 8)
       croak_xs_usage(cv,  "element, rate, format, flags, cur_type, cur, stop_type, stop");
    {
	gboolean	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	gdouble	rate = (double)SvNV(ST(1))
;
	GstFormat	format = SvGstFormat (ST(2))
;
	GstSeekFlags	flags = SvGstSeekFlags (ST(3))
;
	GstSeekType	cur_type = SvGstSeekType (ST(4))
;
	gint64	cur = SvGInt64 (ST(5))
;
	GstSeekType	stop_type = SvGstSeekType (ST(6))
;
	gint64	stop = SvGInt64 (ST(7))
;

	RETVAL = gst_element_seek(element, rate, format, flags, cur_type, cur, stop_type, stop);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_get_query_types); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_get_query_types)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GstElement *	element = SvGstElement (ST(0))
;
#line 139 "xs/GstElement.xs"
	GstQueryType *types;
#line 854 "xs/GstElement.c"
#line 141 "xs/GstElement.xs"
	types = (GstQueryType *) gst_element_get_query_types (element);
	if (types)
		while (*types++)
			XPUSHs (sv_2mortal (newSVGstQueryType (*types)));
#line 860 "xs/GstElement.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_GStreamer__Element_query); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_query)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, query");
    {
	gboolean	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	GstQuery *	query = SvGstQuery (ST(1))
;

	RETVAL = gst_element_query(element, query);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_post_message); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_post_message)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, message");
    {
	gboolean	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	GstMessage *	message = SvGstMessage (ST(1))
;

	RETVAL = gst_element_post_message(/* element takes ownership of message. */
	element, gst_message_ref (message));
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_found_tags); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_found_tags)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, tag_list");
    {
	GstElement *	element = SvGstElement (ST(0))
;
	GstTagList *	tag_list = SvGstTagList (ST(1))
;

	gst_element_found_tags(element, tag_list);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_GStreamer__Element_found_tags_for_pad); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_found_tags_for_pad)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "element, pad, list");
    {
	GstElement *	element = SvGstElement (ST(0))
;
	GstPad *	pad = SvGstPad (ST(1))
;
	GstTagList *	list = SvGstTagList (ST(2))
;

	gst_element_found_tags_for_pad(/* gst_element_found_tags_for_pad takes ownership of list. */
	element, pad, gst_tag_list_copy (list));
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_GStreamer__Element_is_locked_state); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_is_locked_state)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	gboolean	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_is_locked_state(element);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_set_locked_state); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_set_locked_state)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, locked_state");
    {
	gboolean	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	gboolean	locked_state = (bool)SvTRUE(ST(1))
;

	RETVAL = gst_element_set_locked_state(element, locked_state);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_sync_state_with_parent); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_sync_state_with_parent)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	gboolean	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_sync_state_with_parent(element);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_get_state); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_get_state)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, timeout");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 181 "xs/GstElement.xs"
	GstStateChangeReturn retval;
	GstState state;
	GstState pending;
#line 1016 "xs/GstElement.c"
	GstElement *	element = SvGstElement (ST(0))
;
	GstClockTime	timeout = SvGstClockTime (ST(1))
;
#line 185 "xs/GstElement.xs"
	retval = gst_element_get_state (element, &state, &pending, timeout);
	EXTEND (sp, 3);
	PUSHs (sv_2mortal (newSVGstStateChangeReturn (retval)));
	PUSHs (sv_2mortal (newSVGstState (state)));
	PUSHs (sv_2mortal (newSVGstState (pending)));
#line 1027 "xs/GstElement.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_GStreamer__Element_set_state); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_set_state)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, state");
    {
	GstStateChangeReturn	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	GstState	state = SvGstState (ST(1))
;

	RETVAL = gst_element_set_state(element, state);
	ST(0) = newSVGstStateChangeReturn (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_abort_state); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_abort_state)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	GstElement *	element = SvGstElement (ST(0))
;

	gst_element_abort_state(element);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_GStreamer__Element_continue_state); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_continue_state)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "element, ret");
    {
	GstStateChangeReturn	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;
	GstStateChangeReturn	ret = SvGstStateChangeReturn (ST(1))
;

	RETVAL = gst_element_continue_state(element, ret);
	ST(0) = newSVGstStateChangeReturn (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Element_lost_state); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_lost_state)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	GstElement *	element = SvGstElement (ST(0))
;

	gst_element_lost_state(element);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_GStreamer__Element_get_factory); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Element_get_factory)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "element");
    {
	GstElementFactory *	RETVAL;
	GstElement *	element = SvGstElement (ST(0))
;

	RETVAL = gst_element_get_factory(element);
	ST(0) = newSVGstElementFactory (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_GStreamer__Element); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_GStreamer__Element)
{
    dVAR; dXSARGS;
#if (PERL_REVISION == 5 && PERL_VERSION < 9)
    char* file = __FILE__;
#else
    const char* file = __FILE__;
#endif

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
#ifdef XS_APIVERSION_BOOTCHECK
    XS_APIVERSION_BOOTCHECK;
#endif
    XS_VERSION_BOOTCHECK;

        newXS("GStreamer::Element::requires_clock", XS_GStreamer__Element_requires_clock, file);
        newXS("GStreamer::Element::provides_clock", XS_GStreamer__Element_provides_clock, file);
        newXS("GStreamer::Element::provide_clock", XS_GStreamer__Element_provide_clock, file);
        newXS("GStreamer::Element::get_clock", XS_GStreamer__Element_get_clock, file);
        newXS("GStreamer::Element::set_clock", XS_GStreamer__Element_set_clock, file);
        newXS("GStreamer::Element::set_base_time", XS_GStreamer__Element_set_base_time, file);
        newXS("GStreamer::Element::get_base_time", XS_GStreamer__Element_get_base_time, file);
        newXS("GStreamer::Element::no_more_pads", XS_GStreamer__Element_no_more_pads, file);
        newXS("GStreamer::Element::is_indexable", XS_GStreamer__Element_is_indexable, file);
        newXS("GStreamer::Element::set_index", XS_GStreamer__Element_set_index, file);
        newXS("GStreamer::Element::get_index", XS_GStreamer__Element_get_index, file);
        newXS("GStreamer::Element::get_bus", XS_GStreamer__Element_get_bus, file);
        newXS("GStreamer::Element::add_pad", XS_GStreamer__Element_add_pad, file);
        newXS("GStreamer::Element::remove_pad", XS_GStreamer__Element_remove_pad, file);
        newXS("GStreamer::Element::get_pad", XS_GStreamer__Element_get_pad, file);
        newXS("GStreamer::Element::get_static_pad", XS_GStreamer__Element_get_static_pad, file);
        newXS("GStreamer::Element::get_request_pad", XS_GStreamer__Element_get_request_pad, file);
        newXS("GStreamer::Element::iterate_pads", XS_GStreamer__Element_iterate_pads, file);
        newXS("GStreamer::Element::iterate_src_pads", XS_GStreamer__Element_iterate_src_pads, file);
        newXS("GStreamer::Element::iterate_sink_pads", XS_GStreamer__Element_iterate_sink_pads, file);
        newXS("GStreamer::Element::get_compatible_pad", XS_GStreamer__Element_get_compatible_pad, file);
        newXS("GStreamer::Element::get_compatible_pad_template", XS_GStreamer__Element_get_compatible_pad_template, file);
        newXS("GStreamer::Element::link", XS_GStreamer__Element_link, file);
        newXS("GStreamer::Element::link_filtered", XS_GStreamer__Element_link_filtered, file);
        newXS("GStreamer::Element::unlink", XS_GStreamer__Element_unlink, file);
        newXS("GStreamer::Element::link_pads", XS_GStreamer__Element_link_pads, file);
        newXS("GStreamer::Element::link_pads_filtered", XS_GStreamer__Element_link_pads_filtered, file);
        newXS("GStreamer::Element::unlink_pads", XS_GStreamer__Element_unlink_pads, file);
        newXS("GStreamer::Element::send_event", XS_GStreamer__Element_send_event, file);
        newXS("GStreamer::Element::seek", XS_GStreamer__Element_seek, file);
        newXS("GStreamer::Element::get_query_types", XS_GStreamer__Element_get_query_types, file);
        newXS("GStreamer::Element::query", XS_GStreamer__Element_query, file);
        newXS("GStreamer::Element::post_message", XS_GStreamer__Element_post_message, file);
        newXS("GStreamer::Element::found_tags", XS_GStreamer__Element_found_tags, file);
        newXS("GStreamer::Element::found_tags_for_pad", XS_GStreamer__Element_found_tags_for_pad, file);
        newXS("GStreamer::Element::is_locked_state", XS_GStreamer__Element_is_locked_state, file);
        newXS("GStreamer::Element::set_locked_state", XS_GStreamer__Element_set_locked_state, file);
        newXS("GStreamer::Element::sync_state_with_parent", XS_GStreamer__Element_sync_state_with_parent, file);
        newXS("GStreamer::Element::get_state", XS_GStreamer__Element_get_state, file);
        newXS("GStreamer::Element::set_state", XS_GStreamer__Element_set_state, file);
        newXS("GStreamer::Element::abort_state", XS_GStreamer__Element_abort_state, file);
        newXS("GStreamer::Element::continue_state", XS_GStreamer__Element_continue_state, file);
        newXS("GStreamer::Element::lost_state", XS_GStreamer__Element_lost_state, file);
        newXS("GStreamer::Element::get_factory", XS_GStreamer__Element_get_factory, file);
#if (PERL_REVISION == 5 && PERL_VERSION >= 9)
  if (PL_unitcheckav)
       call_list(PL_scopestack_ix, PL_unitcheckav);
#endif
    XSRETURN_YES;
}

