/* device.c generated by valac 0.56.19, the Vala compiler
 * generated from device.vala, do not modify */

#include "rtp.h"
#include <gst/gst.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gst/base/base.h>
#include <gee.h>
#include <glib-object.h>
#include "xmpp-vala.h"
#include "libdino.h"
#include <gst/rtp/rtp.h>
#include <float.h>
#include <math.h>
#include <gst/audio/audio.h>
#include <gobject/gvaluecollector.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE (dino_plugins_rtp_device_codec_bitrate_get_type ())
#define DINO_PLUGINS_RTP_DEVICE_CODEC_BITRATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE, DinoPluginsRtpDeviceCodecBitrate))
#define DINO_PLUGINS_RTP_DEVICE_CODEC_BITRATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE, DinoPluginsRtpDeviceCodecBitrateClass))
#define DINO_PLUGINS_RTP_DEVICE_IS_CODEC_BITRATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE))
#define DINO_PLUGINS_RTP_DEVICE_IS_CODEC_BITRATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE))
#define DINO_PLUGINS_RTP_DEVICE_CODEC_BITRATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE, DinoPluginsRtpDeviceCodecBitrateClass))

typedef struct _DinoPluginsRtpDeviceCodecBitrate DinoPluginsRtpDeviceCodecBitrate;
typedef struct _DinoPluginsRtpDeviceCodecBitrateClass DinoPluginsRtpDeviceCodecBitrateClass;
enum  {
	DINO_PLUGINS_RTP_DEVICE_0_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_PLUGIN_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_CODEC_UTIL_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_DEVICE_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_ID_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_DISPLAY_NAME_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_DETAIL_NAME_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_MEDIA_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_INCOMING_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_PIPE_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_IS_SOURCE_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_IS_SINK_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_IS_MONITOR_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_IS_DEFAULT_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_PROTOCOL_PROPERTY,
	DINO_PLUGINS_RTP_DEVICE_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _gst_caps_unref0(var) ((var == NULL) ? NULL : (var = (gst_caps_unref (var), NULL)))
#define _dino_plugins_rtp_device_codec_bitrate_unref0(var) ((var == NULL) ? NULL : (var = (dino_plugins_rtp_device_codec_bitrate_unref (var), NULL)))
typedef struct _DinoPluginsRtpDeviceCodecBitratePrivate DinoPluginsRtpDeviceCodecBitratePrivate;
typedef struct _Block1Data Block1Data;
#define _xmpp_xep_jingle_rtp_payload_type_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_jingle_rtp_payload_type_unref (var), NULL)))
#define __vala_GValue_free0(var) ((var == NULL) ? NULL : (var = (_vala_GValue_free (var), NULL)))
typedef struct _Block2Data Block2Data;
typedef struct _Block3Data Block3Data;
#define _gst_structure_free0(var) ((var == NULL) ? NULL : (var = (gst_structure_free (var), NULL)))
typedef struct _DinoPluginsRtpDeviceParamSpecCodecBitrate DinoPluginsRtpDeviceParamSpecCodecBitrate;

struct _DinoPluginsRtpDevicePrivate {
	DinoPluginsRtpPlugin* _plugin;
	GstDevice* _device;
	gchar* device_name;
	gchar* device_display_name;
	GstCaps* device_caps;
	GstElement* element;
	GstElement* tee;
	GstElement* dsp;
	GstAggregator* mixer;
	GstElement* filter;
	gint links;
	GeeMap* codecs;
	GeeMap* codec_tees;
	GeeMap* payloaders;
	GeeMap* payloader_tees;
	GeeMap* payloader_links;
	GeeMap* codec_bitrates;
	GRecMutex __lock_codec_bitrates;
};

struct _DinoPluginsRtpDeviceCodecBitrate {
	GTypeInstance parent_instance;
	volatile int ref_count;
	DinoPluginsRtpDeviceCodecBitratePrivate * priv;
	guint bitrate;
	gint64 timestamp;
};

struct _DinoPluginsRtpDeviceCodecBitrateClass {
	GTypeClass parent_class;
	void (*finalize) (DinoPluginsRtpDeviceCodecBitrate *self);
};

struct _Block1Data {
	int _ref_count_;
	DinoPluginsRtpDevice* self;
	GstElement* link;
};

struct _Block2Data {
	int _ref_count_;
	DinoPluginsRtpDevice* self;
	gint linked_sink_pads;
};

struct _Block3Data {
	int _ref_count_;
	DinoPluginsRtpDevice* self;
	gint linked_src_pads;
};

struct _DinoPluginsRtpDeviceParamSpecCodecBitrate {
	GParamSpec parent_instance;
};

static gint DinoPluginsRtpDevice_private_offset;
static gpointer dino_plugins_rtp_device_parent_class = NULL;
static gpointer dino_plugins_rtp_device_codec_bitrate_parent_class = NULL;
static DinoPluginsMediaDeviceIface * dino_plugins_rtp_device_dino_plugins_media_device_parent_iface = NULL;

static gpointer dino_plugins_rtp_device_codec_bitrate_ref (gpointer instance);
static void dino_plugins_rtp_device_codec_bitrate_unref (gpointer instance);
static GParamSpec* dino_plugins_rtp_device_param_spec_codec_bitrate (const gchar* name,
                                                              const gchar* nick,
                                                              const gchar* blurb,
                                                              GType object_type,
                                                              GParamFlags flags) G_GNUC_UNUSED ;
static void dino_plugins_rtp_device_value_set_codec_bitrate (GValue* value,
                                                      gpointer v_object) G_GNUC_UNUSED ;
static void dino_plugins_rtp_device_value_take_codec_bitrate (GValue* value,
                                                       gpointer v_object) G_GNUC_UNUSED ;
static gpointer dino_plugins_rtp_device_value_get_codec_bitrate (const GValue* value) G_GNUC_UNUSED ;
static GType dino_plugins_rtp_device_codec_bitrate_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static guint _xmpp_xep_jingle_rtp_payload_type_hash_func_gee_hash_data_func (gconstpointer v,
                                                                      gpointer self);
static gboolean _xmpp_xep_jingle_rtp_payload_type_equals_func_gee_equal_data_func (gconstpointer a,
                                                                            gconstpointer b,
                                                                            gpointer self);
static void dino_plugins_rtp_device_set_plugin (DinoPluginsRtpDevice* self,
                                         DinoPluginsRtpPlugin* value);
static void dino_plugins_rtp_device_set_device (DinoPluginsRtpDevice* self,
                                         GstDevice* value);
static void dino_plugins_rtp_device_create (DinoPluginsRtpDevice* self);
static gdouble dino_plugins_rtp_device_get_target_bitrate (GstCaps* caps);
static GstCaps* dino_plugins_rtp_device_get_active_caps (DinoPluginsRtpDevice* self,
                                                  XmppXepJingleRtpPayloadType* payload_type);
static void dino_plugins_rtp_device_apply_caps (DinoPluginsRtpDevice* self,
                                         XmppXepJingleRtpPayloadType* payload_type,
                                         GstCaps* caps);
static void dino_plugins_rtp_device_apply_width (DinoPluginsRtpDevice* self,
                                          XmppXepJingleRtpPayloadType* payload_type,
                                          gint new_width,
                                          guint bitrate);
static DinoPluginsRtpDeviceCodecBitrate* dino_plugins_rtp_device_codec_bitrate_new (guint bitrate);
static DinoPluginsRtpDeviceCodecBitrate* dino_plugins_rtp_device_codec_bitrate_construct (GType object_type,
                                                                                   guint bitrate);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static gboolean ___lambda5_ (Block1Data* _data1_,
                      GeeMapEntry* entry);
static gboolean __lambda6_ (Block1Data* _data1_,
                     GeeMapEntry* entry);
static gboolean ___lambda6__gee_predicate (gconstpointer g,
                                    gpointer self);
static gboolean ____lambda5__gee_predicate (gconstpointer g,
                                     gpointer self);
static gboolean ___lambda7_ (Block1Data* _data1_,
                      GeeMapEntry* entry);
static gboolean ____lambda7__gee_predicate (gconstpointer g,
                                     gpointer self);
static void dino_plugins_rtp_device_destroy (DinoPluginsRtpDevice* self);
static GstCaps* dino_plugins_rtp_device_get_best_caps (DinoPluginsRtpDevice* self);
static void _vala_GValue_free (GValue* self);
static GValue* _g_value_dup (GValue* self);
static GstCaps* dino_plugins_rtp_device_caps_copy_nth (GstCaps* source,
                                                guint index);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static gboolean ____lambda8_ (Block2Data* _data2_,
                       GstElement* _,
                       GstPad* pad);
static gboolean _____lambda8__gst_element_foreach_pad_func (GstElement* element,
                                                     GstPad* pad,
                                                     gpointer self);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static gboolean ____lambda9_ (Block3Data* _data3_,
                       GstElement* _,
                       GstPad* pad);
static gboolean _____lambda9__gst_element_foreach_pad_func (GstElement* element,
                                                     GstPad* pad,
                                                     gpointer self);
static void dino_plugins_rtp_device_codec_bitrate_finalize (DinoPluginsRtpDeviceCodecBitrate * obj);
static GType dino_plugins_rtp_device_codec_bitrate_get_type_once (void);
static void dino_plugins_rtp_device_finalize (GObject * obj);
static GType dino_plugins_rtp_device_get_type_once (void);
static void _vala_dino_plugins_rtp_device_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_dino_plugins_rtp_device_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);

static const gint DINO_PLUGINS_RTP_DEVICE_common_widths[10] = {320, 352, 416, 480, 640, 960, 1280, 1920, 2560, 3840};

static GType
dino_plugins_rtp_device_protocol_get_type_once (void)
{
	static const GEnumValue values[] = {{DINO_PLUGINS_RTP_DEVICE_PROTOCOL_OTHER, "DINO_PLUGINS_RTP_DEVICE_PROTOCOL_OTHER", "other"}, {DINO_PLUGINS_RTP_DEVICE_PROTOCOL_PIPEWIRE, "DINO_PLUGINS_RTP_DEVICE_PROTOCOL_PIPEWIRE", "pipewire"}, {DINO_PLUGINS_RTP_DEVICE_PROTOCOL_V4L2, "DINO_PLUGINS_RTP_DEVICE_PROTOCOL_V4L2", "v4l2"}, {DINO_PLUGINS_RTP_DEVICE_PROTOCOL_PULSEAUDIO, "DINO_PLUGINS_RTP_DEVICE_PROTOCOL_PULSEAUDIO", "pulseaudio"}, {DINO_PLUGINS_RTP_DEVICE_PROTOCOL_ALSA, "DINO_PLUGINS_RTP_DEVICE_PROTOCOL_ALSA", "alsa"}, {0, NULL, NULL}};
	GType dino_plugins_rtp_device_protocol_type_id;
	dino_plugins_rtp_device_protocol_type_id = g_enum_register_static ("DinoPluginsRtpDeviceProtocol", values);
	return dino_plugins_rtp_device_protocol_type_id;
}

GType
dino_plugins_rtp_device_protocol_get_type (void)
{
	static volatile gsize dino_plugins_rtp_device_protocol_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_rtp_device_protocol_type_id__once)) {
		GType dino_plugins_rtp_device_protocol_type_id;
		dino_plugins_rtp_device_protocol_type_id = dino_plugins_rtp_device_protocol_get_type_once ();
		g_once_init_leave (&dino_plugins_rtp_device_protocol_type_id__once, dino_plugins_rtp_device_protocol_type_id);
	}
	return dino_plugins_rtp_device_protocol_type_id__once;
}

static inline gpointer
dino_plugins_rtp_device_get_instance_private (DinoPluginsRtpDevice* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsRtpDevice_private_offset);
}

static guint
_xmpp_xep_jingle_rtp_payload_type_hash_func_gee_hash_data_func (gconstpointer v,
                                                                gpointer self)
{
	guint result;
	result = xmpp_xep_jingle_rtp_payload_type_hash_func ((XmppXepJingleRtpPayloadType*) v);
	return result;
}

static gboolean
_xmpp_xep_jingle_rtp_payload_type_equals_func_gee_equal_data_func (gconstpointer a,
                                                                   gconstpointer b,
                                                                   gpointer self)
{
	gboolean result;
	result = xmpp_xep_jingle_rtp_payload_type_equals_func ((XmppXepJingleRtpPayloadType*) a, (XmppXepJingleRtpPayloadType*) b);
	return result;
}

DinoPluginsRtpDevice*
dino_plugins_rtp_device_construct (GType object_type,
                                   DinoPluginsRtpPlugin* plugin,
                                   GstDevice* device)
{
	DinoPluginsRtpDevice * self = NULL;
	g_return_val_if_fail (plugin != NULL, NULL);
	g_return_val_if_fail (device != NULL, NULL);
	self = (DinoPluginsRtpDevice*) g_object_new (object_type, NULL);
	dino_plugins_rtp_device_set_plugin (self, plugin);
	dino_plugins_rtp_device_update (self, device);
	return self;
}

DinoPluginsRtpDevice*
dino_plugins_rtp_device_new (DinoPluginsRtpPlugin* plugin,
                             GstDevice* device)
{
	return dino_plugins_rtp_device_construct (DINO_PLUGINS_RTP_TYPE_DEVICE, plugin, device);
}

