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

#line 1 "xs/GstPad.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"

/* ------------------------------------------------------------------------- */

static GPerlCallback *
gst2perl_task_func_create (SV *func, SV *data)
{
	return gperl_callback_new (func, data, 0, NULL, G_TYPE_NONE);
}

static void
gst2perl_task_func (gpointer data)
{
	GPerlCallback *callback = data;
	gperl_callback_invoke (callback, NULL);
}

/* ------------------------------------------------------------------------- */

#line 51 "xs/GstPad.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 193 "xs/GstPad.c"

XS_EUPXS(XS_GStreamer__Pad_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_new)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "class, name, direction");
    {
	const gchar *	name;
	GstPadDirection	direction = SvGstPadDirection (ST(2))
;
	GstPad_ornull *	RETVAL;

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

	RETVAL = gst_pad_new(name, direction);
	ST(0) = newSVGstPad_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_new_from_template); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_new_from_template)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "class, templ, name");
    {
	GstPadTemplate *	templ = SvGstPadTemplate (ST(1))
;
	const gchar *	name;
	GstPad_ornull *	RETVAL;

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

	RETVAL = gst_pad_new_from_template(/* We need to ref templ since gst_pad_new_from_template sinks it. */
	g_object_ref (G_OBJECT (templ)), name);
	ST(0) = newSVGstPad_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_get_direction); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_get_direction)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pad");
    {
	GstPadDirection	RETVAL;
	GstPad *	pad = SvGstPad (ST(0))
;

	RETVAL = gst_pad_get_direction(pad);
	ST(0) = newSVGstPadDirection (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_set_active); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_set_active)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "pad, active");
    {
	GstPad *	pad = SvGstPad (ST(0))
;
	gboolean	active = (bool)SvTRUE(ST(1))
;

	gst_pad_set_active(pad, active);
    }
    XSRETURN_EMPTY;
}


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

	RETVAL = gst_pad_is_active(pad);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


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

	RETVAL = gst_pad_activate_pull(pad, active);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


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

	RETVAL = gst_pad_activate_push(pad, active);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


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

	RETVAL = gst_pad_set_blocked(pad, blocked);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


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

	RETVAL = gst_pad_is_blocked(pad);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_get_pad_template); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_get_pad_template)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pad");
    {
	GstPadTemplate *	RETVAL;
	GstPad *	pad = SvGstPad (ST(0))
;

	RETVAL = gst_pad_get_pad_template(pad);
	ST(0) = newSVGstPadTemplate (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_link); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_link)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "srcpad, sinkpad");
    {
	gboolean	RETVAL;
	GstPad *	srcpad = SvGstPad (ST(0))
;
	GstPad *	sinkpad = SvGstPad (ST(1))
;

	RETVAL = gst_pad_link(srcpad, sinkpad);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_unlink); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_unlink)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "srcpad, sinkpad");
    {
	GstPad *	srcpad = SvGstPad (ST(0))
;
	GstPad *	sinkpad = SvGstPad (ST(1))
;

	gst_pad_unlink(srcpad, sinkpad);
    }
    XSRETURN_EMPTY;
}


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

	RETVAL = gst_pad_is_linked(pad);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


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

	RETVAL = gst_pad_get_peer(pad);
	ST(0) = newSVGstPad (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_get_pad_template_caps); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_get_pad_template_caps)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pad");
    {
	const GstCaps *	RETVAL;
	GstPad *	pad = SvGstPad (ST(0))
;

	RETVAL = gst_pad_get_pad_template_caps(pad);
	ST(0) = newSVGstCaps (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_get_caps); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_get_caps)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pad");
    {
	GstCaps_own *	RETVAL;
	GstPad *	pad = SvGstPad (ST(0))
;

	RETVAL = gst_pad_get_caps(pad);
	ST(0) = newSVGstCaps_own (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


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

	gst_pad_fixate_caps(pad, caps);
    }
    XSRETURN_EMPTY;
}


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

	RETVAL = gst_pad_accept_caps(pad, caps);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


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

	RETVAL = gst_pad_set_caps(pad, caps);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_peer_get_caps); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_peer_get_caps)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pad");
    {
	GstCaps_own *	RETVAL;
	GstPad *	pad = SvGstPad (ST(0))
;

	RETVAL = gst_pad_peer_get_caps(pad);
	ST(0) = newSVGstCaps_own (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


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

	RETVAL = gst_pad_peer_accept_caps(pad, caps);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_get_allowed_caps); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_get_allowed_caps)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "srcpad");
    {
	GstCaps_own_ornull *	RETVAL;
	GstPad *	srcpad = SvGstPad (ST(0))
;

	RETVAL = gst_pad_get_allowed_caps(srcpad);
	ST(0) = newSVGstCaps_own_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_get_negotiated_caps); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_get_negotiated_caps)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pad");
    {
	GstCaps_own_ornull *	RETVAL;
	GstPad *	pad = SvGstPad (ST(0))
;

	RETVAL = gst_pad_get_negotiated_caps(pad);
	ST(0) = newSVGstCaps_own_ornull (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_push); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_push)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "pad, buffer");
    {
	GstFlowReturn	RETVAL;
	GstPad *	pad = SvGstPad (ST(0))
;
	GstBuffer *	buffer = SvGstBuffer (ST(1))
;

	RETVAL = gst_pad_push(/* We need to keep the buffer alive. */
	pad, gst_buffer_ref (buffer));
	ST(0) = newSVGstFlowReturn (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


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

	RETVAL = gst_pad_check_pull_range(pad);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_pull_range); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_pull_range)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "pad, offset, size");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 145 "xs/GstPad.xs"
	GstFlowReturn retval;
	GstBuffer *buffer = NULL;
