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

#include "rtp.h"
#include <glib.h>
#include <gst/app/app.h>
#include <gst/gst.h>
#include <gst/rtp/rtp.h>
#include "crypto-vala.h"
#include "xmpp-vala.h"
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gst/base/base.h>
#include <float.h>
#include <math.h>
#include <gst/video/video.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  {
	DINO_PLUGINS_RTP_STREAM_0_PROPERTY,
	DINO_PLUGINS_RTP_STREAM_RTPID_PROPERTY,
	DINO_PLUGINS_RTP_STREAM_PLUGIN_PROPERTY,
	DINO_PLUGINS_RTP_STREAM_PIPE_PROPERTY,
	DINO_PLUGINS_RTP_STREAM_RTPBIN_PROPERTY,
	DINO_PLUGINS_RTP_STREAM_CODEC_UTIL_PROPERTY,
	DINO_PLUGINS_RTP_STREAM_INPUT_DEVICE_PROPERTY,
	DINO_PLUGINS_RTP_STREAM_OUTPUT_DEVICE_PROPERTY,
	DINO_PLUGINS_RTP_STREAM_CREATED_PROPERTY,
	DINO_PLUGINS_RTP_STREAM_PAUSED_PROPERTY,
	DINO_PLUGINS_RTP_STREAM_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _crypto_srtp_session_unref0(var) ((var == NULL) ? NULL : (var = (crypto_srtp_session_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _gst_caps_unref0(var) ((var == NULL) ? NULL : (var = (gst_caps_unref (var), NULL)))
#define _gst_mini_object_unref0(var) ((var == NULL) ? NULL : (var = (gst_mini_object_unref (var), NULL)))
#define _gst_buffer_unref0(var) ((var == NULL) ? NULL : (var = (gst_buffer_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)))
#define _gst_sample_unref0(var) ((var == NULL) ? NULL : (var = (gst_sample_unref (var), NULL)))
#define _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))
typedef struct _Block10Data Block10Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	DINO_PLUGINS_RTP_STREAM_INCOMING_VIDEO_ORIENTATION_CHANGED_SIGNAL,
	DINO_PLUGINS_RTP_STREAM_NUM_SIGNALS
};
static guint dino_plugins_rtp_stream_signals[DINO_PLUGINS_RTP_STREAM_NUM_SIGNALS] = {0};
enum  {
	DINO_PLUGINS_RTP_VIDEO_STREAM_0_PROPERTY,
	DINO_PLUGINS_RTP_VIDEO_STREAM_NUM_PROPERTIES
};
static GParamSpec* dino_plugins_rtp_video_stream_properties[DINO_PLUGINS_RTP_VIDEO_STREAM_NUM_PROPERTIES];
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _DinoPluginsRtpStreamPrivate {
	guint8 _rtpid;
	DinoPluginsRtpPlugin* _plugin;
	GstAppSink* send_rtp;
	GstAppSink* send_rtcp;
	GstAppSrc* recv_rtp;
	GstAppSrc* recv_rtcp;
	GstElement* decode;
	GstRTPBaseDepayload* decode_depay;
	GstElement* input;
	GstPad* input_pad;
	GstElement* output;
	GstElement* session;
	DinoPluginsRtpDevice* _input_device;
	DinoPluginsRtpDevice* _output_device;
	gboolean _created;
	gboolean _paused;
	gboolean push_recv_data;
	guint our_ssrc;
	gint next_seqnum_offset;
	guint32 next_timestamp_offset_base;
	gint64 next_timestamp_offset_stamp;
	guint32 participant_ssrc;
	GstPad* recv_rtcp_sink_pad;
	GstPad* recv_rtp_sink_pad;
	GstPad* recv_rtp_src_pad;
	GstPad* send_rtcp_src_pad;
	GstPad* send_rtp_sink_pad;
	GstPad* send_rtp_src_pad;
	CryptoSrtpSession* crypto_session;
	gint last_packets_lost;
	guint64 last_packets_received;
	guint64 last_octets_received;
	guint max_target_receive_bitrate;
	gint64 last_remb_time;
	gboolean flip;
	guint8 rotation;
	guint16 previous_incoming_video_orientation_degree;
	gulong block_probe_handler_id;
};

struct _Block10Data {
	int _ref_count_;
	DinoPluginsRtpStream* _self_;
};

struct _DinoPluginsRtpVideoStreamPrivate {
	GeeList* outputs;
	GstElement* output_tee;
	GstElement* rotate;
	gulong incoming_video_orientation_changed_handler;
};

static gint DinoPluginsRtpStream_private_offset;
static gpointer dino_plugins_rtp_stream_parent_class = NULL;
static gint DinoPluginsRtpVideoStream_private_offset;
static gpointer dino_plugins_rtp_video_stream_parent_class = NULL;

static void dino_plugins_rtp_stream_set_plugin (DinoPluginsRtpStream* self,
                                         DinoPluginsRtpPlugin* value);
static void dino_plugins_rtp_stream_set_rtpid (DinoPluginsRtpStream* self,
                                        guint8 value);
static void _dino_plugins_rtp_stream_on_senders_changed_g_object_notify (GObject* _sender,
                                                                  GParamSpec* pspec,
                                                                  gpointer self);
static void dino_plugins_rtp_stream_real_create (XmppXepJingleRtpStream* base);
static GstFlowReturn dino_plugins_rtp_stream_on_new_sample (DinoPluginsRtpStream* self,
                                                     GstAppSink* sink);
static GstFlowReturn _dino_plugins_rtp_stream_on_new_sample_gst_app_sink_new_sample (GstAppSink* _sender,
                                                                              gpointer self);
static gboolean dino_plugins_rtp_stream_on_new_event (DinoPluginsRtpStream* self,
                                               GstAppSink* sink);
static gboolean _dino_plugins_rtp_stream_on_new_event_gst_app_sink_new_serialized_event (GstAppSink* _sender,
                                                                                  gpointer self);
static void dino_plugins_rtp_stream_on_eos_static (GstAppSink* sink,
                                            DinoPluginsRtpStream* _self_);
static void dino_plugins_rtp_stream_set_created (DinoPluginsRtpStream* self,
                                          gboolean value);
static void dino_plugins_rtp_stream_on_feedback_rtcp (GstElement* session,
                                               guint type,
                                               guint fbtype,
                                               guint sender_ssrc,
                                               guint media_ssrc,
                                               GstBuffer* fci,
                                               DinoPluginsRtpStream* _self_);
static gboolean ___lambda13_ (DinoPluginsRtpStream* self);
static gboolean dino_plugins_rtp_stream_remb_adjust (DinoPluginsRtpStream* self);
static gboolean ____lambda13__gsource_func (gpointer self);
static void dino_plugins_rtp_stream_encrypt_and_send_rtcp (DinoPluginsRtpStream* self,
                                                    guint8* data,
                                                    gint data_length1);
static guint8* _vala_array_dup1 (guint8* self,
                          gssize length);
static void dino_plugins_rtp_stream_prepare_local_crypto (DinoPluginsRtpStream* self);
static gboolean ___lambda10_ (DinoPluginsRtpStream* self,
                       XmppXepJingleRtpHeaderExtension* it);
static gboolean ____lambda10__gee_predicate (gconstpointer g,
                                      gpointer self);
static void dino_plugins_rtp_stream_encrypt_and_send_rtp (DinoPluginsRtpStream* self,
                                                   guint8* data,
                                                   gint data_length1);
static guint8* _vala_array_dup2 (guint8* self,
                          gssize length);
static guint8* _vala_array_dup3 (guint8* self,
                          gssize length);
static GstPadProbeReturn dino_plugins_rtp_stream_drop_probe (void);
static Block10Data* block10_data_ref (Block10Data* _data10_);
static void block10_data_unref (void * _userdata_);
static gboolean ___lambda11_ (Block10Data* _data10_);
static void dino_plugins_rtp_stream_on_send_rtp_eos (DinoPluginsRtpStream* self);
static gboolean ____lambda11__gsource_func (gpointer self);
static gboolean ____lambda12_ (Block10Data* _data10_);
static void dino_plugins_rtp_stream_on_send_rtcp_eos (DinoPluginsRtpStream* self);
static gboolean _____lambda12__gsource_func (gpointer self);
static void dino_plugins_rtp_stream_real_destroy (XmppXepJingleRtpStream* base);
static GstPadProbeReturn _dino_plugins_rtp_stream_drop_probe_gst_pad_probe_callback (GstPad* pad,
                                                                              GstPadProbeInfo* info,
                                                                              gpointer self);
static void dino_plugins_rtp_stream_prepare_remote_crypto (DinoPluginsRtpStream* self);
static void dino_plugins_rtp_stream_real_on_recv_rtp_data (XmppXepJingleRtpStream* base,
                                                    GBytes* bytes);
static gboolean _____lambda14_ (DinoPluginsRtpStream* self,
                         XmppXepJingleRtpHeaderExtension* it);
static gboolean ______lambda14__gee_predicate (gconstpointer g,
                                        gpointer self);
static void dino_plugins_rtp_stream_real_on_recv_rtcp_data (XmppXepJingleRtpStream* base,
                                                     GBytes* bytes);
static void dino_plugins_rtp_stream_real_on_rtp_ready (XmppXepJingleRtpStream* base);
static void dino_plugins_rtp_stream_real_on_rtcp_ready (XmppXepJingleRtpStream* base);
static void dino_plugins_rtp_stream_set_input_and_pause (DinoPluginsRtpStream* self,
                                                  GstElement* input,
                                                  gboolean paused);
static void dino_plugins_rtp_stream_set_paused (DinoPluginsRtpStream* self,
                                         gboolean value);
static guint32 dino_plugins_rtp_stream_get_next_timestamp_offset (DinoPluginsRtpStream* self);
static void dino_plugins_rtp_stream_real_add_output (DinoPluginsRtpStream* self,
                                              GstElement* element,
                                              XmppJid* participant);
static void dino_plugins_rtp_stream_real_remove_output (DinoPluginsRtpStream* self,
                                                 GstElement* element);
static void dino_plugins_rtp_stream_finalize (GObject * obj);
static GType dino_plugins_rtp_stream_get_type_once (void);
static void _vala_dino_plugins_rtp_stream_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_dino_plugins_rtp_stream_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);
static void dino_plugins_rtp_video_stream_real_create (XmppXepJingleRtpStream* base);
static void dino_plugins_rtp_video_stream_on_video_orientation_changed (DinoPluginsRtpVideoStream* self,
                                                                 guint16 degree);
static void _dino_plugins_rtp_video_stream_on_video_orientation_changed_dino_plugins_rtp_stream_incoming_video_orientation_changed (DinoPluginsRtpStream* _sender,
                                                                                                                             guint16 degree,
                                                                                                                             gpointer self);
static void dino_plugins_rtp_video_stream_real_destroy (XmppXepJingleRtpStream* base);
static void dino_plugins_rtp_video_stream_real_add_output (DinoPluginsRtpStream* base,
                                                    GstElement* element,
                                                    XmppJid* participant);
static void dino_plugins_rtp_video_stream_real_remove_output (DinoPluginsRtpStream* base,
                                                       GstElement* element);
static void dino_plugins_rtp_video_stream_finalize (GObject * obj);
static GType dino_plugins_rtp_video_stream_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_plugins_rtp_stream_get_instance_private (DinoPluginsRtpStream* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsRtpStream_private_offset);
}

static void
_dino_plugins_rtp_stream_on_senders_changed_g_object_notify (GObject* _sender,
                                                             GParamSpec* pspec,
                                                             gpointer self)
{
	dino_plugins_rtp_stream_on_senders_changed ((DinoPluginsRtpStream*) self);
}

DinoPluginsRtpStream*
dino_plugins_rtp_stream_construct (GType object_type,
                                   DinoPluginsRtpPlugin* plugin,
                                   XmppXepJingleContent* content)
{
	DinoPluginsRtpStream * self = NULL;
	g_return_val_if_fail (plugin != NULL, NULL);
	g_return_val_if_fail (content != NULL, NULL);
	self = (DinoPluginsRtpStream*) xmpp_xep_jingle_rtp_stream_construct (object_type, content);
	dino_plugins_rtp_stream_set_plugin (self, plugin);
	dino_plugins_rtp_stream_set_rtpid (self, dino_plugins_rtp_plugin_next_free_id (plugin));
	g_signal_connect_object ((GObject*) content, "notify::senders", (GCallback) _dino_plugins_rtp_stream_on_senders_changed_g_object_notify, self, G_CONNECT_AFTER);
	return self;
}

DinoPluginsRtpStream*
dino_plugins_rtp_stream_new (DinoPluginsRtpPlugin* plugin,
                             XmppXepJingleContent* content)
{
	return dino_plugins_rtp_stream_construct (DINO_PLUGINS_RTP_TYPE_STREAM, plugin, content);
}

void
dino_plugins_rtp_stream_on_senders_changed (DinoPluginsRtpStream* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_;
	gboolean _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp1_ = xmpp_xep_jingle_rtp_stream_get_sending ((XmppXepJingleRtpStream*) self);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GstElement* _tmp3_;
		_tmp3_ = self->priv->input;
		_tmp0_ = _tmp3_ == NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		DinoPluginsRtpDevice* _tmp4_;
		DinoPluginsRtpDevice* _tmp5_;
		_tmp4_ = dino_plugins_rtp_stream_get_input_device (self);
		_tmp5_ = _tmp4_;
		dino_plugins_rtp_stream_set_input_device (self, _tmp5_);
	}
	_tmp7_ = xmpp_xep_jingle_rtp_stream_get_receiving ((XmppXepJingleRtpStream*) self);
	_tmp8_ = _tmp7_;
	if (_tmp8_) {
		GstElement* _tmp9_;
		_tmp9_ = self->priv->output;
		_tmp6_ = _tmp9_ == NULL;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		DinoPluginsRtpDevice* _tmp10_;
		DinoPluginsRtpDevice* _tmp11_;
		_tmp10_ = dino_plugins_rtp_stream_get_output_device (self);
		_tmp11_ = _tmp10_;
		dino_plugins_rtp_stream_set_output_device (self, _tmp11_);
	}
}

static GstFlowReturn
_dino_plugins_rtp_stream_on_new_sample_gst_app_sink_new_sample (GstAppSink* _sender,
                                                                gpointer self)
{
	GstFlowReturn result;
	result = dino_plugins_rtp_stream_on_new_sample ((DinoPluginsRtpStream*) self, _sender);
	return result;
}

static gboolean
_dino_plugins_rtp_stream_on_new_event_gst_app_sink_new_serialized_event (GstAppSink* _sender,
                                                                         gpointer self)
{
	gboolean result;
	result = dino_plugins_rtp_stream_on_new_event ((DinoPluginsRtpStream*) self, _sender);
	return result;
}

static gboolean
___lambda13_ (DinoPluginsRtpStream* self)
{
	gboolean result;
	result = dino_plugins_rtp_stream_remb_adjust (self);
	return result;
}

static gboolean
____lambda13__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda13_ ((DinoPluginsRtpStream*) self);
	return result;
}

