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

#include "rtp.h"
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "xmpp-vala.h"
#include <gst/gst.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 _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _xmpp_xep_jingle_rtp_rtcp_feedback_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_jingle_rtp_rtcp_feedback_unref (var), NULL)))
#define _gst_caps_unref0(var) ((var == NULL) ? NULL : (var = (gst_caps_unref (var), NULL)))
typedef struct _DinoPluginsRtpParamSpecCodecUtil DinoPluginsRtpParamSpecCodecUtil;

struct _DinoPluginsRtpCodecUtilPrivate {
	GeeSet* supported_elements;
	GeeSet* unsupported_elements;
};

struct _DinoPluginsRtpParamSpecCodecUtil {
	GParamSpec parent_instance;
};

static gint DinoPluginsRtpCodecUtil_private_offset;
static gpointer dino_plugins_rtp_codec_util_parent_class = NULL;

static void dino_plugins_rtp_codec_util_finalize (DinoPluginsRtpCodecUtil * obj);
static GType dino_plugins_rtp_codec_util_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
dino_plugins_rtp_codec_util_get_instance_private (DinoPluginsRtpCodecUtil* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsRtpCodecUtil_private_offset);
}

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

GstCaps*
dino_plugins_rtp_codec_util_get_caps (const gchar* media,
                                      XmppXepJingleRtpPayloadType* payload_type,
                                      gboolean incoming)
{
	GstCaps* caps = NULL;
	guint8 _tmp0_;
	guint8 _tmp1_;
	GstCaps* _tmp2_;
	GstStructure* s = NULL;
	GstCaps* _tmp3_;
	GstStructure* _tmp4_;
	guint32 _tmp5_;
	guint32 _tmp6_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	GstCaps* result;
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (payload_type != NULL, NULL);
	_tmp0_ = xmpp_xep_jingle_rtp_payload_type_get_id (payload_type);
	_tmp1_ = _tmp0_;
	_tmp2_ = gst_caps_new_simple ("application/x-rtp", "media", G_TYPE_STRING, media, "payload", G_TYPE_INT, _tmp1_, NULL);
	caps = _tmp2_;
	_tmp3_ = caps;
	_tmp4_ = gst_caps_get_structure (_tmp3_, (guint) 0);
	s = _tmp4_;
	_tmp5_ = xmpp_xep_jingle_rtp_payload_type_get_clockrate (payload_type);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != ((guint32) 0)) {
		GstStructure* _tmp7_;
		guint32 _tmp8_;
		guint32 _tmp9_;
		_tmp7_ = s;
		_tmp8_ = xmpp_xep_jingle_rtp_payload_type_get_clockrate (payload_type);
		_tmp9_ = _tmp8_;
		gst_structure_set (_tmp7_, "clock-rate", G_TYPE_INT, _tmp9_, NULL);
	}
	_tmp10_ = xmpp_xep_jingle_rtp_payload_type_get_name (payload_type);
	_tmp11_ = _tmp10_;
	if (_tmp11_ != NULL) {
		GstStructure* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		_tmp12_ = s;
		_tmp13_ = xmpp_xep_jingle_rtp_payload_type_get_name (payload_type);
		_tmp14_ = _tmp13_;
		_tmp15_ = g_utf8_strup (_tmp14_, (gssize) -1);
		_tmp16_ = _tmp15_;
		gst_structure_set (_tmp12_, "encoding-name", G_TYPE_STRING, _tmp16_, NULL);
		_g_free0 (_tmp16_);
	}
	if (incoming) {
		{
			GeeList* _rtcp_fb_list = NULL;
			GeeList* _tmp17_;
			gint _rtcp_fb_size = 0;
			GeeList* _tmp18_;
			gint _tmp19_;
			gint _tmp20_;
			gint _rtcp_fb_index = 0;
			_tmp17_ = payload_type->rtcp_fbs;
			_rtcp_fb_list = _tmp17_;
			_tmp18_ = _rtcp_fb_list;
			_tmp19_ = gee_collection_get_size ((GeeCollection*) _tmp18_);
			_tmp20_ = _tmp19_;
			_rtcp_fb_size = _tmp20_;
			_rtcp_fb_index = -1;
			while (TRUE) {
				gint _tmp21_;
				gint _tmp22_;
				XmppXepJingleRtpRtcpFeedback* rtcp_fb = NULL;
				GeeList* _tmp23_;
				gpointer _tmp24_;
				XmppXepJingleRtpRtcpFeedback* _tmp25_;
				const gchar* _tmp26_;
				const gchar* _tmp27_;
				_rtcp_fb_index = _rtcp_fb_index + 1;
				_tmp21_ = _rtcp_fb_index;
				_tmp22_ = _rtcp_fb_size;
				if (!(_tmp21_ < _tmp22_)) {
					break;
				}
				_tmp23_ = _rtcp_fb_list;
				_tmp24_ = gee_list_get (_tmp23_, _rtcp_fb_index);
				rtcp_fb = (XmppXepJingleRtpRtcpFeedback*) _tmp24_;
				_tmp25_ = rtcp_fb;
				_tmp26_ = xmpp_xep_jingle_rtp_rtcp_feedback_get_subtype (_tmp25_);
				_tmp27_ = _tmp26_;
				if (_tmp27_ == NULL) {
					GstStructure* _tmp28_;
					XmppXepJingleRtpRtcpFeedback* _tmp29_;
					const gchar* _tmp30_;
					const gchar* _tmp31_;
					const gchar* _tmp32_;
					gchar* _tmp33_;
					gchar* _tmp34_;
					_tmp28_ = s;
					_tmp29_ = rtcp_fb;
					_tmp30_ = xmpp_xep_jingle_rtp_rtcp_feedback_get_type_ (_tmp29_);
					_tmp31_ = _tmp30_;
					_tmp32_ = string_to_string (_tmp31_);
					_tmp33_ = g_strconcat ("rtcp-fb-", _tmp32_, NULL);
					_tmp34_ = _tmp33_;
					gst_structure_set (_tmp28_, _tmp34_, G_TYPE_BOOLEAN, TRUE, NULL);
					_g_free0 (_tmp34_);
				} else {
					GstStructure* _tmp35_;
					XmppXepJingleRtpRtcpFeedback* _tmp36_;
					const gchar* _tmp37_;
					const gchar* _tmp38_;
					const gchar* _tmp39_;
					XmppXepJingleRtpRtcpFeedback* _tmp40_;
					const gchar* _tmp41_;
					const gchar* _tmp42_;
					const gchar* _tmp43_;
					gchar* _tmp44_;
					gchar* _tmp45_;
					_tmp35_ = s;
					_tmp36_ = rtcp_fb;
					_tmp37_ = xmpp_xep_jingle_rtp_rtcp_feedback_get_type_ (_tmp36_);
					_tmp38_ = _tmp37_;
					_tmp39_ = string_to_string (_tmp38_);
					_tmp40_ = rtcp_fb;
					_tmp41_ = xmpp_xep_jingle_rtp_rtcp_feedback_get_subtype (_tmp40_);
					_tmp42_ = _tmp41_;
					_tmp43_ = string_to_string (_tmp42_);
					_tmp44_ = g_strconcat ("rtcp-fb-", _tmp39_, "-", _tmp43_, NULL);
					_tmp45_ = _tmp44_;
					gst_structure_set (_tmp35_, _tmp45_, G_TYPE_BOOLEAN, TRUE, NULL);
					_g_free0 (_tmp45_);
				}
				_xmpp_xep_jingle_rtp_rtcp_feedback_unref0 (rtcp_fb);
			}
		}
	}
	result = caps;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_codec_from_payload (const gchar* media,
                                                    XmppXepJingleRtpPayloadType* payload_type)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (payload_type != NULL, NULL);
	_tmp0_ = xmpp_xep_jingle_rtp_payload_type_get_name (payload_type);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp2_ = xmpp_xep_jingle_rtp_payload_type_get_name (payload_type);
		_tmp3_ = _tmp2_;
		_tmp4_ = g_utf8_strdown (_tmp3_, (gssize) -1);
		result = _tmp4_;
		return result;
	}
	if (g_strcmp0 (media, "audio") == 0) {
		guint8 _tmp5_;
		guint8 _tmp6_;
		_tmp5_ = xmpp_xep_jingle_rtp_payload_type_get_id (payload_type);
		_tmp6_ = _tmp5_;
		switch (_tmp6_) {
			case 0:
			{
				gchar* _tmp7_;
				_tmp7_ = g_strdup ("pcmu");
				result = _tmp7_;
				return result;
			}
			case 8:
			{
				gchar* _tmp8_;
				_tmp8_ = g_strdup ("pcma");
				result = _tmp8_;
				return result;
			}
			default:
			break;
		}
	}
	result = NULL;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_media_type_from_payload (const gchar* media,
                                                         XmppXepJingleRtpPayloadType* payload_type)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (payload_type != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_codec_util_get_codec_from_payload (media, payload_type);
	_tmp1_ = _tmp0_;
	_tmp2_ = dino_plugins_rtp_codec_util_get_media_type (media, _tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_media_type (const gchar* media,
                                            const gchar* codec)
{
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	if (codec == NULL) {
		result = NULL;
		return result;
	}
	if (g_strcmp0 (media, "audio") == 0) {
		const gchar* _tmp0_;
		GQuark _tmp2_ = 0U;
		static GQuark _tmp1_label0 = 0;
		static GQuark _tmp1_label1 = 0;
		_tmp0_ = codec;
		_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
		if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("pcma")))) {
			switch (0) {
				default:
				{
					gchar* _tmp3_;
					_tmp3_ = g_strdup ("audio/x-alaw");
					result = _tmp3_;
					return result;
				}
			}
		} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("pcmu")))) {
			switch (0) {
				default:
				{
					gchar* _tmp4_;
					_tmp4_ = g_strdup ("audio/x-mulaw");
					result = _tmp4_;
					return result;
				}
			}
		}
	}
	_tmp5_ = string_to_string (media);
	_tmp6_ = string_to_string (codec);
	_tmp7_ = g_strconcat (_tmp5_, "/x-", _tmp6_, NULL);
	result = _tmp7_;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_rtp_pay_element_name_from_payload (const gchar* media,
                                                                   XmppXepJingleRtpPayloadType* payload_type)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (payload_type != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_codec_util_get_codec_from_payload (media, payload_type);
	_tmp1_ = _tmp0_;
	_tmp2_ = dino_plugins_rtp_codec_util_get_pay_candidate (media, _tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_pay_candidate (const gchar* media,
                                               const gchar* codec)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	if (codec == NULL) {
		result = NULL;
		return result;
	}
	_tmp0_ = string_to_string (codec);
	_tmp1_ = g_strconcat ("rtp", _tmp0_, "pay", NULL);
	result = _tmp1_;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_rtp_depay_element_name_from_payload (const gchar* media,
                                                                     XmppXepJingleRtpPayloadType* payload_type)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (payload_type != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_codec_util_get_codec_from_payload (media, payload_type);
	_tmp1_ = _tmp0_;
	_tmp2_ = dino_plugins_rtp_codec_util_get_depay_candidate (media, _tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_depay_candidate (const gchar* media,
                                                 const gchar* codec)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	if (codec == NULL) {
		result = NULL;
		return result;
	}
	_tmp0_ = string_to_string (codec);
	_tmp1_ = g_strconcat ("rtp", _tmp0_, "depay", NULL);
	result = _tmp1_;
	return result;
}

gchar**
dino_plugins_rtp_codec_util_get_encode_candidates (const gchar* media,
                                                   const gchar* codec,
                                                   gint* result_length1)
{
	gchar** _tmp32_;
	gchar** _tmp33_;
	gint _tmp33__length1;
	gchar** result;
	g_return_val_if_fail (media != NULL, NULL);
	if (codec == NULL) {
		gchar** _tmp0_;
		gchar** _tmp1_;
		gint _tmp1__length1;
		_tmp0_ = g_new0 (gchar*, 0 + 1);
		_tmp1_ = _tmp0_;
		_tmp1__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp1__length1;
		}
		result = _tmp1_;
		return result;
	}
	if (g_strcmp0 (media, "audio") == 0) {
		const gchar* _tmp2_;
		GQuark _tmp4_ = 0U;
		static GQuark _tmp3_label0 = 0;
		static GQuark _tmp3_label1 = 0;
		static GQuark _tmp3_label2 = 0;
		static GQuark _tmp3_label3 = 0;
		static GQuark _tmp3_label4 = 0;
		_tmp2_ = codec;
		_tmp4_ = (NULL == _tmp2_) ? 0 : g_quark_from_string (_tmp2_);
		if (_tmp4_ == ((0 != _tmp3_label0) ? _tmp3_label0 : (_tmp3_label0 = g_quark_from_static_string ("opus")))) {
			switch (0) {
				default:
				{
					gchar* _tmp5_;
					gchar** _tmp6_;
					gchar** _tmp7_;
					gint _tmp7__length1;
					_tmp5_ = g_strdup ("opusenc");
					_tmp6_ = g_new0 (gchar*, 1 + 1);
					_tmp6_[0] = _tmp5_;
					_tmp7_ = _tmp6_;
					_tmp7__length1 = 1;
					if (result_length1) {
						*result_length1 = _tmp7__length1;
					}
					result = _tmp7_;
					return result;
				}
			}
		} else if (_tmp4_ == ((0 != _tmp3_label1) ? _tmp3_label1 : (_tmp3_label1 = g_quark_from_static_string ("speex")))) {
			switch (0) {
				default:
				{
					gchar* _tmp8_;
					gchar** _tmp9_;
					gchar** _tmp10_;
					gint _tmp10__length1;
					_tmp8_ = g_strdup ("speexenc");
					_tmp9_ = g_new0 (gchar*, 1 + 1);
					_tmp9_[0] = _tmp8_;
					_tmp10_ = _tmp9_;
					_tmp10__length1 = 1;
					if (result_length1) {
						*result_length1 = _tmp10__length1;
					}
					result = _tmp10_;
					return result;
				}
			}
		} else if (_tmp4_ == ((0 != _tmp3_label2) ? _tmp3_label2 : (_tmp3_label2 = g_quark_from_static_string ("pcma")))) {
			switch (0) {
				default:
				{
					gchar* _tmp11_;
					gchar** _tmp12_;
					gchar** _tmp13_;
					gint _tmp13__length1;
					_tmp11_ = g_strdup ("alawenc");
					_tmp12_ = g_new0 (gchar*, 1 + 1);
					_tmp12_[0] = _tmp11_;
					_tmp13_ = _tmp12_;
					_tmp13__length1 = 1;
					if (result_length1) {
						*result_length1 = _tmp13__length1;
					}
					result = _tmp13_;
					return result;
				}
			}
		} else if (_tmp4_ == ((0 != _tmp3_label3) ? _tmp3_label3 : (_tmp3_label3 = g_quark_from_static_string ("pcmu")))) {
			switch (0) {
				default:
				{
					gchar* _tmp14_;
					gchar** _tmp15_;
					gchar** _tmp16_;
					gint _tmp16__length1;
					_tmp14_ = g_strdup ("mulawenc");
					_tmp15_ = g_new0 (gchar*, 1 + 1);
					_tmp15_[0] = _tmp14_;
					_tmp16_ = _tmp15_;
					_tmp16__length1 = 1;
					if (result_length1) {
						*result_length1 = _tmp16__length1;
					}
					result = _tmp16_;
					return result;
				}
			}
		} else if (_tmp4_ == ((0 != _tmp3_label4) ? _tmp3_label4 : (_tmp3_label4 = g_quark_from_static_string ("g722")))) {
			switch (0) {
				default:
				{
					gchar* _tmp17_;
					gchar** _tmp18_;
					gchar** _tmp19_;
					gint _tmp19__length1;
					_tmp17_ = g_strdup ("avenc_g722");
					_tmp18_ = g_new0 (gchar*, 1 + 1);
					_tmp18_[0] = _tmp17_;
					_tmp19_ = _tmp18_;
					_tmp19__length1 = 1;
					if (result_length1) {
						*result_length1 = _tmp19__length1;
					}
					result = _tmp19_;
					return result;
				}
			}
		}
	} else {
		if (g_strcmp0 (media, "video") == 0) {
			const gchar* _tmp20_;
			GQuark _tmp22_ = 0U;
			static GQuark _tmp21_label0 = 0;
			static GQuark _tmp21_label1 = 0;
			static GQuark _tmp21_label2 = 0;
			_tmp20_ = codec;
			_tmp22_ = (NULL == _tmp20_) ? 0 : g_quark_from_string (_tmp20_);
			if (_tmp22_ == ((0 != _tmp21_label0) ? _tmp21_label0 : (_tmp21_label0 = g_quark_from_static_string ("h264")))) {
				switch (0) {
					default:
					{
						gchar* _tmp23_;
						gchar** _tmp24_;
						gchar** _tmp25_;
						gint _tmp25__length1;
						_tmp23_ = g_strdup ("x264enc");
						_tmp24_ = g_new0 (gchar*, 1 + 1);
						_tmp24_[0] = _tmp23_;
						_tmp25_ = _tmp24_;
						_tmp25__length1 = 1;
						if (result_length1) {
							*result_length1 = _tmp25__length1;
						}
						result = _tmp25_;
						return result;
					}
				}
			} else if (_tmp22_ == ((0 != _tmp21_label1) ? _tmp21_label1 : (_tmp21_label1 = g_quark_from_static_string ("vp9")))) {
				switch (0) {
					default:
					{
						gchar* _tmp26_;
						gchar** _tmp27_;
						gchar** _tmp28_;
						gint _tmp28__length1;
						_tmp26_ = g_strdup ("vp9enc");
						_tmp27_ = g_new0 (gchar*, 1 + 1);
						_tmp27_[0] = _tmp26_;
						_tmp28_ = _tmp27_;
						_tmp28__length1 = 1;
						if (result_length1) {
							*result_length1 = _tmp28__length1;
						}
						result = _tmp28_;
						return result;
					}
				}
			} else if (_tmp22_ == ((0 != _tmp21_label2) ? _tmp21_label2 : (_tmp21_label2 = g_quark_from_static_string ("vp8")))) {
				switch (0) {
					default:
					{
						gchar* _tmp29_;
						gchar** _tmp30_;
						gchar** _tmp31_;
						gint _tmp31__length1;
						_tmp29_ = g_strdup ("vp8enc");
						_tmp30_ = g_new0 (gchar*, 1 + 1);
						_tmp30_[0] = _tmp29_;
						_tmp31_ = _tmp30_;
						_tmp31__length1 = 1;
						if (result_length1) {
							*result_length1 = _tmp31__length1;
						}
						result = _tmp31_;
						return result;
					}
				}
			}
		}
	}
	_tmp32_ = g_new0 (gchar*, 0 + 1);
	_tmp33_ = _tmp32_;
	_tmp33__length1 = 0;
	if (result_length1) {
		*result_length1 = _tmp33__length1;
	}
	result = _tmp33_;
	return result;
}

gchar**
dino_plugins_rtp_codec_util_get_decode_candidates (const gchar* media,
                                                   const gchar* codec,
                                                   gint* result_length1)
{
	gchar** _tmp31_;
	gchar** _tmp32_;
	gint _tmp32__length1;
	gchar** result;
	g_return_val_if_fail (media != NULL, NULL);
	if (codec == NULL) {
		gchar** _tmp0_;
		gchar** _tmp1_;
		gint _tmp1__length1;
		_tmp0_ = g_new0 (gchar*, 0 + 1);
		_tmp1_ = _tmp0_;
		_tmp1__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp1__length1;
		}
		result = _tmp1_;
		return result;
	}
	if (g_strcmp0 (media, "audio") == 0) {
		const gchar* _tmp2_;
		GQuark _tmp4_ = 0U;
		static GQuark _tmp3_label0 = 0;
		static GQuark _tmp3_label1 = 0;
		static GQuark _tmp3_label2 = 0;
		static GQuark _tmp3_label3 = 0;
		static GQuark _tmp3_label4 = 0;
		_tmp2_ = codec;
		_tmp4_ = (NULL == _tmp2_) ? 0 : g_quark_from_string (_tmp2_);
		if (_tmp4_ == ((0 != _tmp3_label0) ? _tmp3_label0 : (_tmp3_label0 = g_quark_from_static_string ("opus")))) {
			switch (0) {
				default:
				{
					gchar* _tmp5_;
					gchar** _tmp6_;
					gchar** _tmp7_;
					gint _tmp7__length1;
					_tmp5_ = g_strdup ("opusdec");
					_tmp6_ = g_new0 (gchar*, 1 + 1);
					_tmp6_[0] = _tmp5_;
					_tmp7_ = _tmp6_;
					_tmp7__length1 = 1;
					if (result_length1) {
						*result_length1 = _tmp7__length1;
					}
					result = _tmp7_;
					return result;
				}
			}
		} else if (_tmp4_ == ((0 != _tmp3_label1) ? _tmp3_label1 : (_tmp3_label1 = g_quark_from_static_string ("speex")))) {
			switch (0) {
				default:
				{
					gchar* _tmp8_;
					gchar** _tmp9_;
					gchar** _tmp10_;
					gint _tmp10__length1;
					_tmp8_ = g_strdup ("speexdec");
					_tmp9_ = g_new0 (gchar*, 1 + 1);
					_tmp9_[0] = _tmp8_;
					_tmp10_ = _tmp9_;
					_tmp10__length1 = 1;
					if (result_length1) {
						*result_length1 = _tmp10__length1;
					}
					result = _tmp10_;
					return result;
				}
			}
		} else if (_tmp4_ == ((0 != _tmp3_label2) ? _tmp3_label2 : (_tmp3_label2 = g_quark_from_static_string ("pcma")))) {
			switch (0) {
				default:
				{
					gchar* _tmp11_;
					gchar** _tmp12_;
					gchar** _tmp13_;
					gint _tmp13__length1;
					_tmp11_ = g_strdup ("alawdec");
					_tmp12_ = g_new0 (gchar*, 1 + 1);
					_tmp12_[0] = _tmp11_;
					_tmp13_ = _tmp12_;
					_tmp13__length1 = 1;
					if (result_length1) {
						*result_length1 = _tmp13__length1;
					}
					result = _tmp13_;
					return result;
				}
			}
		} else if (_tmp4_ == ((0 != _tmp3_label3) ? _tmp3_label3 : (_tmp3_label3 = g_quark_from_static_string ("pcmu")))) {
			switch (0) {
				default:
				{
					gchar* _tmp14_;
					gchar** _tmp15_;
					gchar** _tmp16_;
					gint _tmp16__length1;
					_tmp14_ = g_strdup ("mulawdec");
					_tmp15_ = g_new0 (gchar*, 1 + 1);
					_tmp15_[0] = _tmp14_;
					_tmp16_ = _tmp15_;
					_tmp16__length1 = 1;
					if (result_length1) {
						*result_length1 = _tmp16__length1;
					}
					result = _tmp16_;
					return result;
				}
			}
		} else if (_tmp4_ == ((0 != _tmp3_label4) ? _tmp3_label4 : (_tmp3_label4 = g_quark_from_static_string ("g722")))) {
			switch (0) {
				default:
				{
					gchar* _tmp17_;
					gchar** _tmp18_;
					gchar** _tmp19_;
					gint _tmp19__length1;
					_tmp17_ = g_strdup ("avdec_g722");
					_tmp18_ = g_new0 (gchar*, 1 + 1);
					_tmp18_[0] = _tmp17_;
					_tmp19_ = _tmp18_;
					_tmp19__length1 = 1;
					if (result_length1) {
						*result_length1 = _tmp19__length1;
					}
					result = _tmp19_;
					return result;
				}
			}
		}
	} else {
		if (g_strcmp0 (media, "video") == 0) {
			const gchar* _tmp20_;
			GQuark _tmp22_ = 0U;
			static GQuark _tmp21_label0 = 0;
			static GQuark _tmp21_label1 = 0;
			static GQuark _tmp21_label2 = 0;
			_tmp20_ = codec;
			_tmp22_ = (NULL == _tmp20_) ? 0 : g_quark_from_string (_tmp20_);
			if (_tmp22_ == ((0 != _tmp21_label0) ? _tmp21_label0 : (_tmp21_label0 = g_quark_from_static_string ("h264")))) {
				switch (0) {
					default:
					{
						gchar** _tmp23_;
						gchar** _tmp24_;
						gint _tmp24__length1;
						_tmp23_ = g_new0 (gchar*, 1 + 1);
						_tmp23_[0] = NULL;
						_tmp24_ = _tmp23_;
						_tmp24__length1 = 1;
						if (result_length1) {
							*result_length1 = _tmp24__length1;
						}
						result = _tmp24_;
						return result;
					}
				}
			} else if (_tmp22_ == ((0 != _tmp21_label1) ? _tmp21_label1 : (_tmp21_label1 = g_quark_from_static_string ("vp9")))) {
				switch (0) {
					default:
					{
						gchar* _tmp25_;
						gchar** _tmp26_;
						gchar** _tmp27_;
						gint _tmp27__length1;
						_tmp25_ = g_strdup ("vp9dec");
						_tmp26_ = g_new0 (gchar*, 1 + 1);
						_tmp26_[0] = _tmp25_;
						_tmp27_ = _tmp26_;
						_tmp27__length1 = 1;
						if (result_length1) {
							*result_length1 = _tmp27__length1;
						}
						result = _tmp27_;
						return result;
					}
				}
			} else if (_tmp22_ == ((0 != _tmp21_label2) ? _tmp21_label2 : (_tmp21_label2 = g_quark_from_static_string ("vp8")))) {
				switch (0) {
					default:
					{
						gchar* _tmp28_;
						gchar** _tmp29_;
						gchar** _tmp30_;
						gint _tmp30__length1;
						_tmp28_ = g_strdup ("vp8dec");
						_tmp29_ = g_new0 (gchar*, 1 + 1);
						_tmp29_[0] = _tmp28_;
						_tmp30_ = _tmp29_;
						_tmp30__length1 = 1;
						if (result_length1) {
							*result_length1 = _tmp30__length1;
						}
						result = _tmp30_;
						return result;
					}
				}
			}
		}
	}
	_tmp31_ = g_new0 (gchar*, 0 + 1);
	_tmp32_ = _tmp31_;
	_tmp32__length1 = 0;
	if (result_length1) {
		*result_length1 = _tmp32__length1;
	}
	result = _tmp32_;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_encode_prefix (const gchar* media,
                                               const gchar* codec,
                                               const gchar* encode,
                                               XmppXepJingleRtpPayloadType* payload_type)
{
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (codec != NULL, NULL);
	g_return_val_if_fail (encode != NULL, NULL);
	if (g_strcmp0 (encode, "msdkh264enc") == 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("capsfilter caps=video/x-raw,format=NV12 ! ");
		result = _tmp0_;
		return result;
	}
	if (g_strcmp0 (encode, "vaapih264enc") == 0) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("capsfilter caps=video/x-raw,format=NV12 ! ");
		result = _tmp1_;
		return result;
	}
	result = NULL;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_encode_args (const gchar* media,
                                             const gchar* codec,
                                             const gchar* encode,
                                             XmppXepJingleRtpPayloadType* payload_type)
{
	gboolean _tmp3_ = FALSE;
	gboolean _tmp6_ = FALSE;
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (codec != NULL, NULL);
	g_return_val_if_fail (encode != NULL, NULL);
	if (g_strcmp0 (encode, "msdkh264enc") == 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (" rate-control=vbr");
		result = _tmp0_;
		return result;
	}
	if (g_strcmp0 (encode, "vaapih264enc") == 0) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup (" rate-control=vbr");
		result = _tmp1_;
		return result;
	}
	if (g_strcmp0 (encode, "x264enc") == 0) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (" byte-stream=1 speed-preset=ultrafast tune=zerolatency bframes=0 cabac" \
"=false dct8x8=false");
		result = _tmp2_;
		return result;
	}
	if (g_strcmp0 (encode, "vaapivp8enc") == 0) {
		_tmp3_ = TRUE;
	} else {
		_tmp3_ = g_strcmp0 (encode, "msdkvp8enc") == 0;
	}
	if (_tmp3_) {
		gchar* _tmp4_;
		_tmp4_ = g_strdup (" rate-control=vbr target-percentage=90");
		result = _tmp4_;
		return result;
	}
	if (g_strcmp0 (encode, "vp8enc") == 0) {
		gchar* _tmp5_;
		_tmp5_ = g_strdup (" deadline=1 error-resilient=3 lag-in-frames=0 resize-allowed=true thre" \
"ads=8 dropframe-threshold=30 end-usage=vbr cpu-used=4");
		result = _tmp5_;
		return result;
	}
	if (g_strcmp0 (encode, "msdkvp9enc") == 0) {
		_tmp6_ = TRUE;
	} else {
		_tmp6_ = g_strcmp0 (encode, "vaapivp9enc") == 0;
	}
	if (_tmp6_) {
		gchar* _tmp7_;
		_tmp7_ = g_strdup (" rate-control=vbr target-percentage=90");
		result = _tmp7_;
		return result;
	}
	if (g_strcmp0 (encode, "vp9enc") == 0) {
		gchar* _tmp8_;
		_tmp8_ = g_strdup (" deadline=1 error-resilient=3 lag-in-frames=0 resize-allowed=true thre" \
"ads=8 dropframe-threshold=30 end-usage=vbr cpu-used=4");
		result = _tmp8_;
		return result;
	}
	if (g_strcmp0 (encode, "opusenc") == 0) {
		gboolean _tmp9_ = FALSE;
		gchar* _tmp12_;
		if (payload_type != NULL) {
			GeeMap* _tmp10_;
			_tmp10_ = payload_type->parameters;
			_tmp9_ = gee_map_has (_tmp10_, "useinbandfec", "1");
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			gchar* _tmp11_;
			_tmp11_ = g_strdup (" audio-type=voice inband-fec=true");
			result = _tmp11_;
			return result;
		}
		_tmp12_ = g_strdup (" audio-type=voice");
		result = _tmp12_;
		return result;
	}
	result = NULL;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_encode_suffix (const gchar* media,
                                               const gchar* codec,
                                               const gchar* encode,
                                               XmppXepJingleRtpPayloadType* payload_type)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (codec != NULL, NULL);
	g_return_val_if_fail (encode != NULL, NULL);
	if (g_strcmp0 (media, "video") == 0) {
		_tmp0_ = g_strcmp0 (codec, "h264") == 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup (" ! capsfilter caps=video/x-h264,profile=constrained-baseline ! h264par" \
"se");
		result = _tmp1_;
		return result;
	}
	if (g_strcmp0 (media, "video") == 0) {
		_tmp3_ = g_strcmp0 (codec, "vp8") == 0;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		_tmp2_ = g_strcmp0 (encode, "vp8enc") == 0;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		gchar* _tmp4_;
		_tmp4_ = g_strdup (" ! capsfilter caps=video/x-vp8,profile=(string)1");
		result = _tmp4_;
		return result;
	}
	result = NULL;
	return result;
}

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