#line 698 "xs/GstPad.c"
	GstPad *	pad = SvGstPad (ST(0))
;
	guint64	offset = SvGUInt64 (ST(1))
;
	guint	size = (guint)SvUV(ST(2))
;
#line 148 "xs/GstPad.xs"
	retval = gst_pad_pull_range (pad, offset, size, &buffer);
	EXTEND (sp, 2);
	PUSHs (sv_2mortal (newSVGstFlowReturn (retval)));
	PUSHs (sv_2mortal (newSVGstBuffer_ornull (buffer)));
#line 710 "xs/GstPad.c"
	PUTBACK;
	return;
    }
}


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

	RETVAL = gst_pad_push_event(/* Need to keep event alive. */
	pad, gst_event_ref (event));
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


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

	RETVAL = gst_pad_event_default(/* Need to keep event alive. */
	pad, gst_event_ref (event));
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_chain); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_chain)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "pad, buffer");
    {
	GstFlowReturn	RETVAL;
	GstPad *	pad = SvGstPad (ST(0))
;
	GstBuffer *	buffer = SvGstBuffer (ST(1))
;

	RETVAL = gst_pad_chain(/* We need to keep the buffer alive. */
	pad, gst_buffer_ref (buffer));
	ST(0) = newSVGstFlowReturn (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_get_range); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_get_range)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "pad, offset, size");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 171 "xs/GstPad.xs"
	GstFlowReturn retval;
	GstBuffer *buffer = NULL;
#line 793 "xs/GstPad.c"
	GstPad *	pad = SvGstPad (ST(0))
;
	guint64	offset = SvGUInt64 (ST(1))
;
	guint	size = (guint)SvUV(ST(2))
;
#line 174 "xs/GstPad.xs"
	retval = gst_pad_get_range (pad, offset, size, &buffer);
	EXTEND (sp, 2);
	PUSHs (sv_2mortal (newSVGstFlowReturn (retval)));
	PUSHs (sv_2mortal (newSVGstBuffer_ornull (buffer)));
#line 805 "xs/GstPad.c"
	PUTBACK;
	return;
    }
}


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

	RETVAL = gst_pad_send_event(/* Need to keep event alive. */
	pad, gst_event_ref (event));
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_start_task); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_start_task)
{
    dVAR; dXSARGS;
    if (items < 2 || items > 3)
       croak_xs_usage(cv,  "pad, func, data=NULL");
    {
#line 188 "xs/GstPad.xs"
	GPerlCallback *callback;
#line 842 "xs/GstPad.c"
	gboolean	RETVAL;
	GstPad *	pad = SvGstPad (ST(0))
;
	SV *	func = ST(1)
;
	SV *	data;

	if (items < 3)
	    data = NULL;
	else {
	    data = ST(2)
;
	}
#line 190 "xs/GstPad.xs"
	callback = gst2perl_task_func_create (func, data);
	RETVAL = gst_pad_start_task (pad, gst2perl_task_func, callback);
#line 859 "xs/GstPad.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


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

	RETVAL = gst_pad_pause_task(pad);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


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

	RETVAL = gst_pad_stop_task(pad);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_get_internal_links); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_get_internal_links)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "pad");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GstPad *	pad = SvGstPad (ST(0))