static void
dino_plugins_rtp_stream_real_create (XmppXepJingleRtpStream* base)
{
	DinoPluginsRtpStream * self;
	DinoPluginsRtpPlugin* _tmp0_;
	gboolean _tmp1_ = FALSE;
	GstElement* _tmp2_;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	GstElement* _tmp9_;
	guint8 _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	GstElement* _tmp21_;
	GstAppSink* _tmp22_;
	GstAppSink* _tmp23_;
	GstAppSink* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	XmppXepJingleRtpPayloadType* _tmp27_;
	XmppXepJingleRtpPayloadType* _tmp28_;
	GstCaps* _tmp29_;
	GstCaps* _tmp30_;
	GstAppSink* _tmp31_;
	GstAppSink* _tmp32_;
	GstAppSink* _tmp33_;
	GstAppSink* _tmp34_;
	GstAppSink* _tmp35_;
	GstAppSink* _tmp36_;
	GstAppSink* _tmp37_;
	GstPipeline* _tmp38_;
	GstPipeline* _tmp39_;
	GstAppSink* _tmp40_;
	guint8 _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	GstElement* _tmp46_;
	GstAppSink* _tmp47_;
	GstAppSink* _tmp48_;
	GstAppSink* _tmp49_;
	GstCaps* _tmp50_;
	GstCaps* _tmp51_;
	GstAppSink* _tmp52_;
	GstAppSink* _tmp53_;
	GstAppSink* _tmp54_;
	GstAppSink* _tmp55_;
	GstAppSink* _tmp56_;
	GstAppSink* _tmp57_;
	GstPipeline* _tmp58_;
	GstPipeline* _tmp59_;
	GstAppSink* _tmp60_;
	guint8 _tmp61_;
	gchar* _tmp62_;
	gchar* _tmp63_;
	gchar* _tmp64_;
	gchar* _tmp65_;
	GstElement* _tmp66_;
	GstAppSrc* _tmp67_;
	GstAppSrc* _tmp68_;
	const gchar* _tmp69_;
	const gchar* _tmp70_;
	XmppXepJingleRtpPayloadType* _tmp71_;
	XmppXepJingleRtpPayloadType* _tmp72_;
	GstCaps* _tmp73_;
	GstCaps* _tmp74_;
	GstAppSrc* _tmp75_;
	GstAppSrc* _tmp76_;
	GstAppSrc* _tmp77_;
	GstPipeline* _tmp78_;
	GstPipeline* _tmp79_;
	GstAppSrc* _tmp80_;
	guint8 _tmp81_;
	gchar* _tmp82_;
	gchar* _tmp83_;
	gchar* _tmp84_;
	gchar* _tmp85_;
	GstElement* _tmp86_;
	GstAppSrc* _tmp87_;
	GstAppSrc* _tmp88_;
	GstCaps* _tmp89_;
	GstCaps* _tmp90_;
	GstAppSrc* _tmp91_;
	GstAppSrc* _tmp92_;
	GstAppSrc* _tmp93_;
	GstPipeline* _tmp94_;
	GstPipeline* _tmp95_;
	GstAppSrc* _tmp96_;
	GstElement* _tmp97_;
	GstElement* _tmp98_;
	guint8 _tmp99_;
	gchar* _tmp100_;
	gchar* _tmp101_;
	gchar* _tmp102_;
	gchar* _tmp103_;
	GstPad* _tmp104_;
	GstPad* _tmp105_;
	GstAppSink* _tmp106_;
	GstPad* _tmp107_;
	GstPad* _tmp108_;
	GstElement* _tmp109_;
	GstElement* _tmp110_;
	guint8 _tmp111_;
	gchar* _tmp112_;
	gchar* _tmp113_;
	gchar* _tmp114_;
	gchar* _tmp115_;
	GstPad* _tmp116_;
	GstAppSrc* _tmp117_;
	GstPad* _tmp118_;
	GstPad* _tmp119_;
	GstPad* _tmp120_;
	GstElement* _tmp121_;
	GstElement* _tmp122_;
	guint8 _tmp123_;
	gchar* _tmp124_;
	gchar* _tmp125_;
	gchar* _tmp126_;
	gchar* _tmp127_;
	GstPad* _tmp128_;
	GstElement* _tmp129_;
	DinoPluginsRtpCodecUtil* _tmp139_;
	DinoPluginsRtpCodecUtil* _tmp140_;
	const gchar* _tmp141_;
	const gchar* _tmp142_;
	XmppXepJingleRtpPayloadType* _tmp143_;
	XmppXepJingleRtpPayloadType* _tmp144_;
	guint8 _tmp145_;
	gchar* _tmp146_;
	gchar* _tmp147_;
	gchar* _tmp148_;
	gchar* _tmp149_;
	GstElement* _tmp150_;
	GstElement* _tmp151_;
	guint8 _tmp152_;
	gchar* _tmp153_;
	gchar* _tmp154_;
	gchar* _tmp155_;
	gchar* _tmp156_;
	GstElement* _tmp157_;
	GstPipeline* _tmp158_;
	GstPipeline* _tmp159_;
	GstElement* _tmp160_;
	GstElement* _tmp161_;
	GstElement* _tmp164_;
	GstElement* _tmp165_;
	guint8 _tmp166_;
	gchar* _tmp167_;
	gchar* _tmp168_;
	gchar* _tmp169_;
	gchar* _tmp170_;
	GstPad* _tmp171_;
	GstAppSrc* _tmp172_;
	GstPad* _tmp173_;
	GstPad* _tmp174_;
	GstPad* _tmp175_;
	DinoPluginsRtpPlugin* _tmp176_;
	GstElement* _tmp177_;
	GstElement* _tmp178_;
	guint8 _tmp179_;
	GstElement* _tmp180_ = NULL;
	gboolean _tmp181_ = FALSE;
	GstElement* _tmp182_;
	gboolean _tmp189_ = FALSE;
	DinoPluginsRtpDevice* _tmp190_;
	DinoPluginsRtpDevice* _tmp191_;
	self = (DinoPluginsRtpStream*) base;
	_tmp0_ = self->priv->_plugin;
	dino_plugins_rtp_plugin_pause (_tmp0_);
	_tmp2_ = self->priv->input;
	if (_tmp2_ == NULL) {
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp3_ = xmpp_xep_jingle_rtp_stream_get_sending ((XmppXepJingleRtpStream*) self);
		_tmp4_ = _tmp3_;
		_tmp1_ = _tmp4_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		DinoPluginsRtpDevice* _tmp5_;
		DinoPluginsRtpDevice* _tmp6_;
		_tmp5_ = dino_plugins_rtp_stream_get_input_device (self);
		_tmp6_ = _tmp5_;
		dino_plugins_rtp_stream_set_input_device (self, _tmp6_);
	}
	_tmp9_ = self->priv->output;
	if (_tmp9_ == NULL) {
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp10_ = xmpp_xep_jingle_rtp_stream_get_receiving ((XmppXepJingleRtpStream*) self);
		_tmp11_ = _tmp10_;
		_tmp8_ = _tmp11_;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		_tmp12_ = xmpp_xep_jingle_rtp_stream_get_media ((XmppXepJingleRtpStream*) self);
		_tmp13_ = _tmp12_;
		_tmp7_ = g_strcmp0 (_tmp13_, "audio") == 0;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		DinoPluginsRtpDevice* _tmp14_;
		DinoPluginsRtpDevice* _tmp15_;
		_tmp14_ = dino_plugins_rtp_stream_get_output_device (self);
		_tmp15_ = _tmp14_;
		dino_plugins_rtp_stream_set_output_device (self, _tmp15_);
	}
	_tmp16_ = self->priv->_rtpid;
	_tmp17_ = g_strdup_printf ("%hhu", _tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = g_strconcat ("rtp_sink_", _tmp18_, NULL);
	_tmp20_ = _tmp19_;
	_tmp21_ = gst_element_factory_make ("appsink", _tmp20_);
	_tmp22_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, gst_app_sink_get_type ()) ? ((GstAppSink*) _tmp21_) : NULL;
	if (_tmp22_ == NULL) {
		_g_object_unref0 (_tmp21_);
	}
	if (_tmp22_ != NULL) {
		g_object_ref_sink (_tmp22_);
	}
	_g_object_unref0 (self->priv->send_rtp);
	self->priv->send_rtp = _tmp22_;
	_g_free0 (_tmp20_);
	_g_free0 (_tmp18_);
	_tmp23_ = self->priv->send_rtp;
	g_object_set ((GstBaseSink*) _tmp23_, "async", FALSE, NULL);
	_tmp24_ = self->priv->send_rtp;
	_tmp25_ = xmpp_xep_jingle_rtp_stream_get_media ((XmppXepJingleRtpStream*) self);
	_tmp26_ = _tmp25_;
	_tmp27_ = xmpp_xep_jingle_rtp_stream_get_payload_type ((XmppXepJingleRtpStream*) self);
	_tmp28_ = _tmp27_;
	_tmp29_ = dino_plugins_rtp_codec_util_get_caps (_tmp26_, _tmp28_, FALSE);
	_tmp30_ = _tmp29_;
	gst_app_sink_set_caps (_tmp24_, _tmp30_);
	_gst_caps_unref0 (_tmp30_);
	_tmp31_ = self->priv->send_rtp;
	gst_app_sink_set_emit_signals (_tmp31_, TRUE);
	_tmp32_ = self->priv->send_rtp;
	gst_base_sink_set_sync ((GstBaseSink*) _tmp32_, TRUE);
	_tmp33_ = self->priv->send_rtp;
	gst_app_sink_set_drop (_tmp33_, TRUE);
	_tmp34_ = self->priv->send_rtp;
	gst_app_sink_set_wait_on_eos (_tmp34_, FALSE);
	_tmp35_ = self->priv->send_rtp;
	g_signal_connect_object (_tmp35_, "new-sample", (GCallback) _dino_plugins_rtp_stream_on_new_sample_gst_app_sink_new_sample, self, 0);
	_tmp36_ = self->priv->send_rtp;
	g_signal_connect_object (_tmp36_, "new-serialized-event", (GCallback) _dino_plugins_rtp_stream_on_new_event_gst_app_sink_new_serialized_event, self, 0);
	_tmp37_ = self->priv->send_rtp;
	g_object_connect ((GObject*) _tmp37_, "signal::eos", dino_plugins_rtp_stream_on_eos_static, self, NULL);
	_tmp38_ = dino_plugins_rtp_stream_get_pipe (self);
	_tmp39_ = _tmp38_;
	_tmp40_ = self->priv->send_rtp;
	gst_bin_add ((GstBin*) _tmp39_, (GstElement*) _tmp40_);
	_tmp41_ = self->priv->_rtpid;
	_tmp42_ = g_strdup_printf ("%hhu", _tmp41_);
	_tmp43_ = _tmp42_;
	_tmp44_ = g_strconcat ("rtcp_sink_", _tmp43_, NULL);
	_tmp45_ = _tmp44_;
	_tmp46_ = gst_element_factory_make ("appsink", _tmp45_);
	_tmp47_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp46_, gst_app_sink_get_type ()) ? ((GstAppSink*) _tmp46_) : NULL;
	if (_tmp47_ == NULL) {
		_g_object_unref0 (_tmp46_);
	}
	if (_tmp47_ != NULL) {
		g_object_ref_sink (_tmp47_);
	}
	_g_object_unref0 (self->priv->send_rtcp);
	self->priv->send_rtcp = _tmp47_;
	_g_free0 (_tmp45_);
	_g_free0 (_tmp43_);
	_tmp48_ = self->priv->send_rtcp;
	g_object_set ((GstBaseSink*) _tmp48_, "async", FALSE, NULL);
	_tmp49_ = self->priv->send_rtcp;
	_tmp50_ = gst_caps_new_empty_simple ("application/x-rtcp");
	_tmp51_ = _tmp50_;
	gst_app_sink_set_caps (_tmp49_, _tmp51_);
	_gst_caps_unref0 (_tmp51_);
	_tmp52_ = self->priv->send_rtcp;
	gst_app_sink_set_emit_signals (_tmp52_, TRUE);
	_tmp53_ = self->priv->send_rtcp;
	gst_base_sink_set_sync ((GstBaseSink*) _tmp53_, TRUE);
	_tmp54_ = self->priv->send_rtcp;
	gst_app_sink_set_drop (_tmp54_, TRUE);
	_tmp55_ = self->priv->send_rtcp;
	gst_app_sink_set_wait_on_eos (_tmp55_, FALSE);
	_tmp56_ = self->priv->send_rtcp;
	g_signal_connect_object (_tmp56_, "new-sample", (GCallback) _dino_plugins_rtp_stream_on_new_sample_gst_app_sink_new_sample, self, 0);
	_tmp57_ = self->priv->send_rtcp;
	g_object_connect ((GObject*) _tmp57_, "signal::eos", dino_plugins_rtp_stream_on_eos_static, self, NULL);
	_tmp58_ = dino_plugins_rtp_stream_get_pipe (self);
	_tmp59_ = _tmp58_;
	_tmp60_ = self->priv->send_rtcp;
	gst_bin_add ((GstBin*) _tmp59_, (GstElement*) _tmp60_);
	_tmp61_ = self->priv->_rtpid;
	_tmp62_ = g_strdup_printf ("%hhu", _tmp61_);
	_tmp63_ = _tmp62_;
	_tmp64_ = g_strconcat ("rtp_src_", _tmp63_, NULL);
	_tmp65_ = _tmp64_;
	_tmp66_ = gst_element_factory_make ("appsrc", _tmp65_);
	_tmp67_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp66_, gst_app_src_get_type ()) ? ((GstAppSrc*) _tmp66_) : NULL;
	if (_tmp67_ == NULL) {
		_g_object_unref0 (_tmp66_);
	}
	if (_tmp67_ != NULL) {
		g_object_ref_sink (_tmp67_);
	}
	_g_object_unref0 (self->priv->recv_rtp);
	self->priv->recv_rtp = _tmp67_;
	_g_free0 (_tmp65_);
	_g_free0 (_tmp63_);
	_tmp68_ = self->priv->recv_rtp;
	_tmp69_ = xmpp_xep_jingle_rtp_stream_get_media ((XmppXepJingleRtpStream*) self);
	_tmp70_ = _tmp69_;
	_tmp71_ = xmpp_xep_jingle_rtp_stream_get_payload_type ((XmppXepJingleRtpStream*) self);
	_tmp72_ = _tmp71_;
	_tmp73_ = dino_plugins_rtp_codec_util_get_caps (_tmp70_, _tmp72_, TRUE);
	_tmp74_ = _tmp73_;
	gst_app_src_set_caps (_tmp68_, _tmp74_);
	_gst_caps_unref0 (_tmp74_);
	_tmp75_ = self->priv->recv_rtp;
	gst_base_src_set_do_timestamp ((GstBaseSrc*) _tmp75_, TRUE);
	_tmp76_ = self->priv->recv_rtp;
	g_object_set (_tmp76_, "format", GST_FORMAT_TIME, NULL);
	_tmp77_ = self->priv->recv_rtp;
	g_object_set (_tmp77_, "is-live", TRUE, NULL);
	_tmp78_ = dino_plugins_rtp_stream_get_pipe (self);
	_tmp79_ = _tmp78_;
	_tmp80_ = self->priv->recv_rtp;
	gst_bin_add ((GstBin*) _tmp79_, (GstElement*) _tmp80_);
	_tmp81_ = self->priv->_rtpid;
	_tmp82_ = g_strdup_printf ("%hhu", _tmp81_);
	_tmp83_ = _tmp82_;
	_tmp84_ = g_strconcat ("rtcp_src_", _tmp83_, NULL);
	_tmp85_ = _tmp84_;
	_tmp86_ = gst_element_factory_make ("appsrc", _tmp85_);
	_tmp87_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp86_, gst_app_src_get_type ()) ? ((GstAppSrc*) _tmp86_) : NULL;
	if (_tmp87_ == NULL) {
		_g_object_unref0 (_tmp86_);
	}
	if (_tmp87_ != NULL) {
		g_object_ref_sink (_tmp87_);
	}
	_g_object_unref0 (self->priv->recv_rtcp);
	self->priv->recv_rtcp = _tmp87_;
	_g_free0 (_tmp85_);
	_g_free0 (_tmp83_);
	_tmp88_ = self->priv->recv_rtcp;
	_tmp89_ = gst_caps_new_empty_simple ("application/x-rtcp");
	_tmp90_ = _tmp89_;
	gst_app_src_set_caps (_tmp88_, _tmp90_);
	_gst_caps_unref0 (_tmp90_);
	_tmp91_ = self->priv->recv_rtcp;
	gst_base_src_set_do_timestamp ((GstBaseSrc*) _tmp91_, TRUE);
	_tmp92_ = self->priv->recv_rtcp;
	g_object_set (_tmp92_, "format", GST_FORMAT_TIME, NULL);
	_tmp93_ = self->priv->recv_rtcp;
	g_object_set (_tmp93_, "is-live", TRUE, NULL);
	_tmp94_ = dino_plugins_rtp_stream_get_pipe (self);
	_tmp95_ = _tmp94_;
	_tmp96_ = self->priv->recv_rtcp;
	gst_bin_add ((GstBin*) _tmp95_, (GstElement*) _tmp96_);
	_tmp97_ = dino_plugins_rtp_stream_get_rtpbin (self);
	_tmp98_ = _tmp97_;
	_tmp99_ = self->priv->_rtpid;
	_tmp100_ = g_strdup_printf ("%hhu", _tmp99_);
	_tmp101_ = _tmp100_;
	_tmp102_ = g_strconcat ("send_rtcp_src_", _tmp101_, NULL);
	_tmp103_ = _tmp102_;
	_tmp104_ = gst_element_get_request_pad (_tmp98_, _tmp103_);
	_g_object_unref0 (self->priv->send_rtcp_src_pad);
	self->priv->send_rtcp_src_pad = _tmp104_;
	_g_free0 (_tmp103_);
	_g_free0 (_tmp101_);
	_tmp105_ = self->priv->send_rtcp_src_pad;
	_tmp106_ = self->priv->send_rtcp;
	_tmp107_ = gst_element_get_static_pad ((GstElement*) _tmp106_, "sink");
	_tmp108_ = _tmp107_;
	gst_pad_link_full (_tmp105_, _tmp108_, GST_PAD_LINK_CHECK_DEFAULT);
	_g_object_unref0 (_tmp108_);
	_tmp109_ = dino_plugins_rtp_stream_get_rtpbin (self);
	_tmp110_ = _tmp109_;
	_tmp111_ = self->priv->_rtpid;
	_tmp112_ = g_strdup_printf ("%hhu", _tmp111_);
	_tmp113_ = _tmp112_;
	_tmp114_ = g_strconcat ("recv_rtcp_sink_", _tmp113_, NULL);
	_tmp115_ = _tmp114_;
	_tmp116_ = gst_element_get_request_pad (_tmp110_, _tmp115_);
	_g_object_unref0 (self->priv->recv_rtcp_sink_pad);
	self->priv->recv_rtcp_sink_pad = _tmp116_;
	_g_free0 (_tmp115_);
	_g_free0 (_tmp113_);
	_tmp117_ = self->priv->recv_rtcp;
	_tmp118_ = gst_element_get_static_pad ((GstElement*) _tmp117_, "src");
	_tmp119_ = _tmp118_;
	_tmp120_ = self->priv->recv_rtcp_sink_pad;
	gst_pad_link_full (_tmp119_, _tmp120_, GST_PAD_LINK_CHECK_DEFAULT);
	_g_object_unref0 (_tmp119_);
	_tmp121_ = dino_plugins_rtp_stream_get_rtpbin (self);
	_tmp122_ = _tmp121_;
	_tmp123_ = self->priv->_rtpid;
	_tmp124_ = g_strdup_printf ("%hhu", _tmp123_);
	_tmp125_ = _tmp124_;
	_tmp126_ = g_strconcat ("send_rtp_sink_", _tmp125_, NULL);
	_tmp127_ = _tmp126_;
	_tmp128_ = gst_element_get_request_pad (_tmp122_, _tmp127_);
	_g_object_unref0 (self->priv->send_rtp_sink_pad);
	self->priv->send_rtp_sink_pad = _tmp128_;
	_g_free0 (_tmp127_);
	_g_free0 (_tmp125_);
	_tmp129_ = self->priv->input;
	if (_tmp129_ != NULL) {
		GstElement* _tmp130_;
		guint8 _tmp131_;
		gchar* _tmp132_;
		gchar* _tmp133_;
		gchar* _tmp134_;
		gchar* _tmp135_;
		GstPad* _tmp136_;
		GstPad* _tmp137_;
		GstPad* _tmp138_;
		_tmp130_ = self->priv->input;
		_tmp131_ = self->priv->_rtpid;
		_tmp132_ = g_strdup_printf ("%hhu", _tmp131_);
		_tmp133_ = _tmp132_;
		_tmp134_ = g_strconcat ("src_", _tmp133_, NULL);
		_tmp135_ = _tmp134_;
		_tmp136_ = gst_element_get_request_pad (_tmp130_, _tmp135_);
		_g_object_unref0 (self->priv->input_pad);
		self->priv->input_pad = _tmp136_;
		_g_free0 (_tmp135_);
		_g_free0 (_tmp133_);
		_tmp137_ = self->priv->input_pad;
		_tmp138_ = self->priv->send_rtp_sink_pad;
		gst_pad_link_full (_tmp137_, _tmp138_, GST_PAD_LINK_CHECK_DEFAULT);
	}
	_tmp139_ = dino_plugins_rtp_stream_get_codec_util (self);
	_tmp140_ = _tmp139_;
	_tmp141_ = xmpp_xep_jingle_rtp_stream_get_media ((XmppXepJingleRtpStream*) self);
	_tmp142_ = _tmp141_;
	_tmp143_ = xmpp_xep_jingle_rtp_stream_get_payload_type ((XmppXepJingleRtpStream*) self);
	_tmp144_ = _tmp143_;
	_tmp145_ = self->priv->_rtpid;
	_tmp146_ = g_strdup_printf ("%hhu", _tmp145_);
	_tmp147_ = _tmp146_;
	_tmp148_ = g_strconcat ("decode_", _tmp147_, NULL);
	_tmp149_ = _tmp148_;
	_tmp150_ = dino_plugins_rtp_codec_util_get_decode_bin (_tmp140_, _tmp142_, _tmp144_, _tmp149_);
	_g_object_unref0 (self->priv->decode);
	self->priv->decode = _tmp150_;
	_g_free0 (_tmp149_);
	_g_free0 (_tmp147_);
	_tmp151_ = self->priv->decode;
	_tmp152_ = self->priv->_rtpid;
	_tmp153_ = g_strdup_printf ("%hhu", _tmp152_);
	_tmp154_ = _tmp153_;
	_tmp155_ = g_strconcat ("decode_", _tmp154_, "_rtp_depay", NULL);
	_tmp156_ = _tmp155_;
	_tmp157_ = gst_bin_get_by_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp151_, gst_bin_get_type (), GstBin), _tmp156_);
	_g_object_unref0 (self->priv->decode_depay);
	self->priv->decode_depay = G_TYPE_CHECK_INSTANCE_CAST (_tmp157_, gst_rtp_base_depayload_get_type (), GstRTPBaseDepayload);
	_g_free0 (_tmp156_);
	_g_free0 (_tmp154_);
	_tmp158_ = dino_plugins_rtp_stream_get_pipe (self);
	_tmp159_ = _tmp158_;
	_tmp160_ = self->priv->decode;
	gst_bin_add ((GstBin*) _tmp159_, _tmp160_);
	_tmp161_ = self->priv->output;
	if (_tmp161_ != NULL) {
		GstElement* _tmp162_;
		GstElement* _tmp163_;
		_tmp162_ = self->priv->decode;
		_tmp163_ = self->priv->output;
		gst_element_link (_tmp162_, _tmp163_);
	}
	_tmp164_ = dino_plugins_rtp_stream_get_rtpbin (self);
	_tmp165_ = _tmp164_;
	_tmp166_ = self->priv->_rtpid;
	_tmp167_ = g_strdup_printf ("%hhu", _tmp166_);
	_tmp168_ = _tmp167_;
	_tmp169_ = g_strconcat ("recv_rtp_sink_", _tmp168_, NULL);
	_tmp170_ = _tmp169_;
	_tmp171_ = gst_element_get_request_pad (_tmp165_, _tmp170_);
	_g_object_unref0 (self->priv->recv_rtp_sink_pad);
	self->priv->recv_rtp_sink_pad = _tmp171_;
	_g_free0 (_tmp170_);
	_g_free0 (_tmp168_);
	_tmp172_ = self->priv->recv_rtp;
	_tmp173_ = gst_element_get_static_pad ((GstElement*) _tmp172_, "src");
	_tmp174_ = _tmp173_;
	_tmp175_ = self->priv->recv_rtp_sink_pad;
	gst_pad_link_full (_tmp174_, _tmp175_, GST_PAD_LINK_CHECK_DEFAULT);
	_g_object_unref0 (_tmp174_);
	dino_plugins_rtp_stream_set_created (self, TRUE);
	self->priv->push_recv_data = TRUE;
	_tmp176_ = self->priv->_plugin;
	dino_plugins_rtp_plugin_unpause (_tmp176_);
	_tmp177_ = dino_plugins_rtp_stream_get_rtpbin (self);
	_tmp178_ = _tmp177_;
	_tmp179_ = self->priv->_rtpid;
	g_signal_emit_by_name (_tmp178_, "get-session", _tmp179_, &_tmp180_, NULL);
	_g_object_unref0 (self->priv->session);
	self->priv->session = _tmp180_;
	_tmp182_ = self->priv->session;
	if (_tmp182_ != NULL) {
		gboolean _tmp183_;
		gboolean _tmp184_;
		_tmp183_ = xmpp_xep_jingle_rtp_stream_get_remb_enabled ((XmppXepJingleRtpStream*) self);
		_tmp184_ = _tmp183_;
		_tmp181_ = _tmp184_;
	} else {
		_tmp181_ = FALSE;
	}
	if (_tmp181_) {
		GObject* internal_session = NULL;
		GstElement* _tmp185_;
		GObject* _tmp186_ = NULL;
		GObject* _tmp187_;
		_tmp185_ = self->priv->session;
		g_object_get ((GObject*) _tmp185_, "internal-session", &_tmp186_, NULL);
		_g_object_unref0 (internal_session);
		internal_session = _tmp186_;
		_tmp187_ = internal_session;
		if (_tmp187_ != NULL) {
			GObject* _tmp188_;
			_tmp188_ = internal_session;
			g_object_connect (_tmp188_, "signal::on-feedback-rtcp", dino_plugins_rtp_stream_on_feedback_rtcp, self, NULL);
		}
		g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 1000, ____lambda13__gsource_func, g_object_ref (self), g_object_unref);
		_g_object_unref0 (internal_session);
	}
	_tmp190_ = dino_plugins_rtp_stream_get_input_device (self);
	_tmp191_ = _tmp190_;
	if (_tmp191_ != NULL) {
		const gchar* _tmp192_;
		const gchar* _tmp193_;
		_tmp192_ = xmpp_xep_jingle_rtp_stream_get_media ((XmppXepJingleRtpStream*) self);
		_tmp193_ = _tmp192_;
		_tmp189_ = g_strcmp0 (_tmp193_, "video") == 0;
	} else {
		_tmp189_ = FALSE;
	}
	if (_tmp189_) {
		DinoPluginsRtpDevice* _tmp194_;
		DinoPluginsRtpDevice* _tmp195_;
		XmppXepJingleRtpPayloadType* _tmp196_;
		XmppXepJingleRtpPayloadType* _tmp197_;
		guint _tmp198_;
		guint _tmp199_;
		_tmp194_ = dino_plugins_rtp_stream_get_input_device (self);
		_tmp195_ = _tmp194_;
		_tmp196_ = xmpp_xep_jingle_rtp_stream_get_payload_type ((XmppXepJingleRtpStream*) self);
		_tmp197_ = _tmp196_;
		_tmp198_ = xmpp_xep_jingle_rtp_stream_get_target_send_bitrate ((XmppXepJingleRtpStream*) self);
		_tmp199_ = _tmp198_;
		dino_plugins_rtp_device_update_bitrate (_tmp195_, _tmp197_, _tmp199_);
	}
}

static guint8*
_vala_array_dup1 (guint8* self,
                  gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (guint8));
	}
	return NULL;
}

