/* rygel-media-export-image-extractor.c generated by valac 0.34.4, the Vala compiler
 * generated from rygel-media-export-image-extractor.vala, do not modify */

/*
 * Copyright (C) 2016 Jens Georg <mail@jensge.org>
 *
 * Author: 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.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 <gio/gio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <stdlib.h>
#include <string.h>


#define RYGEL_MEDIA_EXPORT_TYPE_EXTRACTOR (rygel_media_export_extractor_get_type ())
#define RYGEL_MEDIA_EXPORT_EXTRACTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MEDIA_EXPORT_TYPE_EXTRACTOR, RygelMediaExportExtractor))
#define RYGEL_MEDIA_EXPORT_EXTRACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_MEDIA_EXPORT_TYPE_EXTRACTOR, RygelMediaExportExtractorClass))
#define RYGEL_MEDIA_EXPORT_IS_EXTRACTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MEDIA_EXPORT_TYPE_EXTRACTOR))
#define RYGEL_MEDIA_EXPORT_IS_EXTRACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_MEDIA_EXPORT_TYPE_EXTRACTOR))
#define RYGEL_MEDIA_EXPORT_EXTRACTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_MEDIA_EXPORT_TYPE_EXTRACTOR, RygelMediaExportExtractorClass))

typedef struct _RygelMediaExportExtractor RygelMediaExportExtractor;
typedef struct _RygelMediaExportExtractorClass RygelMediaExportExtractorClass;
typedef struct _RygelMediaExportExtractorPrivate RygelMediaExportExtractorPrivate;

#define RYGEL_MEDIA_EXPORT_TYPE_IMAGE_EXTRACTOR (rygel_media_export_image_extractor_get_type ())
#define RYGEL_MEDIA_EXPORT_IMAGE_EXTRACTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_MEDIA_EXPORT_TYPE_IMAGE_EXTRACTOR, RygelMediaExportImageExtractor))
#define RYGEL_MEDIA_EXPORT_IMAGE_EXTRACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_MEDIA_EXPORT_TYPE_IMAGE_EXTRACTOR, RygelMediaExportImageExtractorClass))
#define RYGEL_MEDIA_EXPORT_IS_IMAGE_EXTRACTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_MEDIA_EXPORT_TYPE_IMAGE_EXTRACTOR))
#define RYGEL_MEDIA_EXPORT_IS_IMAGE_EXTRACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_MEDIA_EXPORT_TYPE_IMAGE_EXTRACTOR))
#define RYGEL_MEDIA_EXPORT_IMAGE_EXTRACTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_MEDIA_EXPORT_TYPE_IMAGE_EXTRACTOR, RygelMediaExportImageExtractorClass))

typedef struct _RygelMediaExportImageExtractor RygelMediaExportImageExtractor;
typedef struct _RygelMediaExportImageExtractorClass RygelMediaExportImageExtractorClass;
typedef struct _RygelMediaExportImageExtractorPrivate RygelMediaExportImageExtractorPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define __vala_GdkPixbufFormat_free0(var) ((var == NULL) ? NULL : (var = (_vala_GdkPixbufFormat_free (var), NULL)))
typedef struct _RygelMediaExportImageExtractorRunData RygelMediaExportImageExtractorRunData;

struct _RygelMediaExportExtractor {
	GObject parent_instance;
	RygelMediaExportExtractorPrivate * priv;
	GVariantDict* serialized_info;
};

struct _RygelMediaExportExtractorClass {
	GObjectClass parent_class;
	void (*run) (RygelMediaExportExtractor* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*run_finish) (RygelMediaExportExtractor* self, GAsyncResult* _res_, GError** error);
};

struct _RygelMediaExportImageExtractor {
	RygelMediaExportExtractor parent_instance;
	RygelMediaExportImageExtractorPrivate * priv;
};

struct _RygelMediaExportImageExtractorClass {
	RygelMediaExportExtractorClass parent_class;
};

struct _RygelMediaExportImageExtractorRunData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelMediaExportImageExtractor* self;
	gint width;
	gint height;
	GdkPixbufFormat* format;
	GFile* _tmp0_;
	GFile* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	GdkPixbufFormat* _tmp6_;
	GdkPixbufFormat* _tmp7_;
	GdkPixbufFormat* _tmp8_;
	gchar* mime;
	GdkPixbufFormat* _tmp9_;
	gchar** _tmp10_;
	gchar** _tmp11_;
	gchar** _tmp12_;
	gint _tmp12__length1;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	GVariantDict* _tmp16_;
	GVariantDict* _tmp17_;
	const gchar* _tmp18_;
	GVariantDict* _tmp19_;
	gint _tmp20_;
	GVariantDict* _tmp21_;
	gint _tmp22_;
	gchar* profile;
	const gchar* _tmp23_;
	gboolean _tmp24_;
	gint _tmp25_;
	gint _tmp26_;
	gchar* _tmp27_;
	gint _tmp28_;
	gint _tmp29_;
	gchar* _tmp30_;
	gboolean _tmp31_;
	gint _tmp32_;
	gint _tmp33_;
	gchar* _tmp34_;
	gboolean _tmp35_;
	gint _tmp36_;
	gint _tmp37_;
	gchar* _tmp38_;
	gboolean _tmp39_;
	gint _tmp40_;
	gint _tmp41_;
	gchar* _tmp42_;
	gint _tmp43_;
	gint _tmp44_;
	gchar* _tmp45_;
	GVariantDict* _tmp46_;
	const gchar* _tmp47_;
	GError * _inner_error_;
};


static gpointer rygel_media_export_image_extractor_parent_class = NULL;

GType rygel_media_export_extractor_get_type (void) G_GNUC_CONST;
GType rygel_media_export_image_extractor_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_MEDIA_EXPORT_IMAGE_EXTRACTOR_DUMMY_PROPERTY
};
RygelMediaExportImageExtractor* rygel_media_export_image_extractor_new (GFile* file);
RygelMediaExportImageExtractor* rygel_media_export_image_extractor_construct (GType object_type, GFile* file);
static void rygel_media_export_image_extractor_real_run_data_free (gpointer _data);
static void rygel_media_export_image_extractor_real_run (RygelMediaExportExtractor* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean rygel_media_export_image_extractor_real_run_co (RygelMediaExportImageExtractorRunData* _data_);
void rygel_media_export_extractor_run (RygelMediaExportExtractor* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void rygel_media_export_extractor_run_finish (RygelMediaExportExtractor* self, GAsyncResult* _res_, GError** error);
static void rygel_media_export_image_extractor_run_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
GFile* rygel_media_export_extractor_get_file (RygelMediaExportExtractor* self);
static GdkPixbufFormat* _vala_GdkPixbufFormat_copy (GdkPixbufFormat* self);
#define RYGEL_MEDIA_EXPORT_SERIALIZER_UPNP_CLASS "UPnPClass"
#define UPNP_CLASS_PHOTO "object.item.imageItem.photo"
#define RYGEL_MEDIA_EXPORT_SERIALIZER_MIME_TYPE "MimeType"
#define RYGEL_MEDIA_EXPORT_SERIALIZER_VIDEO_WIDTH "VideoWidth"
#define RYGEL_MEDIA_EXPORT_SERIALIZER_VIDEO_HEIGHT "VideoHeight"
#define RYGEL_MEDIA_EXPORT_SERIALIZER_DLNA_PROFILE "DLNAProfile"
static void _vala_GdkPixbufFormat_free (GdkPixbufFormat* self);
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);


RygelMediaExportImageExtractor* rygel_media_export_image_extractor_construct (GType object_type, GFile* file) {
	RygelMediaExportImageExtractor * self = NULL;
	GFile* _tmp0_ = NULL;
	g_return_val_if_fail (file != NULL, NULL);
	_tmp0_ = file;
	self = (RygelMediaExportImageExtractor*) g_object_new (object_type, "file", _tmp0_, NULL);
	return self;
}


RygelMediaExportImageExtractor* rygel_media_export_image_extractor_new (GFile* file) {
	return rygel_media_export_image_extractor_construct (RYGEL_MEDIA_EXPORT_TYPE_IMAGE_EXTRACTOR, file);
}


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


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


static void rygel_media_export_image_extractor_real_run (RygelMediaExportExtractor* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelMediaExportImageExtractor * self;
	RygelMediaExportImageExtractorRunData* _data_;
	RygelMediaExportImageExtractor* _tmp0_ = NULL;
	self = (RygelMediaExportImageExtractor*) base;
	_data_ = g_slice_new0 (RygelMediaExportImageExtractorRunData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rygel_media_export_image_extractor_real_run);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_media_export_image_extractor_real_run_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	rygel_media_export_image_extractor_real_run_co (_data_);
}


static void rygel_media_export_image_extractor_real_run_finish (RygelMediaExportExtractor* base, GAsyncResult* _res_, GError** error) {
	RygelMediaExportImageExtractorRunData* _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_image_extractor_run_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RygelMediaExportImageExtractorRunData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	rygel_media_export_image_extractor_real_run_co (_data_);
}


static GdkPixbufFormat* _vala_GdkPixbufFormat_copy (GdkPixbufFormat* self) {
	return g_boxed_copy (gdk_pixbuf_format_get_type (), self);
}


static gpointer __vala_GdkPixbufFormat_copy0 (gpointer self) {
	return self ? _vala_GdkPixbufFormat_copy (self) : NULL;
}


static void _vala_GdkPixbufFormat_free (GdkPixbufFormat* self) {
	g_boxed_free (gdk_pixbuf_format_get_type (), self);
}


static gboolean rygel_media_export_image_extractor_real_run_co (RygelMediaExportImageExtractorRunData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	RYGEL_MEDIA_EXPORT_EXTRACTOR_CLASS (rygel_media_export_image_extractor_parent_class)->run (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, RYGEL_MEDIA_EXPORT_TYPE_EXTRACTOR, RygelMediaExportExtractor), rygel_media_export_image_extractor_run_ready, _data_);
	return FALSE;
	_state_1:
	RYGEL_MEDIA_EXPORT_EXTRACTOR_CLASS (rygel_media_export_image_extractor_parent_class)->run_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, RYGEL_MEDIA_EXPORT_TYPE_EXTRACTOR, RygelMediaExportExtractor), _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;
	}
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = rygel_media_export_extractor_get_file ((RygelMediaExportExtractor*) _data_->self);
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = g_file_get_path (_data_->_tmp1_);
	_data_->_tmp3_ = NULL;
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = 0;
	_data_->_tmp5_ = 0;
	_data_->_state_ = 2;
	gdk_pixbuf_get_file_info_async (_data_->_tmp3_, NULL, rygel_media_export_image_extractor_run_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp6_ = NULL;
	_data_->_tmp6_ = gdk_pixbuf_get_file_info_finish (_data_->_res_, &_data_->_tmp4_, &_data_->_tmp5_, &_data_->_inner_error_);
	_data_->width = _data_->_tmp4_;
	_data_->height = _data_->_tmp5_;
	_data_->_tmp7_ = NULL;
	_data_->_tmp7_ = __vala_GdkPixbufFormat_copy0 (_data_->_tmp6_);
	_data_->_tmp8_ = NULL;
	_data_->_tmp8_ = _data_->_tmp7_;
	_g_free0 (_data_->_tmp3_);
	_data_->format = _data_->_tmp8_;
	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;
	}
	_data_->_tmp9_ = NULL;
	_data_->_tmp9_ = _data_->format;
	_data_->_tmp10_ = NULL;
	_data_->_tmp11_ = NULL;
	_data_->_tmp11_ = _data_->_tmp10_ = gdk_pixbuf_format_get_mime_types (_data_->_tmp9_);
	_data_->_tmp12_ = NULL;
	_data_->_tmp12__length1 = 0;
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp12__length1 = _vala_array_length (_data_->_tmp10_);
	_data_->_tmp13_ = NULL;
	_data_->_tmp13_ = _data_->_tmp12_[0];
	_data_->_tmp14_ = NULL;
	_data_->_tmp14_ = g_strdup (_data_->_tmp13_);
	_data_->_tmp15_ = NULL;
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->_tmp12_ = (_vala_array_free (_data_->_tmp12_, _data_->_tmp12__length1, (GDestroyNotify) g_free), NULL);
	_data_->mime = _data_->_tmp15_;
	_data_->_tmp16_ = NULL;
	_data_->_tmp16_ = ((RygelMediaExportExtractor*) _data_->self)->serialized_info;
	g_variant_dict_insert (_data_->_tmp16_, RYGEL_MEDIA_EXPORT_SERIALIZER_UPNP_CLASS, "s", UPNP_CLASS_PHOTO, NULL);
	_data_->_tmp17_ = NULL;
	_data_->_tmp17_ = ((RygelMediaExportExtractor*) _data_->self)->serialized_info;
	_data_->_tmp18_ = NULL;
	_data_->_tmp18_ = _data_->mime;
	g_variant_dict_insert (_data_->_tmp17_, RYGEL_MEDIA_EXPORT_SERIALIZER_MIME_TYPE, "s", _data_->_tmp18_, NULL);
	_data_->_tmp19_ = NULL;
	_data_->_tmp19_ = ((RygelMediaExportExtractor*) _data_->self)->serialized_info;
	_data_->_tmp20_ = 0;
	_data_->_tmp20_ = _data_->width;
	g_variant_dict_insert (_data_->_tmp19_, RYGEL_MEDIA_EXPORT_SERIALIZER_VIDEO_WIDTH, "i", _data_->_tmp20_, NULL);
	_data_->_tmp21_ = NULL;
	_data_->_tmp21_ = ((RygelMediaExportExtractor*) _data_->self)->serialized_info;
	_data_->_tmp22_ = 0;
	_data_->_tmp22_ = _data_->height;
	g_variant_dict_insert (_data_->_tmp21_, RYGEL_MEDIA_EXPORT_SERIALIZER_VIDEO_HEIGHT, "i", _data_->_tmp22_, NULL);
	_data_->profile = NULL;
	_data_->_tmp23_ = NULL;
	_data_->_tmp23_ = _data_->mime;
	if (g_strcmp0 (_data_->_tmp23_, "image/png") == 0) {
		_data_->_tmp25_ = 0;
		_data_->_tmp25_ = _data_->width;
		if (_data_->_tmp25_ <= 4096) {
			_data_->_tmp26_ = 0;
			_data_->_tmp26_ = _data_->height;
			_data_->_tmp24_ = _data_->_tmp26_ <= 4096;
		} else {
			_data_->_tmp24_ = FALSE;
		}
		if (_data_->_tmp24_) {
			_data_->_tmp27_ = NULL;
			_data_->_tmp27_ = g_strdup ("PNG_LRG");
			_g_free0 (_data_->profile);
			_data_->profile = _data_->_tmp27_;
		} else {
			_data_->_tmp28_ = 0;
			_data_->_tmp28_ = _data_->width;
			_data_->_tmp29_ = 0;
			_data_->_tmp29_ = _data_->height;
			_data_->_tmp30_ = NULL;
			_data_->_tmp30_ = g_strdup_printf ("PNG_RES_%d_%d", _data_->_tmp28_, _data_->_tmp29_);
			_g_free0 (_data_->profile);
			_data_->profile = _data_->_tmp30_;
		}
	} else {
		_data_->_tmp32_ = 0;
		_data_->_tmp32_ = _data_->width;
		if (_data_->_tmp32_ <= 640) {
			_data_->_tmp33_ = 0;
			_data_->_tmp33_ = _data_->height;
			_data_->_tmp31_ = _data_->_tmp33_ <= 480;
		} else {
			_data_->_tmp31_ = FALSE;
		}
		if (_data_->_tmp31_) {
			_data_->_tmp34_ = NULL;
			_data_->_tmp34_ = g_strdup ("JPEG_SM");
			_g_free0 (_data_->profile);
			_data_->profile = _data_->_tmp34_;
		} else {
			_data_->_tmp36_ = 0;
			_data_->_tmp36_ = _data_->width;
			if (_data_->_tmp36_ <= 1024) {
				_data_->_tmp37_ = 0;
				_data_->_tmp37_ = _data_->height;
				_data_->_tmp35_ = _data_->_tmp37_ <= 768;
			} else {
				_data_->_tmp35_ = FALSE;
			}
			if (_data_->_tmp35_) {
				_data_->_tmp38_ = NULL;
				_data_->_tmp38_ = g_strdup ("JPEG_MED");
				_g_free0 (_data_->profile);
				_data_->profile = _data_->_tmp38_;
			} else {
				_data_->_tmp40_ = 0;
				_data_->_tmp40_ = _data_->width;
				if (_data_->_tmp40_ <= 4096) {
					_data_->_tmp41_ = 0;
					_data_->_tmp41_ = _data_->height;
					_data_->_tmp39_ = _data_->_tmp41_ <= 4096;
				} else {
					_data_->_tmp39_ = FALSE;
				}
				if (_data_->_tmp39_) {
					_data_->_tmp42_ = NULL;
					_data_->_tmp42_ = g_strdup ("JPEG_LRG");
					_g_free0 (_data_->profile);
					_data_->profile = _data_->_tmp42_;
				} else {
					_data_->_tmp43_ = 0;
					_data_->_tmp43_ = _data_->width;
					_data_->_tmp44_ = 0;
					_data_->_tmp44_ = _data_->height;
					_data_->_tmp45_ = NULL;
					_data_->_tmp45_ = g_strdup_printf ("JPEG_RES_%d_%d", _data_->_tmp43_, _data_->_tmp44_);
					_g_free0 (_data_->profile);
					_data_->profile = _data_->_tmp45_;
				}
			}
		}
	}
	_data_->_tmp46_ = NULL;
	_data_->_tmp46_ = ((RygelMediaExportExtractor*) _data_->self)->serialized_info;
	_data_->_tmp47_ = NULL;
	_data_->_tmp47_ = _data_->profile;
	g_variant_dict_insert (_data_->_tmp46_, RYGEL_MEDIA_EXPORT_SERIALIZER_DLNA_PROFILE, "s", _data_->_tmp47_, NULL);
	_g_free0 (_data_->profile);
	_g_free0 (_data_->mime);
	__vala_GdkPixbufFormat_free0 (_data_->format);
	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_image_extractor_class_init (RygelMediaExportImageExtractorClass * klass) {
	rygel_media_export_image_extractor_parent_class = g_type_class_peek_parent (klass);
	((RygelMediaExportExtractorClass *) klass)->run = rygel_media_export_image_extractor_real_run;
	((RygelMediaExportExtractorClass *) klass)->run_finish = rygel_media_export_image_extractor_real_run_finish;
}


static void rygel_media_export_image_extractor_instance_init (RygelMediaExportImageExtractor * self) {
}


GType rygel_media_export_image_extractor_get_type (void) {
	static volatile gsize rygel_media_export_image_extractor_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_media_export_image_extractor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelMediaExportImageExtractorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_media_export_image_extractor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelMediaExportImageExtractor), 0, (GInstanceInitFunc) rygel_media_export_image_extractor_instance_init, NULL };
		GType rygel_media_export_image_extractor_type_id;
		rygel_media_export_image_extractor_type_id = g_type_register_static (RYGEL_MEDIA_EXPORT_TYPE_EXTRACTOR, "RygelMediaExportImageExtractor", &g_define_type_info, 0);
		g_once_init_leave (&rygel_media_export_image_extractor_type_id__volatile, rygel_media_export_image_extractor_type_id);
	}
	return rygel_media_export_image_extractor_type_id__volatile;
}


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;
}



