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

#include "xmpp-vala.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <glib-object.h>
#include <gio/gio.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

enum  {
	XMPP_XEP_JINGLE_RTP_PARAMETERS_0_PROPERTY,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_MEDIA_PROPERTY,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_SSRC_PROPERTY,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_RTCP_MUX_PROPERTY,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_BANDWIDTH_PROPERTY,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_BANDWIDTH_TYPE_PROPERTY,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_ENCRYPTION_REQUIRED_PROPERTY,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_AGREED_PAYLOAD_TYPE_PROPERTY,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_RTP_READY_PROPERTY,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_RTCP_READY_PROPERTY,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_STREAM_PROPERTY,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _xmpp_xep_jingle_rtp_payload_type_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_jingle_rtp_payload_type_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_xep_jingle_rtp_crypto_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_jingle_rtp_crypto_unref (var), NULL)))
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
#define _xmpp_xep_jingle_rtp_header_extension_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_jingle_rtp_header_extension_unref (var), NULL)))
typedef struct _XmppXepJingleRtpParametersHandleProposedContentData XmppXepJingleRtpParametersHandleProposedContentData;
typedef struct _Block10Data Block10Data;
enum  {
	XMPP_XEP_JINGLE_RTP_PARAMETERS_STREAM_CREATED_SIGNAL,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_CONNECTION_READY_SIGNAL,
	XMPP_XEP_JINGLE_RTP_PARAMETERS_NUM_SIGNALS
};
static guint xmpp_xep_jingle_rtp_parameters_signals[XMPP_XEP_JINGLE_RTP_PARAMETERS_NUM_SIGNALS] = {0};
typedef struct _XmppXepJingleRtpParamSpecHeaderExtension XmppXepJingleRtpParamSpecHeaderExtension;

struct _XmppXepJingleRtpParametersPrivate {
	gchar* _media;
	gchar* _ssrc;
	gboolean _rtcp_mux;
	gchar* _bandwidth;
	gchar* _bandwidth_type;
	gboolean _encryption_required;
	XmppXepJingleRtpPayloadType* _agreed_payload_type;
	gboolean _rtp_ready;
	gboolean _rtcp_ready;
	XmppXepJingleRtpStream* _stream;
	XmppXepJingleRtpModule* parent;
};

struct _XmppXepJingleRtpParametersHandleProposedContentData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	XmppXepJingleRtpParameters* self;
	XmppXmppStream* stream;
	XmppXepJingleSession* session;
	XmppXepJingleContent* content;
	XmppXepJingleRtpModule* _tmp0_;
	const gchar* _tmp1_;
	GeeList* _tmp2_;
	XmppXepJingleRtpPayloadType* _tmp3_;
	XmppXepJingleRtpPayloadType* _tmp4_;
	XmppXepJingleRtpPayloadType* _tmp5_;
	GeeIterator* iter;
	GeeList* _tmp6_;
	GeeIterator* _tmp7_;
	GeeIterator* _tmp8_;
	XmppXepJingleRtpModule* _tmp9_;
	const gchar* _tmp10_;
	GeeIterator* _tmp11_;
	gpointer _tmp12_;
	XmppXepJingleRtpHeaderExtension* _tmp13_;
	gboolean _tmp14_;
	GeeIterator* _tmp15_;
	XmppXepJingleRtpModule* _tmp16_;
	GeeList* _tmp17_;
	XmppXepJingleRtpCrypto* _tmp18_;
	gboolean _tmp19_;
	XmppXepJingleRtpCrypto* _tmp20_;
	XmppXepJingleRtpCrypto* _tmp21_;
	XmppXepJingleRtpModule* _tmp22_;
	XmppXepJingleRtpCrypto* _tmp23_;
	XmppXepJingleRtpCrypto* _tmp24_;
	gboolean _tmp25_;
	gboolean _tmp26_;
	XmppXepJingleRtpCrypto* _tmp27_;
	XmppXepJingleRtpCrypto* _tmp28_;
	gboolean _tmp29_;
};

struct _Block10Data {
	int _ref_count_;
	XmppXepJingleRtpParameters* self;
	XmppXepJingleDatagramConnection* rtp_datagram;
	XmppXepJingleDatagramConnection* rtcp_datagram;
	gulong rtcp_ready_handler_id;
	gulong rtp_ready_handler_id;
	gulong session_state_handler_id;
};

struct _XmppXepJingleRtpHeaderExtensionPrivate {
	guint8 _id;
	gchar* _uri;
};

struct _XmppXepJingleRtpParamSpecHeaderExtension {
	GParamSpec parent_instance;
};

static gint XmppXepJingleRtpParameters_private_offset;
static gpointer xmpp_xep_jingle_rtp_parameters_parent_class = NULL;
static XmppXepJingleContentParametersIface * xmpp_xep_jingle_rtp_parameters_xmpp_xep_jingle_content_parameters_parent_iface = NULL;
static gint XmppXepJingleRtpHeaderExtension_private_offset;
static gpointer xmpp_xep_jingle_rtp_header_extension_parent_class = NULL;

static gboolean _xmpp_xep_jingle_rtp_payload_type_equals_func_gee_equal_data_func (gconstpointer a,
                                                                            gconstpointer b,
                                                                            gpointer self);
static void xmpp_xep_jingle_rtp_parameters_set_media (XmppXepJingleRtpParameters* self,
                                               const gchar* value);
static void xmpp_xep_jingle_rtp_parameters_set_ssrc (XmppXepJingleRtpParameters* self,
                                              const gchar* value);
static void xmpp_xep_jingle_rtp_parameters_set_rtcp_mux (XmppXepJingleRtpParameters* self,
                                                  gboolean value);
static void xmpp_xep_jingle_rtp_parameters_set_bandwidth (XmppXepJingleRtpParameters* self,
                                                   const gchar* value);
static void xmpp_xep_jingle_rtp_parameters_set_bandwidth_type (XmppXepJingleRtpParameters* self,
                                                        const gchar* value);
static void xmpp_xep_jingle_rtp_parameters_set_encryption_required (XmppXepJingleRtpParameters* self,
                                                             gboolean value);
static void xmpp_xep_jingle_rtp_parameters_real_handle_proposed_content_data_free (gpointer _data);
static void xmpp_xep_jingle_rtp_parameters_real_handle_proposed_content (XmppXepJingleContentParameters* base,
                                                                  XmppXmppStream* stream,
                                                                  XmppXepJingleSession* session,
                                                                  XmppXepJingleContent* content,
                                                                  GAsyncReadyCallback _callback_,
                                                                  gpointer _user_data_);
static gboolean xmpp_xep_jingle_rtp_parameters_real_handle_proposed_content_co (XmppXepJingleRtpParametersHandleProposedContentData* _data_);
static void xmpp_xep_jingle_rtp_parameters_handle_proposed_content_ready (GObject* source_object,
                                                                   GAsyncResult* _res_,
                                                                   gpointer _user_data_);
static void xmpp_xep_jingle_rtp_parameters_set_agreed_payload_type (XmppXepJingleRtpParameters* self,
                                                             XmppXepJingleRtpPayloadType* value);
static void xmpp_xep_jingle_rtp_parameters_real_accept (XmppXepJingleContentParameters* base,
                                                 XmppXmppStream* stream,
                                                 XmppXepJingleSession* session,
                                                 XmppXepJingleContent* content);
static Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (void * _userdata_);
static void __lambda21_ (Block10Data* _data10_,
                  GObject* rtcp_datagram,
                  GParamSpec* _);
static void xmpp_xep_jingle_rtp_parameters_set_rtcp_ready (XmppXepJingleRtpParameters* self,
                                                    gboolean value);
static void ___lambda21__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void __lambda22_ (Block10Data* _data10_,
                  GObject* rtp_datagram,
                  GParamSpec* _);
static void xmpp_xep_jingle_rtp_parameters_set_rtp_ready (XmppXepJingleRtpParameters* self,
                                                   gboolean value);
static void ___lambda22__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void __lambda23_ (Block10Data* _data10_,
                  GObject* obj,
                  GParamSpec* _);
static void ___lambda23__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void xmpp_xep_jingle_rtp_parameters_set_stream (XmppXepJingleRtpParameters* self,
                                                XmppXepJingleRtpStream* value);
static void __lambda24_ (XmppXepJingleRtpParameters* self);
static void ___lambda24__gweak_notify (gpointer self,
                                GObject* object);
static void _xmpp_xep_jingle_rtp_stream_on_recv_rtp_data_xmpp_xep_jingle_datagram_connection_datagram_received (XmppXepJingleDatagramConnection* _sender,
                                                                                                         GBytes* datagram,
                                                                                                         gpointer self);
static void _xmpp_xep_jingle_rtp_stream_on_recv_rtcp_data_xmpp_xep_jingle_datagram_connection_datagram_received (XmppXepJingleDatagramConnection* _sender,
                                                                                                          GBytes* datagram,
                                                                                                          gpointer self);
static void _xmpp_xep_jingle_datagram_connection_send_datagram_xmpp_xep_jingle_rtp_stream_on_send_rtp_data (XmppXepJingleRtpStream* _sender,
                                                                                                     GBytes* bytes,
                                                                                                     gpointer self);
static void _xmpp_xep_jingle_datagram_connection_send_datagram_xmpp_xep_jingle_rtp_stream_on_send_rtcp_data (XmppXepJingleRtpStream* _sender,
                                                                                                      GBytes* bytes,
                                                                                                      gpointer self);
static void xmpp_xep_jingle_rtp_parameters_real_handle_accept (XmppXepJingleContentParameters* base,
                                                        XmppXmppStream* stream,
                                                        XmppXepJingleSession* session,
                                                        XmppXepJingleContent* content,
                                                        XmppStanzaNode* description_node);
static void xmpp_xep_jingle_rtp_parameters_real_terminate (XmppXepJingleContentParameters* base,
                                                    gboolean we_terminated,
                                                    const gchar* reason_name,
                                                    const gchar* reason_text);
static XmppStanzaNode* xmpp_xep_jingle_rtp_parameters_real_get_description_node (XmppXepJingleContentParameters* base);
static void xmpp_xep_jingle_rtp_parameters_finalize (GObject * obj);
static GType xmpp_xep_jingle_rtp_parameters_get_type_once (void);
static void _vala_xmpp_xep_jingle_rtp_parameters_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_xmpp_xep_jingle_rtp_parameters_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);
static void xmpp_xep_jingle_rtp_header_extension_set_id (XmppXepJingleRtpHeaderExtension* self,
                                                  guint8 value);
static void xmpp_xep_jingle_rtp_header_extension_set_uri (XmppXepJingleRtpHeaderExtension* self,
                                                   const gchar* value);