;
#line 210 "xs/GstPad.xs"
	GList *list, *i;
#line 916 "xs/GstPad.c"
#line 212 "xs/GstPad.xs"
	list = ix == 1 ? gst_pad_get_internal_links_default (pad) :
	                 gst_pad_get_internal_links (pad);
	for (i = list; i != NULL; i = i->next)
		XPUSHs (sv_2mortal (newSVGstPad (i->data)));
#line 922 "xs/GstPad.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_GStreamer__Pad_get_query_types); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_get_query_types)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "pad");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GstPad *	pad = SvGstPad (ST(0))
;
#line 228 "xs/GstPad.xs"
	const GstQueryType *types = NULL;
#line 943 "xs/GstPad.c"
#line 230 "xs/GstPad.xs"
	types = ix == 1 ? gst_pad_get_query_types_default (pad) :
	                  gst_pad_get_query_types (pad);
	if (types)
		while (*types++)
			XPUSHs (sv_2mortal (newSVGstQueryType (*types)));
#line 950 "xs/GstPad.c"
	PUTBACK;
	return;
    }
}


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

	RETVAL = gst_pad_query(pad, query);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


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

	RETVAL = gst_pad_query_default(pad, query);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}

#if GST_CHECK_VERSION (0, 10, 11)
#define XSubPPtmpAAAA 1


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

	RETVAL = gst_pad_is_blocking(pad);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}

#endif
#if GST_CHECK_VERSION (0, 10, 15)
#define XSubPPtmpAAAB 1


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

	RETVAL = gst_pad_peer_query(pad, query);
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}

#endif
#if GST_CHECK_VERSION (0, 10, 21)
#define XSubPPtmpAAAC 1