static gboolean
dino_plugins_rtp_stream_remb_adjust (DinoPluginsRtpStream* self)
{
	GstStructure* stats = NULL;
	GstElement* _tmp0_;
	GstElement* _tmp2_;
	GstStructure* _tmp3_ = NULL;
	GstStructure* _tmp4_;
	GValueArray* source_stats = NULL;
	GstStructure* _tmp6_;
	GValueArray* _tmp7_ = NULL;
	GValueArray* _tmp8_;
	DinoPluginsRtpDevice* _tmp10_;
	DinoPluginsRtpDevice* _tmp11_;
	GValueArray* _tmp12_;
	GValue* _tmp13_;
	gint _tmp13__length1;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->session;
	if (_tmp0_ == NULL) {
		guint8 _tmp1_;
		_tmp1_ = self->priv->_rtpid;
		g_debug ("stream.vala:187: Session for %u finished, turning off remb adjustment", (guint) _tmp1_);
		result = G_SOURCE_REMOVE;
		return result;
	}
	_tmp2_ = self->priv->session;
	g_object_get ((GObject*) _tmp2_, "stats", &_tmp3_, NULL);
	stats = _tmp3_;
	_tmp4_ = stats;
	if (_tmp4_ == NULL) {
		guint8 _tmp5_;
		_tmp5_ = self->priv->_rtpid;
		g_warning ("stream.vala:192: No stats for session %u", (guint) _tmp5_);
		result = G_SOURCE_REMOVE;
		return result;
	}
	_tmp6_ = stats;
	gst_structure_get (_tmp6_, "source-stats", G_TYPE_VALUE_ARRAY, &_tmp7_, NULL);
	source_stats = _tmp7_;
	_tmp8_ = source_stats;
	if (_tmp8_ == NULL) {
		guint8 _tmp9_;
		_tmp9_ = self->priv->_rtpid;
		g_warning ("stream.vala:198: No source-stats for session %u", (guint) _tmp9_);
		result = G_SOURCE_REMOVE;
		return result;
	}
	_tmp10_ = dino_plugins_rtp_stream_get_input_device (self);
	_tmp11_ = _tmp10_;
	if (_tmp11_ == NULL) {
		result = G_SOURCE_CONTINUE;
		return result;
	}
	_tmp12_ = source_stats;
	_tmp13_ = _tmp12_->values;
	_tmp13__length1 = _tmp12_->n_values;
	{
		GValue* value_collection = NULL;
		gint value_collection_length1 = 0;
		gint _value_collection_size_ = 0;
		gint value_it = 0;
		value_collection = _tmp13_;
		value_collection_length1 = _tmp13__length1;
		for (value_it = 0; value_it < value_collection_length1; value_it = value_it + 1) {
			GValue _tmp14_;
			GValue _tmp15_ = {0};
			GValue value = {0};
			_tmp14_ = value_collection[value_it];
			if (G_IS_VALUE (&_tmp14_)) {
				g_value_init (&_tmp15_, G_VALUE_TYPE (&_tmp14_));
				g_value_copy (&_tmp14_, &_tmp15_);
			} else {
				_tmp15_ = _tmp14_;
			}
			value = _tmp15_;
			{
				GstStructure* source_stat = NULL;
				void* _tmp16_;
				guint32 ssrc = 0U;
				GstStructure* _tmp17_;
				guint _tmp18_ = 0U;
				gboolean _tmp19_;
				_tmp16_ = g_value_get_boxed (&value);
				source_stat = (GstStructure*) _tmp16_;
				_tmp17_ = source_stat;
				_tmp19_ = gst_structure_get_uint (_tmp17_, "ssrc", &_tmp18_);
				ssrc = (guint32) _tmp18_;
				if (!_tmp19_) {
					G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
					continue;
				}
				if (ssrc == self->priv->participant_ssrc) {
					gint packets_lost = 0;
					guint64 packets_received = 0ULL;
					guint64 octets_received = 0ULL;
					GstStructure* _tmp20_;
					gint _tmp21_ = 0;
					GstStructure* _tmp22_;
					guint64 _tmp23_ = 0ULL;
					GstStructure* _tmp24_;
					guint64 _tmp25_ = 0ULL;
					gint new_lost = 0;
					guint64 new_received = 0ULL;
					guint64 new_octets = 0ULL;
					gdouble loss_rate = 0.0;
					guint new_target_receive_bitrate = 0U;
					gboolean _tmp26_ = FALSE;
					guint _tmp33_;
					guint _tmp34_;
					_tmp20_ = source_stat;
					gst_structure_get_int (_tmp20_, "packets-lost", &_tmp21_);
					packets_lost = _tmp21_;
					_tmp22_ = source_stat;
					gst_structure_get_uint64 (_tmp22_, "packets-received", &_tmp23_);
					packets_received = _tmp23_;
					_tmp24_ = source_stat;
					gst_structure_get_uint64 (_tmp24_, "octets-received", &_tmp25_);
					octets_received = _tmp25_;
					new_lost = packets_lost - self->priv->last_packets_lost;
					if (new_lost < 0) {
						new_lost = 0;
					}
					new_received = packets_received - self->priv->last_packets_received;
					if (packets_received < self->priv->last_packets_received) {
						new_received = (guint64) 0;
					}
					new_octets = octets_received - self->priv->last_octets_received;
					if (octets_received < self->priv->last_octets_received) {
						octets_received = (guint64) 0;
					}
					if (new_received == ((guint64) 0)) {
						G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
						continue;
					}
					self->priv->last_packets_lost = packets_lost;
					self->priv->last_packets_received = packets_received;
					self->priv->last_octets_received = octets_received;
					loss_rate = ((gdouble) new_lost) / ((gdouble) (new_lost + new_received));
					if (new_lost <= 0) {
						_tmp26_ = TRUE;
					} else {
						_tmp26_ = loss_rate < 0.02;
					}
					if (_tmp26_) {
						guint _tmp27_;
						guint _tmp28_;
						_tmp27_ = xmpp_xep_jingle_rtp_stream_get_target_receive_bitrate ((XmppXepJingleRtpStream*) self);
						_tmp28_ = _tmp27_;
						new_target_receive_bitrate = (guint) (1.08 * ((gdouble) _tmp28_));
					} else {
						if (loss_rate > 0.1) {
							guint _tmp29_;
							guint _tmp30_;
							_tmp29_ = xmpp_xep_jingle_rtp_stream_get_target_receive_bitrate ((XmppXepJingleRtpStream*) self);
							_tmp30_ = _tmp29_;
							new_target_receive_bitrate = (guint) ((1.0 - (0.5 * loss_rate)) * ((gdouble) _tmp30_));
						} else {
							guint _tmp31_;
							guint _tmp32_;
							_tmp31_ = xmpp_xep_jingle_rtp_stream_get_target_receive_bitrate ((XmppXepJingleRtpStream*) self);
							_tmp32_ = _tmp31_;
							new_target_receive_bitrate = _tmp32_;
						}
					}
					if (self->priv->last_remb_time == ((gint64) 0)) {
						self->priv->last_remb_time = g_get_monotonic_time ();
					} else {
						gint64 time_now = 0LL;
						gint64 time_diff = 0LL;
						guint actual_bitrate = 0U;
						time_now = g_get_monotonic_time ();
						time_diff = time_now - self->priv->last_remb_time;
						self->priv->last_remb_time = time_now;
						actual_bitrate = (guint) ((((((gdouble) new_octets) * 8.0) * ((gdouble) time_diff)) / 1000.0) / 1000000.0);
						new_target_receive_bitrate = MAX (new_target_receive_bitrate, (guint) (0.9 * ((gdouble) actual_bitrate)));
						self->priv->max_target_receive_bitrate = MAX ((guint) (1.5 * ((gdouble) actual_bitrate)), self->priv->max_target_receive_bitrate);
						new_target_receive_bitrate = MIN (new_target_receive_bitrate, self->priv->max_target_receive_bitrate);
					}
					new_target_receive_bitrate = MAX ((guint) 16, new_target_receive_bitrate);
					_tmp33_ = xmpp_xep_jingle_rtp_stream_get_target_receive_bitrate ((XmppXepJingleRtpStream*) self);
					_tmp34_ = _tmp33_;
					if (new_target_receive_bitrate != _tmp34_) {
						guint8* data = NULL;
						guint8* _tmp35_;
						gint data_length1;
						gint _data_size_;
						guint8* _tmp36_;
						gint _tmp36__length1;
						guint8* _tmp37_;
						gint _tmp37__length1;
						guint8* _tmp38_;
						gint _tmp38__length1;
						guint8* _tmp39_;
						gint _tmp39__length1;
						guint8 br_exp = 0U;
						guint32 br_mant = 0U;
						guint _tmp40_;
						guint _tmp41_;
						guint8 bits = 0U;
						guint8* _tmp42_;
						gint _tmp42__length1;
						guint8* _tmp43_;
						gint _tmp43__length1;
						guint8* _tmp44_;
						gint _tmp44__length1;
						guint8* _tmp45_;
						gint _tmp45__length1;
						guint8* _tmp46_;
						gint _tmp46__length1;
						guint8* _tmp47_;
						gint _tmp47__length1;
						guint8* _tmp48_;
						gint _tmp48__length1;
						guint8* _tmp49_;
						gint _tmp49__length1;
						guint8* _tmp50_;
						gint _tmp50__length1;
						xmpp_xep_jingle_rtp_stream_set_target_receive_bitrate ((XmppXepJingleRtpStream*) self, new_target_receive_bitrate);
						_tmp35_ = g_new0 (guint8, 24);
						_tmp35_[0] = (guint8) 143;
						_tmp35_[1] = (guint8) 206;
						_tmp35_[2] = (guint8) 0;
						_tmp35_[3] = (guint8) 5;
						_tmp35_[4] = (guint8) 0;
						_tmp35_[5] = (guint8) 0;
						_tmp35_[6] = (guint8) 0;
						_tmp35_[7] = (guint8) 0;
						_tmp35_[8] = (guint8) 0;
						_tmp35_[9] = (guint8) 0;
						_tmp35_[10] = (guint8) 0;
						_tmp35_[11] = (guint8) 0;
						_tmp35_[12] = (guint8) 'R';
						_tmp35_[13] = (guint8) 'E';
						_tmp35_[14] = (guint8) 'M';
						_tmp35_[15] = (guint8) 'B';
						_tmp35_[16] = (guint8) 1;
						_tmp35_[17] = (guint8) 0;
						_tmp35_[18] = (guint8) 0;
						_tmp35_[19] = (guint8) 0;
						_tmp35_[20] = (guint8) 0;
						_tmp35_[21] = (guint8) 0;
						_tmp35_[22] = (guint8) 0;
						_tmp35_[23] = (guint8) 0;
						data = _tmp35_;
						data_length1 = 24;
						_data_size_ = data_length1;
						_tmp36_ = data;
						_tmp36__length1 = data_length1;
						_tmp36_[4] = (guint8) ((self->priv->our_ssrc >> 24) & 0xff);
						_tmp37_ = data;
						_tmp37__length1 = data_length1;
						_tmp37_[5] = (guint8) ((self->priv->our_ssrc >> 16) & 0xff);
						_tmp38_ = data;
						_tmp38__length1 = data_length1;
						_tmp38_[6] = (guint8) ((self->priv->our_ssrc >> 8) & 0xff);
						_tmp39_ = data;
						_tmp39__length1 = data_length1;
						_tmp39_[7] = (guint8) (self->priv->our_ssrc & 0xff);
						br_exp = (guint8) 0;
						_tmp40_ = xmpp_xep_jingle_rtp_stream_get_target_receive_bitrate ((XmppXepJingleRtpStream*) self);
						_tmp41_ = _tmp40_;
						br_mant = (guint32) (_tmp41_ * 1000);
						bits = (guint8) log2 ((gdouble) br_mant);
						if (((gint) bits) > 16) {
							br_exp = (guint8) (((guint8) bits) - 16);
							br_mant = br_mant >> br_exp;
						}
						_tmp42_ = data;
						_tmp42__length1 = data_length1;
						_tmp42_[17] = (guint8) ((br_exp << 2) | ((br_mant >> 16) & 0x3));
						_tmp43_ = data;
						_tmp43__length1 = data_length1;
						_tmp43_[18] = (guint8) ((br_mant >> 8) & 0xff);
						_tmp44_ = data;
						_tmp44__length1 = data_length1;
						_tmp44_[19] = (guint8) (br_mant & 0xff);
						_tmp45_ = data;
						_tmp45__length1 = data_length1;
						_tmp45_[20] = (guint8) ((ssrc >> 24) & 0xff);
						_tmp46_ = data;
						_tmp46__length1 = data_length1;
						_tmp46_[21] = (guint8) ((ssrc >> 16) & 0xff);
						_tmp47_ = data;
						_tmp47__length1 = data_length1;
						_tmp47_[22] = (guint8) ((ssrc >> 8) & 0xff);
						_tmp48_ = data;
						_tmp48__length1 = data_length1;
						_tmp48_[23] = (guint8) (ssrc & 0xff);
						_tmp49_ = data;
						_tmp49__length1 = data_length1;
						_tmp50_ = (_tmp49_ != NULL) ? _vala_array_dup1 (_tmp49_, _tmp49__length1) : _tmp49_;
						_tmp50__length1 = _tmp49__length1;
						dino_plugins_rtp_stream_encrypt_and_send_rtcp (self, _tmp50_, (gint) _tmp50__length1);
						data = (g_free (data), NULL);
					}
				}
				G_IS_VALUE (&value) ? (g_value_unset (&value), NULL) : NULL;
			}
		}
	}
	result = G_SOURCE_CONTINUE;
	return result;
}

static void
dino_plugins_rtp_stream_on_feedback_rtcp (GstElement* session,
                                          guint type,
                                          guint fbtype,
                                          guint sender_ssrc,
                                          guint media_ssrc,
                                          GstBuffer* fci,
                                          DinoPluginsRtpStream* _self_)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	DinoPluginsRtpDevice* _tmp5_;
	DinoPluginsRtpDevice* _tmp6_;
	g_return_if_fail (session != NULL);
	g_return_if_fail (_self_ != NULL);
	_tmp5_ = dino_plugins_rtp_stream_get_input_device (_self_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != NULL) {
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		_tmp7_ = xmpp_xep_jingle_rtp_stream_get_media ((XmppXepJingleRtpStream*) _self_);
		_tmp8_ = _tmp7_;
		_tmp4_ = g_strcmp0 (_tmp8_, "video") == 0;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		_tmp3_ = type == ((guint) 206);
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		_tmp2_ = fbtype == ((guint) 15);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		_tmp1_ = fci != NULL;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_tmp0_ = sender_ssrc == ((guint) _self_->priv->participant_ssrc);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		guint8* data = NULL;
		gint data_length1 = 0;
		gint _data_size_ = 0;
		guint8* _tmp9_ = NULL;
		gsize _tmp10_ = 0;
		gboolean _tmp11_ = FALSE;
		gboolean _tmp12_ = FALSE;
		gboolean _tmp13_ = FALSE;
		guint8* _tmp14_;
		gint _tmp14__length1;
		guint8 _tmp15_;
		guint8 br_exp = 0U;
		guint8* _tmp22_;
		gint _tmp22__length1;
		guint8 _tmp23_;
		guint32 br_mant = 0U;
		guint8* _tmp24_;
		gint _tmp24__length1;
		guint8 _tmp25_;
		guint8* _tmp26_;
		gint _tmp26__length1;
		guint8 _tmp27_;
		guint8* _tmp28_;
		gint _tmp28__length1;
		guint8 _tmp29_;
		DinoPluginsRtpDevice* _tmp30_;
		DinoPluginsRtpDevice* _tmp31_;
		XmppXepJingleRtpPayloadType* _tmp32_;
		XmppXepJingleRtpPayloadType* _tmp33_;
		guint _tmp34_;
		guint _tmp35_;
		gst_buffer_extract_dup (fci, (gsize) 0, gst_buffer_get_size (fci), &_tmp9_, &_tmp10_);
		data = (g_free (data), NULL);
		data = _tmp9_;
		data_length1 = _tmp10_;
		_data_size_ = data_length1;
		_tmp14_ = data;
		_tmp14__length1 = data_length1;
		_tmp15_ = _tmp14_[0];
		if (_tmp15_ != ((guint8) 'R')) {
			_tmp13_ = TRUE;
		} else {
			guint8* _tmp16_;
			gint _tmp16__length1;
			guint8 _tmp17_;
			_tmp16_ = data;
			_tmp16__length1 = data_length1;
			_tmp17_ = _tmp16_[1];
			_tmp13_ = _tmp17_ != ((guint8) 'E');
		}
		if (_tmp13_) {
			_tmp12_ = TRUE;
		} else {
			guint8* _tmp18_;
			gint _tmp18__length1;
			guint8 _tmp19_;
			_tmp18_ = data;
			_tmp18__length1 = data_length1;
			_tmp19_ = _tmp18_[2];
			_tmp12_ = _tmp19_ != ((guint8) 'M');
		}
		if (_tmp12_) {
			_tmp11_ = TRUE;
		} else {
			guint8* _tmp20_;
			gint _tmp20__length1;
			guint8 _tmp21_;
			_tmp20_ = data;
			_tmp20__length1 = data_length1;
			_tmp21_ = _tmp20_[3];
			_tmp11_ = _tmp21_ != ((guint8) 'B');
		}
		if (_tmp11_) {
			data = (g_free (data), NULL);
			return;
		}
		_tmp22_ = data;
		_tmp22__length1 = data_length1;
		_tmp23_ = _tmp22_[5];
		br_exp = (guint8) (_tmp23_ >> 2);
		_tmp24_ = data;
		_tmp24__length1 = data_length1;
		_tmp25_ = _tmp24_[5];
		_tmp26_ = data;
		_tmp26__length1 = data_length1;
		_tmp27_ = _tmp26_[6];
		_tmp28_ = data;
		_tmp28__length1 = data_length1;
		_tmp29_ = _tmp28_[7];
		br_mant = (((((guint32) _tmp25_) & 0x3) << 16) + (((guint32) _tmp27_) << 8)) + ((guint32) _tmp29_);
		xmpp_xep_jingle_rtp_stream_set_target_send_bitrate ((XmppXepJingleRtpStream*) _self_, (guint) ((br_mant << br_exp) / 1000));
		_tmp30_ = dino_plugins_rtp_stream_get_input_device (_self_);
		_tmp31_ = _tmp30_;
		_tmp32_ = xmpp_xep_jingle_rtp_stream_get_payload_type ((XmppXepJingleRtpStream*) _self_);
		_tmp33_ = _tmp32_;
		_tmp34_ = xmpp_xep_jingle_rtp_stream_get_target_send_bitrate ((XmppXepJingleRtpStream*) _self_);
		_tmp35_ = _tmp34_;
		dino_plugins_rtp_device_update_bitrate (_tmp31_, _tmp33_, _tmp35_);
		data = (g_free (data), NULL);
	}
}

