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

#line 1 "xs/GstMessage.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 const char *
get_package (GstMessage *message)
{
	const char *package = "GStreamer::Message";

	switch (GST_MESSAGE_TYPE (message)) {
	    case GST_MESSAGE_EOS:
		package = "GStreamer::Message::EOS";
		break;

	    case GST_MESSAGE_ERROR:
		package = "GStreamer::Message::Error";
		break;

	    case GST_MESSAGE_WARNING:
		package = "GStreamer::Message::Warning";
		break;

	    case GST_MESSAGE_INFO:
		package = "GStreamer::Message::Info";
		break;

	    case GST_MESSAGE_TAG:
		package = "GStreamer::Message::Tag";
		break;

	    case GST_MESSAGE_BUFFERING:
		package = "GStreamer::Message::Buffering";
		break;

	    case GST_MESSAGE_STATE_CHANGED:
		package = "GStreamer::Message::StateChanged";
		break;

	    case GST_MESSAGE_STATE_DIRTY:
		package = "GStreamer::Message::StateDirty";
		break;

	    case GST_MESSAGE_STEP_DONE:
		package = "GStreamer::Message::StepDone";
		break;

	    case GST_MESSAGE_CLOCK_PROVIDE:
		package = "GStreamer::Message::ClockProvide";
		break;

	    case GST_MESSAGE_CLOCK_LOST:
		package = "GStreamer::Message::ClockLost";
		break;

	    case GST_MESSAGE_NEW_CLOCK:
		package = "GStreamer::Message::NewClock";
		break;

	    case GST_MESSAGE_STRUCTURE_CHANGE:
		package = "GStreamer::Message::StructureChange";
		break;

	    case GST_MESSAGE_STREAM_STATUS:
		package = "GStreamer::Message::StreamStatus";
		break;

	    case GST_MESSAGE_APPLICATION:
		package = "GStreamer::Message::Application";
		break;

	    case GST_MESSAGE_ELEMENT:
		package = "GStreamer::Message::Element";
		break;

	    case GST_MESSAGE_SEGMENT_START:
		package = "GStreamer::Message::SegmentStart";
		break;

	    case GST_MESSAGE_SEGMENT_DONE:
		package = "GStreamer::Message::SegmentDone";
		break;

	    case GST_MESSAGE_DURATION:
		package = "GStreamer::Message::Duration";
		break;

#if GST_CHECK_VERSION (0, 10, 12)
	    case GST_MESSAGE_LATENCY:
		package = "GStreamer::Message::Latency";
		break;
#endif

#if GST_CHECK_VERSION (0, 10, 13)
	    case GST_MESSAGE_ASYNC_START:
		package = "GStreamer::Message::AsyncStart";
		break;

	    case GST_MESSAGE_ASYNC_DONE:
		package = "GStreamer::Message::AsyncDone";
		break;
#endif

	    case GST_MESSAGE_UNKNOWN:
	    case GST_MESSAGE_ANY:
		/* Use the default package name */
		break;
	}

	return package;
}

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

#line 143 "xs/GstMessage.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 285 "xs/GstMessage.c"

XS_EUPXS(XS_GStreamer__Message_get_structure); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message_get_structure)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
	const GstStructure *	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;

	RETVAL = gst_message_get_structure(message);
	ST(0) = newSVGstStructure (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message_type); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message_type)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
	GstMessageType	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 255 "xs/GstMessage.xs"
	RETVAL = GST_MESSAGE_TYPE (message);
#line 318 "xs/GstMessage.c"
	ST(0) = newSVGstMessageType (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message_timestamp); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message_timestamp)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
	guint64	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 262 "xs/GstMessage.xs"
	RETVAL = GST_MESSAGE_TIMESTAMP (message);
#line 338 "xs/GstMessage.c"
	ST(0) = newSVGUInt64 (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message_src); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message_src)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
	GstObject *	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 269 "xs/GstMessage.xs"
	RETVAL = GST_MESSAGE_SRC (message);