static void xmpp_xep_jingle_rtp_header_extension_finalize (XmppXepJingleRtpHeaderExtension * obj);
static GType xmpp_xep_jingle_rtp_header_extension_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
xmpp_xep_jingle_rtp_parameters_get_instance_private (XmppXepJingleRtpParameters* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleRtpParameters_private_offset);
}

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

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

static gpointer
_xmpp_xep_jingle_rtp_crypto_ref0 (gpointer self)
{
	return self ? xmpp_xep_jingle_rtp_crypto_ref (self) : NULL;
}

XmppXepJingleRtpParameters*
xmpp_xep_jingle_rtp_parameters_construct (GType object_type,
                                          XmppXepJingleRtpModule* parent,
                                          const gchar* media,
                                          GeeList* payload_types,
                                          const gchar* ssrc,
                                          gboolean rtcp_mux,
                                          const gchar* bandwidth,
                                          const gchar* bandwidth_type,
                                          gboolean encryption_required,
                                          XmppXepJingleRtpCrypto* local_crypto)
{
	XmppXepJingleRtpParameters * self = NULL;
	XmppXepJingleRtpModule* _tmp0_;
	GeeList* _tmp1_;
	XmppXepJingleRtpCrypto* _tmp2_;
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (media != NULL, NULL);
	g_return_val_if_fail (payload_types != NULL, NULL);
	self = (XmppXepJingleRtpParameters*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (parent);
	_g_object_unref0 (self->priv->parent);
	self->priv->parent = _tmp0_;
	xmpp_xep_jingle_rtp_parameters_set_media (self, media);
	xmpp_xep_jingle_rtp_parameters_set_ssrc (self, ssrc);
	xmpp_xep_jingle_rtp_parameters_set_rtcp_mux (self, TRUE);
	xmpp_xep_jingle_rtp_parameters_set_bandwidth (self, bandwidth);
	xmpp_xep_jingle_rtp_parameters_set_bandwidth_type (self, bandwidth_type);
	xmpp_xep_jingle_rtp_parameters_set_encryption_required (self, encryption_required);
	_tmp1_ = _g_object_ref0 (payload_types);
	_g_object_unref0 (self->payload_types);
	self->payload_types = _tmp1_;
	_tmp2_ = _xmpp_xep_jingle_rtp_crypto_ref0 (local_crypto);
	_xmpp_xep_jingle_rtp_crypto_unref0 (self->local_crypto);
	self->local_crypto = _tmp2_;
	return self;
}

XmppXepJingleRtpParameters*
xmpp_xep_jingle_rtp_parameters_new (XmppXepJingleRtpModule* parent,
                                    const gchar* media,
                                    GeeList* payload_types,
                                    const gchar* ssrc,
                                    gboolean rtcp_mux,
                                    const gchar* bandwidth,
                                    const gchar* bandwidth_type,
                                    gboolean encryption_required,
                                    XmppXepJingleRtpCrypto* local_crypto)
{
	return xmpp_xep_jingle_rtp_parameters_construct (XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, parent, media, payload_types, ssrc, rtcp_mux, bandwidth, bandwidth_type, encryption_required, local_crypto);
}

XmppXepJingleRtpParameters*
xmpp_xep_jingle_rtp_parameters_construct_from_node (GType object_type,
                                                    XmppXepJingleRtpModule* parent,
                                                    XmppStanzaNode* node,
                                                    GError** error)
{
	XmppXepJingleRtpParameters * self = NULL;
	XmppXepJingleRtpModule* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* encryption = NULL;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (node != NULL, NULL);
	self = (XmppXepJingleRtpParameters*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (parent);
	_g_object_unref0 (self->priv->parent);
	self->priv->parent = _tmp0_;
	_tmp1_ = xmpp_stanza_node_get_attribute (node, "media", NULL);
	xmpp_xep_jingle_rtp_parameters_set_media (self, _tmp1_);
	_tmp2_ = xmpp_stanza_node_get_attribute (node, "ssrc", NULL);
	xmpp_xep_jingle_rtp_parameters_set_ssrc (self, _tmp2_);
	_tmp3_ = xmpp_stanza_node_get_subnode (node, "rtcp-mux", NULL, FALSE);
	_tmp4_ = _tmp3_;
	xmpp_xep_jingle_rtp_parameters_set_rtcp_mux (self, _tmp4_ != NULL);
	_xmpp_stanza_entry_unref0 (_tmp4_);
	_tmp5_ = xmpp_stanza_node_get_subnode (node, "encryption", NULL, FALSE);
	encryption = _tmp5_;
	_tmp6_ = encryption;
	if (_tmp6_ != NULL) {
		XmppStanzaNode* _tmp7_;
		gboolean _tmp8_;
		_tmp7_ = encryption;
		_tmp8_ = self->priv->_encryption_required;
		xmpp_xep_jingle_rtp_parameters_set_encryption_required (self, xmpp_stanza_node_get_attribute_bool (_tmp7_, "required", _tmp8_, NULL));
		{
			GeeList* _crypto_list = NULL;
			XmppStanzaNode* _tmp9_;
			GeeList* _tmp10_;
			gint _crypto_size = 0;
			GeeList* _tmp11_;
			gint _tmp12_;
			gint _tmp13_;
			gint _crypto_index = 0;
			_tmp9_ = encryption;
			_tmp10_ = xmpp_stanza_node_get_subnodes (_tmp9_, "crypto", NULL, FALSE);
			_crypto_list = _tmp10_;
			_tmp11_ = _crypto_list;
			_tmp12_ = gee_collection_get_size ((GeeCollection*) _tmp11_);
			_tmp13_ = _tmp12_;
			_crypto_size = _tmp13_;
			_crypto_index = -1;
			while (TRUE) {
				gint _tmp14_;
				gint _tmp15_;
				XmppStanzaNode* crypto = NULL;
				GeeList* _tmp16_;
				gpointer _tmp17_;
				GeeList* _tmp18_;
				XmppStanzaNode* _tmp19_;
				XmppXepJingleRtpCrypto* _tmp20_;
				XmppXepJingleRtpCrypto* _tmp21_;
				_crypto_index = _crypto_index + 1;
				_tmp14_ = _crypto_index;
				_tmp15_ = _crypto_size;
				if (!(_tmp14_ < _tmp15_)) {
					break;
				}
				_tmp16_ = _crypto_list;
				_tmp17_ = gee_list_get (_tmp16_, _crypto_index);
				crypto = (XmppStanzaNode*) _tmp17_;
				_tmp18_ = self->remote_cryptos;
				_tmp19_ = crypto;
				_tmp20_ = xmpp_xep_jingle_rtp_crypto_parse (_tmp19_);
				_tmp21_ = _tmp20_;
				gee_collection_add ((GeeCollection*) _tmp18_, _tmp21_);
				_xmpp_xep_jingle_rtp_crypto_unref0 (_tmp21_);
				_xmpp_stanza_entry_unref0 (crypto);
			}
			_g_object_unref0 (_crypto_list);
		}
	}
	{
		GeeList* _payloadType_list = NULL;
		GeeList* _tmp22_;
		gint _payloadType_size = 0;
		GeeList* _tmp23_;
		gint _tmp24_;
		gint _tmp25_;
		gint _payloadType_index = 0;
		_tmp22_ = xmpp_stanza_node_get_subnodes (node, XMPP_XEP_JINGLE_RTP_PAYLOAD_TYPE_NAME, NULL, FALSE);
		_payloadType_list = _tmp22_;
		_tmp23_ = _payloadType_list;
		_tmp24_ = gee_collection_get_size ((GeeCollection*) _tmp23_);
		_tmp25_ = _tmp24_;
		_payloadType_size = _tmp25_;
		_payloadType_index = -1;
		while (TRUE) {
			gint _tmp26_;
			gint _tmp27_;
			XmppStanzaNode* payloadType = NULL;
			GeeList* _tmp28_;
			gpointer _tmp29_;
			GeeList* _tmp30_;
			XmppStanzaNode* _tmp31_;
			XmppXepJingleRtpPayloadType* _tmp32_;
			XmppXepJingleRtpPayloadType* _tmp33_;
			_payloadType_index = _payloadType_index + 1;
			_tmp26_ = _payloadType_index;
			_tmp27_ = _payloadType_size;
			if (!(_tmp26_ < _tmp27_)) {
				break;
			}
			_tmp28_ = _payloadType_list;
			_tmp29_ = gee_list_get (_tmp28_, _payloadType_index);
			payloadType = (XmppStanzaNode*) _tmp29_;
			_tmp30_ = self->payload_types;
			_tmp31_ = payloadType;
			_tmp32_ = xmpp_xep_jingle_rtp_payload_type_parse (_tmp31_);
			_tmp33_ = _tmp32_;
			gee_collection_add ((GeeCollection*) _tmp30_, _tmp33_);
			_xmpp_xep_jingle_rtp_payload_type_unref0 (_tmp33_);
			_xmpp_stanza_entry_unref0 (payloadType);
		}
		_g_object_unref0 (_payloadType_list);
	}
	{
		GeeList* _subnode_list = NULL;
		GeeList* _tmp34_;
		gint _subnode_size = 0;
		GeeList* _tmp35_;
		gint _tmp36_;
		gint _tmp37_;
		gint _subnode_index = 0;
		_tmp34_ = xmpp_stanza_node_get_subnodes (node, XMPP_XEP_JINGLE_RTP_HEADER_EXTENSION_NAME, XMPP_XEP_JINGLE_RTP_HEADER_EXTENSION_NS_URI, FALSE);
		_subnode_list = _tmp34_;
		_tmp35_ = _subnode_list;
		_tmp36_ = gee_collection_get_size ((GeeCollection*) _tmp35_);
		_tmp37_ = _tmp36_;
		_subnode_size = _tmp37_;
		_subnode_index = -1;
		while (TRUE) {
			gint _tmp38_;
			gint _tmp39_;
			XmppStanzaNode* subnode = NULL;
			GeeList* _tmp40_;
			gpointer _tmp41_;
			GeeList* _tmp42_;
			XmppStanzaNode* _tmp43_;
			XmppXepJingleRtpHeaderExtension* _tmp44_;
			XmppXepJingleRtpHeaderExtension* _tmp45_;
			_subnode_index = _subnode_index + 1;
			_tmp38_ = _subnode_index;
			_tmp39_ = _subnode_size;
			if (!(_tmp38_ < _tmp39_)) {
				break;
			}
			_tmp40_ = _subnode_list;
			_tmp41_ = gee_list_get (_tmp40_, _subnode_index);
			subnode = (XmppStanzaNode*) _tmp41_;
			_tmp42_ = self->header_extensions;
			_tmp43_ = subnode;
			_tmp44_ = xmpp_xep_jingle_rtp_header_extension_parse (_tmp43_);
			_tmp45_ = _tmp44_;
			gee_collection_add ((GeeCollection*) _tmp42_, _tmp45_);
			_xmpp_xep_jingle_rtp_header_extension_unref0 (_tmp45_);
			_xmpp_stanza_entry_unref0 (subnode);
		}
		_g_object_unref0 (_subnode_list);
	}
	_xmpp_stanza_entry_unref0 (encryption);
	return self;
}

XmppXepJingleRtpParameters*
xmpp_xep_jingle_rtp_parameters_new_from_node (XmppXepJingleRtpModule* parent,
                                              XmppStanzaNode* node,
                                              GError** error)
{
	return xmpp_xep_jingle_rtp_parameters_construct_from_node (XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, parent, node, error);
}

static void
xmpp_xep_jingle_rtp_parameters_real_handle_proposed_content_data_free (gpointer _data)
{
	XmppXepJingleRtpParametersHandleProposedContentData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->stream);
	_g_object_unref0 (_data_->session);
	_g_object_unref0 (_data_->content);
	_g_object_unref0 (_data_->self);
	g_slice_free (XmppXepJingleRtpParametersHandleProposedContentData, _data_);
}

static void
xmpp_xep_jingle_rtp_parameters_real_handle_proposed_content (XmppXepJingleContentParameters* base,
                                                             XmppXmppStream* stream,
                                                             XmppXepJingleSession* session,
                                                             XmppXepJingleContent* content,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_)
{
	XmppXepJingleRtpParameters * self;
	XmppXepJingleRtpParametersHandleProposedContentData* _data_;
	XmppXepJingleRtpParameters* _tmp0_;
	XmppXmppStream* _tmp1_;
	XmppXepJingleSession* _tmp2_;
	XmppXepJingleContent* _tmp3_;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (session != NULL);
	g_return_if_fail (content != NULL);
	self = (XmppXepJingleRtpParameters*) base;
	_data_ = g_slice_new0 (XmppXepJingleRtpParametersHandleProposedContentData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, xmpp_xep_jingle_rtp_parameters_real_handle_proposed_content_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (stream);
	_g_object_unref0 (_data_->stream);
	_data_->stream = _tmp1_;
	_tmp2_ = _g_object_ref0 (session);
	_g_object_unref0 (_data_->session);
	_data_->session = _tmp2_;
	_tmp3_ = _g_object_ref0 (content);
	_g_object_unref0 (_data_->content);
	_data_->content = _tmp3_;
	xmpp_xep_jingle_rtp_parameters_real_handle_proposed_content_co (_data_);
}

static void
xmpp_xep_jingle_rtp_parameters_handle_proposed_content_finish (XmppXepJingleContentParameters* base,
                                                               GAsyncResult* _res_)
{
	XmppXepJingleRtpParametersHandleProposedContentData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
xmpp_xep_jingle_rtp_parameters_handle_proposed_content_ready (GObject* source_object,
                                                              GAsyncResult* _res_,
                                                              gpointer _user_data_)
{
	XmppXepJingleRtpParametersHandleProposedContentData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	xmpp_xep_jingle_rtp_parameters_real_handle_proposed_content_co (_data_);
}

static gboolean
xmpp_xep_jingle_rtp_parameters_real_handle_proposed_content_co (XmppXepJingleRtpParametersHandleProposedContentData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->parent;
	_data_->_tmp1_ = _data_->self->priv->_media;
	_data_->_tmp2_ = _data_->self->payload_types;
	_data_->_state_ = 1;
	xmpp_xep_jingle_rtp_module_pick_payload_type (_data_->_tmp0_, _data_->_tmp1_, _data_->_tmp2_, xmpp_xep_jingle_rtp_parameters_handle_proposed_content_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp3_ = xmpp_xep_jingle_rtp_module_pick_payload_type_finish (_data_->_tmp0_, _data_->_res_);
	_data_->_tmp4_ = _data_->_tmp3_;
	xmpp_xep_jingle_rtp_parameters_set_agreed_payload_type (_data_->self, _data_->_tmp4_);
	_xmpp_xep_jingle_rtp_payload_type_unref0 (_data_->_tmp4_);
	_data_->_tmp5_ = _data_->self->priv->_agreed_payload_type;
	if (_data_->_tmp5_ == NULL) {
		g_debug ("content_parameters.vala:72: no usable payload type");
		xmpp_xep_jingle_content_reject (_data_->content);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _data_->self->header_extensions;
	_data_->_tmp7_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp6_);
	_data_->iter = _data_->_tmp7_;
	while (TRUE) {
		_data_->_tmp8_ = _data_->iter;
		if (!gee_iterator_next (_data_->_tmp8_)) {
			break;
		}
		_data_->_tmp9_ = _data_->self->priv->parent;
		_data_->_tmp10_ = _data_->self->priv->_media;
		_data_->_tmp11_ = _data_->iter;
		_data_->_tmp12_ = gee_iterator_get (_data_->_tmp11_);
		_data_->_tmp13_ = (XmppXepJingleRtpHeaderExtension*) _data_->_tmp12_;
		_data_->_tmp14_ = !xmpp_xep_jingle_rtp_module_is_header_extension_supported (_data_->_tmp9_, _data_->_tmp10_, _data_->_tmp13_);
		_xmpp_xep_jingle_rtp_header_extension_unref0 (_data_->_tmp13_);
		if (_data_->_tmp14_) {
			_data_->_tmp15_ = _data_->iter;
			gee_iterator_remove (_data_->_tmp15_);
		}
	}
	_data_->_tmp16_ = _data_->self->priv->parent;
	_data_->_tmp17_ = _data_->self->remote_cryptos;
	_data_->_tmp18_ = xmpp_xep_jingle_rtp_module_pick_remote_crypto (_data_->_tmp16_, _data_->_tmp17_);
	_xmpp_xep_jingle_rtp_crypto_unref0 (_data_->self->remote_crypto);
	_data_->self->remote_crypto = _data_->_tmp18_;
	_data_->_tmp20_ = _data_->self->local_crypto;
	if (_data_->_tmp20_ == NULL) {
		_data_->_tmp21_ = _data_->self->remote_crypto;
		_data_->_tmp19_ = _data_->_tmp21_ != NULL;
	} else {
		_data_->_tmp19_ = FALSE;
	}
	if (_data_->_tmp19_) {
		_data_->_tmp22_ = _data_->self->priv->parent;
		_data_->_tmp23_ = _data_->self->remote_crypto;
		_data_->_tmp24_ = xmpp_xep_jingle_rtp_module_pick_local_crypto (_data_->_tmp22_, _data_->_tmp23_);
		_xmpp_xep_jingle_rtp_crypto_unref0 (_data_->self->local_crypto);
		_data_->self->local_crypto = _data_->_tmp24_;
	}
	_data_->_tmp27_ = _data_->self->local_crypto;
	if (_data_->_tmp27_ == NULL) {
		_data_->_tmp26_ = TRUE;
	} else {
		_data_->_tmp28_ = _data_->self->remote_crypto;
		_data_->_tmp26_ = _data_->_tmp28_ == NULL;
	}
	if (_data_->_tmp26_) {
		_data_->_tmp29_ = _data_->self->priv->_encryption_required;
		_data_->_tmp25_ = _data_->_tmp29_;
	} else {
		_data_->_tmp25_ = FALSE;
	}
	if (_data_->_tmp25_) {
		g_debug ("content_parameters.vala:86: no usable encryption, but encryption requi" \
"red");
		xmpp_xep_jingle_content_reject (_data_->content);
		_g_object_unref0 (_data_->iter);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_object_unref0 (_data_->iter);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static Block10Data*
block10_data_ref (Block10Data* _data10_)
{
	g_atomic_int_inc (&_data10_->_ref_count_);
	return _data10_;
}

static void
block10_data_unref (void * _userdata_)
{
	Block10Data* _data10_;
	_data10_ = (Block10Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data10_->_ref_count_)) {
		XmppXepJingleRtpParameters* self;
		self = _data10_->self;
		_g_object_unref0 (_data10_->rtcp_datagram);
		_g_object_unref0 (_data10_->rtp_datagram);
		_g_object_unref0 (self);
		g_slice_free (Block10Data, _data10_);
	}
}

static void
__lambda21_ (Block10Data* _data10_,
             GObject* rtcp_datagram,
             GParamSpec* _)
{
	XmppXepJingleRtpParameters* self;
	XmppXepJingleRtpStream* _tmp0_;
	self = _data10_->self;
	g_return_if_fail (rtcp_datagram != NULL);
	g_return_if_fail (_ != NULL);
	_tmp0_ = self->priv->_stream;
	xmpp_xep_jingle_rtp_stream_on_rtcp_ready (_tmp0_);
	xmpp_xep_jingle_rtp_parameters_set_rtcp_ready (self, TRUE);
	g_signal_handler_disconnect ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (rtcp_datagram, XMPP_XEP_JINGLE_TYPE_DATAGRAM_CONNECTION, XmppXepJingleDatagramConnection), _data10_->rtcp_ready_handler_id);
	_data10_->rtcp_ready_handler_id = (gulong) 0;
}

static void
___lambda21__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda21_ (self, _sender, pspec);
}

static void
__lambda22_ (Block10Data* _data10_,
             GObject* rtp_datagram,
             GParamSpec* _)
{
	XmppXepJingleRtpParameters* self;
	XmppXepJingleRtpStream* _tmp0_;
	gboolean _tmp1_;
	self = _data10_->self;
	g_return_if_fail (rtp_datagram != NULL);
	g_return_if_fail (_ != NULL);
	_tmp0_ = self->priv->_stream;
	xmpp_xep_jingle_rtp_stream_on_rtp_ready (_tmp0_);
	xmpp_xep_jingle_rtp_parameters_set_rtp_ready (self, TRUE);
	_tmp1_ = self->priv->_rtcp_mux;
	if (_tmp1_) {
		XmppXepJingleRtpStream* _tmp2_;
		_tmp2_ = self->priv->_stream;
		xmpp_xep_jingle_rtp_stream_on_rtcp_ready (_tmp2_);
		xmpp_xep_jingle_rtp_parameters_set_rtcp_ready (self, TRUE);
	}
	g_signal_emit (self, xmpp_xep_jingle_rtp_parameters_signals[XMPP_XEP_JINGLE_RTP_PARAMETERS_CONNECTION_READY_SIGNAL], 0);
	g_signal_handler_disconnect ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (rtp_datagram, XMPP_XEP_JINGLE_TYPE_DATAGRAM_CONNECTION, XmppXepJingleDatagramConnection), _data10_->rtp_ready_handler_id);
	_data10_->rtp_ready_handler_id = (gulong) 0;
}

static void
___lambda22__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda22_ (self, _sender, pspec);
}

static void
__lambda23_ (Block10Data* _data10_,
             GObject* obj,
             GParamSpec* _)
{
	XmppXepJingleRtpParameters* self;
	XmppXepJingleSession* session2 = NULL;
	XmppXepJingleSession* _tmp0_;
	XmppXepJingleSession* _tmp1_;
	XmppXepJingleSessionState _tmp2_;
	XmppXepJingleSessionState _tmp3_;
	self = _data10_->self;
	g_return_if_fail (obj != NULL);
	g_return_if_fail (_ != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_TYPE_SESSION, XmppXepJingleSession));
	session2 = _tmp0_;
	_tmp1_ = session2;
	_tmp2_ = xmpp_xep_jingle_session_get_state (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == XMPP_XEP_JINGLE_SESSION_STATE_ENDED) {
		if (_data10_->rtcp_ready_handler_id != ((gulong) 0)) {
			XmppXepJingleDatagramConnection* _tmp4_;
			_tmp4_ = _data10_->rtcp_datagram;
			g_signal_handler_disconnect ((GObject*) _tmp4_, _data10_->rtcp_ready_handler_id);
		}
		if (_data10_->rtp_ready_handler_id != ((gulong) 0)) {
			XmppXepJingleDatagramConnection* _tmp5_;
			_tmp5_ = _data10_->rtp_datagram;
			g_signal_handler_disconnect ((GObject*) _tmp5_, _data10_->rtp_ready_handler_id);
		}
		if (_data10_->session_state_handler_id != ((gulong) 0)) {
			XmppXepJingleSession* _tmp6_;
			_tmp6_ = session2;
			g_signal_handler_disconnect ((GObject*) _tmp6_, _data10_->session_state_handler_id);
		}
	}
	_g_object_unref0 (session2);
}