static void
dino_plugins_rtp_stream_prepare_local_crypto (DinoPluginsRtpStream* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	XmppXepJingleRtpCrypto* _tmp2_;
	XmppXepJingleRtpCrypto* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp2_ = xmpp_xep_jingle_rtp_stream_get_local_crypto ((XmppXepJingleRtpStream*) self);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		XmppXepJingleRtpCrypto* _tmp4_;
		XmppXepJingleRtpCrypto* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp4_ = xmpp_xep_jingle_rtp_stream_get_local_crypto ((XmppXepJingleRtpStream*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = xmpp_xep_jingle_rtp_crypto_get_is_valid (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		CryptoSrtpSession* _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		_tmp8_ = self->priv->crypto_session;
		_tmp9_ = crypto_srtp_session_get_has_encrypt (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = !_tmp10_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		CryptoSrtpSession* _tmp11_;
		XmppXepJingleRtpCrypto* _tmp12_;
		XmppXepJingleRtpCrypto* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		XmppXepJingleRtpCrypto* _tmp16_;
		XmppXepJingleRtpCrypto* _tmp17_;
		guint8* _tmp18_;
		gint _tmp18__length1;
		gint _tmp19_ = 0;
		guint8* _tmp20_;
		gint _tmp20__length1;
		guint8* _tmp21_;
		gint _tmp21__length1;
		XmppXepJingleRtpCrypto* _tmp22_;
		XmppXepJingleRtpCrypto* _tmp23_;
		guint8* _tmp24_;
		gint _tmp24__length1;
		gint _tmp25_ = 0;
		guint8* _tmp26_;
		gint _tmp26__length1;
		guint8* _tmp27_;
		gint _tmp27__length1;
		XmppXepJingleRtpCrypto* _tmp28_;
		XmppXepJingleRtpCrypto* _tmp29_;
		const gchar* _tmp30_;
		const gchar* _tmp31_;
		_tmp11_ = self->priv->crypto_session;
		_tmp12_ = xmpp_xep_jingle_rtp_stream_get_local_crypto ((XmppXepJingleRtpStream*) self);
		_tmp13_ = _tmp12_;
		_tmp14_ = xmpp_xep_jingle_rtp_crypto_get_crypto_suite (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = xmpp_xep_jingle_rtp_stream_get_local_crypto ((XmppXepJingleRtpStream*) self);
		_tmp17_ = _tmp16_;
		_tmp18_ = xmpp_xep_jingle_rtp_crypto_get_key (_tmp17_, &_tmp19_);
		_tmp18__length1 = _tmp19_;
		_tmp20_ = _tmp18_;
		_tmp20__length1 = _tmp18__length1;
		_tmp21_ = _tmp20_;
		_tmp21__length1 = _tmp20__length1;
		_tmp22_ = xmpp_xep_jingle_rtp_stream_get_local_crypto ((XmppXepJingleRtpStream*) self);
		_tmp23_ = _tmp22_;
		_tmp24_ = xmpp_xep_jingle_rtp_crypto_get_salt (_tmp23_, &_tmp25_);
		_tmp24__length1 = _tmp25_;
		_tmp26_ = _tmp24_;
		_tmp26__length1 = _tmp24__length1;
		_tmp27_ = _tmp26_;
		_tmp27__length1 = _tmp26__length1;
		crypto_srtp_session_set_encryption_key (_tmp11_, _tmp15_, _tmp21_, (gint) _tmp20__length1, _tmp27_, (gint) _tmp26__length1);
		_tmp27_ = (g_free (_tmp27_), NULL);
		_tmp21_ = (g_free (_tmp21_), NULL);
		_tmp28_ = xmpp_xep_jingle_rtp_stream_get_local_crypto ((XmppXepJingleRtpStream*) self);
		_tmp29_ = _tmp28_;
		_tmp30_ = xmpp_xep_jingle_rtp_crypto_get_key_params (_tmp29_);
		_tmp31_ = _tmp30_;
		g_debug ("stream.vala:296: Setting up encryption with key params %s", _tmp31_);
	}
}

static gboolean
dino_plugins_rtp_stream_on_new_event (DinoPluginsRtpStream* self,
                                      GstAppSink* sink)
{
	gboolean _tmp0_ = FALSE;
	GstMiniObject* obj = NULL;
	GstMiniObject* _tmp2_ = NULL;
	GstMiniObject* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (sink != NULL, FALSE);
	if (sink == NULL) {
		_tmp0_ = TRUE;
	} else {
		GstAppSink* _tmp1_;
		_tmp1_ = self->priv->send_rtp;
		_tmp0_ = sink != _tmp1_;
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	g_signal_emit_by_name (sink, "try-pull-object", (guint64) 0, &_tmp2_);
	obj = _tmp2_;
	_tmp3_ = obj;
	if (_tmp3_->type == gst_event_get_type ()) {
		GstTagList* tags = NULL;
		GstMiniObject* _tmp4_;
		_tmp4_ = obj;
		if (((GstEvent*) _tmp4_)->type == GST_EVENT_TAG) {
			GstMiniObject* _tmp5_;
			GstTagList* _tmp6_ = NULL;
			GstVideoOrientationMethod orientation_method = 0;
			GstTagList* _tmp7_;
			GstVideoOrientationMethod _tmp8_ = 0;
			_tmp5_ = obj;
			gst_event_parse_tag ((GstEvent*) _tmp5_, &_tmp6_);
			tags = _tmp6_;
			_tmp7_ = tags;
			gst_video_orientation_from_tag (_tmp7_, &_tmp8_);
			orientation_method = _tmp8_;
			switch (orientation_method) {
				default:
				case GST_VIDEO_ORIENTATION_IDENTITY:
				case GST_VIDEO_ORIENTATION_VERT:
				{
					self->priv->rotation = (guint8) 0;
					break;
				}
				case GST_VIDEO_ORIENTATION_90R:
				case GST_VIDEO_ORIENTATION_UL_LR:
				{
					self->priv->rotation = (guint8) 1;
					break;
				}
				case GST_VIDEO_ORIENTATION_180:
				case GST_VIDEO_ORIENTATION_HORIZ:
				{
					self->priv->rotation = (guint8) 2;
					break;
				}
				case GST_VIDEO_ORIENTATION_90L:
				case GST_VIDEO_ORIENTATION_UR_LL:
				{
					self->priv->rotation = (guint8) 3;
					break;
				}
			}
			switch (orientation_method) {
				default:
				case GST_VIDEO_ORIENTATION_IDENTITY:
				case GST_VIDEO_ORIENTATION_90R:
				case GST_VIDEO_ORIENTATION_180:
				case GST_VIDEO_ORIENTATION_90L:
				{
					self->priv->flip = FALSE;
					break;
				}
				case GST_VIDEO_ORIENTATION_VERT:
				case GST_VIDEO_ORIENTATION_UL_LR:
				case GST_VIDEO_ORIENTATION_HORIZ:
				case GST_VIDEO_ORIENTATION_UR_LL:
				{
					self->priv->flip = TRUE;
					break;
				}
			}
		}
	}
	result = FALSE;
	_gst_mini_object_unref0 (obj);
	return result;
}

static gpointer
_gst_buffer_ref0 (gpointer self)
{
	return self ? gst_buffer_ref (self) : NULL;
}

static gboolean
___lambda10_ (DinoPluginsRtpStream* self,
              XmppXepJingleRtpHeaderExtension* it)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gboolean result;
	g_return_val_if_fail (it != NULL, FALSE);
	_tmp0_ = xmpp_xep_jingle_rtp_header_extension_get_uri (it);
	_tmp1_ = _tmp0_;
	result = g_strcmp0 (_tmp1_, "urn:3gpp:video-orientation") == 0;
	return result;
}

static gboolean
____lambda10__gee_predicate (gconstpointer g,
                             gpointer self)
{
	gboolean result;
	result = ___lambda10_ ((DinoPluginsRtpStream*) self, (XmppXepJingleRtpHeaderExtension*) g);
	return result;
}

static GstFlowReturn
dino_plugins_rtp_stream_on_new_sample (DinoPluginsRtpStream* self,
                                       GstAppSink* sink)
{
	gboolean _tmp0_ = FALSE;
	GstAppSink* _tmp1_;
	GstSample* sample = NULL;
	GstSample* _tmp3_;
	GstBuffer* buffer = NULL;
	GstSample* _tmp4_;
	GstBuffer* _tmp5_;
	GstBuffer* _tmp6_;
	GstAppSink* _tmp7_;
	GstAppSink* _tmp11_;
	guint8* data = NULL;
	gint data_length1 = 0;
	gint _data_size_ = 0;
	GstBuffer* _tmp35_;
	GstBuffer* _tmp36_;
	guint8* _tmp37_ = NULL;
	gsize _tmp38_ = 0;
	GstAppSink* _tmp39_;
	GstFlowReturn result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (sink != NULL, 0);
	if (sink == NULL) {
		g_debug ("stream.vala:356: Sink is null");
		result = GST_FLOW_EOS;
		return result;
	}
	_tmp1_ = self->priv->send_rtp;
	if (sink != _tmp1_) {
		GstAppSink* _tmp2_;
		_tmp2_ = self->priv->send_rtcp;
		_tmp0_ = sink != _tmp2_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		g_warning ("stream.vala:360: unknown sample");
		result = GST_FLOW_NOT_SUPPORTED;
		return result;
	}
	_tmp3_ = gst_app_sink_pull_sample (sink);
	sample = _tmp3_;
	_tmp4_ = sample;
	_tmp5_ = gst_sample_get_buffer (_tmp4_);
	_tmp6_ = _gst_buffer_ref0 (_tmp5_);
	buffer = _tmp6_;
	_tmp7_ = self->priv->send_rtp;
	if (sink == _tmp7_) {
		guint buffer_ssrc = 0U;
		guint buffer_seq = 0U;
		GstRTPBuffer rtp_buffer = {0};
		GstBuffer* _tmp8_;
		GstRTPBuffer _tmp9_ = {0};
		gboolean _tmp10_;
		buffer_ssrc = (guint) 0;
		buffer_seq = (guint) 0;
		_tmp8_ = buffer;
		_tmp10_ = gst_rtp_buffer_map (_tmp8_, GST_MAP_READ, &_tmp9_);
		rtp_buffer = _tmp9_;
		if (_tmp10_) {
			buffer_ssrc = (guint) gst_rtp_buffer_get_ssrc (&rtp_buffer);
			buffer_seq = (guint) gst_rtp_buffer_get_seq (&rtp_buffer);
			self->priv->next_seqnum_offset = gst_rtp_buffer_get_seq (&rtp_buffer) + 1;
			self->priv->next_timestamp_offset_base = gst_rtp_buffer_get_timestamp (&rtp_buffer);
			self->priv->next_timestamp_offset_stamp = g_get_monotonic_time ();
			gst_rtp_buffer_unmap (&rtp_buffer);
		}
	}
	_tmp11_ = self->priv->send_rtp;
	if (sink == _tmp11_) {
		XmppXepJingleRtpHeaderExtension* ext = NULL;
		GeeList* _tmp12_;
		GeeList* _tmp13_;
		gpointer _tmp14_;
		XmppXepJingleRtpHeaderExtension* _tmp15_;
		_tmp12_ = xmpp_xep_jingle_rtp_stream_get_header_extensions ((XmppXepJingleRtpStream*) self);
		_tmp13_ = _tmp12_;
		_tmp14_ = gee_traversable_first_match ((GeeTraversable*) _tmp13_, ____lambda10__gee_predicate, g_object_ref (self), g_object_unref);
		ext = (XmppXepJingleRtpHeaderExtension*) _tmp14_;
		_tmp15_ = ext;
		if (_tmp15_ != NULL) {
			GstBuffer* _tmp16_;
			GstMiniObject* _tmp17_;
			GstRTPBuffer rtp_buffer = {0};
			GstBuffer* _tmp18_;
			GstRTPBuffer _tmp19_ = {0};
			gboolean _tmp20_;
			_tmp16_ = buffer;
			buffer = NULL;
			_tmp17_ = _tmp16_ = gst_mini_object_make_writable (_tmp16_);
			_gst_buffer_unref0 (buffer);
			buffer = (GstBuffer*) _tmp17_;
			_tmp18_ = buffer;
			_tmp20_ = gst_rtp_buffer_map (_tmp18_, GST_MAP_WRITE, &_tmp19_);
			rtp_buffer = _tmp19_;
			if (_tmp20_) {
				guint8* extension_data = NULL;
				guint8* _tmp21_;
				gint extension_data_length1;
				gint _extension_data_size_;
				gboolean camera = FALSE;
				guint8* _tmp22_;
				gint _tmp22__length1;
				guint8* _tmp23_;
				gint _tmp23__length1;
				guint8 _tmp24_;
				XmppXepJingleRtpHeaderExtension* _tmp31_;
				guint8 _tmp32_;
				guint8 _tmp33_;
				guint8* _tmp34_;
				gint _tmp34__length1;
				_tmp21_ = g_new0 (guint8, 1);
				extension_data = _tmp21_;
				extension_data_length1 = 1;
				_extension_data_size_ = extension_data_length1;
				camera = FALSE;
				_tmp22_ = extension_data;
				_tmp22__length1 = extension_data_length1;
				_tmp23_ = extension_data;
				_tmp23__length1 = extension_data_length1;
				_tmp24_ = _tmp23_[0];
				_tmp22_[0] = _tmp24_ | (self->priv->rotation & 0x3);
				if (self->priv->flip) {
					guint8* _tmp25_;
					gint _tmp25__length1;
					guint8* _tmp26_;
					gint _tmp26__length1;
					guint8 _tmp27_;
					_tmp25_ = extension_data;
					_tmp25__length1 = extension_data_length1;
					_tmp26_ = extension_data;
					_tmp26__length1 = extension_data_length1;
					_tmp27_ = _tmp26_[0];
					_tmp25_[0] = _tmp27_ | 0x4;
				}
				if (camera) {
					guint8* _tmp28_;
					gint _tmp28__length1;
					guint8* _tmp29_;
					gint _tmp29__length1;
					guint8 _tmp30_;
					_tmp28_ = extension_data;
					_tmp28__length1 = extension_data_length1;
					_tmp29_ = extension_data;
					_tmp29__length1 = extension_data_length1;
					_tmp30_ = _tmp29_[0];
					_tmp28_[0] = _tmp30_ | 0x8;
				}
				_tmp31_ = ext;
				_tmp32_ = xmpp_xep_jingle_rtp_header_extension_get_id (_tmp31_);
				_tmp33_ = _tmp32_;
				_tmp34_ = extension_data;
				_tmp34__length1 = extension_data_length1;
				gst_rtp_buffer_add_extension_onebyte_header (&rtp_buffer, _tmp33_, _tmp34_, (guint) _tmp34__length1);
				extension_data = (g_free (extension_data), NULL);
			}
		}
		_xmpp_xep_jingle_rtp_header_extension_unref0 (ext);
	}
	dino_plugins_rtp_stream_prepare_local_crypto (self);
	_tmp35_ = buffer;
	_tmp36_ = buffer;
	gst_buffer_extract_dup (_tmp35_, (gsize) 0, gst_buffer_get_size (_tmp36_), &_tmp37_, &_tmp38_);
	data = (g_free (data), NULL);
	data = _tmp37_;
	data_length1 = _tmp38_;
	_data_size_ = data_length1;
	_tmp39_ = self->priv->send_rtp;
	if (sink == _tmp39_) {
		guint8* _tmp40_;
		gint _tmp40__length1;
		_tmp40_ = data;
		_tmp40__length1 = data_length1;
		data = NULL;
		data_length1 = 0;
		dino_plugins_rtp_stream_encrypt_and_send_rtp (self, _tmp40_, (gint) _tmp40__length1);
	} else {
		GstAppSink* _tmp41_;
		_tmp41_ = self->priv->send_rtcp;
		if (sink == _tmp41_) {
			guint8* _tmp42_;
			gint _tmp42__length1;
			_tmp42_ = data;
			_tmp42__length1 = data_length1;
			data = NULL;
			data_length1 = 0;
			dino_plugins_rtp_stream_encrypt_and_send_rtcp (self, _tmp42_, (gint) _tmp42__length1);
		}
	}
	result = GST_FLOW_OK;
	data = (g_free (data), NULL);
	_gst_buffer_unref0 (buffer);
	_gst_sample_unref0 (sample);
	return result;
}

static guint8*
_vala_array_dup2 (guint8* self,
                  gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (guint8));
	}
	return NULL;
}

static void
dino_plugins_rtp_stream_encrypt_and_send_rtp (DinoPluginsRtpStream* self,
                                              guint8* data,
                                              gint data_length1)
{
	GBytes* bytes = NULL;
	CryptoSrtpSession* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GBytes* _tmp11_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->crypto_session;
	_tmp1_ = crypto_srtp_session_get_has_encrypt (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		guint8* _tmp3_ = NULL;
		CryptoSrtpSession* _tmp4_;
		gint _tmp5_ = 0;
		guint8* _tmp6_;
		gint _tmp3__length1;
		gint __tmp3__size_;
		guint8* _tmp7_;
		gint _tmp7__length1;
		GBytes* _tmp8_;
		_tmp4_ = self->priv->crypto_session;
		_tmp6_ = crypto_srtp_session_encrypt_rtp (_tmp4_, data, (gint) data_length1, &_tmp5_, &_inner_error0_);
		_tmp3_ = _tmp6_;
		_tmp3__length1 = _tmp5_;
		__tmp3__size_ = _tmp3__length1;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_bytes_unref0 (bytes);
			data = (g_free (data), NULL);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp7_ = _tmp3_;
		_tmp7__length1 = _tmp3__length1;
		_tmp3_ = NULL;
		_tmp3__length1 = 0;
		_tmp8_ = g_bytes_new_take (_tmp7_, _tmp7__length1);
		_g_bytes_unref0 (bytes);
		bytes = _tmp8_;
		_tmp3_ = (g_free (_tmp3_), NULL);
	} else {
		guint8* _tmp9_;
		gint _tmp9__length1;
		GBytes* _tmp10_;
		_tmp9_ = (data != NULL) ? _vala_array_dup2 (data, data_length1) : data;
		_tmp9__length1 = data_length1;
		_tmp10_ = g_bytes_new_take (_tmp9_, _tmp9__length1);
		_g_bytes_unref0 (bytes);
		bytes = _tmp10_;
	}
	_tmp11_ = bytes;
	g_signal_emit_by_name ((XmppXepJingleRtpStream*) self, "on-send-rtp-data", _tmp11_);
	_g_bytes_unref0 (bytes);
	data = (g_free (data), NULL);
}

static guint8*
_vala_array_dup3 (guint8* self,
                  gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (guint8));
	}
	return NULL;
}

static void
dino_plugins_rtp_stream_encrypt_and_send_rtcp (DinoPluginsRtpStream* self,
                                               guint8* data,
                                               gint data_length1)
{
	GBytes* bytes = NULL;
	CryptoSrtpSession* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->crypto_session;
	_tmp1_ = crypto_srtp_session_get_has_encrypt (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		guint8* _tmp3_ = NULL;
		CryptoSrtpSession* _tmp4_;
		gint _tmp5_ = 0;
		guint8* _tmp6_;
		gint _tmp3__length1;
		gint __tmp3__size_;
		guint8* _tmp7_;
		gint _tmp7__length1;
		GBytes* _tmp8_;
		_tmp4_ = self->priv->crypto_session;
		_tmp6_ = crypto_srtp_session_encrypt_rtcp (_tmp4_, data, (gint) data_length1, &_tmp5_, &_inner_error0_);
		_tmp3_ = _tmp6_;
		_tmp3__length1 = _tmp5_;
		__tmp3__size_ = _tmp3__length1;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_bytes_unref0 (bytes);
			data = (g_free (data), NULL);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		_tmp7_ = _tmp3_;
		_tmp7__length1 = _tmp3__length1;
		_tmp3_ = NULL;
		_tmp3__length1 = 0;
		_tmp8_ = g_bytes_new_take (_tmp7_, _tmp7__length1);
		_g_bytes_unref0 (bytes);
		bytes = _tmp8_;
		_tmp3_ = (g_free (_tmp3_), NULL);
	} else {
		guint8* _tmp9_;
		gint _tmp9__length1;
		GBytes* _tmp10_;
		_tmp9_ = (data != NULL) ? _vala_array_dup3 (data, data_length1) : data;
		_tmp9__length1 = data_length1;
		_tmp10_ = g_bytes_new_take (_tmp9_, _tmp9__length1);
		_g_bytes_unref0 (bytes);
		bytes = _tmp10_;
	}
	_tmp11_ = xmpp_xep_jingle_rtp_stream_get_rtcp_mux ((XmppXepJingleRtpStream*) self);
	_tmp12_ = _tmp11_;
	if (_tmp12_) {
		GBytes* _tmp13_;
		_tmp13_ = bytes;
		g_signal_emit_by_name ((XmppXepJingleRtpStream*) self, "on-send-rtp-data", _tmp13_);
	} else {
		GBytes* _tmp14_;
		_tmp14_ = bytes;
		g_signal_emit_by_name ((XmppXepJingleRtpStream*) self, "on-send-rtcp-data", _tmp14_);
	}
	_g_bytes_unref0 (bytes);
	data = (g_free (data), NULL);
}

static GstPadProbeReturn
dino_plugins_rtp_stream_drop_probe (void)
{
	GstPadProbeReturn result;
	result = GST_PAD_PROBE_DROP;
	return result;
}

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

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_)) {
		_g_object_unref0 (_data10_->_self_);
		g_slice_free (Block10Data, _data10_);
	}
}

static gboolean
___lambda11_ (Block10Data* _data10_)
{
	gboolean result;
	dino_plugins_rtp_stream_on_send_rtp_eos (_data10_->_self_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
____lambda11__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda11_ (self);
	return result;
}

static gboolean
____lambda12_ (Block10Data* _data10_)
{
	gboolean result;
	dino_plugins_rtp_stream_on_send_rtcp_eos (_data10_->_self_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
_____lambda12__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda12_ (self);
	return result;
}

static void
dino_plugins_rtp_stream_on_eos_static (GstAppSink* sink,
                                       DinoPluginsRtpStream* _self_)
{
	Block10Data* _data10_;
	DinoPluginsRtpStream* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GstAppSink* _tmp4_;
	g_return_if_fail (sink != NULL);
	g_return_if_fail (_self_ != NULL);
	_data10_ = g_slice_new0 (Block10Data);
	_data10_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (_self_);
	_g_object_unref0 (_data10_->_self_);
	_data10_->_self_ = _tmp0_;
	_tmp1_ = gst_object_get_name ((GstObject*) sink);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	g_debug ("stream.vala:442: EOS on %s", _tmp3_);
	_g_free0 (_tmp3_);
	_tmp4_ = _data10_->_self_->priv->send_rtp;
	if (sink == _tmp4_) {
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda11__gsource_func, block10_data_ref (_data10_), block10_data_unref);
	} else {
		GstAppSink* _tmp5_;
		_tmp5_ = _data10_->_self_->priv->send_rtcp;
		if (sink == _tmp5_) {
			g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _____lambda12__gsource_func, block10_data_ref (_data10_), block10_data_unref);
		}
	}
	block10_data_unref (_data10_);
	_data10_ = NULL;
}

static void
dino_plugins_rtp_stream_on_send_rtp_eos (DinoPluginsRtpStream* self)
{
	GstPad* _tmp0_;
	GstAppSink* _tmp5_;
	GstAppSink* _tmp6_;
	GstPipeline* _tmp7_;
	GstPipeline* _tmp8_;
	guint8 _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->send_rtp_src_pad;
	if (_tmp0_ != NULL) {
		GstPad* _tmp1_;
		GstAppSink* _tmp2_;
		GstPad* _tmp3_;
		GstPad* _tmp4_;
		_tmp1_ = self->priv->send_rtp_src_pad;
		_tmp2_ = self->priv->send_rtp;
		_tmp3_ = gst_element_get_static_pad ((GstElement*) _tmp2_, "sink");
		_tmp4_ = _tmp3_;
		gst_pad_unlink (_tmp1_, _tmp4_);
		_g_object_unref0 (_tmp4_);
		_g_object_unref0 (self->priv->send_rtp_src_pad);
		self->priv->send_rtp_src_pad = NULL;
	}
	_tmp5_ = self->priv->send_rtp;
	gst_element_set_locked_state ((GstElement*) _tmp5_, TRUE);
	_tmp6_ = self->priv->send_rtp;
	gst_element_set_state ((GstElement*) _tmp6_, GST_STATE_NULL);
	_tmp7_ = dino_plugins_rtp_stream_get_pipe (self);
	_tmp8_ = _tmp7_;
	if (_tmp8_ != NULL) {
		GstPipeline* _tmp9_;
		GstPipeline* _tmp10_;
		GstAppSink* _tmp11_;
		_tmp9_ = dino_plugins_rtp_stream_get_pipe (self);
		_tmp10_ = _tmp9_;
		_tmp11_ = self->priv->send_rtp;
		gst_bin_remove ((GstBin*) _tmp10_, (GstElement*) _tmp11_);
	}
	_g_object_unref0 (self->priv->send_rtp);
	self->priv->send_rtp = NULL;
	_tmp12_ = self->priv->_rtpid;
	g_debug ("stream.vala:460: Stopped sending RTP for %u", (guint) _tmp12_);
}