#line 358 "xs/GstMessage.c"
	ST(0) = newSVGstObject (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__Custom_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__Custom_new)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "class, type, src, structure");
    {
	GstMessage_noinc *	RETVAL;
	GstMessageType	type = SvGstMessageType (ST(1))
;
	GstObject *	src = SvGstObject (ST(2))
;
	GstStructure *	structure = SvGstStructure (ST(3))
;
#line 281 "xs/GstMessage.xs"
	/* gst_message_new_custom takes ownership of structure. */
	RETVAL = gst_message_new_custom (type, src, structure);
#line 383 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__EOS_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__EOS_new)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, src");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
#line 294 "xs/GstMessage.xs"
	RETVAL = gst_message_new_eos (src);
#line 403 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__Error_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__Error_new)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "class, src, error, debug");
    {
#line 306 "xs/GstMessage.xs"
	GError *real_error = NULL;
#line 420 "xs/GstMessage.c"
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	SV *	error = ST(2)
;
	gchar *	debug;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(3));
	debug = (gchar *)SvPV_nolen (ST(3))
;
#line 308 "xs/GstMessage.xs"
	gperl_gerror_from_sv (error, &real_error);
	RETVAL = gst_message_new_error (src, real_error, debug);
#line 435 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__Error_error); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__Error_error)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
#line 320 "xs/GstMessage.xs"
	GError *error = NULL;
	gchar *debug = NULL;
#line 454 "xs/GstMessage.c"
	SV *	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 323 "xs/GstMessage.xs"
	gst_message_parse_error (message, &error, &debug);
	switch (ix) {
	    case 0:
		RETVAL = gperl_sv_from_gerror (error);
		g_error_free (error);
		break;

	    case 1:
	    	RETVAL = newSVGChar (debug);
		g_free (debug);
		break;

	    default:
	    	RETVAL = &PL_sv_undef;
	}
#line 474 "xs/GstMessage.c"
	ST(0) = RETVAL;
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__Warning_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__Warning_new)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "class, src, error, debug");
    {
#line 349 "xs/GstMessage.xs"
	GError *real_error = NULL;
#line 491 "xs/GstMessage.c"
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	SV *	error = ST(2)
;
	gchar *	debug;

	/* same as SvGChar(), but not in a function */
	sv_utf8_upgrade (ST(3));
	debug = (gchar *)SvPV_nolen (ST(3))
;
#line 351 "xs/GstMessage.xs"
	gperl_gerror_from_sv (error, &real_error);
	RETVAL = gst_message_new_warning (src, real_error, debug);
#line 506 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__Warning_error); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__Warning_error)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
#line 363 "xs/GstMessage.xs"
	GError *error = NULL;
	gchar *debug = NULL;
#line 525 "xs/GstMessage.c"
	SV *	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 366 "xs/GstMessage.xs"
	gst_message_parse_warning (message, &error, &debug);
	switch (ix) {
	    case 0:
		RETVAL = gperl_sv_from_gerror (error);
		g_error_free (error);
		break;

	    case 1:
		RETVAL = newSVGChar (debug);
		g_free (debug);
		break;

	    default:
		RETVAL = &PL_sv_undef;
	}
#line 545 "xs/GstMessage.c"
	ST(0) = RETVAL;
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__Tag_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__Tag_new)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "class, src, tag_list");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	GstTagList *	tag_list = SvGstTagList (ST(2))
;
#line 392 "xs/GstMessage.xs"
	/* gst_message_new_tag takes ownership of tag_list. */
	RETVAL = gst_message_new_tag (src, tag_list);
#line 568 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__Tag_tag_list); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__Tag_tag_list)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
	GstTagList_own *	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 402 "xs/GstMessage.xs"
	gst_message_parse_tag (message, &RETVAL);
#line 588 "xs/GstMessage.c"
	ST(0) = newSVGstTagList_own (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__StateChanged_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__StateChanged_new)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "class, src, oldstate, newstate, pending");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	GstState	oldstate = SvGstState (ST(2))
;
	GstState	newstate = SvGstState (ST(3))
;
	GstState	pending = SvGstState (ST(4))
;
#line 414 "xs/GstMessage.xs"
	RETVAL = gst_message_new_state_changed (src, oldstate, newstate, pending);
#line 614 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__StateChanged_old_state); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__StateChanged_old_state)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
#line 426 "xs/GstMessage.xs"
	GstState old, new, pending;
#line 632 "xs/GstMessage.c"
	GstState	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 428 "xs/GstMessage.xs"
	gst_message_parse_state_changed (message, &old, &new, &pending);
	switch (ix) {
	    case 0: RETVAL = old; break;
	    case 1: RETVAL = new; break;
	    case 2: RETVAL = pending; break;
	    default: XSRETURN_UNDEF;
	}
#line 644 "xs/GstMessage.c"
	ST(0) = newSVGstState (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__StateDirty_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__StateDirty_new)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, src");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
#line 446 "xs/GstMessage.xs"
	RETVAL = gst_message_new_state_dirty (src);
