/* test.c generated by valac 0.20.1, the Vala compiler
 * generated from test.vala, do not modify */


#include <glib.h>
#include <glib-object.h>
#include <gst/gst.h>


#define TYPE_TEST (test_get_type ())
#define TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST, Test))
#define TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST, TestClass))
#define IS_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST))
#define IS_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEST))
#define TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEST, TestClass))

typedef struct _Test Test;
typedef struct _TestClass TestClass;
typedef struct _TestPrivate TestPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _Test {
	GObject parent_instance;
	TestPrivate * priv;
};

struct _TestClass {
	GObjectClass parent_class;
};

struct _TestPrivate {
	GstElement* adder;
	GstElement* queue;
	GstPipeline* pipeline;
};


static gpointer test_parent_class = NULL;

GType test_get_type (void) G_GNUC_CONST;
#define TEST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_TEST, TestPrivate))
enum  {
	TEST_DUMMY_PROPERTY
};
void test_test (Test* self);
Test* test_new (void);
Test* test_construct (GType object_type);
static void test_finalize (GObject* obj);


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


void test_test (Test* self) {
	GstPipeline* _tmp0_;
	GstElement* _tmp1_ = NULL;
	GstElement* _tmp2_;
	GstElement* _tmp3_ = NULL;
	GstElement* _tmp4_;
	GstPipeline* _tmp5_;
	GstElement* _tmp6_;
	GstElement* _tmp7_;
	GstElement* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GstPipeline*) gst_pipeline_new ("pipeline");
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->pipeline);
	self->priv->pipeline = _tmp0_;
	_tmp1_ = gst_element_factory_make ("adder", "adder");
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (self->priv->adder);
	self->priv->adder = _tmp2_;
	_tmp3_ = gst_element_factory_make ("queue2", "queue2");
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (self->priv->adder);
	self->priv->adder = _tmp4_;
	_tmp5_ = self->priv->pipeline;
	_tmp6_ = self->priv->adder;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	_tmp8_ = self->priv->queue;
	gst_bin_add_many ((GstBin*) _tmp5_, _tmp7_, _tmp8_, NULL);
}


Test* test_construct (GType object_type) {
	Test * self = NULL;
	self = (Test*) g_object_new (object_type, NULL);
	return self;
}


Test* test_new (void) {
	return test_construct (TYPE_TEST);
}


static void test_class_init (TestClass * klass) {
	test_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (TestPrivate));
	G_OBJECT_CLASS (klass)->finalize = test_finalize;
}


static void test_instance_init (Test * self) {
	self->priv = TEST_GET_PRIVATE (self);
}


static void test_finalize (GObject* obj) {
	Test * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TEST, Test);
	_g_object_unref0 (self->priv->adder);
	_g_object_unref0 (self->priv->queue);
	_g_object_unref0 (self->priv->pipeline);
	G_OBJECT_CLASS (test_parent_class)->finalize (obj);
}


GType test_get_type (void) {
	static volatile gsize test_type_id__volatile = 0;
	if (g_once_init_enter (&test_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (TestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) test_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Test), 0, (GInstanceInitFunc) test_instance_init, NULL };
		GType test_type_id;
		test_type_id = g_type_register_static (G_TYPE_OBJECT, "Test", &g_define_type_info, 0);
		g_once_init_leave (&test_type_id__volatile, test_type_id);
	}
	return test_type_id__volatile;
}