static void
dino_plugins_rtp_stream_on_send_rtcp_eos (DinoPluginsRtpStream* self)
{
	GstAppSink* _tmp0_;
	GstAppSink* _tmp1_;
	GstPipeline* _tmp2_;
	GstPipeline* _tmp3_;
	guint8 _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->send_rtcp;
	gst_element_set_locked_state ((GstElement*) _tmp0_, TRUE);
	_tmp1_ = self->priv->send_rtcp;
	gst_element_set_state ((GstElement*) _tmp1_, GST_STATE_NULL);
	_tmp2_ = dino_plugins_rtp_stream_get_pipe (self);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		GstPipeline* _tmp4_;
		GstPipeline* _tmp5_;
		GstAppSink* _tmp6_;
		_tmp4_ = dino_plugins_rtp_stream_get_pipe (self);
		_tmp5_ = _tmp4_;
		_tmp6_ = self->priv->send_rtcp;
		gst_bin_remove ((GstBin*) _tmp5_, (GstElement*) _tmp6_);
	}
	_g_object_unref0 (self->priv->send_rtcp);
	self->priv->send_rtcp = NULL;
	_tmp7_ = self->priv->_rtpid;
	g_debug ("stream.vala:469: Stopped sending RTCP for %u", (guint) _tmp7_);
}

static GstPadProbeReturn
_dino_plugins_rtp_stream_drop_probe_gst_pad_probe_callback (GstPad* pad,
                                                            GstPadProbeInfo* info,
                                                            gpointer self)
{
	GstPadProbeReturn result;
	result = dino_plugins_rtp_stream_drop_probe ();
	return result;
}

static void
dino_plugins_rtp_stream_real_destroy (XmppXepJingleRtpStream* base)
{
	DinoPluginsRtpStream * self;
	GstAppSrc* _tmp0_;
	GstAppSrc* _tmp2_;
	GstAppSink* _tmp4_;
	GstAppSink* _tmp7_;
	GstElement* _tmp10_;
	DinoPluginsRtpDevice* _tmp15_;
	GstPad* _tmp19_;
	GstPad* _tmp22_;
	GstElement* _tmp28_;
	DinoPluginsRtpDevice* _tmp34_;
	GstElement* _tmp37_;
	GstAppSrc* _tmp43_;
	GstAppSrc* _tmp53_;
	GstPad* _tmp63_;
	GstPad* _tmp67_;
	GstPad* _tmp71_;
	GstPad* _tmp75_;
	self = (DinoPluginsRtpStream*) base;
	self->priv->push_recv_data = FALSE;
	_tmp0_ = self->priv->recv_rtp;
	if (_tmp0_ != NULL) {
		GstAppSrc* _tmp1_;
		_tmp1_ = self->priv->recv_rtp;
		gst_app_src_end_of_stream (_tmp1_);
	}
	_tmp2_ = self->priv->recv_rtcp;
	if (_tmp2_ != NULL) {
		GstAppSrc* _tmp3_;
		_tmp3_ = self->priv->recv_rtcp;
		gst_app_src_end_of_stream (_tmp3_);
	}
	_tmp4_ = self->priv->send_rtp;
	if (_tmp4_ != NULL) {
		GstAppSink* _tmp5_;
		guint _tmp6_;
		_tmp5_ = self->priv->send_rtp;
		g_signal_parse_name ("new-sample", gst_app_sink_get_type (), &_tmp6_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp5_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) _dino_plugins_rtp_stream_on_new_sample_gst_app_sink_new_sample, self);
	}
	_tmp7_ = self->priv->send_rtcp;
	if (_tmp7_ != NULL) {
		GstAppSink* _tmp8_;
		guint _tmp9_;
		_tmp8_ = self->priv->send_rtcp;
		g_signal_parse_name ("new-sample", gst_app_sink_get_type (), &_tmp9_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp8_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp9_, 0, NULL, (GCallback) _dino_plugins_rtp_stream_on_new_sample_gst_app_sink_new_sample, self);
	}
	_tmp10_ = self->priv->input;
	if (_tmp10_ != NULL) {
		GstPad* _tmp11_;
		GstPad* _tmp12_;
		GstElement* _tmp13_;
		GstPad* _tmp14_;
		_tmp11_ = self->priv->input_pad;
		_tmp12_ = self->priv->send_rtp_sink_pad;
		gst_pad_unlink (_tmp11_, _tmp12_);
		_tmp13_ = self->priv->input;
		_tmp14_ = self->priv->input_pad;
		gst_element_release_request_pad (_tmp13_, _tmp14_);
		_g_object_unref0 (self->priv->input_pad);
		self->priv->input_pad = NULL;
	}
	_tmp15_ = self->priv->_input_device;
	if (_tmp15_ != NULL) {
		gboolean _tmp16_;
		_tmp16_ = self->priv->_paused;
		if (!_tmp16_) {
			DinoPluginsRtpDevice* _tmp17_;
			GstElement* _tmp18_;
			_tmp17_ = self->priv->_input_device;
			_tmp18_ = self->priv->input;
			dino_plugins_rtp_device_unlink (_tmp17_, _tmp18_);
		}
		_g_object_unref0 (self->priv->_input_device);
		self->priv->_input_device = NULL;
		_g_object_unref0 (self->priv->input);
		self->priv->input = NULL;
	}
	_tmp19_ = self->priv->send_rtp_sink_pad;
	if (_tmp19_ != NULL) {
		GstPad* _tmp20_;
		GstEvent* _tmp21_;
		_tmp20_ = self->priv->send_rtp_sink_pad;
		_tmp21_ = gst_event_new_eos ();
		gst_pad_send_event (_tmp20_, _tmp21_);
	}
	_tmp22_ = self->priv->recv_rtp_src_pad;
	if (_tmp22_ != NULL) {
		GstPad* _tmp23_;
		GstPad* _tmp24_;
		GstElement* _tmp25_;
		GstPad* _tmp26_;
		GstPad* _tmp27_;
		_tmp23_ = self->priv->recv_rtp_src_pad;
		gst_pad_add_probe (_tmp23_, GST_PAD_PROBE_TYPE_BLOCK, _dino_plugins_rtp_stream_drop_probe_gst_pad_probe_callback, NULL, NULL);
		_tmp24_ = self->priv->recv_rtp_src_pad;
		_tmp25_ = self->priv->decode;
		_tmp26_ = gst_element_get_static_pad (_tmp25_, "sink");
		_tmp27_ = _tmp26_;
		gst_pad_unlink (_tmp24_, _tmp27_);
		_g_object_unref0 (_tmp27_);
	}
	_tmp28_ = self->priv->output;
	if (_tmp28_ != NULL) {
		GstElement* _tmp29_;
		GstPad* _tmp30_;
		GstPad* _tmp31_;
		GstElement* _tmp32_;
		GstElement* _tmp33_;
		_tmp29_ = self->priv->decode;
		_tmp30_ = gst_element_get_static_pad (_tmp29_, "src");
		_tmp31_ = _tmp30_;
		gst_pad_add_probe (_tmp31_, GST_PAD_PROBE_TYPE_BLOCK, _dino_plugins_rtp_stream_drop_probe_gst_pad_probe_callback, NULL, NULL);
		_g_object_unref0 (_tmp31_);
		_tmp32_ = self->priv->decode;
		_tmp33_ = self->priv->output;
		gst_element_unlink (_tmp32_, _tmp33_);
	}
	_tmp34_ = self->priv->_output_device;
	if (_tmp34_ != NULL) {
		DinoPluginsRtpDevice* _tmp35_;
		GstElement* _tmp36_;
		_tmp35_ = self->priv->_output_device;
		_tmp36_ = self->priv->output;
		dino_plugins_rtp_device_unlink (_tmp35_, _tmp36_);
		_g_object_unref0 (self->priv->_output_device);
		self->priv->_output_device = NULL;
	}
	_g_object_unref0 (self->priv->output);
	self->priv->output = NULL;
	_tmp37_ = self->priv->decode;
	if (_tmp37_ != NULL) {
		GstElement* _tmp38_;
		GstElement* _tmp39_;
		GstPipeline* _tmp40_;
		GstPipeline* _tmp41_;
		GstElement* _tmp42_;
		_tmp38_ = self->priv->decode;
		gst_element_set_locked_state (_tmp38_, TRUE);
		_tmp39_ = self->priv->decode;
		gst_element_set_state (_tmp39_, GST_STATE_NULL);
		_tmp40_ = dino_plugins_rtp_stream_get_pipe (self);
		_tmp41_ = _tmp40_;
		_tmp42_ = self->priv->decode;
		gst_bin_remove ((GstBin*) _tmp41_, _tmp42_);
		_g_object_unref0 (self->priv->decode);
		self->priv->decode = NULL;
		_g_object_unref0 (self->priv->decode_depay);
		self->priv->decode_depay = NULL;
	}
	_tmp43_ = self->priv->recv_rtp;
	if (_tmp43_ != NULL) {
		GstAppSrc* _tmp44_;
		GstPad* _tmp45_;
		GstPad* _tmp46_;
		GstPad* _tmp47_;
		GstAppSrc* _tmp48_;
		GstAppSrc* _tmp49_;
		GstPipeline* _tmp50_;
		GstPipeline* _tmp51_;
		GstAppSrc* _tmp52_;
		_tmp44_ = self->priv->recv_rtp;
		_tmp45_ = gst_element_get_static_pad ((GstElement*) _tmp44_, "src");
		_tmp46_ = _tmp45_;
		_tmp47_ = self->priv->recv_rtp_sink_pad;
		gst_pad_unlink (_tmp46_, _tmp47_);
		_g_object_unref0 (_tmp46_);
		_tmp48_ = self->priv->recv_rtp;
		gst_element_set_locked_state ((GstElement*) _tmp48_, TRUE);
		_tmp49_ = self->priv->recv_rtp;
		gst_element_set_state ((GstElement*) _tmp49_, GST_STATE_NULL);
		_tmp50_ = dino_plugins_rtp_stream_get_pipe (self);
		_tmp51_ = _tmp50_;
		_tmp52_ = self->priv->recv_rtp;
		gst_bin_remove ((GstBin*) _tmp51_, (GstElement*) _tmp52_);
		_g_object_unref0 (self->priv->recv_rtp);
		self->priv->recv_rtp = NULL;
	}
	_tmp53_ = self->priv->recv_rtcp;
	if (_tmp53_ != NULL) {
		GstAppSrc* _tmp54_;
		GstPad* _tmp55_;
		GstPad* _tmp56_;
		GstPad* _tmp57_;
		GstAppSrc* _tmp58_;
		GstAppSrc* _tmp59_;
		GstPipeline* _tmp60_;
		GstPipeline* _tmp61_;
		GstAppSrc* _tmp62_;
		_tmp54_ = self->priv->recv_rtcp;
		_tmp55_ = gst_element_get_static_pad ((GstElement*) _tmp54_, "src");
		_tmp56_ = _tmp55_;
		_tmp57_ = self->priv->recv_rtcp_sink_pad;
		gst_pad_unlink (_tmp56_, _tmp57_);
		_g_object_unref0 (_tmp56_);
		_tmp58_ = self->priv->recv_rtcp;
		gst_element_set_locked_state ((GstElement*) _tmp58_, TRUE);
		_tmp59_ = self->priv->recv_rtcp;
		gst_element_set_state ((GstElement*) _tmp59_, GST_STATE_NULL);
		_tmp60_ = dino_plugins_rtp_stream_get_pipe (self);
		_tmp61_ = _tmp60_;
		_tmp62_ = self->priv->recv_rtcp;
		gst_bin_remove ((GstBin*) _tmp61_, (GstElement*) _tmp62_);
		_g_object_unref0 (self->priv->recv_rtcp);
		self->priv->recv_rtcp = NULL;
	}
	_tmp63_ = self->priv->send_rtp_sink_pad;
	if (_tmp63_ != NULL) {
		GstElement* _tmp64_;
		GstElement* _tmp65_;
		GstPad* _tmp66_;
		_tmp64_ = dino_plugins_rtp_stream_get_rtpbin (self);
		_tmp65_ = _tmp64_;
		_tmp66_ = self->priv->send_rtp_sink_pad;
		gst_element_release_request_pad (_tmp65_, _tmp66_);
		_g_object_unref0 (self->priv->send_rtp_sink_pad);
		self->priv->send_rtp_sink_pad = NULL;
	}
	_tmp67_ = self->priv->recv_rtp_sink_pad;
	if (_tmp67_ != NULL) {
		GstElement* _tmp68_;
		GstElement* _tmp69_;
		GstPad* _tmp70_;
		_tmp68_ = dino_plugins_rtp_stream_get_rtpbin (self);
		_tmp69_ = _tmp68_;
		_tmp70_ = self->priv->recv_rtp_sink_pad;
		gst_element_release_request_pad (_tmp69_, _tmp70_);
		_g_object_unref0 (self->priv->recv_rtp_sink_pad);
		self->priv->recv_rtp_sink_pad = NULL;
	}
	_tmp71_ = self->priv->send_rtcp_src_pad;
	if (_tmp71_ != NULL) {
		GstElement* _tmp72_;
		GstElement* _tmp73_;
		GstPad* _tmp74_;
		_tmp72_ = dino_plugins_rtp_stream_get_rtpbin (self);
		_tmp73_ = _tmp72_;
		_tmp74_ = self->priv->send_rtcp_src_pad;
		gst_element_release_request_pad (_tmp73_, _tmp74_);
		_g_object_unref0 (self->priv->send_rtcp_src_pad);
		self->priv->send_rtcp_src_pad = NULL;
	}
	_tmp75_ = self->priv->recv_rtcp_sink_pad;
	if (_tmp75_ != NULL) {
		GstElement* _tmp76_;
		GstElement* _tmp77_;
		GstPad* _tmp78_;
		_tmp76_ = dino_plugins_rtp_stream_get_rtpbin (self);
		_tmp77_ = _tmp76_;
		_tmp78_ = self->priv->recv_rtcp_sink_pad;
		gst_element_release_request_pad (_tmp77_, _tmp78_);
		_g_object_unref0 (self->priv->recv_rtcp_sink_pad);
		self->priv->recv_rtcp_sink_pad = NULL;
	}
}

