/* rygel-l16-transcoder.c generated by valac 0.17.4.16-52707, the Vala compiler
 * generated from rygel-l16-transcoder.vala, do not modify */

/*
 * Copyright (C) 2009 Nokia Corporation.
 *
 * 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 <gst/gst.h>
#include <libgupnp-av/gupnp-av.h>
#include <gst/pbutils/pbutils.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>


#define RYGEL_TYPE_TRANSCODER (rygel_transcoder_get_type ())
#define RYGEL_TRANSCODER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_TRANSCODER, RygelTranscoder))
#define RYGEL_TRANSCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_TRANSCODER, RygelTranscoderClass))
#define RYGEL_IS_TRANSCODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_TRANSCODER))
#define RYGEL_IS_TRANSCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_TRANSCODER))
#define RYGEL_TRANSCODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_TRANSCODER, RygelTranscoderClass))

typedef struct _RygelTranscoder RygelTranscoder;
typedef struct _RygelTranscoderClass RygelTranscoderClass;
typedef struct _RygelTranscoderPrivate RygelTranscoderPrivate;

#define RYGEL_TYPE_MEDIA_OBJECT (rygel_media_object_get_type ())
#define RYGEL_MEDIA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_MEDIA_OBJECT, RygelMediaObject))
#define RYGEL_MEDIA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_MEDIA_OBJECT, RygelMediaObjectClass))
#define RYGEL_IS_MEDIA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_MEDIA_OBJECT))
#define RYGEL_IS_MEDIA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_MEDIA_OBJECT))
#define RYGEL_MEDIA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_MEDIA_OBJECT, RygelMediaObjectClass))

typedef struct _RygelMediaObject RygelMediaObject;
typedef struct _RygelMediaObjectClass RygelMediaObjectClass;

#define RYGEL_TYPE_MEDIA_ITEM (rygel_media_item_get_type ())
#define RYGEL_MEDIA_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_MEDIA_ITEM, RygelMediaItem))
#define RYGEL_MEDIA_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_MEDIA_ITEM, RygelMediaItemClass))
#define RYGEL_IS_MEDIA_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_MEDIA_ITEM))
#define RYGEL_IS_MEDIA_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_MEDIA_ITEM))
#define RYGEL_MEDIA_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_MEDIA_ITEM, RygelMediaItemClass))

typedef struct _RygelMediaItem RygelMediaItem;
typedef struct _RygelMediaItemClass RygelMediaItemClass;

#define RYGEL_TYPE_TRANSCODE_MANAGER (rygel_transcode_manager_get_type ())
#define RYGEL_TRANSCODE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_TRANSCODE_MANAGER, RygelTranscodeManager))
#define RYGEL_TRANSCODE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_TRANSCODE_MANAGER, RygelTranscodeManagerClass))
#define RYGEL_IS_TRANSCODE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_TRANSCODE_MANAGER))
#define RYGEL_IS_TRANSCODE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_TRANSCODE_MANAGER))
#define RYGEL_TRANSCODE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_TRANSCODE_MANAGER, RygelTranscodeManagerClass))

typedef struct _RygelTranscodeManager RygelTranscodeManager;
typedef struct _RygelTranscodeManagerClass RygelTranscodeManagerClass;

#define RYGEL_TYPE_AUDIO_TRANSCODER (rygel_audio_transcoder_get_type ())
#define RYGEL_AUDIO_TRANSCODER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_AUDIO_TRANSCODER, RygelAudioTranscoder))
#define RYGEL_AUDIO_TRANSCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_AUDIO_TRANSCODER, RygelAudioTranscoderClass))
#define RYGEL_IS_AUDIO_TRANSCODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_AUDIO_TRANSCODER))
#define RYGEL_IS_AUDIO_TRANSCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_AUDIO_TRANSCODER))
#define RYGEL_AUDIO_TRANSCODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_AUDIO_TRANSCODER, RygelAudioTranscoderClass))

typedef struct _RygelAudioTranscoder RygelAudioTranscoder;
typedef struct _RygelAudioTranscoderClass RygelAudioTranscoderClass;
typedef struct _RygelAudioTranscoderPrivate RygelAudioTranscoderPrivate;

#define RYGEL_TYPE_L16_TRANSCODER (rygel_l16_transcoder_get_type ())
#define RYGEL_L16_TRANSCODER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_L16_TRANSCODER, RygelL16Transcoder))
#define RYGEL_L16_TRANSCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_L16_TRANSCODER, RygelL16TranscoderClass))
#define RYGEL_IS_L16_TRANSCODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_L16_TRANSCODER))
#define RYGEL_IS_L16_TRANSCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_L16_TRANSCODER))
#define RYGEL_L16_TRANSCODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_L16_TRANSCODER, RygelL16TranscoderClass))

typedef struct _RygelL16Transcoder RygelL16Transcoder;
typedef struct _RygelL16TranscoderClass RygelL16TranscoderClass;
typedef struct _RygelL16TranscoderPrivate RygelL16TranscoderPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define RYGEL_TYPE_AUDIO_ITEM (rygel_audio_item_get_type ())
#define RYGEL_AUDIO_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_AUDIO_ITEM, RygelAudioItem))
#define RYGEL_AUDIO_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_AUDIO_ITEM, RygelAudioItemClass))
#define RYGEL_IS_AUDIO_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_AUDIO_ITEM))
#define RYGEL_IS_AUDIO_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_AUDIO_ITEM))
#define RYGEL_AUDIO_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_AUDIO_ITEM, RygelAudioItemClass))

typedef struct _RygelAudioItem RygelAudioItem;
typedef struct _RygelAudioItemClass RygelAudioItemClass;

#define RYGEL_TYPE_VIDEO_ITEM (rygel_video_item_get_type ())
#define RYGEL_VIDEO_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_VIDEO_ITEM, RygelVideoItem))
#define RYGEL_VIDEO_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_VIDEO_ITEM, RygelVideoItemClass))
#define RYGEL_IS_VIDEO_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_VIDEO_ITEM))
#define RYGEL_IS_VIDEO_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_VIDEO_ITEM))
#define RYGEL_VIDEO_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_VIDEO_ITEM, RygelVideoItemClass))

typedef struct _RygelVideoItem RygelVideoItem;
typedef struct _RygelVideoItemClass RygelVideoItemClass;
typedef struct _RygelMediaObjectPrivate RygelMediaObjectPrivate;

#define RYGEL_TYPE_HTTP_SERVER (rygel_http_server_get_type ())
#define RYGEL_HTTP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_HTTP_SERVER, RygelHTTPServer))
#define RYGEL_HTTP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_HTTP_SERVER, RygelHTTPServerClass))
#define RYGEL_IS_HTTP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_HTTP_SERVER))
#define RYGEL_IS_HTTP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_HTTP_SERVER))
#define RYGEL_HTTP_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_HTTP_SERVER, RygelHTTPServerClass))

typedef struct _RygelHTTPServer RygelHTTPServer;
typedef struct _RygelHTTPServerClass RygelHTTPServerClass;

#define RYGEL_TYPE_MEDIA_CONTAINER (rygel_media_container_get_type ())
#define RYGEL_MEDIA_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_MEDIA_CONTAINER, RygelMediaContainer))
#define RYGEL_MEDIA_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_MEDIA_CONTAINER, RygelMediaContainerClass))
#define RYGEL_IS_MEDIA_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_MEDIA_CONTAINER))
#define RYGEL_IS_MEDIA_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_MEDIA_CONTAINER))
#define RYGEL_MEDIA_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_MEDIA_CONTAINER, RygelMediaContainerClass))

typedef struct _RygelMediaContainer RygelMediaContainer;
typedef struct _RygelMediaContainerClass RygelMediaContainerClass;
typedef struct _RygelMediaItemPrivate RygelMediaItemPrivate;
typedef struct _RygelAudioItemPrivate RygelAudioItemPrivate;

struct _RygelTranscoder {
	GObject parent_instance;
	RygelTranscoderPrivate * priv;
};

struct _RygelTranscoderClass {
	GObjectClass parent_class;
	GstElement* (*create_source) (RygelTranscoder* self, RygelMediaItem* item, GstElement* src, GError** error);
	GUPnPDIDLLiteResource* (*add_resource) (RygelTranscoder* self, GUPnPDIDLLiteItem* didl_item, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error);
	guint (*get_distance) (RygelTranscoder* self, RygelMediaItem* item);
	GstEncodingProfile* (*get_encoding_profile) (RygelTranscoder* self);
};

struct _RygelAudioTranscoder {
	RygelTranscoder parent_instance;
	RygelAudioTranscoderPrivate * priv;
	gint audio_bitrate;
	GstCaps* container_format;
	GstCaps* audio_codec_format;
};

struct _RygelAudioTranscoderClass {
	RygelTranscoderClass parent_class;
};

struct _RygelL16Transcoder {
	RygelAudioTranscoder parent_instance;
	RygelL16TranscoderPrivate * priv;
};

struct _RygelL16TranscoderClass {
	RygelAudioTranscoderClass parent_class;
};

struct _RygelMediaObject {
	GObject parent_instance;
	RygelMediaObjectPrivate * priv;
	gchar* id;
	gchar* ref_id;
	gchar* upnp_class;
	guint64 modified;
	GeeArrayList* uris;
	RygelMediaContainer* parent;
};

struct _RygelMediaObjectClass {
	GObjectClass parent_class;
	GUPnPDIDLLiteObject* (*serialize) (RygelMediaObject* self, GUPnPDIDLLiteWriter* writer, RygelHTTPServer* http_server, GError** error);
	gint (*compare_by_property) (RygelMediaObject* self, RygelMediaObject* media_object, const gchar* property);
	GUPnPOCMFlags (*get_ocm_flags) (RygelMediaObject* self);
};

struct _RygelMediaItem {
	RygelMediaObject parent_instance;
	RygelMediaItemPrivate * priv;
	gchar* date;
	gchar* mime_type;
	gchar* dlna_profile;
	GRegex* address_regex;
};

struct _RygelMediaItemClass {
	RygelMediaObjectClass parent_class;
	GstElement* (*create_stream_source) (RygelMediaItem* self, const gchar* host_ip);
	gboolean (*streamable) (RygelMediaItem* self);
	void (*add_uri) (RygelMediaItem* self, const gchar* uri);
	GUPnPDIDLLiteResource* (*add_resource) (RygelMediaItem* self, GUPnPDIDLLiteItem* didl_item, const gchar* uri, const gchar* protocol, const gchar* import_uri, GError** error);
	void (*add_proxy_resources) (RygelMediaItem* self, RygelHTTPServer* server, GUPnPDIDLLiteItem* didl_item, GError** error);
	GUPnPProtocolInfo* (*get_protocol_info) (RygelMediaItem* self, const gchar* uri, const gchar* protocol);
	void (*add_resources) (RygelMediaItem* self, GUPnPDIDLLiteItem* didl_item, gboolean allow_internal, GError** error);
};

struct _RygelAudioItem {
	RygelMediaItem parent_instance;
	RygelAudioItemPrivate * priv;
	glong duration;
	gint bitrate;
	gint sample_freq;
	gint bits_per_sample;
	gint channels;
};

struct _RygelAudioItemClass {
	RygelMediaItemClass parent_class;
};


static gpointer rygel_l16_transcoder_parent_class = NULL;

GType rygel_transcoder_get_type (void) G_GNUC_CONST;
GType rygel_media_object_get_type (void) G_GNUC_CONST;
GType rygel_media_item_get_type (void) G_GNUC_CONST;
GType rygel_transcode_manager_get_type (void) G_GNUC_CONST;
GType rygel_audio_transcoder_get_type (void) G_GNUC_CONST;
GType rygel_l16_transcoder_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_L16_TRANSCODER_DUMMY_PROPERTY
};
#define RYGEL_L16_TRANSCODER_CHANNELS 2
#define RYGEL_L16_TRANSCODER_FREQUENCY 44100
#define RYGEL_L16_TRANSCODER_WIDTH 16
#define RYGEL_L16_TRANSCODER_DEPTH 16
#define RYGEL_L16_TRANSCODER_SIGNED TRUE
#define RYGEL_L16_TRANSCODER_ENDIANNESS ((gint) G_BIG_ENDIAN)
RygelL16Transcoder* rygel_l16_transcoder_new (void);
RygelL16Transcoder* rygel_l16_transcoder_construct (GType object_type);
#define RYGEL_AUDIO_TRANSCODER_NO_CONTAINER NULL
RygelAudioTranscoder* rygel_audio_transcoder_new (const gchar* content_type, const gchar* dlna_profile, gint audio_bitrate, const gchar* container_caps, const gchar* audio_codec_caps, const gchar* extension);
RygelAudioTranscoder* rygel_audio_transcoder_construct (GType object_type, const gchar* content_type, const gchar* dlna_profile, gint audio_bitrate, const gchar* container_caps, const gchar* audio_codec_caps, const gchar* extension);
static GUPnPDIDLLiteResource* rygel_l16_transcoder_real_add_resource (RygelTranscoder* base, GUPnPDIDLLiteItem* didl_item, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error);
GUPnPDIDLLiteResource* rygel_transcoder_add_resource (RygelTranscoder* self, GUPnPDIDLLiteItem* didl_item, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error);
static guint rygel_l16_transcoder_real_get_distance (RygelTranscoder* base, RygelMediaItem* item);
GType rygel_audio_item_get_type (void) G_GNUC_CONST;
GType rygel_video_item_get_type (void) G_GNUC_CONST;
GType rygel_http_server_get_type (void) G_GNUC_CONST;
GType rygel_media_container_get_type (void) G_GNUC_CONST;


static gchar* bool_to_string (gboolean self) {
	gchar* result = NULL;
#line 37 "/opt/gnome2/share/vala-0.18/vapi/glib-2.0.vapi"
	if (self) {
#line 268 "rygel-l16-transcoder.c"
		gchar* _tmp0_;
#line 38 "/opt/gnome2/share/vala-0.18/vapi/glib-2.0.vapi"
		_tmp0_ = g_strdup ("true");
#line 38 "/opt/gnome2/share/vala-0.18/vapi/glib-2.0.vapi"
		result = _tmp0_;
#line 38 "/opt/gnome2/share/vala-0.18/vapi/glib-2.0.vapi"
		return result;
#line 276 "rygel-l16-transcoder.c"
	} else {
		gchar* _tmp1_;
#line 40 "/opt/gnome2/share/vala-0.18/vapi/glib-2.0.vapi"
		_tmp1_ = g_strdup ("false");
#line 40 "/opt/gnome2/share/vala-0.18/vapi/glib-2.0.vapi"
		result = _tmp1_;
#line 40 "/opt/gnome2/share/vala-0.18/vapi/glib-2.0.vapi"
		return result;
#line 285 "rygel-l16-transcoder.c"
	}
}


RygelL16Transcoder* rygel_l16_transcoder_construct (GType object_type) {
	RygelL16Transcoder * self = NULL;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_ = NULL;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* mime_type;
	gchar* _tmp16_ = NULL;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_ = NULL;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_ = NULL;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_ = NULL;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_ = NULL;
	gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	gchar* _tmp46_ = NULL;
	gchar* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	gchar* caps_str;
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp0_ = g_strdup_printf ("%i", RYGEL_L16_TRANSCODER_WIDTH);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp1_ = _tmp0_;
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp2_ = g_strconcat ("audio/L", _tmp1_, NULL);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp3_ = _tmp2_;
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp4_ = g_strconcat (_tmp3_, ";rate=", NULL);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp5_ = _tmp4_;
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp6_ = g_strdup_printf ("%i", RYGEL_L16_TRANSCODER_FREQUENCY);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp7_ = _tmp6_;
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp8_ = g_strconcat (_tmp5_, _tmp7_, NULL);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp9_ = _tmp8_;
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp10_ = g_strconcat (_tmp9_, ";channels=", NULL);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp11_ = _tmp10_;
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp12_ = g_strdup_printf ("%i", RYGEL_L16_TRANSCODER_CHANNELS);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp13_ = _tmp12_;
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp14_ = g_strconcat (_tmp11_, _tmp13_, NULL);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp15_ = _tmp14_;
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp13_);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp11_);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp9_);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp7_);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp5_);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp3_);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp1_);
#line 39 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	mime_type = _tmp15_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp16_ = g_strdup_printf ("%i", RYGEL_L16_TRANSCODER_CHANNELS);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp17_ = _tmp16_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp18_ = g_strconcat ("audio/x-raw-int" ",channels=", _tmp17_, NULL);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp19_ = _tmp18_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp20_ = g_strconcat (_tmp19_, ",rate=", NULL);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp21_ = _tmp20_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp22_ = g_strdup_printf ("%i", RYGEL_L16_TRANSCODER_FREQUENCY);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp23_ = _tmp22_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp24_ = g_strconcat (_tmp21_, _tmp23_, NULL);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp25_ = _tmp24_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp26_ = g_strconcat (_tmp25_, ",width=", NULL);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp27_ = _tmp26_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp28_ = g_strdup_printf ("%i", RYGEL_L16_TRANSCODER_WIDTH);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp29_ = _tmp28_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp30_ = g_strconcat (_tmp27_, _tmp29_, NULL);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp31_ = _tmp30_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp32_ = g_strconcat (_tmp31_, ",depth=", NULL);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp33_ = _tmp32_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp34_ = g_strdup_printf ("%i", RYGEL_L16_TRANSCODER_DEPTH);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp35_ = _tmp34_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp36_ = g_strconcat (_tmp33_, _tmp35_, NULL);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp37_ = _tmp36_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp38_ = g_strconcat (_tmp37_, ",signed=", NULL);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp39_ = _tmp38_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp40_ = bool_to_string (RYGEL_L16_TRANSCODER_SIGNED);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp41_ = _tmp40_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp42_ = g_strconcat (_tmp39_, _tmp41_, NULL);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp43_ = _tmp42_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp44_ = g_strconcat (_tmp43_, ",endianness=", NULL);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp45_ = _tmp44_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp46_ = g_strdup_printf ("%i", RYGEL_L16_TRANSCODER_ENDIANNESS);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp47_ = _tmp46_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp48_ = g_strconcat (_tmp45_, _tmp47_, NULL);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp49_ = _tmp48_;
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp47_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp45_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp43_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp41_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp39_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp37_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp35_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp33_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp31_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp29_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp27_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp25_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp23_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp21_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp19_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (_tmp17_);
#line 43 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	caps_str = _tmp49_;
#line 51 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	self = (RygelL16Transcoder*) rygel_audio_transcoder_construct (object_type, mime_type, "LPCM", 0, RYGEL_AUDIO_TRANSCODER_NO_CONTAINER, caps_str, "lpcm");
#line 38 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (caps_str);
#line 38 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_free0 (mime_type);
#line 38 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	return self;
#line 502 "rygel-l16-transcoder.c"
}


RygelL16Transcoder* rygel_l16_transcoder_new (void) {
#line 38 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	return rygel_l16_transcoder_construct (RYGEL_TYPE_L16_TRANSCODER);
#line 509 "rygel-l16-transcoder.c"
}


static GUPnPDIDLLiteResource* rygel_l16_transcoder_real_add_resource (RygelTranscoder* base, GUPnPDIDLLiteItem* didl_item, RygelMediaItem* item, RygelTranscodeManager* manager, GError** error) {
	RygelL16Transcoder * self;
	GUPnPDIDLLiteResource* result = NULL;
	GUPnPDIDLLiteItem* _tmp0_;
	RygelMediaItem* _tmp1_;
	RygelTranscodeManager* _tmp2_;
	GUPnPDIDLLiteResource* _tmp3_ = NULL;
	GUPnPDIDLLiteResource* resource;
	GError * _inner_error_ = NULL;
#line 59 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	self = (RygelL16Transcoder*) base;
#line 59 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	g_return_val_if_fail (didl_item != NULL, NULL);
#line 59 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	g_return_val_if_fail (item != NULL, NULL);
#line 59 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	g_return_val_if_fail (manager != NULL, NULL);
#line 63 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp0_ = didl_item;
#line 63 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp1_ = item;
#line 63 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp2_ = manager;
#line 63 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp3_ = RYGEL_TRANSCODER_CLASS (rygel_l16_transcoder_parent_class)->add_resource ((RygelTranscoder*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_AUDIO_TRANSCODER, RygelAudioTranscoder), _tmp0_, _tmp1_, _tmp2_, &_inner_error_);
#line 63 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	resource = _tmp3_;
#line 63 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	if (_inner_error_ != NULL) {
#line 63 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		g_propagate_error (error, _inner_error_);
#line 63 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		return NULL;
#line 546 "rygel-l16-transcoder.c"
	}
#line 64 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	if (resource == NULL) {
#line 65 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		result = NULL;
#line 65 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_g_object_unref0 (resource);
#line 65 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		return result;
#line 556 "rygel-l16-transcoder.c"
	}
#line 68 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	gupnp_didl_lite_resource_set_sample_freq (resource, RYGEL_L16_TRANSCODER_FREQUENCY);
#line 69 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	gupnp_didl_lite_resource_set_audio_channels (resource, RYGEL_L16_TRANSCODER_CHANNELS);
#line 70 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	gupnp_didl_lite_resource_set_bits_per_sample (resource, RYGEL_L16_TRANSCODER_WIDTH);
#line 72 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	gupnp_didl_lite_resource_set_bitrate (resource, ((RYGEL_L16_TRANSCODER_FREQUENCY * RYGEL_L16_TRANSCODER_CHANNELS) * RYGEL_L16_TRANSCODER_WIDTH) / 8);
#line 76 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	result = resource;
#line 76 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	return result;
#line 570 "rygel-l16-transcoder.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 84 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	return self ? g_object_ref (self) : NULL;
#line 577 "rygel-l16-transcoder.c"
}


static guint rygel_l16_transcoder_real_get_distance (RygelTranscoder* base, RygelMediaItem* item) {
	RygelL16Transcoder * self;
	guint result = 0U;
	gboolean _tmp0_ = FALSE;
	RygelMediaItem* _tmp1_;
	gboolean _tmp3_;
	RygelMediaItem* _tmp5_;
	RygelAudioItem* _tmp6_;
	RygelAudioItem* audio_item;
	guint _tmp7_;
	guint distance;
	RygelAudioItem* _tmp8_;
	gint _tmp9_;
	RygelAudioItem* _tmp14_;
	gint _tmp15_;
	RygelAudioItem* _tmp20_;
	gint _tmp21_;
#line 79 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	self = (RygelL16Transcoder*) base;
#line 79 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	g_return_val_if_fail (item != NULL, 0U);
#line 80 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp1_ = item;
#line 80 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, RYGEL_TYPE_AUDIO_ITEM)) {
#line 80 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp0_ = TRUE;
#line 608 "rygel-l16-transcoder.c"
	} else {
		RygelMediaItem* _tmp2_;
#line 80 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp2_ = item;
#line 80 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp0_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, RYGEL_TYPE_VIDEO_ITEM);
#line 615 "rygel-l16-transcoder.c"
	}
#line 80 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp3_ = _tmp0_;
#line 80 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	if (_tmp3_) {
#line 621 "rygel-l16-transcoder.c"
		guint _tmp4_;
#line 81 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp4_ = G_MAXUINT;
#line 81 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		result = _tmp4_;
#line 81 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		return result;
#line 629 "rygel-l16-transcoder.c"
	}
#line 84 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp5_ = item;
#line 84 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, RYGEL_TYPE_AUDIO_ITEM) ? ((RygelAudioItem*) _tmp5_) : NULL);
#line 84 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	audio_item = _tmp6_;
#line 85 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp7_ = 0;
#line 85 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	distance = _tmp7_;
#line 87 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp8_ = audio_item;
#line 87 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp9_ = _tmp8_->sample_freq;
#line 87 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	if (_tmp9_ > 0) {
#line 647 "rygel-l16-transcoder.c"
		guint _tmp10_;
		RygelAudioItem* _tmp11_;
		gint _tmp12_;
		gint _tmp13_ = 0;
#line 88 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp10_ = distance;
#line 88 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp11_ = audio_item;
#line 88 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp12_ = _tmp11_->sample_freq;
#line 88 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp13_ = abs (_tmp12_ - RYGEL_L16_TRANSCODER_FREQUENCY);
#line 88 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		distance = _tmp10_ + _tmp13_;
#line 662 "rygel-l16-transcoder.c"
	}
#line 91 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp14_ = audio_item;
#line 91 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp15_ = _tmp14_->channels;
#line 91 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	if (_tmp15_ > 0) {
#line 670 "rygel-l16-transcoder.c"
		guint _tmp16_;
		RygelAudioItem* _tmp17_;
		gint _tmp18_;
		gint _tmp19_ = 0;
#line 92 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp16_ = distance;
#line 92 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp17_ = audio_item;
#line 92 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp18_ = _tmp17_->channels;
#line 92 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp19_ = abs (_tmp18_ - RYGEL_L16_TRANSCODER_CHANNELS);
#line 92 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		distance = _tmp16_ + _tmp19_;
#line 685 "rygel-l16-transcoder.c"
	}
#line 95 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp20_ = audio_item;
#line 95 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_tmp21_ = _tmp20_->bits_per_sample;
#line 95 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	if (_tmp21_ > 0) {
#line 693 "rygel-l16-transcoder.c"
		guint _tmp22_;
		RygelAudioItem* _tmp23_;
		gint _tmp24_;
		gint _tmp25_ = 0;
#line 96 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp22_ = distance;
#line 96 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp23_ = audio_item;
#line 96 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp24_ = _tmp23_->bits_per_sample;
#line 96 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		_tmp25_ = abs (_tmp24_ - RYGEL_L16_TRANSCODER_WIDTH);
#line 96 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
		distance = _tmp22_ + _tmp25_;
#line 708 "rygel-l16-transcoder.c"
	}
#line 99 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	result = distance;
#line 99 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	_g_object_unref0 (audio_item);
#line 99 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	return result;
#line 716 "rygel-l16-transcoder.c"
}


static void rygel_l16_transcoder_class_init (RygelL16TranscoderClass * klass) {
#line 30 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	rygel_l16_transcoder_parent_class = g_type_class_peek_parent (klass);
#line 30 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	RYGEL_TRANSCODER_CLASS (klass)->add_resource = rygel_l16_transcoder_real_add_resource;
#line 30 "/home/jens/Source/rygel/src/librygel-server/rygel-l16-transcoder.vala"
	RYGEL_TRANSCODER_CLASS (klass)->get_distance = rygel_l16_transcoder_real_get_distance;
#line 727 "rygel-l16-transcoder.c"
}


static void rygel_l16_transcoder_instance_init (RygelL16Transcoder * self) {
}


/**
 * Transcoder for linear PCM audio (LPCM).
 */
GType rygel_l16_transcoder_get_type (void) {
	static volatile gsize rygel_l16_transcoder_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_l16_transcoder_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelL16TranscoderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_l16_transcoder_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelL16Transcoder), 0, (GInstanceInitFunc) rygel_l16_transcoder_instance_init, NULL };
		GType rygel_l16_transcoder_type_id;
		rygel_l16_transcoder_type_id = g_type_register_static (RYGEL_TYPE_AUDIO_TRANSCODER, "RygelL16Transcoder", &g_define_type_info, 0);
		g_once_init_leave (&rygel_l16_transcoder_type_id__volatile, rygel_l16_transcoder_type_id);
	}
	return rygel_l16_transcoder_type_id__volatile;
}