static void
___lambda23__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda23_ (self, _sender, pspec);
}

static void
__lambda24_ (XmppXepJingleRtpParameters* self)
{
	xmpp_xep_jingle_rtp_parameters_set_stream (self, NULL);
}

static void
___lambda24__gweak_notify (gpointer self,
                           GObject* object)
{
	__lambda24_ ((XmppXepJingleRtpParameters*) self);
}

static void
_xmpp_xep_jingle_rtp_stream_on_recv_rtp_data_xmpp_xep_jingle_datagram_connection_datagram_received (XmppXepJingleDatagramConnection* _sender,
                                                                                                    GBytes* datagram,
                                                                                                    gpointer self)
{
	xmpp_xep_jingle_rtp_stream_on_recv_rtp_data ((XmppXepJingleRtpStream*) self, datagram);
}

static void
_xmpp_xep_jingle_rtp_stream_on_recv_rtcp_data_xmpp_xep_jingle_datagram_connection_datagram_received (XmppXepJingleDatagramConnection* _sender,
                                                                                                     GBytes* datagram,
                                                                                                     gpointer self)
{
	xmpp_xep_jingle_rtp_stream_on_recv_rtcp_data ((XmppXepJingleRtpStream*) self, datagram);
}

static void
_xmpp_xep_jingle_datagram_connection_send_datagram_xmpp_xep_jingle_rtp_stream_on_send_rtp_data (XmppXepJingleRtpStream* _sender,
                                                                                                GBytes* bytes,
                                                                                                gpointer self)
{
	xmpp_xep_jingle_datagram_connection_send_datagram ((XmppXepJingleDatagramConnection*) self, bytes);
}