XS_EUPXS(XS_GStreamer__Pad_iterate_internal_links); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_iterate_internal_links)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pad");
    {
	GstIterator *	RETVAL;
	GstPad *	pad = SvGstPad (ST(0))
;

	RETVAL = gst_pad_iterate_internal_links(pad);
	ST(0) = newSVGstIterator (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Pad_iterate_internal_links_default); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Pad_iterate_internal_links_default)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pad");
    {
	GstIterator *	RETVAL;
	GstPad *	pad = SvGstPad (ST(0))
;

	RETVAL = gst_pad_iterate_internal_links_default(pad);
	ST(0) = newSVGstIterator (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}

#endif
#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_GStreamer__Pad); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_GStreamer__Pad)
{
    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::Pad::new", XS_GStreamer__Pad_new, file);
        newXS("GStreamer::Pad::new_from_template", XS_GStreamer__Pad_new_from_template, file);
        newXS("GStreamer::Pad::get_direction", XS_GStreamer__Pad_get_direction, file);
        newXS("GStreamer::Pad::set_active", XS_GStreamer__Pad_set_active, file);
        newXS("GStreamer::Pad::is_active", XS_GStreamer__Pad_is_active, file);
        newXS("GStreamer::Pad::activate_pull", XS_GStreamer__Pad_activate_pull, file);
        newXS("GStreamer::Pad::activate_push", XS_GStreamer__Pad_activate_push, file);
        newXS("GStreamer::Pad::set_blocked", XS_GStreamer__Pad_set_blocked, file);
        newXS("GStreamer::Pad::is_blocked", XS_GStreamer__Pad_is_blocked, file);
        newXS("GStreamer::Pad::get_pad_template", XS_GStreamer__Pad_get_pad_template, file);
        newXS("GStreamer::Pad::link", XS_GStreamer__Pad_link, file);
        newXS("GStreamer::Pad::unlink", XS_GStreamer__Pad_unlink, file);
        newXS("GStreamer::Pad::is_linked", XS_GStreamer__Pad_is_linked, file);
        newXS("GStreamer::Pad::get_peer", XS_GStreamer__Pad_get_peer, file);
        newXS("GStreamer::Pad::get_pad_template_caps", XS_GStreamer__Pad_get_pad_template_caps, file);
        newXS("GStreamer::Pad::get_caps", XS_GStreamer__Pad_get_caps, file);
        newXS("GStreamer::Pad::fixate_caps", XS_GStreamer__Pad_fixate_caps, file);
        newXS("GStreamer::Pad::accept_caps", XS_GStreamer__Pad_accept_caps, file);
        newXS("GStreamer::Pad::set_caps", XS_GStreamer__Pad_set_caps, file);
        newXS("GStreamer::Pad::peer_get_caps", XS_GStreamer__Pad_peer_get_caps, file);
        newXS("GStreamer::Pad::peer_accept_caps", XS_GStreamer__Pad_peer_accept_caps, file);
        newXS("GStreamer::Pad::get_allowed_caps", XS_GStreamer__Pad_get_allowed_caps, file);
        newXS("GStreamer::Pad::get_negotiated_caps", XS_GStreamer__Pad_get_negotiated_caps, file);
        newXS("GStreamer::Pad::push", XS_GStreamer__Pad_push, file);
        newXS("GStreamer::Pad::check_pull_range", XS_GStreamer__Pad_check_pull_range, file);
        newXS("GStreamer::Pad::pull_range", XS_GStreamer__Pad_pull_range, file);
        newXS("GStreamer::Pad::push_event", XS_GStreamer__Pad_push_event, file);
        newXS("GStreamer::Pad::event_default", XS_GStreamer__Pad_event_default, file);
        newXS("GStreamer::Pad::chain", XS_GStreamer__Pad_chain, file);
        newXS("GStreamer::Pad::get_range", XS_GStreamer__Pad_get_range, file);
        newXS("GStreamer::Pad::send_event", XS_GStreamer__Pad_send_event, file);
        newXS("GStreamer::Pad::start_task", XS_GStreamer__Pad_start_task, file);
        newXS("GStreamer::Pad::pause_task", XS_GStreamer__Pad_pause_task, file);
        newXS("GStreamer::Pad::stop_task", XS_GStreamer__Pad_stop_task, file);
        cv = newXS("GStreamer::Pad::get_internal_links", XS_GStreamer__Pad_get_internal_links, file);
        XSANY.any_i32 = 0;
        cv = newXS("GStreamer::Pad::get_internal_links_default", XS_GStreamer__Pad_get_internal_links, file);
        XSANY.any_i32 = 1;
        cv = newXS("GStreamer::Pad::get_query_types", XS_GStreamer__Pad_get_query_types, file);
        XSANY.any_i32 = 0;
        cv = newXS("GStreamer::Pad::get_query_types_default", XS_GStreamer__Pad_get_query_types, file);
        XSANY.any_i32 = 1;
        newXS("GStreamer::Pad::query", XS_GStreamer__Pad_query, file);
        newXS("GStreamer::Pad::query_default", XS_GStreamer__Pad_query_default, file);
#if XSubPPtmpAAAA
        newXS("GStreamer::Pad::is_blocking", XS_GStreamer__Pad_is_blocking, file);
#endif
#if XSubPPtmpAAAB
        newXS("GStreamer::Pad::peer_query", XS_GStreamer__Pad_peer_query, file);
#endif
#if XSubPPtmpAAAC
        newXS("GStreamer::Pad::iterate_internal_links", XS_GStreamer__Pad_iterate_internal_links, file);
        newXS("GStreamer::Pad::iterate_internal_links_default", XS_GStreamer__Pad_iterate_internal_links_default, file);
#endif

    /* Initialisation Section */

#line 44 "xs/GstPad.xs"
	gperl_object_set_no_warn_unreg_subclass (GST_TYPE_PAD, TRUE);

#if XSubPPtmpAAAA
#endif
#if XSubPPtmpAAAB
#endif
#if XSubPPtmpAAAC
#endif
#line 1170 "xs/GstPad.c"

    /* End of Initialisation Section */

#if (PERL_REVISION == 5 && PERL_VERSION >= 9)
  if (PL_unitcheckav)
       call_list(PL_scopestack_ix, PL_unitcheckav);
#endif
    XSRETURN_YES;
}