static void
dino_plugins_rtp_stream_prepare_remote_crypto (DinoPluginsRtpStream* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	XmppXepJingleRtpCrypto* _tmp2_;
	XmppXepJingleRtpCrypto* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp2_ = xmpp_xep_jingle_rtp_stream_get_remote_crypto ((XmppXepJingleRtpStream*) self);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		XmppXepJingleRtpCrypto* _tmp4_;
		XmppXepJingleRtpCrypto* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp4_ = xmpp_xep_jingle_rtp_stream_get_remote_crypto ((XmppXepJingleRtpStream*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = xmpp_xep_jingle_rtp_crypto_get_is_valid (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = _tmp7_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		CryptoSrtpSession* _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		_tmp8_ = self->priv->crypto_session;
		_tmp9_ = crypto_srtp_session_get_has_decrypt (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = !_tmp10_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		CryptoSrtpSession* _tmp11_;
		XmppXepJingleRtpCrypto* _tmp12_;
		XmppXepJingleRtpCrypto* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		XmppXepJingleRtpCrypto* _tmp16_;
		XmppXepJingleRtpCrypto* _tmp17_;
		guint8* _tmp18_;
		gint _tmp18__length1;
		gint _tmp19_ = 0;
		guint8* _tmp20_;
		gint _tmp20__length1;
		guint8* _tmp21_;
		gint _tmp21__length1;
		XmppXepJingleRtpCrypto* _tmp22_;
		XmppXepJingleRtpCrypto* _tmp23_;
		guint8* _tmp24_;
		gint _tmp24__length1;
		gint _tmp25_ = 0;
		guint8* _tmp26_;
		gint _tmp26__length1;
		guint8* _tmp27_;
		gint _tmp27__length1;
		XmppXepJingleRtpCrypto* _tmp28_;
		XmppXepJingleRtpCrypto* _tmp29_;
		const gchar* _tmp30_;
		const gchar* _tmp31_;
		_tmp11_ = self->priv->crypto_session;
		_tmp12_ = xmpp_xep_jingle_rtp_stream_get_remote_crypto ((XmppXepJingleRtpStream*) self);
		_tmp13_ = _tmp12_;
		_tmp14_ = xmpp_xep_jingle_rtp_crypto_get_crypto_suite (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = xmpp_xep_jingle_rtp_stream_get_remote_crypto ((XmppXepJingleRtpStream*) self);
		_tmp17_ = _tmp16_;
		_tmp18_ = xmpp_xep_jingle_rtp_crypto_get_key (_tmp17_, &_tmp19_);
		_tmp18__length1 = _tmp19_;
		_tmp20_ = _tmp18_;
		_tmp20__length1 = _tmp18__length1;
		_tmp21_ = _tmp20_;
		_tmp21__length1 = _tmp20__length1;
		_tmp22_ = xmpp_xep_jingle_rtp_stream_get_remote_crypto ((XmppXepJingleRtpStream*) self);
		_tmp23_ = _tmp22_;
		_tmp24_ = xmpp_xep_jingle_rtp_crypto_get_salt (_tmp23_, &_tmp25_);
		_tmp24__length1 = _tmp25_;
		_tmp26_ = _tmp24_;
		_tmp26__length1 = _tmp24__length1;
		_tmp27_ = _tmp26_;
		_tmp27__length1 = _tmp26__length1;
		crypto_srtp_session_set_decryption_key (_tmp11_, _tmp15_, _tmp21_, (gint) _tmp20__length1, _tmp27_, (gint) _tmp26__length1);
		_tmp27_ = (g_free (_tmp27_), NULL);
		_tmp21_ = (g_free (_tmp21_), NULL);
		_tmp28_ = xmpp_xep_jingle_rtp_stream_get_remote_crypto ((XmppXepJingleRtpStream*) self);
		_tmp29_ = _tmp28_;
		_tmp30_ = xmpp_xep_jingle_rtp_crypto_get_key_params (_tmp29_);
		_tmp31_ = _tmp30_;
		g_debug ("stream.vala:565: Setting up decryption with key params %s", _tmp31_);
	}
}

static gint
_vala_g_bytes_get_length (GBytes* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = (gint) g_bytes_get_size (self);
	return result;
}

static guint8
_vala_g_bytes_get (GBytes* self,
                   gint index)
{
	gboolean _tmp0_ = FALSE;
	guint8* data = NULL;
	gsize _tmp1_ = 0;
	guint8* _tmp2_;
	gint data_length1;
	gint _data_size_;
	guint8 _tmp3_;
	guint8 result;
	g_return_val_if_fail (self != NULL, 0U);
	if (index >= 0) {
		_tmp0_ = index < ((gint) g_bytes_get_size (self));
	} else {
		_tmp0_ = FALSE;
	}
	_vala_assert (_tmp0_, "index >= 0 && index < (int) this.get_size ()");
	_tmp2_ = g_bytes_get_data (self, &_tmp1_);
	data = (guint8*) _tmp2_;
	data_length1 = (_tmp1_ * sizeof (guint8)) / sizeof (guint8);
	_data_size_ = data_length1;
	_tmp3_ = data[index];
	result = _tmp3_;
	return result;
}

static gboolean
_____lambda14_ (DinoPluginsRtpStream* self,
                XmppXepJingleRtpHeaderExtension* it)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gboolean result;
	g_return_val_if_fail (it != NULL, FALSE);
	_tmp0_ = xmpp_xep_jingle_rtp_header_extension_get_uri (it);
	_tmp1_ = _tmp0_;
	result = g_strcmp0 (_tmp1_, "urn:3gpp:video-orientation") == 0;
	return result;
}

static gboolean
______lambda14__gee_predicate (gconstpointer g,
                               gpointer self)
{
	gboolean result;
	result = _____lambda14_ ((DinoPluginsRtpStream*) self, (XmppXepJingleRtpHeaderExtension*) g);
	return result;
}

static void
dino_plugins_rtp_stream_real_on_recv_rtp_data (XmppXepJingleRtpStream* base,
                                               GBytes* bytes)
{
	DinoPluginsRtpStream * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_;
	gboolean _tmp4_;
	GError* _inner_error0_ = NULL;
	self = (DinoPluginsRtpStream*) base;
	g_return_if_fail (bytes != NULL);
	_tmp3_ = xmpp_xep_jingle_rtp_stream_get_rtcp_mux ((XmppXepJingleRtpStream*) self);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		gint _tmp5_;
		gint _tmp6_;
		_tmp5_ = _vala_g_bytes_get_length (bytes);
		_tmp6_ = _tmp5_;
		_tmp2_ = _tmp6_ >= 2;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		_tmp1_ = ((gint) _vala_g_bytes_get (bytes, 1)) >= 192;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_tmp0_ = ((gint) _vala_g_bytes_get (bytes, 1)) < 224;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		xmpp_xep_jingle_rtp_stream_on_recv_rtcp_data ((XmppXepJingleRtpStream*) self, bytes);
		return;
	}
	{
		GstBuffer* buffer = NULL;
		GstBuffer* _tmp7_;
		GstRTPBuffer rtp_buffer = {0};
		guint buffer_ssrc = 0U;
		guint buffer_seq = 0U;
		GstBuffer* _tmp8_;
		GstRTPBuffer _tmp9_ = {0};
		gboolean _tmp10_;
		_tmp7_ = gst_buffer_new_wrapped_bytes (bytes);
		buffer = _tmp7_;
		buffer_ssrc = (guint) 0;
		buffer_seq = (guint) 0;
		_tmp8_ = buffer;
		_tmp10_ = gst_rtp_buffer_map (_tmp8_, GST_MAP_READ, &_tmp9_);
		rtp_buffer = _tmp9_;
		if (_tmp10_) {
			buffer_ssrc = (guint) gst_rtp_buffer_get_ssrc (&rtp_buffer);
			buffer_seq = (guint) gst_rtp_buffer_get_seq (&rtp_buffer);
			gst_rtp_buffer_unmap (&rtp_buffer);
		}
		_gst_buffer_unref0 (buffer);
	}
	if (self->priv->push_recv_data) {
		GstBuffer* buffer = NULL;
		CryptoSrtpSession* _tmp11_;
		gboolean _tmp12_;
		gboolean _tmp13_;
		GstRTPBuffer rtp_buffer = {0};
		GstBuffer* _tmp26_;
		GstRTPBuffer _tmp27_ = {0};
		gboolean _tmp28_;
		GstAppSrc* _tmp47_;
		GstBuffer* _tmp48_;
		dino_plugins_rtp_stream_prepare_remote_crypto (self);
		_tmp11_ = self->priv->crypto_session;
		_tmp12_ = crypto_srtp_session_get_has_decrypt (_tmp11_);
		_tmp13_ = _tmp12_;
		if (_tmp13_) {
			{
				guint8* _tmp14_ = NULL;
				CryptoSrtpSession* _tmp15_;
				gsize _tmp16_ = 0;
				guint8* _tmp17_;
				gint _tmp18_ = 0;
				guint8* _tmp19_;
				gint _tmp14__length1;
				gint __tmp14__size_;
				guint8* _tmp20_;
				gint _tmp20__length1;
				GstBuffer* _tmp21_;
				_tmp15_ = self->priv->crypto_session;
				_tmp17_ = g_bytes_get_data (bytes, &_tmp16_);
				_tmp19_ = crypto_srtp_session_decrypt_rtp (_tmp15_, _tmp17_, (gint) _tmp16_, &_tmp18_, &_inner_error0_);
				_tmp14_ = _tmp19_;
				_tmp14__length1 = _tmp18_;
				__tmp14__size_ = _tmp14__length1;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_tmp20_ = _tmp14_;
				_tmp20__length1 = _tmp14__length1;
				_tmp14_ = NULL;
				_tmp14__length1 = 0;
				_tmp21_ = gst_buffer_new_wrapped (_tmp20_, _tmp20__length1);
				_gst_buffer_unref0 (buffer);
				buffer = _tmp21_;
				_tmp14_ = (g_free (_tmp14_), NULL);
			}
			goto __finally0;
			__catch0_g_error:
			{
				GError* e = NULL;
				GError* _tmp22_;
				const gchar* _tmp23_;
				GError* _tmp24_;
				e = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp22_ = e;
				_tmp23_ = _tmp22_->message;
				_tmp24_ = e;
				g_warning ("stream.vala:597: %s (%d)", _tmp23_, _tmp24_->code);
				_g_error_free0 (e);
				_gst_buffer_unref0 (buffer);
				return;
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_gst_buffer_unref0 (buffer);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		} else {
			GstBuffer* _tmp25_;
			_tmp25_ = gst_buffer_new_wrapped_bytes (bytes);
			_gst_buffer_unref0 (buffer);
			buffer = _tmp25_;
		}
		_tmp26_ = buffer;
		_tmp28_ = gst_rtp_buffer_map (_tmp26_, GST_MAP_READ, &_tmp27_);
		rtp_buffer = _tmp27_;
		if (_tmp28_) {
			if (gst_rtp_buffer_get_extension (&rtp_buffer)) {
				XmppXepJingleRtpHeaderExtension* ext = NULL;
				GeeList* _tmp29_;
				GeeList* _tmp30_;
				gpointer _tmp31_;
				XmppXepJingleRtpHeaderExtension* _tmp32_;
				_tmp29_ = xmpp_xep_jingle_rtp_stream_get_header_extensions ((XmppXepJingleRtpStream*) self);
				_tmp30_ = _tmp29_;
				_tmp31_ = gee_traversable_first_match ((GeeTraversable*) _tmp30_, ______lambda14__gee_predicate, g_object_ref (self), g_object_unref);
				ext = (XmppXepJingleRtpHeaderExtension*) _tmp31_;
				_tmp32_ = ext;
				if (_tmp32_ != NULL) {
					guint8* extension_data = NULL;
					gint extension_data_length1 = 0;
					gint _extension_data_size_ = 0;
					gboolean _tmp33_ = FALSE;
					XmppXepJingleRtpHeaderExtension* _tmp34_;
					guint8 _tmp35_;
					guint8 _tmp36_;
					guint8* _tmp37_ = NULL;
					guint _tmp38_ = 0;
					gboolean _tmp39_;
					_tmp34_ = ext;
					_tmp35_ = xmpp_xep_jingle_rtp_header_extension_get_id (_tmp34_);
					_tmp36_ = _tmp35_;
					_tmp39_ = gst_rtp_buffer_get_extension_onebyte_header (&rtp_buffer, _tmp36_, (guint) 0, &_tmp37_, &_tmp38_);
					extension_data = _tmp37_;
					extension_data_length1 = _tmp38_;
					_extension_data_size_ = extension_data_length1;
					if (_tmp39_) {
						guint8* _tmp40_;
						gint _tmp40__length1;
						_tmp40_ = extension_data;
						_tmp40__length1 = extension_data_length1;
						_tmp33_ = _tmp40__length1 == 1;
					} else {
						_tmp33_ = FALSE;
					}
					if (_tmp33_) {
						gboolean camera = FALSE;
						guint8* _tmp41_;
						gint _tmp41__length1;
						guint8 _tmp42_;
						gboolean flip = FALSE;
						guint8* _tmp43_;
						gint _tmp43__length1;
						guint8 _tmp44_;
						guint8 rotation = 0U;
						guint8* _tmp45_;
						gint _tmp45__length1;
						guint8 _tmp46_;
						guint16 rotation_degree = 0U;
						_tmp41_ = extension_data;
						_tmp41__length1 = extension_data_length1;
						_tmp42_ = _tmp41_[0];
						camera = ((gint) (_tmp42_ & 0x8)) > 0;
						_tmp43_ = extension_data;
						_tmp43__length1 = extension_data_length1;
						_tmp44_ = _tmp43_[0];
						flip = ((gint) (_tmp44_ & 0x4)) > 0;
						_tmp45_ = extension_data;
						_tmp45__length1 = extension_data_length1;
						_tmp46_ = _tmp45_[0];
						rotation = _tmp46_ & 0x3;
						rotation_degree = G_MAXUINT16;
						switch (rotation) {
							case 0:
							{
								rotation_degree = (guint16) 0;
								break;
							}
							case 1:
							{
								rotation_degree = (guint16) 90;
								break;
							}
							case 2:
							{
								rotation_degree = (guint16) 180;
								break;
							}
							case 3:
							{
								rotation_degree = (guint16) 270;
								break;
							}
							default:
							break;
						}
						if (rotation_degree != self->priv->previous_incoming_video_orientation_degree) {
							g_signal_emit (self, dino_plugins_rtp_stream_signals[DINO_PLUGINS_RTP_STREAM_INCOMING_VIDEO_ORIENTATION_CHANGED_SIGNAL], 0, rotation_degree);
							self->priv->previous_incoming_video_orientation_degree = rotation_degree;
						}
					}
				}
				_xmpp_xep_jingle_rtp_header_extension_unref0 (ext);
			}
			gst_rtp_buffer_unmap (&rtp_buffer);
		}
		_tmp47_ = self->priv->recv_rtp;
		_tmp48_ = buffer;
		buffer = NULL;
		gst_app_src_push_buffer (_tmp47_, _tmp48_);
		_gst_buffer_unref0 (buffer);
	}
}

static void
dino_plugins_rtp_stream_real_on_recv_rtcp_data (XmppXepJingleRtpStream* base,
                                                GBytes* bytes)
{
	DinoPluginsRtpStream * self;
	GError* _inner_error0_ = NULL;
	self = (DinoPluginsRtpStream*) base;
	g_return_if_fail (bytes != NULL);
	if (self->priv->push_recv_data) {
		GstBuffer* buffer = NULL;
		CryptoSrtpSession* _tmp0_;
		gboolean _tmp1_;
		gboolean _tmp2_;
		GstAppSrc* _tmp15_;
		GstBuffer* _tmp16_;
		dino_plugins_rtp_stream_prepare_remote_crypto (self);
		_tmp0_ = self->priv->crypto_session;
		_tmp1_ = crypto_srtp_session_get_has_decrypt (_tmp0_);
		_tmp2_ = _tmp1_;
		if (_tmp2_) {
			{
				guint8* _tmp3_ = NULL;
				CryptoSrtpSession* _tmp4_;
				gsize _tmp5_ = 0;
				guint8* _tmp6_;
				gint _tmp7_ = 0;
				guint8* _tmp8_;
				gint _tmp3__length1;
				gint __tmp3__size_;
				guint8* _tmp9_;
				gint _tmp9__length1;
				GstBuffer* _tmp10_;
				_tmp4_ = self->priv->crypto_session;
				_tmp6_ = g_bytes_get_data (bytes, &_tmp5_);
				_tmp8_ = crypto_srtp_session_decrypt_rtcp (_tmp4_, _tmp6_, (gint) _tmp5_, &_tmp7_, &_inner_error0_);
				_tmp3_ = _tmp8_;
				_tmp3__length1 = _tmp7_;
				__tmp3__size_ = _tmp3__length1;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_tmp9_ = _tmp3_;
				_tmp9__length1 = _tmp3__length1;
				_tmp3_ = NULL;
				_tmp3__length1 = 0;
				_tmp10_ = gst_buffer_new_wrapped (_tmp9_, _tmp9__length1);
				_gst_buffer_unref0 (buffer);
				buffer = _tmp10_;
				_tmp3_ = (g_free (_tmp3_), NULL);
			}
			goto __finally0;
			__catch0_g_error:
			{
				GError* e = NULL;
				GError* _tmp11_;
				const gchar* _tmp12_;
				GError* _tmp13_;
				e = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp11_ = e;
				_tmp12_ = _tmp11_->message;
				_tmp13_ = e;
				g_warning ("stream.vala:653: %s (%d)", _tmp12_, _tmp13_->code);
				_g_error_free0 (e);
				_gst_buffer_unref0 (buffer);
				return;
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_gst_buffer_unref0 (buffer);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
		} else {
			GstBuffer* _tmp14_;
			_tmp14_ = gst_buffer_new_wrapped_bytes (bytes);
			_gst_buffer_unref0 (buffer);
			buffer = _tmp14_;
		}
		_tmp15_ = self->priv->recv_rtcp;
		_tmp16_ = buffer;
		buffer = NULL;
		gst_app_src_push_buffer (_tmp15_, _tmp16_);
		_gst_buffer_unref0 (buffer);
	}
}

static void
dino_plugins_rtp_stream_real_on_rtp_ready (XmppXepJingleRtpStream* base)
{
	DinoPluginsRtpStream * self;
	GstElement* _tmp0_;
	GstElement* _tmp1_;
	GstStructure* _tmp2_;
	GstEvent* _tmp3_;
	self = (DinoPluginsRtpStream*) base;
	_tmp0_ = dino_plugins_rtp_stream_get_rtpbin (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = gst_structure_new ("GstForceKeyUnit", "all-headers", G_TYPE_BOOLEAN, TRUE, NULL, NULL);
	_tmp3_ = gst_event_new_custom (GST_EVENT_CUSTOM_UPSTREAM, _tmp2_);
	gst_element_send_event (_tmp1_, _tmp3_);
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

static void
dino_plugins_rtp_stream_real_on_rtcp_ready (XmppXepJingleRtpStream* base)
{
	DinoPluginsRtpStream * self;
	gint rtp_session_id = 0;
	guint8 _tmp0_;
	guint64 max_delay = 0ULL;
	GObject* rtp_session = NULL;
	gboolean rtp_sent = FALSE;
	GstElement* _tmp1_;
	GstElement* _tmp2_;
	GObject* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	gchar* _tmp5_;
	gchar* _tmp6_;
	self = (DinoPluginsRtpStream*) base;
	_tmp0_ = self->priv->_rtpid;
	rtp_session_id = (gint) _tmp0_;
	max_delay = (guint64) G_MAXINT;
	_tmp1_ = dino_plugins_rtp_stream_get_rtpbin (self);
	_tmp2_ = _tmp1_;
	g_signal_emit_by_name (_tmp2_, "get-internal-session", rtp_session_id, &_tmp3_, NULL);
	_g_object_unref0 (rtp_session);
	rtp_session = _tmp3_;
	g_signal_emit_by_name (rtp_session, "send-rtcp-full", max_delay, &_tmp4_, NULL);
	rtp_sent = _tmp4_;
	_tmp5_ = bool_to_string (rtp_sent);
	_tmp6_ = _tmp5_;
	g_debug ("stream.vala:689: RTCP is ready, resending rtcp: %s", _tmp6_);
	_g_free0 (_tmp6_);
	_g_object_unref0 (rtp_session);
}

void
dino_plugins_rtp_stream_on_ssrc_pad_added (DinoPluginsRtpStream* self,
                                           guint32 ssrc,
                                           GstPad* pad)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GstPad* _tmp4_;
	GstElement* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pad != NULL);
	_tmp0_ = gst_object_get_name ((GstObject*) pad);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	g_debug ("stream.vala:693: New ssrc %u with pad %s", (guint) ssrc, _tmp2_);
	_g_free0 (_tmp2_);
	if (self->priv->participant_ssrc != ((guint32) 0)) {
		_tmp3_ = self->priv->participant_ssrc != ssrc;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		g_warning ("stream.vala:695: Got second ssrc on stream (old: %u, new: %u), ignorin" \
"g", (guint) self->priv->participant_ssrc, (guint) ssrc);
		return;
	}
	self->priv->participant_ssrc = ssrc;
	_tmp4_ = _g_object_ref0 (pad);
	_g_object_unref0 (self->priv->recv_rtp_src_pad);
	self->priv->recv_rtp_src_pad = _tmp4_;
	_tmp5_ = self->priv->decode;
	if (_tmp5_ != NULL) {
		DinoPluginsRtpPlugin* _tmp6_;
		GstPad* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		GstPad* _tmp15_;
		GstElement* _tmp16_;
		GstPad* _tmp17_;
		GstPad* _tmp18_;
		DinoPluginsRtpPlugin* _tmp19_;
		_tmp6_ = self->priv->_plugin;
		dino_plugins_rtp_plugin_pause (_tmp6_);
		_tmp7_ = self->priv->recv_rtp_src_pad;
		_tmp8_ = gst_object_get_name ((GstObject*) _tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		_tmp11_ = xmpp_xep_jingle_rtp_stream_get_media ((XmppXepJingleRtpStream*) self);
		_tmp12_ = _tmp11_;
		_tmp13_ = xmpp_xep_jingle_rtp_stream_get_name ((XmppXepJingleRtpStream*) self);
		_tmp14_ = _tmp13_;
		g_debug ("stream.vala:702: Link %s to %s decode for %s", _tmp10_, _tmp12_, _tmp14_);
		_g_free0 (_tmp10_);
		_tmp15_ = self->priv->recv_rtp_src_pad;
		_tmp16_ = self->priv->decode;
		_tmp17_ = gst_element_get_static_pad (_tmp16_, "sink");
		_tmp18_ = _tmp17_;
		gst_pad_link_full (_tmp15_, _tmp18_, GST_PAD_LINK_CHECK_DEFAULT);
		_g_object_unref0 (_tmp18_);
		_tmp19_ = self->priv->_plugin;
		dino_plugins_rtp_plugin_unpause (_tmp19_);
	}
}

void
dino_plugins_rtp_stream_on_send_rtp_src_added (DinoPluginsRtpStream* self,
                                               GstPad* pad)
{
	GstPad* _tmp0_;
	GstAppSink* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (pad != NULL);
	_tmp0_ = _g_object_ref0 (pad);
	_g_object_unref0 (self->priv->send_rtp_src_pad);
	self->priv->send_rtp_src_pad = _tmp0_;
	_tmp1_ = self->priv->send_rtp;
	if (_tmp1_ != NULL) {
		DinoPluginsRtpPlugin* _tmp2_;
		GstPad* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		GstPad* _tmp11_;
		GstAppSink* _tmp12_;
		GstPad* _tmp13_;
		GstPad* _tmp14_;
		DinoPluginsRtpPlugin* _tmp15_;
		_tmp2_ = self->priv->_plugin;
		dino_plugins_rtp_plugin_pause (_tmp2_);
		_tmp3_ = self->priv->send_rtp_src_pad;
		_tmp4_ = gst_object_get_name ((GstObject*) _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		_tmp7_ = xmpp_xep_jingle_rtp_stream_get_media ((XmppXepJingleRtpStream*) self);
		_tmp8_ = _tmp7_;
		_tmp9_ = xmpp_xep_jingle_rtp_stream_get_name ((XmppXepJingleRtpStream*) self);
		_tmp10_ = _tmp9_;
		g_debug ("stream.vala:712: Link %s to %s send_rtp for %s", _tmp6_, _tmp8_, _tmp10_);
		_g_free0 (_tmp6_);
		_tmp11_ = self->priv->send_rtp_src_pad;
		_tmp12_ = self->priv->send_rtp;
		_tmp13_ = gst_element_get_static_pad ((GstElement*) _tmp12_, "sink");
		_tmp14_ = _tmp13_;
		gst_pad_link_full (_tmp11_, _tmp14_, GST_PAD_LINK_CHECK_DEFAULT);
		_g_object_unref0 (_tmp14_);
		_tmp15_ = self->priv->_plugin;
		dino_plugins_rtp_plugin_unpause (_tmp15_);
	}
}

void
dino_plugins_rtp_stream_set_input (DinoPluginsRtpStream* self,
                                   GstElement* input)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_paused;
	dino_plugins_rtp_stream_set_input_and_pause (self, input, _tmp0_);
}

static void
dino_plugins_rtp_stream_set_input_and_pause (DinoPluginsRtpStream* self,
                                             GstElement* input,
                                             gboolean paused)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	GstElement* _tmp7_;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_ = FALSE;
	gboolean _tmp10_ = FALSE;
	gboolean _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_created;
	if (_tmp1_) {
		GstElement* _tmp2_;
		_tmp2_ = self->priv->input;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GstPad* _tmp3_;
		GstPad* _tmp4_;
		GstElement* _tmp5_;
		GstPad* _tmp6_;
		_tmp3_ = self->priv->input_pad;
		_tmp4_ = self->priv->send_rtp_sink_pad;
		gst_pad_unlink (_tmp3_, _tmp4_);
		_tmp5_ = self->priv->input;
		_tmp6_ = self->priv->input_pad;
		gst_element_release_request_pad (_tmp5_, _tmp6_);
		_g_object_unref0 (self->priv->input_pad);
		self->priv->input_pad = NULL;
		_g_object_unref0 (self->priv->input);
		self->priv->input = NULL;
	}
	_tmp7_ = _g_object_ref0 (input);
	_g_object_unref0 (self->priv->input);
	self->priv->input = _tmp7_;
	dino_plugins_rtp_stream_set_paused (self, paused);
	_tmp11_ = self->priv->_created;
	if (_tmp11_) {
		gboolean _tmp12_;
		gboolean _tmp13_;
		_tmp12_ = xmpp_xep_jingle_rtp_stream_get_sending ((XmppXepJingleRtpStream*) self);
		_tmp13_ = _tmp12_;
		_tmp10_ = _tmp13_;
	} else {
		_tmp10_ = FALSE;
	}
	if (_tmp10_) {
		_tmp9_ = !paused;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		_tmp8_ = input != NULL;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		DinoPluginsRtpPlugin* _tmp14_;
		guint8 _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		GstPad* _tmp20_;
		GstPad* _tmp21_;
		GstPad* _tmp22_;
		DinoPluginsRtpPlugin* _tmp23_;
		_tmp14_ = self->priv->_plugin;
		dino_plugins_rtp_plugin_pause (_tmp14_);
		_tmp15_ = self->priv->_rtpid;
		_tmp16_ = g_strdup_printf ("%hhu", _tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = g_strconcat ("src_", _tmp17_, NULL);
		_tmp19_ = _tmp18_;
		_tmp20_ = gst_element_get_request_pad (input, _tmp19_);
		_g_object_unref0 (self->priv->input_pad);
		self->priv->input_pad = _tmp20_;
		_g_free0 (_tmp19_);
		_g_free0 (_tmp17_);
		_tmp21_ = self->priv->input_pad;
		_tmp22_ = self->priv->send_rtp_sink_pad;
		gst_pad_link_full (_tmp21_, _tmp22_, GST_PAD_LINK_CHECK_DEFAULT);
		_tmp23_ = self->priv->_plugin;
		dino_plugins_rtp_plugin_unpause (_tmp23_);
	}
}

void
dino_plugins_rtp_stream_pause (DinoPluginsRtpStream* self)
{
	gboolean _tmp0_;
	GstElement* input = NULL;
	GstElement* _tmp1_;
	GstElement* _tmp2_;
	gboolean _tmp3_ = FALSE;
	GstElement* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_paused;
	if (_tmp0_) {
		return;
	}
	_tmp1_ = self->priv->input;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	input = _tmp2_;
	dino_plugins_rtp_stream_set_input_and_pause (self, NULL, TRUE);
	_tmp4_ = input;
	if (_tmp4_ != NULL) {
		DinoPluginsRtpDevice* _tmp5_;
		DinoPluginsRtpDevice* _tmp6_;
		_tmp5_ = dino_plugins_rtp_stream_get_input_device (self);
		_tmp6_ = _tmp5_;
		_tmp3_ = _tmp6_ != NULL;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		DinoPluginsRtpDevice* _tmp7_;
		DinoPluginsRtpDevice* _tmp8_;
		GstElement* _tmp9_;
		_tmp7_ = dino_plugins_rtp_stream_get_input_device (self);
		_tmp8_ = _tmp7_;
		_tmp9_ = input;
		dino_plugins_rtp_device_unlink (_tmp8_, _tmp9_);
	}
	_g_object_unref0 (input);
}

void
dino_plugins_rtp_stream_unpause (DinoPluginsRtpStream* self)
{
	gboolean _tmp0_;
	GstElement* _tmp1_ = NULL;
	DinoPluginsRtpDevice* _tmp2_;
	DinoPluginsRtpDevice* _tmp3_;
	DinoPluginsRtpDevice* _tmp11_;
	DinoPluginsRtpDevice* _tmp12_;
	XmppXepJingleRtpPayloadType* _tmp13_;
	XmppXepJingleRtpPayloadType* _tmp14_;
	guint _tmp15_;
	guint _tmp16_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_paused;
	if (!_tmp0_) {
		return;
	}
	_tmp2_ = dino_plugins_rtp_stream_get_input_device (self);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		DinoPluginsRtpDevice* _tmp4_;
		DinoPluginsRtpDevice* _tmp5_;
		XmppXepJingleRtpPayloadType* _tmp6_;
		XmppXepJingleRtpPayloadType* _tmp7_;
		guint32 _tmp8_;
		guint32 _tmp9_;
		GstElement* _tmp10_;
		_tmp4_ = dino_plugins_rtp_stream_get_input_device (self);
		_tmp5_ = _tmp4_;
		_tmp6_ = xmpp_xep_jingle_rtp_stream_get_payload_type ((XmppXepJingleRtpStream*) self);
		_tmp7_ = _tmp6_;
		_tmp8_ = dino_plugins_rtp_stream_get_next_timestamp_offset (self);
		_tmp9_ = _tmp8_;
		_tmp10_ = dino_plugins_rtp_device_link_source (_tmp5_, _tmp7_, self->priv->our_ssrc, self->priv->next_seqnum_offset, _tmp9_);
		_g_object_unref0 (_tmp1_);
		_tmp1_ = _tmp10_;
	} else {
		_g_object_unref0 (_tmp1_);
		_tmp1_ = NULL;
	}
	dino_plugins_rtp_stream_set_input_and_pause (self, _tmp1_, FALSE);
	_tmp11_ = dino_plugins_rtp_stream_get_input_device (self);
	_tmp12_ = _tmp11_;
	_tmp13_ = xmpp_xep_jingle_rtp_stream_get_payload_type ((XmppXepJingleRtpStream*) self);
	_tmp14_ = _tmp13_;
	_tmp15_ = xmpp_xep_jingle_rtp_stream_get_target_send_bitrate ((XmppXepJingleRtpStream*) self);
	_tmp16_ = _tmp15_;
	dino_plugins_rtp_device_update_bitrate (_tmp12_, _tmp14_, _tmp16_);
	_g_object_unref0 (_tmp1_);
}

guint
dino_plugins_rtp_stream_get_participant_ssrc (DinoPluginsRtpStream* self,
                                              XmppJid* participant)
{
	XmppXepJingleContent* _tmp0_;
	XmppXepJingleContent* _tmp1_;
	XmppXepJingleSession* _tmp2_;
	XmppJid* _tmp3_;
	XmppJid* _tmp4_;
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	g_return_val_if_fail (participant != NULL, 0U);
	_tmp0_ = xmpp_xep_jingle_rtp_stream_get_content ((XmppXepJingleRtpStream*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->session;
	_tmp3_ = xmpp_xep_jingle_session_get_peer_full_jid (_tmp2_);
	_tmp4_ = _tmp3_;
	if (xmpp_jid_equals (participant, _tmp4_)) {
		result = (guint) self->priv->participant_ssrc;
		return result;
	}
	result = (guint) 0;
	return result;
}

static void
dino_plugins_rtp_stream_real_add_output (DinoPluginsRtpStream* self,
                                         GstElement* element,
                                         XmppJid* participant)
{
	GstElement* _tmp0_;
	GstElement* _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (element != NULL);
	_tmp0_ = self->priv->output;
	if (_tmp0_ != NULL) {
		g_critical ("stream.vala:764: add_output() invoked more than once");
		return;
	}
	if (participant != NULL) {
		g_critical ("stream.vala:768: add_output() invoked with participant when not suppor" \
"ted");
		return;
	}
	_tmp1_ = _g_object_ref0 (element);
	_g_object_unref0 (self->priv->output);
	self->priv->output = _tmp1_;
	_tmp2_ = self->priv->_created;
	if (_tmp2_) {
		DinoPluginsRtpPlugin* _tmp3_;
		GstElement* _tmp4_;
		DinoPluginsRtpPlugin* _tmp8_;
		_tmp3_ = self->priv->_plugin;
		dino_plugins_rtp_plugin_pause (_tmp3_);
		_tmp4_ = self->priv->decode;
		gst_element_link (_tmp4_, element);
		if (self->priv->block_probe_handler_id != ((gulong) 0)) {
			GstElement* _tmp5_;
			GstPad* _tmp6_;
			GstPad* _tmp7_;
			_tmp5_ = self->priv->decode;
			_tmp6_ = gst_element_get_static_pad (_tmp5_, "src");
			_tmp7_ = _tmp6_;
			gst_pad_remove_probe (_tmp7_, self->priv->block_probe_handler_id);
			_g_object_unref0 (_tmp7_);
		}
		_tmp8_ = self->priv->_plugin;
		dino_plugins_rtp_plugin_unpause (_tmp8_);
	}
}

void
dino_plugins_rtp_stream_add_output (DinoPluginsRtpStream* self,
                                    GstElement* element,
                                    XmppJid* participant)
{
	DinoPluginsRtpStreamClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = DINO_PLUGINS_RTP_STREAM_GET_CLASS (self);
	if (_klass_->add_output) {
		_klass_->add_output (self, element, participant);
	}
}

static void
dino_plugins_rtp_stream_real_remove_output (DinoPluginsRtpStream* self,
                                            GstElement* element)
{
	GstElement* _tmp0_;
	gboolean _tmp1_;
	DinoPluginsRtpDevice* _tmp6_;
	g_return_if_fail (element != NULL);
	_tmp0_ = self->priv->output;
	if (_tmp0_ != element) {
		g_critical ("stream.vala:784: remove_output() invoked without prior add_output()");
		return;
	}
	_tmp1_ = self->priv->_created;
	if (_tmp1_) {
		GstElement* _tmp2_;
		GstPad* _tmp3_;
		GstPad* _tmp4_;
		GstElement* _tmp5_;
		_tmp2_ = self->priv->decode;
		_tmp3_ = gst_element_get_static_pad (_tmp2_, "src");
		_tmp4_ = _tmp3_;
		self->priv->block_probe_handler_id = gst_pad_add_probe (_tmp4_, GST_PAD_PROBE_TYPE_BLOCK, _dino_plugins_rtp_stream_drop_probe_gst_pad_probe_callback, NULL, NULL);
		_g_object_unref0 (_tmp4_);
		_tmp5_ = self->priv->decode;
		gst_element_unlink (_tmp5_, element);
	}
	_tmp6_ = self->priv->_output_device;
	if (_tmp6_ != NULL) {
		DinoPluginsRtpDevice* _tmp7_;
		_tmp7_ = self->priv->_output_device;
		dino_plugins_rtp_device_unlink (_tmp7_, element);
		_g_object_unref0 (self->priv->_output_device);
		self->priv->_output_device = NULL;
	}
	_g_object_unref0 (self->priv->output);
	self->priv->output = NULL;
}

void
dino_plugins_rtp_stream_remove_output (DinoPluginsRtpStream* self,
                                       GstElement* element)
{
	DinoPluginsRtpStreamClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = DINO_PLUGINS_RTP_STREAM_GET_CLASS (self);
	if (_klass_->remove_output) {
		_klass_->remove_output (self, element);
	}
}

guint8
dino_plugins_rtp_stream_get_rtpid (DinoPluginsRtpStream* self)
{
	guint8 result;
	g_return_val_if_fail (self != NULL, 0U);
	result = self->priv->_rtpid;
	return result;
}

static void
dino_plugins_rtp_stream_set_rtpid (DinoPluginsRtpStream* self,
                                   guint8 value)
{
	guint8 old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_plugins_rtp_stream_get_rtpid (self);
	if (old_value != value) {
		self->priv->_rtpid = value;
		g_object_notify_by_pspec ((GObject *) self, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_RTPID_PROPERTY]);
	}
}

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

static void
dino_plugins_rtp_stream_set_plugin (DinoPluginsRtpStream* self,
                                    DinoPluginsRtpPlugin* value)
{
	DinoPluginsRtpPlugin* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_plugins_rtp_stream_get_plugin (self);
	if (old_value != value) {
		DinoPluginsRtpPlugin* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_plugin);
		self->priv->_plugin = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_PLUGIN_PROPERTY]);
	}
}

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

GstElement*
dino_plugins_rtp_stream_get_rtpbin (DinoPluginsRtpStream* self)
{
	GstElement* result;
	DinoPluginsRtpPlugin* _tmp0_;
	GstBin* _tmp1_;
	GstBin* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_plugin;
	_tmp1_ = dino_plugins_rtp_plugin_get_rtpbin (_tmp0_);
	_tmp2_ = _tmp1_;
	result = (GstElement*) _tmp2_;
	return result;
}

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

DinoPluginsRtpDevice*
dino_plugins_rtp_stream_get_input_device (DinoPluginsRtpStream* self)
{
	DinoPluginsRtpDevice* result;
	DinoPluginsRtpDevice* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_input_device;
	result = _tmp0_;
	return result;
}

void
dino_plugins_rtp_stream_set_input_device (DinoPluginsRtpStream* self,
                                          DinoPluginsRtpDevice* value)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	DinoPluginsRtpDevice* _tmp15_;
	g_return_if_fail (self != NULL);
	_tmp1_ = xmpp_xep_jingle_rtp_stream_get_sending ((XmppXepJingleRtpStream*) self);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		gboolean _tmp3_;
		_tmp3_ = self->priv->_paused;
		_tmp0_ = !_tmp3_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GstElement* input = NULL;
		GstElement* _tmp4_;
		GstElement* _tmp5_;
		GstElement* _tmp6_ = NULL;
		DinoPluginsRtpDevice* _tmp12_;
		_tmp4_ = self->priv->input;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		input = _tmp5_;
		if (value != NULL) {
			XmppXepJingleRtpPayloadType* _tmp7_;
			XmppXepJingleRtpPayloadType* _tmp8_;
			guint32 _tmp9_;
			guint32 _tmp10_;
			GstElement* _tmp11_;
			_tmp7_ = xmpp_xep_jingle_rtp_stream_get_payload_type ((XmppXepJingleRtpStream*) self);
			_tmp8_ = _tmp7_;
			_tmp9_ = dino_plugins_rtp_stream_get_next_timestamp_offset (self);
			_tmp10_ = _tmp9_;
			_tmp11_ = dino_plugins_rtp_device_link_source (value, _tmp8_, self->priv->our_ssrc, self->priv->next_seqnum_offset, _tmp10_);
			_g_object_unref0 (_tmp6_);
			_tmp6_ = _tmp11_;
		} else {
			_g_object_unref0 (_tmp6_);
			_tmp6_ = NULL;
		}
		dino_plugins_rtp_stream_set_input (self, _tmp6_);
		_tmp12_ = self->priv->_input_device;
		if (_tmp12_ != NULL) {
			DinoPluginsRtpDevice* _tmp13_;
			GstElement* _tmp14_;
			_tmp13_ = self->priv->_input_device;
			_tmp14_ = input;
			dino_plugins_rtp_device_unlink (_tmp13_, _tmp14_);
		}
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (input);
	}
	_tmp15_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_input_device);
	self->priv->_input_device = _tmp15_;
	g_object_notify_by_pspec ((GObject *) self, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_INPUT_DEVICE_PROPERTY]);
}