static void
_xmpp_xep_jingle_datagram_connection_send_datagram_xmpp_xep_jingle_rtp_stream_on_send_rtcp_data (XmppXepJingleRtpStream* _sender,
                                                                                                 GBytes* bytes,
                                                                                                 gpointer self)
{
	xmpp_xep_jingle_datagram_connection_send_datagram ((XmppXepJingleDatagramConnection*) self, bytes);
}

static void
xmpp_xep_jingle_rtp_parameters_real_accept (XmppXepJingleContentParameters* base,
                                            XmppXmppStream* stream,
                                            XmppXepJingleSession* session,
                                            XmppXepJingleContent* content)
{
	XmppXepJingleRtpParameters * self;
	Block10Data* _data10_;
	XmppXepJingleComponentConnection* _tmp0_;
	XmppXepJingleComponentConnection* _tmp1_;
	XmppXepJingleDatagramConnection* _tmp2_;
	gulong _tmp3_;
	XmppXepJingleDatagramConnection* _tmp4_;
	gulong _tmp5_;
	gulong _tmp6_;
	gboolean _tmp7_ = FALSE;
	XmppXepJingleRtpCrypto* _tmp8_;
	gboolean _tmp11_ = FALSE;
	XmppXepJingleRtpCrypto* _tmp12_;
	XmppXepJingleRtpModule* _tmp30_;
	XmppXepJingleRtpStream* _tmp31_;
	XmppXepJingleRtpStream* _tmp32_;
	XmppXepJingleRtpStream* _tmp33_;
	XmppXepJingleDatagramConnection* _tmp34_;
	XmppXepJingleRtpStream* _tmp35_;
	XmppXepJingleDatagramConnection* _tmp36_;
	XmppXepJingleRtpStream* _tmp37_;
	XmppXepJingleRtpStream* _tmp38_;
	XmppXepJingleDatagramConnection* _tmp39_;
	XmppXepJingleRtpStream* _tmp40_;
	XmppXepJingleDatagramConnection* _tmp41_;
	XmppXepJingleRtpStream* _tmp42_;
	XmppXepJingleRtpStream* _tmp43_;
	self = (XmppXepJingleRtpParameters*) base;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (session != NULL);
	g_return_if_fail (content != NULL);
	_data10_ = g_slice_new0 (Block10Data);
	_data10_->_ref_count_ = 1;
	_data10_->self = g_object_ref (self);
	g_debug ("content_parameters.vala:93: [%p] Jingle RTP on_accept", stream);
	_tmp0_ = xmpp_xep_jingle_content_get_transport_connection (content, (guint8) 1);
	_data10_->rtp_datagram = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, XMPP_XEP_JINGLE_TYPE_DATAGRAM_CONNECTION, XmppXepJingleDatagramConnection);
	_tmp1_ = xmpp_xep_jingle_content_get_transport_connection (content, (guint8) 2);
	_data10_->rtcp_datagram = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, XMPP_XEP_JINGLE_TYPE_DATAGRAM_CONNECTION, XmppXepJingleDatagramConnection);
	_data10_->rtcp_ready_handler_id = (gulong) 0;
	_tmp2_ = _data10_->rtcp_datagram;
	_tmp3_ = g_signal_connect_data ((GObject*) _tmp2_, "notify::ready", (GCallback) ___lambda21__g_object_notify, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
	_data10_->rtcp_ready_handler_id = _tmp3_;
	_data10_->rtp_ready_handler_id = (gulong) 0;
	_tmp4_ = _data10_->rtp_datagram;
	_tmp5_ = g_signal_connect_data ((GObject*) _tmp4_, "notify::ready", (GCallback) ___lambda22__g_object_notify, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
	_data10_->rtp_ready_handler_id = _tmp5_;
	_data10_->session_state_handler_id = (gulong) 0;
	_tmp6_ = g_signal_connect_data ((GObject*) session, "notify::state", (GCallback) ___lambda23__g_object_notify, block10_data_ref (_data10_), (GClosureNotify) block10_data_unref, 0);
	_data10_->session_state_handler_id = _tmp6_;
	_tmp8_ = self->remote_crypto;
	if (_tmp8_ == NULL) {
		_tmp7_ = TRUE;
	} else {
		XmppXepJingleRtpCrypto* _tmp9_;
		_tmp9_ = self->local_crypto;
		_tmp7_ = _tmp9_ == NULL;
	}
	if (_tmp7_) {
		gboolean _tmp10_;
		_tmp10_ = self->priv->_encryption_required;
		if (_tmp10_) {
			g_warning ("content_parameters.vala:135: Encryption required but not provided in b" \
"oth directions");
			block10_data_unref (_data10_);
			_data10_ = NULL;
			return;
		}
		_xmpp_xep_jingle_rtp_crypto_unref0 (self->remote_crypto);
		self->remote_crypto = NULL;
		_xmpp_xep_jingle_rtp_crypto_unref0 (self->local_crypto);
		self->local_crypto = NULL;
	}
	_tmp12_ = self->remote_crypto;
	if (_tmp12_ != NULL) {
		XmppXepJingleRtpCrypto* _tmp13_;
		_tmp13_ = self->local_crypto;
		_tmp11_ = _tmp13_ != NULL;
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		XmppXepJingleContentEncryption* content_encryption = NULL;
		XmppXepJingleRtpCrypto* _tmp14_;
		guint8* _tmp15_;
		gint _tmp15__length1;
		gint _tmp16_ = 0;
		guint8* _tmp17_;
		gint _tmp17__length1;
		guint8* _tmp18_;
		gint _tmp18__length1;
		XmppXepJingleRtpCrypto* _tmp19_;
		guint8* _tmp20_;
		gint _tmp20__length1;
		gint _tmp21_ = 0;
		guint8* _tmp22_;
		gint _tmp22__length1;
		guint8* _tmp23_;
		gint _tmp23__length1;
		XmppXepJingleContentEncryption* _tmp24_;
		XmppXepJingleContentEncryption* _tmp25_;
		GeeHashMap* _tmp26_;
		XmppXepJingleContentEncryption* _tmp27_;
		const gchar* _tmp28_;
		XmppXepJingleContentEncryption* _tmp29_;
		_tmp14_ = self->local_crypto;
		_tmp15_ = xmpp_xep_jingle_rtp_crypto_get_key (_tmp14_, &_tmp16_);
		_tmp15__length1 = _tmp16_;
		_tmp17_ = _tmp15_;
		_tmp17__length1 = _tmp15__length1;
		_tmp18_ = _tmp17_;
		_tmp18__length1 = _tmp17__length1;
		_tmp19_ = self->remote_crypto;
		_tmp20_ = xmpp_xep_jingle_rtp_crypto_get_key (_tmp19_, &_tmp21_);
		_tmp20__length1 = _tmp21_;
		_tmp22_ = _tmp20_;
		_tmp22__length1 = _tmp20__length1;
		_tmp23_ = _tmp22_;
		_tmp23__length1 = _tmp22__length1;
		_tmp24_ = xmpp_xep_jingle_content_encryption_new ("", "SRTP", _tmp18_, _tmp17__length1, _tmp23_, _tmp22__length1);
		_tmp25_ = _tmp24_;
		_tmp23_ = (g_free (_tmp23_), NULL);
		_tmp18_ = (g_free (_tmp18_), NULL);
		content_encryption = _tmp25_;
		_tmp26_ = content->encryptions;
		_tmp27_ = content_encryption;
		_tmp28_ = _tmp27_->encryption_name;
		_tmp29_ = content_encryption;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp26_, _tmp28_, _tmp29_);
		_g_object_unref0 (content_encryption);
	}
	_tmp30_ = self->priv->parent;
	_tmp31_ = xmpp_xep_jingle_rtp_module_create_stream (_tmp30_, content);
	_tmp32_ = _tmp31_;
	xmpp_xep_jingle_rtp_parameters_set_stream (self, _tmp32_);
	_g_object_unref0 (_tmp32_);
	_tmp33_ = self->priv->_stream;
	g_object_weak_ref ((GObject*) _tmp33_, ___lambda24__gweak_notify, self);
	_tmp34_ = _data10_->rtp_datagram;
	_tmp35_ = self->priv->_stream;
	g_signal_connect_object (_tmp34_, "datagram-received", (GCallback) _xmpp_xep_jingle_rtp_stream_on_recv_rtp_data_xmpp_xep_jingle_datagram_connection_datagram_received, _tmp35_, 0);
	_tmp36_ = _data10_->rtcp_datagram;
	_tmp37_ = self->priv->_stream;
	g_signal_connect_object (_tmp36_, "datagram-received", (GCallback) _xmpp_xep_jingle_rtp_stream_on_recv_rtcp_data_xmpp_xep_jingle_datagram_connection_datagram_received, _tmp37_, 0);
	_tmp38_ = self->priv->_stream;
	_tmp39_ = _data10_->rtp_datagram;
	g_signal_connect_object (_tmp38_, "on-send-rtp-data", (GCallback) _xmpp_xep_jingle_datagram_connection_send_datagram_xmpp_xep_jingle_rtp_stream_on_send_rtp_data, _tmp39_, 0);
	_tmp40_ = self->priv->_stream;
	_tmp41_ = _data10_->rtcp_datagram;
	g_signal_connect_object (_tmp40_, "on-send-rtcp-data", (GCallback) _xmpp_xep_jingle_datagram_connection_send_datagram_xmpp_xep_jingle_rtp_stream_on_send_rtcp_data, _tmp41_, 0);
	_tmp42_ = self->priv->_stream;
	g_signal_emit (self, xmpp_xep_jingle_rtp_parameters_signals[XMPP_XEP_JINGLE_RTP_PARAMETERS_STREAM_CREATED_SIGNAL], 0, _tmp42_);
	_tmp43_ = self->priv->_stream;
	xmpp_xep_jingle_rtp_stream_create (_tmp43_);
	block10_data_unref (_data10_);
	_data10_ = NULL;
}