#line 664 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__ClockProvide_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__ClockProvide_new)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "class, src, clock, ready");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	GstClock *	clock = SvGstClock (ST(2))
;
	gboolean	ready = (bool)SvTRUE(ST(3))
;
#line 458 "xs/GstMessage.xs"
	RETVAL = gst_message_new_clock_provide (src, clock, ready);
#line 688 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__ClockProvide_clock); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__ClockProvide_clock)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
#line 469 "xs/GstMessage.xs"
	gboolean ready;
	GstClock *clock = NULL;
#line 707 "xs/GstMessage.c"
	SV *	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 472 "xs/GstMessage.xs"
	gst_message_parse_clock_provide (message, &clock, &ready);
	switch (ix) {
	    case 0:
		RETVAL = newSVGstClock (clock);
		break;

	    case 1:
		RETVAL = newSVuv (ready);
		break;

	    default:
		RETVAL = &PL_sv_undef;
	}
#line 725 "xs/GstMessage.c"
	ST(0) = RETVAL;
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__ClockLost_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__ClockLost_new)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "class, src, clock");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	GstClock *	clock = SvGstClock (ST(2))
;
#line 496 "xs/GstMessage.xs"
	RETVAL = gst_message_new_clock_lost (src, clock);
#line 747 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__ClockLost_clock); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__ClockLost_clock)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
	GstClock *	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 505 "xs/GstMessage.xs"
	gst_message_parse_clock_lost (message, &RETVAL);
#line 767 "xs/GstMessage.c"
	ST(0) = newSVGstClock (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__NewClock_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__NewClock_new)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "class, src, clock");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	GstClock *	clock = SvGstClock (ST(2))
;
#line 517 "xs/GstMessage.xs"
	RETVAL = gst_message_new_new_clock (src, clock);
#line 789 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__NewClock_clock); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__NewClock_clock)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
	GstClock *	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 526 "xs/GstMessage.xs"
	gst_message_parse_new_clock (message, &RETVAL);
#line 809 "xs/GstMessage.c"
	ST(0) = newSVGstClock (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__Application_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__Application_new)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "class, src, structure");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	GstStructure *	structure = SvGstStructure (ST(2))
;
#line 538 "xs/GstMessage.xs"
	/* gst_message_new_application takes ownership of structure. */
	RETVAL = gst_message_new_application (src, structure);
#line 832 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__Element_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__Element_new)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "class, src, structure");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	GstStructure *	structure = SvGstStructure (ST(2))
;
#line 551 "xs/GstMessage.xs"
	/* gst_message_new_element takes ownership of structure. */
	RETVAL = gst_message_new_element (src, structure);
#line 855 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__SegmentStart_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__SegmentStart_new)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "class, src, format, position");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	GstFormat	format = SvGstFormat (ST(2))
;
	gint64	position = SvGInt64 (ST(3))
;
#line 564 "xs/GstMessage.xs"
	RETVAL = gst_message_new_segment_start (src, format, position);
#line 879 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__SegmentStart_format); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__SegmentStart_format)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
#line 575 "xs/GstMessage.xs"
	GstFormat format;
	gint64 position;
#line 898 "xs/GstMessage.c"
	SV *	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 578 "xs/GstMessage.xs"
	gst_message_parse_segment_start (message, &format, &position);
	switch (ix) {
	    case 0:
		RETVAL = newSVGstFormat (format);
		break;

	    case 1:
		RETVAL = newSVGInt64 (position);
		break;

	    default:
		RETVAL = &PL_sv_undef;
	}
#line 916 "xs/GstMessage.c"
	ST(0) = RETVAL;
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__SegmentDone_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__SegmentDone_new)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "class, src, format, position");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	GstFormat	format = SvGstFormat (ST(2))
;
	gint64	position = SvGInt64 (ST(3))
;
#line 602 "xs/GstMessage.xs"
	RETVAL = gst_message_new_segment_done (src, format, position);
#line 940 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__SegmentDone_format); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__SegmentDone_format)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
#line 613 "xs/GstMessage.xs"
	GstFormat format;
	gint64 position;
#line 959 "xs/GstMessage.c"
	SV *	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 616 "xs/GstMessage.xs"
	gst_message_parse_segment_done (message, &format, &position);
	switch (ix) {
	    case 0:
		RETVAL = newSVGstFormat (format);
		break;

	    case 1:
		RETVAL = newSVGInt64 (position);
		break;

	    default:
		RETVAL = &PL_sv_undef;
	}