DinoPluginsRtpDevice*
dino_plugins_rtp_stream_get_output_device (DinoPluginsRtpStream* self)
{
	DinoPluginsRtpDevice* result;
	DinoPluginsRtpDevice* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_output_device;
	result = _tmp0_;
	return result;
}

void
dino_plugins_rtp_stream_set_output_device (DinoPluginsRtpStream* self,
                                           DinoPluginsRtpDevice* value)
{
	GstElement* _tmp0_;
	gboolean _tmp2_ = FALSE;
	DinoPluginsRtpDevice* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->output;
	if (_tmp0_ != NULL) {
		GstElement* _tmp1_;
		_tmp1_ = self->priv->output;
		dino_plugins_rtp_stream_remove_output (self, _tmp1_);
	}
	if (value != NULL) {
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp3_ = xmpp_xep_jingle_rtp_stream_get_receiving ((XmppXepJingleRtpStream*) self);
		_tmp4_ = _tmp3_;
		_tmp2_ = _tmp4_;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GstElement* _tmp5_;
		GstElement* _tmp6_;
		_tmp5_ = dino_plugins_rtp_device_link_sink (value);
		_tmp6_ = _tmp5_;
		dino_plugins_rtp_stream_add_output (self, _tmp6_, NULL);
		_g_object_unref0 (_tmp6_);
	}
	_tmp7_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_output_device);
	self->priv->_output_device = _tmp7_;
	g_object_notify_by_pspec ((GObject *) self, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_OUTPUT_DEVICE_PROPERTY]);
}

gboolean
dino_plugins_rtp_stream_get_created (DinoPluginsRtpStream* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_created;
	return result;
}

static void
dino_plugins_rtp_stream_set_created (DinoPluginsRtpStream* self,
                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_plugins_rtp_stream_get_created (self);
	if (old_value != value) {
		self->priv->_created = value;
		g_object_notify_by_pspec ((GObject *) self, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_CREATED_PROPERTY]);
	}
}

gboolean
dino_plugins_rtp_stream_get_paused (DinoPluginsRtpStream* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_paused;
	return result;
}

static void
dino_plugins_rtp_stream_set_paused (DinoPluginsRtpStream* self,
                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_plugins_rtp_stream_get_paused (self);
	if (old_value != value) {
		self->priv->_paused = value;
		g_object_notify_by_pspec ((GObject *) self, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_PAUSED_PROPERTY]);
	}
}

static guint32
dino_plugins_rtp_stream_get_next_timestamp_offset (DinoPluginsRtpStream* self)
{
	guint32 result;
	gint64 monotonic_diff = 0LL;
	XmppXepJingleRtpPayloadType* _tmp0_;
	XmppXepJingleRtpPayloadType* _tmp1_;
	guint32 _tmp2_;
	guint32 _tmp3_;
	g_return_val_if_fail (self != NULL, 0U);
	if (self->priv->next_timestamp_offset_base == ((guint32) 0)) {
		result = (guint32) 0;
		return result;
	}
	monotonic_diff = g_get_monotonic_time () - self->priv->next_timestamp_offset_stamp;
	_tmp0_ = xmpp_xep_jingle_rtp_stream_get_payload_type ((XmppXepJingleRtpStream*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_xep_jingle_rtp_payload_type_get_clockrate (_tmp1_);
	_tmp3_ = _tmp2_;
	result = self->priv->next_timestamp_offset_base + ((guint32) ((((gdouble) monotonic_diff) / 1000000.0) * _tmp3_));
	return result;
}

static void
dino_plugins_rtp_stream_class_init (DinoPluginsRtpStreamClass * klass,
                                    gpointer klass_data)
{
	dino_plugins_rtp_stream_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsRtpStream_private_offset);
	((XmppXepJingleRtpStreamClass *) klass)->create = (void (*) (XmppXepJingleRtpStream*)) dino_plugins_rtp_stream_real_create;
	((XmppXepJingleRtpStreamClass *) klass)->destroy = (void (*) (XmppXepJingleRtpStream*)) dino_plugins_rtp_stream_real_destroy;
	((XmppXepJingleRtpStreamClass *) klass)->on_recv_rtp_data = (void (*) (XmppXepJingleRtpStream*, GBytes*)) dino_plugins_rtp_stream_real_on_recv_rtp_data;
	((XmppXepJingleRtpStreamClass *) klass)->on_recv_rtcp_data = (void (*) (XmppXepJingleRtpStream*, GBytes*)) dino_plugins_rtp_stream_real_on_recv_rtcp_data;
	((XmppXepJingleRtpStreamClass *) klass)->on_rtp_ready = (void (*) (XmppXepJingleRtpStream*)) dino_plugins_rtp_stream_real_on_rtp_ready;
	((XmppXepJingleRtpStreamClass *) klass)->on_rtcp_ready = (void (*) (XmppXepJingleRtpStream*)) dino_plugins_rtp_stream_real_on_rtcp_ready;
	((DinoPluginsRtpStreamClass *) klass)->add_output = (void (*) (DinoPluginsRtpStream*, GstElement*, XmppJid*)) dino_plugins_rtp_stream_real_add_output;
	((DinoPluginsRtpStreamClass *) klass)->remove_output = (void (*) (DinoPluginsRtpStream*, GstElement*)) dino_plugins_rtp_stream_real_remove_output;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_plugins_rtp_stream_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_plugins_rtp_stream_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_rtp_stream_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_STREAM_RTPID_PROPERTY, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_RTPID_PROPERTY] = g_param_spec_uchar ("rtpid", "rtpid", "rtpid", 0, G_MAXUINT8, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_STREAM_PLUGIN_PROPERTY, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_PLUGIN_PROPERTY] = g_param_spec_object ("plugin", "plugin", "plugin", DINO_PLUGINS_RTP_TYPE_PLUGIN, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_STREAM_PIPE_PROPERTY, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_PIPE_PROPERTY] = g_param_spec_object ("pipe", "pipe", "pipe", gst_pipeline_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_STREAM_RTPBIN_PROPERTY, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_RTPBIN_PROPERTY] = g_param_spec_object ("rtpbin", "rtpbin", "rtpbin", gst_element_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_STREAM_CODEC_UTIL_PROPERTY, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_CODEC_UTIL_PROPERTY] = dino_plugins_rtp_param_spec_codec_util ("codec-util", "codec-util", "codec-util", DINO_PLUGINS_RTP_TYPE_CODEC_UTIL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_STREAM_INPUT_DEVICE_PROPERTY, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_INPUT_DEVICE_PROPERTY] = g_param_spec_object ("input-device", "input-device", "input-device", DINO_PLUGINS_RTP_TYPE_DEVICE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_STREAM_OUTPUT_DEVICE_PROPERTY, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_OUTPUT_DEVICE_PROPERTY] = g_param_spec_object ("output-device", "output-device", "output-device", DINO_PLUGINS_RTP_TYPE_DEVICE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_STREAM_CREATED_PROPERTY, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_CREATED_PROPERTY] = g_param_spec_boolean ("created", "created", "created", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_PLUGINS_RTP_STREAM_PAUSED_PROPERTY, dino_plugins_rtp_stream_properties[DINO_PLUGINS_RTP_STREAM_PAUSED_PROPERTY] = g_param_spec_boolean ("paused", "paused", "paused", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	dino_plugins_rtp_stream_signals[DINO_PLUGINS_RTP_STREAM_INCOMING_VIDEO_ORIENTATION_CHANGED_SIGNAL] = g_signal_new ("incoming-video-orientation-changed", DINO_PLUGINS_RTP_TYPE_STREAM, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
}

static void
dino_plugins_rtp_stream_instance_init (DinoPluginsRtpStream * self,
                                       gpointer klass)
{
	CryptoSrtpSession* _tmp0_;
	self->priv = dino_plugins_rtp_stream_get_instance_private (self);
	self->priv->_created = FALSE;
	self->priv->_paused = FALSE;
	self->priv->push_recv_data = FALSE;
	self->priv->our_ssrc = (guint) g_random_int ();
	self->priv->next_seqnum_offset = -1;
	self->priv->next_timestamp_offset_base = (guint32) 0;
	self->priv->next_timestamp_offset_stamp = (gint64) 0;
	self->priv->participant_ssrc = (guint32) 0;
	_tmp0_ = crypto_srtp_session_new ();
	self->priv->crypto_session = _tmp0_;
	self->priv->last_packets_lost = -1;
	self->priv->last_packets_received = (guint64) 0;
	self->priv->last_octets_received = (guint64) 0;
	self->priv->max_target_receive_bitrate = (guint) 0;
	self->priv->last_remb_time = (gint64) 0;
	self->priv->flip = FALSE;
	self->priv->rotation = (guint8) 0;
	self->priv->previous_incoming_video_orientation_degree = G_MAXUINT16;
	self->priv->block_probe_handler_id = (gulong) 0;
}

static void
dino_plugins_rtp_stream_finalize (GObject * obj)
{
	DinoPluginsRtpStream * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_RTP_TYPE_STREAM, DinoPluginsRtpStream);
	_g_object_unref0 (self->priv->_plugin);
	_g_object_unref0 (self->priv->send_rtp);
	_g_object_unref0 (self->priv->send_rtcp);
	_g_object_unref0 (self->priv->recv_rtp);
	_g_object_unref0 (self->priv->recv_rtcp);
	_g_object_unref0 (self->priv->decode);
	_g_object_unref0 (self->priv->decode_depay);
	_g_object_unref0 (self->priv->input);
	_g_object_unref0 (self->priv->input_pad);
	_g_object_unref0 (self->priv->output);
	_g_object_unref0 (self->priv->session);
	_g_object_unref0 (self->priv->_input_device);
	_g_object_unref0 (self->priv->_output_device);
	_g_object_unref0 (self->priv->recv_rtcp_sink_pad);
	_g_object_unref0 (self->priv->recv_rtp_sink_pad);
	_g_object_unref0 (self->priv->recv_rtp_src_pad);
	_g_object_unref0 (self->priv->send_rtcp_src_pad);
	_g_object_unref0 (self->priv->send_rtp_sink_pad);
	_g_object_unref0 (self->priv->send_rtp_src_pad);
	_crypto_srtp_session_unref0 (self->priv->crypto_session);
	G_OBJECT_CLASS (dino_plugins_rtp_stream_parent_class)->finalize (obj);
}

static GType
dino_plugins_rtp_stream_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsRtpStreamClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_rtp_stream_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsRtpStream), 0, (GInstanceInitFunc) dino_plugins_rtp_stream_instance_init, NULL };
	GType dino_plugins_rtp_stream_type_id;
	dino_plugins_rtp_stream_type_id = g_type_register_static (XMPP_XEP_JINGLE_RTP_TYPE_STREAM, "DinoPluginsRtpStream", &g_define_type_info, 0);
	DinoPluginsRtpStream_private_offset = g_type_add_instance_private (dino_plugins_rtp_stream_type_id, sizeof (DinoPluginsRtpStreamPrivate));
	return dino_plugins_rtp_stream_type_id;
}