gboolean
dino_plugins_rtp_device_matches (DinoPluginsRtpDevice* self,
                                 GstDevice* device)
{
	GstDevice* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gboolean _tmp7_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (device != NULL, FALSE);
	_tmp0_ = self->priv->_device;
	_tmp1_ = gst_object_get_name ((GstObject*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = gst_object_get_name ((GstObject*) device);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strcmp0 (_tmp3_, _tmp6_) == 0;
	_g_free0 (_tmp6_);
	_g_free0 (_tmp3_);
	if (_tmp7_) {
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

void
dino_plugins_rtp_device_update (DinoPluginsRtpDevice* self,
                                GstDevice* device)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (device != NULL);
	dino_plugins_rtp_device_set_device (self, device);
	_tmp0_ = gst_object_get_name ((GstObject*) device);
	_tmp1_ = _tmp0_;
	_g_free0 (self->priv->device_name);
	self->priv->device_name = _tmp1_;
	_tmp2_ = gst_device_get_display_name (device);
	_tmp3_ = _tmp2_;
	_g_free0 (self->priv->device_display_name);
	self->priv->device_display_name = _tmp3_;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

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

GstElement*
dino_plugins_rtp_device_link_sink (DinoPluginsRtpDevice* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	GstElement* _tmp2_;
	gint _tmp3_;
	GstAggregator* _tmp4_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gboolean _tmp23_;
	GstElement* _tmp26_;
	GstElement* _tmp27_;
	GstElement* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_device_get_is_sink (self);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		result = NULL;
		return result;
	}
	_tmp2_ = self->priv->element;
	if (_tmp2_ == NULL) {
		dino_plugins_rtp_device_create (self);
	}
	_tmp3_ = self->priv->links;
	self->priv->links = _tmp3_ + 1;
	_tmp4_ = self->priv->mixer;
	if (_tmp4_ != NULL) {
		GstElement* rate = NULL;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		const gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		GstElement* _tmp13_;
		GstElement* _tmp14_;
		GstPipeline* _tmp15_;
		GstPipeline* _tmp16_;
		GstElement* _tmp17_;
		GstElement* _tmp18_;
		GstAggregator* _tmp19_;
		_tmp5_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
		_tmp6_ = _tmp5_;
		_tmp7_ = _tmp6_;
		_tmp8_ = string_to_string (_tmp7_);
		_tmp9_ = g_strdup_printf ("%u", g_random_int ());
		_tmp10_ = _tmp9_;
		_tmp11_ = g_strconcat (_tmp8_, "_rate_", _tmp10_, NULL);
		_tmp12_ = _tmp11_;
		_tmp13_ = gst_element_factory_make ("audiorate", _tmp12_);
		if (_tmp13_ != NULL) {
			g_object_ref_sink (_tmp13_);
		}
		_tmp14_ = _tmp13_;
		_g_free0 (_tmp12_);
		_g_free0 (_tmp10_);
		_g_free0 (_tmp7_);
		rate = _tmp14_;
		_tmp15_ = dino_plugins_rtp_device_get_pipe (self);
		_tmp16_ = _tmp15_;
		_tmp17_ = rate;
		gst_bin_add ((GstBin*) _tmp16_, _tmp17_);
		_tmp18_ = rate;
		_tmp19_ = self->priv->mixer;
		gst_element_link (_tmp18_, (GstElement*) _tmp19_);
		result = rate;
		return result;
	}
	_tmp20_ = dino_plugins_media_device_get_media ((DinoPluginsMediaDevice*) self);
	_tmp21_ = _tmp20_;
	_tmp22_ = _tmp21_;
	_tmp23_ = g_strcmp0 (_tmp22_, "audio") == 0;
	_g_free0 (_tmp22_);
	if (_tmp23_) {
		GstElement* _tmp24_;
		GstElement* _tmp25_;
		_tmp24_ = self->priv->filter;
		_tmp25_ = _g_object_ref0 (_tmp24_);
		result = _tmp25_;
		return result;
	}
	_tmp26_ = self->priv->element;
	_tmp27_ = _g_object_ref0 (_tmp26_);
	result = _tmp27_;
	return result;
}

GstElement*
dino_plugins_rtp_device_link_source (DinoPluginsRtpDevice* self,
                                     XmppXepJingleRtpPayloadType* payload_type,
                                     guint ssrc,
                                     gint seqnum_offset,
                                     guint32 timestamp_offset)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	GstElement* _tmp2_;
	gint _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	GstElement* _tmp199_;
	GstElement* _tmp202_;
	GstElement* _tmp203_;
	GstElement* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_device_get_is_source (self);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		result = NULL;
		return result;
	}
	_tmp2_ = self->priv->element;
	if (_tmp2_ == NULL) {
		dino_plugins_rtp_device_create (self);
	}
	_tmp3_ = self->priv->links;
	self->priv->links = _tmp3_ + 1;
	if (payload_type != NULL) {
		_tmp5_ = ssrc != ((guint) 0);
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		GstElement* _tmp6_;
		_tmp6_ = self->priv->tee;
		_tmp4_ = _tmp6_ != NULL;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		gboolean new_codec = FALSE;
		gchar* codec = NULL;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		GeeMap* _tmp12_;
		GeeMap* _tmp34_;
		GeeMap* _tmp60_;
		GeeMap* _tmp64_;
		gpointer _tmp65_;
		GeeMap* _tmp66_;
		gboolean _tmp67_;
		GeeMap* _tmp127_;
		GeeMap* _tmp131_;
		gpointer _tmp132_;
		GeeMap* _tmp133_;
		gboolean _tmp134_;
		GeeMap* _tmp172_;
		GeeMap* _tmp176_;
		gpointer _tmp177_;
		GeeMap* _tmp178_;
		gboolean _tmp179_;
		GeeMap* _tmp194_;
		gpointer _tmp195_;
		GeeMap* _tmp196_;
		gpointer _tmp197_;
		GstElement* _tmp198_;
		new_codec = FALSE;
		_tmp7_ = dino_plugins_media_device_get_media ((DinoPluginsMediaDevice*) self);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp10_ = dino_plugins_rtp_codec_util_get_codec_from_payload (_tmp9_, payload_type);
		_tmp11_ = _tmp10_;
		_g_free0 (_tmp9_);
		codec = _tmp11_;
		_tmp12_ = self->priv->codecs;
		if (!gee_map_has_key (_tmp12_, payload_type)) {
			GeeMap* _tmp13_;
			DinoPluginsRtpCodecUtil* _tmp14_;
			DinoPluginsRtpCodecUtil* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			gchar* _tmp19_;
			gchar* _tmp20_;
			gchar* _tmp21_;
			const gchar* _tmp22_;
			const gchar* _tmp23_;
			const gchar* _tmp24_;
			gchar* _tmp25_;
			gchar* _tmp26_;
			GstElement* _tmp27_;
			GstElement* _tmp28_;
			GstPipeline* _tmp29_;
			GstPipeline* _tmp30_;
			GeeMap* _tmp31_;
			gpointer _tmp32_;
			GstElement* _tmp33_;
			_tmp13_ = self->priv->codecs;
			_tmp14_ = dino_plugins_rtp_device_get_codec_util (self);
			_tmp15_ = _tmp14_;
			_tmp16_ = dino_plugins_media_device_get_media ((DinoPluginsMediaDevice*) self);
			_tmp17_ = _tmp16_;
			_tmp18_ = _tmp17_;
			_tmp19_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
			_tmp20_ = _tmp19_;
			_tmp21_ = _tmp20_;
			_tmp22_ = string_to_string (_tmp21_);
			_tmp23_ = codec;
			_tmp24_ = string_to_string (_tmp23_);
			_tmp25_ = g_strconcat (_tmp22_, "_", _tmp24_, "_encoder", NULL);
			_tmp26_ = _tmp25_;
			_tmp27_ = dino_plugins_rtp_codec_util_get_encode_bin_without_payloader (_tmp15_, _tmp18_, payload_type, _tmp26_);
			_tmp28_ = _tmp27_;
			gee_map_set (_tmp13_, payload_type, _tmp28_);
			_g_object_unref0 (_tmp28_);
			_g_free0 (_tmp26_);
			_g_free0 (_tmp21_);
			_g_free0 (_tmp18_);
			_tmp29_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp30_ = _tmp29_;
			_tmp31_ = self->priv->codecs;
			_tmp32_ = gee_map_get (_tmp31_, payload_type);
			_tmp33_ = (GstElement*) _tmp32_;
			gst_bin_add ((GstBin*) _tmp30_, _tmp33_);
			_g_object_unref0 (_tmp33_);
			new_codec = TRUE;
		}
		_tmp34_ = self->priv->codec_tees;
		if (!gee_map_has_key (_tmp34_, payload_type)) {
			GeeMap* _tmp35_;
			gchar* _tmp36_;
			gchar* _tmp37_;
			gchar* _tmp38_;
			const gchar* _tmp39_;
			const gchar* _tmp40_;
			const gchar* _tmp41_;
			gchar* _tmp42_;
			gchar* _tmp43_;
			GstElement* _tmp44_;
			GstElement* _tmp45_;
			GeeMap* _tmp46_;
			gpointer _tmp47_;
			GstElement* _tmp48_;
			GstPipeline* _tmp49_;
			GstPipeline* _tmp50_;
			GeeMap* _tmp51_;
			gpointer _tmp52_;
			GstElement* _tmp53_;
			GeeMap* _tmp54_;
			gpointer _tmp55_;
			GstElement* _tmp56_;
			GeeMap* _tmp57_;
			gpointer _tmp58_;
			GstElement* _tmp59_;
			_tmp35_ = self->priv->codec_tees;
			_tmp36_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
			_tmp37_ = _tmp36_;
			_tmp38_ = _tmp37_;
			_tmp39_ = string_to_string (_tmp38_);
			_tmp40_ = codec;
			_tmp41_ = string_to_string (_tmp40_);
			_tmp42_ = g_strconcat (_tmp39_, "_", _tmp41_, "_tee", NULL);
			_tmp43_ = _tmp42_;
			_tmp44_ = gst_element_factory_make ("tee", _tmp43_);
			if (_tmp44_ != NULL) {
				g_object_ref_sink (_tmp44_);
			}
			_tmp45_ = _tmp44_;
			gee_map_set (_tmp35_, payload_type, _tmp45_);
			_g_object_unref0 (_tmp45_);
			_g_free0 (_tmp43_);
			_g_free0 (_tmp38_);
			_tmp46_ = self->priv->codec_tees;
			_tmp47_ = gee_map_get (_tmp46_, payload_type);
			_tmp48_ = (GstElement*) _tmp47_;
			g_object_set ((GObject*) _tmp48_, "allow-not-linked", TRUE, NULL);
			_g_object_unref0 (_tmp48_);
			_tmp49_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp50_ = _tmp49_;
			_tmp51_ = self->priv->codec_tees;
			_tmp52_ = gee_map_get (_tmp51_, payload_type);
			_tmp53_ = (GstElement*) _tmp52_;
			gst_bin_add ((GstBin*) _tmp50_, _tmp53_);
			_g_object_unref0 (_tmp53_);
			_tmp54_ = self->priv->codecs;
			_tmp55_ = gee_map_get (_tmp54_, payload_type);
			_tmp56_ = (GstElement*) _tmp55_;
			_tmp57_ = self->priv->codec_tees;
			_tmp58_ = gee_map_get (_tmp57_, payload_type);
			_tmp59_ = (GstElement*) _tmp58_;
			gst_element_link (_tmp56_, _tmp59_);
			_g_object_unref0 (_tmp59_);
			_g_object_unref0 (_tmp56_);
		}
		_tmp60_ = self->priv->payloaders;
		if (!gee_map_has_key (_tmp60_, payload_type)) {
			GeeMap* _tmp61_;
			GeeHashMap* _tmp62_;
			GeeHashMap* _tmp63_;
			_tmp61_ = self->priv->payloaders;
			_tmp62_ = gee_hash_map_new (G_TYPE_UINT, NULL, NULL, gst_element_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
			_tmp63_ = _tmp62_;
			gee_map_set (_tmp61_, payload_type, (GeeMap*) _tmp63_);
			_g_object_unref0 (_tmp63_);
		}
		_tmp64_ = self->priv->payloaders;
		_tmp65_ = gee_map_get (_tmp64_, payload_type);
		_tmp66_ = (GeeMap*) _tmp65_;
		_tmp67_ = !gee_map_has_key (_tmp66_, (gpointer) ((guintptr) ssrc));
		_g_object_unref0 (_tmp66_);
		if (_tmp67_) {
			GeeMap* _tmp68_;
			gpointer _tmp69_;
			GeeMap* _tmp70_;
			DinoPluginsRtpCodecUtil* _tmp71_;
			DinoPluginsRtpCodecUtil* _tmp72_;
			gchar* _tmp73_;
			gchar* _tmp74_;
			gchar* _tmp75_;
			gchar* _tmp76_;
			gchar* _tmp77_;
			gchar* _tmp78_;
			const gchar* _tmp79_;
			const gchar* _tmp80_;
			const gchar* _tmp81_;
			gchar* _tmp82_;
			gchar* _tmp83_;
			gchar* _tmp84_;
			gchar* _tmp85_;
			GstElement* _tmp86_;
			GstElement* _tmp87_;
			GstRTPBasePayload* payload = NULL;
			GeeMap* _tmp88_;
			gpointer _tmp89_;
			GeeMap* _tmp90_;
			gpointer _tmp91_;
			GstBin* _tmp92_;
			gchar* _tmp93_;
			gchar* _tmp94_;
			gchar* _tmp95_;
			const gchar* _tmp96_;
			const gchar* _tmp97_;
			const gchar* _tmp98_;
			gchar* _tmp99_;
			gchar* _tmp100_;
			gchar* _tmp101_;
			gchar* _tmp102_;
			GstElement* _tmp103_;
			GstRTPBasePayload* _tmp104_;
			GstRTPBasePayload* _tmp105_;
			GstRTPBasePayload* _tmp106_;
			GstPipeline* _tmp108_;
			GstPipeline* _tmp109_;
			GeeMap* _tmp110_;
			gpointer _tmp111_;
			GeeMap* _tmp112_;
			gpointer _tmp113_;
			GstElement* _tmp114_;
			GeeMap* _tmp115_;
			gpointer _tmp116_;
			GstElement* _tmp117_;
			GeeMap* _tmp118_;
			gpointer _tmp119_;
			GeeMap* _tmp120_;
			gpointer _tmp121_;
			GstElement* _tmp122_;
			gchar* _tmp123_;
			gchar* _tmp124_;
			gchar* _tmp125_;
			const gchar* _tmp126_;
			_tmp68_ = self->priv->payloaders;
			_tmp69_ = gee_map_get (_tmp68_, payload_type);
			_tmp70_ = (GeeMap*) _tmp69_;
			_tmp71_ = dino_plugins_rtp_device_get_codec_util (self);
			_tmp72_ = _tmp71_;
			_tmp73_ = dino_plugins_media_device_get_media ((DinoPluginsMediaDevice*) self);
			_tmp74_ = _tmp73_;
			_tmp75_ = _tmp74_;
			_tmp76_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
			_tmp77_ = _tmp76_;
			_tmp78_ = _tmp77_;
			_tmp79_ = string_to_string (_tmp78_);
			_tmp80_ = codec;
			_tmp81_ = string_to_string (_tmp80_);
			_tmp82_ = g_strdup_printf ("%u", ssrc);
			_tmp83_ = _tmp82_;
			_tmp84_ = g_strconcat (_tmp79_, "_", _tmp81_, "_", _tmp83_, NULL);
			_tmp85_ = _tmp84_;
			_tmp86_ = dino_plugins_rtp_codec_util_get_payloader_bin (_tmp72_, _tmp75_, payload_type, _tmp85_);
			_tmp87_ = _tmp86_;
			gee_map_set (_tmp70_, (gpointer) ((guintptr) ssrc), _tmp87_);
			_g_object_unref0 (_tmp87_);
			_g_free0 (_tmp85_);
			_g_free0 (_tmp83_);
			_g_free0 (_tmp78_);
			_g_free0 (_tmp75_);
			_g_object_unref0 (_tmp70_);
			_tmp88_ = self->priv->payloaders;
			_tmp89_ = gee_map_get (_tmp88_, payload_type);
			_tmp90_ = (GeeMap*) _tmp89_;
			_tmp91_ = gee_map_get (_tmp90_, (gpointer) ((guintptr) ssrc));
			_tmp92_ = G_TYPE_CHECK_INSTANCE_CAST ((GstElement*) _tmp91_, gst_bin_get_type (), GstBin);
			_tmp93_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
			_tmp94_ = _tmp93_;
			_tmp95_ = _tmp94_;
			_tmp96_ = string_to_string (_tmp95_);
			_tmp97_ = codec;
			_tmp98_ = string_to_string (_tmp97_);
			_tmp99_ = g_strdup_printf ("%u", ssrc);
			_tmp100_ = _tmp99_;
			_tmp101_ = g_strconcat (_tmp96_, "_", _tmp98_, "_", _tmp100_, "_rtp_pay", NULL);
			_tmp102_ = _tmp101_;
			_tmp103_ = gst_bin_get_by_name (_tmp92_, _tmp102_);
			_tmp104_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp103_, gst_rtp_base_payload_get_type (), GstRTPBasePayload);
			_g_free0 (_tmp102_);
			_g_free0 (_tmp100_);
			_g_free0 (_tmp95_);
			_g_object_unref0 (_tmp92_);
			_g_object_unref0 (_tmp90_);
			payload = _tmp104_;
			_tmp105_ = payload;
			g_object_set (_tmp105_, "ssrc", ssrc, NULL);
			_tmp106_ = payload;
			g_object_set (_tmp106_, "seqnum-offset", seqnum_offset, NULL);
			if (timestamp_offset != ((guint32) 0)) {
				GstRTPBasePayload* _tmp107_;
				_tmp107_ = payload;
				g_object_set (_tmp107_, "timestamp-offset", (guint) timestamp_offset, NULL);
			}
			_tmp108_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp109_ = _tmp108_;
			_tmp110_ = self->priv->payloaders;
			_tmp111_ = gee_map_get (_tmp110_, payload_type);
			_tmp112_ = (GeeMap*) _tmp111_;
			_tmp113_ = gee_map_get (_tmp112_, (gpointer) ((guintptr) ssrc));
			_tmp114_ = (GstElement*) _tmp113_;
			gst_bin_add ((GstBin*) _tmp109_, _tmp114_);
			_g_object_unref0 (_tmp114_);
			_g_object_unref0 (_tmp112_);
			_tmp115_ = self->priv->codec_tees;
			_tmp116_ = gee_map_get (_tmp115_, payload_type);
			_tmp117_ = (GstElement*) _tmp116_;
			_tmp118_ = self->priv->payloaders;
			_tmp119_ = gee_map_get (_tmp118_, payload_type);
			_tmp120_ = (GeeMap*) _tmp119_;
			_tmp121_ = gee_map_get (_tmp120_, (gpointer) ((guintptr) ssrc));
			_tmp122_ = (GstElement*) _tmp121_;
			gst_element_link (_tmp117_, _tmp122_);
			_g_object_unref0 (_tmp122_);
			_g_object_unref0 (_tmp120_);
			_g_object_unref0 (_tmp117_);
			_tmp123_ = dino_plugins_media_device_get_media ((DinoPluginsMediaDevice*) self);
			_tmp124_ = _tmp123_;
			_tmp125_ = _tmp124_;
			_tmp126_ = codec;
			g_debug ("device.vala:152: Payload for %s with %s using ssrc %u, seqnum_offset %" \
"u, timestamp_offset %u", _tmp125_, _tmp126_, ssrc, (guint) seqnum_offset, (guint) timestamp_offset);
			_g_free0 (_tmp125_);
			_g_object_unref0 (payload);
		}
		_tmp127_ = self->priv->payloader_tees;
		if (!gee_map_has_key (_tmp127_, payload_type)) {
			GeeMap* _tmp128_;
			GeeHashMap* _tmp129_;
			GeeHashMap* _tmp130_;
			_tmp128_ = self->priv->payloader_tees;
			_tmp129_ = gee_hash_map_new (G_TYPE_UINT, NULL, NULL, gst_element_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
			_tmp130_ = _tmp129_;
			gee_map_set (_tmp128_, payload_type, (GeeMap*) _tmp130_);
			_g_object_unref0 (_tmp130_);
		}
		_tmp131_ = self->priv->payloader_tees;
		_tmp132_ = gee_map_get (_tmp131_, payload_type);
		_tmp133_ = (GeeMap*) _tmp132_;
		_tmp134_ = !gee_map_has_key (_tmp133_, (gpointer) ((guintptr) ssrc));
		_g_object_unref0 (_tmp133_);
		if (_tmp134_) {
			GeeMap* _tmp135_;
			gpointer _tmp136_;
			GeeMap* _tmp137_;
			gchar* _tmp138_;
			gchar* _tmp139_;
			gchar* _tmp140_;
			const gchar* _tmp141_;
			const gchar* _tmp142_;
			const gchar* _tmp143_;
			gchar* _tmp144_;
			gchar* _tmp145_;
			gchar* _tmp146_;
			gchar* _tmp147_;
			GstElement* _tmp148_;
			GstElement* _tmp149_;
			GeeMap* _tmp150_;
			gpointer _tmp151_;
			GeeMap* _tmp152_;
			gpointer _tmp153_;
			GstElement* _tmp154_;
			GstPipeline* _tmp155_;
			GstPipeline* _tmp156_;
			GeeMap* _tmp157_;
			gpointer _tmp158_;
			GeeMap* _tmp159_;
			gpointer _tmp160_;
			GstElement* _tmp161_;
			GeeMap* _tmp162_;
			gpointer _tmp163_;
			GeeMap* _tmp164_;
			gpointer _tmp165_;
			GstElement* _tmp166_;
			GeeMap* _tmp167_;
			gpointer _tmp168_;
			GeeMap* _tmp169_;
			gpointer _tmp170_;
			GstElement* _tmp171_;
			_tmp135_ = self->priv->payloader_tees;
			_tmp136_ = gee_map_get (_tmp135_, payload_type);
			_tmp137_ = (GeeMap*) _tmp136_;
			_tmp138_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
			_tmp139_ = _tmp138_;
			_tmp140_ = _tmp139_;
			_tmp141_ = string_to_string (_tmp140_);
			_tmp142_ = codec;
			_tmp143_ = string_to_string (_tmp142_);
			_tmp144_ = g_strdup_printf ("%u", ssrc);
			_tmp145_ = _tmp144_;
			_tmp146_ = g_strconcat (_tmp141_, "_", _tmp143_, "_", _tmp145_, "_tee", NULL);
			_tmp147_ = _tmp146_;
			_tmp148_ = gst_element_factory_make ("tee", _tmp147_);
			if (_tmp148_ != NULL) {
				g_object_ref_sink (_tmp148_);
			}
			_tmp149_ = _tmp148_;
			gee_map_set (_tmp137_, (gpointer) ((guintptr) ssrc), _tmp149_);
			_g_object_unref0 (_tmp149_);
			_g_free0 (_tmp147_);
			_g_free0 (_tmp145_);
			_g_free0 (_tmp140_);
			_g_object_unref0 (_tmp137_);
			_tmp150_ = self->priv->payloader_tees;
			_tmp151_ = gee_map_get (_tmp150_, payload_type);
			_tmp152_ = (GeeMap*) _tmp151_;
			_tmp153_ = gee_map_get (_tmp152_, (gpointer) ((guintptr) ssrc));
			_tmp154_ = (GstElement*) _tmp153_;
			g_object_set ((GObject*) _tmp154_, "allow-not-linked", TRUE, NULL);
			_g_object_unref0 (_tmp154_);
			_g_object_unref0 (_tmp152_);
			_tmp155_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp156_ = _tmp155_;
			_tmp157_ = self->priv->payloader_tees;
			_tmp158_ = gee_map_get (_tmp157_, payload_type);
			_tmp159_ = (GeeMap*) _tmp158_;
			_tmp160_ = gee_map_get (_tmp159_, (gpointer) ((guintptr) ssrc));
			_tmp161_ = (GstElement*) _tmp160_;
			gst_bin_add ((GstBin*) _tmp156_, _tmp161_);
			_g_object_unref0 (_tmp161_);
			_g_object_unref0 (_tmp159_);
			_tmp162_ = self->priv->payloaders;
			_tmp163_ = gee_map_get (_tmp162_, payload_type);
			_tmp164_ = (GeeMap*) _tmp163_;
			_tmp165_ = gee_map_get (_tmp164_, (gpointer) ((guintptr) ssrc));
			_tmp166_ = (GstElement*) _tmp165_;
			_tmp167_ = self->priv->payloader_tees;
			_tmp168_ = gee_map_get (_tmp167_, payload_type);
			_tmp169_ = (GeeMap*) _tmp168_;
			_tmp170_ = gee_map_get (_tmp169_, (gpointer) ((guintptr) ssrc));
			_tmp171_ = (GstElement*) _tmp170_;
			gst_element_link (_tmp166_, _tmp171_);
			_g_object_unref0 (_tmp171_);
			_g_object_unref0 (_tmp169_);
			_g_object_unref0 (_tmp166_);
			_g_object_unref0 (_tmp164_);
		}
		_tmp172_ = self->priv->payloader_links;
		if (!gee_map_has_key (_tmp172_, payload_type)) {
			GeeMap* _tmp173_;
			GeeHashMap* _tmp174_;
			GeeHashMap* _tmp175_;
			_tmp173_ = self->priv->payloader_links;
			_tmp174_ = gee_hash_map_new (G_TYPE_UINT, NULL, NULL, G_TYPE_UINT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
			_tmp175_ = _tmp174_;
			gee_map_set (_tmp173_, payload_type, (GeeMap*) _tmp175_);
			_g_object_unref0 (_tmp175_);
		}
		_tmp176_ = self->priv->payloader_links;
		_tmp177_ = gee_map_get (_tmp176_, payload_type);
		_tmp178_ = (GeeMap*) _tmp177_;
		_tmp179_ = !gee_map_has_key (_tmp178_, (gpointer) ((guintptr) ssrc));
		_g_object_unref0 (_tmp178_);
		if (_tmp179_) {
			GeeMap* _tmp180_;
			gpointer _tmp181_;
			GeeMap* _tmp182_;
			_tmp180_ = self->priv->payloader_links;
			_tmp181_ = gee_map_get (_tmp180_, payload_type);
			_tmp182_ = (GeeMap*) _tmp181_;
			gee_map_set (_tmp182_, (gpointer) ((guintptr) ssrc), (gpointer) ((guintptr) 1));
			_g_object_unref0 (_tmp182_);
		} else {
			GeeMap* _tmp183_;
			gpointer _tmp184_;
			GeeMap* _tmp185_;
			GeeMap* _tmp186_;
			gpointer _tmp187_;
			GeeMap* _tmp188_;
			gpointer _tmp189_;
			_tmp183_ = self->priv->payloader_links;
			_tmp184_ = gee_map_get (_tmp183_, payload_type);
			_tmp185_ = (GeeMap*) _tmp184_;
			_tmp186_ = self->priv->payloader_links;
			_tmp187_ = gee_map_get (_tmp186_, payload_type);
			_tmp188_ = (GeeMap*) _tmp187_;
			_tmp189_ = gee_map_get (_tmp188_, (gpointer) ((guintptr) ssrc));
			gee_map_set (_tmp185_, (gpointer) ((guintptr) ssrc), (gpointer) ((guintptr) (((guint) ((guintptr) _tmp189_)) + 1)));
			_g_object_unref0 (_tmp188_);
			_g_object_unref0 (_tmp185_);
		}
		if (new_codec) {
			GstElement* _tmp190_;
			GeeMap* _tmp191_;
			gpointer _tmp192_;
			GstElement* _tmp193_;
			_tmp190_ = self->priv->tee;
			_tmp191_ = self->priv->codecs;
			_tmp192_ = gee_map_get (_tmp191_, payload_type);
			_tmp193_ = (GstElement*) _tmp192_;
			gst_element_link (_tmp190_, _tmp193_);
			_g_object_unref0 (_tmp193_);
		}
		_tmp194_ = self->priv->payloader_tees;
		_tmp195_ = gee_map_get (_tmp194_, payload_type);
		_tmp196_ = (GeeMap*) _tmp195_;
		_tmp197_ = gee_map_get (_tmp196_, (gpointer) ((guintptr) ssrc));
		_tmp198_ = (GstElement*) _tmp197_;
		_g_object_unref0 (_tmp196_);
		result = _tmp198_;
		_g_free0 (codec);
		return result;
	}
	_tmp199_ = self->priv->tee;
	if (_tmp199_ != NULL) {
		GstElement* _tmp200_;
		GstElement* _tmp201_;
		_tmp200_ = self->priv->tee;
		_tmp201_ = _g_object_ref0 (_tmp200_);
		result = _tmp201_;
		return result;
	}
	_tmp202_ = self->priv->element;
	_tmp203_ = _g_object_ref0 (_tmp202_);
	result = _tmp203_;
	return result;
}

static gdouble
dino_plugins_rtp_device_get_target_bitrate (GstCaps* caps)
{
	gboolean _tmp0_ = FALSE;
	GstStructure* that = NULL;
	GstStructure* _tmp1_;
	gint num = 0;
	gint den = 0;
	gint width = 0;
	gint height = 0;
	gboolean _tmp2_ = FALSE;
	GstStructure* _tmp3_;
	gboolean _tmp7_ = FALSE;
	GstStructure* _tmp8_;
	GstStructure* _tmp12_;
	GValue framerate = {0};
	GstStructure* _tmp13_;
	GValue _tmp14_;
	GValue _tmp15_ = {0};
	GValue _tmp16_;
	GValue _tmp17_;
	gdouble pxs = 0.0;
	gdouble br = 0.0;
	gdouble result;
	g_return_val_if_fail (caps != NULL, -1.0);
	if (caps == NULL) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = gst_caps_get_size (caps) == ((guint) 0);
	}
	if (_tmp0_) {
		result = (gdouble) G_MAXUINT;
		return result;
	}
	_tmp1_ = gst_caps_get_structure (caps, (guint) 0);
	that = _tmp1_;
	num = 0;
	den = 0;
	width = 0;
	height = 0;
	_tmp3_ = that;
	if (!gst_structure_has_field (_tmp3_, "width")) {
		_tmp2_ = TRUE;
	} else {
		GstStructure* _tmp4_;
		gint _tmp5_ = 0;
		gboolean _tmp6_;
		_tmp4_ = that;
		_tmp6_ = gst_structure_get_int (_tmp4_, "width", &_tmp5_);
		width = _tmp5_;
		_tmp2_ = !_tmp6_;
	}
	if (_tmp2_) {
		result = (gdouble) G_MAXUINT;
		return result;
	}
	_tmp8_ = that;
	if (!gst_structure_has_field (_tmp8_, "height")) {
		_tmp7_ = TRUE;
	} else {
		GstStructure* _tmp9_;
		gint _tmp10_ = 0;
		gboolean _tmp11_;
		_tmp9_ = that;
		_tmp11_ = gst_structure_get_int (_tmp9_, "height", &_tmp10_);
		height = _tmp10_;
		_tmp7_ = !_tmp11_;
	}
	if (_tmp7_) {
		result = (gdouble) G_MAXUINT;
		return result;
	}
	_tmp12_ = that;
	if (!gst_structure_has_field (_tmp12_, "framerate")) {
		result = (gdouble) G_MAXUINT;
		return result;
	}
	_tmp13_ = that;
	_tmp14_ = *gst_structure_get_value (_tmp13_, "framerate");
	if (G_IS_VALUE (&_tmp14_)) {
		g_value_init (&_tmp15_, G_VALUE_TYPE (&_tmp14_));
		g_value_copy (&_tmp14_, &_tmp15_);
	} else {
		_tmp15_ = _tmp14_;
	}
	framerate = _tmp15_;
	if (G_VALUE_TYPE (&framerate) != gst_fraction_get_type ()) {
		result = (gdouble) G_MAXUINT;
		G_IS_VALUE (&framerate) ? (g_value_unset (&framerate), NULL) : NULL;
		return result;
	}
	_tmp16_ = framerate;
	num = gst_value_get_fraction_numerator (&_tmp16_);
	_tmp17_ = framerate;
	den = gst_value_get_fraction_denominator (&_tmp17_);
	pxs = ((((gdouble) num) / ((gdouble) den)) * ((gdouble) width)) * ((gdouble) height);
	br = (sqrt (sqrt (pxs)) * 100.0) - 3700.0;
	if (br < 128.0) {
		result = 128.0;
		G_IS_VALUE (&framerate) ? (g_value_unset (&framerate), NULL) : NULL;
		return result;
	}
	result = br;
	G_IS_VALUE (&framerate) ? (g_value_unset (&framerate), NULL) : NULL;
	return result;
}

static gpointer
_gst_caps_ref0 (gpointer self)
{
	return self ? gst_caps_ref (self) : NULL;
}

static GstCaps*
dino_plugins_rtp_device_get_active_caps (DinoPluginsRtpDevice* self,
                                         XmppXepJingleRtpPayloadType* payload_type)
{
	GstCaps* _tmp0_ = NULL;
	DinoPluginsRtpCodecUtil* _tmp1_;
	DinoPluginsRtpCodecUtil* _tmp2_;
	GeeMap* _tmp3_;
	gpointer _tmp4_;
	GstElement* _tmp5_;
	GstCaps* _tmp6_;
	GstCaps* _tmp7_;
	GstCaps* _tmp10_;
	GstCaps* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (payload_type != NULL, NULL);
	_tmp1_ = dino_plugins_rtp_device_get_codec_util (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->codecs;
	_tmp4_ = gee_map_get (_tmp3_, payload_type);
	_tmp5_ = (GstElement*) _tmp4_;
	_tmp6_ = dino_plugins_rtp_codec_util_get_rescale_caps (_tmp2_, _tmp5_);
	_tmp7_ = _tmp6_;
	_g_object_unref0 (_tmp5_);
	_tmp0_ = _tmp7_;
	if (_tmp0_ == NULL) {
		GstCaps* _tmp8_;
		GstCaps* _tmp9_;
		_tmp8_ = self->priv->device_caps;
		_tmp9_ = _gst_caps_ref0 (_tmp8_);
		_gst_caps_unref0 (_tmp0_);
		_tmp0_ = _tmp9_;
	}
	_tmp10_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp10_;
	_gst_caps_unref0 (_tmp0_);
	return result;
}

static void
dino_plugins_rtp_device_apply_caps (DinoPluginsRtpDevice* self,
                                    XmppXepJingleRtpPayloadType* payload_type,
                                    GstCaps* caps)
{
	DinoPluginsRtpPlugin* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	DinoPluginsRtpCodecUtil* _tmp3_;
	DinoPluginsRtpCodecUtil* _tmp4_;
	GeeMap* _tmp5_;
	gpointer _tmp6_;
	GstElement* _tmp7_;
	DinoPluginsRtpPlugin* _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (payload_type != NULL);
	g_return_if_fail (caps != NULL);
	_tmp0_ = self->priv->_plugin;
	dino_plugins_rtp_plugin_pause (_tmp0_);
	_tmp1_ = gst_caps_to_string (caps);
	_tmp2_ = _tmp1_;
	g_debug ("device.vala:203: Set scaled caps to %s", _tmp2_);
	_g_free0 (_tmp2_);
	_tmp3_ = dino_plugins_rtp_device_get_codec_util (self);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->codecs;
	_tmp6_ = gee_map_get (_tmp5_, payload_type);
	_tmp7_ = (GstElement*) _tmp6_;
	dino_plugins_rtp_codec_util_update_rescale_caps (_tmp4_, _tmp7_, caps);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = self->priv->_plugin;
	dino_plugins_rtp_plugin_unpause (_tmp8_);
}

static void
dino_plugins_rtp_device_apply_width (DinoPluginsRtpDevice* self,
                                     XmppXepJingleRtpPayloadType* payload_type,
                                     gint new_width,
                                     guint bitrate)
{
	gint device_caps_width = 0;
	gint device_caps_height = 0;
	gint active_caps_width = 0;
	gint device_caps_framerate_num = 0;
	gint device_caps_framerate_den = 0;
	GstCaps* _tmp0_;
	GstStructure* _tmp1_;
	gint _tmp2_ = 0;
	GstCaps* _tmp3_;
	GstStructure* _tmp4_;
	gint _tmp5_ = 0;
	GstCaps* _tmp6_;
	GstStructure* _tmp7_;
	gint _tmp8_ = 0;
	gint _tmp9_ = 0;
	GstCaps* active_caps = NULL;
	GstCaps* _tmp10_;
	gboolean _tmp11_ = FALSE;
	GstCaps* _tmp12_;
	gint new_height = 0;
	GstCaps* new_caps = NULL;
	gdouble required_bitrate = 0.0;
	GstCaps* _tmp19_;
	gboolean _tmp20_ = FALSE;
	GstCaps* _tmp21_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (payload_type != NULL);
	_tmp0_ = self->priv->device_caps;
	_tmp1_ = gst_caps_get_structure (_tmp0_, (guint) 0);
	gst_structure_get_int (_tmp1_, "width", &_tmp2_);
	device_caps_width = _tmp2_;
	_tmp3_ = self->priv->device_caps;
	_tmp4_ = gst_caps_get_structure (_tmp3_, (guint) 0);
	gst_structure_get_int (_tmp4_, "height", &_tmp5_);
	device_caps_height = _tmp5_;
	_tmp6_ = self->priv->device_caps;
	_tmp7_ = gst_caps_get_structure (_tmp6_, (guint) 0);
	gst_structure_get_fraction (_tmp7_, "framerate", &_tmp8_, &_tmp9_);
	device_caps_framerate_num = _tmp8_;
	device_caps_framerate_den = _tmp9_;
	_tmp10_ = dino_plugins_rtp_device_get_active_caps (self, payload_type);
	active_caps = _tmp10_;
	_tmp12_ = active_caps;
	if (_tmp12_ != NULL) {
		GstCaps* _tmp13_;
		_tmp13_ = active_caps;
		_tmp11_ = gst_caps_get_size (_tmp13_) > ((guint) 0);
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		GstCaps* _tmp14_;
		GstStructure* _tmp15_;
		gint _tmp16_ = 0;
		_tmp14_ = active_caps;
		_tmp15_ = gst_caps_get_structure (_tmp14_, (guint) 0);
		gst_structure_get_int (_tmp15_, "width", &_tmp16_);
		active_caps_width = _tmp16_;
	} else {
		active_caps_width = device_caps_width;
	}
	if (new_width == active_caps_width) {
		_gst_caps_unref0 (active_caps);
		return;
	}
	new_height = (device_caps_height * new_width) / device_caps_width;
	if ((new_height % 2) != 0) {
		new_height += 1;
	}
	if (device_caps_framerate_den != 0) {
		GstCaps* _tmp17_;
		_tmp17_ = gst_caps_new_simple ("video/x-raw", "width", G_TYPE_INT, new_width, "height", G_TYPE_INT, new_height, "framerate", gst_fraction_get_type (), device_caps_framerate_num, device_caps_framerate_den, NULL, NULL);
		_gst_caps_unref0 (new_caps);
		new_caps = _tmp17_;
	} else {
		GstCaps* _tmp18_;
		_tmp18_ = gst_caps_new_simple ("video/x-raw", "width", G_TYPE_INT, new_width, "height", G_TYPE_INT, new_height, NULL, NULL);
		_gst_caps_unref0 (new_caps);
		new_caps = _tmp18_;
	}
	_tmp19_ = new_caps;
	required_bitrate = dino_plugins_rtp_device_get_target_bitrate (_tmp19_);
	g_debug ("device.vala:231: Changing resolution width from %d to %d (requires bit" \
"rate %f, current target is %u)", active_caps_width, new_width, required_bitrate, bitrate);
	if (((gdouble) bitrate) < required_bitrate) {
		_tmp20_ = new_width > active_caps_width;
	} else {
		_tmp20_ = FALSE;
	}
	if (_tmp20_) {
		_gst_caps_unref0 (new_caps);
		_gst_caps_unref0 (active_caps);
		return;
	}
	_tmp21_ = new_caps;
	dino_plugins_rtp_device_apply_caps (self, payload_type, _tmp21_);
	_gst_caps_unref0 (new_caps);
	_gst_caps_unref0 (active_caps);
}

void
dino_plugins_rtp_device_update_bitrate (DinoPluginsRtpDevice* self,
                                        XmppXepJingleRtpPayloadType* payload_type,
                                        guint bitrate)
{
	GeeMap* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (payload_type != NULL);
	_tmp0_ = self->priv->codecs;
	if (gee_map_has_key (_tmp0_, payload_type)) {
		GeeMap* _tmp1_;
		GeeMap* _tmp2_;
		GeeMap* _tmp6_;
		gpointer _tmp7_;
		GeeList* _tmp8_;
		DinoPluginsRtpDeviceCodecBitrate* _tmp9_;
		DinoPluginsRtpDeviceCodecBitrate* _tmp10_;
		GeeArrayList* remove = NULL;
		GeeArrayList* _tmp11_;
		GeeMap* _tmp26_;
		gpointer _tmp27_;
		GeeList* _tmp28_;
		GeeArrayList* _tmp29_;
		gchar* _tmp30_;
		gchar* _tmp31_;
		gchar* _tmp32_;
		gboolean _tmp33_;
		DinoPluginsRtpCodecUtil* _tmp63_;
		DinoPluginsRtpCodecUtil* _tmp64_;
		gchar* _tmp65_;
		gchar* _tmp66_;
		gchar* _tmp67_;
		GeeMap* _tmp68_;
		gpointer _tmp69_;
		GstElement* _tmp70_;
		GeeMap* _tmp71_;
		_tmp1_ = self->priv->codec_bitrates;
		g_rec_mutex_lock (&self->priv->__lock_codec_bitrates);
		_tmp2_ = self->priv->codec_bitrates;
		if (!gee_map_has_key (_tmp2_, payload_type)) {
			GeeMap* _tmp3_;
			GeeArrayList* _tmp4_;
			GeeArrayList* _tmp5_;
			_tmp3_ = self->priv->codec_bitrates;
			_tmp4_ = gee_array_list_new (DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE, (GBoxedCopyFunc) dino_plugins_rtp_device_codec_bitrate_ref, (GDestroyNotify) dino_plugins_rtp_device_codec_bitrate_unref, NULL, NULL, NULL);
			_tmp5_ = _tmp4_;
			gee_map_set (_tmp3_, payload_type, (GeeList*) _tmp5_);
			_g_object_unref0 (_tmp5_);
		}
		_tmp6_ = self->priv->codec_bitrates;
		_tmp7_ = gee_map_get (_tmp6_, payload_type);
		_tmp8_ = (GeeList*) _tmp7_;
		_tmp9_ = dino_plugins_rtp_device_codec_bitrate_new (bitrate);
		_tmp10_ = _tmp9_;
		gee_collection_add ((GeeCollection*) _tmp8_, _tmp10_);
		_dino_plugins_rtp_device_codec_bitrate_unref0 (_tmp10_);
		_g_object_unref0 (_tmp8_);
		_tmp11_ = gee_array_list_new (DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE, (GBoxedCopyFunc) dino_plugins_rtp_device_codec_bitrate_ref, (GDestroyNotify) dino_plugins_rtp_device_codec_bitrate_unref, NULL, NULL, NULL);
		remove = _tmp11_;
		{
			GeeList* _rate_list = NULL;
			GeeMap* _tmp12_;
			gpointer _tmp13_;
			gint _rate_size = 0;
			GeeList* _tmp14_;
			gint _tmp15_;
			gint _tmp16_;
			gint _rate_index = 0;
			_tmp12_ = self->priv->codec_bitrates;
			_tmp13_ = gee_map_get (_tmp12_, payload_type);
			_rate_list = (GeeList*) _tmp13_;
			_tmp14_ = _rate_list;
			_tmp15_ = gee_collection_get_size ((GeeCollection*) _tmp14_);
			_tmp16_ = _tmp15_;
			_rate_size = _tmp16_;
			_rate_index = -1;
			while (TRUE) {
				gint _tmp17_;
				gint _tmp18_;
				DinoPluginsRtpDeviceCodecBitrate* rate = NULL;
				GeeList* _tmp19_;
				gpointer _tmp20_;
				DinoPluginsRtpDeviceCodecBitrate* _tmp21_;
				DinoPluginsRtpDeviceCodecBitrate* _tmp24_;
				_rate_index = _rate_index + 1;
				_tmp17_ = _rate_index;
				_tmp18_ = _rate_size;
				if (!(_tmp17_ < _tmp18_)) {
					break;
				}
				_tmp19_ = _rate_list;
				_tmp20_ = gee_list_get (_tmp19_, _rate_index);
				rate = (DinoPluginsRtpDeviceCodecBitrate*) _tmp20_;
				_tmp21_ = rate;
				if (_tmp21_->timestamp < (g_get_monotonic_time () - 5000000L)) {
					GeeArrayList* _tmp22_;
					DinoPluginsRtpDeviceCodecBitrate* _tmp23_;
					_tmp22_ = remove;
					_tmp23_ = rate;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp22_, _tmp23_);
					_dino_plugins_rtp_device_codec_bitrate_unref0 (rate);
					continue;
				}
				_tmp24_ = rate;
				if (_tmp24_->bitrate < bitrate) {
					DinoPluginsRtpDeviceCodecBitrate* _tmp25_;
					_tmp25_ = rate;
					bitrate = _tmp25_->bitrate;
				}
				_dino_plugins_rtp_device_codec_bitrate_unref0 (rate);
			}
			_g_object_unref0 (_rate_list);
		}
		_tmp26_ = self->priv->codec_bitrates;
		_tmp27_ = gee_map_get (_tmp26_, payload_type);
		_tmp28_ = (GeeList*) _tmp27_;
		_tmp29_ = remove;
		gee_collection_remove_all ((GeeCollection*) _tmp28_, (GeeCollection*) _tmp29_);
		_g_object_unref0 (_tmp28_);
		_tmp30_ = dino_plugins_media_device_get_media ((DinoPluginsMediaDevice*) self);
		_tmp31_ = _tmp30_;
		_tmp32_ = _tmp31_;
		_tmp33_ = g_strcmp0 (_tmp32_, "video") == 0;
		_g_free0 (_tmp32_);
		if (_tmp33_) {
			GstCaps* active_caps = NULL;
			GstCaps* _tmp34_;
			gdouble max_bitrate = 0.0;
			GstCaps* _tmp35_;
			gdouble current_target_bitrate = 0.0;
			GstCaps* _tmp36_;
			gint device_caps_width = 0;
			gint active_caps_width = 0;
			GstCaps* _tmp37_;
			GstStructure* _tmp38_;
			gint _tmp39_ = 0;
			gboolean _tmp40_ = FALSE;
			GstCaps* _tmp41_;
			gboolean _tmp46_ = FALSE;
			if (bitrate < ((guint) 128)) {
				bitrate = (guint) 128;
			}
			_tmp34_ = dino_plugins_rtp_device_get_active_caps (self, payload_type);
			active_caps = _tmp34_;
			_tmp35_ = self->priv->device_caps;
			max_bitrate = dino_plugins_rtp_device_get_target_bitrate (_tmp35_) * 2;
			_tmp36_ = active_caps;
			current_target_bitrate = dino_plugins_rtp_device_get_target_bitrate (_tmp36_);
			_tmp37_ = self->priv->device_caps;
			_tmp38_ = gst_caps_get_structure (_tmp37_, (guint) 0);
			gst_structure_get_int (_tmp38_, "width", &_tmp39_);
			device_caps_width = _tmp39_;
			_tmp41_ = active_caps;
			if (_tmp41_ != NULL) {
				GstCaps* _tmp42_;
				_tmp42_ = active_caps;
				_tmp40_ = gst_caps_get_size (_tmp42_) > ((guint) 0);
			} else {
				_tmp40_ = FALSE;
			}
			if (_tmp40_) {
				GstCaps* _tmp43_;
				GstStructure* _tmp44_;
				gint _tmp45_ = 0;
				_tmp43_ = active_caps;
				_tmp44_ = gst_caps_get_structure (_tmp43_, (guint) 0);
				gst_structure_get_int (_tmp44_, "width", &_tmp45_);
				active_caps_width = _tmp45_;
			} else {
				active_caps_width = device_caps_width;
			}
			if (((gdouble) bitrate) < (0.75 * current_target_bitrate)) {
				gint _tmp47_;
				_tmp47_ = DINO_PLUGINS_RTP_DEVICE_common_widths[0];
				_tmp46_ = active_caps_width > _tmp47_;
			} else {
				_tmp46_ = FALSE;
			}
			if (_tmp46_) {
				gint i = 0;
				gint _tmp52_;
				gint _tmp53_;
				i = 1;
				{
					gboolean _tmp48_ = FALSE;
					_tmp48_ = TRUE;
					while (TRUE) {
						gboolean _tmp50_ = FALSE;
						if (!_tmp48_) {
							gint _tmp49_;
							_tmp49_ = i;
							i = _tmp49_ + 1;
						}
						_tmp48_ = FALSE;
						if (i < G_N_ELEMENTS (DINO_PLUGINS_RTP_DEVICE_common_widths)) {
							gint _tmp51_;
							_tmp51_ = DINO_PLUGINS_RTP_DEVICE_common_widths[i];
							_tmp50_ = _tmp51_ < active_caps_width;
						} else {
							_tmp50_ = FALSE;
						}
						if (!_tmp50_) {
							break;
						}
					}
				}
				_tmp52_ = DINO_PLUGINS_RTP_DEVICE_common_widths[i];
				if (_tmp52_ != active_caps_width) {
					g_debug ("device.vala:270: Decrease resolution to ensure target bitrate (%u) is " \
"in reach (current resolution target bitrate is %f)", bitrate, current_target_bitrate);
				}
				_tmp53_ = DINO_PLUGINS_RTP_DEVICE_common_widths[i - 1];
				dino_plugins_rtp_device_apply_width (self, payload_type, _tmp53_, bitrate);
			} else {
				gboolean _tmp54_ = FALSE;
				if (((gdouble) bitrate) > (2 * current_target_bitrate)) {
					_tmp54_ = active_caps_width < device_caps_width;
				} else {
					_tmp54_ = FALSE;
				}
				if (_tmp54_) {
					gint i = 0;
					gint _tmp59_;
					gint _tmp60_;
					i = 0;
					{
						gboolean _tmp55_ = FALSE;
						_tmp55_ = TRUE;
						while (TRUE) {
							gboolean _tmp57_ = FALSE;
							if (!_tmp55_) {
								gint _tmp56_;
								_tmp56_ = i;
								i = _tmp56_ + 1;
							}
							_tmp55_ = FALSE;
							if (i < G_N_ELEMENTS (DINO_PLUGINS_RTP_DEVICE_common_widths)) {
								gint _tmp58_;
								_tmp58_ = DINO_PLUGINS_RTP_DEVICE_common_widths[i];
								_tmp57_ = _tmp58_ <= active_caps_width;
							} else {
								_tmp57_ = FALSE;
							}
							if (!_tmp57_) {
								break;
							}
						}
					}
					_tmp59_ = DINO_PLUGINS_RTP_DEVICE_common_widths[i];
					if (_tmp59_ != active_caps_width) {
						g_debug ("device.vala:278: Increase resolution to make use of available bandwidt" \
"h of target bitrate (%u) (current resolution target bitrate is %f)", bitrate, current_target_bitrate);
					}
					_tmp60_ = DINO_PLUGINS_RTP_DEVICE_common_widths[i];
					if (_tmp60_ > device_caps_width) {
						dino_plugins_rtp_device_apply_width (self, payload_type, device_caps_width, bitrate);
					} else {
						gint _tmp61_;
						_tmp61_ = DINO_PLUGINS_RTP_DEVICE_common_widths[i];
						if (_tmp61_ != active_caps_width) {
							gint _tmp62_;
							_tmp62_ = DINO_PLUGINS_RTP_DEVICE_common_widths[i];
							dino_plugins_rtp_device_apply_width (self, payload_type, _tmp62_, bitrate);
						}
					}
				}
			}
			if (((gdouble) bitrate) > max_bitrate) {
				bitrate = (guint) max_bitrate;
			}
			_gst_caps_unref0 (active_caps);
		}
		_tmp63_ = dino_plugins_rtp_device_get_codec_util (self);
		_tmp64_ = _tmp63_;
		_tmp65_ = dino_plugins_media_device_get_media ((DinoPluginsMediaDevice*) self);
		_tmp66_ = _tmp65_;
		_tmp67_ = _tmp66_;
		_tmp68_ = self->priv->codecs;
		_tmp69_ = gee_map_get (_tmp68_, payload_type);
		_tmp70_ = (GstElement*) _tmp69_;
		dino_plugins_rtp_codec_util_update_bitrate (_tmp64_, _tmp67_, payload_type, _tmp70_, bitrate);
		_g_object_unref0 (_tmp70_);
		_g_free0 (_tmp67_);
		_tmp71_ = self->priv->codec_bitrates;
		g_rec_mutex_unlock (&self->priv->__lock_codec_bitrates);
		_g_object_unref0 (remove);
	}
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		DinoPluginsRtpDevice* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->link);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static gboolean
__lambda6_ (Block1Data* _data1_,
            GeeMapEntry* entry)
{
	DinoPluginsRtpDevice* self;
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gboolean result;
	self = _data1_->self;
	g_return_val_if_fail (entry != NULL, FALSE);
	_tmp0_ = gee_map_entry_get_value (entry);
	_tmp1_ = _tmp0_;
	result = ((GstElement*) _tmp1_) == _data1_->link;
	return result;
}

static gboolean
___lambda6__gee_predicate (gconstpointer g,
                           gpointer self)
{
	gboolean result;
	result = __lambda6_ (self, (GeeMapEntry*) g);
	return result;
}

static gboolean
___lambda5_ (Block1Data* _data1_,
             GeeMapEntry* entry)
{
	DinoPluginsRtpDevice* self;
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gboolean result;
	self = _data1_->self;
	g_return_val_if_fail (entry != NULL, FALSE);
	_tmp0_ = gee_map_entry_get_value (entry);
	_tmp1_ = _tmp0_;
	result = gee_traversable_any_match ((GeeTraversable*) ((GeeMap*) _tmp1_), ___lambda6__gee_predicate, block1_data_ref (_data1_), block1_data_unref);
	return result;
}

static gboolean
____lambda5__gee_predicate (gconstpointer g,
                            gpointer self)
{
	gboolean result;
	result = ___lambda5_ (self, (GeeMapEntry*) g);
	return result;
}

static gpointer
_xmpp_xep_jingle_rtp_payload_type_ref0 (gpointer self)
{
	return self ? xmpp_xep_jingle_rtp_payload_type_ref (self) : NULL;
}

static gboolean
___lambda7_ (Block1Data* _data1_,
             GeeMapEntry* entry)
{
	DinoPluginsRtpDevice* self;
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gboolean result;
	self = _data1_->self;
	g_return_val_if_fail (entry != NULL, FALSE);
	_tmp0_ = gee_map_entry_get_value (entry);
	_tmp1_ = _tmp0_;
	result = ((GstElement*) _tmp1_) == _data1_->link;
	return result;
}

static gboolean
____lambda7__gee_predicate (gconstpointer g,
                            gpointer self)
{
	gboolean result;
	result = ___lambda7_ (self, (GeeMapEntry*) g);
	return result;
}

void
dino_plugins_rtp_device_unlink (DinoPluginsRtpDevice* self,
                                GstElement* link)
{
	Block1Data* _data1_;
	GstElement* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp173_ = FALSE;
	gboolean _tmp174_ = FALSE;
	gint _tmp192_;
	g_return_if_fail (self != NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_data1_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (link);
	_g_object_unref0 (_data1_->link);
	_data1_->link = _tmp0_;
	if (self->priv->links <= 0) {
		g_critical ("device.vala:296: Link count below zero.");
		block1_data_unref (_data1_);
		_data1_ = NULL;
		return;
	}
	if (_data1_->link != NULL) {
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp3_ = dino_plugins_rtp_device_get_is_source (self);
		_tmp4_ = _tmp3_;
		_tmp2_ = _tmp4_;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GstElement* _tmp5_;
		_tmp5_ = self->priv->tee;
		_tmp1_ = _tmp5_ != NULL;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		XmppXepJingleRtpPayloadType* payload_type = NULL;
		GeeMap* _tmp6_;
		gpointer _tmp7_;
		GeeMapEntry* _tmp8_;
		gconstpointer _tmp9_;
		gconstpointer _tmp10_;
		XmppXepJingleRtpPayloadType* _tmp11_;
		XmppXepJingleRtpPayloadType* _tmp12_;
		guint ssrc = 0U;
		GeeMap* _tmp13_;
		XmppXepJingleRtpPayloadType* _tmp14_;
		gpointer _tmp15_;
		GeeMap* _tmp16_;
		gpointer _tmp17_;
		GeeMapEntry* _tmp18_;
		gconstpointer _tmp19_;
		gconstpointer _tmp20_;
		guint _tmp21_;
		GeeMap* _tmp22_;
		XmppXepJingleRtpPayloadType* _tmp23_;
		gpointer _tmp24_;
		GeeMap* _tmp25_;
		GeeMap* _tmp26_;
		XmppXepJingleRtpPayloadType* _tmp27_;
		gpointer _tmp28_;
		GeeMap* _tmp29_;
		gpointer _tmp30_;
		GeeMap* _tmp31_;
		XmppXepJingleRtpPayloadType* _tmp32_;
		gpointer _tmp33_;
		GeeMap* _tmp34_;
		gpointer _tmp35_;
		gboolean _tmp36_;
		GeeMap* _tmp113_;
		XmppXepJingleRtpPayloadType* _tmp114_;
		gpointer _tmp115_;
		GeeMap* _tmp116_;
		gint _tmp117_;
		gint _tmp118_;
		gboolean _tmp119_;
		_tmp6_ = self->priv->payloader_tees;
		_tmp7_ = gee_traversable_first_match ((GeeTraversable*) _tmp6_, ____lambda5__gee_predicate, block1_data_ref (_data1_), block1_data_unref);
		_tmp8_ = (GeeMapEntry*) _tmp7_;
		_tmp9_ = gee_map_entry_get_key (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = _xmpp_xep_jingle_rtp_payload_type_ref0 ((XmppXepJingleRtpPayloadType*) _tmp10_);
		_tmp12_ = _tmp11_;
		_g_object_unref0 (_tmp8_);
		payload_type = _tmp12_;
		_tmp13_ = self->priv->payloader_tees;
		_tmp14_ = payload_type;
		_tmp15_ = gee_map_get (_tmp13_, _tmp14_);
		_tmp16_ = (GeeMap*) _tmp15_;
		_tmp17_ = gee_traversable_first_match ((GeeTraversable*) _tmp16_, ____lambda7__gee_predicate, block1_data_ref (_data1_), block1_data_unref);
		_tmp18_ = (GeeMapEntry*) _tmp17_;
		_tmp19_ = gee_map_entry_get_key (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = (guint) ((guintptr) _tmp20_);
		_g_object_unref0 (_tmp18_);
		_g_object_unref0 (_tmp16_);
		ssrc = _tmp21_;
		_tmp22_ = self->priv->payloader_links;
		_tmp23_ = payload_type;
		_tmp24_ = gee_map_get (_tmp22_, _tmp23_);
		_tmp25_ = (GeeMap*) _tmp24_;
		_tmp26_ = self->priv->payloader_links;
		_tmp27_ = payload_type;
		_tmp28_ = gee_map_get (_tmp26_, _tmp27_);
		_tmp29_ = (GeeMap*) _tmp28_;
		_tmp30_ = gee_map_get (_tmp29_, (gpointer) ((guintptr) ssrc));
		gee_map_set (_tmp25_, (gpointer) ((guintptr) ssrc), (gpointer) ((guintptr) (((guint) ((guintptr) _tmp30_)) - 1)));
		_g_object_unref0 (_tmp29_);
		_g_object_unref0 (_tmp25_);
		_tmp31_ = self->priv->payloader_links;
		_tmp32_ = payload_type;
		_tmp33_ = gee_map_get (_tmp31_, _tmp32_);
		_tmp34_ = (GeeMap*) _tmp33_;
		_tmp35_ = gee_map_get (_tmp34_, (gpointer) ((guintptr) ssrc));
		_tmp36_ = ((guint) ((guintptr) _tmp35_)) == ((guint) 0);
		_g_object_unref0 (_tmp34_);
		if (_tmp36_) {
			DinoPluginsRtpPlugin* _tmp37_;
			GeeMap* _tmp38_;
			XmppXepJingleRtpPayloadType* _tmp39_;
			gpointer _tmp40_;
			GstElement* _tmp41_;
			GeeMap* _tmp42_;
			XmppXepJingleRtpPayloadType* _tmp43_;
			gpointer _tmp44_;
			GeeMap* _tmp45_;
			gpointer _tmp46_;
			GstElement* _tmp47_;
			GeeMap* _tmp48_;
			XmppXepJingleRtpPayloadType* _tmp49_;
			gpointer _tmp50_;
			GeeMap* _tmp51_;
			gpointer _tmp52_;
			GstElement* _tmp53_;
			GeeMap* _tmp54_;
			XmppXepJingleRtpPayloadType* _tmp55_;
			gpointer _tmp56_;
			GeeMap* _tmp57_;
			gpointer _tmp58_;
			GstElement* _tmp59_;
			GeeMap* _tmp60_;
			XmppXepJingleRtpPayloadType* _tmp61_;
			gpointer _tmp62_;
			GeeMap* _tmp63_;
			gpointer _tmp64_;
			GstElement* _tmp65_;
			GeeMap* _tmp66_;
			XmppXepJingleRtpPayloadType* _tmp67_;
			gpointer _tmp68_;
			GeeMap* _tmp69_;
			gpointer _tmp70_;
			GstElement* _tmp71_;
			GstPipeline* _tmp72_;
			GstPipeline* _tmp73_;
			GeeMap* _tmp74_;
			XmppXepJingleRtpPayloadType* _tmp75_;
			gpointer _tmp76_;
			GeeMap* _tmp77_;
			gpointer _tmp78_;
			GstElement* _tmp79_;
			GeeMap* _tmp80_;
			XmppXepJingleRtpPayloadType* _tmp81_;
			gpointer _tmp82_;
			GeeMap* _tmp83_;
			GeeMap* _tmp84_;
			XmppXepJingleRtpPayloadType* _tmp85_;
			gpointer _tmp86_;
			GeeMap* _tmp87_;
			gpointer _tmp88_;
			GstElement* _tmp89_;
			GeeMap* _tmp90_;
			XmppXepJingleRtpPayloadType* _tmp91_;
			gpointer _tmp92_;
			GeeMap* _tmp93_;
			gpointer _tmp94_;
			GstElement* _tmp95_;
			GstPipeline* _tmp96_;
			GstPipeline* _tmp97_;
			GeeMap* _tmp98_;
			XmppXepJingleRtpPayloadType* _tmp99_;
			gpointer _tmp100_;
			GeeMap* _tmp101_;
			gpointer _tmp102_;
			GstElement* _tmp103_;
			GeeMap* _tmp104_;
			XmppXepJingleRtpPayloadType* _tmp105_;
			gpointer _tmp106_;
			GeeMap* _tmp107_;
			GeeMap* _tmp108_;
			XmppXepJingleRtpPayloadType* _tmp109_;
			gpointer _tmp110_;
			GeeMap* _tmp111_;
			DinoPluginsRtpPlugin* _tmp112_;
			_tmp37_ = self->priv->_plugin;
			dino_plugins_rtp_plugin_pause (_tmp37_);
			_tmp38_ = self->priv->codec_tees;
			_tmp39_ = payload_type;
			_tmp40_ = gee_map_get (_tmp38_, _tmp39_);
			_tmp41_ = (GstElement*) _tmp40_;
			_tmp42_ = self->priv->payloaders;
			_tmp43_ = payload_type;
			_tmp44_ = gee_map_get (_tmp42_, _tmp43_);
			_tmp45_ = (GeeMap*) _tmp44_;
			_tmp46_ = gee_map_get (_tmp45_, (gpointer) ((guintptr) ssrc));
			_tmp47_ = (GstElement*) _tmp46_;
			gst_element_unlink (_tmp41_, _tmp47_);
			_g_object_unref0 (_tmp47_);
			_g_object_unref0 (_tmp45_);
			_g_object_unref0 (_tmp41_);
			_tmp48_ = self->priv->payloaders;
			_tmp49_ = payload_type;
			_tmp50_ = gee_map_get (_tmp48_, _tmp49_);
			_tmp51_ = (GeeMap*) _tmp50_;
			_tmp52_ = gee_map_get (_tmp51_, (gpointer) ((guintptr) ssrc));
			_tmp53_ = (GstElement*) _tmp52_;
			gst_element_set_locked_state (_tmp53_, TRUE);
			_g_object_unref0 (_tmp53_);
			_g_object_unref0 (_tmp51_);
			_tmp54_ = self->priv->payloaders;
			_tmp55_ = payload_type;
			_tmp56_ = gee_map_get (_tmp54_, _tmp55_);
			_tmp57_ = (GeeMap*) _tmp56_;
			_tmp58_ = gee_map_get (_tmp57_, (gpointer) ((guintptr) ssrc));
			_tmp59_ = (GstElement*) _tmp58_;
			gst_element_set_state (_tmp59_, GST_STATE_NULL);
			_g_object_unref0 (_tmp59_);
			_g_object_unref0 (_tmp57_);
			_tmp60_ = self->priv->payloaders;
			_tmp61_ = payload_type;
			_tmp62_ = gee_map_get (_tmp60_, _tmp61_);
			_tmp63_ = (GeeMap*) _tmp62_;
			_tmp64_ = gee_map_get (_tmp63_, (gpointer) ((guintptr) ssrc));
			_tmp65_ = (GstElement*) _tmp64_;
			_tmp66_ = self->priv->payloader_tees;
			_tmp67_ = payload_type;
			_tmp68_ = gee_map_get (_tmp66_, _tmp67_);
			_tmp69_ = (GeeMap*) _tmp68_;
			_tmp70_ = gee_map_get (_tmp69_, (gpointer) ((guintptr) ssrc));
			_tmp71_ = (GstElement*) _tmp70_;
			gst_element_unlink (_tmp65_, _tmp71_);
			_g_object_unref0 (_tmp71_);
			_g_object_unref0 (_tmp69_);
			_g_object_unref0 (_tmp65_);
			_g_object_unref0 (_tmp63_);
			_tmp72_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp73_ = _tmp72_;
			_tmp74_ = self->priv->payloaders;
			_tmp75_ = payload_type;
			_tmp76_ = gee_map_get (_tmp74_, _tmp75_);
			_tmp77_ = (GeeMap*) _tmp76_;
			_tmp78_ = gee_map_get (_tmp77_, (gpointer) ((guintptr) ssrc));
			_tmp79_ = (GstElement*) _tmp78_;
			gst_bin_remove ((GstBin*) _tmp73_, _tmp79_);
			_g_object_unref0 (_tmp79_);
			_g_object_unref0 (_tmp77_);
			_tmp80_ = self->priv->payloaders;
			_tmp81_ = payload_type;
			_tmp82_ = gee_map_get (_tmp80_, _tmp81_);
			_tmp83_ = (GeeMap*) _tmp82_;
			gee_map_unset (_tmp83_, (gpointer) ((guintptr) ssrc), NULL);
			_g_object_unref0 (_tmp83_);
			_tmp84_ = self->priv->payloader_tees;
			_tmp85_ = payload_type;
			_tmp86_ = gee_map_get (_tmp84_, _tmp85_);
			_tmp87_ = (GeeMap*) _tmp86_;
			_tmp88_ = gee_map_get (_tmp87_, (gpointer) ((guintptr) ssrc));
			_tmp89_ = (GstElement*) _tmp88_;
			gst_element_set_locked_state (_tmp89_, TRUE);
			_g_object_unref0 (_tmp89_);
			_g_object_unref0 (_tmp87_);
			_tmp90_ = self->priv->payloader_tees;
			_tmp91_ = payload_type;
			_tmp92_ = gee_map_get (_tmp90_, _tmp91_);
			_tmp93_ = (GeeMap*) _tmp92_;
			_tmp94_ = gee_map_get (_tmp93_, (gpointer) ((guintptr) ssrc));
			_tmp95_ = (GstElement*) _tmp94_;
			gst_element_set_state (_tmp95_, GST_STATE_NULL);
			_g_object_unref0 (_tmp95_);
			_g_object_unref0 (_tmp93_);
			_tmp96_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp97_ = _tmp96_;
			_tmp98_ = self->priv->payloader_tees;
			_tmp99_ = payload_type;
			_tmp100_ = gee_map_get (_tmp98_, _tmp99_);
			_tmp101_ = (GeeMap*) _tmp100_;
			_tmp102_ = gee_map_get (_tmp101_, (gpointer) ((guintptr) ssrc));
			_tmp103_ = (GstElement*) _tmp102_;
			gst_bin_remove ((GstBin*) _tmp97_, _tmp103_);
			_g_object_unref0 (_tmp103_);
			_g_object_unref0 (_tmp101_);
			_tmp104_ = self->priv->payloader_tees;
			_tmp105_ = payload_type;
			_tmp106_ = gee_map_get (_tmp104_, _tmp105_);
			_tmp107_ = (GeeMap*) _tmp106_;
			gee_map_unset (_tmp107_, (gpointer) ((guintptr) ssrc), NULL);
			_g_object_unref0 (_tmp107_);
			_tmp108_ = self->priv->payloader_links;
			_tmp109_ = payload_type;
			_tmp110_ = gee_map_get (_tmp108_, _tmp109_);
			_tmp111_ = (GeeMap*) _tmp110_;
			gee_map_unset (_tmp111_, (gpointer) ((guintptr) ssrc), NULL);
			_g_object_unref0 (_tmp111_);
			_tmp112_ = self->priv->_plugin;
			dino_plugins_rtp_plugin_unpause (_tmp112_);
		}
		_tmp113_ = self->priv->payloader_links;
		_tmp114_ = payload_type;
		_tmp115_ = gee_map_get (_tmp113_, _tmp114_);
		_tmp116_ = (GeeMap*) _tmp115_;
		_tmp117_ = gee_map_get_size (_tmp116_);
		_tmp118_ = _tmp117_;
		_tmp119_ = _tmp118_ == 0;
		_g_object_unref0 (_tmp116_);
		if (_tmp119_) {
			DinoPluginsRtpPlugin* _tmp120_;
			GstElement* _tmp121_;
			GeeMap* _tmp122_;
			XmppXepJingleRtpPayloadType* _tmp123_;
			gpointer _tmp124_;
			GstElement* _tmp125_;
			GeeMap* _tmp126_;
			XmppXepJingleRtpPayloadType* _tmp127_;
			gpointer _tmp128_;
			GstElement* _tmp129_;
			GeeMap* _tmp130_;
			XmppXepJingleRtpPayloadType* _tmp131_;
			gpointer _tmp132_;
			GstElement* _tmp133_;
			GeeMap* _tmp134_;
			XmppXepJingleRtpPayloadType* _tmp135_;
			gpointer _tmp136_;
			GstElement* _tmp137_;
			GeeMap* _tmp138_;
			XmppXepJingleRtpPayloadType* _tmp139_;
			gpointer _tmp140_;
			GstElement* _tmp141_;
			GstPipeline* _tmp142_;
			GstPipeline* _tmp143_;
			GeeMap* _tmp144_;
			XmppXepJingleRtpPayloadType* _tmp145_;
			gpointer _tmp146_;
			GstElement* _tmp147_;
			GeeMap* _tmp148_;
			XmppXepJingleRtpPayloadType* _tmp149_;
			GeeMap* _tmp150_;
			XmppXepJingleRtpPayloadType* _tmp151_;
			gpointer _tmp152_;
			GstElement* _tmp153_;
			GeeMap* _tmp154_;
			XmppXepJingleRtpPayloadType* _tmp155_;
			gpointer _tmp156_;
			GstElement* _tmp157_;
			GstPipeline* _tmp158_;
			GstPipeline* _tmp159_;
			GeeMap* _tmp160_;
			XmppXepJingleRtpPayloadType* _tmp161_;
			gpointer _tmp162_;
			GstElement* _tmp163_;
			GeeMap* _tmp164_;
			XmppXepJingleRtpPayloadType* _tmp165_;
			GeeMap* _tmp166_;
			XmppXepJingleRtpPayloadType* _tmp167_;
			GeeMap* _tmp168_;
			XmppXepJingleRtpPayloadType* _tmp169_;
			GeeMap* _tmp170_;
			XmppXepJingleRtpPayloadType* _tmp171_;
			DinoPluginsRtpPlugin* _tmp172_;
			_tmp120_ = self->priv->_plugin;
			dino_plugins_rtp_plugin_pause (_tmp120_);
			_tmp121_ = self->priv->tee;
			_tmp122_ = self->priv->codecs;
			_tmp123_ = payload_type;
			_tmp124_ = gee_map_get (_tmp122_, _tmp123_);
			_tmp125_ = (GstElement*) _tmp124_;
			gst_element_unlink (_tmp121_, _tmp125_);
			_g_object_unref0 (_tmp125_);
			_tmp126_ = self->priv->codecs;
			_tmp127_ = payload_type;
			_tmp128_ = gee_map_get (_tmp126_, _tmp127_);
			_tmp129_ = (GstElement*) _tmp128_;
			gst_element_set_locked_state (_tmp129_, TRUE);
			_g_object_unref0 (_tmp129_);
			_tmp130_ = self->priv->codecs;
			_tmp131_ = payload_type;
			_tmp132_ = gee_map_get (_tmp130_, _tmp131_);
			_tmp133_ = (GstElement*) _tmp132_;
			gst_element_set_state (_tmp133_, GST_STATE_NULL);
			_g_object_unref0 (_tmp133_);
			_tmp134_ = self->priv->codecs;
			_tmp135_ = payload_type;
			_tmp136_ = gee_map_get (_tmp134_, _tmp135_);
			_tmp137_ = (GstElement*) _tmp136_;
			_tmp138_ = self->priv->codec_tees;
			_tmp139_ = payload_type;
			_tmp140_ = gee_map_get (_tmp138_, _tmp139_);
			_tmp141_ = (GstElement*) _tmp140_;
			gst_element_unlink (_tmp137_, _tmp141_);
			_g_object_unref0 (_tmp141_);
			_g_object_unref0 (_tmp137_);
			_tmp142_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp143_ = _tmp142_;
			_tmp144_ = self->priv->codecs;
			_tmp145_ = payload_type;
			_tmp146_ = gee_map_get (_tmp144_, _tmp145_);
			_tmp147_ = (GstElement*) _tmp146_;
			gst_bin_remove ((GstBin*) _tmp143_, _tmp147_);
			_g_object_unref0 (_tmp147_);
			_tmp148_ = self->priv->codecs;
			_tmp149_ = payload_type;
			gee_map_unset (_tmp148_, _tmp149_, NULL);
			_tmp150_ = self->priv->codec_tees;
			_tmp151_ = payload_type;
			_tmp152_ = gee_map_get (_tmp150_, _tmp151_);
			_tmp153_ = (GstElement*) _tmp152_;
			gst_element_set_locked_state (_tmp153_, TRUE);
			_g_object_unref0 (_tmp153_);
			_tmp154_ = self->priv->codec_tees;
			_tmp155_ = payload_type;
			_tmp156_ = gee_map_get (_tmp154_, _tmp155_);
			_tmp157_ = (GstElement*) _tmp156_;
			gst_element_set_state (_tmp157_, GST_STATE_NULL);
			_g_object_unref0 (_tmp157_);
			_tmp158_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp159_ = _tmp158_;
			_tmp160_ = self->priv->codec_tees;
			_tmp161_ = payload_type;
			_tmp162_ = gee_map_get (_tmp160_, _tmp161_);
			_tmp163_ = (GstElement*) _tmp162_;
			gst_bin_remove ((GstBin*) _tmp159_, _tmp163_);
			_g_object_unref0 (_tmp163_);
			_tmp164_ = self->priv->codec_tees;
			_tmp165_ = payload_type;
			gee_map_unset (_tmp164_, _tmp165_, NULL);
			_tmp166_ = self->priv->payloaders;
			_tmp167_ = payload_type;
			gee_map_unset (_tmp166_, _tmp167_, NULL);
			_tmp168_ = self->priv->payloader_tees;
			_tmp169_ = payload_type;
			gee_map_unset (_tmp168_, _tmp169_, NULL);
			_tmp170_ = self->priv->payloader_links;
			_tmp171_ = payload_type;
			gee_map_unset (_tmp170_, _tmp171_, NULL);
			_tmp172_ = self->priv->_plugin;
			dino_plugins_rtp_plugin_unpause (_tmp172_);
		}
		_xmpp_xep_jingle_rtp_payload_type_unref0 (payload_type);
	}
	if (_data1_->link != NULL) {
		gboolean _tmp175_;
		gboolean _tmp176_;
		_tmp175_ = dino_plugins_rtp_device_get_is_sink (self);
		_tmp176_ = _tmp175_;
		_tmp174_ = _tmp176_;
	} else {
		_tmp174_ = FALSE;
	}
	if (_tmp174_) {
		GstAggregator* _tmp177_;
		_tmp177_ = self->priv->mixer;
		_tmp173_ = _tmp177_ != NULL;
	} else {
		_tmp173_ = FALSE;
	}
	if (_tmp173_) {
		DinoPluginsRtpPlugin* _tmp178_;
		GstAggregatorPad* mixer_sink_pad = NULL;
		GstPad* _tmp179_;
		GstPad* _tmp180_;
		GstPad* _tmp181_;
		GstAggregatorPad* _tmp182_;
		GstPad* _tmp183_;
		GstPad* _tmp184_;
		GstAggregatorPad* _tmp185_;
		GstAggregatorPad* _tmp186_;
		GstPipeline* _tmp187_;
		GstPipeline* _tmp188_;
		GstAggregator* _tmp189_;
		GstAggregatorPad* _tmp190_;
		DinoPluginsRtpPlugin* _tmp191_;
		_tmp178_ = self->priv->_plugin;
		dino_plugins_rtp_plugin_pause (_tmp178_);
		gst_element_set_locked_state (_data1_->link, TRUE);
		_tmp179_ = gst_element_get_static_pad (_data1_->link, "src");
		_tmp180_ = _tmp179_;
		_tmp181_ = gst_pad_get_peer (_tmp180_);
		_tmp182_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp181_, gst_aggregator_pad_get_type (), GstAggregatorPad);
		_g_object_unref0 (_tmp180_);
		mixer_sink_pad = _tmp182_;
		_tmp183_ = gst_element_get_static_pad (_data1_->link, "src");
		_tmp184_ = _tmp183_;
		_tmp185_ = mixer_sink_pad;
		gst_pad_unlink (_tmp184_, (GstPad*) _tmp185_);
		_g_object_unref0 (_tmp184_);
		_tmp186_ = mixer_sink_pad;
		gst_pad_set_active ((GstPad*) _tmp186_, FALSE);
		gst_element_set_state (_data1_->link, GST_STATE_NULL);
		_tmp187_ = dino_plugins_rtp_device_get_pipe (self);
		_tmp188_ = _tmp187_;
		gst_bin_remove ((GstBin*) _tmp188_, _data1_->link);
		_tmp189_ = self->priv->mixer;
		_tmp190_ = mixer_sink_pad;
		gst_element_release_request_pad ((GstElement*) _tmp189_, (GstPad*) _tmp190_);
		_tmp191_ = self->priv->_plugin;
		dino_plugins_rtp_plugin_unpause (_tmp191_);
		_g_object_unref0 (mixer_sink_pad);
	}
	_tmp192_ = self->priv->links;
	self->priv->links = _tmp192_ - 1;
	if (self->priv->links == 0) {
		dino_plugins_rtp_device_destroy (self);
	}
	block1_data_unref (_data1_);
	_data1_ = NULL;
}

static void
_vala_GValue_free (GValue* self)
{
	g_boxed_free (G_TYPE_VALUE, self);
}

static GValue*
_g_value_dup (GValue* self)
{
	return g_boxed_copy (G_TYPE_VALUE, self);
}

static gpointer
__g_value_dup0 (gpointer self)
{
	return self ? _g_value_dup (self) : NULL;
}

static GstCaps*
dino_plugins_rtp_device_get_best_caps (DinoPluginsRtpDevice* self)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_;
	GstCaps* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = dino_plugins_media_device_get_media ((DinoPluginsMediaDevice*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strcmp0 (_tmp2_, "audio") == 0;
	_g_free0 (_tmp2_);
	if (_tmp3_) {
		GstCaps* _tmp4_;
		_tmp4_ = gst_caps_from_string ("audio/x-raw,rate=48000,channels=1");
		result = _tmp4_;
		return result;
	} else {
		gboolean _tmp5_ = FALSE;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gboolean _tmp9_;
		_tmp6_ = dino_plugins_media_device_get_media ((DinoPluginsMediaDevice*) self);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strcmp0 (_tmp8_, "video") == 0;
		_g_free0 (_tmp8_);
		if (_tmp9_) {
			GstDevice* _tmp10_;
			GstCaps* _tmp11_;
			GstCaps* _tmp12_;
			GstCaps* _tmp13_;
			_tmp10_ = self->priv->_device;
			_tmp11_ = gst_device_get_caps (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = _tmp12_;
			_tmp5_ = gst_caps_get_size (_tmp13_) > ((guint) 0);
			_gst_caps_unref0 (_tmp13_);
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			gint best_index = 0;
			GValue* best_fraction = NULL;
			gint best_fps = 0;
			gint best_width = 0;
			gint best_height = 0;
			GstCaps* res = NULL;
			GstDevice* _tmp108_;
			GstCaps* _tmp109_;
			GstCaps* _tmp110_;
			GstCaps* _tmp111_;
			GstCaps* _tmp112_;
			GstCaps* _tmp113_;
			GstStructure* that = NULL;
			GstCaps* _tmp114_;
			GstStructure* _tmp115_;
			GValue* framerate = NULL;
			GstStructure* _tmp116_;
			GValue* _tmp117_;
			gboolean _tmp118_ = FALSE;
			gboolean _tmp119_ = FALSE;
			GValue* _tmp120_;
			GstCaps* _tmp128_;
			gchar* _tmp129_;
			gchar* _tmp130_;
			best_index = -1;
			best_fraction = NULL;
			best_fps = 0;
			best_width = 0;
			best_height = 0;
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp14_ = FALSE;
					_tmp14_ = TRUE;
					while (TRUE) {
						GstDevice* _tmp16_;
						GstCaps* _tmp17_;
						GstCaps* _tmp18_;
						GstCaps* _tmp19_;
						gboolean _tmp20_;
						GstStructure* that = NULL;
						GstDevice* _tmp21_;
						GstCaps* _tmp22_;
						GstCaps* _tmp23_;
						GstCaps* _tmp24_;
						GstStructure* _tmp25_;
						GstStructure* _tmp26_;
						GstCapsFeatures* features = NULL;
						GstDevice* _tmp27_;
						GstCaps* _tmp28_;
						GstCaps* _tmp29_;
						GstCaps* _tmp30_;
						GstCapsFeatures* _tmp31_;
						GstCapsFeatures* _tmp32_;
						GValue* best_fraction_now = NULL;
						gboolean _tmp33_ = FALSE;
						GstStructure* _tmp34_;
						gint num = 0;
						gint den = 0;
						gint width = 0;
						gint height = 0;
						GstStructure* _tmp36_;
						GValue framerate = {0};
						GstStructure* _tmp37_;
						GValue _tmp38_;
						GValue _tmp39_ = {0};
						gboolean _tmp56_ = FALSE;
						GstStructure* _tmp57_;
						gboolean _tmp61_ = FALSE;
						GstStructure* _tmp62_;
						gint fps = 0;
						gboolean _tmp66_ = FALSE;
						gboolean _tmp67_ = FALSE;
						if (!_tmp14_) {
							gint _tmp15_;
							_tmp15_ = i;
							i = _tmp15_ + 1;
						}
						_tmp14_ = FALSE;
						_tmp16_ = self->priv->_device;
						_tmp17_ = gst_device_get_caps (_tmp16_);
						_tmp18_ = _tmp17_;
						_tmp19_ = _tmp18_;
						_tmp20_ = !(((guint) i) < gst_caps_get_size (_tmp19_));
						_gst_caps_unref0 (_tmp19_);
						if (_tmp20_) {
							break;
						}
						_tmp21_ = self->priv->_device;
						_tmp22_ = gst_device_get_caps (_tmp21_);
						_tmp23_ = _tmp22_;
						_tmp24_ = _tmp23_;
						_tmp25_ = gst_caps_get_structure (_tmp24_, (guint) i);
						_tmp26_ = _tmp25_;
						_gst_caps_unref0 (_tmp24_);
						that = _tmp26_;
						_tmp27_ = self->priv->_device;
						_tmp28_ = gst_device_get_caps (_tmp27_);
						_tmp29_ = _tmp28_;
						_tmp30_ = _tmp29_;
						_tmp31_ = gst_caps_get_features (_tmp30_, (guint) i);
						_tmp32_ = _tmp31_;
						_gst_caps_unref0 (_tmp30_);
						features = _tmp32_;
						best_fraction_now = NULL;
						_tmp34_ = that;
						if (!gst_structure_has_name (_tmp34_, "video/x-raw")) {
							_tmp33_ = TRUE;
						} else {
							GstCapsFeatures* _tmp35_;
							_tmp35_ = features;
							_tmp33_ = !gst_caps_features_contains (_tmp35_, "memory:SystemMemory");
						}
						if (_tmp33_) {
							__vala_GValue_free0 (best_fraction_now);
							continue;
						}
						num = 0;
						den = 0;
						width = 0;
						height = 0;
						_tmp36_ = that;
						if (!gst_structure_has_field (_tmp36_, "framerate")) {
							__vala_GValue_free0 (best_fraction_now);
							continue;
						}
						_tmp37_ = that;
						_tmp38_ = *gst_structure_get_value (_tmp37_, "framerate");
						if (G_IS_VALUE (&_tmp38_)) {
							g_value_init (&_tmp39_, G_VALUE_TYPE (&_tmp38_));
							g_value_copy (&_tmp38_, &_tmp39_);
						} else {
							_tmp39_ = _tmp38_;
						}
						framerate = _tmp39_;
						if (G_VALUE_TYPE (&framerate) == gst_fraction_get_type ()) {
							GValue _tmp40_;
							GValue _tmp41_;
							_tmp40_ = framerate;
							num = gst_value_get_fraction_numerator (&_tmp40_);
							_tmp41_ = framerate;
							den = gst_value_get_fraction_denominator (&_tmp41_);
						} else {
							if (G_VALUE_TYPE (&framerate) == gst_value_list_get_type ()) {
								{
									guint j = 0U;
									j = (guint) 0;
									{
										gboolean _tmp42_ = FALSE;
										_tmp42_ = TRUE;
										while (TRUE) {
											GValue _tmp44_;
											GValue fraction = {0};
											GValue _tmp45_;
											GValue _tmp46_;
											GValue _tmp47_ = {0};
											gint in_num = 0;
											GValue _tmp48_;
											gint in_den = 0;
											GValue _tmp49_;
											gint _tmp50_ = 0;
											gint fps = 0;
											gint _tmp51_ = 0;
											gint in_fps = 0;
											if (!_tmp42_) {
												guint _tmp43_;
												_tmp43_ = j;
												j = _tmp43_ + 1;
											}
											_tmp42_ = FALSE;
											_tmp44_ = framerate;
											if (!(j < gst_value_list_get_size (&_tmp44_))) {
												break;
											}
											_tmp45_ = framerate;
											_tmp46_ = *gst_value_list_get_value (&_tmp45_, j);
											if (G_IS_VALUE (&_tmp46_)) {
												g_value_init (&_tmp47_, G_VALUE_TYPE (&_tmp46_));
												g_value_copy (&_tmp46_, &_tmp47_);
											} else {
												_tmp47_ = _tmp46_;
											}
											fraction = _tmp47_;
											_tmp48_ = fraction;
											in_num = gst_value_get_fraction_numerator (&_tmp48_);
											_tmp49_ = fraction;
											in_den = gst_value_get_fraction_denominator (&_tmp49_);
											if (den > 0) {
												_tmp50_ = num / den;
											} else {
												_tmp50_ = 0;
											}
											fps = _tmp50_;
											if (in_den > 0) {
												_tmp51_ = in_num / in_den;
											} else {
												_tmp51_ = 0;
											}
											in_fps = _tmp51_;
											if (in_fps > fps) {
												GValue _tmp52_;
												GValue _tmp53_;
												GValue* _tmp54_;
												_tmp52_ = fraction;
												_tmp53_ = _tmp52_;
												_tmp54_ = __g_value_dup0 (&_tmp53_);
												__vala_GValue_free0 (best_fraction_now);
												best_fraction_now = _tmp54_;
												num = in_num;
												den = in_den;
											}
											G_IS_VALUE (&fraction) ? (g_value_unset (&fraction), NULL) : NULL;
										}
									}
								}
							} else {
								const gchar* _tmp55_;
								_tmp55_ = G_VALUE_TYPE_NAME (&framerate);
								g_debug ("device.vala:391: Unknown type for framerate: %s", _tmp55_);
							}
						}
						if (den == 0) {
							G_IS_VALUE (&framerate) ? (g_value_unset (&framerate), NULL) : NULL;
							__vala_GValue_free0 (best_fraction_now);
							continue;
						}
						_tmp57_ = that;
						if (!gst_structure_has_field (_tmp57_, "width")) {
							_tmp56_ = TRUE;
						} else {
							GstStructure* _tmp58_;
							gint _tmp59_ = 0;
							gboolean _tmp60_;
							_tmp58_ = that;
							_tmp60_ = gst_structure_get_int (_tmp58_, "width", &_tmp59_);
							width = _tmp59_;
							_tmp56_ = !_tmp60_;
						}
						if (_tmp56_) {
							G_IS_VALUE (&framerate) ? (g_value_unset (&framerate), NULL) : NULL;
							__vala_GValue_free0 (best_fraction_now);
							continue;
						}
						_tmp62_ = that;
						if (!gst_structure_has_field (_tmp62_, "height")) {
							_tmp61_ = TRUE;
						} else {
							GstStructure* _tmp63_;
							gint _tmp64_ = 0;
							gboolean _tmp65_;
							_tmp63_ = that;
							_tmp65_ = gst_structure_get_int (_tmp63_, "height", &_tmp64_);
							height = _tmp64_;
							_tmp61_ = !_tmp65_;
						}
						if (_tmp61_) {
							G_IS_VALUE (&framerate) ? (g_value_unset (&framerate), NULL) : NULL;
							__vala_GValue_free0 (best_fraction_now);
							continue;
						}
						fps = num / den;
						if (best_fps < fps) {
							_tmp67_ = TRUE;
						} else {
							gboolean _tmp68_ = FALSE;
							if (best_fps == fps) {
								_tmp68_ = best_width < width;
							} else {
								_tmp68_ = FALSE;
							}
							_tmp67_ = _tmp68_;
						}
						if (_tmp67_) {
							_tmp66_ = TRUE;
						} else {
							gboolean _tmp69_ = FALSE;
							gboolean _tmp70_ = FALSE;
							if (best_fps == fps) {
								_tmp70_ = best_width == width;
							} else {
								_tmp70_ = FALSE;
							}
							if (_tmp70_) {
								_tmp69_ = best_height < height;
							} else {
								_tmp69_ = FALSE;
							}
							_tmp66_ = _tmp69_;
						}
						if (_tmp66_) {
							GValue* _tmp71_;
							GValue* _tmp72_;
							best_fps = fps;
							best_width = width;
							best_height = height;
							best_index = i;
							_tmp71_ = best_fraction_now;
							_tmp72_ = __g_value_dup0 (_tmp71_);
							__vala_GValue_free0 (best_fraction);
							best_fraction = _tmp72_;
						}
						G_IS_VALUE (&framerate) ? (g_value_unset (&framerate), NULL) : NULL;
						__vala_GValue_free0 (best_fraction_now);
					}
				}
			}
			if (best_index == -1) {
				gint target_pixel_count = 0;
				gdouble target_pixel_ratio = 0.0;
				gdouble best_diversion_factor = 0.0;
				target_pixel_count = 1280 * 720;
				target_pixel_ratio = 16.0 / 9.0;
				best_diversion_factor = 0.0;
				{
					gint i = 0;
					i = 0;
					{
						gboolean _tmp73_ = FALSE;
						_tmp73_ = TRUE;
						while (TRUE) {
							GstDevice* _tmp75_;
							GstCaps* _tmp76_;
							GstCaps* _tmp77_;
							GstCaps* _tmp78_;
							gboolean _tmp79_;
							GstStructure* that = NULL;
							GstDevice* _tmp80_;
							GstCaps* _tmp81_;
							GstCaps* _tmp82_;
							GstCaps* _tmp83_;
							GstStructure* _tmp84_;
							GstStructure* _tmp85_;
							GstCapsFeatures* features = NULL;
							GstDevice* _tmp86_;
							GstCaps* _tmp87_;
							GstCaps* _tmp88_;
							GstCaps* _tmp89_;
							GstCapsFeatures* _tmp90_;
							GstCapsFeatures* _tmp91_;
							gboolean _tmp92_ = FALSE;
							GstStructure* _tmp93_;
							gint width = 0;
							gint height = 0;
							gboolean _tmp95_ = FALSE;
							gboolean _tmp96_ = FALSE;
							GstStructure* _tmp97_;
							gboolean _tmp101_ = FALSE;
							gboolean _tmp102_ = FALSE;
							GstStructure* _tmp103_;
							gint pixel_count = 0;
							gdouble pixel_count_diversion_factor = 0.0;
							gdouble pixel_ratio = 0.0;
							gdouble ratio_diversion_factor = 0.0;
							gdouble diversion_factor = 0.0;
							gboolean _tmp107_ = FALSE;
							if (!_tmp73_) {
								gint _tmp74_;
								_tmp74_ = i;
								i = _tmp74_ + 1;
							}
							_tmp73_ = FALSE;
							_tmp75_ = self->priv->_device;
							_tmp76_ = gst_device_get_caps (_tmp75_);
							_tmp77_ = _tmp76_;
							_tmp78_ = _tmp77_;
							_tmp79_ = !(((guint) i) < gst_caps_get_size (_tmp78_));
							_gst_caps_unref0 (_tmp78_);
							if (_tmp79_) {
								break;
							}
							_tmp80_ = self->priv->_device;
							_tmp81_ = gst_device_get_caps (_tmp80_);
							_tmp82_ = _tmp81_;
							_tmp83_ = _tmp82_;
							_tmp84_ = gst_caps_get_structure (_tmp83_, (guint) i);
							_tmp85_ = _tmp84_;
							_gst_caps_unref0 (_tmp83_);
							that = _tmp85_;
							_tmp86_ = self->priv->_device;
							_tmp87_ = gst_device_get_caps (_tmp86_);
							_tmp88_ = _tmp87_;
							_tmp89_ = _tmp88_;
							_tmp90_ = gst_caps_get_features (_tmp89_, (guint) i);
							_tmp91_ = _tmp90_;
							_gst_caps_unref0 (_tmp89_);
							features = _tmp91_;
							_tmp93_ = that;
							if (!gst_structure_has_name (_tmp93_, "video/x-raw")) {
								_tmp92_ = TRUE;
							} else {
								GstCapsFeatures* _tmp94_;
								_tmp94_ = features;
								_tmp92_ = !gst_caps_features_contains (_tmp94_, "memory:SystemMemory");
							}
							if (_tmp92_) {
								continue;
							}
							width = 0;
							height = 0;
							_tmp97_ = that;
							if (!gst_structure_has_field (_tmp97_, "width")) {
								_tmp96_ = TRUE;
							} else {
								GstStructure* _tmp98_;
								gint _tmp99_ = 0;
								gboolean _tmp100_;
								_tmp98_ = that;
								_tmp100_ = gst_structure_get_int (_tmp98_, "width", &_tmp99_);
								width = _tmp99_;
								_tmp96_ = !_tmp100_;
							}
							if (_tmp96_) {
								_tmp95_ = TRUE;
							} else {
								_tmp95_ = width == 0;
							}
							if (_tmp95_) {
								continue;
							}
							_tmp103_ = that;
							if (!gst_structure_has_field (_tmp103_, "height")) {
								_tmp102_ = TRUE;
							} else {
								GstStructure* _tmp104_;
								gint _tmp105_ = 0;
								gboolean _tmp106_;
								_tmp104_ = that;
								_tmp106_ = gst_structure_get_int (_tmp104_, "height", &_tmp105_);
								height = _tmp105_;
								_tmp102_ = !_tmp106_;
							}
							if (_tmp102_) {
								_tmp101_ = TRUE;
							} else {
								_tmp101_ = height == 0;
							}
							if (_tmp101_) {
								continue;
							}
							pixel_count = width * height;
							if (pixel_count > target_pixel_count) {
								pixel_count_diversion_factor = ((gdouble) pixel_count) / target_pixel_count;
							} else {
								pixel_count_diversion_factor = ((gdouble) target_pixel_count) / pixel_count;
							}
							if (width > height) {
								pixel_ratio = ((gdouble) width) / height;
							} else {
								pixel_ratio = ((gdouble) height) / width;
							}
							if (pixel_ratio > target_pixel_ratio) {
								ratio_diversion_factor = pixel_ratio / target_pixel_ratio;
							} else {
								ratio_diversion_factor = target_pixel_ratio / pixel_ratio;
							}
							diversion_factor = pixel_count_diversion_factor * ratio_diversion_factor;
							if (best_index == -1) {
								_tmp107_ = TRUE;
							} else {
								_tmp107_ = diversion_factor < best_diversion_factor;
							}
							if (_tmp107_) {
								best_index = i;
								best_width = width;
								best_height = height;
								best_diversion_factor = diversion_factor;
							}
						}
					}
				}
			}
			_tmp108_ = self->priv->_device;
			_tmp109_ = gst_device_get_caps (_tmp108_);
			_tmp110_ = _tmp109_;
			_tmp111_ = _tmp110_;
			_tmp112_ = dino_plugins_rtp_device_caps_copy_nth (_tmp111_, (guint) best_index);
			_tmp113_ = _tmp112_;
			_gst_caps_unref0 (_tmp111_);
			res = _tmp113_;
			_tmp114_ = res;
			_tmp115_ = gst_caps_get_structure (_tmp114_, (guint) 0);
			that = _tmp115_;
			_tmp116_ = that;
			_tmp117_ = __g_value_dup0 (gst_structure_get_value (_tmp116_, "framerate"));
			framerate = _tmp117_;
			_tmp120_ = framerate;
			if (((gpointer) _tmp120_) != NULL) {
				GValue* _tmp121_;
				_tmp121_ = framerate;
				_tmp119_ = G_VALUE_TYPE (_tmp121_) == gst_value_list_get_type ();
			} else {
				_tmp119_ = FALSE;
			}
			if (_tmp119_) {
				GValue* _tmp122_;
				_tmp122_ = best_fraction;
				_tmp118_ = ((gpointer) _tmp122_) != NULL;
			} else {
				_tmp118_ = FALSE;
			}
			if (_tmp118_) {
				GstStructure* _tmp123_;
				GValue* _tmp124_;
				GValue _tmp125_;
				_tmp123_ = that;
				_tmp124_ = best_fraction;
				_tmp125_ = *_tmp124_;
				gst_structure_set_value (_tmp123_, "framerate", &_tmp125_);
			} else {
				GValue* _tmp126_;
				_tmp126_ = framerate;
				if (((gpointer) _tmp126_) == NULL) {
					GstStructure* _tmp127_;
					_tmp127_ = that;
					gst_structure_set (_tmp127_, "framerate", gst_fraction_get_type (), 30, 1, NULL, NULL);
				}
			}
			_tmp128_ = res;
			_tmp129_ = gst_caps_to_string (_tmp128_);
			_tmp130_ = _tmp129_;
			g_debug ("device.vala:461: Selected caps %s", _tmp130_);
			_g_free0 (_tmp130_);
			result = res;
			__vala_GValue_free0 (framerate);
			__vala_GValue_free0 (best_fraction);
			return result;
		} else {
			GstDevice* _tmp131_;
			GstCaps* _tmp132_;
			GstCaps* _tmp133_;
			GstCaps* _tmp134_;
			gboolean _tmp135_;
			_tmp131_ = self->priv->_device;
			_tmp132_ = gst_device_get_caps (_tmp131_);
			_tmp133_ = _tmp132_;
			_tmp134_ = _tmp133_;
			_tmp135_ = gst_caps_get_size (_tmp134_) > ((guint) 0);
			_gst_caps_unref0 (_tmp134_);
			if (_tmp135_) {
				GstDevice* _tmp136_;
				GstCaps* _tmp137_;
				GstCaps* _tmp138_;
				GstCaps* _tmp139_;
				GstCaps* _tmp140_;
				GstCaps* _tmp141_;
				_tmp136_ = self->priv->_device;
				_tmp137_ = gst_device_get_caps (_tmp136_);
				_tmp138_ = _tmp137_;
				_tmp139_ = _tmp138_;
				_tmp140_ = dino_plugins_rtp_device_caps_copy_nth (_tmp139_, (guint) 0);
				_tmp141_ = _tmp140_;
				_gst_caps_unref0 (_tmp139_);
				result = _tmp141_;
				return result;
			} else {
				GstCaps* _tmp142_;
				_tmp142_ = gst_caps_new_any ();
				result = _tmp142_;
				return result;
			}
		}
	}
}

static GstCaps*
dino_plugins_rtp_device_caps_copy_nth (GstCaps* source,
                                       guint index)
{
	GstCaps* target = NULL;
	GstCaps* _tmp0_;
	GstStructure* _tmp1_;
	GstStructure* _tmp2_;
	GstCapsFeatures* _tmp3_;
	GstCapsFeatures* _tmp4_;
	GstCaps* result;
	g_return_val_if_fail (source != NULL, NULL);
	_tmp0_ = gst_caps_new_empty ();
	target = _tmp0_;
	((GstMiniObject*) target)->flags = ((GstMiniObject*) source)->flags;
	_tmp1_ = gst_caps_get_structure (source, index);
	_tmp2_ = gst_structure_copy (_tmp1_);
	_tmp3_ = gst_caps_get_features (source, index);
	_tmp4_ = gst_caps_features_copy (_tmp3_);
	gst_caps_append_structure_full (target, _tmp2_, _tmp4_);
	result = target;
	return result;
}

static void
dino_plugins_rtp_device_create (DinoPluginsRtpDevice* self)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	DinoPluginsRtpPlugin* _tmp3_;
	GstDevice* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GstElement* _tmp8_;
	GstElement* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GstPipeline* _tmp14_;
	GstPipeline* _tmp15_;
	GstElement* _tmp16_;
	GstCaps* _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	gboolean _tmp75_ = FALSE;
	gboolean _tmp76_;
	gboolean _tmp77_;
	DinoPluginsRtpPlugin* _tmp124_;
	g_return_if_fail (self != NULL);
	_tmp0_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	g_debug ("device.vala:479: Creating device %s", _tmp2_);
	_g_free0 (_tmp2_);
	_tmp3_ = self->priv->_plugin;
	dino_plugins_rtp_plugin_pause (_tmp3_);
	_tmp4_ = self->priv->_device;
	_tmp5_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp8_ = gst_device_create_element (_tmp4_, _tmp7_);
	_tmp9_ = _g_object_ref0 (_tmp8_);
	_g_object_unref0 (self->priv->element);
	self->priv->element = _tmp9_;
	_g_free0 (_tmp7_);
	_tmp10_ = dino_plugins_rtp_device_get_is_sink (self);
	_tmp11_ = _tmp10_;
	if (_tmp11_) {
		GstElement* _tmp12_;
		GstElement* _tmp13_;
		_tmp12_ = self->priv->element;
		g_object_set ((GObject*) _tmp12_, "async", FALSE, NULL);
		_tmp13_ = self->priv->element;
		g_object_set ((GObject*) _tmp13_, "sync", FALSE, NULL);
	}
	_tmp14_ = dino_plugins_rtp_device_get_pipe (self);
	_tmp15_ = _tmp14_;
	_tmp16_ = self->priv->element;
	gst_bin_add ((GstBin*) _tmp15_, _tmp16_);
	_tmp17_ = dino_plugins_rtp_device_get_best_caps (self);
	_gst_caps_unref0 (self->priv->device_caps);
	self->priv->device_caps = _tmp17_;
	_tmp18_ = dino_plugins_rtp_device_get_is_source (self);
	_tmp19_ = _tmp18_;
	if (_tmp19_) {
		GstElement* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		const gchar* _tmp24_;
		gchar* _tmp25_;
		gchar* _tmp26_;
		GstElement* _tmp27_;
		GstElement* _tmp28_;
		GstCaps* _tmp29_;
		GstPipeline* _tmp30_;
		GstPipeline* _tmp31_;
		GstElement* _tmp32_;
		GstElement* _tmp33_;
		GstElement* _tmp34_;
		gboolean _tmp35_ = FALSE;
		gchar* _tmp36_;
		gchar* _tmp37_;
		gchar* _tmp38_;
		gboolean _tmp39_;
		gchar* _tmp60_;
		gchar* _tmp61_;
		gchar* _tmp62_;
		const gchar* _tmp63_;
		gchar* _tmp64_;
		gchar* _tmp65_;
		GstElement* _tmp66_;
		GstElement* _tmp67_;
		GstPipeline* _tmp68_;
		GstPipeline* _tmp69_;
		GstElement* _tmp70_;
		GstElement* _tmp71_ = NULL;
		GstElement* _tmp72_;
		GstElement* _tmp74_;
		_tmp20_ = self->priv->element;
		g_object_set ((GObject*) _tmp20_, "do-timestamp", TRUE, NULL);
		_tmp21_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
		_tmp22_ = _tmp21_;
		_tmp23_ = _tmp22_;
		_tmp24_ = string_to_string (_tmp23_);
		_tmp25_ = g_strconcat ("caps_filter_", _tmp24_, NULL);
		_tmp26_ = _tmp25_;
		_tmp27_ = gst_element_factory_make ("capsfilter", _tmp26_);
		if (_tmp27_ != NULL) {
			g_object_ref_sink (_tmp27_);
		}
		_g_object_unref0 (self->priv->filter);
		self->priv->filter = _tmp27_;
		_g_free0 (_tmp26_);
		_g_free0 (_tmp23_);
		_tmp28_ = self->priv->filter;
		_tmp29_ = self->priv->device_caps;
		g_object_set ((GObject*) _tmp28_, "caps", _tmp29_, NULL);
		_tmp30_ = dino_plugins_rtp_device_get_pipe (self);
		_tmp31_ = _tmp30_;
		_tmp32_ = self->priv->filter;
		gst_bin_add ((GstBin*) _tmp31_, _tmp32_);
		_tmp33_ = self->priv->element;
		_tmp34_ = self->priv->filter;
		gst_element_link (_tmp33_, _tmp34_);
		_tmp36_ = dino_plugins_media_device_get_media ((DinoPluginsMediaDevice*) self);
		_tmp37_ = _tmp36_;
		_tmp38_ = _tmp37_;
		_tmp39_ = g_strcmp0 (_tmp38_, "audio") == 0;
		_g_free0 (_tmp38_);
		if (_tmp39_) {
			DinoPluginsRtpPlugin* _tmp40_;
			GstElement* _tmp41_;
			GstElement* _tmp42_;
			_tmp40_ = self->priv->_plugin;
			_tmp41_ = dino_plugins_rtp_plugin_get_echoprobe (_tmp40_);
			_tmp42_ = _tmp41_;
			_tmp35_ = _tmp42_ != NULL;
		} else {
			_tmp35_ = FALSE;
		}
		if (_tmp35_) {
			DinoPluginsRtpPlugin* _tmp43_;
			GstElement* _tmp44_;
			GstElement* _tmp45_;
			GstElement* _tmp46_;
			DinoPluginsRtpVoiceProcessor* _tmp47_;
			GstElement* _tmp48_;
			gchar* _tmp49_;
			gchar* _tmp50_;
			gchar* _tmp51_;
			const gchar* _tmp52_;
			gchar* _tmp53_;
			gchar* _tmp54_;
			GstPipeline* _tmp55_;
			GstPipeline* _tmp56_;
			GstElement* _tmp57_;
			GstElement* _tmp58_;
			GstElement* _tmp59_;
			_tmp43_ = self->priv->_plugin;
			_tmp44_ = dino_plugins_rtp_plugin_get_echoprobe (_tmp43_);
			_tmp45_ = _tmp44_;
			_tmp46_ = self->priv->element;
			_tmp47_ = dino_plugins_rtp_voice_processor_new (DINO_PLUGINS_RTP_IS_ECHO_PROBE (_tmp45_) ? ((DinoPluginsRtpEchoProbe*) _tmp45_) : NULL, G_TYPE_CHECK_INSTANCE_TYPE (_tmp46_, gst_stream_volume_get_type ()) ? ((GstStreamVolume*) _tmp46_) : NULL);
			g_object_ref_sink (_tmp47_);
			_g_object_unref0 (self->priv->dsp);
			self->priv->dsp = (GstElement*) _tmp47_;
			_tmp48_ = self->priv->dsp;
			_tmp49_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
			_tmp50_ = _tmp49_;
			_tmp51_ = _tmp50_;
			_tmp52_ = string_to_string (_tmp51_);
			_tmp53_ = g_strconcat ("dsp_", _tmp52_, NULL);
			_tmp54_ = _tmp53_;
			gst_object_set_name ((GstObject*) _tmp48_, _tmp54_);
			_g_free0 (_tmp54_);
			_g_free0 (_tmp51_);
			_tmp55_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp56_ = _tmp55_;
			_tmp57_ = self->priv->dsp;
			gst_bin_add ((GstBin*) _tmp56_, _tmp57_);
			_tmp58_ = self->priv->filter;
			_tmp59_ = self->priv->dsp;
			gst_element_link (_tmp58_, _tmp59_);
		}
		_tmp60_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
		_tmp61_ = _tmp60_;
		_tmp62_ = _tmp61_;
		_tmp63_ = string_to_string (_tmp62_);
		_tmp64_ = g_strconcat ("tee_", _tmp63_, NULL);
		_tmp65_ = _tmp64_;
		_tmp66_ = gst_element_factory_make ("tee", _tmp65_);
		if (_tmp66_ != NULL) {
			g_object_ref_sink (_tmp66_);
		}
		_g_object_unref0 (self->priv->tee);
		self->priv->tee = _tmp66_;
		_g_free0 (_tmp65_);
		_g_free0 (_tmp62_);
		_tmp67_ = self->priv->tee;
		g_object_set ((GObject*) _tmp67_, "allow-not-linked", TRUE, NULL);
		_tmp68_ = dino_plugins_rtp_device_get_pipe (self);
		_tmp69_ = _tmp68_;
		_tmp70_ = self->priv->tee;
		gst_bin_add ((GstBin*) _tmp69_, _tmp70_);
		_tmp72_ = self->priv->dsp;
		_tmp71_ = _tmp72_;
		if (_tmp71_ == NULL) {
			GstElement* _tmp73_;
			_tmp73_ = self->priv->filter;
			_tmp71_ = _tmp73_;
		}
		_tmp74_ = self->priv->tee;
		gst_element_link (_tmp71_, _tmp74_);
	}
	_tmp76_ = dino_plugins_rtp_device_get_is_sink (self);
	_tmp77_ = _tmp76_;
	if (_tmp77_) {
		gchar* _tmp78_;
		gchar* _tmp79_;
		gchar* _tmp80_;
		_tmp78_ = dino_plugins_media_device_get_media ((DinoPluginsMediaDevice*) self);
		_tmp79_ = _tmp78_;
		_tmp80_ = _tmp79_;
		_tmp75_ = g_strcmp0 (_tmp80_, "audio") == 0;
		_g_free0 (_tmp80_);
	} else {
		_tmp75_ = FALSE;
	}
	if (_tmp75_) {
		gchar* _tmp81_;
		gchar* _tmp82_;
		gchar* _tmp83_;
		const gchar* _tmp84_;
		gchar* _tmp85_;
		gchar* _tmp86_;
		GstElement* _tmp87_;
		GstPipeline* _tmp88_;
		GstPipeline* _tmp89_;
		GstAggregator* _tmp90_;
		gboolean _tmp91_ = FALSE;
		DinoPluginsRtpPlugin* _tmp92_;
		GstElement* _tmp93_;
		GstElement* _tmp94_;
		_tmp81_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
		_tmp82_ = _tmp81_;
		_tmp83_ = _tmp82_;
		_tmp84_ = string_to_string (_tmp83_);
		_tmp85_ = g_strconcat ("mixer_", _tmp84_, NULL);
		_tmp86_ = _tmp85_;
		_tmp87_ = gst_element_factory_make ("audiomixer", _tmp86_);
		g_object_ref_sink (G_TYPE_CHECK_INSTANCE_CAST (_tmp87_, gst_aggregator_get_type (), GstAggregator));
		_g_object_unref0 (self->priv->mixer);
		self->priv->mixer = G_TYPE_CHECK_INSTANCE_CAST (_tmp87_, gst_aggregator_get_type (), GstAggregator);
		_g_free0 (_tmp86_);
		_g_free0 (_tmp83_);
		_tmp88_ = dino_plugins_rtp_device_get_pipe (self);
		_tmp89_ = _tmp88_;
		_tmp90_ = self->priv->mixer;
		gst_bin_add ((GstBin*) _tmp89_, (GstElement*) _tmp90_);
		_tmp92_ = self->priv->_plugin;
		_tmp93_ = dino_plugins_rtp_plugin_get_echoprobe (_tmp92_);
		_tmp94_ = _tmp93_;
		if (_tmp94_ != NULL) {
			DinoPluginsRtpPlugin* _tmp95_;
			GstElement* _tmp96_;
			GstElement* _tmp97_;
			GstPad* _tmp98_;
			GstPad* _tmp99_;
			_tmp95_ = self->priv->_plugin;
			_tmp96_ = dino_plugins_rtp_plugin_get_echoprobe (_tmp95_);
			_tmp97_ = _tmp96_;
			_tmp98_ = gst_element_get_static_pad (_tmp97_, "src");
			_tmp99_ = _tmp98_;
			_tmp91_ = !gst_pad_is_linked (_tmp99_);
			_g_object_unref0 (_tmp99_);
		} else {
			_tmp91_ = FALSE;
		}
		if (_tmp91_) {
			GstAggregator* _tmp100_;
			DinoPluginsRtpPlugin* _tmp101_;
			GstElement* _tmp102_;
			GstElement* _tmp103_;
			DinoPluginsRtpPlugin* _tmp104_;
			GstElement* _tmp105_;
			GstElement* _tmp106_;
			GstElement* _tmp107_;
			_tmp100_ = self->priv->mixer;
			_tmp101_ = self->priv->_plugin;
			_tmp102_ = dino_plugins_rtp_plugin_get_echoprobe (_tmp101_);
			_tmp103_ = _tmp102_;
			gst_element_link ((GstElement*) _tmp100_, _tmp103_);
			_tmp104_ = self->priv->_plugin;
			_tmp105_ = dino_plugins_rtp_plugin_get_echoprobe (_tmp104_);
			_tmp106_ = _tmp105_;
			_tmp107_ = self->priv->element;
			gst_element_link (_tmp106_, _tmp107_);
		} else {
			gchar* _tmp108_;
			gchar* _tmp109_;
			gchar* _tmp110_;
			const gchar* _tmp111_;
			gchar* _tmp112_;
			gchar* _tmp113_;
			GstElement* _tmp114_;
			GstElement* _tmp115_;
			GstCaps* _tmp116_;
			GstPipeline* _tmp117_;
			GstPipeline* _tmp118_;
			GstElement* _tmp119_;
			GstAggregator* _tmp120_;
			GstElement* _tmp121_;
			GstElement* _tmp122_;
			GstElement* _tmp123_;
			_tmp108_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
			_tmp109_ = _tmp108_;
			_tmp110_ = _tmp109_;
			_tmp111_ = string_to_string (_tmp110_);
			_tmp112_ = g_strconcat ("caps_filter_", _tmp111_, NULL);
			_tmp113_ = _tmp112_;
			_tmp114_ = gst_element_factory_make ("capsfilter", _tmp113_);
			if (_tmp114_ != NULL) {
				g_object_ref_sink (_tmp114_);
			}
			_g_object_unref0 (self->priv->filter);
			self->priv->filter = _tmp114_;
			_g_free0 (_tmp113_);
			_g_free0 (_tmp110_);
			_tmp115_ = self->priv->filter;
			_tmp116_ = self->priv->device_caps;
			g_object_set ((GObject*) _tmp115_, "caps", _tmp116_, NULL);
			_tmp117_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp118_ = _tmp117_;
			_tmp119_ = self->priv->filter;
			gst_bin_add ((GstBin*) _tmp118_, _tmp119_);
			_tmp120_ = self->priv->mixer;
			_tmp121_ = self->priv->filter;
			gst_element_link ((GstElement*) _tmp120_, _tmp121_);
			_tmp122_ = self->priv->filter;
			_tmp123_ = self->priv->element;
			gst_element_link (_tmp122_, _tmp123_);
		}
	}
	_tmp124_ = self->priv->_plugin;
	dino_plugins_rtp_plugin_unpause (_tmp124_);
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		DinoPluginsRtpDevice* self;
		self = _data2_->self;
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static gboolean
____lambda8_ (Block2Data* _data2_,
              GstElement* _,
              GstPad* pad)
{
	DinoPluginsRtpDevice* self;
	gboolean result;
	self = _data2_->self;
	g_return_val_if_fail (_ != NULL, FALSE);
	g_return_val_if_fail (pad != NULL, FALSE);
	if (gst_pad_is_linked (pad)) {
		gint _tmp0_;
		_tmp0_ = _data2_->linked_sink_pads;
		_data2_->linked_sink_pads = _tmp0_ + 1;
	}
	result = TRUE;
	return result;
}

static gboolean
_____lambda8__gst_element_foreach_pad_func (GstElement* element,
                                            GstPad* pad,
                                            gpointer self)
{
	gboolean result;
	result = ____lambda8_ (self, element, pad);
	return result;
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		DinoPluginsRtpDevice* self;
		self = _data3_->self;
		_g_object_unref0 (self);
		g_slice_free (Block3Data, _data3_);
	}
}

static gboolean
____lambda9_ (Block3Data* _data3_,
              GstElement* _,
              GstPad* pad)
{
	DinoPluginsRtpDevice* self;
	gboolean result;
	self = _data3_->self;
	g_return_val_if_fail (_ != NULL, FALSE);
	g_return_val_if_fail (pad != NULL, FALSE);
	if (gst_pad_is_linked (pad)) {
		gint _tmp0_;
		_tmp0_ = _data3_->linked_src_pads;
		_data3_->linked_src_pads = _tmp0_ + 1;
	}
	result = TRUE;
	return result;
}

static gboolean
_____lambda9__gst_element_foreach_pad_func (GstElement* element,
                                            GstPad* pad,
                                            gpointer self)
{
	gboolean result;
	result = ____lambda9_ (self, element, pad);
	return result;
}

static void
dino_plugins_rtp_device_destroy (DinoPluginsRtpDevice* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	GstElement* _tmp28_;
	GstElement* _tmp29_;
	GstElement* _tmp30_;
	GstPipeline* _tmp37_;
	GstPipeline* _tmp38_;
	GstElement* _tmp39_;
	GstAggregator* _tmp40_;
	gboolean _tmp46_;
	gboolean _tmp47_;
	gchar* _tmp76_;
	gchar* _tmp77_;
	gchar* _tmp78_;
	g_return_if_fail (self != NULL);
	_tmp0_ = dino_plugins_rtp_device_get_is_sink (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		GstAggregator* _tmp2_;
		GstElement* _tmp13_;
		DinoPluginsRtpPlugin* _tmp21_;
		GstElement* _tmp22_;
		GstElement* _tmp23_;
		_tmp2_ = self->priv->mixer;
		if (_tmp2_ != NULL) {
			Block2Data* _data2_;
			GstAggregator* _tmp3_;
			GstElement* _tmp7_ = NULL;
			DinoPluginsRtpPlugin* _tmp8_;
			GstElement* _tmp9_;
			GstElement* _tmp10_;
			GstAggregator* _tmp12_;
			_data2_ = g_slice_new0 (Block2Data);
			_data2_->_ref_count_ = 1;
			_data2_->self = g_object_ref (self);
			_data2_->linked_sink_pads = 0;
			_tmp3_ = self->priv->mixer;
			gst_element_foreach_sink_pad ((GstElement*) _tmp3_, _____lambda8__gst_element_foreach_pad_func, _data2_);
			if (_data2_->linked_sink_pads > 0) {
				gchar* _tmp4_;
				gchar* _tmp5_;
				gchar* _tmp6_;
				_tmp4_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
				_tmp5_ = _tmp4_;
				_tmp6_ = _tmp5_;
				g_warning ("device.vala:533: %s-mixer still has %i sink pads while being destroyed", _tmp6_, _data2_->linked_sink_pads);
				_g_free0 (_tmp6_);
			}
			_tmp8_ = self->priv->_plugin;
			_tmp9_ = dino_plugins_rtp_plugin_get_echoprobe (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp7_ = _tmp10_;
			if (_tmp7_ == NULL) {
				GstElement* _tmp11_;
				_tmp11_ = self->priv->element;
				_tmp7_ = _tmp11_;
			}
			_tmp12_ = self->priv->mixer;
			gst_element_unlink ((GstElement*) _tmp12_, _tmp7_);
			block2_data_unref (_data2_);
			_data2_ = NULL;
		}
		_tmp13_ = self->priv->filter;
		if (_tmp13_ != NULL) {
			GstElement* _tmp14_;
			GstElement* _tmp15_;
			GstElement* _tmp16_;
			GstElement* _tmp17_;
			GstPipeline* _tmp18_;
			GstPipeline* _tmp19_;
			GstElement* _tmp20_;
			_tmp14_ = self->priv->filter;
			gst_element_set_locked_state (_tmp14_, TRUE);
			_tmp15_ = self->priv->filter;
			gst_element_set_state (_tmp15_, GST_STATE_NULL);
			_tmp16_ = self->priv->filter;
			_tmp17_ = self->priv->element;
			gst_element_unlink (_tmp16_, _tmp17_);
			_tmp18_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp19_ = _tmp18_;
			_tmp20_ = self->priv->filter;
			gst_bin_remove ((GstBin*) _tmp19_, _tmp20_);
			_g_object_unref0 (self->priv->filter);
			self->priv->filter = NULL;
		}
		_tmp21_ = self->priv->_plugin;
		_tmp22_ = dino_plugins_rtp_plugin_get_echoprobe (_tmp21_);
		_tmp23_ = _tmp22_;
		if (_tmp23_ != NULL) {
			DinoPluginsRtpPlugin* _tmp24_;
			GstElement* _tmp25_;
			GstElement* _tmp26_;
			GstElement* _tmp27_;
			_tmp24_ = self->priv->_plugin;
			_tmp25_ = dino_plugins_rtp_plugin_get_echoprobe (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = self->priv->element;
			gst_element_unlink (_tmp26_, _tmp27_);
		}
	}
	_tmp28_ = self->priv->element;
	gst_element_set_locked_state (_tmp28_, TRUE);
	_tmp29_ = self->priv->element;
	gst_element_set_state (_tmp29_, GST_STATE_NULL);
	_tmp30_ = self->priv->filter;
	if (_tmp30_ != NULL) {
		GstElement* _tmp31_;
		GstElement* _tmp32_;
		_tmp31_ = self->priv->element;
		_tmp32_ = self->priv->filter;
		gst_element_unlink (_tmp31_, _tmp32_);
	} else {
		gboolean _tmp33_;
		gboolean _tmp34_;
		_tmp33_ = dino_plugins_rtp_device_get_is_source (self);
		_tmp34_ = _tmp33_;
		if (_tmp34_) {
			GstElement* _tmp35_;
			GstElement* _tmp36_;
			_tmp35_ = self->priv->element;
			_tmp36_ = self->priv->tee;
			gst_element_unlink (_tmp35_, _tmp36_);
		}
	}
	_tmp37_ = dino_plugins_rtp_device_get_pipe (self);
	_tmp38_ = _tmp37_;
	_tmp39_ = self->priv->element;
	gst_bin_remove ((GstBin*) _tmp38_, _tmp39_);
	_g_object_unref0 (self->priv->element);
	self->priv->element = NULL;
	_tmp40_ = self->priv->mixer;
	if (_tmp40_ != NULL) {
		GstAggregator* _tmp41_;
		GstAggregator* _tmp42_;
		GstPipeline* _tmp43_;
		GstPipeline* _tmp44_;
		GstAggregator* _tmp45_;
		_tmp41_ = self->priv->mixer;
		gst_element_set_locked_state ((GstElement*) _tmp41_, TRUE);
		_tmp42_ = self->priv->mixer;
		gst_element_set_state ((GstElement*) _tmp42_, GST_STATE_NULL);
		_tmp43_ = dino_plugins_rtp_device_get_pipe (self);
		_tmp44_ = _tmp43_;
		_tmp45_ = self->priv->mixer;
		gst_bin_remove ((GstBin*) _tmp44_, (GstElement*) _tmp45_);
		_g_object_unref0 (self->priv->mixer);
		self->priv->mixer = NULL;
	}
	_tmp46_ = dino_plugins_rtp_device_get_is_source (self);
	_tmp47_ = _tmp46_;
	if (_tmp47_) {
		GstElement* _tmp48_;
		GstElement* _tmp58_;
		GstElement* _tmp66_;
		_tmp48_ = self->priv->filter;
		if (_tmp48_ != NULL) {
			GstElement* _tmp49_;
			GstElement* _tmp50_;
			GstElement* _tmp51_ = NULL;
			GstElement* _tmp52_;
			GstElement* _tmp54_;
			GstPipeline* _tmp55_;
			GstPipeline* _tmp56_;
			GstElement* _tmp57_;
			_tmp49_ = self->priv->filter;
			gst_element_set_locked_state (_tmp49_, TRUE);
			_tmp50_ = self->priv->filter;
			gst_element_set_state (_tmp50_, GST_STATE_NULL);
			_tmp52_ = self->priv->dsp;
			_tmp51_ = _tmp52_;
			if (_tmp51_ == NULL) {
				GstElement* _tmp53_;
				_tmp53_ = self->priv->tee;
				_tmp51_ = _tmp53_;
			}
			_tmp54_ = self->priv->filter;
			gst_element_unlink (_tmp54_, _tmp51_);
			_tmp55_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp56_ = _tmp55_;
			_tmp57_ = self->priv->filter;
			gst_bin_remove ((GstBin*) _tmp56_, _tmp57_);
			_g_object_unref0 (self->priv->filter);
			self->priv->filter = NULL;
		}
		_tmp58_ = self->priv->dsp;
		if (_tmp58_ != NULL) {
			GstElement* _tmp59_;
			GstElement* _tmp60_;
			GstElement* _tmp61_;
			GstElement* _tmp62_;
			GstPipeline* _tmp63_;
			GstPipeline* _tmp64_;
			GstElement* _tmp65_;
			_tmp59_ = self->priv->dsp;
			gst_element_set_locked_state (_tmp59_, TRUE);
			_tmp60_ = self->priv->dsp;
			gst_element_set_state (_tmp60_, GST_STATE_NULL);
			_tmp61_ = self->priv->dsp;
			_tmp62_ = self->priv->tee;
			gst_element_unlink (_tmp61_, _tmp62_);
			_tmp63_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp64_ = _tmp63_;
			_tmp65_ = self->priv->dsp;
			gst_bin_remove ((GstBin*) _tmp64_, _tmp65_);
			_g_object_unref0 (self->priv->dsp);
			self->priv->dsp = NULL;
		}
		_tmp66_ = self->priv->tee;
		if (_tmp66_ != NULL) {
			Block3Data* _data3_;
			GstElement* _tmp67_;
			GstElement* _tmp71_;
			GstElement* _tmp72_;
			GstPipeline* _tmp73_;
			GstPipeline* _tmp74_;
			GstElement* _tmp75_;
			_data3_ = g_slice_new0 (Block3Data);
			_data3_->_ref_count_ = 1;
			_data3_->self = g_object_ref (self);
			_data3_->linked_src_pads = 0;
			_tmp67_ = self->priv->tee;
			gst_element_foreach_src_pad (_tmp67_, _____lambda9__gst_element_foreach_pad_func, _data3_);
			if (_data3_->linked_src_pads != 0) {
				gchar* _tmp68_;
				gchar* _tmp69_;
				gchar* _tmp70_;
				_tmp68_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
				_tmp69_ = _tmp68_;
				_tmp70_ = _tmp69_;
				g_warning ("device.vala:582: %s-tee still has %d src pads while being destroyed", _tmp70_, _data3_->linked_src_pads);
				_g_free0 (_tmp70_);
			}
			_tmp71_ = self->priv->tee;
			gst_element_set_locked_state (_tmp71_, TRUE);
			_tmp72_ = self->priv->tee;
			gst_element_set_state (_tmp72_, GST_STATE_NULL);
			_tmp73_ = dino_plugins_rtp_device_get_pipe (self);
			_tmp74_ = _tmp73_;
			_tmp75_ = self->priv->tee;
			gst_bin_remove ((GstBin*) _tmp74_, _tmp75_);
			_g_object_unref0 (self->priv->tee);
			self->priv->tee = NULL;
			block3_data_unref (_data3_);
			_data3_ = NULL;
		}
	}
	_tmp76_ = dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self);
	_tmp77_ = _tmp76_;
	_tmp78_ = _tmp77_;
	g_debug ("device.vala:590: Destroyed device %s", _tmp78_);
	_g_free0 (_tmp78_);
}

DinoPluginsRtpPlugin*
dino_plugins_rtp_device_get_plugin (DinoPluginsRtpDevice* self)
{
	DinoPluginsRtpPlugin* result;
	DinoPluginsRtpPlugin* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_plugin;
	result = _tmp0_;
	return result;
}

static void
dino_plugins_rtp_device_set_plugin (DinoPluginsRtpDevice* self,
                                    DinoPluginsRtpPlugin* value)
{
	DinoPluginsRtpPlugin* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_plugins_rtp_device_get_plugin (self);
	if (old_value != value) {
		DinoPluginsRtpPlugin* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_plugin);
		self->priv->_plugin = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_PLUGIN_PROPERTY]);
	}
}

DinoPluginsRtpCodecUtil*
dino_plugins_rtp_device_get_codec_util (DinoPluginsRtpDevice* self)
{
	DinoPluginsRtpCodecUtil* result;
	DinoPluginsRtpPlugin* _tmp0_;
	DinoPluginsRtpCodecUtil* _tmp1_;
	DinoPluginsRtpCodecUtil* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_plugin;
	_tmp1_ = dino_plugins_rtp_plugin_get_codec_util (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

GstDevice*
dino_plugins_rtp_device_get_device (DinoPluginsRtpDevice* self)
{
	GstDevice* result;
	GstDevice* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_device;
	result = _tmp0_;
	return result;
}

static void
dino_plugins_rtp_device_set_device (DinoPluginsRtpDevice* self,
                                    GstDevice* value)
{
	GstDevice* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_plugins_rtp_device_get_device (self);
	if (old_value != value) {
		GstDevice* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_device);
		self->priv->_device = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_DEVICE_PROPERTY]);
	}
}