#line 977 "xs/GstMessage.c"
	ST(0) = RETVAL;
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__Duration_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__Duration_new)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "class, src, format, duration");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	GstFormat	format = SvGstFormat (ST(2))
;
	gint64	duration = SvGInt64 (ST(3))
;
#line 640 "xs/GstMessage.xs"
	RETVAL = gst_message_new_duration (src, format, duration);
#line 1001 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__Duration_format); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__Duration_format)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
#line 651 "xs/GstMessage.xs"
	GstFormat format;
	gint64 duration;
#line 1020 "xs/GstMessage.c"
	SV *	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 654 "xs/GstMessage.xs"
	gst_message_parse_duration (message, &format, &duration);
	switch (ix) {
	    case 0:
		RETVAL = newSVGstFormat (format);
		break;

	    case 1:
		RETVAL = newSVGInt64 (duration);
		break;

	    default:
		RETVAL = &PL_sv_undef;
	}
#line 1038 "xs/GstMessage.c"
	ST(0) = RETVAL;
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}

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


XS_EUPXS(XS_GStreamer__Message__Latency_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__Latency_new)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, src");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
#line 680 "xs/GstMessage.xs"
	RETVAL = gst_message_new_latency (src);
#line 1061 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}

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


XS_EUPXS(XS_GStreamer__Message__AsyncStart_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__AsyncStart_new)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "class, src, new_base_time");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
	gboolean	new_base_time = (bool)SvTRUE(ST(2))
;
#line 696 "xs/GstMessage.xs"
	RETVAL = gst_message_new_async_start (src, new_base_time);
#line 1087 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}


XS_EUPXS(XS_GStreamer__Message__AsyncStart_new_base_time); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__AsyncStart_new_base_time)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "message");
    {
	gboolean	RETVAL;
	GstMessage *	message = SvGstMessage (ST(0))
;
#line 705 "xs/GstMessage.xs"
	gst_message_parse_async_start (message, &RETVAL);
#line 1107 "xs/GstMessage.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}

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


XS_EUPXS(XS_GStreamer__Message__AsyncDone_new); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_GStreamer__Message__AsyncDone_new)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "class, src");
    {
	GstMessage_noinc *	RETVAL;
	GstObject *	src = SvGstObject (ST(1))
;
#line 721 "xs/GstMessage.xs"
	RETVAL = gst_message_new_async_done (src);
#line 1130 "xs/GstMessage.c"
	ST(0) = newSVGstMessage_noinc (RETVAL);
	sv_2mortal(ST(0));
    }
    XSRETURN(1);
}

