/* rygel-media-export-dvd-container.c generated by valac 0.30.0.35-2c9e8, the Vala compiler
 * generated from rygel-media-export-dvd-container.vala, do not modify */

/*
 * Copyright (C) 2015 Jens Georg <mail@jensge.org>.
 *
 * 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 <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <libgupnp/gupnp.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <gee.h>
#include <glib/gstdio.h>
#include <libsoup/soup.h>
#include <float.h>
#include <math.h>


#define RYGEL_MEDIA_EXPORT_TYPE_UPDATABLE_OBJECT (rygel_media_export_updatable_object_get_type ())
#define RYGEL_MEDIA_EXPORT_UPDATABLE_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MEDIA_EXPORT_TYPE_UPDATABLE_OBJECT, RygelMediaExportUpdatableObject))
#define RYGEL_MEDIA_EXPORT_IS_UPDATABLE_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MEDIA_EXPORT_TYPE_UPDATABLE_OBJECT))
#define RYGEL_MEDIA_EXPORT_UPDATABLE_OBJECT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RYGEL_MEDIA_EXPORT_TYPE_UPDATABLE_OBJECT, RygelMediaExportUpdatableObjectIface))

typedef struct _RygelMediaExportUpdatableObject RygelMediaExportUpdatableObject;
typedef struct _RygelMediaExportUpdatableObjectIface RygelMediaExportUpdatableObjectIface;

#define RYGEL_MEDIA_EXPORT_TYPE_DVD_CONTAINER (rygel_media_export_dvd_container_get_type ())
#define RYGEL_MEDIA_EXPORT_DVD_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MEDIA_EXPORT_TYPE_DVD_CONTAINER, RygelMediaExportDVDContainer))
#define RYGEL_MEDIA_EXPORT_DVD_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_MEDIA_EXPORT_TYPE_DVD_CONTAINER, RygelMediaExportDVDContainerClass))
#define RYGEL_MEDIA_EXPORT_IS_DVD_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MEDIA_EXPORT_TYPE_DVD_CONTAINER))
#define RYGEL_MEDIA_EXPORT_IS_DVD_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_MEDIA_EXPORT_TYPE_DVD_CONTAINER))
#define RYGEL_MEDIA_EXPORT_DVD_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_MEDIA_EXPORT_TYPE_DVD_CONTAINER, RygelMediaExportDVDContainerClass))

typedef struct _RygelMediaExportDVDContainer RygelMediaExportDVDContainer;
typedef struct _RygelMediaExportDVDContainerClass RygelMediaExportDVDContainerClass;
typedef struct _RygelMediaExportDVDContainerPrivate RygelMediaExportDVDContainerPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmlXPathFreeContext0(var) ((var == NULL) ? NULL : (var = (xmlXPathFreeContext (var), NULL)))
typedef struct _RygelMediaExportDvdContainerGetChildrenData RygelMediaExportDvdContainerGetChildrenData;
typedef struct _RygelMediaExportDvdContainerFindObjectData RygelMediaExportDvdContainerFindObjectData;
typedef struct _RygelMediaExportDvdContainerCommitData RygelMediaExportDvdContainerCommitData;

#define RYGEL_MEDIA_EXPORT_TYPE_MEDIA_CACHE (rygel_media_export_media_cache_get_type ())
#define RYGEL_MEDIA_EXPORT_MEDIA_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MEDIA_EXPORT_TYPE_MEDIA_CACHE, RygelMediaExportMediaCache))
#define RYGEL_MEDIA_EXPORT_MEDIA_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_MEDIA_EXPORT_TYPE_MEDIA_CACHE, RygelMediaExportMediaCacheClass))
#define RYGEL_MEDIA_EXPORT_IS_MEDIA_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MEDIA_EXPORT_TYPE_MEDIA_CACHE))
#define RYGEL_MEDIA_EXPORT_IS_MEDIA_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_MEDIA_EXPORT_TYPE_MEDIA_CACHE))
#define RYGEL_MEDIA_EXPORT_MEDIA_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_MEDIA_EXPORT_TYPE_MEDIA_CACHE, RygelMediaExportMediaCacheClass))

typedef struct _RygelMediaExportMediaCache RygelMediaExportMediaCache;
typedef struct _RygelMediaExportMediaCacheClass RygelMediaExportMediaCacheClass;
typedef struct _RygelMediaExportDvdContainerCommitCustomData RygelMediaExportDvdContainerCommitCustomData;

#define RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK (rygel_media_export_dvd_track_get_type ())
#define RYGEL_MEDIA_EXPORT_DVD_TRACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK, RygelMediaExportDVDTrack))
#define RYGEL_MEDIA_EXPORT_DVD_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK, RygelMediaExportDVDTrackClass))
#define RYGEL_MEDIA_EXPORT_IS_DVD_TRACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK))
#define RYGEL_MEDIA_EXPORT_IS_DVD_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK))
#define RYGEL_MEDIA_EXPORT_DVD_TRACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_MEDIA_EXPORT_TYPE_DVD_TRACK, RygelMediaExportDVDTrackClass))

typedef struct _RygelMediaExportDVDTrack RygelMediaExportDVDTrack;
typedef struct _RygelMediaExportDVDTrackClass RygelMediaExportDVDTrackClass;
typedef struct _Block6Data Block6Data;
#define __vala_SoupURI_free0(var) ((var == NULL) ? NULL : (var = (_vala_SoupURI_free (var), NULL)))

struct _RygelMediaExportUpdatableObjectIface {
	GTypeInterface parent_iface;
	void (*commit_custom) (RygelMediaExportUpdatableObject* self, gboolean override_guarded, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*commit_custom_finish) (RygelMediaExportUpdatableObject* self, GAsyncResult* _res_, GError** error);
};

struct _RygelMediaExportDVDContainer {
	RygelSimpleContainer parent_instance;
	RygelMediaExportDVDContainerPrivate * priv;
};

struct _RygelMediaExportDVDContainerClass {
	RygelSimpleContainerClass parent_class;
};

struct _RygelMediaExportDVDContainerPrivate {
	gchar* _path;
	GUPnPXMLDoc* doc;
};

struct _RygelMediaExportDvdContainerGetChildrenData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelMediaExportDVDContainer* self;
	guint offset;
	guint max_count;
	gchar* sort_criteria;
	GCancellable* cancellable;
	RygelMediaObjects* result;
	RygelMediaObjects* children;
	RygelMediaObjects* _tmp0_;
	xmlXPathContext* context;
	GUPnPXMLDoc* _tmp1_;
	xmlDoc* _tmp2_;
	xmlXPathContext* _tmp3_;
	xmlXPathObject* xpo;
	xmlXPathContext* _tmp4_;
	xmlXPathObject* _tmp5_;
	xmlXPathObject* _tmp6_;
	xmlXPathObjectType _tmp7_;
	xmlXPathObject* _tmp8_;
	gint i;
	gboolean _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	xmlXPathObject* _tmp12_;
	xmlNodeSet* _tmp13_;
	gint _tmp14_;
	xmlNode* node;
	xmlXPathObject* _tmp15_;
	xmlNodeSet* _tmp16_;
	gint _tmp17_;
	xmlNode* _tmp18_;
	RygelMediaFileItem* item;
	gint _tmp19_;
	xmlNode* _tmp20_;
	RygelMediaFileItem* _tmp21_;
	RygelMediaObjects* _tmp22_;
	RygelMediaFileItem* _tmp23_;
	xmlXPathObject* _tmp24_;
};

struct _RygelMediaExportDvdContainerFindObjectData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelMediaExportDVDContainer* self;
	gchar* id;
	GCancellable* cancellable;
	RygelMediaObject* result;
	const gchar* _tmp0_;
	gboolean _tmp1_;
	gchar** parts;
	const gchar* _tmp2_;
	gchar** _tmp3_;
	gchar** _tmp4_;
	gint parts_length1;
	gint _parts_size_;
	gint track;
	gchar** _tmp5_;
	gint _tmp5__length1;
	const gchar* _tmp6_;
	gint _tmp7_;
	xmlXPathContext* context;
	GUPnPXMLDoc* _tmp8_;
	xmlDoc* _tmp9_;
	xmlXPathContext* _tmp10_;
	xmlXPathObject* xpo;
	xmlXPathContext* _tmp11_;
	xmlXPathObject* _tmp12_;
	gboolean _tmp13_;
	xmlXPathObject* _tmp14_;
	xmlXPathObjectType _tmp15_;
	xmlXPathObject* _tmp16_;
	xmlNodeSet* _tmp17_;
	gint _tmp18_;
	gint _tmp19_;
	xmlXPathObject* _tmp20_;
	gchar** _tmp21_;
	gint _tmp21__length1;
	const gchar* _tmp22_;
	RygelMediaFileItem* object;
	gchar** _tmp23_;
	gint _tmp23__length1;
	const gchar* _tmp24_;
	gint _tmp25_;
	xmlXPathObject* _tmp26_;
	xmlNodeSet* _tmp27_;
	gint _tmp28_;
	xmlNode* _tmp29_;
	RygelMediaFileItem* _tmp30_;
	xmlXPathObject* _tmp31_;
};

struct _RygelMediaExportDvdContainerCommitData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelMediaExportDVDContainer* self;
	GError * _inner_error_;
};

struct _RygelMediaExportDvdContainerCommitCustomData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelMediaExportDVDContainer* self;
	gboolean override_guarded;
	RygelMediaExportMediaCache* _tmp0_;
	RygelMediaExportMediaCache* _tmp1_;
	GError * _inner_error_;
};

struct _Block6Data {
	int _ref_count_;
	RygelMediaExportDVDContainer* self;
	RygelMediaExportDVDTrack* item;
	RygelMediaEngine* media_engine;
};


static gpointer rygel_media_export_dvd_container_parent_class = NULL;
static RygelMediaExportUpdatableObjectIface* rygel_media_export_dvd_container_rygel_media_export_updatable_object_parent_iface = NULL;

GType rygel_media_export_updatable_object_get_type (void) G_GNUC_CONST;
GType rygel_media_export_dvd_container_get_type (void) G_GNUC_CONST;
#define RYGEL_MEDIA_EXPORT_DVD_CONTAINER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RYGEL_MEDIA_EXPORT_TYPE_DVD_CONTAINER, RygelMediaExportDVDContainerPrivate))
enum  {
	RYGEL_MEDIA_EXPORT_DVD_CONTAINER_DUMMY_PROPERTY,
	RYGEL_MEDIA_EXPORT_DVD_CONTAINER_PATH
};
#define RYGEL_MEDIA_EXPORT_DVD_CONTAINER_UPNP_CLASS RYGEL_MEDIA_CONTAINER_PLAYLIST ".DVD"
#define RYGEL_MEDIA_EXPORT_DVD_CONTAINER_PREFIX "dvd"
#define RYGEL_MEDIA_EXPORT_DVD_CONTAINER_TRACK_PREFIX "dvd-track"
RygelMediaExportDVDContainer* rygel_media_export_dvd_container_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, const gchar* path);
RygelMediaExportDVDContainer* rygel_media_export_dvd_container_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, const gchar* path);
static void rygel_media_export_dvd_container_real_constructed (GObject* base);
static gchar* rygel_media_export_dvd_container_get_cache_path (RygelMediaExportDVDContainer* self, const gchar* image_path);
const gchar* rygel_media_export_dvd_container_get_path (RygelMediaExportDVDContainer* self);
static void rygel_media_export_dvd_container_real_get_children_data_free (gpointer _data);
static void rygel_media_export_dvd_container_real_get_children (RygelMediaContainer* base, guint offset, guint max_count, const gchar* sort_criteria, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean rygel_media_export_dvd_container_real_get_children_co (RygelMediaExportDvdContainerGetChildrenData* _data_);
static RygelMediaFileItem* rygel_media_export_dvd_container_get_item_for_xml (RygelMediaExportDVDContainer* self, gint track, xmlNode* node);
static void rygel_media_export_dvd_container_real_find_object_data_free (gpointer _data);
static void rygel_media_export_dvd_container_real_find_object (RygelMediaContainer* base, const gchar* id, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean rygel_media_export_dvd_container_real_find_object_co (RygelMediaExportDvdContainerFindObjectData* _data_);
static void rygel_media_export_dvd_container_commit_data_free (gpointer _data);
void rygel_media_export_dvd_container_commit (RygelMediaExportDVDContainer* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void rygel_media_export_dvd_container_commit_finish (RygelMediaExportDVDContainer* self, GAsyncResult* _res_, GError** error);
static gboolean rygel_media_export_dvd_container_commit_co (RygelMediaExportDvdContainerCommitData* _data_);
void rygel_media_export_updatable_object_commit_custom (RygelMediaExportUpdatableObject* self, gboolean override_guarded, GAsyncReadyCallback _callback_, gpointer _user_data_);
void rygel_media_export_updatable_object_commit_custom_finish (RygelMediaExportUpdatableObject* self, GAsyncResult* _res_, GError** error);
static void rygel_media_export_dvd_container_commit_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void rygel_media_export_dvd_container_real_commit_custom_data_free (gpointer _data);
static void rygel_media_export_dvd_container_real_commit_custom (RygelMediaExportUpdatableObject* base, gboolean override_guarded, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean rygel_media_export_dvd_container_real_commit_custom_co (RygelMediaExportDvdContainerCommitCustomData* _data_);
GType rygel_media_export_media_cache_get_type (void) G_GNUC_CONST;
RygelMediaExportMediaCache* rygel_media_export_media_cache_get_default (void);
void rygel_media_export_media_cache_save_container (RygelMediaExportMediaCache* self, RygelMediaContainer* container, GError** error);
static gchar* rygel_media_export_dvd_container_get_track_id (RygelMediaExportDVDContainer* self, gint track);
static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value);
GType rygel_media_export_dvd_track_get_type (void) G_GNUC_CONST;
static Block6Data* block6_data_ref (Block6Data* _data6_);
static void block6_data_unref (void * _userdata_);
RygelMediaExportDVDTrack* rygel_media_export_dvd_track_new (const gchar* id, RygelMediaContainer* parent, const gchar* title);
RygelMediaExportDVDTrack* rygel_media_export_dvd_track_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title);
static void __lambda5_ (Block6Data* _data6_, GObject* obj, GAsyncResult* res);
static void ___lambda5__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void _vala_SoupURI_free (SoupURI* self);
void rygel_media_export_dvd_container_set_path (RygelMediaExportDVDContainer* self, const gchar* value);
static void rygel_media_export_dvd_container_finalize (GObject* obj);
static void _vala_rygel_media_export_dvd_container_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_rygel_media_export_dvd_container_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


RygelMediaExportDVDContainer* rygel_media_export_dvd_container_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, const gchar* path) {
	RygelMediaExportDVDContainer * self = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	RygelMediaContainer* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	g_return_val_if_fail (id != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	_tmp0_ = id;
	_tmp1_ = title;
	_tmp2_ = parent;
	_tmp3_ = path;
	self = (RygelMediaExportDVDContainer*) g_object_new (object_type, "id", _tmp0_, "upnp-class", RYGEL_MEDIA_EXPORT_DVD_CONTAINER_UPNP_CLASS, "title", _tmp1_, "parent", _tmp2_, "child-count", 0, "path", _tmp3_, NULL);
	return self;
}


RygelMediaExportDVDContainer* rygel_media_export_dvd_container_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, const gchar* path) {
	return rygel_media_export_dvd_container_construct (RYGEL_MEDIA_EXPORT_TYPE_DVD_CONTAINER, id, parent, title, path);
}


static void rygel_media_export_dvd_container_real_constructed (GObject* base) {
	RygelMediaExportDVDContainer * self;
	gchar* cache_path = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	xmlDoc* doc = NULL;
	const gchar* _tmp2_ = NULL;
	xmlDoc* _tmp3_ = NULL;
	xmlDoc* _tmp4_ = NULL;
	GUPnPXMLDoc* _tmp5_ = NULL;
	xmlNode* it = NULL;
	xmlDoc* _tmp6_ = NULL;
	xmlNode* _tmp7_ = NULL;
	xmlNode* _tmp8_ = NULL;
	gint child_count = 0;
	gint _tmp20_ = 0;
	self = (RygelMediaExportDVDContainer*) base;
	G_OBJECT_CLASS (rygel_media_export_dvd_container_parent_class)->constructed ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_SIMPLE_CONTAINER, RygelSimpleContainer));
	_tmp0_ = self->priv->_path;
	_tmp1_ = rygel_media_export_dvd_container_get_cache_path (self, _tmp0_);
	cache_path = _tmp1_;
	_tmp2_ = cache_path;
	_tmp3_ = xmlReadFile (_tmp2_, NULL, (gint) (XML_PARSE_NOERROR | XML_PARSE_NOWARNING));
	doc = _tmp3_;
	_tmp4_ = doc;
	_tmp5_ = gupnp_xml_doc_new (_tmp4_);
	_g_object_unref0 (self->priv->doc);
	self->priv->doc = _tmp5_;
	_tmp6_ = doc;
	_tmp7_ = xmlDocGetRootElement (_tmp6_);
	_tmp8_ = _tmp7_->children;
	it = _tmp8_;
	child_count = 0;
	while (TRUE) {
		xmlNode* _tmp9_ = NULL;
		xmlNode* _tmp10_ = NULL;
		const gchar* _tmp11_ = NULL;
		xmlNode* _tmp18_ = NULL;
		xmlNode* _tmp19_ = NULL;
		_tmp9_ = it;
		if (!(_tmp9_ != NULL)) {
			break;
		}
		_tmp10_ = it;
		_tmp11_ = _tmp10_->name;
		if (g_strcmp0 (_tmp11_, "title") == 0) {
			xmlNode* _tmp12_ = NULL;
			xmlNode* _tmp13_ = NULL;
			const gchar* _tmp14_ = NULL;
			_tmp12_ = it;
			_tmp13_ = _tmp12_->children;
			_tmp14_ = _tmp13_->content;
			rygel_media_object_set_title ((RygelMediaObject*) self, _tmp14_);
		} else {
			xmlNode* _tmp15_ = NULL;
			const gchar* _tmp16_ = NULL;
			_tmp15_ = it;
			_tmp16_ = _tmp15_->name;
			if (g_strcmp0 (_tmp16_, "track") == 0) {
				gint _tmp17_ = 0;
				_tmp17_ = child_count;
				child_count = _tmp17_ + 1;
			}
		}
		_tmp18_ = it;
		_tmp19_ = _tmp18_->next;
		it = _tmp19_;
	}
	_tmp20_ = child_count;
	rygel_media_container_set_child_count ((RygelMediaContainer*) self, _tmp20_);
	_g_free0 (cache_path);
}


static void rygel_media_export_dvd_container_real_get_children_data_free (gpointer _data) {
	RygelMediaExportDvdContainerGetChildrenData* _data_;
	_data_ = _data;
	_g_free0 (_data_->sort_criteria);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (RygelMediaExportDvdContainerGetChildrenData, _data_);
}


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


static void rygel_media_export_dvd_container_real_get_children (RygelMediaContainer* base, guint offset, guint max_count, const gchar* sort_criteria, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelMediaExportDVDContainer * self;
	RygelMediaExportDvdContainerGetChildrenData* _data_;
	RygelMediaExportDVDContainer* _tmp0_ = NULL;
	guint _tmp1_ = 0U;
	guint _tmp2_ = 0U;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	GCancellable* _tmp5_ = NULL;
	GCancellable* _tmp6_ = NULL;
	self = (RygelMediaExportDVDContainer*) base;
	_data_ = g_slice_new0 (RygelMediaExportDvdContainerGetChildrenData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rygel_media_export_dvd_container_real_get_children);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_media_export_dvd_container_real_get_children_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = offset;
	_data_->offset = _tmp1_;
	_tmp2_ = max_count;
	_data_->max_count = _tmp2_;
	_tmp3_ = sort_criteria;
	_tmp4_ = g_strdup (_tmp3_);
	_g_free0 (_data_->sort_criteria);
	_data_->sort_criteria = _tmp4_;
	_tmp5_ = cancellable;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp6_;
	rygel_media_export_dvd_container_real_get_children_co (_data_);
}


static RygelMediaObjects* rygel_media_export_dvd_container_real_get_children_finish (RygelMediaContainer* base, GAsyncResult* _res_, GError** error) {
	RygelMediaObjects* result;
	RygelMediaExportDvdContainerGetChildrenData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static gboolean rygel_media_export_dvd_container_real_get_children_co (RygelMediaExportDvdContainerGetChildrenData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = rygel_media_objects_new ();
	_data_->children = _data_->_tmp0_;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->self->priv->doc;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = _data_->_tmp1_->doc;
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = xmlXPathNewContext (_data_->_tmp2_);
	_data_->context = _data_->_tmp3_;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _data_->context;
	_data_->_tmp5_ = NULL;
	_data_->_tmp5_ = xmlXPathEval ((xmlChar*) "/lsdvd/track", _data_->_tmp4_);
	_data_->xpo = _data_->_tmp5_;
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = _data_->xpo;
	_data_->_tmp7_ = 0;
	_data_->_tmp7_ = _data_->_tmp6_->type;
	if (_data_->_tmp7_ != XPATH_NODESET) {
		_data_->_tmp8_ = NULL;
		_data_->_tmp8_ = _data_->xpo;
		xmlXPathFreeObject (_data_->_tmp8_);
		g_warning ("rygel-media-export-dvd-container.vala:82: No tracks found in DVD");
		_data_->result = _data_->children;
		_xmlXPathFreeContext0 (_data_->context);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->i = 0;
		{
			_data_->_tmp9_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp9_) {
					_data_->_tmp10_ = 0;
					_data_->_tmp10_ = _data_->i;
					_data_->i = _data_->_tmp10_ + 1;
				}
				_data_->_tmp9_ = FALSE;
				_data_->_tmp11_ = 0;
				_data_->_tmp11_ = _data_->i;
				_data_->_tmp12_ = NULL;
				_data_->_tmp12_ = _data_->xpo;
				_data_->_tmp13_ = NULL;
				_data_->_tmp13_ = _data_->_tmp12_->nodesetval;
				_data_->_tmp14_ = 0;
				_data_->_tmp14_ = xmlXPathNodeSetGetLength (_data_->_tmp13_);
				if (!(_data_->_tmp11_ < _data_->_tmp14_)) {
					break;
				}
				_data_->_tmp15_ = NULL;
				_data_->_tmp15_ = _data_->xpo;
				_data_->_tmp16_ = NULL;
				_data_->_tmp16_ = _data_->_tmp15_->nodesetval;
				_data_->_tmp17_ = 0;
				_data_->_tmp17_ = _data_->i;
				_data_->_tmp18_ = NULL;
				_data_->_tmp18_ = xmlXPathNodeSetItem (_data_->_tmp16_, _data_->_tmp17_);
				_data_->node = _data_->_tmp18_;
				_data_->_tmp19_ = 0;
				_data_->_tmp19_ = _data_->i;
				_data_->_tmp20_ = NULL;
				_data_->_tmp20_ = _data_->node;
				_data_->_tmp21_ = NULL;
				_data_->_tmp21_ = rygel_media_export_dvd_container_get_item_for_xml (_data_->self, _data_->_tmp19_, _data_->_tmp20_);
				_data_->item = _data_->_tmp21_;
				_data_->_tmp22_ = NULL;
				_data_->_tmp22_ = _data_->children;
				_data_->_tmp23_ = NULL;
				_data_->_tmp23_ = _data_->item;
				gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp22_, (RygelMediaObject*) _data_->_tmp23_);
				_g_object_unref0 (_data_->item);
			}
		}
	}
	_data_->_tmp24_ = NULL;
	_data_->_tmp24_ = _data_->xpo;
	xmlXPathFreeObject (_data_->_tmp24_);
	_data_->result = _data_->children;
	_xmlXPathFreeContext0 (_data_->context);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_xmlXPathFreeContext0 (_data_->context);
	_g_object_unref0 (_data_->children);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void rygel_media_export_dvd_container_real_find_object_data_free (gpointer _data) {
	RygelMediaExportDvdContainerFindObjectData* _data_;
	_data_ = _data;
	_g_free0 (_data_->id);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (RygelMediaExportDvdContainerFindObjectData, _data_);
}


static void rygel_media_export_dvd_container_real_find_object (RygelMediaContainer* base, const gchar* id, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelMediaExportDVDContainer * self;
	RygelMediaExportDvdContainerFindObjectData* _data_;
	RygelMediaExportDVDContainer* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	GCancellable* _tmp3_ = NULL;
	GCancellable* _tmp4_ = NULL;
	self = (RygelMediaExportDVDContainer*) base;
	_data_ = g_slice_new0 (RygelMediaExportDvdContainerFindObjectData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rygel_media_export_dvd_container_real_find_object);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_media_export_dvd_container_real_find_object_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = id;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (_data_->id);
	_data_->id = _tmp2_;
	_tmp3_ = cancellable;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp4_;
	rygel_media_export_dvd_container_real_find_object_co (_data_);
}


static RygelMediaObject* rygel_media_export_dvd_container_real_find_object_finish (RygelMediaContainer* base, GAsyncResult* _res_, GError** error) {
	RygelMediaObject* result;
	RygelMediaExportDvdContainerFindObjectData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static gboolean rygel_media_export_dvd_container_real_find_object_co (RygelMediaExportDvdContainerFindObjectData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = _data_->id;
	_data_->_tmp1_ = FALSE;
	_data_->_tmp1_ = g_str_has_prefix (_data_->_tmp0_, RYGEL_MEDIA_EXPORT_DVD_CONTAINER_TRACK_PREFIX);
	if (!_data_->_tmp1_) {
		_data_->result = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = _data_->id;
	_data_->_tmp3_ = NULL;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = _data_->_tmp3_ = g_strsplit (_data_->_tmp2_, ":", 0);
	_data_->parts_length1 = 0;
	_data_->_parts_size_ = 0;
	_data_->parts = _data_->_tmp4_;
	_data_->parts_length1 = _vala_array_length (_data_->_tmp3_);
	_data_->_parts_size_ = _data_->parts_length1;
	_data_->_tmp5_ = NULL;
	_data_->_tmp5__length1 = 0;
	_data_->_tmp5_ = _data_->parts;
	_data_->_tmp5__length1 = _data_->parts_length1;
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = _data_->_tmp5_[2];
	_data_->_tmp7_ = 0;
	_data_->_tmp7_ = atoi (_data_->_tmp6_);
	_data_->track = _data_->_tmp7_;
	_data_->_tmp8_ = NULL;
	_data_->_tmp8_ = _data_->self->priv->doc;
	_data_->_tmp9_ = NULL;
	_data_->_tmp9_ = _data_->_tmp8_->doc;
	_data_->_tmp10_ = NULL;
	_data_->_tmp10_ = xmlXPathNewContext (_data_->_tmp9_);
	_data_->context = _data_->_tmp10_;
	_data_->_tmp11_ = NULL;
	_data_->_tmp11_ = _data_->context;
	_data_->_tmp12_ = NULL;
	_data_->_tmp12_ = xmlXPathEval ((xmlChar*) "/lsdvd/track", _data_->_tmp11_);
	_data_->xpo = _data_->_tmp12_;
	_data_->_tmp14_ = NULL;
	_data_->_tmp14_ = _data_->xpo;
	_data_->_tmp15_ = 0;
	_data_->_tmp15_ = _data_->_tmp14_->type;
	if (_data_->_tmp15_ == XPATH_NODESET) {
		_data_->_tmp16_ = NULL;
		_data_->_tmp16_ = _data_->xpo;
		_data_->_tmp17_ = NULL;
		_data_->_tmp17_ = _data_->_tmp16_->nodesetval;
		_data_->_tmp18_ = 0;
		_data_->_tmp18_ = xmlXPathNodeSetGetLength (_data_->_tmp17_);
		_data_->_tmp19_ = 0;
		_data_->_tmp19_ = _data_->track;
		_data_->_tmp13_ = _data_->_tmp18_ >= _data_->_tmp19_;
	} else {
		_data_->_tmp13_ = FALSE;
	}
	if (!_data_->_tmp13_) {
		_data_->_tmp20_ = NULL;
		_data_->_tmp20_ = _data_->xpo;
		xmlXPathFreeObject (_data_->_tmp20_);
		_data_->_tmp21_ = NULL;
		_data_->_tmp21__length1 = 0;
		_data_->_tmp21_ = _data_->parts;
		_data_->_tmp21__length1 = _data_->parts_length1;
		_data_->_tmp22_ = NULL;
		_data_->_tmp22_ = _data_->_tmp21_[2];
		g_warning ("rygel-media-export-dvd-container.vala:113: No track %s in DVD", _data_->_tmp22_);
		_data_->result = NULL;
		_xmlXPathFreeContext0 (_data_->context);
		_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp23_ = NULL;
	_data_->_tmp23__length1 = 0;
	_data_->_tmp23_ = _data_->parts;
	_data_->_tmp23__length1 = _data_->parts_length1;
	_data_->_tmp24_ = NULL;
	_data_->_tmp24_ = _data_->_tmp23_[2];
	_data_->_tmp25_ = 0;
	_data_->_tmp25_ = atoi (_data_->_tmp24_);
	_data_->_tmp26_ = NULL;
	_data_->_tmp26_ = _data_->xpo;
	_data_->_tmp27_ = NULL;
	_data_->_tmp27_ = _data_->_tmp26_->nodesetval;
	_data_->_tmp28_ = 0;
	_data_->_tmp28_ = _data_->track;
	_data_->_tmp29_ = NULL;
	_data_->_tmp29_ = xmlXPathNodeSetItem (_data_->_tmp27_, _data_->_tmp28_);
	_data_->_tmp30_ = NULL;
	_data_->_tmp30_ = rygel_media_export_dvd_container_get_item_for_xml (_data_->self, _data_->_tmp25_, _data_->_tmp29_);
	_data_->object = _data_->_tmp30_;
	_data_->_tmp31_ = NULL;
	_data_->_tmp31_ = _data_->xpo;
	xmlXPathFreeObject (_data_->_tmp31_);
	_data_->result = (RygelMediaObject*) _data_->object;
	_xmlXPathFreeContext0 (_data_->context);
	_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->object);
	_xmlXPathFreeContext0 (_data_->context);
	_data_->parts = (_vala_array_free (_data_->parts, _data_->parts_length1, (GDestroyNotify) g_free), NULL);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static gchar* rygel_media_export_dvd_container_get_cache_path (RygelMediaExportDVDContainer* self, const gchar* image_path) {
	gchar* result = NULL;
	const gchar* user_cache = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* id = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gchar* cache_folder = NULL;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (image_path != NULL, NULL);
	_tmp0_ = g_get_user_cache_dir ();
	user_cache = _tmp0_;
	_tmp1_ = image_path;
	_tmp2_ = g_compute_checksum_for_string (G_CHECKSUM_MD5, _tmp1_, (gsize) -1);
	id = _tmp2_;
	_tmp3_ = g_build_filename (user_cache, "rygel", "dvd-content", NULL);
	cache_folder = _tmp3_;
	g_mkdir_with_parents (cache_folder, 0700);
	_tmp4_ = g_build_filename (cache_folder, id, NULL);
	result = _tmp4_;
	_g_free0 (cache_folder);
	_g_free0 (id);
	return result;
}


static void rygel_media_export_dvd_container_commit_data_free (gpointer _data) {
	RygelMediaExportDvdContainerCommitData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (RygelMediaExportDvdContainerCommitData, _data_);
}


void rygel_media_export_dvd_container_commit (RygelMediaExportDVDContainer* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelMediaExportDvdContainerCommitData* _data_;
	RygelMediaExportDVDContainer* _tmp0_ = NULL;
	_data_ = g_slice_new0 (RygelMediaExportDvdContainerCommitData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rygel_media_export_dvd_container_commit);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_media_export_dvd_container_commit_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	rygel_media_export_dvd_container_commit_co (_data_);
}


void rygel_media_export_dvd_container_commit_finish (RygelMediaExportDVDContainer* self, GAsyncResult* _res_, GError** error) {
	RygelMediaExportDvdContainerCommitData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void rygel_media_export_dvd_container_commit_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RygelMediaExportDvdContainerCommitData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	rygel_media_export_dvd_container_commit_co (_data_);
}


static gboolean rygel_media_export_dvd_container_commit_co (RygelMediaExportDvdContainerCommitData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	rygel_media_export_updatable_object_commit_custom ((RygelMediaExportUpdatableObject*) _data_->self, TRUE, rygel_media_export_dvd_container_commit_ready, _data_);
	return FALSE;
	_state_1:
	rygel_media_export_updatable_object_commit_custom_finish ((RygelMediaExportUpdatableObject*) _data_->self, _data_->_res_, &_data_->_inner_error_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void rygel_media_export_dvd_container_real_commit_custom_data_free (gpointer _data) {
	RygelMediaExportDvdContainerCommitCustomData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (RygelMediaExportDvdContainerCommitCustomData, _data_);
}


static void rygel_media_export_dvd_container_real_commit_custom (RygelMediaExportUpdatableObject* base, gboolean override_guarded, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelMediaExportDVDContainer * self;
	RygelMediaExportDvdContainerCommitCustomData* _data_;
	RygelMediaExportDVDContainer* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	self = (RygelMediaExportDVDContainer*) base;
	_data_ = g_slice_new0 (RygelMediaExportDvdContainerCommitCustomData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rygel_media_export_dvd_container_real_commit_custom);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_media_export_dvd_container_real_commit_custom_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = override_guarded;
	_data_->override_guarded = _tmp1_;
	rygel_media_export_dvd_container_real_commit_custom_co (_data_);
}


static void rygel_media_export_dvd_container_real_commit_custom_finish (RygelMediaExportUpdatableObject* base, GAsyncResult* _res_, GError** error) {
	RygelMediaExportDvdContainerCommitCustomData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gboolean rygel_media_export_dvd_container_real_commit_custom_co (RygelMediaExportDvdContainerCommitCustomData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = rygel_media_export_media_cache_get_default ();
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->_tmp0_;
	rygel_media_export_media_cache_save_container (_data_->_tmp1_, (RygelMediaContainer*) _data_->self, &_data_->_inner_error_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void _vala_array_add1 (gchar*** array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static gchar* _vala_g_strjoinv (const gchar* separator, gchar** str_array, int str_array_length1) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	_tmp0_ = separator;
	if (_tmp0_ == NULL) {
		separator = "";
	}
	_tmp3_ = str_array;
	_tmp3__length1 = str_array_length1;
	if (_tmp3_ != NULL) {
		_tmp2_ = TRUE;
	} else {
		gchar** _tmp4_ = NULL;
		gint _tmp4__length1 = 0;
		_tmp4_ = str_array;
		_tmp4__length1 = str_array_length1;
		_tmp2_ = _tmp4__length1 > 0;
	}
	if (_tmp2_) {
		_tmp1_ = TRUE;
	} else {
		gboolean _tmp5_ = FALSE;
		gchar** _tmp6_ = NULL;
		gint _tmp6__length1 = 0;
		_tmp6_ = str_array;
		_tmp6__length1 = str_array_length1;
		if (_tmp6__length1 == -1) {
			gchar** _tmp7_ = NULL;
			gint _tmp7__length1 = 0;
			const gchar* _tmp8_ = NULL;
			_tmp7_ = str_array;
			_tmp7__length1 = str_array_length1;
			_tmp8_ = _tmp7_[0];
			_tmp5_ = _tmp8_ != NULL;
		} else {
			_tmp5_ = FALSE;
		}
		_tmp1_ = _tmp5_;
	}
	if (_tmp1_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp31_ = 0;
		gint _tmp33_ = 0;
		gint _tmp34_ = 0;
		gsize _tmp35_ = 0UL;
		const gchar* _tmp36_ = NULL;
		gint _tmp37_ = 0;
		gint _tmp38_ = 0;
		gint _tmp39_ = 0;
		const gchar* res = NULL;
		gsize _tmp40_ = 0UL;
		void* _tmp41_ = NULL;
		void* ptr = NULL;
		const gchar* _tmp42_ = NULL;
		gchar** _tmp43_ = NULL;
		gint _tmp43__length1 = 0;
		const gchar* _tmp44_ = NULL;
		void* _tmp45_ = NULL;
		const gchar* _tmp62_ = NULL;
		len = (gsize) 1;
		{
			gboolean _tmp9_ = FALSE;
			i = 0;
			_tmp9_ = TRUE;
			while (TRUE) {
				gboolean _tmp11_ = FALSE;
				gboolean _tmp12_ = FALSE;
				gchar** _tmp13_ = NULL;
				gint _tmp13__length1 = 0;
				gint _tmp21_ = 0;
				gchar** _tmp22_ = NULL;
				gint _tmp22__length1 = 0;
				gint _tmp23_ = 0;
				const gchar* _tmp24_ = NULL;
				gsize _tmp30_ = 0UL;
				if (!_tmp9_) {
					gint _tmp10_ = 0;
					_tmp10_ = i;
					i = _tmp10_ + 1;
				}
				_tmp9_ = FALSE;
				_tmp13_ = str_array;
				_tmp13__length1 = str_array_length1;
				if (_tmp13__length1 != -1) {
					gint _tmp14_ = 0;
					gchar** _tmp15_ = NULL;
					gint _tmp15__length1 = 0;
					_tmp14_ = i;
					_tmp15_ = str_array;
					_tmp15__length1 = str_array_length1;
					_tmp12_ = _tmp14_ < _tmp15__length1;
				} else {
					_tmp12_ = FALSE;
				}
				if (_tmp12_) {
					_tmp11_ = TRUE;
				} else {
					gboolean _tmp16_ = FALSE;
					gchar** _tmp17_ = NULL;
					gint _tmp17__length1 = 0;
					_tmp17_ = str_array;
					_tmp17__length1 = str_array_length1;
					if (_tmp17__length1 == -1) {
						gchar** _tmp18_ = NULL;
						gint _tmp18__length1 = 0;
						gint _tmp19_ = 0;
						const gchar* _tmp20_ = NULL;
						_tmp18_ = str_array;
						_tmp18__length1 = str_array_length1;
						_tmp19_ = i;
						_tmp20_ = _tmp18_[_tmp19_];
						_tmp16_ = _tmp20_ != NULL;
					} else {
						_tmp16_ = FALSE;
					}
					_tmp11_ = _tmp16_;
				}
				if (!_tmp11_) {
					break;
				}
				_tmp22_ = str_array;
				_tmp22__length1 = str_array_length1;
				_tmp23_ = i;
				_tmp24_ = _tmp22_[_tmp23_];
				if (_tmp24_ != NULL) {
					gchar** _tmp25_ = NULL;
					gint _tmp25__length1 = 0;
					gint _tmp26_ = 0;
					const gchar* _tmp27_ = NULL;
					gint _tmp28_ = 0;
					gint _tmp29_ = 0;
					_tmp25_ = str_array;
					_tmp25__length1 = str_array_length1;
					_tmp26_ = i;
					_tmp27_ = _tmp25_[_tmp26_];
					_tmp28_ = strlen ((const gchar*) _tmp27_);
					_tmp29_ = _tmp28_;
					_tmp21_ = _tmp29_;
				} else {
					_tmp21_ = 0;
				}
				_tmp30_ = len;
				len = _tmp30_ + _tmp21_;
			}
		}
		_tmp31_ = i;
		if (_tmp31_ == 0) {
			gchar* _tmp32_ = NULL;
			_tmp32_ = g_strdup ("");
			result = _tmp32_;
			return result;
		}
		_tmp33_ = i;
		str_array_length1 = _tmp33_;
		_tmp34_ = str_array_length1;
		_tmp35_ = len;
		_tmp36_ = separator;
		_tmp37_ = strlen ((const gchar*) _tmp36_);
		_tmp38_ = _tmp37_;
		_tmp39_ = i;
		len = _tmp35_ + (_tmp38_ * (_tmp39_ - 1));
		_tmp40_ = len;
		_tmp41_ = g_malloc (_tmp40_);
		res = _tmp41_;
		_tmp42_ = res;
		_tmp43_ = str_array;
		_tmp43__length1 = str_array_length1;
		_tmp44_ = _tmp43_[0];
		_tmp45_ = g_stpcpy ((void*) _tmp42_, (const gchar*) _tmp44_);
		ptr = _tmp45_;
		{
			gboolean _tmp46_ = FALSE;
			i = 1;
			_tmp46_ = TRUE;
			while (TRUE) {
				gint _tmp48_ = 0;
				gchar** _tmp49_ = NULL;
				gint _tmp49__length1 = 0;
				void* _tmp50_ = NULL;
				const gchar* _tmp51_ = NULL;
				void* _tmp52_ = NULL;
				const gchar* _tmp53_ = NULL;
				gchar** _tmp54_ = NULL;
				gint _tmp54__length1 = 0;
				gint _tmp55_ = 0;
				const gchar* _tmp56_ = NULL;
				void* _tmp60_ = NULL;
				void* _tmp61_ = NULL;
				if (!_tmp46_) {
					gint _tmp47_ = 0;
					_tmp47_ = i;
					i = _tmp47_ + 1;
				}
				_tmp46_ = FALSE;
				_tmp48_ = i;
				_tmp49_ = str_array;
				_tmp49__length1 = str_array_length1;
				if (!(_tmp48_ < _tmp49__length1)) {
					break;
				}
				_tmp50_ = ptr;
				_tmp51_ = separator;
				_tmp52_ = g_stpcpy (_tmp50_, (const gchar*) _tmp51_);
				ptr = _tmp52_;
				_tmp54_ = str_array;
				_tmp54__length1 = str_array_length1;
				_tmp55_ = i;
				_tmp56_ = _tmp54_[_tmp55_];
				if (_tmp56_ != NULL) {
					gchar** _tmp57_ = NULL;
					gint _tmp57__length1 = 0;
					gint _tmp58_ = 0;
					const gchar* _tmp59_ = NULL;
					_tmp57_ = str_array;
					_tmp57__length1 = str_array_length1;
					_tmp58_ = i;
					_tmp59_ = _tmp57_[_tmp58_];
					_tmp53_ = (const gchar*) _tmp59_;
				} else {
					_tmp53_ = "";
				}
				_tmp60_ = ptr;
				_tmp61_ = g_stpcpy (_tmp60_, _tmp53_);
				ptr = _tmp61_;
			}
		}
		_tmp62_ = res;
		res = NULL;
		result = (gchar*) _tmp62_;
		return result;
	} else {
		gchar* _tmp63_ = NULL;
		_tmp63_ = g_strdup ("");
		result = _tmp63_;
		return result;
	}
}


static gchar* rygel_media_export_dvd_container_get_track_id (RygelMediaExportDVDContainer* self, gint track) {
	gchar* result = NULL;
	gchar** parts = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gchar** _tmp3_ = NULL;
	gint parts_length1 = 0;
	gint _parts_size_ = 0;
	gchar** _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	gchar* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar** _tmp7_ = NULL;
	gint _tmp7__length1 = 0;
	gint _tmp8_ = 0;
	gchar* _tmp9_ = NULL;
	gchar** _tmp10_ = NULL;
	gint _tmp10__length1 = 0;
	gchar* _tmp11_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = rygel_media_object_get_id ((RygelMediaObject*) self);
	_tmp1_ = _tmp0_;
	_tmp3_ = _tmp2_ = g_strsplit (_tmp1_, ":", 0);
	parts = _tmp3_;
	parts_length1 = _vala_array_length (_tmp2_);
	_parts_size_ = parts_length1;
	_tmp4_ = parts;
	_tmp4__length1 = parts_length1;
	_tmp5_ = g_strdup ("dvd-track");
	_g_free0 (_tmp4_[0]);
	_tmp4_[0] = _tmp5_;
	_tmp6_ = _tmp4_[0];
	_tmp7_ = parts;
	_tmp7__length1 = parts_length1;
	_tmp8_ = track;
	_tmp9_ = g_strdup_printf ("%i", _tmp8_);
	_vala_array_add1 (&parts, &parts_length1, &_parts_size_, _tmp9_);
	_tmp10_ = parts;
	_tmp10__length1 = parts_length1;
	_tmp11_ = _vala_g_strjoinv (":", _tmp10_, _tmp10__length1);
	result = _tmp11_;
	parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
	return result;
}


static Block6Data* block6_data_ref (Block6Data* _data6_) {
	g_atomic_int_inc (&_data6_->_ref_count_);
	return _data6_;
}


static void block6_data_unref (void * _userdata_) {
	Block6Data* _data6_;
	_data6_ = (Block6Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
		RygelMediaExportDVDContainer* self;
		self = _data6_->self;
		_g_object_unref0 (_data6_->media_engine);
		_g_object_unref0 (_data6_->item);
		_g_object_unref0 (self);
		g_slice_free (Block6Data, _data6_);
	}
}


static gdouble double_parse (const gchar* str) {
	gdouble result = 0.0;
	const gchar* _tmp0_ = NULL;
	gdouble _tmp1_ = 0.0;
	g_return_val_if_fail (str != NULL, 0.0);
	_tmp0_ = str;
	_tmp1_ = g_ascii_strtod (_tmp0_, NULL);
	result = _tmp1_;
	return result;
}


static void __lambda5_ (Block6Data* _data6_, GObject* obj, GAsyncResult* res) {
	RygelMediaExportDVDContainer* self;
	GeeList* added_resources = NULL;
	GAsyncResult* _tmp0_ = NULL;
	GeeList* _tmp1_ = NULL;
	GeeList* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	RygelMediaExportDVDTrack* _tmp5_ = NULL;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	RygelMediaExportDVDTrack* _tmp22_ = NULL;
	GeeList* _tmp23_ = NULL;
	GeeList* _tmp24_ = NULL;
	GeeList* _tmp25_ = NULL;
	self = _data6_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = res;
	_tmp1_ = rygel_media_engine_get_resources_for_item_finish (_data6_->media_engine, _tmp0_);
	added_resources = _tmp1_;
	_tmp2_ = added_resources;
	_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _data6_->item;
	_tmp6_ = rygel_media_object_get_primary_uri ((RygelMediaObject*) _tmp5_);
	_tmp7_ = _tmp6_;
	g_debug ("rygel-media-export-dvd-container.vala:183: Adding %d resources to item" \
" source %s", _tmp4_, _tmp7_);
	_g_free0 (_tmp7_);
	{
		GeeList* _resrc_list = NULL;
		GeeList* _tmp8_ = NULL;
		GeeList* _tmp9_ = NULL;
		gint _resrc_size = 0;
		GeeList* _tmp10_ = NULL;
		gint _tmp11_ = 0;
		gint _tmp12_ = 0;
		gint _resrc_index = 0;
		_tmp8_ = added_resources;
		_tmp9_ = _g_object_ref0 (_tmp8_);
		_resrc_list = _tmp9_;
		_tmp10_ = _resrc_list;
		_tmp11_ = gee_collection_get_size ((GeeCollection*) _tmp10_);
		_tmp12_ = _tmp11_;
		_resrc_size = _tmp12_;
		_resrc_index = -1;
		while (TRUE) {
			gint _tmp13_ = 0;
			gint _tmp14_ = 0;
			gint _tmp15_ = 0;
			RygelMediaResource* resrc = NULL;
			GeeList* _tmp16_ = NULL;
			gint _tmp17_ = 0;
			gpointer _tmp18_ = NULL;
			RygelMediaResource* _tmp19_ = NULL;
			gchar* _tmp20_ = NULL;
			gchar* _tmp21_ = NULL;
			_tmp13_ = _resrc_index;
			_resrc_index = _tmp13_ + 1;
			_tmp14_ = _resrc_index;
			_tmp15_ = _resrc_size;
			if (!(_tmp14_ < _tmp15_)) {
				break;
			}
			_tmp16_ = _resrc_list;
			_tmp17_ = _resrc_index;
			_tmp18_ = gee_list_get (_tmp16_, _tmp17_);
			resrc = (RygelMediaResource*) _tmp18_;
			_tmp19_ = resrc;
			_tmp20_ = rygel_media_resource_get_name (_tmp19_);
			_tmp21_ = _tmp20_;
			g_debug ("rygel-media-export-dvd-container.vala:186: Media-export item media res" \
"ource %s", _tmp21_);
			_g_free0 (_tmp21_);
			_g_object_unref0 (resrc);
		}
		_g_object_unref0 (_resrc_list);
	}
	_tmp22_ = _data6_->item;
	_tmp23_ = rygel_media_object_get_resource_list ((RygelMediaObject*) _tmp22_);
	_tmp24_ = _tmp23_;
	_tmp25_ = added_resources;
	gee_collection_add_all ((GeeCollection*) _tmp24_, (GeeCollection*) _tmp25_);
	_g_object_unref0 (_tmp24_);
	_g_object_unref0 (added_resources);
}


static void ___lambda5__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	__lambda5_ (self, source_object, res);
	block6_data_unref (self);
}


static void _vala_SoupURI_free (SoupURI* self) {
	g_boxed_free (soup_uri_get_type (), self);
}


static RygelMediaFileItem* rygel_media_export_dvd_container_get_item_for_xml (RygelMediaExportDVDContainer* self, gint track, xmlNode* node) {
	RygelMediaFileItem* result = NULL;
	Block6Data* _data6_;
	gint _tmp0_ = 0;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	RygelMediaExportDVDTrack* _tmp6_ = NULL;
	RygelMediaExportDVDTrack* _tmp7_ = NULL;
	RygelMediaExportDVDTrack* _tmp8_ = NULL;
	SoupURI* uri = NULL;
	GeeList* _tmp9_ = NULL;
	GeeList* _tmp10_ = NULL;
	gpointer _tmp11_ = NULL;
	gchar* _tmp12_ = NULL;
	SoupURI* _tmp13_ = NULL;
	SoupURI* _tmp14_ = NULL;
	SoupURI* _tmp15_ = NULL;
	SoupURI* _tmp16_ = NULL;
	gint _tmp17_ = 0;
	gchar* _tmp18_ = NULL;
	gchar* _tmp19_ = NULL;
	RygelMediaExportDVDTrack* _tmp20_ = NULL;
	SoupURI* _tmp21_ = NULL;
	gchar* _tmp22_ = NULL;
	gchar* _tmp23_ = NULL;
	RygelMediaExportDVDTrack* _tmp24_ = NULL;
	RygelMediaExportDVDTrack* _tmp25_ = NULL;
	xmlNode* it = NULL;
	xmlNode* _tmp26_ = NULL;
	xmlNode* _tmp27_ = NULL;
	RygelMediaEngine* _tmp52_ = NULL;
	RygelMediaExportDVDTrack* _tmp53_ = NULL;
	RygelMediaExportDVDTrack* _tmp54_ = NULL;
	RygelMediaFileItem* _tmp55_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_data6_ = g_slice_new0 (Block6Data);
	_data6_->_ref_count_ = 1;
	_data6_->self = g_object_ref (self);
	_tmp0_ = track;
	_tmp1_ = rygel_media_export_dvd_container_get_track_id (self, _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = track;
	_tmp4_ = g_strdup_printf ("Track %d", _tmp3_ + 1);
	_tmp5_ = _tmp4_;
	_tmp6_ = rygel_media_export_dvd_track_new (_tmp2_, (RygelMediaContainer*) self, _tmp5_);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp5_);
	_g_free0 (_tmp2_);
	_data6_->item = _tmp7_;
	_tmp8_ = _data6_->item;
	rygel_media_object_set_parent_ref ((RygelMediaObject*) _tmp8_, (RygelMediaContainer*) self);
	_tmp9_ = rygel_media_object_get_uris ((RygelMediaObject*) self);
	_tmp10_ = _tmp9_;
	_tmp11_ = gee_list_get (_tmp10_, 0);
	_tmp12_ = (gchar*) _tmp11_;
	_tmp13_ = soup_uri_new (_tmp12_);
	_tmp14_ = _tmp13_;
	_g_free0 (_tmp12_);
	_g_object_unref0 (_tmp10_);
	uri = _tmp14_;
	_tmp15_ = uri;
	soup_uri_set_scheme (_tmp15_, "dvd");
	_tmp16_ = uri;
	_tmp17_ = track;
	_tmp18_ = g_strdup_printf ("title=%d", _tmp17_ + 1);
	_tmp19_ = _tmp18_;
	soup_uri_set_query (_tmp16_, _tmp19_);
	_g_free0 (_tmp19_);
	_tmp20_ = _data6_->item;
	_tmp21_ = uri;
	_tmp22_ = soup_uri_to_string (_tmp21_, FALSE);
	_tmp23_ = _tmp22_;
	rygel_media_object_add_uri ((RygelMediaObject*) _tmp20_, _tmp23_);
	_g_free0 (_tmp23_);
	_tmp24_ = _data6_->item;
	rygel_media_file_item_set_dlna_profile ((RygelMediaFileItem*) _tmp24_, "MPEG_PS");
	_tmp25_ = _data6_->item;
	rygel_media_file_item_set_mime_type ((RygelMediaFileItem*) _tmp25_, "video/mpeg");
	_tmp26_ = node;
	_tmp27_ = _tmp26_->children;
	it = _tmp27_;
	while (TRUE) {
		xmlNode* _tmp28_ = NULL;
		xmlNode* _tmp29_ = NULL;
		const gchar* _tmp30_ = NULL;
		xmlNode* _tmp50_ = NULL;
		xmlNode* _tmp51_ = NULL;
		_tmp28_ = it;
		if (!(_tmp28_ != NULL)) {
			break;
		}
		_tmp29_ = it;
		_tmp30_ = _tmp29_->name;
		if (g_strcmp0 (_tmp30_, "length") == 0) {
			RygelMediaExportDVDTrack* _tmp31_ = NULL;
			xmlNode* _tmp32_ = NULL;
			xmlNode* _tmp33_ = NULL;
			const gchar* _tmp34_ = NULL;
			gdouble _tmp35_ = 0.0;
			_tmp31_ = _data6_->item;
			_tmp32_ = it;
			_tmp33_ = _tmp32_->children;
			_tmp34_ = _tmp33_->content;
			_tmp35_ = double_parse (_tmp34_);
			rygel_audio_item_set_duration ((RygelAudioItem*) _tmp31_, (glong) ((gint) _tmp35_));
		} else {
			xmlNode* _tmp36_ = NULL;
			const gchar* _tmp37_ = NULL;
			_tmp36_ = it;
			_tmp37_ = _tmp36_->name;
			if (g_strcmp0 (_tmp37_, "width") == 0) {
				RygelMediaExportDVDTrack* _tmp38_ = NULL;
				xmlNode* _tmp39_ = NULL;
				xmlNode* _tmp40_ = NULL;
				const gchar* _tmp41_ = NULL;
				gint _tmp42_ = 0;
				_tmp38_ = _data6_->item;
				_tmp39_ = it;
				_tmp40_ = _tmp39_->children;
				_tmp41_ = _tmp40_->content;
				_tmp42_ = atoi (_tmp41_);
				rygel_visual_item_set_width ((RygelVisualItem*) _tmp38_, _tmp42_);
			} else {
				xmlNode* _tmp43_ = NULL;
				const gchar* _tmp44_ = NULL;
				_tmp43_ = it;
				_tmp44_ = _tmp43_->name;
				if (g_strcmp0 (_tmp44_, "height") == 0) {
					RygelMediaExportDVDTrack* _tmp45_ = NULL;
					xmlNode* _tmp46_ = NULL;
					xmlNode* _tmp47_ = NULL;
					const gchar* _tmp48_ = NULL;
					gint _tmp49_ = 0;
					_tmp45_ = _data6_->item;
					_tmp46_ = it;
					_tmp47_ = _tmp46_->children;
					_tmp48_ = _tmp47_->content;
					_tmp49_ = atoi (_tmp48_);
					rygel_visual_item_set_height ((RygelVisualItem*) _tmp45_, _tmp49_);
				}
			}
		}
		_tmp50_ = it;
		_tmp51_ = _tmp50_->next;
		it = _tmp51_;
	}
	_tmp52_ = rygel_media_engine_get_default ();
	_data6_->media_engine = _tmp52_;
	_tmp53_ = _data6_->item;
	rygel_media_engine_get_resources_for_item (_data6_->media_engine, (RygelMediaObject*) _tmp53_, ___lambda5__gasync_ready_callback, block6_data_ref (_data6_));
	_tmp54_ = _data6_->item;
	_tmp55_ = _g_object_ref0 ((RygelMediaFileItem*) _tmp54_);
	result = _tmp55_;
	__vala_SoupURI_free0 (uri);
	block6_data_unref (_data6_);
	_data6_ = NULL;
	return result;
}


const gchar* rygel_media_export_dvd_container_get_path (RygelMediaExportDVDContainer* self) {
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_path;
	result = _tmp0_;
	return result;
}


void rygel_media_export_dvd_container_set_path (RygelMediaExportDVDContainer* self, const gchar* value) {
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_path);
	self->priv->_path = _tmp1_;
	g_object_notify ((GObject *) self, "path");
}


static void rygel_media_export_dvd_container_class_init (RygelMediaExportDVDContainerClass * klass) {
	rygel_media_export_dvd_container_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (RygelMediaExportDVDContainerPrivate));
	((GObjectClass *) klass)->constructed = rygel_media_export_dvd_container_real_constructed;
	((RygelMediaContainerClass *) klass)->get_children = rygel_media_export_dvd_container_real_get_children;
	((RygelMediaContainerClass *) klass)->get_children_finish = rygel_media_export_dvd_container_real_get_children_finish;
	((RygelMediaContainerClass *) klass)->find_object = rygel_media_export_dvd_container_real_find_object;
	((RygelMediaContainerClass *) klass)->find_object_finish = rygel_media_export_dvd_container_real_find_object_finish;
	G_OBJECT_CLASS (klass)->get_property = _vala_rygel_media_export_dvd_container_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_rygel_media_export_dvd_container_set_property;
	G_OBJECT_CLASS (klass)->finalize = rygel_media_export_dvd_container_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), RYGEL_MEDIA_EXPORT_DVD_CONTAINER_PATH, g_param_spec_string ("path", "path", "path", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
}


static void rygel_media_export_dvd_container_rygel_media_export_updatable_object_interface_init (RygelMediaExportUpdatableObjectIface * iface) {
	rygel_media_export_dvd_container_rygel_media_export_updatable_object_parent_iface = g_type_interface_peek_parent (iface);
	iface->commit_custom = (void (*)(RygelMediaExportUpdatableObject*, gboolean, GError**)) rygel_media_export_dvd_container_real_commit_custom;
	iface->commit_custom_finish = rygel_media_export_dvd_container_real_commit_custom_finish;
}


static void rygel_media_export_dvd_container_instance_init (RygelMediaExportDVDContainer * self) {
	self->priv = RYGEL_MEDIA_EXPORT_DVD_CONTAINER_GET_PRIVATE (self);
}


static void rygel_media_export_dvd_container_finalize (GObject* obj) {
	RygelMediaExportDVDContainer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, RYGEL_MEDIA_EXPORT_TYPE_DVD_CONTAINER, RygelMediaExportDVDContainer);
	_g_free0 (self->priv->_path);
	_g_object_unref0 (self->priv->doc);
	G_OBJECT_CLASS (rygel_media_export_dvd_container_parent_class)->finalize (obj);
}


GType rygel_media_export_dvd_container_get_type (void) {
	static volatile gsize rygel_media_export_dvd_container_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_media_export_dvd_container_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelMediaExportDVDContainerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_media_export_dvd_container_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelMediaExportDVDContainer), 0, (GInstanceInitFunc) rygel_media_export_dvd_container_instance_init, NULL };
		static const GInterfaceInfo rygel_media_export_updatable_object_info = { (GInterfaceInitFunc) rygel_media_export_dvd_container_rygel_media_export_updatable_object_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType rygel_media_export_dvd_container_type_id;
		rygel_media_export_dvd_container_type_id = g_type_register_static (RYGEL_TYPE_SIMPLE_CONTAINER, "RygelMediaExportDVDContainer", &g_define_type_info, 0);
		g_type_add_interface_static (rygel_media_export_dvd_container_type_id, RYGEL_MEDIA_EXPORT_TYPE_UPDATABLE_OBJECT, &rygel_media_export_updatable_object_info);
		g_once_init_leave (&rygel_media_export_dvd_container_type_id__volatile, rygel_media_export_dvd_container_type_id);
	}
	return rygel_media_export_dvd_container_type_id__volatile;
}


static void _vala_rygel_media_export_dvd_container_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	RygelMediaExportDVDContainer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, RYGEL_MEDIA_EXPORT_TYPE_DVD_CONTAINER, RygelMediaExportDVDContainer);
	switch (property_id) {
		case RYGEL_MEDIA_EXPORT_DVD_CONTAINER_PATH:
		g_value_set_string (value, rygel_media_export_dvd_container_get_path (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_rygel_media_export_dvd_container_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	RygelMediaExportDVDContainer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, RYGEL_MEDIA_EXPORT_TYPE_DVD_CONTAINER, RygelMediaExportDVDContainer);
	switch (property_id) {
		case RYGEL_MEDIA_EXPORT_DVD_CONTAINER_PATH:
		rygel_media_export_dvd_container_set_path (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