guint
dino_plugins_rtp_codec_util_update_bitrate (DinoPluginsRtpCodecUtil* self,
                                            const gchar* media,
                                            XmppXepJingleRtpPayloadType* payload_type,
                                            GstElement* encode_element,
                                            guint bitrate)
{
	GstBin* encode_bin = NULL;
	GstBin* _tmp0_;
	GstBin* _tmp1_;
	gchar* codec = NULL;
	gchar* _tmp2_;
	gchar* encode_name = NULL;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	GstElement* encode = NULL;
	GstBin* _tmp6_;
	GstBin* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	GstElement* _tmp14_;
	GstElement* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	GQuark _tmp19_ = 0U;
	static GQuark _tmp18_label0 = 0;
	static GQuark _tmp18_label1 = 0;
	static GQuark _tmp18_label2 = 0;
	static GQuark _tmp18_label3 = 0;
	static GQuark _tmp18_label4 = 0;
	static GQuark _tmp18_label5 = 0;
	static GQuark _tmp18_label6 = 0;
	static GQuark _tmp18_label7 = 0;
	static GQuark _tmp18_label8 = 0;
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	g_return_val_if_fail (media != NULL, 0U);
	g_return_val_if_fail (payload_type != NULL, 0U);
	g_return_val_if_fail (encode_element != NULL, 0U);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (encode_element, gst_bin_get_type ()) ? ((GstBin*) encode_element) : NULL);
	encode_bin = _tmp0_;
	_tmp1_ = encode_bin;
	if (_tmp1_ == NULL) {
		result = (guint) 0;
		_g_object_unref0 (encode_bin);
		return result;
	}
	_tmp2_ = dino_plugins_rtp_codec_util_get_codec_from_payload (media, payload_type);
	codec = _tmp2_;
	_tmp3_ = codec;
	_tmp4_ = dino_plugins_rtp_codec_util_get_encode_element_name (self, media, _tmp3_);
	encode_name = _tmp4_;
	_tmp5_ = encode_name;
	if (_tmp5_ == NULL) {
		result = (guint) 0;
		_g_free0 (encode_name);
		_g_free0 (codec);
		_g_object_unref0 (encode_bin);
		return result;
	}
	_tmp6_ = encode_bin;
	_tmp7_ = encode_bin;
	_tmp8_ = gst_object_get_name ((GstObject*) _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _tmp9_;
	_tmp11_ = string_to_string (_tmp10_);
	_tmp12_ = g_strconcat (_tmp11_, "_encode", NULL);
	_tmp13_ = _tmp12_;
	_tmp14_ = gst_bin_get_by_name (_tmp6_, _tmp13_);
	_tmp15_ = _tmp14_;
	_g_free0 (_tmp13_);
	_g_free0 (_tmp10_);
	encode = _tmp15_;
	_tmp16_ = encode_name;
	_tmp17_ = _tmp16_;
	_tmp19_ = (NULL == _tmp17_) ? 0 : g_quark_from_string (_tmp17_);
	if (((((((_tmp19_ == ((0 != _tmp18_label0) ? _tmp18_label0 : (_tmp18_label0 = g_quark_from_static_string ("msdkh264enc")))) || (_tmp19_ == ((0 != _tmp18_label1) ? _tmp18_label1 : (_tmp18_label1 = g_quark_from_static_string ("vaapih264enc"))))) || (_tmp19_ == ((0 != _tmp18_label2) ? _tmp18_label2 : (_tmp18_label2 = g_quark_from_static_string ("x264enc"))))) || (_tmp19_ == ((0 != _tmp18_label3) ? _tmp18_label3 : (_tmp18_label3 = g_quark_from_static_string ("msdkvp9enc"))))) || (_tmp19_ == ((0 != _tmp18_label4) ? _tmp18_label4 : (_tmp18_label4 = g_quark_from_static_string ("vaapivp9enc"))))) || (_tmp19_ == ((0 != _tmp18_label5) ? _tmp18_label5 : (_tmp18_label5 = g_quark_from_static_string ("msdkvp8enc"))))) || (_tmp19_ == ((0 != _tmp18_label6) ? _tmp18_label6 : (_tmp18_label6 = g_quark_from_static_string ("vaapivp8enc"))))) {
		switch (0) {
			default:
			{
				GstElement* _tmp20_;
				bitrate = MIN ((guint) 2048000, bitrate);
				_tmp20_ = encode;
				g_object_set ((GObject*) _tmp20_, "bitrate", bitrate, NULL);
				result = bitrate;
				_g_object_unref0 (encode);
				_g_free0 (encode_name);
				_g_free0 (codec);
				_g_object_unref0 (encode_bin);
				return result;
			}
		}
	} else if ((_tmp19_ == ((0 != _tmp18_label7) ? _tmp18_label7 : (_tmp18_label7 = g_quark_from_static_string ("vp9enc")))) || (_tmp19_ == ((0 != _tmp18_label8) ? _tmp18_label8 : (_tmp18_label8 = g_quark_from_static_string ("vp8enc"))))) {
		switch (0) {
			default:
			{
				GstElement* _tmp21_;
				bitrate = MIN ((guint) 2147483, bitrate);
				_tmp21_ = encode;
				g_object_set ((GObject*) _tmp21_, "target-bitrate", bitrate * 1024, NULL);
				result = bitrate;
				_g_object_unref0 (encode);
				_g_free0 (encode_name);
				_g_free0 (codec);
				_g_object_unref0 (encode_bin);
				return result;
			}
		}
	}
	result = (guint) 0;
	_g_object_unref0 (encode);
	_g_free0 (encode_name);
	_g_free0 (codec);
	_g_object_unref0 (encode_bin);
	return result;
}

