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

#include "xmpp-vala.h"
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gee.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_STREAM_0_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_CONTENT_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_NAME_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_MEDIA_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_PAYLOAD_TYPE_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_LOCAL_CRYPTO_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_REMOTE_CRYPTO_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_HEADER_EXTENSIONS_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_SENDING_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_RECEIVING_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_RTCP_MUX_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_REMB_ENABLED_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_TARGET_RECEIVE_BITRATE_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_TARGET_SEND_BITRATE_PROPERTY,
	XMPP_XEP_JINGLE_RTP_STREAM_NUM_PROPERTIES
};
static GParamSpec* xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	XMPP_XEP_JINGLE_RTP_STREAM_ON_SEND_RTP_DATA_SIGNAL,
	XMPP_XEP_JINGLE_RTP_STREAM_ON_SEND_RTCP_DATA_SIGNAL,
	XMPP_XEP_JINGLE_RTP_STREAM_NUM_SIGNALS
};
static guint xmpp_xep_jingle_rtp_stream_signals[XMPP_XEP_JINGLE_RTP_STREAM_NUM_SIGNALS] = {0};

struct _XmppXepJingleRtpStreamPrivate {
	XmppXepJingleContent* _content;
	guint _target_receive_bitrate;
	guint _target_send_bitrate;
};

static gint XmppXepJingleRtpStream_private_offset;
static gpointer xmpp_xep_jingle_rtp_stream_parent_class = NULL;

static void xmpp_xep_jingle_rtp_stream_real_on_recv_rtp_data (XmppXepJingleRtpStream* self,
                                                       GBytes* bytes);
static void xmpp_xep_jingle_rtp_stream_real_on_recv_rtcp_data (XmppXepJingleRtpStream* self,
                                                        GBytes* bytes);
static void xmpp_xep_jingle_rtp_stream_real_on_rtp_ready (XmppXepJingleRtpStream* self);
static void xmpp_xep_jingle_rtp_stream_real_on_rtcp_ready (XmppXepJingleRtpStream* self);
static void xmpp_xep_jingle_rtp_stream_real_create (XmppXepJingleRtpStream* self);
static void xmpp_xep_jingle_rtp_stream_real_destroy (XmppXepJingleRtpStream* self);
static gboolean _xmpp_xep_jingle_rtp_stream_remb_enabled____lambda20_ (XmppXepJingleRtpStream* self,
                                                                XmppXepJingleRtpRtcpFeedback* it);
static gboolean __xmpp_xep_jingle_rtp_stream_remb_enabled____lambda20__gee_predicate (gconstpointer g,
                                                                               gpointer self);
static void xmpp_xep_jingle_rtp_stream_finalize (GObject * obj);
static GType xmpp_xep_jingle_rtp_stream_get_type_once (void);
static void _vala_xmpp_xep_jingle_rtp_stream_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_xmpp_xep_jingle_rtp_stream_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
xmpp_xep_jingle_rtp_stream_get_instance_private (XmppXepJingleRtpStream* self)
{
	return G_STRUCT_MEMBER_P (self, XmppXepJingleRtpStream_private_offset);
}

XmppXepJingleRtpStream*
xmpp_xep_jingle_rtp_stream_construct (GType object_type,
                                      XmppXepJingleContent* content)
{
	XmppXepJingleRtpStream * self = NULL;
	g_return_val_if_fail (content != NULL, NULL);
	self = (XmppXepJingleRtpStream*) g_object_new (object_type, NULL);
	xmpp_xep_jingle_rtp_stream_set_content (self, content);
	return self;
}