static gchar*
dino_plugins_rtp_device_real_get_id (DinoPluginsMediaDevice* base)
{
	gchar* result;
	DinoPluginsRtpDevice* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (DinoPluginsRtpDevice*) base;
	_tmp0_ = self->priv->device_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
dino_plugins_rtp_device_real_get_display_name (DinoPluginsMediaDevice* base)
{
	gchar* result;
	DinoPluginsRtpDevice* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (DinoPluginsRtpDevice*) base;
	_tmp0_ = self->priv->device_display_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
dino_plugins_rtp_device_real_get_detail_name (DinoPluginsMediaDevice* base)
{
	gchar* result;
	DinoPluginsRtpDevice* self;
	GstDevice* _tmp0_;
	GstStructure* _tmp1_;
	GstStructure* _tmp2_;
	GstStructure* _tmp3_;
	gboolean _tmp4_;
	GstDevice* _tmp5_;
	GstStructure* _tmp6_;
	GstStructure* _tmp7_;
	GstStructure* _tmp8_;
	gboolean _tmp9_;
	GstDevice* _tmp17_;
	GstStructure* _tmp18_;
	GstStructure* _tmp19_;
	GstStructure* _tmp20_;
	gboolean _tmp21_;
	GstDevice* _tmp29_;
	GstStructure* _tmp30_;
	GstStructure* _tmp31_;
	GstStructure* _tmp32_;
	gboolean _tmp33_;
	GstDevice* _tmp41_;
	GstStructure* _tmp42_;
	GstStructure* _tmp43_;
	GstStructure* _tmp44_;
	gboolean _tmp45_;
	self = (DinoPluginsRtpDevice*) base;
	_tmp0_ = self->priv->_device;
	_tmp1_ = gst_device_get_properties (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_ == NULL;
	_gst_structure_free0 (_tmp3_);
	if (_tmp4_) {
		result = NULL;
		return result;
	}
	_tmp5_ = self->priv->_device;
	_tmp6_ = gst_device_get_properties (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp9_ = gst_structure_has_field (_tmp8_, "alsa.card_name");
	_gst_structure_free0 (_tmp8_);
	if (_tmp9_) {
		GstDevice* _tmp10_;
		GstStructure* _tmp11_;
		GstStructure* _tmp12_;
		GstStructure* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		_tmp10_ = self->priv->_device;
		_tmp11_ = gst_device_get_properties (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = _tmp12_;
		_tmp14_ = gst_structure_get_string (_tmp13_, "alsa.card_name");
		_tmp15_ = g_strdup (_tmp14_);
		_tmp16_ = _tmp15_;
		_gst_structure_free0 (_tmp13_);
		result = _tmp16_;
		return result;
	}
	_tmp17_ = self->priv->_device;
	_tmp18_ = gst_device_get_properties (_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = _tmp19_;
	_tmp21_ = gst_structure_has_field (_tmp20_, "alsa.name");
	_gst_structure_free0 (_tmp20_);
	if (_tmp21_) {
		GstDevice* _tmp22_;
		GstStructure* _tmp23_;
		GstStructure* _tmp24_;
		GstStructure* _tmp25_;
		const gchar* _tmp26_;
		gchar* _tmp27_;
		gchar* _tmp28_;
		_tmp22_ = self->priv->_device;
		_tmp23_ = gst_device_get_properties (_tmp22_);
		_tmp24_ = _tmp23_;
		_tmp25_ = _tmp24_;
		_tmp26_ = gst_structure_get_string (_tmp25_, "alsa.name");
		_tmp27_ = g_strdup (_tmp26_);
		_tmp28_ = _tmp27_;
		_gst_structure_free0 (_tmp25_);
		result = _tmp28_;
		return result;
	}
	_tmp29_ = self->priv->_device;
	_tmp30_ = gst_device_get_properties (_tmp29_);
	_tmp31_ = _tmp30_;
	_tmp32_ = _tmp31_;
	_tmp33_ = gst_structure_has_field (_tmp32_, "alsa.id");
	_gst_structure_free0 (_tmp32_);
	if (_tmp33_) {
		GstDevice* _tmp34_;
		GstStructure* _tmp35_;
		GstStructure* _tmp36_;
		GstStructure* _tmp37_;
		const gchar* _tmp38_;
		gchar* _tmp39_;
		gchar* _tmp40_;
		_tmp34_ = self->priv->_device;
		_tmp35_ = gst_device_get_properties (_tmp34_);
		_tmp36_ = _tmp35_;
		_tmp37_ = _tmp36_;
		_tmp38_ = gst_structure_get_string (_tmp37_, "alsa.id");
		_tmp39_ = g_strdup (_tmp38_);
		_tmp40_ = _tmp39_;
		_gst_structure_free0 (_tmp37_);
		result = _tmp40_;
		return result;
	}
	_tmp41_ = self->priv->_device;
	_tmp42_ = gst_device_get_properties (_tmp41_);
	_tmp43_ = _tmp42_;
	_tmp44_ = _tmp43_;
	_tmp45_ = gst_structure_has_field (_tmp44_, "api.v4l2.cap.card");
	_gst_structure_free0 (_tmp44_);
	if (_tmp45_) {
		GstDevice* _tmp46_;
		GstStructure* _tmp47_;
		GstStructure* _tmp48_;
		GstStructure* _tmp49_;
		const gchar* _tmp50_;
		gchar* _tmp51_;
		gchar* _tmp52_;
		_tmp46_ = self->priv->_device;
		_tmp47_ = gst_device_get_properties (_tmp46_);
		_tmp48_ = _tmp47_;
		_tmp49_ = _tmp48_;
		_tmp50_ = gst_structure_get_string (_tmp49_, "api.v4l2.cap.card");
		_tmp51_ = g_strdup (_tmp50_);
		_tmp52_ = _tmp51_;
		_gst_structure_free0 (_tmp49_);
		result = _tmp52_;
		return result;
	}
	result = NULL;
	return result;
}

static gchar*
dino_plugins_rtp_device_real_get_media (DinoPluginsMediaDevice* base)
{
	gchar* result;
	DinoPluginsRtpDevice* self;
	GstDevice* _tmp0_;
	self = (DinoPluginsRtpDevice*) base;
	_tmp0_ = self->priv->_device;
	if (gst_device_has_classes (_tmp0_, "Audio")) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("audio");
		result = _tmp1_;
		return result;
	} else {
		GstDevice* _tmp2_;
		_tmp2_ = self->priv->_device;
		if (gst_device_has_classes (_tmp2_, "Video")) {
			gchar* _tmp3_;
			_tmp3_ = g_strdup ("video");
			result = _tmp3_;
			return result;
		} else {
			result = NULL;
			return result;
		}
	}
}

static gboolean
dino_plugins_rtp_device_real_get_incoming (DinoPluginsMediaDevice* base)
{
	gboolean result;
	DinoPluginsRtpDevice* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	self = (DinoPluginsRtpDevice*) base;
	_tmp0_ = dino_plugins_rtp_device_get_is_sink (self);
	_tmp1_ = _tmp0_;
	result = _tmp1_;
	return result;
}

GstPipeline*
dino_plugins_rtp_device_get_pipe (DinoPluginsRtpDevice* self)
{
	GstPipeline* result;
	DinoPluginsRtpPlugin* _tmp0_;
	GstPipeline* _tmp1_;
	GstPipeline* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_plugin;
	_tmp1_ = dino_plugins_rtp_plugin_get_pipe (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

gboolean
dino_plugins_rtp_device_get_is_source (DinoPluginsRtpDevice* self)
{
	gboolean result;
	GstDevice* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_device;
	result = gst_device_has_classes (_tmp0_, "Source");
	return result;
}

gboolean
dino_plugins_rtp_device_get_is_sink (DinoPluginsRtpDevice* self)
{
	gboolean result;
	GstDevice* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_device;
	result = gst_device_has_classes (_tmp0_, "Sink");
	return result;
}

gboolean
dino_plugins_rtp_device_get_is_monitor (DinoPluginsRtpDevice* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GstDevice* _tmp2_;
	GstStructure* _tmp3_;
	GstStructure* _tmp4_;
	GstStructure* _tmp5_;
	gboolean _tmp6_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp2_ = self->priv->_device;
	_tmp3_ = gst_device_get_properties (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_ != NULL;
	_gst_structure_free0 (_tmp5_);
	if (_tmp6_) {
		GstDevice* _tmp7_;
		GstStructure* _tmp8_;
		GstStructure* _tmp9_;
		GstStructure* _tmp10_;
		const gchar* _tmp11_;
		_tmp7_ = self->priv->_device;
		_tmp8_ = gst_device_get_properties (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		_tmp11_ = gst_structure_get_string (_tmp10_, "device.class");
		_tmp1_ = g_strcmp0 (_tmp11_, "monitor") == 0;
		_gst_structure_free0 (_tmp10_);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp12_ = FALSE;
		DinoPluginsRtpDeviceProtocol _tmp13_;
		DinoPluginsRtpDeviceProtocol _tmp14_;
		_tmp13_ = dino_plugins_rtp_device_get_protocol (self);
		_tmp14_ = _tmp13_;
		if (_tmp14_ == DINO_PLUGINS_RTP_DEVICE_PROTOCOL_PIPEWIRE) {
			GstDevice* _tmp15_;
			_tmp15_ = self->priv->_device;
			_tmp12_ = gst_device_has_classes (_tmp15_, "Stream");
		} else {
			_tmp12_ = FALSE;
		}
		_tmp0_ = _tmp12_;
	}
	result = _tmp0_;
	return result;
}

gboolean
dino_plugins_rtp_device_get_is_default (DinoPluginsRtpDevice* self)
{
	gboolean result;
	GstDevice* _tmp0_;
	GstStructure* _tmp1_;
	GstStructure* _tmp2_;
	GstStructure* _tmp3_;
	gboolean _tmp4_;
	gboolean ret = FALSE;
	GstDevice* _tmp5_;
	GstStructure* _tmp6_;
	GstStructure* _tmp7_;
	GstStructure* _tmp8_;
	gboolean _tmp9_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_device;
	_tmp1_ = gst_device_get_properties (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_ == NULL;
	_gst_structure_free0 (_tmp3_);
	if (_tmp4_) {
		result = FALSE;
		return result;
	}
	_tmp5_ = self->priv->_device;
	_tmp6_ = gst_device_get_properties (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_;
	gst_structure_get_boolean (_tmp8_, "is-default", &_tmp9_);
	ret = _tmp9_;
	_gst_structure_free0 (_tmp8_);
	result = ret;
	return result;
}

DinoPluginsRtpDeviceProtocol
dino_plugins_rtp_device_get_protocol (DinoPluginsRtpDevice* self)
{
	DinoPluginsRtpDeviceProtocol result;
	GstDevice* _tmp0_;
	GstStructure* _tmp1_;
	GstStructure* _tmp2_;
	GstStructure* _tmp3_;
	gboolean _tmp4_;
	GstDevice* _tmp5_;
	GstStructure* _tmp6_;
	GstStructure* _tmp7_;
	GstStructure* _tmp8_;
	gboolean _tmp9_;
	GstDevice* _tmp10_;
	GstStructure* _tmp11_;
	GstStructure* _tmp12_;
	GstStructure* _tmp13_;
	gboolean _tmp14_;
	GstDevice* _tmp15_;
	GstStructure* _tmp16_;
	GstStructure* _tmp17_;
	GstStructure* _tmp18_;
	gboolean _tmp19_;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = self->priv->_device;
	_tmp1_ = gst_device_get_properties (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_ == NULL;
	_gst_structure_free0 (_tmp3_);
	if (_tmp4_) {
		result = DINO_PLUGINS_RTP_DEVICE_PROTOCOL_OTHER;
		return result;
	}
	_tmp5_ = self->priv->_device;
	_tmp6_ = gst_device_get_properties (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp9_ = gst_structure_has_name (_tmp8_, "pulse-proplist");
	_gst_structure_free0 (_tmp8_);
	if (_tmp9_) {
		result = DINO_PLUGINS_RTP_DEVICE_PROTOCOL_PULSEAUDIO;
		return result;
	}
	_tmp10_ = self->priv->_device;
	_tmp11_ = gst_device_get_properties (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = _tmp12_;
	_tmp14_ = gst_structure_has_name (_tmp13_, "pipewire-proplist");
	_gst_structure_free0 (_tmp13_);
	if (_tmp14_) {
		result = DINO_PLUGINS_RTP_DEVICE_PROTOCOL_PIPEWIRE;
		return result;
	}
	_tmp15_ = self->priv->_device;
	_tmp16_ = gst_device_get_properties (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = _tmp17_;
	_tmp19_ = gst_structure_has_name (_tmp18_, "v4l2deviceprovider");
	_gst_structure_free0 (_tmp18_);
	if (_tmp19_) {
		result = DINO_PLUGINS_RTP_DEVICE_PROTOCOL_V4L2;
		return result;
	}
	result = DINO_PLUGINS_RTP_DEVICE_PROTOCOL_OTHER;
	return result;
}

static DinoPluginsRtpDeviceCodecBitrate*
dino_plugins_rtp_device_codec_bitrate_construct (GType object_type,
                                                 guint bitrate)
{
	DinoPluginsRtpDeviceCodecBitrate* self = NULL;
	self = (DinoPluginsRtpDeviceCodecBitrate*) g_type_create_instance (object_type);
	self->bitrate = bitrate;
	self->timestamp = g_get_monotonic_time ();
	return self;
}

static DinoPluginsRtpDeviceCodecBitrate*
dino_plugins_rtp_device_codec_bitrate_new (guint bitrate)
{
	return dino_plugins_rtp_device_codec_bitrate_construct (DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE, bitrate);
}

static void
dino_plugins_rtp_device_value_codec_bitrate_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
dino_plugins_rtp_device_value_codec_bitrate_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		dino_plugins_rtp_device_codec_bitrate_unref (value->data[0].v_pointer);
	}
}

static void
dino_plugins_rtp_device_value_codec_bitrate_copy_value (const GValue* src_value,
                                                        GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = dino_plugins_rtp_device_codec_bitrate_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
dino_plugins_rtp_device_value_codec_bitrate_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
dino_plugins_rtp_device_value_codec_bitrate_collect_value (GValue* value,
                                                           guint n_collect_values,
                                                           GTypeCValue* collect_values,
                                                           guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		DinoPluginsRtpDeviceCodecBitrate * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = dino_plugins_rtp_device_codec_bitrate_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
dino_plugins_rtp_device_value_codec_bitrate_lcopy_value (const GValue* value,
                                                         guint n_collect_values,
                                                         GTypeCValue* collect_values,
                                                         guint collect_flags)
{
	DinoPluginsRtpDeviceCodecBitrate ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = dino_plugins_rtp_device_codec_bitrate_ref (value->data[0].v_pointer);
	}
	return NULL;
}

static GParamSpec*
dino_plugins_rtp_device_param_spec_codec_bitrate (const gchar* name,
                                                  const gchar* nick,
                                                  const gchar* blurb,
                                                  GType object_type,
                                                  GParamFlags flags)
{
	DinoPluginsRtpDeviceParamSpecCodecBitrate* spec;
	g_return_val_if_fail (g_type_is_a (object_type, DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

static gpointer
dino_plugins_rtp_device_value_get_codec_bitrate (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE), NULL);
	return value->data[0].v_pointer;
}

static void
dino_plugins_rtp_device_value_set_codec_bitrate (GValue* value,
                                                 gpointer v_object)
{
	DinoPluginsRtpDeviceCodecBitrate * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		dino_plugins_rtp_device_codec_bitrate_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_plugins_rtp_device_codec_bitrate_unref (old);
	}
}

static void
dino_plugins_rtp_device_value_take_codec_bitrate (GValue* value,
                                                  gpointer v_object)
{
	DinoPluginsRtpDeviceCodecBitrate * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_plugins_rtp_device_codec_bitrate_unref (old);
	}
}

static void
dino_plugins_rtp_device_codec_bitrate_class_init (DinoPluginsRtpDeviceCodecBitrateClass * klass,
                                                  gpointer klass_data)
{
	dino_plugins_rtp_device_codec_bitrate_parent_class = g_type_class_peek_parent (klass);
	((DinoPluginsRtpDeviceCodecBitrateClass *) klass)->finalize = dino_plugins_rtp_device_codec_bitrate_finalize;
}

static void
dino_plugins_rtp_device_codec_bitrate_instance_init (DinoPluginsRtpDeviceCodecBitrate * self,
                                                     gpointer klass)
{
	self->ref_count = 1;
}

static void
dino_plugins_rtp_device_codec_bitrate_finalize (DinoPluginsRtpDeviceCodecBitrate * obj)
{
	DinoPluginsRtpDeviceCodecBitrate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_RTP_DEVICE_TYPE_CODEC_BITRATE, DinoPluginsRtpDeviceCodecBitrate);
	g_signal_handlers_destroy (self);
}

static GType
dino_plugins_rtp_device_codec_bitrate_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { dino_plugins_rtp_device_value_codec_bitrate_init, dino_plugins_rtp_device_value_codec_bitrate_free_value, dino_plugins_rtp_device_value_codec_bitrate_copy_value, dino_plugins_rtp_device_value_codec_bitrate_peek_pointer, "p", dino_plugins_rtp_device_value_codec_bitrate_collect_value, "p", dino_plugins_rtp_device_value_codec_bitrate_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsRtpDeviceCodecBitrateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_rtp_device_codec_bitrate_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsRtpDeviceCodecBitrate), 0, (GInstanceInitFunc) dino_plugins_rtp_device_codec_bitrate_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType dino_plugins_rtp_device_codec_bitrate_type_id;
	dino_plugins_rtp_device_codec_bitrate_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DinoPluginsRtpDeviceCodecBitrate", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return dino_plugins_rtp_device_codec_bitrate_type_id;
}

static GType
dino_plugins_rtp_device_codec_bitrate_get_type (void)
{
	static volatile gsize dino_plugins_rtp_device_codec_bitrate_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_rtp_device_codec_bitrate_type_id__once)) {
		GType dino_plugins_rtp_device_codec_bitrate_type_id;
		dino_plugins_rtp_device_codec_bitrate_type_id = dino_plugins_rtp_device_codec_bitrate_get_type_once ();
		g_once_init_leave (&dino_plugins_rtp_device_codec_bitrate_type_id__once, dino_plugins_rtp_device_codec_bitrate_type_id);
	}
	return dino_plugins_rtp_device_codec_bitrate_type_id__once;
}

static gpointer
dino_plugins_rtp_device_codec_bitrate_ref (gpointer instance)
{
	DinoPluginsRtpDeviceCodecBitrate * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

static void
dino_plugins_rtp_device_codec_bitrate_unref (gpointer instance)
{
	DinoPluginsRtpDeviceCodecBitrate * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		DINO_PLUGINS_RTP_DEVICE_CODEC_BITRATE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
dino_plugins_rtp_device_class_init (DinoPluginsRtpDeviceClass * klass,
                                    gpointer klass_data)
{
	dino_plugins_rtp_device_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsRtpDevice_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_plugins_rtp_device_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_plugins_rtp_device_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_rtp_device_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_PLUGIN_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_PLUGIN_PROPERTY] = g_param_spec_object ("plugin", "plugin", "plugin", DINO_PLUGINS_RTP_TYPE_PLUGIN, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_CODEC_UTIL_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_CODEC_UTIL_PROPERTY] = dino_plugins_rtp_param_spec_codec_util ("codec-util", "codec-util", "codec-util", DINO_PLUGINS_RTP_TYPE_CODEC_UTIL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_DEVICE_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_DEVICE_PROPERTY] = g_param_spec_object ("device", "device", "device", gst_device_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_ID_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_DISPLAY_NAME_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_DETAIL_NAME_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_DETAIL_NAME_PROPERTY] = g_param_spec_string ("detail-name", "detail-name", "detail-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_MEDIA_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_MEDIA_PROPERTY] = g_param_spec_string ("media", "media", "media", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_INCOMING_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_INCOMING_PROPERTY] = g_param_spec_boolean ("incoming", "incoming", "incoming", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_PIPE_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_PIPE_PROPERTY] = g_param_spec_object ("pipe", "pipe", "pipe", gst_pipeline_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_IS_SOURCE_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_IS_SOURCE_PROPERTY] = g_param_spec_boolean ("is-source", "is-source", "is-source", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_IS_SINK_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_IS_SINK_PROPERTY] = g_param_spec_boolean ("is-sink", "is-sink", "is-sink", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_IS_MONITOR_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_IS_MONITOR_PROPERTY] = g_param_spec_boolean ("is-monitor", "is-monitor", "is-monitor", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_IS_DEFAULT_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_IS_DEFAULT_PROPERTY] = g_param_spec_boolean ("is-default", "is-default", "is-default", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_DEVICE_PROTOCOL_PROPERTY, dino_plugins_rtp_device_properties[DINO_PLUGINS_RTP_DEVICE_PROTOCOL_PROPERTY] = g_param_spec_enum ("protocol", "protocol", "protocol", DINO_PLUGINS_RTP_TYPE_DEVICE_PROTOCOL, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
dino_plugins_rtp_device_dino_plugins_media_device_interface_init (DinoPluginsMediaDeviceIface * iface,
                                                                  gpointer iface_data)
{
	dino_plugins_rtp_device_dino_plugins_media_device_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_id = dino_plugins_rtp_device_real_get_id;
	iface->get_display_name = dino_plugins_rtp_device_real_get_display_name;
	iface->get_detail_name = dino_plugins_rtp_device_real_get_detail_name;
	iface->get_media = dino_plugins_rtp_device_real_get_media;
	iface->get_incoming = dino_plugins_rtp_device_real_get_incoming;
}

static void
dino_plugins_rtp_device_instance_init (DinoPluginsRtpDevice * self,
                                       gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* _tmp3_;
	GeeHashMap* _tmp4_;
	GeeHashMap* _tmp5_;
	self->priv = dino_plugins_rtp_device_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (XMPP_XEP_JINGLE_RTP_TYPE_PAYLOAD_TYPE, (GBoxedCopyFunc) xmpp_xep_jingle_rtp_payload_type_ref, (GDestroyNotify) xmpp_xep_jingle_rtp_payload_type_unref, gst_element_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_xep_jingle_rtp_payload_type_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_xep_jingle_rtp_payload_type_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->codecs = (GeeMap*) _tmp0_;
	_tmp1_ = gee_hash_map_new (XMPP_XEP_JINGLE_RTP_TYPE_PAYLOAD_TYPE, (GBoxedCopyFunc) xmpp_xep_jingle_rtp_payload_type_ref, (GDestroyNotify) xmpp_xep_jingle_rtp_payload_type_unref, gst_element_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_xep_jingle_rtp_payload_type_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_xep_jingle_rtp_payload_type_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->codec_tees = (GeeMap*) _tmp1_;
	_tmp2_ = gee_hash_map_new (XMPP_XEP_JINGLE_RTP_TYPE_PAYLOAD_TYPE, (GBoxedCopyFunc) xmpp_xep_jingle_rtp_payload_type_ref, (GDestroyNotify) xmpp_xep_jingle_rtp_payload_type_unref, GEE_TYPE_MAP, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_xep_jingle_rtp_payload_type_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_xep_jingle_rtp_payload_type_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->payloaders = (GeeMap*) _tmp2_;
	_tmp3_ = gee_hash_map_new (XMPP_XEP_JINGLE_RTP_TYPE_PAYLOAD_TYPE, (GBoxedCopyFunc) xmpp_xep_jingle_rtp_payload_type_ref, (GDestroyNotify) xmpp_xep_jingle_rtp_payload_type_unref, GEE_TYPE_MAP, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_xep_jingle_rtp_payload_type_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_xep_jingle_rtp_payload_type_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->payloader_tees = (GeeMap*) _tmp3_;
	_tmp4_ = gee_hash_map_new (XMPP_XEP_JINGLE_RTP_TYPE_PAYLOAD_TYPE, (GBoxedCopyFunc) xmpp_xep_jingle_rtp_payload_type_ref, (GDestroyNotify) xmpp_xep_jingle_rtp_payload_type_unref, GEE_TYPE_MAP, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_xep_jingle_rtp_payload_type_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_xep_jingle_rtp_payload_type_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->payloader_links = (GeeMap*) _tmp4_;
	g_rec_mutex_init (&self->priv->__lock_codec_bitrates);
	_tmp5_ = gee_hash_map_new (XMPP_XEP_JINGLE_RTP_TYPE_PAYLOAD_TYPE, (GBoxedCopyFunc) xmpp_xep_jingle_rtp_payload_type_ref, (GDestroyNotify) xmpp_xep_jingle_rtp_payload_type_unref, GEE_TYPE_LIST, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _xmpp_xep_jingle_rtp_payload_type_hash_func_gee_hash_data_func, NULL, NULL, _xmpp_xep_jingle_rtp_payload_type_equals_func_gee_equal_data_func, NULL, NULL, NULL, NULL, NULL);
	self->priv->codec_bitrates = (GeeMap*) _tmp5_;
}

static void
dino_plugins_rtp_device_finalize (GObject * obj)
{
	DinoPluginsRtpDevice * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_RTP_TYPE_DEVICE, DinoPluginsRtpDevice);
	_g_object_unref0 (self->priv->_plugin);
	_g_object_unref0 (self->priv->_device);
	_g_free0 (self->priv->device_name);
	_g_free0 (self->priv->device_display_name);
	_gst_caps_unref0 (self->priv->device_caps);
	_g_object_unref0 (self->priv->element);
	_g_object_unref0 (self->priv->tee);
	_g_object_unref0 (self->priv->dsp);
	_g_object_unref0 (self->priv->mixer);
	_g_object_unref0 (self->priv->filter);
	_g_object_unref0 (self->priv->codecs);
	_g_object_unref0 (self->priv->codec_tees);
	_g_object_unref0 (self->priv->payloaders);
	_g_object_unref0 (self->priv->payloader_tees);
	_g_object_unref0 (self->priv->payloader_links);
	g_rec_mutex_clear (&self->priv->__lock_codec_bitrates);
	_g_object_unref0 (self->priv->codec_bitrates);
	G_OBJECT_CLASS (dino_plugins_rtp_device_parent_class)->finalize (obj);
}

static GType
dino_plugins_rtp_device_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsRtpDeviceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_rtp_device_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsRtpDevice), 0, (GInstanceInitFunc) dino_plugins_rtp_device_instance_init, NULL };
	static const GInterfaceInfo dino_plugins_media_device_info = { (GInterfaceInitFunc) dino_plugins_rtp_device_dino_plugins_media_device_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType dino_plugins_rtp_device_type_id;
	dino_plugins_rtp_device_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoPluginsRtpDevice", &g_define_type_info, 0);
	g_type_add_interface_static (dino_plugins_rtp_device_type_id, DINO_PLUGINS_TYPE_MEDIA_DEVICE, &dino_plugins_media_device_info);
	DinoPluginsRtpDevice_private_offset = g_type_add_instance_private (dino_plugins_rtp_device_type_id, sizeof (DinoPluginsRtpDevicePrivate));
	return dino_plugins_rtp_device_type_id;
}

GType
dino_plugins_rtp_device_get_type (void)
{
	static volatile gsize dino_plugins_rtp_device_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_rtp_device_type_id__once)) {
		GType dino_plugins_rtp_device_type_id;
		dino_plugins_rtp_device_type_id = dino_plugins_rtp_device_get_type_once ();
		g_once_init_leave (&dino_plugins_rtp_device_type_id__once, dino_plugins_rtp_device_type_id);
	}
	return dino_plugins_rtp_device_type_id__once;
}

static void
_vala_dino_plugins_rtp_device_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	DinoPluginsRtpDevice * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_PLUGINS_RTP_TYPE_DEVICE, DinoPluginsRtpDevice);
	switch (property_id) {
		case DINO_PLUGINS_RTP_DEVICE_PLUGIN_PROPERTY:
		g_value_set_object (value, dino_plugins_rtp_device_get_plugin (self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_CODEC_UTIL_PROPERTY:
		dino_plugins_rtp_value_set_codec_util (value, dino_plugins_rtp_device_get_codec_util (self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_DEVICE_PROPERTY:
		g_value_set_object (value, dino_plugins_rtp_device_get_device (self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_ID_PROPERTY:
		g_value_take_string (value, dino_plugins_media_device_get_id ((DinoPluginsMediaDevice*) self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_DISPLAY_NAME_PROPERTY:
		g_value_take_string (value, dino_plugins_media_device_get_display_name ((DinoPluginsMediaDevice*) self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_DETAIL_NAME_PROPERTY:
		g_value_take_string (value, dino_plugins_media_device_get_detail_name ((DinoPluginsMediaDevice*) self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_MEDIA_PROPERTY:
		g_value_take_string (value, dino_plugins_media_device_get_media ((DinoPluginsMediaDevice*) self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_INCOMING_PROPERTY:
		g_value_set_boolean (value, dino_plugins_media_device_get_incoming ((DinoPluginsMediaDevice*) self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_PIPE_PROPERTY:
		g_value_set_object (value, dino_plugins_rtp_device_get_pipe (self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_IS_SOURCE_PROPERTY:
		g_value_set_boolean (value, dino_plugins_rtp_device_get_is_source (self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_IS_SINK_PROPERTY:
		g_value_set_boolean (value, dino_plugins_rtp_device_get_is_sink (self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_IS_MONITOR_PROPERTY:
		g_value_set_boolean (value, dino_plugins_rtp_device_get_is_monitor (self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_IS_DEFAULT_PROPERTY:
		g_value_set_boolean (value, dino_plugins_rtp_device_get_is_default (self));
		break;
		case DINO_PLUGINS_RTP_DEVICE_PROTOCOL_PROPERTY:
		g_value_set_enum (value, dino_plugins_rtp_device_get_protocol (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_plugins_rtp_device_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	DinoPluginsRtpDevice * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_PLUGINS_RTP_TYPE_DEVICE, DinoPluginsRtpDevice);
	switch (property_id) {
		case DINO_PLUGINS_RTP_DEVICE_PLUGIN_PROPERTY:
		dino_plugins_rtp_device_set_plugin (self, g_value_get_object (value));
		break;
		case DINO_PLUGINS_RTP_DEVICE_DEVICE_PROPERTY:
		dino_plugins_rtp_device_set_device (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