void
dino_plugins_rtp_codec_util_update_rescale_caps (DinoPluginsRtpCodecUtil* self,
                                                 GstElement* encode_element,
                                                 GstCaps* caps)
{
	GstBin* encode_bin = NULL;
	GstBin* _tmp0_;
	GstBin* _tmp1_;
	GstElement* rescale_caps = NULL;
	GstBin* _tmp2_;
	GstBin* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GstElement* _tmp10_;
	GstElement* _tmp11_;
	GstElement* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (encode_element != NULL);
	g_return_if_fail (caps != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (encode_element, gst_bin_get_type ()) ? ((GstBin*) encode_element) : NULL);
	encode_bin = _tmp0_;
	_tmp1_ = encode_bin;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (encode_bin);
		return;
	}
	_tmp2_ = encode_bin;
	_tmp3_ = encode_bin;
	_tmp4_ = gst_object_get_name ((GstObject*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp7_ = string_to_string (_tmp6_);
	_tmp8_ = g_strconcat (_tmp7_, "_rescale_caps", NULL);
	_tmp9_ = _tmp8_;
	_tmp10_ = gst_bin_get_by_name (_tmp2_, _tmp9_);
	_tmp11_ = _tmp10_;
	_g_free0 (_tmp9_);
	_g_free0 (_tmp6_);
	rescale_caps = _tmp11_;
	_tmp12_ = rescale_caps;
	g_object_set ((GObject*) _tmp12_, "caps", caps, NULL);
	_g_object_unref0 (rescale_caps);
	_g_object_unref0 (encode_bin);
}

GstCaps*
dino_plugins_rtp_codec_util_get_rescale_caps (DinoPluginsRtpCodecUtil* self,
                                              GstElement* encode_element)
{
	GstBin* encode_bin = NULL;
	GstBin* _tmp0_;
	GstBin* _tmp1_;
	GstElement* rescale_caps = NULL;
	GstBin* _tmp2_;
	GstBin* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	GstElement* _tmp10_;
	GstElement* _tmp11_;
	GstCaps* caps = NULL;
	GstElement* _tmp12_;
	GstCaps* _tmp13_ = NULL;
	GstCaps* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (encode_element != NULL, NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (encode_element, gst_bin_get_type ()) ? ((GstBin*) encode_element) : NULL);
	encode_bin = _tmp0_;
	_tmp1_ = encode_bin;
	if (_tmp1_ == NULL) {
		result = NULL;
		_g_object_unref0 (encode_bin);
		return result;
	}
	_tmp2_ = encode_bin;
	_tmp3_ = encode_bin;
	_tmp4_ = gst_object_get_name ((GstObject*) _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp7_ = string_to_string (_tmp6_);
	_tmp8_ = g_strconcat (_tmp7_, "_rescale_caps", NULL);
	_tmp9_ = _tmp8_;
	_tmp10_ = gst_bin_get_by_name (_tmp2_, _tmp9_);
	_tmp11_ = _tmp10_;
	_g_free0 (_tmp9_);
	_g_free0 (_tmp6_);
	rescale_caps = _tmp11_;
	_tmp12_ = rescale_caps;
	g_object_get ((GObject*) _tmp12_, "caps", &_tmp13_, NULL);
	_gst_caps_unref0 (caps);
	caps = _tmp13_;
	result = caps;
	_g_object_unref0 (rescale_caps);
	_g_object_unref0 (encode_bin);
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_decode_prefix (const gchar* media,
                                               const gchar* codec,
                                               const gchar* decode,
                                               XmppXepJingleRtpPayloadType* payload_type)
{
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (codec != NULL, NULL);
	g_return_val_if_fail (decode != NULL, NULL);
	result = NULL;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_decode_args (const gchar* media,
                                             const gchar* codec,
                                             const gchar* decode,
                                             XmppXepJingleRtpPayloadType* payload_type)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp7_ = FALSE;
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (codec != NULL, NULL);
	g_return_val_if_fail (decode != NULL, NULL);
	if (g_strcmp0 (decode, "opusdec") == 0) {
		_tmp1_ = payload_type != NULL;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GeeMap* _tmp2_;
		_tmp2_ = payload_type->parameters;
		_tmp0_ = gee_map_has (_tmp2_, "useinbandfec", "1");
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gchar* _tmp3_;
		_tmp3_ = g_strdup (" use-inband-fec=true");
		result = _tmp3_;
		return result;
	}
	if (g_strcmp0 (decode, "vaapivp9dec") == 0) {
		_tmp5_ = TRUE;
	} else {
		_tmp5_ = g_strcmp0 (decode, "vaapivp8dec") == 0;
	}
	if (_tmp5_) {
		_tmp4_ = TRUE;
	} else {
		_tmp4_ = g_strcmp0 (decode, "vaapih264dec") == 0;
	}
	if (_tmp4_) {
		gchar* _tmp6_;
		_tmp6_ = g_strdup (" max-errors=100");
		result = _tmp6_;
		return result;
	}
	if (g_strcmp0 (decode, "vp8dec") == 0) {
		_tmp7_ = TRUE;
	} else {
		_tmp7_ = g_strcmp0 (decode, "vp9dec") == 0;
	}
	if (_tmp7_) {
		gchar* _tmp8_;
		_tmp8_ = g_strdup (" threads=8");
		result = _tmp8_;
		return result;
	}
	result = NULL;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_decode_suffix (const gchar* media,
                                               const gchar* codec,
                                               const gchar* encode,
                                               XmppXepJingleRtpPayloadType* payload_type)
{
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (codec != NULL, NULL);
	g_return_val_if_fail (encode != NULL, NULL);
	result = NULL;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_depay_args (const gchar* media,
                                            const gchar* codec,
                                            const gchar* encode,
                                            XmppXepJingleRtpPayloadType* payload_type)
{
	gchar* result;
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (codec != NULL, NULL);
	g_return_val_if_fail (encode != NULL, NULL);
	if (g_strcmp0 (codec, "vp8") == 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (" wait-for-keyframe=true");
		result = _tmp0_;
		return result;
	}
	result = NULL;
	return result;
}

gboolean
dino_plugins_rtp_codec_util_is_element_supported (DinoPluginsRtpCodecUtil* self,
                                                  const gchar* element_name)
{
	GeeSet* _tmp0_;
	GeeSet* _tmp1_;
	GstElement* test_element = NULL;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GstElement* _tmp5_;
	GstElement* _tmp6_;
	GstElement* _tmp7_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (element_name == NULL) {
		result = FALSE;
		return result;
	}
	_tmp0_ = self->priv->unsupported_elements;
	if (gee_collection_contains ((GeeCollection*) _tmp0_, element_name)) {
		result = FALSE;
		return result;
	}
	_tmp1_ = self->priv->supported_elements;
	if (gee_collection_contains ((GeeCollection*) _tmp1_, element_name)) {
		result = TRUE;
		return result;
	}
	_tmp2_ = string_to_string (element_name);
	_tmp3_ = g_strconcat ("test-", _tmp2_, NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = gst_element_factory_make (element_name, _tmp4_);
	if (_tmp5_ != NULL) {
		g_object_ref_sink (_tmp5_);
	}
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp4_);
	test_element = _tmp6_;
	_tmp7_ = test_element;
	if (_tmp7_ != NULL) {
		GeeSet* _tmp8_;
		_tmp8_ = self->priv->supported_elements;
		gee_collection_add ((GeeCollection*) _tmp8_, element_name);
		result = TRUE;
		_g_object_unref0 (test_element);
		return result;
	} else {
		GeeSet* _tmp9_;
		g_warning ("codec_util.vala:298: %s is not installed or supported on this system", element_name);
		_tmp9_ = self->priv->unsupported_elements;
		gee_collection_add ((GeeCollection*) _tmp9_, element_name);
		result = FALSE;
		_g_object_unref0 (test_element);
		return result;
	}
}

gchar*
dino_plugins_rtp_codec_util_get_encode_element_name (DinoPluginsRtpCodecUtil* self,
                                                     const gchar* media,
                                                     const gchar* codec)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_;
	gint _tmp3_ = 0;
	gchar** _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_codec_util_get_pay_element_name (self, media, codec);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_ == NULL;
	_g_free0 (_tmp1_);
	if (_tmp2_) {
		result = NULL;
		return result;
	}
	_tmp4_ = dino_plugins_rtp_codec_util_get_encode_candidates (media, codec, &_tmp3_);
	{
		gchar** candidate_collection = NULL;
		gint candidate_collection_length1 = 0;
		gint _candidate_collection_size_ = 0;
		gint candidate_it = 0;
		candidate_collection = _tmp4_;
		candidate_collection_length1 = _tmp3_;
		for (candidate_it = 0; candidate_it < candidate_collection_length1; candidate_it = candidate_it + 1) {
			gchar* _tmp5_;
			gchar* candidate = NULL;
			_tmp5_ = g_strdup (candidate_collection[candidate_it]);
			candidate = _tmp5_;
			{
				const gchar* _tmp6_;
				_tmp6_ = candidate;
				if (dino_plugins_rtp_codec_util_is_element_supported (self, _tmp6_)) {
					result = candidate;
					candidate_collection = (_vala_array_free (candidate_collection, candidate_collection_length1, (GDestroyNotify) g_free), NULL);
					return result;
				}
				_g_free0 (candidate);
			}
		}
		candidate_collection = (_vala_array_free (candidate_collection, candidate_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	result = NULL;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_pay_element_name (DinoPluginsRtpCodecUtil* self,
                                                  const gchar* media,
                                                  const gchar* codec)
{
	gchar* candidate = NULL;
	gchar* _tmp0_;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_codec_util_get_pay_candidate (media, codec);
	candidate = _tmp0_;
	_tmp2_ = candidate;
	if (_tmp2_ != NULL) {
		const gchar* _tmp3_;
		_tmp3_ = candidate;
		_tmp1_ = dino_plugins_rtp_codec_util_is_element_supported (self, _tmp3_);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		result = candidate;
		return result;
	}
	result = NULL;
	_g_free0 (candidate);
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_decode_element_name (DinoPluginsRtpCodecUtil* self,
                                                     const gchar* media,
                                                     const gchar* codec)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_;
	gint _tmp3_ = 0;
	gchar** _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_codec_util_get_depay_element_name (self, media, codec);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_ == NULL;
	_g_free0 (_tmp1_);
	if (_tmp2_) {
		result = NULL;
		return result;
	}
	_tmp4_ = dino_plugins_rtp_codec_util_get_decode_candidates (media, codec, &_tmp3_);
	{
		gchar** candidate_collection = NULL;
		gint candidate_collection_length1 = 0;
		gint _candidate_collection_size_ = 0;
		gint candidate_it = 0;
		candidate_collection = _tmp4_;
		candidate_collection_length1 = _tmp3_;
		for (candidate_it = 0; candidate_it < candidate_collection_length1; candidate_it = candidate_it + 1) {
			gchar* _tmp5_;
			gchar* candidate = NULL;
			_tmp5_ = g_strdup (candidate_collection[candidate_it]);
			candidate = _tmp5_;
			{
				const gchar* _tmp6_;
				_tmp6_ = candidate;
				if (dino_plugins_rtp_codec_util_is_element_supported (self, _tmp6_)) {
					result = candidate;
					candidate_collection = (_vala_array_free (candidate_collection, candidate_collection_length1, (GDestroyNotify) g_free), NULL);
					return result;
				}
				_g_free0 (candidate);
			}
		}
		candidate_collection = (_vala_array_free (candidate_collection, candidate_collection_length1, (GDestroyNotify) g_free), NULL);
	}
	result = NULL;
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_depay_element_name (DinoPluginsRtpCodecUtil* self,
                                                    const gchar* media,
                                                    const gchar* codec)
{
	gchar* candidate = NULL;
	gchar* _tmp0_;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_codec_util_get_depay_candidate (media, codec);
	candidate = _tmp0_;
	_tmp2_ = candidate;
	if (_tmp2_ != NULL) {
		const gchar* _tmp3_;
		_tmp3_ = candidate;
		_tmp1_ = dino_plugins_rtp_codec_util_is_element_supported (self, _tmp3_);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		result = candidate;
		return result;
	}
	result = NULL;
	_g_free0 (candidate);
	return result;
}

void
dino_plugins_rtp_codec_util_mark_element_unsupported (DinoPluginsRtpCodecUtil* self,
                                                      const gchar* element_name)
{
	GeeSet* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (element_name != NULL);
	_tmp0_ = self->priv->unsupported_elements;
	gee_collection_add ((GeeCollection*) _tmp0_, element_name);
}

gchar*
dino_plugins_rtp_codec_util_get_decode_bin_description (DinoPluginsRtpCodecUtil* self,
                                                        const gchar* media,
                                                        const gchar* codec,
                                                        XmppXepJingleRtpPayloadType* payload_type,
                                                        const gchar* element_name,
                                                        const gchar* name)
{
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* base_name = NULL;
	gchar* _tmp6_;
	gchar* depay = NULL;
	gchar* _tmp7_;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_;
	gchar* decode = NULL;
	gchar* _tmp11_;
	gboolean _tmp12_ = FALSE;
	const gchar* _tmp13_;
	gchar* _tmp15_ = NULL;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* decode_prefix = NULL;
	gchar* _tmp19_;
	gchar* _tmp20_ = NULL;
	const gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* decode_args = NULL;
	gchar* _tmp24_;
	gchar* _tmp25_ = NULL;
	const gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* decode_suffix = NULL;
	gchar* _tmp29_;
	gchar* _tmp30_ = NULL;
	const gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* depay_args = NULL;
	gchar* _tmp34_;
	gchar* _tmp35_ = NULL;
	gchar* resample = NULL;
	gchar* _tmp40_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	const gchar* _tmp44_;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	const gchar* _tmp47_;
	const gchar* _tmp48_;
	const gchar* _tmp49_;
	const gchar* _tmp50_;
	const gchar* _tmp51_;
	const gchar* _tmp52_;
	const gchar* _tmp53_;
	const gchar* _tmp54_;
	const gchar* _tmp55_;
	const gchar* _tmp56_;
	const gchar* _tmp57_;
	const gchar* _tmp58_;
	const gchar* _tmp59_;
	const gchar* _tmp60_;
	const gchar* _tmp61_;
	const gchar* _tmp62_;
	gchar* _tmp63_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	if (codec == NULL) {
		result = NULL;
		return result;
	}
	_tmp1_ = g_strdup (name);
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp2_ = string_to_string (codec);
		_tmp3_ = g_strdup_printf ("%u", g_random_int ());
		_tmp4_ = _tmp3_;
		_tmp5_ = g_strconcat ("encode-", _tmp2_, "-", _tmp4_, NULL);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp5_;
		_g_free0 (_tmp4_);
	}
	_tmp6_ = _tmp0_;
	_tmp0_ = NULL;
	base_name = _tmp6_;
	_tmp7_ = dino_plugins_rtp_codec_util_get_depay_element_name (self, media, codec);
	depay = _tmp7_;
	_tmp9_ = g_strdup (element_name);
	_tmp8_ = _tmp9_;
	if (_tmp8_ == NULL) {
		gchar* _tmp10_;
		_tmp10_ = dino_plugins_rtp_codec_util_get_decode_element_name (self, media, codec);
		_g_free0 (_tmp8_);
		_tmp8_ = _tmp10_;
	}
	_tmp11_ = _tmp8_;
	_tmp8_ = NULL;
	decode = _tmp11_;
	_tmp13_ = depay;
	if (_tmp13_ == NULL) {
		_tmp12_ = TRUE;
	} else {
		const gchar* _tmp14_;
		_tmp14_ = decode;
		_tmp12_ = _tmp14_ == NULL;
	}
	if (_tmp12_) {
		result = NULL;
		_g_free0 (decode);
		_g_free0 (_tmp8_);
		_g_free0 (depay);
		_g_free0 (base_name);
		_g_free0 (_tmp0_);
		return result;
	}
	_tmp16_ = decode;
	_tmp17_ = dino_plugins_rtp_codec_util_get_decode_prefix (media, codec, _tmp16_, payload_type);
	_tmp15_ = _tmp17_;
	if (_tmp15_ == NULL) {
		gchar* _tmp18_;
		_tmp18_ = g_strdup ("");
		_g_free0 (_tmp15_);
		_tmp15_ = _tmp18_;
	}
	_tmp19_ = _tmp15_;
	_tmp15_ = NULL;
	decode_prefix = _tmp19_;
	_tmp21_ = decode;
	_tmp22_ = dino_plugins_rtp_codec_util_get_decode_args (media, codec, _tmp21_, payload_type);
	_tmp20_ = _tmp22_;
	if (_tmp20_ == NULL) {
		gchar* _tmp23_;
		_tmp23_ = g_strdup ("");
		_g_free0 (_tmp20_);
		_tmp20_ = _tmp23_;
	}
	_tmp24_ = _tmp20_;
	_tmp20_ = NULL;
	decode_args = _tmp24_;
	_tmp26_ = decode;
	_tmp27_ = dino_plugins_rtp_codec_util_get_decode_suffix (media, codec, _tmp26_, payload_type);
	_tmp25_ = _tmp27_;
	if (_tmp25_ == NULL) {
		gchar* _tmp28_;
		_tmp28_ = g_strdup ("");
		_g_free0 (_tmp25_);
		_tmp25_ = _tmp28_;
	}
	_tmp29_ = _tmp25_;
	_tmp25_ = NULL;
	decode_suffix = _tmp29_;
	_tmp31_ = decode;
	_tmp32_ = dino_plugins_rtp_codec_util_get_depay_args (media, codec, _tmp31_, payload_type);
	_tmp30_ = _tmp32_;
	if (_tmp30_ == NULL) {
		gchar* _tmp33_;
		_tmp33_ = g_strdup ("");
		_g_free0 (_tmp30_);
		_tmp30_ = _tmp33_;
	}
	_tmp34_ = _tmp30_;
	_tmp30_ = NULL;
	depay_args = _tmp34_;
	if (g_strcmp0 (media, "audio") == 0) {
		const gchar* _tmp36_;
		const gchar* _tmp37_;
		gchar* _tmp38_;
		_tmp36_ = base_name;
		_tmp37_ = string_to_string (_tmp36_);
		_tmp38_ = g_strconcat (" ! audioresample name=", _tmp37_, "_resample", NULL);
		_g_free0 (_tmp35_);
		_tmp35_ = _tmp38_;
	} else {
		gchar* _tmp39_;
		_tmp39_ = g_strdup ("");
		_g_free0 (_tmp35_);
		_tmp35_ = _tmp39_;
	}
	_tmp40_ = _tmp35_;
	_tmp35_ = NULL;
	resample = _tmp40_;
	_tmp41_ = depay;
	_tmp42_ = string_to_string (_tmp41_);
	_tmp43_ = depay_args;
	_tmp44_ = string_to_string (_tmp43_);
	_tmp45_ = base_name;
	_tmp46_ = string_to_string (_tmp45_);
	_tmp47_ = decode_prefix;
	_tmp48_ = string_to_string (_tmp47_);
	_tmp49_ = decode;
	_tmp50_ = string_to_string (_tmp49_);
	_tmp51_ = decode_args;
	_tmp52_ = string_to_string (_tmp51_);
	_tmp53_ = base_name;
	_tmp54_ = string_to_string (_tmp53_);
	_tmp55_ = string_to_string (codec);
	_tmp56_ = decode_suffix;
	_tmp57_ = string_to_string (_tmp56_);
	_tmp58_ = string_to_string (media);
	_tmp59_ = base_name;
	_tmp60_ = string_to_string (_tmp59_);
	_tmp61_ = resample;
	_tmp62_ = string_to_string (_tmp61_);
	_tmp63_ = g_strconcat ("queue ! ", _tmp42_, _tmp44_, " name=", _tmp46_, "_rtp_depay ! ", _tmp48_, _tmp50_, _tmp52_, " name=", _tmp54_, "_", _tmp55_, "_decode", _tmp57_, " ! ", _tmp58_, "convert name=", _tmp60_, "_convert", _tmp62_, NULL);
	result = _tmp63_;
	_g_free0 (resample);
	_g_free0 (_tmp35_);
	_g_free0 (depay_args);
	_g_free0 (_tmp30_);
	_g_free0 (decode_suffix);
	_g_free0 (_tmp25_);
	_g_free0 (decode_args);
	_g_free0 (_tmp20_);
	_g_free0 (decode_prefix);
	_g_free0 (_tmp15_);
	_g_free0 (decode);
	_g_free0 (_tmp8_);
	_g_free0 (depay);
	_g_free0 (base_name);
	_g_free0 (_tmp0_);
	return result;
}

GstElement*
dino_plugins_rtp_codec_util_get_decode_bin (DinoPluginsRtpCodecUtil* self,
                                            const gchar* media,
                                            XmppXepJingleRtpPayloadType* payload_type,
                                            const gchar* name)
{
	gchar* codec = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* base_name = NULL;
	gchar* _tmp8_;
	gchar* desc = NULL;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	GstElement* bin = NULL;
	const gchar* _tmp15_;
	GstElement* _tmp16_;
	GstElement* _tmp17_;
	GError* _inner_error0_ = NULL;
	GstElement* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (payload_type != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_codec_util_get_codec_from_payload (media, payload_type);
	codec = _tmp0_;
	_tmp2_ = g_strdup (name);
	_tmp1_ = _tmp2_;
	if (_tmp1_ == NULL) {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp3_ = codec;
		_tmp4_ = string_to_string (_tmp3_);
		_tmp5_ = g_strdup_printf ("%u", g_random_int ());
		_tmp6_ = _tmp5_;
		_tmp7_ = g_strconcat ("decode_", _tmp4_, "_", _tmp6_, NULL);
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp7_;
		_g_free0 (_tmp6_);
	}
	_tmp8_ = _tmp1_;
	_tmp1_ = NULL;
	base_name = _tmp8_;
	_tmp9_ = codec;
	_tmp10_ = base_name;
	_tmp11_ = dino_plugins_rtp_codec_util_get_decode_bin_description (self, media, _tmp9_, payload_type, NULL, _tmp10_);
	desc = _tmp11_;
	_tmp12_ = desc;
	if (_tmp12_ == NULL) {
		result = NULL;
		_g_free0 (desc);
		_g_free0 (base_name);
		_g_free0 (_tmp1_);
		_g_free0 (codec);
		return result;
	}
	_tmp13_ = codec;
	_tmp14_ = desc;
	g_debug ("codec_util.vala:355: Pipeline to decode %s %s: %s", media, _tmp13_, _tmp14_);
	_tmp15_ = desc;
	_tmp16_ = gst_parse_bin_from_description_full (_tmp15_, TRUE, NULL, GST_PARSE_FLAG_NONE, &_inner_error0_);
	if (_tmp16_ != NULL) {
		g_object_ref_sink (_tmp16_);
	}
	bin = _tmp16_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (desc);
		_g_free0 (base_name);
		_g_free0 (_tmp1_);
		_g_free0 (codec);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp17_ = bin;
	gst_object_set_name ((GstObject*) _tmp17_, name);
	result = bin;
	_g_free0 (desc);
	_g_free0 (base_name);
	_g_free0 (_tmp1_);
	_g_free0 (codec);
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_encode_bin_description (DinoPluginsRtpCodecUtil* self,
                                                        const gchar* media,
                                                        const gchar* codec,
                                                        XmppXepJingleRtpPayloadType* payload_type,
                                                        const gchar* element_name,
                                                        const gchar* name)
{
	gchar* desc1 = NULL;
	gchar* _tmp0_;
	gchar* desc2 = NULL;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_codec_util_get_encode_bin_without_payloader_description (self, media, codec, payload_type, element_name, name);
	desc1 = _tmp0_;
	_tmp1_ = dino_plugins_rtp_codec_util_get_payloader_bin_description (self, media, codec, payload_type, name);
	desc2 = _tmp1_;
	_tmp2_ = string_to_string (desc1);
	_tmp3_ = string_to_string (desc2);
	_tmp4_ = g_strconcat (_tmp2_, " ! ", _tmp3_, NULL);
	result = _tmp4_;
	_g_free0 (desc2);
	_g_free0 (desc1);
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_payloader_bin_description (DinoPluginsRtpCodecUtil* self,
                                                           const gchar* media,
                                                           const gchar* codec,
                                                           XmppXepJingleRtpPayloadType* payload_type,
                                                           const gchar* name)
{
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* base_name = NULL;
	gchar* _tmp6_;
	gchar* pay = NULL;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	guint8 _tmp9_ = 0U;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	if (codec == NULL) {
		result = NULL;
		return result;
	}
	_tmp1_ = g_strdup (name);
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp2_ = string_to_string (codec);
		_tmp3_ = g_strdup_printf ("%u", g_random_int ());
		_tmp4_ = _tmp3_;
		_tmp5_ = g_strconcat ("encode_", _tmp2_, "_", _tmp4_, NULL);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp5_;
		_g_free0 (_tmp4_);
	}
	_tmp6_ = _tmp0_;
	_tmp0_ = NULL;
	base_name = _tmp6_;
	_tmp7_ = dino_plugins_rtp_codec_util_get_pay_element_name (self, media, codec);
	pay = _tmp7_;
	_tmp8_ = pay;
	if (_tmp8_ == NULL) {
		result = NULL;
		_g_free0 (pay);
		_g_free0 (base_name);
		_g_free0 (_tmp0_);
		return result;
	}
	if (payload_type != NULL) {
		guint8 _tmp10_;
		guint8 _tmp11_;
		_tmp10_ = xmpp_xep_jingle_rtp_payload_type_get_id (payload_type);
		_tmp11_ = _tmp10_;
		_tmp9_ = _tmp11_;
	} else {
		_tmp9_ = (guint8) 96;
	}
	_tmp12_ = pay;
	_tmp13_ = string_to_string (_tmp12_);
	_tmp14_ = g_strdup_printf ("%hhu", _tmp9_);
	_tmp15_ = _tmp14_;
	_tmp16_ = base_name;
	_tmp17_ = string_to_string (_tmp16_);
	_tmp18_ = g_strconcat (_tmp13_, " pt=", _tmp15_, " name=", _tmp17_, "_rtp_pay", NULL);
	_tmp19_ = _tmp18_;
	_g_free0 (_tmp15_);
	result = _tmp19_;
	_g_free0 (pay);
	_g_free0 (base_name);
	_g_free0 (_tmp0_);
	return result;
}

gchar*
dino_plugins_rtp_codec_util_get_encode_bin_without_payloader_description (DinoPluginsRtpCodecUtil* self,
                                                                          const gchar* media,
                                                                          const gchar* codec,
                                                                          XmppXepJingleRtpPayloadType* payload_type,
                                                                          const gchar* element_name,
                                                                          const gchar* name)
{
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* base_name = NULL;
	gchar* _tmp6_;
	gchar* _tmp7_ = NULL;
	gchar* _tmp8_;
	gchar* encode = NULL;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_ = NULL;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* encode_prefix = NULL;
	gchar* _tmp16_;
	gchar* _tmp17_ = NULL;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* encode_args = NULL;
	gchar* _tmp21_;
	gchar* _tmp22_ = NULL;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* encode_suffix = NULL;
	gchar* _tmp26_;
	gchar* _tmp27_ = NULL;
	gchar* rescale = NULL;
	gchar* _tmp36_;
	const gchar* _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	const gchar* _tmp43_;
	const gchar* _tmp44_;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	const gchar* _tmp47_;
	const gchar* _tmp48_;
	const gchar* _tmp49_;
	const gchar* _tmp50_;
	const gchar* _tmp51_;
	gchar* _tmp52_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	if (codec == NULL) {
		result = NULL;
		return result;
	}
	_tmp1_ = g_strdup (name);
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp2_ = string_to_string (codec);
		_tmp3_ = g_strdup_printf ("%u", g_random_int ());
		_tmp4_ = _tmp3_;
		_tmp5_ = g_strconcat ("encode_", _tmp2_, "_", _tmp4_, NULL);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp5_;
		_g_free0 (_tmp4_);
	}
	_tmp6_ = _tmp0_;
	_tmp0_ = NULL;
	base_name = _tmp6_;
	_tmp8_ = g_strdup (element_name);
	_tmp7_ = _tmp8_;
	if (_tmp7_ == NULL) {
		gchar* _tmp9_;
		_tmp9_ = dino_plugins_rtp_codec_util_get_encode_element_name (self, media, codec);
		_g_free0 (_tmp7_);
		_tmp7_ = _tmp9_;
	}
	_tmp10_ = _tmp7_;
	_tmp7_ = NULL;
	encode = _tmp10_;
	_tmp11_ = encode;
	if (_tmp11_ == NULL) {
		result = NULL;
		_g_free0 (encode);
		_g_free0 (_tmp7_);
		_g_free0 (base_name);
		_g_free0 (_tmp0_);
		return result;
	}
	_tmp13_ = encode;
	_tmp14_ = dino_plugins_rtp_codec_util_get_encode_prefix (media, codec, _tmp13_, payload_type);
	_tmp12_ = _tmp14_;
	if (_tmp12_ == NULL) {
		gchar* _tmp15_;
		_tmp15_ = g_strdup ("");
		_g_free0 (_tmp12_);
		_tmp12_ = _tmp15_;
	}
	_tmp16_ = _tmp12_;
	_tmp12_ = NULL;
	encode_prefix = _tmp16_;
	_tmp18_ = encode;
	_tmp19_ = dino_plugins_rtp_codec_util_get_encode_args (media, codec, _tmp18_, payload_type);
	_tmp17_ = _tmp19_;
	if (_tmp17_ == NULL) {
		gchar* _tmp20_;
		_tmp20_ = g_strdup ("");
		_g_free0 (_tmp17_);
		_tmp17_ = _tmp20_;
	}
	_tmp21_ = _tmp17_;
	_tmp17_ = NULL;
	encode_args = _tmp21_;
	_tmp23_ = encode;
	_tmp24_ = dino_plugins_rtp_codec_util_get_encode_suffix (media, codec, _tmp23_, payload_type);
	_tmp22_ = _tmp24_;
	if (_tmp22_ == NULL) {
		gchar* _tmp25_;
		_tmp25_ = g_strdup ("");
		_g_free0 (_tmp22_);
		_tmp22_ = _tmp25_;
	}
	_tmp26_ = _tmp22_;
	_tmp22_ = NULL;
	encode_suffix = _tmp26_;
	if (g_strcmp0 (media, "audio") == 0) {
		const gchar* _tmp28_;
		const gchar* _tmp29_;
		gchar* _tmp30_;
		_tmp28_ = base_name;
		_tmp29_ = string_to_string (_tmp28_);
		_tmp30_ = g_strconcat (" ! audioresample name=", _tmp29_, "_resample", NULL);
		_g_free0 (_tmp27_);
		_tmp27_ = _tmp30_;
	} else {
		const gchar* _tmp31_;
		const gchar* _tmp32_;
		const gchar* _tmp33_;
		const gchar* _tmp34_;
		gchar* _tmp35_;
		_tmp31_ = base_name;
		_tmp32_ = string_to_string (_tmp31_);
		_tmp33_ = base_name;
		_tmp34_ = string_to_string (_tmp33_);
		_tmp35_ = g_strconcat (" ! videoscale name=", _tmp32_, "_rescale ! capsfilter name=", _tmp34_, "_rescale_caps", NULL);
		_g_free0 (_tmp27_);
		_tmp27_ = _tmp35_;
	}
	_tmp36_ = _tmp27_;
	_tmp27_ = NULL;
	rescale = _tmp36_;
	_tmp37_ = string_to_string (media);
	_tmp38_ = base_name;
	_tmp39_ = string_to_string (_tmp38_);
	_tmp40_ = rescale;
	_tmp41_ = string_to_string (_tmp40_);
	_tmp42_ = encode_prefix;
	_tmp43_ = string_to_string (_tmp42_);
	_tmp44_ = encode;
	_tmp45_ = string_to_string (_tmp44_);
	_tmp46_ = encode_args;
	_tmp47_ = string_to_string (_tmp46_);
	_tmp48_ = base_name;
	_tmp49_ = string_to_string (_tmp48_);
	_tmp50_ = encode_suffix;
	_tmp51_ = string_to_string (_tmp50_);
	_tmp52_ = g_strconcat (_tmp37_, "convert name=", _tmp39_, "_convert", _tmp41_, " ! queue ! ", _tmp43_, _tmp45_, _tmp47_, " name=", _tmp49_, "_encode", _tmp51_, NULL);
	result = _tmp52_;
	_g_free0 (rescale);
	_g_free0 (_tmp27_);
	_g_free0 (encode_suffix);
	_g_free0 (_tmp22_);
	_g_free0 (encode_args);
	_g_free0 (_tmp17_);
	_g_free0 (encode_prefix);
	_g_free0 (_tmp12_);
	_g_free0 (encode);
	_g_free0 (_tmp7_);
	_g_free0 (base_name);
	_g_free0 (_tmp0_);
	return result;
}

GstElement*
dino_plugins_rtp_codec_util_get_encode_bin (DinoPluginsRtpCodecUtil* self,
                                            const gchar* media,
                                            XmppXepJingleRtpPayloadType* payload_type,
                                            const gchar* name)
{
	gchar* codec = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* base_name = NULL;
	gchar* _tmp8_;
	gchar* desc = NULL;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	GstElement* bin = NULL;
	const gchar* _tmp15_;
	GstElement* _tmp16_;
	GstElement* _tmp17_;
	GError* _inner_error0_ = NULL;
	GstElement* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (payload_type != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_codec_util_get_codec_from_payload (media, payload_type);
	codec = _tmp0_;
	_tmp2_ = g_strdup (name);
	_tmp1_ = _tmp2_;
	if (_tmp1_ == NULL) {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp3_ = codec;
		_tmp4_ = string_to_string (_tmp3_);
		_tmp5_ = g_strdup_printf ("%u", g_random_int ());
		_tmp6_ = _tmp5_;
		_tmp7_ = g_strconcat ("encode_", _tmp4_, "_", _tmp6_, NULL);
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp7_;
		_g_free0 (_tmp6_);
	}
	_tmp8_ = _tmp1_;
	_tmp1_ = NULL;
	base_name = _tmp8_;
	_tmp9_ = codec;
	_tmp10_ = base_name;
	_tmp11_ = dino_plugins_rtp_codec_util_get_encode_bin_description (self, media, _tmp9_, payload_type, NULL, _tmp10_);
	desc = _tmp11_;
	_tmp12_ = desc;
	if (_tmp12_ == NULL) {
		result = NULL;
		_g_free0 (desc);
		_g_free0 (base_name);
		_g_free0 (_tmp1_);
		_g_free0 (codec);
		return result;
	}
	_tmp13_ = codec;
	_tmp14_ = desc;
	g_debug ("codec_util.vala:392: Pipeline to encode %s %s: %s", media, _tmp13_, _tmp14_);
	_tmp15_ = desc;
	_tmp16_ = gst_parse_bin_from_description_full (_tmp15_, TRUE, NULL, GST_PARSE_FLAG_NONE, &_inner_error0_);
	if (_tmp16_ != NULL) {
		g_object_ref_sink (_tmp16_);
	}
	bin = _tmp16_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (desc);
		_g_free0 (base_name);
		_g_free0 (_tmp1_);
		_g_free0 (codec);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp17_ = bin;
	gst_object_set_name ((GstObject*) _tmp17_, name);
	result = bin;
	_g_free0 (desc);
	_g_free0 (base_name);
	_g_free0 (_tmp1_);
	_g_free0 (codec);
	return result;
}

GstElement*
dino_plugins_rtp_codec_util_get_encode_bin_without_payloader (DinoPluginsRtpCodecUtil* self,
                                                              const gchar* media,
                                                              XmppXepJingleRtpPayloadType* payload_type,
                                                              const gchar* name)
{
	gchar* codec = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* base_name = NULL;
	gchar* _tmp8_;
	gchar* desc = NULL;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	GstElement* bin = NULL;
	const gchar* _tmp15_;
	GstElement* _tmp16_;
	GstElement* _tmp17_;
	GError* _inner_error0_ = NULL;
	GstElement* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (payload_type != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_codec_util_get_codec_from_payload (media, payload_type);
	codec = _tmp0_;
	_tmp2_ = g_strdup (name);
	_tmp1_ = _tmp2_;
	if (_tmp1_ == NULL) {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp3_ = codec;
		_tmp4_ = string_to_string (_tmp3_);
		_tmp5_ = g_strdup_printf ("%u", g_random_int ());
		_tmp6_ = _tmp5_;
		_tmp7_ = g_strconcat ("encode_", _tmp4_, "_", _tmp6_, NULL);
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp7_;
		_g_free0 (_tmp6_);
	}
	_tmp8_ = _tmp1_;
	_tmp1_ = NULL;
	base_name = _tmp8_;
	_tmp9_ = codec;
	_tmp10_ = base_name;
	_tmp11_ = dino_plugins_rtp_codec_util_get_encode_bin_without_payloader_description (self, media, _tmp9_, payload_type, NULL, _tmp10_);
	desc = _tmp11_;
	_tmp12_ = desc;
	if (_tmp12_ == NULL) {
		result = NULL;
		_g_free0 (desc);
		_g_free0 (base_name);
		_g_free0 (_tmp1_);
		_g_free0 (codec);
		return result;
	}
	_tmp13_ = codec;
	_tmp14_ = desc;
	g_debug ("codec_util.vala:403: Pipeline to encode %s %s without payloader: %s", media, _tmp13_, _tmp14_);
	_tmp15_ = desc;
	_tmp16_ = gst_parse_bin_from_description_full (_tmp15_, TRUE, NULL, GST_PARSE_FLAG_NONE, &_inner_error0_);
	if (_tmp16_ != NULL) {
		g_object_ref_sink (_tmp16_);
	}
	bin = _tmp16_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (desc);
		_g_free0 (base_name);
		_g_free0 (_tmp1_);
		_g_free0 (codec);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp17_ = bin;
	gst_object_set_name ((GstObject*) _tmp17_, name);
	result = bin;
	_g_free0 (desc);
	_g_free0 (base_name);
	_g_free0 (_tmp1_);
	_g_free0 (codec);
	return result;
}

GstElement*
dino_plugins_rtp_codec_util_get_payloader_bin (DinoPluginsRtpCodecUtil* self,
                                               const gchar* media,
                                               XmppXepJingleRtpPayloadType* payload_type,
                                               const gchar* name)
{
	gchar* codec = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* base_name = NULL;
	gchar* _tmp8_;
	gchar* desc = NULL;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	GstElement* bin = NULL;
	const gchar* _tmp15_;
	GstElement* _tmp16_;
	GstElement* _tmp17_;
	GError* _inner_error0_ = NULL;
	GstElement* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (payload_type != NULL, NULL);
	_tmp0_ = dino_plugins_rtp_codec_util_get_codec_from_payload (media, payload_type);
	codec = _tmp0_;
	_tmp2_ = g_strdup (name);
	_tmp1_ = _tmp2_;
	if (_tmp1_ == NULL) {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp3_ = codec;
		_tmp4_ = string_to_string (_tmp3_);
		_tmp5_ = g_strdup_printf ("%u", g_random_int ());
		_tmp6_ = _tmp5_;
		_tmp7_ = g_strconcat ("encode_", _tmp4_, "_", _tmp6_, NULL);
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp7_;
		_g_free0 (_tmp6_);
	}
	_tmp8_ = _tmp1_;
	_tmp1_ = NULL;
	base_name = _tmp8_;
	_tmp9_ = codec;
	_tmp10_ = base_name;
	_tmp11_ = dino_plugins_rtp_codec_util_get_payloader_bin_description (self, media, _tmp9_, payload_type, _tmp10_);
	desc = _tmp11_;
	_tmp12_ = desc;
	if (_tmp12_ == NULL) {
		result = NULL;
		_g_free0 (desc);
		_g_free0 (base_name);
		_g_free0 (_tmp1_);
		_g_free0 (codec);
		return result;
	}
	_tmp13_ = codec;
	_tmp14_ = desc;
	g_debug ("codec_util.vala:414: Pipeline to payload %s %s: %s", media, _tmp13_, _tmp14_);
	_tmp15_ = desc;
	_tmp16_ = gst_parse_bin_from_description_full (_tmp15_, TRUE, NULL, GST_PARSE_FLAG_NONE, &_inner_error0_);
	if (_tmp16_ != NULL) {
		g_object_ref_sink (_tmp16_);
	}
	bin = _tmp16_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (desc);
		_g_free0 (base_name);
		_g_free0 (_tmp1_);
		_g_free0 (codec);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp17_ = bin;
	gst_object_set_name ((GstObject*) _tmp17_, name);
	result = bin;
	_g_free0 (desc);
	_g_free0 (base_name);
	_g_free0 (_tmp1_);
	_g_free0 (codec);
	return result;
}

DinoPluginsRtpCodecUtil*
dino_plugins_rtp_codec_util_construct (GType object_type)
{
	DinoPluginsRtpCodecUtil* self = NULL;
	self = (DinoPluginsRtpCodecUtil*) g_type_create_instance (object_type);
	return self;
}

DinoPluginsRtpCodecUtil*
dino_plugins_rtp_codec_util_new (void)
{
	return dino_plugins_rtp_codec_util_construct (DINO_PLUGINS_RTP_TYPE_CODEC_UTIL);
}

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

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

static void
dino_plugins_rtp_value_codec_util_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_codec_util_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

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

static gchar*
dino_plugins_rtp_value_codec_util_collect_value (GValue* value,
                                                 guint n_collect_values,
                                                 GTypeCValue* collect_values,
                                                 guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		DinoPluginsRtpCodecUtil * 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_codec_util_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
dino_plugins_rtp_value_codec_util_lcopy_value (const GValue* value,
                                               guint n_collect_values,
                                               GTypeCValue* collect_values,
                                               guint collect_flags)
{
	DinoPluginsRtpCodecUtil ** 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_codec_util_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
dino_plugins_rtp_param_spec_codec_util (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags)
{
	DinoPluginsRtpParamSpecCodecUtil* spec;
	g_return_val_if_fail (g_type_is_a (object_type, DINO_PLUGINS_RTP_TYPE_CODEC_UTIL), 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);
}

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

void
dino_plugins_rtp_value_set_codec_util (GValue* value,
                                       gpointer v_object)
{
	DinoPluginsRtpCodecUtil * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_PLUGINS_RTP_TYPE_CODEC_UTIL));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_PLUGINS_RTP_TYPE_CODEC_UTIL));
		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_codec_util_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_plugins_rtp_codec_util_unref (old);
	}
}

void
dino_plugins_rtp_value_take_codec_util (GValue* value,
                                        gpointer v_object)
{
	DinoPluginsRtpCodecUtil * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_PLUGINS_RTP_TYPE_CODEC_UTIL));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_PLUGINS_RTP_TYPE_CODEC_UTIL));
		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_codec_util_unref (old);
	}
}

static void
dino_plugins_rtp_codec_util_class_init (DinoPluginsRtpCodecUtilClass * klass,
                                        gpointer klass_data)
{
	dino_plugins_rtp_codec_util_parent_class = g_type_class_peek_parent (klass);
	((DinoPluginsRtpCodecUtilClass *) klass)->finalize = dino_plugins_rtp_codec_util_finalize;
	g_type_class_adjust_private_offset (klass, &DinoPluginsRtpCodecUtil_private_offset);
}

static void
dino_plugins_rtp_codec_util_instance_init (DinoPluginsRtpCodecUtil * self,
                                           gpointer klass)
{
	GeeHashSet* _tmp0_;
	GeeHashSet* _tmp1_;
	self->priv = dino_plugins_rtp_codec_util_get_instance_private (self);
	_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->supported_elements = (GeeSet*) _tmp0_;
	_tmp1_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->unsupported_elements = (GeeSet*) _tmp1_;
	self->ref_count = 1;
}

static void
dino_plugins_rtp_codec_util_finalize (DinoPluginsRtpCodecUtil * obj)
{
	DinoPluginsRtpCodecUtil * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_RTP_TYPE_CODEC_UTIL, DinoPluginsRtpCodecUtil);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->supported_elements);
	_g_object_unref0 (self->priv->unsupported_elements);
}

static GType
dino_plugins_rtp_codec_util_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { dino_plugins_rtp_value_codec_util_init, dino_plugins_rtp_value_codec_util_free_value, dino_plugins_rtp_value_codec_util_copy_value, dino_plugins_rtp_value_codec_util_peek_pointer, "p", dino_plugins_rtp_value_codec_util_collect_value, "p", dino_plugins_rtp_value_codec_util_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsRtpCodecUtilClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_rtp_codec_util_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsRtpCodecUtil), 0, (GInstanceInitFunc) dino_plugins_rtp_codec_util_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_codec_util_type_id;
	dino_plugins_rtp_codec_util_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DinoPluginsRtpCodecUtil", &g_define_type_info, &g_define_type_fundamental_info, 0);
	DinoPluginsRtpCodecUtil_private_offset = g_type_add_instance_private (dino_plugins_rtp_codec_util_type_id, sizeof (DinoPluginsRtpCodecUtilPrivate));
	return dino_plugins_rtp_codec_util_type_id;
}

GType
dino_plugins_rtp_codec_util_get_type (void)
{
	static volatile gsize dino_plugins_rtp_codec_util_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_rtp_codec_util_type_id__once)) {
		GType dino_plugins_rtp_codec_util_type_id;
		dino_plugins_rtp_codec_util_type_id = dino_plugins_rtp_codec_util_get_type_once ();
		g_once_init_leave (&dino_plugins_rtp_codec_util_type_id__once, dino_plugins_rtp_codec_util_type_id);
	}
	return dino_plugins_rtp_codec_util_type_id__once;
}

gpointer
dino_plugins_rtp_codec_util_ref (gpointer instance)
{
	DinoPluginsRtpCodecUtil * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
dino_plugins_rtp_codec_util_unref (gpointer instance)
{
	DinoPluginsRtpCodecUtil * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		DINO_PLUGINS_RTP_CODEC_UTIL_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

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

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