static void
xmpp_xep_jingle_rtp_stream_real_on_recv_rtp_data (XmppXepJingleRtpStream* self,
                                                  GBytes* bytes)
{
	g_critical ("Type `%s' does not implement abstract method `xmpp_xep_jingle_rtp_stream_on_recv_rtp_data'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
xmpp_xep_jingle_rtp_stream_on_recv_rtp_data (XmppXepJingleRtpStream* self,
                                             GBytes* bytes)
{
	XmppXepJingleRtpStreamClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_XEP_JINGLE_RTP_STREAM_GET_CLASS (self);
	if (_klass_->on_recv_rtp_data) {
		_klass_->on_recv_rtp_data (self, bytes);
	}
}

static void
xmpp_xep_jingle_rtp_stream_real_on_recv_rtcp_data (XmppXepJingleRtpStream* self,
                                                   GBytes* bytes)
{
	g_critical ("Type `%s' does not implement abstract method `xmpp_xep_jingle_rtp_stream_on_recv_rtcp_data'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
xmpp_xep_jingle_rtp_stream_on_recv_rtcp_data (XmppXepJingleRtpStream* self,
                                              GBytes* bytes)
{
	XmppXepJingleRtpStreamClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_XEP_JINGLE_RTP_STREAM_GET_CLASS (self);
	if (_klass_->on_recv_rtcp_data) {
		_klass_->on_recv_rtcp_data (self, bytes);
	}
}

static void
xmpp_xep_jingle_rtp_stream_real_on_rtp_ready (XmppXepJingleRtpStream* self)
{
	g_critical ("Type `%s' does not implement abstract method `xmpp_xep_jingle_rtp_stream_on_rtp_ready'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
xmpp_xep_jingle_rtp_stream_on_rtp_ready (XmppXepJingleRtpStream* self)
{
	XmppXepJingleRtpStreamClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_XEP_JINGLE_RTP_STREAM_GET_CLASS (self);
	if (_klass_->on_rtp_ready) {
		_klass_->on_rtp_ready (self);
	}
}

static void
xmpp_xep_jingle_rtp_stream_real_on_rtcp_ready (XmppXepJingleRtpStream* self)
{
	g_critical ("Type `%s' does not implement abstract method `xmpp_xep_jingle_rtp_stream_on_rtcp_ready'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
xmpp_xep_jingle_rtp_stream_on_rtcp_ready (XmppXepJingleRtpStream* self)
{
	XmppXepJingleRtpStreamClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_XEP_JINGLE_RTP_STREAM_GET_CLASS (self);
	if (_klass_->on_rtcp_ready) {
		_klass_->on_rtcp_ready (self);
	}
}

static void
xmpp_xep_jingle_rtp_stream_real_create (XmppXepJingleRtpStream* self)
{
	g_critical ("Type `%s' does not implement abstract method `xmpp_xep_jingle_rtp_stream_create'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
xmpp_xep_jingle_rtp_stream_create (XmppXepJingleRtpStream* self)
{
	XmppXepJingleRtpStreamClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_XEP_JINGLE_RTP_STREAM_GET_CLASS (self);
	if (_klass_->create) {
		_klass_->create (self);
	}
}

static void
xmpp_xep_jingle_rtp_stream_real_destroy (XmppXepJingleRtpStream* self)
{
	g_critical ("Type `%s' does not implement abstract method `xmpp_xep_jingle_rtp_stream_destroy'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
xmpp_xep_jingle_rtp_stream_destroy (XmppXepJingleRtpStream* self)
{
	XmppXepJingleRtpStreamClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_XEP_JINGLE_RTP_STREAM_GET_CLASS (self);
	if (_klass_->destroy) {
		_klass_->destroy (self);
	}
}

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

gchar*
xmpp_xep_jingle_rtp_stream_to_string (XmppXepJingleRtpStream* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	XmppXepJingleContent* _tmp6_;
	XmppXepJingleSession* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = xmpp_xep_jingle_rtp_stream_get_name (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = string_to_string (_tmp1_);
	_tmp3_ = xmpp_xep_jingle_rtp_stream_get_media (self);
	_tmp4_ = _tmp3_;
	_tmp5_ = string_to_string (_tmp4_);
	_tmp6_ = self->priv->_content;
	_tmp7_ = _tmp6_->session;
	_tmp8_ = xmpp_xep_jingle_session_get_sid (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = string_to_string (_tmp9_);
	_tmp11_ = g_strconcat (_tmp2_, "/", _tmp5_, " stream in ", _tmp10_, NULL);
	result = _tmp11_;
	return result;
}

XmppXepJingleContent*
xmpp_xep_jingle_rtp_stream_get_content (XmppXepJingleRtpStream* self)
{
	XmppXepJingleContent* result;
	XmppXepJingleContent* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content;
	result = _tmp0_;
	return result;
}

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

void
xmpp_xep_jingle_rtp_stream_set_content (XmppXepJingleRtpStream* self,
                                        XmppXepJingleContent* value)
{
	XmppXepJingleContent* old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_stream_get_content (self);
	if (old_value != value) {
		XmppXepJingleContent* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_content);
		self->priv->_content = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_CONTENT_PROPERTY]);
	}
}

const gchar*
xmpp_xep_jingle_rtp_stream_get_name (XmppXepJingleRtpStream* self)
{
	const gchar* result;
	XmppXepJingleContent* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content;
	_tmp1_ = xmpp_xep_jingle_content_get_content_name (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

const gchar*
xmpp_xep_jingle_rtp_stream_get_media (XmppXepJingleRtpStream* self)
{
	const gchar* result;
	XmppXepJingleContentParameters* content_params = NULL;
	XmppXepJingleContent* _tmp0_;
	XmppXepJingleContentParameters* _tmp1_;
	XmppXepJingleContentParameters* _tmp2_;
	XmppXepJingleContentParameters* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content;
	_tmp1_ = _tmp0_->content_params;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	content_params = _tmp2_;
	_tmp3_ = content_params;
	if (XMPP_XEP_JINGLE_RTP_IS_PARAMETERS (_tmp3_)) {
		XmppXepJingleContentParameters* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp4_ = content_params;
		_tmp5_ = xmpp_xep_jingle_rtp_parameters_get_media (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, XmppXepJingleRtpParameters));
		_tmp6_ = _tmp5_;
		result = _tmp6_;
		_g_object_unref0 (content_params);
		return result;
	}
	result = NULL;
	_g_object_unref0 (content_params);
	return result;
}

XmppXepJingleRtpPayloadType*
xmpp_xep_jingle_rtp_stream_get_payload_type (XmppXepJingleRtpStream* self)
{
	XmppXepJingleRtpPayloadType* result;
	XmppXepJingleContentParameters* content_params = NULL;
	XmppXepJingleContent* _tmp0_;
	XmppXepJingleContentParameters* _tmp1_;
	XmppXepJingleContentParameters* _tmp2_;
	XmppXepJingleContentParameters* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content;
	_tmp1_ = _tmp0_->content_params;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	content_params = _tmp2_;
	_tmp3_ = content_params;
	if (XMPP_XEP_JINGLE_RTP_IS_PARAMETERS (_tmp3_)) {
		XmppXepJingleContentParameters* _tmp4_;
		XmppXepJingleRtpPayloadType* _tmp5_;
		XmppXepJingleRtpPayloadType* _tmp6_;
		_tmp4_ = content_params;
		_tmp5_ = xmpp_xep_jingle_rtp_parameters_get_agreed_payload_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, XmppXepJingleRtpParameters));
		_tmp6_ = _tmp5_;
		result = _tmp6_;
		_g_object_unref0 (content_params);
		return result;
	}
	result = NULL;
	_g_object_unref0 (content_params);
	return result;
}

XmppXepJingleRtpCrypto*
xmpp_xep_jingle_rtp_stream_get_local_crypto (XmppXepJingleRtpStream* self)
{
	XmppXepJingleRtpCrypto* result;
	XmppXepJingleContentParameters* content_params = NULL;
	XmppXepJingleContent* _tmp0_;
	XmppXepJingleContentParameters* _tmp1_;
	XmppXepJingleContentParameters* _tmp2_;
	XmppXepJingleContentParameters* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content;
	_tmp1_ = _tmp0_->content_params;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	content_params = _tmp2_;
	_tmp3_ = content_params;
	if (XMPP_XEP_JINGLE_RTP_IS_PARAMETERS (_tmp3_)) {
		XmppXepJingleContentParameters* _tmp4_;
		XmppXepJingleRtpCrypto* _tmp5_;
		_tmp4_ = content_params;
		_tmp5_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, XmppXepJingleRtpParameters)->local_crypto;
		result = _tmp5_;
		_g_object_unref0 (content_params);
		return result;
	}
	result = NULL;
	_g_object_unref0 (content_params);
	return result;
}

XmppXepJingleRtpCrypto*
xmpp_xep_jingle_rtp_stream_get_remote_crypto (XmppXepJingleRtpStream* self)
{
	XmppXepJingleRtpCrypto* result;
	XmppXepJingleContentParameters* content_params = NULL;
	XmppXepJingleContent* _tmp0_;
	XmppXepJingleContentParameters* _tmp1_;
	XmppXepJingleContentParameters* _tmp2_;
	XmppXepJingleContentParameters* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content;
	_tmp1_ = _tmp0_->content_params;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	content_params = _tmp2_;
	_tmp3_ = content_params;
	if (XMPP_XEP_JINGLE_RTP_IS_PARAMETERS (_tmp3_)) {
		XmppXepJingleContentParameters* _tmp4_;
		XmppXepJingleRtpCrypto* _tmp5_;
		_tmp4_ = content_params;
		_tmp5_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, XmppXepJingleRtpParameters)->remote_crypto;
		result = _tmp5_;
		_g_object_unref0 (content_params);
		return result;
	}
	result = NULL;
	_g_object_unref0 (content_params);
	return result;
}

GeeList*
xmpp_xep_jingle_rtp_stream_get_header_extensions (XmppXepJingleRtpStream* self)
{
	GeeList* result;
	XmppXepJingleContentParameters* content_params = NULL;
	XmppXepJingleContent* _tmp0_;
	XmppXepJingleContentParameters* _tmp1_;
	XmppXepJingleContentParameters* _tmp2_;
	XmppXepJingleContentParameters* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content;
	_tmp1_ = _tmp0_->content_params;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	content_params = _tmp2_;
	_tmp3_ = content_params;
	if (XMPP_XEP_JINGLE_RTP_IS_PARAMETERS (_tmp3_)) {
		XmppXepJingleContentParameters* _tmp4_;
		GeeList* _tmp5_;
		_tmp4_ = content_params;
		_tmp5_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, XmppXepJingleRtpParameters)->header_extensions;
		result = _tmp5_;
		_g_object_unref0 (content_params);
		return result;
	}
	result = NULL;
	_g_object_unref0 (content_params);
	return result;
}

gboolean
xmpp_xep_jingle_rtp_stream_get_sending (XmppXepJingleRtpStream* self)
{
	gboolean result;
	XmppXepJingleContent* _tmp0_;
	XmppXepJingleSession* _tmp1_;
	XmppXepJingleContent* _tmp2_;
	XmppXepJingleSenders _tmp3_;
	XmppXepJingleSenders _tmp4_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_content;
	_tmp1_ = _tmp0_->session;
	_tmp2_ = self->priv->_content;
	_tmp3_ = xmpp_xep_jingle_content_get_senders (_tmp2_);
	_tmp4_ = _tmp3_;
	result = xmpp_xep_jingle_session_senders_include_us (_tmp1_, _tmp4_);
	return result;
}

gboolean
xmpp_xep_jingle_rtp_stream_get_receiving (XmppXepJingleRtpStream* self)
{
	gboolean result;
	XmppXepJingleContent* _tmp0_;
	XmppXepJingleSession* _tmp1_;
	XmppXepJingleContent* _tmp2_;
	XmppXepJingleSenders _tmp3_;
	XmppXepJingleSenders _tmp4_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_content;
	_tmp1_ = _tmp0_->session;
	_tmp2_ = self->priv->_content;
	_tmp3_ = xmpp_xep_jingle_content_get_senders (_tmp2_);
	_tmp4_ = _tmp3_;
	result = xmpp_xep_jingle_session_senders_include_counterpart (_tmp1_, _tmp4_);
	return result;
}

gboolean
xmpp_xep_jingle_rtp_stream_get_rtcp_mux (XmppXepJingleRtpStream* self)
{
	gboolean result;
	XmppXepJingleContentParameters* content_params = NULL;
	XmppXepJingleContent* _tmp0_;
	XmppXepJingleContentParameters* _tmp1_;
	XmppXepJingleContentParameters* _tmp2_;
	XmppXepJingleContentParameters* _tmp3_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_content;
	_tmp1_ = _tmp0_->content_params;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	content_params = _tmp2_;
	_tmp3_ = content_params;
	if (XMPP_XEP_JINGLE_RTP_IS_PARAMETERS (_tmp3_)) {
		XmppXepJingleContentParameters* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = content_params;
		_tmp5_ = xmpp_xep_jingle_rtp_parameters_get_rtcp_mux (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, XMPP_XEP_JINGLE_RTP_TYPE_PARAMETERS, XmppXepJingleRtpParameters));
		_tmp6_ = _tmp5_;
		result = _tmp6_;
		_g_object_unref0 (content_params);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (content_params);
	return result;
}

static gboolean
_xmpp_xep_jingle_rtp_stream_remb_enabled____lambda20_ (XmppXepJingleRtpStream* self,
                                                       XmppXepJingleRtpRtcpFeedback* it)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gboolean result;
	g_return_val_if_fail (it != NULL, FALSE);
	_tmp0_ = xmpp_xep_jingle_rtp_rtcp_feedback_get_type_ (it);
	_tmp1_ = _tmp0_;
	result = g_strcmp0 (_tmp1_, "goog-remb") == 0;
	return result;
}

static gboolean
__xmpp_xep_jingle_rtp_stream_remb_enabled____lambda20__gee_predicate (gconstpointer g,
                                                                      gpointer self)
{
	gboolean result;
	result = _xmpp_xep_jingle_rtp_stream_remb_enabled____lambda20_ ((XmppXepJingleRtpStream*) self, (XmppXepJingleRtpRtcpFeedback*) g);
	return result;
}

gboolean
xmpp_xep_jingle_rtp_stream_get_remb_enabled (XmppXepJingleRtpStream* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	XmppXepJingleRtpPayloadType* _tmp1_;
	XmppXepJingleRtpPayloadType* _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = xmpp_xep_jingle_rtp_stream_get_payload_type (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		XmppXepJingleRtpPayloadType* _tmp3_;
		XmppXepJingleRtpPayloadType* _tmp4_;
		GeeList* _tmp5_;
		_tmp3_ = xmpp_xep_jingle_rtp_stream_get_payload_type (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_->rtcp_fbs;
		_tmp0_ = gee_traversable_any_match ((GeeTraversable*) _tmp5_, __xmpp_xep_jingle_rtp_stream_remb_enabled____lambda20__gee_predicate, g_object_ref (self), g_object_unref);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

guint
xmpp_xep_jingle_rtp_stream_get_target_receive_bitrate (XmppXepJingleRtpStream* self)
{
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	result = self->priv->_target_receive_bitrate;
	return result;
}

void
xmpp_xep_jingle_rtp_stream_set_target_receive_bitrate (XmppXepJingleRtpStream* self,
                                                       guint value)
{
	guint old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_stream_get_target_receive_bitrate (self);
	if (old_value != value) {
		self->priv->_target_receive_bitrate = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_TARGET_RECEIVE_BITRATE_PROPERTY]);
	}
}

guint
xmpp_xep_jingle_rtp_stream_get_target_send_bitrate (XmppXepJingleRtpStream* self)
{
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	result = self->priv->_target_send_bitrate;
	return result;
}

void
xmpp_xep_jingle_rtp_stream_set_target_send_bitrate (XmppXepJingleRtpStream* self,
                                                    guint value)
{
	guint old_value;
	g_return_if_fail (self != NULL);
	old_value = xmpp_xep_jingle_rtp_stream_get_target_send_bitrate (self);
	if (old_value != value) {
		self->priv->_target_send_bitrate = value;
		g_object_notify_by_pspec ((GObject *) self, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_TARGET_SEND_BITRATE_PROPERTY]);
	}
}

static void
xmpp_xep_jingle_rtp_stream_class_init (XmppXepJingleRtpStreamClass * klass,
                                       gpointer klass_data)
{
	xmpp_xep_jingle_rtp_stream_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppXepJingleRtpStream_private_offset);
	((XmppXepJingleRtpStreamClass *) klass)->on_recv_rtp_data = (void (*) (XmppXepJingleRtpStream*, GBytes*)) xmpp_xep_jingle_rtp_stream_real_on_recv_rtp_data;
	((XmppXepJingleRtpStreamClass *) klass)->on_recv_rtcp_data = (void (*) (XmppXepJingleRtpStream*, GBytes*)) xmpp_xep_jingle_rtp_stream_real_on_recv_rtcp_data;
	((XmppXepJingleRtpStreamClass *) klass)->on_rtp_ready = (void (*) (XmppXepJingleRtpStream*)) xmpp_xep_jingle_rtp_stream_real_on_rtp_ready;
	((XmppXepJingleRtpStreamClass *) klass)->on_rtcp_ready = (void (*) (XmppXepJingleRtpStream*)) xmpp_xep_jingle_rtp_stream_real_on_rtcp_ready;
	((XmppXepJingleRtpStreamClass *) klass)->create = (void (*) (XmppXepJingleRtpStream*)) xmpp_xep_jingle_rtp_stream_real_create;
	((XmppXepJingleRtpStreamClass *) klass)->destroy = (void (*) (XmppXepJingleRtpStream*)) xmpp_xep_jingle_rtp_stream_real_destroy;
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_xep_jingle_rtp_stream_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_xep_jingle_rtp_stream_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_xep_jingle_rtp_stream_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_STREAM_CONTENT_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_CONTENT_PROPERTY] = g_param_spec_object ("content", "content", "content", XMPP_XEP_JINGLE_TYPE_CONTENT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_STREAM_NAME_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_STREAM_MEDIA_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_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_STREAM_PAYLOAD_TYPE_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_PAYLOAD_TYPE_PROPERTY] = xmpp_xep_jingle_rtp_param_spec_payload_type ("payload-type", "payload-type", "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_STREAM_LOCAL_CRYPTO_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_LOCAL_CRYPTO_PROPERTY] = xmpp_xep_jingle_rtp_param_spec_crypto ("local-crypto", "local-crypto", "local-crypto", XMPP_XEP_JINGLE_RTP_TYPE_CRYPTO, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_STREAM_REMOTE_CRYPTO_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_REMOTE_CRYPTO_PROPERTY] = xmpp_xep_jingle_rtp_param_spec_crypto ("remote-crypto", "remote-crypto", "remote-crypto", XMPP_XEP_JINGLE_RTP_TYPE_CRYPTO, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_STREAM_HEADER_EXTENSIONS_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_HEADER_EXTENSIONS_PROPERTY] = g_param_spec_object ("header-extensions", "header-extensions", "header-extensions", GEE_TYPE_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_STREAM_SENDING_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_SENDING_PROPERTY] = g_param_spec_boolean ("sending", "sending", "sending", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_STREAM_RECEIVING_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_RECEIVING_PROPERTY] = g_param_spec_boolean ("receiving", "receiving", "receiving", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_STREAM_RTCP_MUX_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_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_STREAM_REMB_ENABLED_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_REMB_ENABLED_PROPERTY] = g_param_spec_boolean ("remb-enabled", "remb-enabled", "remb-enabled", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_STREAM_TARGET_RECEIVE_BITRATE_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_TARGET_RECEIVE_BITRATE_PROPERTY] = g_param_spec_uint ("target-receive-bitrate", "target-receive-bitrate", "target-receive-bitrate", 0, G_MAXUINT, (guint) 256, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_XEP_JINGLE_RTP_STREAM_TARGET_SEND_BITRATE_PROPERTY, xmpp_xep_jingle_rtp_stream_properties[XMPP_XEP_JINGLE_RTP_STREAM_TARGET_SEND_BITRATE_PROPERTY] = g_param_spec_uint ("target-send-bitrate", "target-send-bitrate", "target-send-bitrate", 0, G_MAXUINT, (guint) 256, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	xmpp_xep_jingle_rtp_stream_signals[XMPP_XEP_JINGLE_RTP_STREAM_ON_SEND_RTP_DATA_SIGNAL] = g_signal_new ("on-send-rtp-data", XMPP_XEP_JINGLE_RTP_TYPE_STREAM, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, G_TYPE_BYTES);
	xmpp_xep_jingle_rtp_stream_signals[XMPP_XEP_JINGLE_RTP_STREAM_ON_SEND_RTCP_DATA_SIGNAL] = g_signal_new ("on-send-rtcp-data", XMPP_XEP_JINGLE_RTP_TYPE_STREAM, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, G_TYPE_BYTES);
}

static void
xmpp_xep_jingle_rtp_stream_instance_init (XmppXepJingleRtpStream * self,
                                          gpointer klass)
{
	self->priv = xmpp_xep_jingle_rtp_stream_get_instance_private (self);
	self->priv->_target_receive_bitrate = (guint) 256;
	self->priv->_target_send_bitrate = (guint) 256;
}

static void
xmpp_xep_jingle_rtp_stream_finalize (GObject * obj)
{
	XmppXepJingleRtpStream * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_XEP_JINGLE_RTP_TYPE_STREAM, XmppXepJingleRtpStream);
	_g_object_unref0 (self->priv->_content);
	G_OBJECT_CLASS (xmpp_xep_jingle_rtp_stream_parent_class)->finalize (obj);
}

static GType
xmpp_xep_jingle_rtp_stream_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleRtpStreamClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_rtp_stream_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppXepJingleRtpStream), 0, (GInstanceInitFunc) xmpp_xep_jingle_rtp_stream_instance_init, NULL };
	GType xmpp_xep_jingle_rtp_stream_type_id;
	xmpp_xep_jingle_rtp_stream_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppXepJingleRtpStream", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	XmppXepJingleRtpStream_private_offset = g_type_add_instance_private (xmpp_xep_jingle_rtp_stream_type_id, sizeof (XmppXepJingleRtpStreamPrivate));
	return xmpp_xep_jingle_rtp_stream_type_id;
}

GType
xmpp_xep_jingle_rtp_stream_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_rtp_stream_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_rtp_stream_type_id__once)) {
		GType xmpp_xep_jingle_rtp_stream_type_id;
		xmpp_xep_jingle_rtp_stream_type_id = xmpp_xep_jingle_rtp_stream_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_rtp_stream_type_id__once, xmpp_xep_jingle_rtp_stream_type_id);
	}
	return xmpp_xep_jingle_rtp_stream_type_id__once;
}