static void
xmpp_xep_jingle_rtp_parameters_real_handle_accept (XmppXepJingleContentParameters* base,
                                                   XmppXmppStream* stream,
                                                   XmppXepJingleSession* session,
                                                   XmppXepJingleContent* content,
                                                   XmppStanzaNode* description_node)
{
	XmppXepJingleRtpParameters * self;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	GeeList* payload_type_nodes = NULL;
	GeeList* _tmp2_;
	GeeList* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	XmppXepJingleRtpPayloadType* preferred_payload_type = NULL;
	GeeList* _tmp6_;
	gpointer _tmp7_;
	XmppStanzaNode* _tmp8_;
	XmppXepJingleRtpPayloadType* _tmp9_;
	XmppXepJingleRtpPayloadType* _tmp10_;
	GeeList* _tmp11_;
	XmppXepJingleRtpPayloadType* _tmp12_;
	XmppXepJingleRtpPayloadType* _tmp13_;
	GeeList* crypto_nodes = NULL;
	GeeList* _tmp14_;
	GeeList* _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	self = (XmppXepJingleRtpParameters*) base;
	g_return_if_fail (stream != NULL);
	g_return_if_fail (session != NULL);
	g_return_if_fail (content != NULL);
	g_return_if_fail (description_node != NULL);
	_tmp0_ = xmpp_stanza_node_get_subnode (description_node, "rtcp-mux", NULL, FALSE);
	_tmp1_ = _tmp0_;
	xmpp_xep_jingle_rtp_parameters_set_rtcp_mux (self, _tmp1_ != NULL);
	_xmpp_stanza_entry_unref0 (_tmp1_);
	_tmp2_ = xmpp_stanza_node_get_subnodes (description_node, "payload-type", NULL, FALSE);
	payload_type_nodes = _tmp2_;
	_tmp3_ = payload_type_nodes;
	_tmp4_ = gee_collection_get_size ((GeeCollection*) _tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ == 0) {
		g_warning ("content_parameters.vala:160: Counterpart didn't include any payload ty" \
"pes");
		_g_object_unref0 (payload_type_nodes);
		return;
	}
	_tmp6_ = payload_type_nodes;
	_tmp7_ = gee_list_get (_tmp6_, 0);
	_tmp8_ = (XmppStanzaNode*) _tmp7_;
	_tmp9_ = xmpp_xep_jingle_rtp_payload_type_parse (_tmp8_);
	_tmp10_ = _tmp9_;
	_xmpp_stanza_entry_unref0 (_tmp8_);
	preferred_payload_type = _tmp10_;
	_tmp11_ = self->payload_types;
	_tmp12_ = preferred_payload_type;
	if (!gee_collection_contains ((GeeCollection*) _tmp11_, _tmp12_)) {
		g_warning ("content_parameters.vala:165: Counterpart's preferred content type does" \
"n't match any of our sent ones");
	}
	_tmp13_ = preferred_payload_type;
	xmpp_xep_jingle_rtp_parameters_set_agreed_payload_type (self, _tmp13_);
	_tmp14_ = xmpp_stanza_node_get_deep_subnodes (description_node, "encryption", "crypto", NULL);
	crypto_nodes = _tmp14_;
	_tmp15_ = crypto_nodes;
	_tmp16_ = gee_collection_get_size ((GeeCollection*) _tmp15_);
	_tmp17_ = _tmp16_;
	if (_tmp17_ == 0) {
		gboolean _tmp18_;
		g_debug ("content_parameters.vala:171: Counterpart didn't include any cryptos");
		_tmp18_ = self->priv->_encryption_required;
		if (_tmp18_) {
			_g_object_unref0 (crypto_nodes);
			_xmpp_xep_jingle_rtp_payload_type_unref0 (preferred_payload_type);
			_g_object_unref0 (payload_type_nodes);
			return;
		}
	} else {
		XmppXepJingleRtpCrypto* preferred_crypto = NULL;
		GeeList* _tmp19_;
		gpointer _tmp20_;
		XmppStanzaNode* _tmp21_;
		XmppXepJingleRtpCrypto* _tmp22_;
		XmppXepJingleRtpCrypto* _tmp23_;
		XmppXepJingleRtpCrypto* _tmp24_;
		const gchar* _tmp25_;
		const gchar* _tmp26_;
		XmppXepJingleRtpCrypto* _tmp27_;
		const gchar* _tmp28_;
		const gchar* _tmp29_;
		XmppXepJingleRtpCrypto* _tmp30_;
		XmppXepJingleRtpCrypto* _tmp31_;
		_tmp19_ = crypto_nodes;
		_tmp20_ = gee_list_get (_tmp19_, 0);
		_tmp21_ = (XmppStanzaNode*) _tmp20_;
		_tmp22_ = xmpp_xep_jingle_rtp_crypto_parse (_tmp21_);
		_tmp23_ = _tmp22_;
		_xmpp_stanza_entry_unref0 (_tmp21_);
		preferred_crypto = _tmp23_;
		_tmp24_ = self->local_crypto;
		_tmp25_ = xmpp_xep_jingle_rtp_crypto_get_crypto_suite (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp27_ = preferred_crypto;
		_tmp28_ = xmpp_xep_jingle_rtp_crypto_get_crypto_suite (_tmp27_);
		_tmp29_ = _tmp28_;
		if (g_strcmp0 (_tmp26_, _tmp29_) != 0) {
			g_warning ("content_parameters.vala:178: Counterpart's crypto suite doesn't match " \
"any of our sent ones");
		}
		_tmp30_ = preferred_crypto;
		_tmp31_ = _xmpp_xep_jingle_rtp_crypto_ref0 (_tmp30_);
		_xmpp_xep_jingle_rtp_crypto_unref0 (self->remote_crypto);
		self->remote_crypto = _tmp31_;
		_xmpp_xep_jingle_rtp_crypto_unref0 (preferred_crypto);
	}
	xmpp_xep_jingle_content_parameters_accept ((XmppXepJingleContentParameters*) self, stream, session, content);
	_g_object_unref0 (crypto_nodes);
	_xmpp_xep_jingle_rtp_payload_type_unref0 (preferred_payload_type);
	_g_object_unref0 (payload_type_nodes);
}

static void
xmpp_xep_jingle_rtp_parameters_real_terminate (XmppXepJingleContentParameters* base,
                                               gboolean we_terminated,
                                               const gchar* reason_name,
                                               const gchar* reason_text)
{
	XmppXepJingleRtpParameters * self;
	XmppXepJingleRtpStream* _tmp0_;
	self = (XmppXepJingleRtpParameters*) base;
	_tmp0_ = self->priv->_stream;
	if (_tmp0_ != NULL) {
		XmppXepJingleRtpModule* _tmp1_;
		XmppXepJingleRtpStream* _tmp2_;
		_tmp1_ = self->priv->parent;
		_tmp2_ = self->priv->_stream;
		xmpp_xep_jingle_rtp_module_close_stream (_tmp1_, _tmp2_);
	}
}

static XmppStanzaNode*
xmpp_xep_jingle_rtp_parameters_real_get_description_node (XmppXepJingleContentParameters* base)
{
	XmppXepJingleRtpParameters * self;
	XmppStanzaNode* ret = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	const gchar* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	XmppXepJingleRtpPayloadType* _tmp7_;
	XmppXepJingleRtpCrypto* _tmp42_;
	gboolean _tmp53_;
	XmppStanzaNode* result;
	self = (XmppXepJingleRtpParameters*) base;
	_tmp0_ = xmpp_stanza_node_new_build ("description", XMPP_XEP_JINGLE_RTP_NS_URI, NULL, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_stanza_node_add_self_xmlns (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->_media;
	_tmp5_ = xmpp_stanza_node_put_attribute (_tmp3_, "media", _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	_xmpp_stanza_entry_unref0 (_tmp3_);
	_xmpp_stanza_entry_unref0 (_tmp1_);
	ret = _tmp6_;
	_tmp7_ = self->priv->_agreed_payload_type;
	if (_tmp7_ != NULL) {
		XmppStanzaNode* _tmp8_;
		XmppXepJingleRtpPayloadType* _tmp9_;
		XmppStanzaNode* _tmp10_;
		XmppStanzaNode* _tmp11_;
		XmppStanzaNode* _tmp12_;
		XmppStanzaNode* _tmp13_;
		_tmp8_ = ret;
		_tmp9_ = self->priv->_agreed_payload_type;
		_tmp10_ = xmpp_xep_jingle_rtp_payload_type_to_xml (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = xmpp_stanza_node_put_node (_tmp8_, _tmp11_);
		_tmp13_ = _tmp12_;
		_xmpp_stanza_entry_unref0 (_tmp13_);
		_xmpp_stanza_entry_unref0 (_tmp11_);
	} else {
		{
			GeeList* _payload_type_list = NULL;
			GeeList* _tmp14_;
			gint _payload_type_size = 0;
			GeeList* _tmp15_;
			gint _tmp16_;
			gint _tmp17_;
			gint _payload_type_index = 0;
			_tmp14_ = self->payload_types;
			_payload_type_list = _tmp14_;
			_tmp15_ = _payload_type_list;
			_tmp16_ = gee_collection_get_size ((GeeCollection*) _tmp15_);
			_tmp17_ = _tmp16_;
			_payload_type_size = _tmp17_;
			_payload_type_index = -1;
			while (TRUE) {
				gint _tmp18_;
				gint _tmp19_;
				XmppXepJingleRtpPayloadType* payload_type = NULL;
				GeeList* _tmp20_;
				gpointer _tmp21_;
				XmppStanzaNode* _tmp22_;
				XmppXepJingleRtpPayloadType* _tmp23_;
				XmppStanzaNode* _tmp24_;
				XmppStanzaNode* _tmp25_;
				XmppStanzaNode* _tmp26_;
				XmppStanzaNode* _tmp27_;
				_payload_type_index = _payload_type_index + 1;
				_tmp18_ = _payload_type_index;
				_tmp19_ = _payload_type_size;
				if (!(_tmp18_ < _tmp19_)) {
					break;
				}
				_tmp20_ = _payload_type_list;
				_tmp21_ = gee_list_get (_tmp20_, _payload_type_index);
				payload_type = (XmppXepJingleRtpPayloadType*) _tmp21_;
				_tmp22_ = ret;
				_tmp23_ = payload_type;
				_tmp24_ = xmpp_xep_jingle_rtp_payload_type_to_xml (_tmp23_);
				_tmp25_ = _tmp24_;
				_tmp26_ = xmpp_stanza_node_put_node (_tmp22_, _tmp25_);
				_tmp27_ = _tmp26_;
				_xmpp_stanza_entry_unref0 (_tmp27_);
				_xmpp_stanza_entry_unref0 (_tmp25_);
				_xmpp_xep_jingle_rtp_payload_type_unref0 (payload_type);
			}
		}
	}
	{
		GeeList* _ext_list = NULL;
		GeeList* _tmp28_;
		gint _ext_size = 0;
		GeeList* _tmp29_;
		gint _tmp30_;
		gint _tmp31_;
		gint _ext_index = 0;
		_tmp28_ = self->header_extensions;
		_ext_list = _tmp28_;
		_tmp29_ = _ext_list;
		_tmp30_ = gee_collection_get_size ((GeeCollection*) _tmp29_);
		_tmp31_ = _tmp30_;
		_ext_size = _tmp31_;
		_ext_index = -1;
		while (TRUE) {
			gint _tmp32_;
			gint _tmp33_;
			XmppXepJingleRtpHeaderExtension* ext = NULL;
			GeeList* _tmp34_;
			gpointer _tmp35_;
			XmppStanzaNode* _tmp36_;
			XmppXepJingleRtpHeaderExtension* _tmp37_;
			XmppStanzaNode* _tmp38_;
			XmppStanzaNode* _tmp39_;
			XmppStanzaNode* _tmp40_;
			XmppStanzaNode* _tmp41_;
			_ext_index = _ext_index + 1;
			_tmp32_ = _ext_index;
			_tmp33_ = _ext_size;
			if (!(_tmp32_ < _tmp33_)) {
				break;
			}
			_tmp34_ = _ext_list;
			_tmp35_ = gee_list_get (_tmp34_, _ext_index);
			ext = (XmppXepJingleRtpHeaderExtension*) _tmp35_;
			_tmp36_ = ret;
			_tmp37_ = ext;
			_tmp38_ = xmpp_xep_jingle_rtp_header_extension_to_xml (_tmp37_);
			_tmp39_ = _tmp38_;
			_tmp40_ = xmpp_stanza_node_put_node (_tmp36_, _tmp39_);
			_tmp41_ = _tmp40_;
			_xmpp_stanza_entry_unref0 (_tmp41_);
			_xmpp_stanza_entry_unref0 (_tmp39_);
			_xmpp_xep_jingle_rtp_header_extension_unref0 (ext);
		}
	}
	_tmp42_ = self->local_crypto;
	if (_tmp42_ != NULL) {
		XmppStanzaNode* _tmp43_;
		XmppStanzaNode* _tmp44_;
		XmppStanzaNode* _tmp45_;
		XmppXepJingleRtpCrypto* _tmp46_;
		XmppStanzaNode* _tmp47_;
		XmppStanzaNode* _tmp48_;
		XmppStanzaNode* _tmp49_;
		XmppStanzaNode* _tmp50_;
		XmppStanzaNode* _tmp51_;
		XmppStanzaNode* _tmp52_;
		_tmp43_ = ret;
		_tmp44_ = xmpp_stanza_node_new_build ("encryption", XMPP_XEP_JINGLE_RTP_NS_URI, NULL, NULL);
		_tmp45_ = _tmp44_;
		_tmp46_ = self->local_crypto;
		_tmp47_ = xmpp_xep_jingle_rtp_crypto_to_xml (_tmp46_);
		_tmp48_ = _tmp47_;
		_tmp49_ = xmpp_stanza_node_put_node (_tmp45_, _tmp48_);
		_tmp50_ = _tmp49_;
		_tmp51_ = xmpp_stanza_node_put_node (_tmp43_, _tmp50_);
		_tmp52_ = _tmp51_;
		_xmpp_stanza_entry_unref0 (_tmp52_);
		_xmpp_stanza_entry_unref0 (_tmp50_);
		_xmpp_stanza_entry_unref0 (_tmp48_);
		_xmpp_stanza_entry_unref0 (_tmp45_);
	}
	_tmp53_ = self->priv->_rtcp_mux;
	if (_tmp53_) {
		XmppStanzaNode* _tmp54_;
		XmppStanzaNode* _tmp55_;
		XmppStanzaNode* _tmp56_;
		XmppStanzaNode* _tmp57_;
		XmppStanzaNode* _tmp58_;
		_tmp54_ = ret;
		_tmp55_ = xmpp_stanza_node_new_build ("rtcp-mux", XMPP_XEP_JINGLE_RTP_NS_URI, NULL, NULL);
		_tmp56_ = _tmp55_;
		_tmp57_ = xmpp_stanza_node_put_node (_tmp54_, _tmp56_);
		_tmp58_ = _tmp57_;
		_xmpp_stanza_entry_unref0 (_tmp58_);
		_xmpp_stanza_entry_unref0 (_tmp56_);
	}
	result = ret;
	return result;
}

const gchar*
xmpp_xep_jingle_rtp_parameters_get_media (XmppXepJingleRtpParameters* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_media;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_rtp_parameters_set_media (XmppXepJingleRtpParameters* self,
                                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_parameters_get_media (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_media);
		self->priv->_media = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_MEDIA_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_rtp_parameters_get_ssrc (XmppXepJingleRtpParameters* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_ssrc;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_rtp_parameters_set_ssrc (XmppXepJingleRtpParameters* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_parameters_get_ssrc (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_ssrc);
		self->priv->_ssrc = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_SSRC_PROPERTY]);
	}
}

gboolean
xmpp_xep_jingle_rtp_parameters_get_rtcp_mux (XmppXepJingleRtpParameters* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_rtcp_mux;
	return result;
}

static void
xmpp_xep_jingle_rtp_parameters_set_rtcp_mux (XmppXepJingleRtpParameters* self,
                                             gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_parameters_get_rtcp_mux (self);
	if (old_value != value) {
		self->priv->_rtcp_mux = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_RTCP_MUX_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_rtp_parameters_get_bandwidth (XmppXepJingleRtpParameters* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_bandwidth;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_rtp_parameters_set_bandwidth (XmppXepJingleRtpParameters* self,
                                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_parameters_get_bandwidth (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_bandwidth);
		self->priv->_bandwidth = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_BANDWIDTH_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_rtp_parameters_get_bandwidth_type (XmppXepJingleRtpParameters* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_bandwidth_type;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_rtp_parameters_set_bandwidth_type (XmppXepJingleRtpParameters* self,
                                                   const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_parameters_get_bandwidth_type (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_bandwidth_type);
		self->priv->_bandwidth_type = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_BANDWIDTH_TYPE_PROPERTY]);
	}
}

gboolean
xmpp_xep_jingle_rtp_parameters_get_encryption_required (XmppXepJingleRtpParameters* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_encryption_required;
	return result;
}

static void
xmpp_xep_jingle_rtp_parameters_set_encryption_required (XmppXepJingleRtpParameters* self,
                                                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_parameters_get_encryption_required (self);
	if (old_value != value) {
		self->priv->_encryption_required = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_ENCRYPTION_REQUIRED_PROPERTY]);
	}
}

XmppXepJingleRtpPayloadType*
xmpp_xep_jingle_rtp_parameters_get_agreed_payload_type (XmppXepJingleRtpParameters* self)
{
	XmppXepJingleRtpPayloadType* result;
	XmppXepJingleRtpPayloadType* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_agreed_payload_type;
	result = _tmp0_;
	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 void
xmpp_xep_jingle_rtp_parameters_set_agreed_payload_type (XmppXepJingleRtpParameters* self,
                                                        XmppXepJingleRtpPayloadType* value)
{
	XmppXepJingleRtpPayloadType* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_parameters_get_agreed_payload_type (self);
	if (old_value != value) {
		XmppXepJingleRtpPayloadType* _tmp0_;
		_tmp0_ = _xmpp_xep_jingle_rtp_payload_type_ref0 (value);
		_xmpp_xep_jingle_rtp_payload_type_unref0 (self->priv->_agreed_payload_type);
		self->priv->_agreed_payload_type = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_AGREED_PAYLOAD_TYPE_PROPERTY]);
	}
}

gboolean
xmpp_xep_jingle_rtp_parameters_get_rtp_ready (XmppXepJingleRtpParameters* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_rtp_ready;
	return result;
}

static void
xmpp_xep_jingle_rtp_parameters_set_rtp_ready (XmppXepJingleRtpParameters* self,
                                              gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_parameters_get_rtp_ready (self);
	if (old_value != value) {
		self->priv->_rtp_ready = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_RTP_READY_PROPERTY]);
	}
}

gboolean
xmpp_xep_jingle_rtp_parameters_get_rtcp_ready (XmppXepJingleRtpParameters* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_rtcp_ready;
	return result;
}

static void
xmpp_xep_jingle_rtp_parameters_set_rtcp_ready (XmppXepJingleRtpParameters* self,
                                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_parameters_get_rtcp_ready (self);
	if (old_value != value) {
		self->priv->_rtcp_ready = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_RTCP_READY_PROPERTY]);
	}
}