GType
dino_plugins_rtp_stream_get_type (void)
{
	static volatile gsize dino_plugins_rtp_stream_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_rtp_stream_type_id__once)) {
		GType dino_plugins_rtp_stream_type_id;
		dino_plugins_rtp_stream_type_id = dino_plugins_rtp_stream_get_type_once ();
		g_once_init_leave (&dino_plugins_rtp_stream_type_id__once, dino_plugins_rtp_stream_type_id);
	}
	return dino_plugins_rtp_stream_type_id__once;
}

static void
_vala_dino_plugins_rtp_stream_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	DinoPluginsRtpStream * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_PLUGINS_RTP_TYPE_STREAM, DinoPluginsRtpStream);
	switch (property_id) {
		case DINO_PLUGINS_RTP_STREAM_RTPID_PROPERTY:
		g_value_set_uchar (value, dino_plugins_rtp_stream_get_rtpid (self));
		break;
		case DINO_PLUGINS_RTP_STREAM_PLUGIN_PROPERTY:
		g_value_set_object (value, dino_plugins_rtp_stream_get_plugin (self));
		break;
		case DINO_PLUGINS_RTP_STREAM_PIPE_PROPERTY:
		g_value_set_object (value, dino_plugins_rtp_stream_get_pipe (self));
		break;
		case DINO_PLUGINS_RTP_STREAM_RTPBIN_PROPERTY:
		g_value_set_object (value, dino_plugins_rtp_stream_get_rtpbin (self));
		break;
		case DINO_PLUGINS_RTP_STREAM_CODEC_UTIL_PROPERTY:
		dino_plugins_rtp_value_set_codec_util (value, dino_plugins_rtp_stream_get_codec_util (self));
		break;
		case DINO_PLUGINS_RTP_STREAM_INPUT_DEVICE_PROPERTY:
		g_value_set_object (value, dino_plugins_rtp_stream_get_input_device (self));
		break;
		case DINO_PLUGINS_RTP_STREAM_OUTPUT_DEVICE_PROPERTY:
		g_value_set_object (value, dino_plugins_rtp_stream_get_output_device (self));
		break;
		case DINO_PLUGINS_RTP_STREAM_CREATED_PROPERTY:
		g_value_set_boolean (value, dino_plugins_rtp_stream_get_created (self));
		break;
		case DINO_PLUGINS_RTP_STREAM_PAUSED_PROPERTY:
		g_value_set_boolean (value, dino_plugins_rtp_stream_get_paused (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_plugins_rtp_stream_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	DinoPluginsRtpStream * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_PLUGINS_RTP_TYPE_STREAM, DinoPluginsRtpStream);
	switch (property_id) {
		case DINO_PLUGINS_RTP_STREAM_RTPID_PROPERTY:
		dino_plugins_rtp_stream_set_rtpid (self, g_value_get_uchar (value));
		break;
		case DINO_PLUGINS_RTP_STREAM_PLUGIN_PROPERTY:
		dino_plugins_rtp_stream_set_plugin (self, g_value_get_object (value));
		break;
		case DINO_PLUGINS_RTP_STREAM_INPUT_DEVICE_PROPERTY:
		dino_plugins_rtp_stream_set_input_device (self, g_value_get_object (value));
		break;
		case DINO_PLUGINS_RTP_STREAM_OUTPUT_DEVICE_PROPERTY:
		dino_plugins_rtp_stream_set_output_device (self, g_value_get_object (value));
		break;
		case DINO_PLUGINS_RTP_STREAM_CREATED_PROPERTY:
		dino_plugins_rtp_stream_set_created (self, g_value_get_boolean (value));
		break;
		case DINO_PLUGINS_RTP_STREAM_PAUSED_PROPERTY:
		dino_plugins_rtp_stream_set_paused (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dino_plugins_rtp_video_stream_get_instance_private (DinoPluginsRtpVideoStream* self)
{
	return G_STRUCT_MEMBER_P (self, DinoPluginsRtpVideoStream_private_offset);
}

DinoPluginsRtpVideoStream*
dino_plugins_rtp_video_stream_construct (GType object_type,
                                         DinoPluginsRtpPlugin* plugin,
                                         XmppXepJingleContent* content)
{
	DinoPluginsRtpVideoStream * self = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (plugin != NULL, NULL);
	g_return_val_if_fail (content != NULL, NULL);
	self = (DinoPluginsRtpVideoStream*) dino_plugins_rtp_stream_construct (object_type, plugin, content);
	_tmp0_ = xmpp_xep_jingle_rtp_stream_get_media ((XmppXepJingleRtpStream*) self);
	_tmp1_ = _tmp0_;
	if (g_strcmp0 (_tmp1_, "video") != 0) {
		g_critical ("stream.vala:807: VideoStream created for non-video media");
	}
	return self;
}

DinoPluginsRtpVideoStream*
dino_plugins_rtp_video_stream_new (DinoPluginsRtpPlugin* plugin,
                                   XmppXepJingleContent* content)
{
	return dino_plugins_rtp_video_stream_construct (DINO_PLUGINS_RTP_TYPE_VIDEO_STREAM, plugin, content);
}

static void
_dino_plugins_rtp_video_stream_on_video_orientation_changed_dino_plugins_rtp_stream_incoming_video_orientation_changed (DinoPluginsRtpStream* _sender,
                                                                                                                        guint16 degree,
                                                                                                                        gpointer self)
{
	dino_plugins_rtp_video_stream_on_video_orientation_changed ((DinoPluginsRtpVideoStream*) self, degree);
}

static void
dino_plugins_rtp_video_stream_real_create (XmppXepJingleRtpStream* base)
{
	DinoPluginsRtpVideoStream * self;
	gulong _tmp0_;
	DinoPluginsRtpPlugin* _tmp1_;
	DinoPluginsRtpPlugin* _tmp2_;
	guint8 _tmp3_;
	guint8 _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GstElement* _tmp9_;
	GstPipeline* _tmp10_;
	GstPipeline* _tmp11_;
	GstElement* _tmp12_;
	guint8 _tmp13_;
	guint8 _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	GstElement* _tmp19_;
	GstElement* _tmp20_;
	GstPipeline* _tmp21_;
	GstPipeline* _tmp22_;
	GstElement* _tmp23_;
	GstElement* _tmp24_;
	GstElement* _tmp25_;
	GstElement* _tmp26_;
	DinoPluginsRtpPlugin* _tmp37_;
	DinoPluginsRtpPlugin* _tmp38_;
	self = (DinoPluginsRtpVideoStream*) base;
	_tmp0_ = g_signal_connect_object ((DinoPluginsRtpStream*) self, "incoming-video-orientation-changed", (GCallback) _dino_plugins_rtp_video_stream_on_video_orientation_changed_dino_plugins_rtp_stream_incoming_video_orientation_changed, self, 0);
	self->priv->incoming_video_orientation_changed_handler = _tmp0_;
	_tmp1_ = dino_plugins_rtp_stream_get_plugin ((DinoPluginsRtpStream*) self);
	_tmp2_ = _tmp1_;
	dino_plugins_rtp_plugin_pause (_tmp2_);
	_tmp3_ = dino_plugins_rtp_stream_get_rtpid ((DinoPluginsRtpStream*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strdup_printf ("%hhu", _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strconcat ("video_rotate_", _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = gst_element_factory_make ("videoflip", _tmp8_);
	if (_tmp9_ != NULL) {
		g_object_ref_sink (_tmp9_);
	}
	_g_object_unref0 (self->priv->rotate);
	self->priv->rotate = _tmp9_;
	_g_free0 (_tmp8_);
	_g_free0 (_tmp6_);
	_tmp10_ = dino_plugins_rtp_stream_get_pipe ((DinoPluginsRtpStream*) self);
	_tmp11_ = _tmp10_;
	_tmp12_ = self->priv->rotate;
	gst_bin_add ((GstBin*) _tmp11_, _tmp12_);
	_tmp13_ = dino_plugins_rtp_stream_get_rtpid ((DinoPluginsRtpStream*) self);
	_tmp14_ = _tmp13_;
	_tmp15_ = g_strdup_printf ("%hhu", _tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_strconcat ("video_tee_", _tmp16_, NULL);
	_tmp18_ = _tmp17_;
	_tmp19_ = gst_element_factory_make ("tee", _tmp18_);
	if (_tmp19_ != NULL) {
		g_object_ref_sink (_tmp19_);
	}
	_g_object_unref0 (self->priv->output_tee);
	self->priv->output_tee = _tmp19_;
	_g_free0 (_tmp18_);
	_g_free0 (_tmp16_);
	_tmp20_ = self->priv->output_tee;
	g_object_set ((GObject*) _tmp20_, "allow-not-linked", TRUE, NULL);
	_tmp21_ = dino_plugins_rtp_stream_get_pipe ((DinoPluginsRtpStream*) self);
	_tmp22_ = _tmp21_;
	_tmp23_ = self->priv->output_tee;
	gst_bin_add ((GstBin*) _tmp22_, _tmp23_);
	_tmp24_ = self->priv->rotate;
	_tmp25_ = self->priv->output_tee;
	gst_element_link (_tmp24_, _tmp25_);
	_tmp26_ = self->priv->rotate;
	dino_plugins_rtp_stream_add_output ((DinoPluginsRtpStream*) self, _tmp26_, NULL);
	XMPP_XEP_JINGLE_RTP_STREAM_CLASS (dino_plugins_rtp_video_stream_parent_class)->create ((XmppXepJingleRtpStream*) G_TYPE_CHECK_INSTANCE_CAST (self, DINO_PLUGINS_RTP_TYPE_STREAM, DinoPluginsRtpStream));
	{
		GeeList* _output_list = NULL;
		GeeList* _tmp27_;
		gint _output_size = 0;
		GeeList* _tmp28_;
		gint _tmp29_;
		gint _tmp30_;
		gint _output_index = 0;
		_tmp27_ = self->priv->outputs;
		_output_list = _tmp27_;
		_tmp28_ = _output_list;
		_tmp29_ = gee_collection_get_size ((GeeCollection*) _tmp28_);
		_tmp30_ = _tmp29_;
		_output_size = _tmp30_;
		_output_index = -1;
		while (TRUE) {
			gint _tmp31_;
			gint _tmp32_;
			GstElement* output = NULL;
			GeeList* _tmp33_;
			gpointer _tmp34_;
			GstElement* _tmp35_;
			GstElement* _tmp36_;
			_output_index = _output_index + 1;
			_tmp31_ = _output_index;
			_tmp32_ = _output_size;
			if (!(_tmp31_ < _tmp32_)) {
				break;
			}
			_tmp33_ = _output_list;
			_tmp34_ = gee_list_get (_tmp33_, _output_index);
			output = (GstElement*) _tmp34_;
			_tmp35_ = self->priv->output_tee;
			_tmp36_ = output;
			gst_element_link (_tmp35_, _tmp36_);
			_g_object_unref0 (output);
		}
	}
	_tmp37_ = dino_plugins_rtp_stream_get_plugin ((DinoPluginsRtpStream*) self);
	_tmp38_ = _tmp37_;
	dino_plugins_rtp_plugin_unpause (_tmp38_);
}

static void
dino_plugins_rtp_video_stream_on_video_orientation_changed (DinoPluginsRtpVideoStream* self,
                                                            guint16 degree)
{
	GstElement* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->rotate;
	if (_tmp0_ != NULL) {
		switch (degree) {
			case 0:
			{
				GstElement* _tmp1_;
				_tmp1_ = self->priv->rotate;
				g_object_set ((GObject*) _tmp1_, "method", 0, NULL);
				break;
			}
			case 90:
			{
				GstElement* _tmp2_;
				_tmp2_ = self->priv->rotate;
				g_object_set ((GObject*) _tmp2_, "method", 1, NULL);
				break;
			}
			case 180:
			{
				GstElement* _tmp3_;
				_tmp3_ = self->priv->rotate;
				g_object_set ((GObject*) _tmp3_, "method", 2, NULL);
				break;
			}
			case 270:
			{
				GstElement* _tmp4_;
				_tmp4_ = self->priv->rotate;
				g_object_set ((GObject*) _tmp4_, "method", 3, NULL);
				break;
			}
			default:
			break;
		}
	}
}

static void
dino_plugins_rtp_video_stream_real_destroy (XmppXepJingleRtpStream* base)
{
	DinoPluginsRtpVideoStream * self;
	GstElement* _tmp10_;
	GstElement* _tmp11_;
	GstElement* _tmp12_;
	GstElement* _tmp13_;
	GstPipeline* _tmp14_;
	GstPipeline* _tmp15_;
	GstElement* _tmp16_;
	GstElement* _tmp17_;
	GstElement* _tmp18_;
	GstPipeline* _tmp19_;
	GstPipeline* _tmp20_;
	GstElement* _tmp21_;
	self = (DinoPluginsRtpVideoStream*) base;
	{
		GeeList* _output_list = NULL;
		GeeList* _tmp0_;
		gint _output_size = 0;
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _output_index = 0;
		_tmp0_ = self->priv->outputs;
		_output_list = _tmp0_;
		_tmp1_ = _output_list;
		_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_output_size = _tmp3_;
		_output_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			GstElement* output = NULL;
			GeeList* _tmp6_;
			gpointer _tmp7_;
			GstElement* _tmp8_;
			GstElement* _tmp9_;
			_output_index = _output_index + 1;
			_tmp4_ = _output_index;
			_tmp5_ = _output_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _output_list;
			_tmp7_ = gee_list_get (_tmp6_, _output_index);
			output = (GstElement*) _tmp7_;
			_tmp8_ = self->priv->output_tee;
			_tmp9_ = output;
			gst_element_unlink (_tmp8_, _tmp9_);
			_g_object_unref0 (output);
		}
	}
	XMPP_XEP_JINGLE_RTP_STREAM_CLASS (dino_plugins_rtp_video_stream_parent_class)->destroy ((XmppXepJingleRtpStream*) G_TYPE_CHECK_INSTANCE_CAST (self, DINO_PLUGINS_RTP_TYPE_STREAM, DinoPluginsRtpStream));
	_tmp10_ = self->priv->rotate;
	gst_element_set_locked_state (_tmp10_, TRUE);
	_tmp11_ = self->priv->rotate;
	gst_element_set_state (_tmp11_, GST_STATE_NULL);
	_tmp12_ = self->priv->rotate;
	_tmp13_ = self->priv->output_tee;
	gst_element_unlink (_tmp12_, _tmp13_);
	_tmp14_ = dino_plugins_rtp_stream_get_pipe ((DinoPluginsRtpStream*) self);
	_tmp15_ = _tmp14_;
	_tmp16_ = self->priv->rotate;
	gst_bin_remove ((GstBin*) _tmp15_, _tmp16_);
	_g_object_unref0 (self->priv->rotate);
	self->priv->rotate = NULL;
	_tmp17_ = self->priv->output_tee;
	gst_element_set_locked_state (_tmp17_, TRUE);
	_tmp18_ = self->priv->output_tee;
	gst_element_set_state (_tmp18_, GST_STATE_NULL);
	_tmp19_ = dino_plugins_rtp_stream_get_pipe ((DinoPluginsRtpStream*) self);
	_tmp20_ = _tmp19_;
	_tmp21_ = self->priv->output_tee;
	gst_bin_remove ((GstBin*) _tmp20_, _tmp21_);
	_g_object_unref0 (self->priv->output_tee);
	self->priv->output_tee = NULL;
	g_signal_handler_disconnect ((GObject*) self, self->priv->incoming_video_orientation_changed_handler);
}

static void
dino_plugins_rtp_video_stream_real_add_output (DinoPluginsRtpStream* base,
                                               GstElement* element,
                                               XmppJid* participant)
{
	DinoPluginsRtpVideoStream * self;
	gboolean _tmp0_ = FALSE;
	GstElement* _tmp1_;
	GeeList* _tmp3_;
	GstElement* _tmp4_;
	self = (DinoPluginsRtpVideoStream*) base;
	g_return_if_fail (element != NULL);
	_tmp1_ = self->priv->output_tee;
	if (element == _tmp1_) {
		_tmp0_ = TRUE;
	} else {
		GstElement* _tmp2_;
		_tmp2_ = self->priv->rotate;
		_tmp0_ = element == _tmp2_;
	}
	if (_tmp0_) {
		DINO_PLUGINS_RTP_STREAM_CLASS (dino_plugins_rtp_video_stream_parent_class)->add_output (G_TYPE_CHECK_INSTANCE_CAST (self, DINO_PLUGINS_RTP_TYPE_STREAM, DinoPluginsRtpStream), element, NULL);
		return;
	}
	_tmp3_ = self->priv->outputs;
	gee_collection_add ((GeeCollection*) _tmp3_, element);
	_tmp4_ = self->priv->output_tee;
	if (_tmp4_ != NULL) {
		GstElement* _tmp5_;
		_tmp5_ = self->priv->output_tee;
		gst_element_link (_tmp5_, element);
	}
}

static void
dino_plugins_rtp_video_stream_real_remove_output (DinoPluginsRtpStream* base,
                                                  GstElement* element)
{
	DinoPluginsRtpVideoStream * self;
	gboolean _tmp0_ = FALSE;
	GstElement* _tmp1_;
	GeeList* _tmp3_;
	GstElement* _tmp4_;
	self = (DinoPluginsRtpVideoStream*) base;
	g_return_if_fail (element != NULL);
	_tmp1_ = self->priv->output_tee;
	if (element == _tmp1_) {
		_tmp0_ = TRUE;
	} else {
		GstElement* _tmp2_;
		_tmp2_ = self->priv->rotate;
		_tmp0_ = element == _tmp2_;
	}
	if (_tmp0_) {
		DINO_PLUGINS_RTP_STREAM_CLASS (dino_plugins_rtp_video_stream_parent_class)->remove_output (G_TYPE_CHECK_INSTANCE_CAST (self, DINO_PLUGINS_RTP_TYPE_STREAM, DinoPluginsRtpStream), element);
		return;
	}
	_tmp3_ = self->priv->outputs;
	gee_collection_remove ((GeeCollection*) _tmp3_, element);
	_tmp4_ = self->priv->output_tee;
	if (_tmp4_ != NULL) {
		GstElement* _tmp5_;
		_tmp5_ = self->priv->output_tee;
		gst_element_unlink (_tmp5_, element);
	}
}

static void
dino_plugins_rtp_video_stream_class_init (DinoPluginsRtpVideoStreamClass * klass,
                                          gpointer klass_data)
{
	dino_plugins_rtp_video_stream_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoPluginsRtpVideoStream_private_offset);
	((XmppXepJingleRtpStreamClass *) klass)->create = (void (*) (XmppXepJingleRtpStream*)) dino_plugins_rtp_video_stream_real_create;
	((XmppXepJingleRtpStreamClass *) klass)->destroy = (void (*) (XmppXepJingleRtpStream*)) dino_plugins_rtp_video_stream_real_destroy;
	((DinoPluginsRtpStreamClass *) klass)->add_output = (void (*) (DinoPluginsRtpStream*, GstElement*, XmppJid*)) dino_plugins_rtp_video_stream_real_add_output;
	((DinoPluginsRtpStreamClass *) klass)->remove_output = (void (*) (DinoPluginsRtpStream*, GstElement*)) dino_plugins_rtp_video_stream_real_remove_output;
	G_OBJECT_CLASS (klass)->finalize = dino_plugins_rtp_video_stream_finalize;
}

static void
dino_plugins_rtp_video_stream_instance_init (DinoPluginsRtpVideoStream * self,
                                             gpointer klass)
{
	GeeArrayList* _tmp0_;
	self->priv = dino_plugins_rtp_video_stream_get_instance_private (self);
	_tmp0_ = gee_array_list_new (gst_element_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->outputs = (GeeList*) _tmp0_;
}

static void
dino_plugins_rtp_video_stream_finalize (GObject * obj)
{
	DinoPluginsRtpVideoStream * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_PLUGINS_RTP_TYPE_VIDEO_STREAM, DinoPluginsRtpVideoStream);
	_g_object_unref0 (self->priv->outputs);
	_g_object_unref0 (self->priv->output_tee);
	_g_object_unref0 (self->priv->rotate);
	G_OBJECT_CLASS (dino_plugins_rtp_video_stream_parent_class)->finalize (obj);
}

static GType
dino_plugins_rtp_video_stream_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoPluginsRtpVideoStreamClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_plugins_rtp_video_stream_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoPluginsRtpVideoStream), 0, (GInstanceInitFunc) dino_plugins_rtp_video_stream_instance_init, NULL };
	GType dino_plugins_rtp_video_stream_type_id;
	dino_plugins_rtp_video_stream_type_id = g_type_register_static (DINO_PLUGINS_RTP_TYPE_STREAM, "DinoPluginsRtpVideoStream", &g_define_type_info, 0);
	DinoPluginsRtpVideoStream_private_offset = g_type_add_instance_private (dino_plugins_rtp_video_stream_type_id, sizeof (DinoPluginsRtpVideoStreamPrivate));
	return dino_plugins_rtp_video_stream_type_id;
}

GType
dino_plugins_rtp_video_stream_get_type (void)
{
	static volatile gsize dino_plugins_rtp_video_stream_type_id__once = 0;
	if (g_once_init_enter (&dino_plugins_rtp_video_stream_type_id__once)) {
		GType dino_plugins_rtp_video_stream_type_id;
		dino_plugins_rtp_video_stream_type_id = dino_plugins_rtp_video_stream_get_type_once ();
		g_once_init_leave (&dino_plugins_rtp_video_stream_type_id__once, dino_plugins_rtp_video_stream_type_id);
	}
	return dino_plugins_rtp_video_stream_type_id__once;
}

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

