/* rygel-gst-launch-item.c generated by valac 0.20.1, the Vala compiler
 * generated from rygel-gst-launch-item.vala, do not modify */

/*
 * Copyright (C) 2009 Thijs Vermeir <thijsvermeir@gmail.com>
 * Copyright (C) 2010 Nokia Corporation.
 *
 * Author: Thijs Vermeir <thijsvermeir@gmail.com>
 * 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 <rygel-server.h>
#include <stdlib.h>
#include <string.h>


#define RYGEL_GST_LAUNCH_TYPE_ITEM (rygel_gst_launch_item_get_type ())
#define RYGEL_GST_LAUNCH_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_GST_LAUNCH_TYPE_ITEM, RygelGstLaunchItem))
#define RYGEL_GST_LAUNCH_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_GST_LAUNCH_TYPE_ITEM))
#define RYGEL_GST_LAUNCH_ITEM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RYGEL_GST_LAUNCH_TYPE_ITEM, RygelGstLaunchItemIface))

typedef struct _RygelGstLaunchItem RygelGstLaunchItem;
typedef struct _RygelGstLaunchItemIface RygelGstLaunchItemIface;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _RygelGstLaunchItemIface {
	GTypeInterface parent_iface;
	const gchar* (*get_launch_line) (RygelGstLaunchItem* self);
	void (*set_launch_line) (RygelGstLaunchItem* self, const gchar* value);
};



GType rygel_gst_launch_item_get_type (void) G_GNUC_CONST;
RygelDataSource* rygel_gst_launch_item_create_source (RygelGstLaunchItem* self);
const gchar* rygel_gst_launch_item_get_launch_line (RygelGstLaunchItem* self);
void rygel_gst_launch_item_set_launch_line (RygelGstLaunchItem* self, const gchar* value);


RygelDataSource* rygel_gst_launch_item_create_source (RygelGstLaunchItem* self) {
	RygelDataSource* result = NULL;
	RygelMediaEngine* _tmp0_ = NULL;
	RygelMediaEngine* engine;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	RygelDataSource* _tmp5_ = NULL;
	RygelDataSource* _tmp6_;
	_tmp0_ = rygel_media_engine_get_default ();
	engine = _tmp0_;
	_tmp1_ = rygel_gst_launch_item_get_launch_line (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strconcat ("gst-launch://", _tmp2_, NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = rygel_media_engine_create_data_source (engine, _tmp4_);
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp4_);
	result = _tmp6_;
	_g_object_unref0 (engine);
	return result;
}


const gchar* rygel_gst_launch_item_get_launch_line (RygelGstLaunchItem* self) {
	g_return_val_if_fail (self != NULL, NULL);
	return RYGEL_GST_LAUNCH_ITEM_GET_INTERFACE (self)->get_launch_line (self);
}


void rygel_gst_launch_item_set_launch_line (RygelGstLaunchItem* self, const gchar* value) {
	g_return_if_fail (self != NULL);
	RYGEL_GST_LAUNCH_ITEM_GET_INTERFACE (self)->set_launch_line (self, value);
}


static void rygel_gst_launch_item_base_init (RygelGstLaunchItemIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
		g_object_interface_install_property (iface, g_param_spec_string ("launch-line", "launch-line", "launch-line", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	}
}


/**
 * Item that serves data from a gst-launch commandline.
 */
GType rygel_gst_launch_item_get_type (void) {
	static volatile gsize rygel_gst_launch_item_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_gst_launch_item_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelGstLaunchItemIface), (GBaseInitFunc) rygel_gst_launch_item_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType rygel_gst_launch_item_type_id;
		rygel_gst_launch_item_type_id = g_type_register_static (G_TYPE_INTERFACE, "RygelGstLaunchItem", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (rygel_gst_launch_item_type_id, RYGEL_TYPE_MEDIA_ITEM);
		g_once_init_leave (&rygel_gst_launch_item_type_id__volatile, rygel_gst_launch_item_type_id);
	}
	return rygel_gst_launch_item_type_id__volatile;
}