XmppXepJingleRtpStream*
xmpp_xep_jingle_rtp_parameters_get_stream (XmppXepJingleRtpParameters* self)
{
	XmppXepJingleRtpStream* result;
	XmppXepJingleRtpStream* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_stream;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_rtp_parameters_set_stream (XmppXepJingleRtpParameters* self,
                                           XmppXepJingleRtpStream* value)
{
	XmppXepJingleRtpStream* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_parameters_get_stream (self);
	if (old_value != value) {
		self->priv->_stream = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_STREAM_PROPERTY]);
	}
}

static void
xmpp_xep_jingle_rtp_parameters_class_init (XmppXepJingleRtpParametersClass * klass,
                                           gpointer klass_data)
{
	xmpp_xep_jingle_rtp_parameters_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleRtpParameters_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_rtp_parameters_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_xep_jingle_rtp_parameters_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_rtp_parameters_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_PARAMETERS_MEDIA_PROPERTY, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_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), XMPP_XEP_JINGLE_RTP_PARAMETERS_SSRC_PROPERTY, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_SSRC_PROPERTY] = g_param_spec_string ("ssrc", "ssrc", "ssrc", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_PARAMETERS_RTCP_MUX_PROPERTY, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_RTCP_MUX_PROPERTY] = g_param_spec_boolean ("rtcp-mux", "rtcp-mux", "rtcp-mux", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_PARAMETERS_BANDWIDTH_PROPERTY, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_BANDWIDTH_PROPERTY] = g_param_spec_string ("bandwidth", "bandwidth", "bandwidth", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_PARAMETERS_BANDWIDTH_TYPE_PROPERTY, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_BANDWIDTH_TYPE_PROPERTY] = g_param_spec_string ("bandwidth-type", "bandwidth-type", "bandwidth-type", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_PARAMETERS_ENCRYPTION_REQUIRED_PROPERTY, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_ENCRYPTION_REQUIRED_PROPERTY] = g_param_spec_boolean ("encryption-required", "encryption-required", "encryption-required", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_PARAMETERS_AGREED_PAYLOAD_TYPE_PROPERTY, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_AGREED_PAYLOAD_TYPE_PROPERTY] = xmpp_xep_jingle_rtp_param_spec_payload_type ("agreed-payload-type", "agreed-payload-type", "agreed-payload-type", XMPP_XEP_JINGLE_RTP_TYPE_PAYLOAD_TYPE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_PARAMETERS_RTP_READY_PROPERTY, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_RTP_READY_PROPERTY] = g_param_spec_boolean ("rtp-ready", "rtp-ready", "rtp-ready", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_PARAMETERS_RTCP_READY_PROPERTY, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_RTCP_READY_PROPERTY] = g_param_spec_boolean ("rtcp-ready", "rtcp-ready", "rtcp-ready", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_PARAMETERS_STREAM_PROPERTY, xmpp_xep_jingle_rtp_parameters_properties[XMPP_XEP_JINGLE_RTP_PARAMETERS_STREAM_PROPERTY] = g_param_spec_object ("stream", "stream", "stream", XMPP_XEP_JINGLE_RTP_TYPE_STREAM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	xmpp_xep_jingle_rtp_parameters_signals[XMPP_XEP_JINGLE_RTP_PARAMETERS_STREAM_CREATED_SIGNAL] = g_signal_new ("stream-created", XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, XMPP_XEP_JINGLE_RTP_TYPE_STREAM);
	xmpp_xep_jingle_rtp_parameters_signals[XMPP_XEP_JINGLE_RTP_PARAMETERS_CONNECTION_READY_SIGNAL] = g_signal_new ("connection-ready", XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
xmpp_xep_jingle_rtp_parameters_xmpp_xep_jingle_content_parameters_interface_init (XmppXepJingleContentParametersIface * iface,
                                                                                  gpointer iface_data)
{
	xmpp_xep_jingle_rtp_parameters_xmpp_xep_jingle_content_parameters_parent_iface = g_type_interface_peek_parent (iface);
	iface->handle_proposed_content = (void (*) (XmppXepJingleContentParameters*, XmppXmppStream*, XmppXepJingleSession*, XmppXepJingleContent*, GAsyncReadyCallback, gpointer)) xmpp_xep_jingle_rtp_parameters_real_handle_proposed_content;
	iface->handle_proposed_content_finish = (void (*) (XmppXepJingleContentParameters*, GAsyncResult*)) xmpp_xep_jingle_rtp_parameters_handle_proposed_content_finish;
	iface->accept = (void (*) (XmppXepJingleContentParameters*, XmppXmppStream*, XmppXepJingleSession*, XmppXepJingleContent*)) xmpp_xep_jingle_rtp_parameters_real_accept;
	iface->handle_accept = (void (*) (XmppXepJingleContentParameters*, XmppXmppStream*, XmppXepJingleSession*, XmppXepJingleContent*, XmppStanzaNode*)) xmpp_xep_jingle_rtp_parameters_real_handle_accept;
	iface->terminate = (void (*) (XmppXepJingleContentParameters*, gboolean, const gchar*, const gchar*)) xmpp_xep_jingle_rtp_parameters_real_terminate;
	iface->get_description_node = (XmppStanzaNode* (*) (XmppXepJingleContentParameters*)) xmpp_xep_jingle_rtp_parameters_real_get_description_node;
}

static void
xmpp_xep_jingle_rtp_parameters_instance_init (XmppXepJingleRtpParameters * self,
                                              gpointer klass)
{
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	self->priv = xmpp_xep_jingle_rtp_parameters_get_instance_private (self);
	self->priv->_encryption_required = FALSE;
	_tmp0_ = gee_array_list_new (XMPP_XEP_JINGLE_RTP_TYPE_PAYLOAD_TYPE, (GBoxedCopyFunc) xmpp_xep_jingle_rtp_payload_type_ref, (GDestroyNotify) xmpp_xep_jingle_rtp_payload_type_unref, _xmpp_xep_jingle_rtp_payload_type_equals_func_gee_equal_data_func, NULL, NULL);
	self->payload_types = (GeeList*) _tmp0_;
	_tmp1_ = gee_array_list_new (XMPP_XEP_JINGLE_RTP_TYPE_HEADER_EXTENSION, (GBoxedCopyFunc) xmpp_xep_jingle_rtp_header_extension_ref, (GDestroyNotify) xmpp_xep_jingle_rtp_header_extension_unref, NULL, NULL, NULL);
	self->header_extensions = (GeeList*) _tmp1_;
	_tmp2_ = gee_array_list_new (XMPP_XEP_JINGLE_RTP_TYPE_CRYPTO, (GBoxedCopyFunc) xmpp_xep_jingle_rtp_crypto_ref, (GDestroyNotify) xmpp_xep_jingle_rtp_crypto_unref, NULL, NULL, NULL);
	self->remote_cryptos = (GeeList*) _tmp2_;
	self->local_crypto = NULL;
	self->remote_crypto = NULL;
	self->priv->_rtp_ready = FALSE;
	self->priv->_rtcp_ready = FALSE;
}

static void
xmpp_xep_jingle_rtp_parameters_finalize (GObject * obj)
{
	XmppXepJingleRtpParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, XmppXepJingleRtpParameters);
	_g_free0 (self->priv->_media);
	_g_free0 (self->priv->_ssrc);
	_g_free0 (self->priv->_bandwidth);
	_g_free0 (self->priv->_bandwidth_type);
	_xmpp_xep_jingle_rtp_payload_type_unref0 (self->priv->_agreed_payload_type);
	_g_object_unref0 (self->payload_types);
	_g_object_unref0 (self->header_extensions);
	_g_object_unref0 (self->remote_cryptos);
	_xmpp_xep_jingle_rtp_crypto_unref0 (self->local_crypto);
	_xmpp_xep_jingle_rtp_crypto_unref0 (self->remote_crypto);
	_g_object_unref0 (self->priv->parent);
	G_OBJECT_CLASS (xmpp_xep_jingle_rtp_parameters_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_rtp_parameters_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleRtpParametersClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_rtp_parameters_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleRtpParameters), 0, (GInstanceInitFunc) xmpp_xep_jingle_rtp_parameters_instance_init, NULL };
	static const GInterfaceInfo xmpp_xep_jingle_content_parameters_info = { (GInterfaceInitFunc) xmpp_xep_jingle_rtp_parameters_xmpp_xep_jingle_content_parameters_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType xmpp_xep_jingle_rtp_parameters_type_id;
	xmpp_xep_jingle_rtp_parameters_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppXepJingleRtpParameters", &g_define_type_info, 0);
	g_type_add_interface_static (xmpp_xep_jingle_rtp_parameters_type_id, XMPP_XEP_JINGLE_TYPE_CONTENT_PARAMETERS, &xmpp_xep_jingle_content_parameters_info);
	XmppXepJingleRtpParameters_private_offset = g_type_add_instance_private (xmpp_xep_jingle_rtp_parameters_type_id, sizeof (XmppXepJingleRtpParametersPrivate));
	return xmpp_xep_jingle_rtp_parameters_type_id;
}

GType
xmpp_xep_jingle_rtp_parameters_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_rtp_parameters_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_rtp_parameters_type_id__once)) {
		GType xmpp_xep_jingle_rtp_parameters_type_id;
		xmpp_xep_jingle_rtp_parameters_type_id = xmpp_xep_jingle_rtp_parameters_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_rtp_parameters_type_id__once, xmpp_xep_jingle_rtp_parameters_type_id);
	}
	return xmpp_xep_jingle_rtp_parameters_type_id__once;
}