static void
_vala_xmpp_xep_jingle_rtp_stream_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	XmppXepJingleRtpStream * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_RTP_TYPE_STREAM, XmppXepJingleRtpStream);
	switch (property_id) {
		case XMPP_XEP_JINGLE_RTP_STREAM_CONTENT_PROPERTY:
		g_value_set_object (value, xmpp_xep_jingle_rtp_stream_get_content (self));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_NAME_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_rtp_stream_get_name (self));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_MEDIA_PROPERTY:
		g_value_set_string (value, xmpp_xep_jingle_rtp_stream_get_media (self));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_PAYLOAD_TYPE_PROPERTY:
		xmpp_xep_jingle_rtp_value_set_payload_type (value, xmpp_xep_jingle_rtp_stream_get_payload_type (self));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_LOCAL_CRYPTO_PROPERTY:
		xmpp_xep_jingle_rtp_value_set_crypto (value, xmpp_xep_jingle_rtp_stream_get_local_crypto (self));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_REMOTE_CRYPTO_PROPERTY:
		xmpp_xep_jingle_rtp_value_set_crypto (value, xmpp_xep_jingle_rtp_stream_get_remote_crypto (self));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_HEADER_EXTENSIONS_PROPERTY:
		g_value_set_object (value, xmpp_xep_jingle_rtp_stream_get_header_extensions (self));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_SENDING_PROPERTY:
		g_value_set_boolean (value, xmpp_xep_jingle_rtp_stream_get_sending (self));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_RECEIVING_PROPERTY:
		g_value_set_boolean (value, xmpp_xep_jingle_rtp_stream_get_receiving (self));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_RTCP_MUX_PROPERTY:
		g_value_set_boolean (value, xmpp_xep_jingle_rtp_stream_get_rtcp_mux (self));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_REMB_ENABLED_PROPERTY:
		g_value_set_boolean (value, xmpp_xep_jingle_rtp_stream_get_remb_enabled (self));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_TARGET_RECEIVE_BITRATE_PROPERTY:
		g_value_set_uint (value, xmpp_xep_jingle_rtp_stream_get_target_receive_bitrate (self));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_TARGET_SEND_BITRATE_PROPERTY:
		g_value_set_uint (value, xmpp_xep_jingle_rtp_stream_get_target_send_bitrate (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_xep_jingle_rtp_stream_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	XmppXepJingleRtpStream * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_XEP_JINGLE_RTP_TYPE_STREAM, XmppXepJingleRtpStream);
	switch (property_id) {
		case XMPP_XEP_JINGLE_RTP_STREAM_CONTENT_PROPERTY:
		xmpp_xep_jingle_rtp_stream_set_content (self, g_value_get_object (value));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_TARGET_RECEIVE_BITRATE_PROPERTY:
		xmpp_xep_jingle_rtp_stream_set_target_receive_bitrate (self, g_value_get_uint (value));
		break;
		case XMPP_XEP_JINGLE_RTP_STREAM_TARGET_SEND_BITRATE_PROPERTY:
		xmpp_xep_jingle_rtp_stream_set_target_send_bitrate (self, g_value_get_uint (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

