/* rygel-playbin-renderer-test.c generated by valac 0.48.5, 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-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.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;
enum  {
	RYGEL_PLAYBIN_RENDERER_TEST_0_PROPERTY,
	RYGEL_PLAYBIN_RENDERER_TEST_NUM_PROPERTIES
};
static GParamSpec* rygel_playbin_renderer_test_properties[RYGEL_PLAYBIN_RENDERER_TEST_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (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;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (RygelPlaybinRendererTest, g_object_unref)
gint rygel_playbin_renderer_test_main (gchar** args,
                                       gint 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);
static GType rygel_playbin_renderer_test_get_type_once (void);

gint
rygel_playbin_renderer_test_main (gchar** args,
                                  gint args_length1)
{
	RygelPlaybinRendererTest* test = NULL;
	RygelPlaybinRendererTest* _tmp0_;
	gint result = 0;
	gst_init ((gint*) (&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)
{
	return rygel_playbin_renderer_test_main (argv, argc);
}

void
rygel_playbin_renderer_test_test_with_default_gstplaybin (RygelPlaybinRendererTest* self)
{
	RygelPlaybinRenderer* renderer = NULL;
	RygelPlaybinRenderer* _tmp0_;
	GError* _inner_error0_ = 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_;
		GstElement* _tmp2_;
		GstElement* _tmp3_;
		_tmp1_ = rygel_playbin_player_instance (&_inner_error0_);
		player = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != 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:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (renderer);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		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,
                                        gpointer klass_data)
{
	rygel_playbin_renderer_test_parent_class = g_type_class_peek_parent (klass);
}

static void
rygel_playbin_renderer_test_instance_init (RygelPlaybinRendererTest * self,
                                           gpointer klass)
{
}

/**
 * TODO: This currently just tests instantiation.
 * We should also test how it works somehow.
 */
static GType
rygel_playbin_renderer_test_get_type_once (void)
{
	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);
	return rygel_playbin_renderer_test_type_id;
}

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)) {
		GType rygel_playbin_renderer_test_type_id;
		rygel_playbin_renderer_test_type_id = rygel_playbin_renderer_test_get_type_once ();
		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;
}