static void
_vala_xmpp_xep_jingle_rtp_parameters_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	XmppXepJingleRtpParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, XmppXepJingleRtpParameters);
	switch (property_id) {
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_MEDIA_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_rtp_parameters_get_media (self));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_SSRC_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_rtp_parameters_get_ssrc (self));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_RTCP_MUX_PROPERTY:
		g_value_set_boolean (value, xmpp_xep_jingle_rtp_parameters_get_rtcp_mux (self));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_BANDWIDTH_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_rtp_parameters_get_bandwidth (self));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_BANDWIDTH_TYPE_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_rtp_parameters_get_bandwidth_type (self));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_ENCRYPTION_REQUIRED_PROPERTY:
		g_value_set_boolean (value, xmpp_xep_jingle_rtp_parameters_get_encryption_required (self));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_AGREED_PAYLOAD_TYPE_PROPERTY:
		xmpp_xep_jingle_rtp_value_set_payload_type (value, xmpp_xep_jingle_rtp_parameters_get_agreed_payload_type (self));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_RTP_READY_PROPERTY:
		g_value_set_boolean (value, xmpp_xep_jingle_rtp_parameters_get_rtp_ready (self));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_RTCP_READY_PROPERTY:
		g_value_set_boolean (value, xmpp_xep_jingle_rtp_parameters_get_rtcp_ready (self));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_STREAM_PROPERTY:
		g_value_set_object (value, xmpp_xep_jingle_rtp_parameters_get_stream (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_xep_jingle_rtp_parameters_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	XmppXepJingleRtpParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, XmppXepJingleRtpParameters);
	switch (property_id) {
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_MEDIA_PROPERTY:
		xmpp_xep_jingle_rtp_parameters_set_media (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_SSRC_PROPERTY:
		xmpp_xep_jingle_rtp_parameters_set_ssrc (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_RTCP_MUX_PROPERTY:
		xmpp_xep_jingle_rtp_parameters_set_rtcp_mux (self, g_value_get_boolean (value));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_BANDWIDTH_PROPERTY:
		xmpp_xep_jingle_rtp_parameters_set_bandwidth (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_BANDWIDTH_TYPE_PROPERTY:
		xmpp_xep_jingle_rtp_parameters_set_bandwidth_type (self, g_value_get_string (value));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_ENCRYPTION_REQUIRED_PROPERTY:
		xmpp_xep_jingle_rtp_parameters_set_encryption_required (self, g_value_get_boolean (value));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_AGREED_PAYLOAD_TYPE_PROPERTY:
		xmpp_xep_jingle_rtp_parameters_set_agreed_payload_type (self, xmpp_xep_jingle_rtp_value_get_payload_type (value));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_RTP_READY_PROPERTY:
		xmpp_xep_jingle_rtp_parameters_set_rtp_ready (self, g_value_get_boolean (value));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_RTCP_READY_PROPERTY:
		xmpp_xep_jingle_rtp_parameters_set_rtcp_ready (self, g_value_get_boolean (value));
		break;
		case XMPP_XEP_JINGLE_RTP_PARAMETERS_STREAM_PROPERTY:
		xmpp_xep_jingle_rtp_parameters_set_stream (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
xmpp_xep_jingle_rtp_header_extension_get_instance_private (XmppXepJingleRtpHeaderExtension* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleRtpHeaderExtension_private_offset);
}

XmppXepJingleRtpHeaderExtension*
xmpp_xep_jingle_rtp_header_extension_construct (GType object_type,
                                                guint8 id,
                                                const gchar* uri)
{
	XmppXepJingleRtpHeaderExtension* self = NULL;
	g_return_val_if_fail (uri != NULL, NULL);
	self = (XmppXepJingleRtpHeaderExtension*) g_type_create_instance (object_type);
	xmpp_xep_jingle_rtp_header_extension_set_id (self, id);
	xmpp_xep_jingle_rtp_header_extension_set_uri (self, uri);
	return self;
}

XmppXepJingleRtpHeaderExtension*
xmpp_xep_jingle_rtp_header_extension_new (guint8 id,
                                          const gchar* uri)
{
	return xmpp_xep_jingle_rtp_header_extension_construct (XMPP_XEP_JINGLE_RTP_TYPE_HEADER_EXTENSION, id, uri);
}

XmppXepJingleRtpHeaderExtension*
xmpp_xep_jingle_rtp_header_extension_parse (XmppStanzaNode* node)
{
	const gchar* _tmp0_;
	XmppXepJingleRtpHeaderExtension* _tmp1_;
	XmppXepJingleRtpHeaderExtension* result;
	g_return_val_if_fail (node != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_get_attribute (node, "uri", NULL);
	_tmp1_ = xmpp_xep_jingle_rtp_header_extension_new ((guint8) xmpp_stanza_node_get_attribute_int (node, "id", -1, NULL), _tmp0_);
	result = _tmp1_;
	return result;
}

XmppStanzaNode*
xmpp_xep_jingle_rtp_header_extension_to_xml (XmppXepJingleRtpHeaderExtension* self)
{
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	guint8 _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	XmppStanzaNode* _tmp7_;
	XmppStanzaNode* _tmp8_;
	const gchar* _tmp9_;
	XmppStanzaNode* _tmp10_;
	XmppStanzaNode* _tmp11_;
	XmppStanzaNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = xmpp_stanza_node_new_build (XMPP_XEP_JINGLE_RTP_HEADER_EXTENSION_NAME, XMPP_XEP_JINGLE_RTP_HEADER_EXTENSION_NS_URI, NULL, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_stanza_node_add_self_xmlns (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->_id;
	_tmp5_ = g_strdup_printf ("%hhu", _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = xmpp_stanza_node_put_attribute (_tmp3_, "id", _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = self->priv->_uri;
	_tmp10_ = xmpp_stanza_node_put_attribute (_tmp8_, "uri", _tmp9_, NULL);
	_tmp11_ = _tmp10_;
	_xmpp_stanza_entry_unref0 (_tmp8_);
	_g_free0 (_tmp6_);
	_xmpp_stanza_entry_unref0 (_tmp3_);
	_xmpp_stanza_entry_unref0 (_tmp1_);
	result = _tmp11_;
	return result;
}

guint8
xmpp_xep_jingle_rtp_header_extension_get_id (XmppXepJingleRtpHeaderExtension* self)
{
	guint8 result;
	g_return_val_if_fail (self != NULL, 0U);
	result = self->priv->_id;
	return result;
}

static void
xmpp_xep_jingle_rtp_header_extension_set_id (XmppXepJingleRtpHeaderExtension* self,
                                             guint8 value)
{
	g_return_if_fail (self != NULL);
	self->priv->_id = value;
}

const gchar*
xmpp_xep_jingle_rtp_header_extension_get_uri (XmppXepJingleRtpHeaderExtension* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_uri;
	result = _tmp0_;
	return result;
}

static void
xmpp_xep_jingle_rtp_header_extension_set_uri (XmppXepJingleRtpHeaderExtension* self,
                                              const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_uri);
	self->priv->_uri = _tmp0_;
}

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

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

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

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

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

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

GParamSpec*
xmpp_xep_jingle_rtp_param_spec_header_extension (const gchar* name,
                                                 const gchar* nick,
                                                 const gchar* blurb,
                                                 GType object_type,
                                                 GParamFlags flags)
{
	XmppXepJingleRtpParamSpecHeaderExtension* spec;
	g_return_val_if_fail (g_type_is_a (object_type, XMPP_XEP_JINGLE_RTP_TYPE_HEADER_EXTENSION), 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
xmpp_xep_jingle_rtp_value_get_header_extension (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_JINGLE_RTP_TYPE_HEADER_EXTENSION), NULL);
	return value->data[0].v_pointer;
}

void
xmpp_xep_jingle_rtp_value_set_header_extension (GValue* value,
                                                gpointer v_object)
{
	XmppXepJingleRtpHeaderExtension * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_XEP_JINGLE_RTP_TYPE_HEADER_EXTENSION));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_XEP_JINGLE_RTP_TYPE_HEADER_EXTENSION));
		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;
		xmpp_xep_jingle_rtp_header_extension_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_xep_jingle_rtp_header_extension_unref (old);
	}
}

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

static void
xmpp_xep_jingle_rtp_header_extension_class_init (XmppXepJingleRtpHeaderExtensionClass * klass,
                                                 gpointer klass_data)
{
	xmpp_xep_jingle_rtp_header_extension_parent_class = g_type_class_peek_parent (klass);
	((XmppXepJingleRtpHeaderExtensionClass *) klass)->finalize = xmpp_xep_jingle_rtp_header_extension_finalize;
	g_type_class_adjust_private_offset (klass, &XmppXepJingleRtpHeaderExtension_private_offset);
}

static void
xmpp_xep_jingle_rtp_header_extension_instance_init (XmppXepJingleRtpHeaderExtension * self,
                                                    gpointer klass)
{
	self->priv = xmpp_xep_jingle_rtp_header_extension_get_instance_private (self);
	self->ref_count = 1;
}

static void
xmpp_xep_jingle_rtp_header_extension_finalize (XmppXepJingleRtpHeaderExtension * obj)
{
	XmppXepJingleRtpHeaderExtension * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_RTP_TYPE_HEADER_EXTENSION, XmppXepJingleRtpHeaderExtension);
	g_signal_handlers_destroy (self);
	_g_free0 (self->priv->_uri);
}

static GType
xmpp_xep_jingle_rtp_header_extension_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { xmpp_xep_jingle_rtp_value_header_extension_init, xmpp_xep_jingle_rtp_value_header_extension_free_value, xmpp_xep_jingle_rtp_value_header_extension_copy_value, xmpp_xep_jingle_rtp_value_header_extension_peek_pointer, "p", xmpp_xep_jingle_rtp_value_header_extension_collect_value, "p", xmpp_xep_jingle_rtp_value_header_extension_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleRtpHeaderExtensionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_rtp_header_extension_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleRtpHeaderExtension), 0, (GInstanceInitFunc) xmpp_xep_jingle_rtp_header_extension_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 xmpp_xep_jingle_rtp_header_extension_type_id;
	xmpp_xep_jingle_rtp_header_extension_type_id = g_type_register_fundamental (g_type_fundamental_next (), "XmppXepJingleRtpHeaderExtension", &g_define_type_info, &g_define_type_fundamental_info, 0);
	XmppXepJingleRtpHeaderExtension_private_offset = g_type_add_instance_private (xmpp_xep_jingle_rtp_header_extension_type_id, sizeof (XmppXepJingleRtpHeaderExtensionPrivate));
	return xmpp_xep_jingle_rtp_header_extension_type_id;
}

GType
xmpp_xep_jingle_rtp_header_extension_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_rtp_header_extension_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_rtp_header_extension_type_id__once)) {
		GType xmpp_xep_jingle_rtp_header_extension_type_id;
		xmpp_xep_jingle_rtp_header_extension_type_id = xmpp_xep_jingle_rtp_header_extension_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_rtp_header_extension_type_id__once, xmpp_xep_jingle_rtp_header_extension_type_id);
	}
	return xmpp_xep_jingle_rtp_header_extension_type_id__once;
}

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

void
xmpp_xep_jingle_rtp_header_extension_unref (gpointer instance)
{
	XmppXepJingleRtpHeaderExtension * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		XMPP_XEP_JINGLE_RTP_HEADER_EXTENSION_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

