/* rygel-gst-utils.c generated by valac 0.17.2.19-5f50d, the Vala compiler
 * generated from rygel-gst-utils.vala, do not modify */

/*
 * Copyright (C) 2009 Nokia Corporation.
 *
 * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
 *                               <zeeshan.ali@nokia.com>
 *
 * This file is part of Rygel.
 *
 * Rygel 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 of the License, or
 * (at your option) any later version.
 *
 * Rygel 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 program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gst/gst.h>
#include <glib/gi18n-lib.h>
#include <gst/pbutils/pbutils.h>
#include <gobject/gvaluecollector.h>


#define RYGEL_TYPE_GST_UTILS (rygel_gst_utils_get_type ())
#define RYGEL_GST_UTILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_GST_UTILS, RygelGstUtils))
#define RYGEL_GST_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_GST_UTILS, RygelGstUtilsClass))
#define RYGEL_IS_GST_UTILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_GST_UTILS))
#define RYGEL_IS_GST_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_GST_UTILS))
#define RYGEL_GST_UTILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_GST_UTILS, RygelGstUtilsClass))

typedef struct _RygelGstUtils RygelGstUtils;
typedef struct _RygelGstUtilsClass RygelGstUtilsClass;
typedef struct _RygelGstUtilsPrivate RygelGstUtilsPrivate;
#define _gst_object_unref0(var) ((var == NULL) ? NULL : (var = (gst_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _gst_encoding_profile_unref0(var) ((var == NULL) ? NULL : (var = (gst_encoding_profile_unref (var), NULL)))
#define __g_list_free__gst_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__gst_object_unref0_ (var), NULL)))
#define _gst_structure_free0(var) ((var == NULL) ? NULL : (var = (gst_structure_free (var), NULL)))
typedef struct _RygelParamSpecGstUtils RygelParamSpecGstUtils;

typedef enum  {
	RYGEL_GST_ERROR_MISSING_PLUGIN,
	RYGEL_GST_ERROR_LINK
} RygelGstError;
#define RYGEL_GST_ERROR rygel_gst_error_quark ()
struct _RygelGstUtils {
	GTypeInstance parent_instance;
	volatile int ref_count;
	RygelGstUtilsPrivate * priv;
};

struct _RygelGstUtilsClass {
	GTypeClass parent_class;
	void (*finalize) (RygelGstUtils *self);
};

struct _RygelParamSpecGstUtils {
	GParamSpec parent_instance;
};


static gpointer rygel_gst_utils_parent_class = NULL;

GQuark rygel_gst_error_quark (void);
gpointer rygel_gst_utils_ref (gpointer instance);
void rygel_gst_utils_unref (gpointer instance);
GParamSpec* rygel_param_spec_gst_utils (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void rygel_value_set_gst_utils (GValue* value, gpointer v_object);
void rygel_value_take_gst_utils (GValue* value, gpointer v_object);
gpointer rygel_value_get_gst_utils (const GValue* value);
GType rygel_gst_utils_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_GST_UTILS_DUMMY_PROPERTY
};
GstElement* rygel_gst_utils_create_element (const gchar* factoryname, const gchar* name, GError** error);
GstElement* rygel_gst_utils_create_source_for_uri (const gchar* uri);
static inline void _dynamic_set_blocksize5 (GstElement* obj, glong value);
static inline void _dynamic_set_tcp_timeout6 (GstElement* obj, gint64 value);
void rygel_gst_utils_dump_encoding_profile (GstEncodingProfile* profile, gint indent);
GstElement* rygel_gst_utils_get_rtp_depayloader (GstCaps* caps);
static gboolean rygel_gst_utils_need_rtp_depayloader (GstCaps* caps);
static void _gst_object_unref0_ (gpointer var);
static void _g_list_free__gst_object_unref0_ (GList* self);
RygelGstUtils* rygel_gst_utils_construct (GType object_type);
static void rygel_gst_utils_finalize (RygelGstUtils* obj);


GQuark rygel_gst_error_quark (void) {
	return g_quark_from_static_string ("rygel_gst_error-quark");
}


GstElement* rygel_gst_utils_create_element (const gchar* factoryname, const gchar* name, GError** error) {
	GstElement* result = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GstElement* _tmp2_ = NULL;
	GstElement* element;
	GstElement* _tmp3_;
	GError * _inner_error_ = NULL;
#line 32 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_return_val_if_fail (factoryname != NULL, NULL);
#line 35 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp0_ = factoryname;
#line 35 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp1_ = name;
#line 35 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp2_ = gst_element_factory_make (_tmp0_, _tmp1_);
#line 35 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (_tmp2_ != NULL) {
#line 35 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		gst_object_ref_sink (_tmp2_);
#line 127 "rygel-gst-utils.c"
	}
#line 35 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	element = _tmp2_;
#line 36 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp3_ = element;
#line 36 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (_tmp3_ == NULL) {
#line 135 "rygel-gst-utils.c"
		const gchar* _tmp4_ = NULL;
		const gchar* _tmp5_;
		GError* _tmp6_;
#line 37 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp4_ = _ ("Required element %s missing");
#line 37 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp5_ = factoryname;
#line 37 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp6_ = g_error_new (RYGEL_GST_ERROR, RYGEL_GST_ERROR_MISSING_PLUGIN, _tmp4_, _tmp5_);
#line 37 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_inner_error_ = _tmp6_;
#line 37 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		g_propagate_error (error, _inner_error_);
#line 37 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_gst_object_unref0 (element);
#line 37 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		return NULL;
#line 153 "rygel-gst-utils.c"
	}
#line 42 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	result = element;
#line 42 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	return result;
#line 159 "rygel-gst-utils.c"
}


static inline void _dynamic_set_blocksize5 (GstElement* obj, glong value) {
#line 55 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_object_set (obj, "blocksize", value, NULL);
#line 166 "rygel-gst-utils.c"
}


static inline void _dynamic_set_tcp_timeout6 (GstElement* obj, gint64 value) {
#line 61 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_object_set (obj, "tcp-timeout", value, NULL);
#line 173 "rygel-gst-utils.c"
}


GstElement* rygel_gst_utils_create_source_for_uri (const gchar* uri) {
	GstElement* result = NULL;
	const gchar* _tmp0_;
	GstElement* _tmp1_ = NULL;
	GstElement* src;
	GstElement* _tmp2_;
#line 45 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_return_val_if_fail (uri != NULL, NULL);
#line 46 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp0_ = uri;
#line 46 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp1_ = gst_element_make_from_uri (GST_URI_SRC, _tmp0_, NULL);
#line 46 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (_tmp1_ != NULL) {
#line 46 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		gst_object_ref_sink (_tmp1_);
#line 193 "rygel-gst-utils.c"
	}
#line 46 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	src = _tmp1_;
#line 47 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp2_ = src;
#line 47 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (_tmp2_ != NULL) {
#line 201 "rygel-gst-utils.c"
		GstElement* _tmp3_;
		gboolean _tmp4_ = FALSE;
		GstElement* _tmp6_;
		GObjectClass* _tmp7_ = NULL;
		GParamSpec* _tmp8_ = NULL;
		GstElement* _tmp10_;
		GObjectClass* _tmp11_ = NULL;
		GParamSpec* _tmp12_ = NULL;
#line 48 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp3_ = src;
#line 48 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp4_ = GST_OBJECT_IS_FLOATING ((GstObject*) _tmp3_);
#line 48 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		if (_tmp4_) {
#line 216 "rygel-gst-utils.c"
			GstElement* _tmp5_;
#line 49 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			_tmp5_ = src;
#line 49 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			gst_object_ref_sink ((GstObject*) _tmp5_);
#line 222 "rygel-gst-utils.c"
		}
#line 52 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp6_ = src;
#line 52 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp7_ = G_OBJECT_GET_CLASS ((GObject*) _tmp6_);
#line 52 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp8_ = g_object_class_find_property (_tmp7_, "blocksize");
#line 52 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		if (_tmp8_ != NULL) {
#line 232 "rygel-gst-utils.c"
			GstElement* _tmp9_;
#line 55 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			_tmp9_ = src;
#line 55 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			_dynamic_set_blocksize5 (_tmp9_, (glong) 65536);
#line 238 "rygel-gst-utils.c"
		}
#line 58 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp10_ = src;
#line 58 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp11_ = G_OBJECT_GET_CLASS ((GObject*) _tmp10_);
#line 58 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp12_ = g_object_class_find_property (_tmp11_, "tcp-timeout");
#line 58 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		if (_tmp12_ != NULL) {
#line 248 "rygel-gst-utils.c"
			GstElement* _tmp13_;
#line 61 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			_tmp13_ = src;
#line 61 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			_dynamic_set_tcp_timeout6 (_tmp13_, (gint64) 60000000);
#line 254 "rygel-gst-utils.c"
		}
	}
#line 65 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	result = src;
#line 65 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	return result;
#line 261 "rygel-gst-utils.c"
}


static gpointer _gst_encoding_profile_ref0 (gpointer self) {
#line 79 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	return self ? gst_encoding_profile_ref (self) : NULL;
#line 268 "rygel-gst-utils.c"
}


void rygel_gst_utils_dump_encoding_profile (GstEncodingProfile* profile, gint indent) {
	gint _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* indent_s;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GstEncodingProfile* _tmp5_;
	const gchar* _tmp6_ = NULL;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GstEncodingProfile* _tmp10_;
	GstCaps* _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_;
	GstEncodingProfile* _tmp14_;
	GstCaps* _tmp15_ = NULL;
	GstEncodingProfile* _tmp23_;
#line 68 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_return_if_fail (profile != NULL);
#line 70 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp0_ = indent;
#line 70 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp1_ = g_strnfill ((gsize) _tmp0_, ' ');
#line 70 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	indent_s = _tmp1_;
#line 71 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp2_ = indent_s;
#line 71 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp3_ = g_strconcat (_tmp2_, "%s:", NULL);
#line 71 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp4_ = _tmp3_;
#line 71 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp5_ = profile;
#line 71 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp6_ = gst_encoding_profile_get_name (_tmp5_);
#line 71 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_debug (_tmp4_, _tmp6_);
#line 71 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_g_free0 (_tmp4_);
#line 72 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp7_ = indent_s;
#line 72 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp8_ = g_strconcat (_tmp7_, "  Format: %s", NULL);
#line 72 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp9_ = _tmp8_;
#line 72 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp10_ = profile;
#line 72 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp11_ = gst_encoding_profile_get_format (_tmp10_);
#line 72 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp12_ = gst_caps_to_string (_tmp11_);
#line 72 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp13_ = _tmp12_;
#line 72 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_debug (_tmp9_, _tmp13_);
#line 72 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_g_free0 (_tmp13_);
#line 72 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_g_free0 (_tmp9_);
#line 73 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp14_ = profile;
#line 73 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp15_ = gst_encoding_profile_get_restriction (_tmp14_);
#line 73 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (_tmp15_ != NULL) {
#line 339 "rygel-gst-utils.c"
		const gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		GstEncodingProfile* _tmp19_;
		GstCaps* _tmp20_ = NULL;
		gchar* _tmp21_ = NULL;
		gchar* _tmp22_;
#line 74 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp16_ = indent_s;
#line 74 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp17_ = g_strconcat (_tmp16_, "  Restriction: %s", NULL);
#line 74 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp18_ = _tmp17_;
#line 74 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp19_ = profile;
#line 74 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp20_ = gst_encoding_profile_get_restriction (_tmp19_);
#line 74 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp21_ = gst_caps_to_string (_tmp20_);
#line 74 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp22_ = _tmp21_;
#line 74 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		g_debug (_tmp18_, _tmp22_);
#line 74 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_g_free0 (_tmp22_);
#line 74 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_g_free0 (_tmp18_);
#line 367 "rygel-gst-utils.c"
	}
#line 78 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp23_ = profile;
#line 78 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp23_, GST_TYPE_ENCODING_CONTAINER_PROFILE)) {
#line 373 "rygel-gst-utils.c"
		GstEncodingProfile* _tmp24_;
		GstEncodingContainerProfile* _tmp25_;
		GstEncodingContainerProfile* container;
		GstEncodingContainerProfile* _tmp26_;
		GList* _tmp27_ = NULL;
#line 79 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp24_ = profile;
#line 79 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp25_ = _gst_encoding_profile_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, GST_TYPE_ENCODING_CONTAINER_PROFILE) ? ((GstEncodingContainerProfile*) _tmp24_) : NULL);
#line 79 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		container = _tmp25_;
#line 80 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp26_ = container;
#line 80 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp27_ = gst_encoding_container_profile_get_profiles (_tmp26_);
#line 389 "rygel-gst-utils.c"
		{
			GList* subprofile_collection = NULL;
			GList* subprofile_it = NULL;
#line 80 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			subprofile_collection = _tmp27_;
#line 80 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			for (subprofile_it = subprofile_collection; subprofile_it != NULL; subprofile_it = subprofile_it->next) {
#line 397 "rygel-gst-utils.c"
				GstEncodingProfile* _tmp28_;
				GstEncodingProfile* subprofile = NULL;
#line 80 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
				_tmp28_ = _gst_encoding_profile_ref0 ((GstEncodingProfile*) subprofile_it->data);
#line 80 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
				subprofile = _tmp28_;
#line 404 "rygel-gst-utils.c"
				{
					GstEncodingProfile* _tmp29_;
					gint _tmp30_;
#line 81 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
					_tmp29_ = subprofile;
#line 81 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
					_tmp30_ = indent;
#line 81 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
					rygel_gst_utils_dump_encoding_profile (_tmp29_, _tmp30_ + 4);
#line 80 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
					_gst_encoding_profile_unref0 (subprofile);
#line 416 "rygel-gst-utils.c"
				}
			}
		}
#line 78 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_gst_encoding_profile_unref0 (container);
#line 422 "rygel-gst-utils.c"
	}
#line 68 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_g_free0 (indent_s);
#line 426 "rygel-gst-utils.c"
}


static void _gst_object_unref0_ (gpointer var) {
#line 94 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	(var == NULL) ? NULL : (var = (gst_object_unref (var), NULL));
#line 433 "rygel-gst-utils.c"
}


static void _g_list_free__gst_object_unref0_ (GList* self) {
#line 94 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_list_foreach (self, (GFunc) _gst_object_unref0_, NULL);
#line 94 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_list_free (self);
#line 442 "rygel-gst-utils.c"
}


GstElement* rygel_gst_utils_get_rtp_depayloader (GstCaps* caps) {
	GstElement* result = NULL;
	GstCaps* _tmp0_;
	gboolean _tmp1_ = FALSE;
	GList* _tmp2_ = NULL;
	GList* features;
	GList* _tmp3_;
	GstCaps* _tmp4_;
	GList* _tmp5_ = NULL;
	GList* _tmp6_;
	gconstpointer _tmp7_;
	const gchar* _tmp8_ = NULL;
#line 86 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_return_val_if_fail (caps != NULL, NULL);
#line 87 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp0_ = caps;
#line 87 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp1_ = rygel_gst_utils_need_rtp_depayloader (_tmp0_);
#line 87 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (!_tmp1_) {
#line 88 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		result = NULL;
#line 88 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		return result;
#line 470 "rygel-gst-utils.c"
	}
#line 91 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp2_ = gst_element_factory_list_get_elements ((GstElementFactoryListType) GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER, GST_RANK_NONE);
#line 91 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	features = _tmp2_;
#line 94 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp3_ = features;
#line 94 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp4_ = caps;
#line 94 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp5_ = gst_element_factory_list_filter (_tmp3_, _tmp4_, GST_PAD_SINK, FALSE);
#line 94 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	__g_list_free__gst_object_unref0_0 (features);
#line 94 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	features = _tmp5_;
#line 101 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp6_ = features;
#line 101 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp7_ = _tmp6_->data;
#line 101 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp8_ = gst_plugin_feature_get_name ((GstPluginFeature*) ((GstElementFactory*) _tmp7_));
#line 101 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (g_strcmp0 (_tmp8_, "rtpdepay") == 0) {
#line 494 "rygel-gst-utils.c"
		GList* _tmp9_;
		GList* _tmp10_;
#line 102 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp9_ = features;
#line 102 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp10_ = _tmp9_->next;
#line 102 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		if (_tmp10_ != NULL) {
#line 503 "rygel-gst-utils.c"
			GList* _tmp11_;
			GList* _tmp12_;
			gconstpointer _tmp13_;
			GstElement* _tmp14_ = NULL;
#line 103 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			_tmp11_ = features;
#line 103 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			_tmp12_ = _tmp11_->next;
#line 103 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			_tmp13_ = _tmp12_->data;
#line 103 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			_tmp14_ = gst_element_factory_create ((GstElementFactory*) _tmp13_, NULL);
#line 103 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			if (_tmp14_ != NULL) {
#line 103 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
				gst_object_ref_sink (_tmp14_);
#line 520 "rygel-gst-utils.c"
			}
#line 103 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			result = _tmp14_;
#line 103 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			__g_list_free__gst_object_unref0_0 (features);
#line 103 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			return result;
#line 528 "rygel-gst-utils.c"
		}
#line 106 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		result = NULL;
#line 106 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		__g_list_free__gst_object_unref0_0 (features);
#line 106 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		return result;
#line 536 "rygel-gst-utils.c"
	} else {
		GList* _tmp15_;
		gconstpointer _tmp16_;
		GstElement* _tmp17_ = NULL;
#line 108 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp15_ = features;
#line 108 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp16_ = _tmp15_->data;
#line 108 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		_tmp17_ = gst_element_factory_create ((GstElementFactory*) _tmp16_, NULL);
#line 108 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		if (_tmp17_ != NULL) {
#line 108 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			gst_object_ref_sink (_tmp17_);
#line 551 "rygel-gst-utils.c"
		}
#line 108 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		result = _tmp17_;
#line 108 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		__g_list_free__gst_object_unref0_0 (features);
#line 108 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		return result;
#line 559 "rygel-gst-utils.c"
	}
#line 86 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	__g_list_free__gst_object_unref0_0 (features);
#line 563 "rygel-gst-utils.c"
}


static gpointer _gst_structure_copy0 (gpointer self) {
#line 113 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	return self ? gst_structure_copy (self) : NULL;
#line 570 "rygel-gst-utils.c"
}


static gboolean rygel_gst_utils_need_rtp_depayloader (GstCaps* caps) {
	gboolean result = FALSE;
	GstCaps* _tmp0_;
	const GstStructure* _tmp1_ = NULL;
	GstStructure* _tmp2_;
	GstStructure* structure;
	const gchar* _tmp3_ = NULL;
#line 112 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_return_val_if_fail (caps != NULL, FALSE);
#line 113 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp0_ = caps;
#line 113 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp1_ = gst_caps_get_structure (_tmp0_, (guint) 0);
#line 113 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp2_ = _gst_structure_copy0 (_tmp1_);
#line 113 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	structure = _tmp2_;
#line 115 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_tmp3_ = gst_structure_get_name (structure);
#line 115 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	result = g_strcmp0 (_tmp3_, "application/x-rtp") == 0;
#line 115 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	_gst_structure_free0 (structure);
#line 115 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	return result;
#line 599 "rygel-gst-utils.c"
}


RygelGstUtils* rygel_gst_utils_construct (GType object_type) {
	RygelGstUtils* self = NULL;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	self = (RygelGstUtils*) g_type_create_instance (object_type);
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	return self;
#line 609 "rygel-gst-utils.c"
}


static void rygel_value_gst_utils_init (GValue* value) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	value->data[0].v_pointer = NULL;
#line 616 "rygel-gst-utils.c"
}


static void rygel_value_gst_utils_free_value (GValue* value) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (value->data[0].v_pointer) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		rygel_gst_utils_unref (value->data[0].v_pointer);
#line 625 "rygel-gst-utils.c"
	}
}


static void rygel_value_gst_utils_copy_value (const GValue* src_value, GValue* dest_value) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (src_value->data[0].v_pointer) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		dest_value->data[0].v_pointer = rygel_gst_utils_ref (src_value->data[0].v_pointer);
#line 635 "rygel-gst-utils.c"
	} else {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		dest_value->data[0].v_pointer = NULL;
#line 639 "rygel-gst-utils.c"
	}
}


static gpointer rygel_value_gst_utils_peek_pointer (const GValue* value) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	return value->data[0].v_pointer;
#line 647 "rygel-gst-utils.c"
}


static gchar* rygel_value_gst_utils_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (collect_values[0].v_pointer) {
#line 654 "rygel-gst-utils.c"
		RygelGstUtils* object;
		object = collect_values[0].v_pointer;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		if (object->parent_instance.g_class == NULL) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 661 "rygel-gst-utils.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 665 "rygel-gst-utils.c"
		}
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		value->data[0].v_pointer = rygel_gst_utils_ref (object);
#line 669 "rygel-gst-utils.c"
	} else {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		value->data[0].v_pointer = NULL;
#line 673 "rygel-gst-utils.c"
	}
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	return NULL;
#line 677 "rygel-gst-utils.c"
}


static gchar* rygel_value_gst_utils_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	RygelGstUtils** object_p;
	object_p = collect_values[0].v_pointer;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (!object_p) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 688 "rygel-gst-utils.c"
	}
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (!value->data[0].v_pointer) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		*object_p = NULL;
#line 694 "rygel-gst-utils.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		*object_p = value->data[0].v_pointer;
#line 698 "rygel-gst-utils.c"
	} else {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		*object_p = rygel_gst_utils_ref (value->data[0].v_pointer);
#line 702 "rygel-gst-utils.c"
	}
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	return NULL;
#line 706 "rygel-gst-utils.c"
}


GParamSpec* rygel_param_spec_gst_utils (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	RygelParamSpecGstUtils* spec;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_return_val_if_fail (g_type_is_a (object_type, RYGEL_TYPE_GST_UTILS), NULL);
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	return G_PARAM_SPEC (spec);
#line 720 "rygel-gst-utils.c"
}


gpointer rygel_value_get_gst_utils (const GValue* value) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_TYPE_GST_UTILS), NULL);
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	return value->data[0].v_pointer;
#line 729 "rygel-gst-utils.c"
}


void rygel_value_set_gst_utils (GValue* value, gpointer v_object) {
	RygelGstUtils* old;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_TYPE_GST_UTILS));
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	old = value->data[0].v_pointer;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (v_object) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, RYGEL_TYPE_GST_UTILS));
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		value->data[0].v_pointer = v_object;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		rygel_gst_utils_ref (value->data[0].v_pointer);
#line 749 "rygel-gst-utils.c"
	} else {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		value->data[0].v_pointer = NULL;
#line 753 "rygel-gst-utils.c"
	}
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (old) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		rygel_gst_utils_unref (old);
#line 759 "rygel-gst-utils.c"
	}
}


void rygel_value_take_gst_utils (GValue* value, gpointer v_object) {
	RygelGstUtils* old;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, RYGEL_TYPE_GST_UTILS));
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	old = value->data[0].v_pointer;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (v_object) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, RYGEL_TYPE_GST_UTILS));
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		value->data[0].v_pointer = v_object;
#line 778 "rygel-gst-utils.c"
	} else {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		value->data[0].v_pointer = NULL;
#line 782 "rygel-gst-utils.c"
	}
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (old) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		rygel_gst_utils_unref (old);
#line 788 "rygel-gst-utils.c"
	}
}


static void rygel_gst_utils_class_init (RygelGstUtilsClass * klass) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	rygel_gst_utils_parent_class = g_type_class_peek_parent (klass);
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	RYGEL_GST_UTILS_CLASS (klass)->finalize = rygel_gst_utils_finalize;
#line 798 "rygel-gst-utils.c"
}


static void rygel_gst_utils_instance_init (RygelGstUtils * self) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	self->ref_count = 1;
#line 805 "rygel-gst-utils.c"
}


static void rygel_gst_utils_finalize (RygelGstUtils* obj) {
	RygelGstUtils * self;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_TYPE_GST_UTILS, RygelGstUtils);
#line 813 "rygel-gst-utils.c"
}


GType rygel_gst_utils_get_type (void) {
	static volatile gsize rygel_gst_utils_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_gst_utils_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { rygel_value_gst_utils_init, rygel_value_gst_utils_free_value, rygel_value_gst_utils_copy_value, rygel_value_gst_utils_peek_pointer, "p", rygel_value_gst_utils_collect_value, "p", rygel_value_gst_utils_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (RygelGstUtilsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_gst_utils_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelGstUtils), 0, (GInstanceInitFunc) rygel_gst_utils_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType rygel_gst_utils_type_id;
		rygel_gst_utils_type_id = g_type_register_fundamental (g_type_fundamental_next (), "RygelGstUtils", &g_define_type_info, &g_define_type_fundamental_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&rygel_gst_utils_type_id__volatile, rygel_gst_utils_type_id);
	}
	return rygel_gst_utils_type_id__volatile;
}


gpointer rygel_gst_utils_ref (gpointer instance) {
	RygelGstUtils* self;
	self = instance;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	g_atomic_int_inc (&self->ref_count);
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	return instance;
#line 838 "rygel-gst-utils.c"
}


void rygel_gst_utils_unref (gpointer instance) {
	RygelGstUtils* self;
	self = instance;
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		RYGEL_GST_UTILS_GET_CLASS (self)->finalize (self);
#line 31 "/home/jens/Source/rygel/tests/rygel-gst-utils.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 851 "rygel-gst-utils.c"
	}
}