#endif
#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_GStreamer__Message); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_GStreamer__Message)
{
    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::Message::get_structure", XS_GStreamer__Message_get_structure, file);
        newXS("GStreamer::Message::type", XS_GStreamer__Message_type, file);
        newXS("GStreamer::Message::timestamp", XS_GStreamer__Message_timestamp, file);
        newXS("GStreamer::Message::src", XS_GStreamer__Message_src, file);
        newXS("GStreamer::Message::Custom::new", XS_GStreamer__Message__Custom_new, file);
        newXS("GStreamer::Message::EOS::new", XS_GStreamer__Message__EOS_new, file);
        newXS("GStreamer::Message::Error::new", XS_GStreamer__Message__Error_new, file);
        cv = newXS("GStreamer::Message::Error::debug", XS_GStreamer__Message__Error_error, file);
        XSANY.any_i32 = 1;
        cv = newXS("GStreamer::Message::Error::error", XS_GStreamer__Message__Error_error, file);
        XSANY.any_i32 = 0;
        newXS("GStreamer::Message::Warning::new", XS_GStreamer__Message__Warning_new, file);
        cv = newXS("GStreamer::Message::Warning::debug", XS_GStreamer__Message__Warning_error, file);
        XSANY.any_i32 = 1;
        cv = newXS("GStreamer::Message::Warning::error", XS_GStreamer__Message__Warning_error, file);
        XSANY.any_i32 = 0;
        newXS("GStreamer::Message::Tag::new", XS_GStreamer__Message__Tag_new, file);
        newXS("GStreamer::Message::Tag::tag_list", XS_GStreamer__Message__Tag_tag_list, file);
        newXS("GStreamer::Message::StateChanged::new", XS_GStreamer__Message__StateChanged_new, file);
        cv = newXS("GStreamer::Message::StateChanged::new_state", XS_GStreamer__Message__StateChanged_old_state, file);
        XSANY.any_i32 = 1;
        cv = newXS("GStreamer::Message::StateChanged::old_state", XS_GStreamer__Message__StateChanged_old_state, file);
        XSANY.any_i32 = 0;
        cv = newXS("GStreamer::Message::StateChanged::pending", XS_GStreamer__Message__StateChanged_old_state, file);
        XSANY.any_i32 = 2;
        newXS("GStreamer::Message::StateDirty::new", XS_GStreamer__Message__StateDirty_new, file);
        newXS("GStreamer::Message::ClockProvide::new", XS_GStreamer__Message__ClockProvide_new, file);
        cv = newXS("GStreamer::Message::ClockProvide::clock", XS_GStreamer__Message__ClockProvide_clock, file);
        XSANY.any_i32 = 0;
        cv = newXS("GStreamer::Message::ClockProvide::ready", XS_GStreamer__Message__ClockProvide_clock, file);
        XSANY.any_i32 = 1;
        newXS("GStreamer::Message::ClockLost::new", XS_GStreamer__Message__ClockLost_new, file);
        newXS("GStreamer::Message::ClockLost::clock", XS_GStreamer__Message__ClockLost_clock, file);
        newXS("GStreamer::Message::NewClock::new", XS_GStreamer__Message__NewClock_new, file);
        newXS("GStreamer::Message::NewClock::clock", XS_GStreamer__Message__NewClock_clock, file);
        newXS("GStreamer::Message::Application::new", XS_GStreamer__Message__Application_new, file);
        newXS("GStreamer::Message::Element::new", XS_GStreamer__Message__Element_new, file);
        newXS("GStreamer::Message::SegmentStart::new", XS_GStreamer__Message__SegmentStart_new, file);
        cv = newXS("GStreamer::Message::SegmentStart::format", XS_GStreamer__Message__SegmentStart_format, file);
        XSANY.any_i32 = 0;
        cv = newXS("GStreamer::Message::SegmentStart::position", XS_GStreamer__Message__SegmentStart_format, file);
        XSANY.any_i32 = 1;
        newXS("GStreamer::Message::SegmentDone::new", XS_GStreamer__Message__SegmentDone_new, file);
        cv = newXS("GStreamer::Message::SegmentDone::format", XS_GStreamer__Message__SegmentDone_format, file);
        XSANY.any_i32 = 0;
        cv = newXS("GStreamer::Message::SegmentDone::position", XS_GStreamer__Message__SegmentDone_format, file);
        XSANY.any_i32 = 1;
        newXS("GStreamer::Message::Duration::new", XS_GStreamer__Message__Duration_new, file);
        cv = newXS("GStreamer::Message::Duration::duration", XS_GStreamer__Message__Duration_format, file);
        XSANY.any_i32 = 1;
        cv = newXS("GStreamer::Message::Duration::format", XS_GStreamer__Message__Duration_format, file);
        XSANY.any_i32 = 0;
#if XSubPPtmpAAAA
        newXS("GStreamer::Message::Latency::new", XS_GStreamer__Message__Latency_new, file);
#endif
#if XSubPPtmpAAAB
        newXS("GStreamer::Message::AsyncStart::new", XS_GStreamer__Message__AsyncStart_new, file);
        newXS("GStreamer::Message::AsyncStart::new_base_time", XS_GStreamer__Message__AsyncStart_new_base_time, file);
#endif
#if XSubPPtmpAAAC
        newXS("GStreamer::Message::AsyncDone::new", XS_GStreamer__Message__AsyncDone_new, file);
#endif

    /* Initialisation Section */

#line 136 "xs/GstMessage.xs"
	gperl_set_isa ("GStreamer::Message::EOS", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::Error", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::Warning", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::Info", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::Tag", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::Buffering", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::StateChanged", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::StateDirty", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::StepDone", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::ClockProvide", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::ClockLost", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::NewClock", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::StructureChange", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::StreamStatus", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::Application", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::Element", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::SegmentStart", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::SegmentDone", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::Duration", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::Latency", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::AsyncStart", "GStreamer::Message");
	gperl_set_isa ("GStreamer::Message::AsyncDone", "GStreamer::Message");
	gst2perl_register_mini_object_package_lookup_func (
		GST_TYPE_MESSAGE,
		(Gst2PerlMiniObjectPackageLookupFunc) get_package);

#if XSubPPtmpAAAA
#endif
#if XSubPPtmpAAAB
#endif
#if XSubPPtmpAAAC
#endif
#line 1256 "xs/GstMessage.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;
}

