/* rygel-playbin-renderer-test.c generated by valac 0.32.1, the Vala compiler
 * generated from rygel-playbin-renderer-test.vala, do not modify */

/*
 * Copyright (C) 2012 Openismus GmbH
 *
 * Author: Murray Cumming <murrayc@openismus.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.1 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 library; 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 <rygel-renderer-gst.h>


#define RYGEL_TYPE_PLAYBIN_RENDERER_TEST (rygel_playbin_renderer_test_get_type ())
#define RYGEL_PLAYBIN_RENDERER_TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_PLAYBIN_RENDERER_TEST, RygelPlaybinRendererTest))
#define RYGEL_PLAYBIN_RENDERER_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_PLAYBIN_RENDERER_TEST, RygelPlaybinRendererTestClass))
#define RYGEL_IS_PLAYBIN_RENDERER_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_PLAYBIN_RENDERER_TEST))
#define RYGEL_IS_PLAYBIN_RENDERER_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_PLAYBIN_RENDERER_TEST))
#define RYGEL_PLAYBIN_RENDERER_TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_PLAYBIN_RENDERER_TEST, RygelPlaybinRendererTestClass))

typedef struct _RygelPlaybinRendererTest RygelPlaybinRendererTest;
typedef struct _RygelPlaybinRendererTestClass RygelPlaybinRendererTestClass;
typedef struct _RygelPlaybinRendererTestPrivate RygelPlaybinRendererTestPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _RygelPlaybinRendererTest {
	GObject parent_instance;
	RygelPlaybinRendererTestPrivate * priv;
};

struct _RygelPlaybinRendererTestClass {
	GObjectClass parent_class;
};


static gpointer rygel_playbin_renderer_test_parent_class = NULL;

GType rygel_playbin_renderer_test_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_PLAYBIN_RENDERER_TEST_DUMMY_PROPERTY
};
gint rygel_playbin_renderer_test_main (gchar** args, int args_length1);
RygelPlaybinRendererTest* rygel_playbin_renderer_test_new (void);
RygelPlaybinRendererTest* rygel_playbin_renderer_test_construct (GType object_type);
void rygel_playbin_renderer_test_test_with_default_gstplaybin (RygelPlaybinRendererTest* self);


gint rygel_playbin_renderer_test_main (gchar** args, int args_length1) {
	gint result = 0;
	RygelPlaybinRendererTest* test = NULL;
	RygelPlaybinRendererTest* _tmp0_ = NULL;
	gst_init (&args_length1, &args);
	_tmp0_ = rygel_playbin_renderer_test_new ();
	test = _tmp0_;
	rygel_playbin_renderer_test_test_with_default_gstplaybin (test);
	result = 0;
	_g_object_unref0 (test);
	return result;
}


int main (int argc, char ** argv) {
#if !GLIB_CHECK_VERSION (2,35,0)
	g_type_init ();
#endif
	return rygel_playbin_renderer_test_main (argv, argc);
}


void rygel_playbin_renderer_test_test_with_default_gstplaybin (RygelPlaybinRendererTest* self) {
	RygelPlaybinRenderer* renderer = NULL;
	RygelPlaybinRenderer* _tmp0_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = rygel_playbin_renderer_new ("test playbin renderer");
	renderer = _tmp0_;
	_vala_assert (renderer != NULL, "renderer != null");
	{
		RygelPlaybinPlayer* player = NULL;
		RygelPlaybinPlayer* _tmp1_ = NULL;
		GstElement* _tmp2_ = NULL;
		GstElement* _tmp3_ = NULL;
		_tmp1_ = rygel_playbin_player_instance (&_inner_error_);
		player = _tmp1_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp2_ = rygel_playbin_player_get_playbin (player);
		_tmp3_ = _tmp2_;
		_vala_assert (_tmp3_ != NULL, "player.playbin != null");
		_g_object_unref0 (player);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_object_unref0 (renderer);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_g_object_unref0 (renderer);
}


RygelPlaybinRendererTest* rygel_playbin_renderer_test_construct (GType object_type) {
	RygelPlaybinRendererTest * self = NULL;
	self = (RygelPlaybinRendererTest*) g_object_new (object_type, NULL);
	return self;
}


RygelPlaybinRendererTest* rygel_playbin_renderer_test_new (void) {
	return rygel_playbin_renderer_test_construct (RYGEL_TYPE_PLAYBIN_RENDERER_TEST);
}


static void rygel_playbin_renderer_test_class_init (RygelPlaybinRendererTestClass * klass) {
	rygel_playbin_renderer_test_parent_class = g_type_class_peek_parent (klass);
}


static void rygel_playbin_renderer_test_instance_init (RygelPlaybinRendererTest * self) {
}


/**
 * TODO: This currently just tests instantiation.
 * We should also test how it works somehow.
 */
GType rygel_playbin_renderer_test_get_type (void) {
	static volatile gsize rygel_playbin_renderer_test_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_playbin_renderer_test_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelPlaybinRendererTestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_playbin_renderer_test_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelPlaybinRendererTest), 0, (GInstanceInitFunc) rygel_playbin_renderer_test_instance_init, NULL };
		GType rygel_playbin_renderer_test_type_id;
		rygel_playbin_renderer_test_type_id = g_type_register_static (G_TYPE_OBJECT, "RygelPlaybinRendererTest", &g_define_type_info, 0);
		g_once_init_leave (&rygel_playbin_renderer_test_type_id__volatile, rygel_playbin_renderer_test_type_id);
	}
	return rygel_playbin_renderer_test_type_id__volatile;
}



