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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include "libdino.h"
#include <float.h>
#include <math.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define DINO_UI_TYPE_CALL_CONNECTION_DETAILS_WINDOW (dino_ui_call_connection_details_window_get_type ())
#define DINO_UI_CALL_CONNECTION_DETAILS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_CALL_CONNECTION_DETAILS_WINDOW, DinoUiCallConnectionDetailsWindow))
#define DINO_UI_CALL_CONNECTION_DETAILS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_CALL_CONNECTION_DETAILS_WINDOW, DinoUiCallConnectionDetailsWindowClass))
#define DINO_UI_IS_CALL_CONNECTION_DETAILS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_CALL_CONNECTION_DETAILS_WINDOW))
#define DINO_UI_IS_CALL_CONNECTION_DETAILS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_CALL_CONNECTION_DETAILS_WINDOW))
#define DINO_UI_CALL_CONNECTION_DETAILS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_CALL_CONNECTION_DETAILS_WINDOW, DinoUiCallConnectionDetailsWindowClass))

typedef struct _DinoUiCallConnectionDetailsWindow DinoUiCallConnectionDetailsWindow;
typedef struct _DinoUiCallConnectionDetailsWindowClass DinoUiCallConnectionDetailsWindowClass;
typedef struct _DinoUiCallConnectionDetailsWindowPrivate DinoUiCallConnectionDetailsWindowPrivate;

#define DINO_UI_TYPE_CALL_CONTENT_DETAILS (dino_ui_call_content_details_get_type ())
#define DINO_UI_CALL_CONTENT_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_CALL_CONTENT_DETAILS, DinoUiCallContentDetails))
#define DINO_UI_CALL_CONTENT_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_CALL_CONTENT_DETAILS, DinoUiCallContentDetailsClass))
#define DINO_UI_IS_CALL_CONTENT_DETAILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_CALL_CONTENT_DETAILS))
#define DINO_UI_IS_CALL_CONTENT_DETAILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_CALL_CONTENT_DETAILS))
#define DINO_UI_CALL_CONTENT_DETAILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_CALL_CONTENT_DETAILS, DinoUiCallContentDetailsClass))

typedef struct _DinoUiCallContentDetails DinoUiCallContentDetails;
typedef struct _DinoUiCallContentDetailsClass DinoUiCallContentDetailsClass;
enum  {
	DINO_UI_CALL_CONNECTION_DETAILS_WINDOW_0_PROPERTY,
	DINO_UI_CALL_CONNECTION_DETAILS_WINDOW_NUM_PROPERTIES
};
static GParamSpec* dino_ui_call_connection_details_window_properties[DINO_UI_CALL_CONNECTION_DETAILS_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _DinoUiCallContentDetailsPrivate DinoUiCallContentDetailsPrivate;
enum  {
	DINO_UI_CALL_CONTENT_DETAILS_0_PROPERTY,
	DINO_UI_CALL_CONTENT_DETAILS_NUM_PROPERTIES
};
static GParamSpec* dino_ui_call_content_details_properties[DINO_UI_CALL_CONTENT_DETAILS_NUM_PROPERTIES];
#define _dino_peer_content_info_unref0(var) ((var == NULL) ? NULL : (var = (dino_peer_content_info_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _DinoUiCallConnectionDetailsWindow {
	GtkWindow parent_instance;
	DinoUiCallConnectionDetailsWindowPrivate * priv;
	GtkBox* box;
};

struct _DinoUiCallConnectionDetailsWindowClass {
	GtkWindowClass parent_class;
};

struct _DinoUiCallConnectionDetailsWindowPrivate {
	gboolean video_added;
	DinoUiCallContentDetails* audio_details;
	DinoUiCallContentDetails* video_details;
};

struct _DinoUiCallContentDetails {
	GtkGrid parent_instance;
	DinoUiCallContentDetailsPrivate * priv;
	GtkLabel* rtp_title;
	GtkLabel* rtcp_title;
	GtkLabel* target_recv_title;
	GtkLabel* target_send_title;
	GtkLabel* rtp_ready;
	GtkLabel* rtcp_ready;
	GtkLabel* sent_bps;
	GtkLabel* recv_bps;
	GtkLabel* codec;
	GtkLabel* target_receive_bitrate;
	GtkLabel* target_send_bitrate;
};

struct _DinoUiCallContentDetailsClass {
	GtkGridClass parent_class;
};

struct _DinoUiCallContentDetailsPrivate {
	DinoPeerContentInfo* prev_info;
	gint row_at;
};

static gint DinoUiCallConnectionDetailsWindow_private_offset;
static gpointer dino_ui_call_connection_details_window_parent_class = NULL;
static gint DinoUiCallContentDetails_private_offset;
static gpointer dino_ui_call_content_details_parent_class = NULL;

VALA_EXTERN GType dino_ui_call_connection_details_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiCallConnectionDetailsWindow, g_object_unref)
VALA_EXTERN GType dino_ui_call_content_details_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiCallContentDetails, g_object_unref)
VALA_EXTERN DinoUiCallContentDetails* dino_ui_call_content_details_new (const gchar* headline);
VALA_EXTERN DinoUiCallContentDetails* dino_ui_call_content_details_construct (GType object_type,
                                                                  const gchar* headline);
VALA_EXTERN DinoUiCallConnectionDetailsWindow* dino_ui_call_connection_details_window_new (void);
VALA_EXTERN DinoUiCallConnectionDetailsWindow* dino_ui_call_connection_details_window_construct (GType object_type);
VALA_EXTERN void dino_ui_call_connection_details_window_update_content (DinoUiCallConnectionDetailsWindow* self,
                                                            DinoPeerInfo* peer_info);
VALA_EXTERN void dino_ui_call_content_details_update_content (DinoUiCallContentDetails* self,
                                                  DinoPeerContentInfo* info);
static void dino_ui_call_connection_details_window_add_video_widgets (DinoUiCallConnectionDetailsWindow* self);
static void dino_ui_call_connection_details_window_finalize (GObject * obj);
static GType dino_ui_call_connection_details_window_get_type_once (void);
static void dino_ui_call_content_details_put_row (DinoUiCallContentDetails* self,
                                           const gchar* label);
static void dino_ui_call_content_details_finalize (GObject * obj);
static GType dino_ui_call_content_details_get_type_once (void);

static inline gpointer
dino_ui_call_connection_details_window_get_instance_private (DinoUiCallConnectionDetailsWindow* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiCallConnectionDetailsWindow_private_offset);
}

DinoUiCallConnectionDetailsWindow*
dino_ui_call_connection_details_window_construct (GType object_type)
{
	DinoUiCallConnectionDetailsWindow * self = NULL;
	GtkBox* _tmp0_;
	DinoUiCallContentDetails* _tmp1_;
	GtkBox* _tmp2_;
	DinoUiCallContentDetails* _tmp3_;
	GtkBox* _tmp4_;
	self = (DinoUiCallConnectionDetailsWindow*) g_object_new (object_type, NULL);
	_tmp0_ = self->box;
	_tmp1_ = self->priv->audio_details;
	gtk_box_append (_tmp0_, (GtkWidget*) _tmp1_);
	_tmp2_ = self->box;
	_tmp3_ = self->priv->video_details;
	gtk_box_append (_tmp2_, (GtkWidget*) _tmp3_);
	_tmp4_ = self->box;
	gtk_window_set_child ((GtkWindow*) self, (GtkWidget*) _tmp4_);
	return self;
}

DinoUiCallConnectionDetailsWindow*
dino_ui_call_connection_details_window_new (void)
{
	return dino_ui_call_connection_details_window_construct (DINO_UI_TYPE_CALL_CONNECTION_DETAILS_WINDOW);
}

void
dino_ui_call_connection_details_window_update_content (DinoUiCallConnectionDetailsWindow* self,
                                                       DinoPeerInfo* peer_info)
{
	DinoPeerContentInfo* _tmp0_;
	DinoPeerContentInfo* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (peer_info != NULL);
	_tmp0_ = peer_info->audio;
	if (_tmp0_ != NULL) {
		DinoUiCallContentDetails* _tmp1_;
		DinoPeerContentInfo* _tmp2_;
		_tmp1_ = self->priv->audio_details;
		_tmp2_ = peer_info->audio;
		dino_ui_call_content_details_update_content (_tmp1_, _tmp2_);
	}
	_tmp3_ = peer_info->video;
	if (_tmp3_ != NULL) {
		DinoUiCallContentDetails* _tmp4_;
		DinoPeerContentInfo* _tmp5_;
		dino_ui_call_connection_details_window_add_video_widgets (self);
		_tmp4_ = self->priv->video_details;
		_tmp5_ = peer_info->video;
		dino_ui_call_content_details_update_content (_tmp4_, _tmp5_);
	}
}

static void
dino_ui_call_connection_details_window_add_video_widgets (DinoUiCallConnectionDetailsWindow* self)
{
	DinoUiCallContentDetails* _tmp0_;
	g_return_if_fail (self != NULL);
	if (self->priv->video_added) {
		return;
	}
	_tmp0_ = self->priv->video_details;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
	self->priv->video_added = TRUE;
}

static void
dino_ui_call_connection_details_window_class_init (DinoUiCallConnectionDetailsWindowClass * klass,
                                                   gpointer klass_data)
{
	dino_ui_call_connection_details_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiCallConnectionDetailsWindow_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dino_ui_call_connection_details_window_finalize;
}

static void
dino_ui_call_connection_details_window_instance_init (DinoUiCallConnectionDetailsWindow * self,
                                                      gpointer klass)
{
	GtkBox* _tmp0_ = NULL;
	DinoUiCallContentDetails* _tmp1_;
	DinoUiCallContentDetails* _tmp2_;
	self->priv = dino_ui_call_connection_details_window_get_instance_private (self);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 15);
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_CENTER);
	gtk_widget_set_valign ((GtkWidget*) _tmp0_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp0_);
	self->box = _tmp0_;
	self->priv->video_added = FALSE;
	_tmp1_ = dino_ui_call_content_details_new ("Audio");
	g_object_ref_sink (_tmp1_);
	self->priv->audio_details = _tmp1_;
	_tmp2_ = dino_ui_call_content_details_new ("Video");
	g_object_ref_sink (_tmp2_);
	self->priv->video_details = _tmp2_;
}

static void
dino_ui_call_connection_details_window_finalize (GObject * obj)
{
	DinoUiCallConnectionDetailsWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_CALL_CONNECTION_DETAILS_WINDOW, DinoUiCallConnectionDetailsWindow);
	_g_object_unref0 (self->box);
	_g_object_unref0 (self->priv->audio_details);
	_g_object_unref0 (self->priv->video_details);
	G_OBJECT_CLASS (dino_ui_call_connection_details_window_parent_class)->finalize (obj);
}

static GType
dino_ui_call_connection_details_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiCallConnectionDetailsWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_call_connection_details_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiCallConnectionDetailsWindow), 0, (GInstanceInitFunc) dino_ui_call_connection_details_window_instance_init, NULL };
	GType dino_ui_call_connection_details_window_type_id;
	dino_ui_call_connection_details_window_type_id = g_type_register_static (gtk_window_get_type (), "DinoUiCallConnectionDetailsWindow", &g_define_type_info, 0);
	DinoUiCallConnectionDetailsWindow_private_offset = g_type_add_instance_private (dino_ui_call_connection_details_window_type_id, sizeof (DinoUiCallConnectionDetailsWindowPrivate));
	return dino_ui_call_connection_details_window_type_id;
}

GType
dino_ui_call_connection_details_window_get_type (void)
{
	static volatile gsize dino_ui_call_connection_details_window_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_call_connection_details_window_type_id__once)) {
		GType dino_ui_call_connection_details_window_type_id;
		dino_ui_call_connection_details_window_type_id = dino_ui_call_connection_details_window_get_type_once ();
		g_once_init_leave (&dino_ui_call_connection_details_window_type_id__once, dino_ui_call_connection_details_window_type_id);
	}
	return dino_ui_call_connection_details_window_type_id__once;
}

static inline gpointer
dino_ui_call_content_details_get_instance_private (DinoUiCallContentDetails* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiCallContentDetails_private_offset);
}

DinoUiCallContentDetails*
dino_ui_call_content_details_construct (GType object_type,
                                        const gchar* headline)
{
	DinoUiCallContentDetails * self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GtkLabel* _tmp2_ = NULL;
	GtkLabel* _tmp3_;
	gint _tmp4_;
	GtkLabel* _tmp5_;
	GtkLabel* _tmp6_;
	gint _tmp7_;
	GtkLabel* _tmp8_;
	GtkLabel* _tmp9_;
	gint _tmp10_;
	GtkLabel* _tmp11_;
	gint _tmp12_;
	GtkLabel* _tmp13_;
	gint _tmp14_;
	GtkLabel* _tmp15_;
	gint _tmp16_;
	GtkLabel* _tmp17_;
	GtkLabel* _tmp18_;
	gint _tmp19_;
	GtkLabel* _tmp20_;
	GtkLabel* _tmp21_;
	gint _tmp22_;
	g_return_val_if_fail (headline != NULL, NULL);
	self = (DinoUiCallContentDetails*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup_printf ("<b>%s</b>", headline);
	_tmp1_ = _tmp0_;
	_tmp2_ = (GtkLabel*) gtk_label_new (_tmp1_);
	gtk_label_set_use_markup (_tmp2_, TRUE);
	gtk_label_set_xalign (_tmp2_, (gfloat) 0);
	g_object_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->row_at;
	self->priv->row_at = _tmp4_ + 1;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp3_, 0, _tmp4_, 1, 1);
	_g_object_unref0 (_tmp3_);
	_g_free0 (_tmp1_);
	_tmp5_ = self->rtp_title;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp5_, 0, self->priv->row_at, 1, 1);
	_tmp6_ = self->rtp_ready;
	_tmp7_ = self->priv->row_at;
	self->priv->row_at = _tmp7_ + 1;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp6_, 1, _tmp7_, 1, 1);
	_tmp8_ = self->rtcp_title;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp8_, 0, self->priv->row_at, 1, 1);
	_tmp9_ = self->rtcp_ready;
	_tmp10_ = self->priv->row_at;
	self->priv->row_at = _tmp10_ + 1;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp9_, 1, _tmp10_, 1, 1);
	dino_ui_call_content_details_put_row (self, "Sent");
	_tmp11_ = self->sent_bps;
	_tmp12_ = self->priv->row_at;
	self->priv->row_at = _tmp12_ + 1;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp11_, 1, _tmp12_, 1, 1);
	dino_ui_call_content_details_put_row (self, "Received");
	_tmp13_ = self->recv_bps;
	_tmp14_ = self->priv->row_at;
	self->priv->row_at = _tmp14_ + 1;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp13_, 1, _tmp14_, 1, 1);
	dino_ui_call_content_details_put_row (self, "Codec");
	_tmp15_ = self->codec;
	_tmp16_ = self->priv->row_at;
	self->priv->row_at = _tmp16_ + 1;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp15_, 1, _tmp16_, 1, 1);
	_tmp17_ = self->target_recv_title;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp17_, 0, self->priv->row_at, 1, 1);
	_tmp18_ = self->target_receive_bitrate;
	_tmp19_ = self->priv->row_at;
	self->priv->row_at = _tmp19_ + 1;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp18_, 1, _tmp19_, 1, 1);
	_tmp20_ = self->target_send_title;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp20_, 0, self->priv->row_at, 1, 1);
	_tmp21_ = self->target_send_bitrate;
	_tmp22_ = self->priv->row_at;
	self->priv->row_at = _tmp22_ + 1;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp21_, 1, _tmp22_, 1, 1);
	gtk_grid_set_column_spacing ((GtkGrid*) self, 5);
	return self;
}

DinoUiCallContentDetails*
dino_ui_call_content_details_new (const gchar* headline)
{
	return dino_ui_call_content_details_construct (DINO_UI_TYPE_CALL_CONTENT_DETAILS, headline);
}

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 gpointer
_dino_peer_content_info_ref0 (gpointer self)
{
	return self ? dino_peer_content_info_ref (self) : NULL;
}

void
dino_ui_call_content_details_update_content (DinoUiCallContentDetails* self,
                                             DinoPeerContentInfo* info)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	guint _tmp20_;
	guint _tmp21_;
	GtkLabel* _tmp40_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	guint32 _tmp45_;
	guint32 _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	gchar* _tmp50_;
	DinoPeerContentInfo* _tmp51_;
	DinoPeerContentInfo* _tmp68_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (info != NULL);
	_tmp0_ = dino_peer_content_info_get_rtp_ready (info);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		GtkLabel* _tmp2_;
		GtkLabel* _tmp3_;
		GtkLabel* _tmp4_;
		GtkLabel* _tmp5_;
		GtkLabel* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		GtkLabel* _tmp11_;
		gboolean _tmp12_;
		gboolean _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp2_ = self->rtp_ready;
		_tmp3_ = self->rtcp_ready;
		gtk_widget_set_visible ((GtkWidget*) _tmp3_, TRUE);
		gtk_widget_set_visible ((GtkWidget*) _tmp2_, TRUE);
		_tmp4_ = self->rtp_title;
		_tmp5_ = self->rtcp_title;
		gtk_widget_set_visible ((GtkWidget*) _tmp5_, TRUE);
		gtk_widget_set_visible ((GtkWidget*) _tmp4_, TRUE);
		_tmp6_ = self->rtp_ready;
		_tmp7_ = dino_peer_content_info_get_rtp_ready (info);
		_tmp8_ = _tmp7_;
		_tmp9_ = bool_to_string (_tmp8_);
		_tmp10_ = _tmp9_;
		gtk_label_set_label (_tmp6_, _tmp10_);
		_g_free0 (_tmp10_);
		_tmp11_ = self->rtcp_ready;
		_tmp12_ = dino_peer_content_info_get_rtcp_ready (info);
		_tmp13_ = _tmp12_;
		_tmp14_ = bool_to_string (_tmp13_);
		_tmp15_ = _tmp14_;
		gtk_label_set_label (_tmp11_, _tmp15_);
		_g_free0 (_tmp15_);
	} else {
		GtkLabel* _tmp16_;
		GtkLabel* _tmp17_;
		GtkLabel* _tmp18_;
		GtkLabel* _tmp19_;
		_tmp16_ = self->rtp_ready;
		_tmp17_ = self->rtcp_ready;
		gtk_widget_set_visible ((GtkWidget*) _tmp17_, FALSE);
		gtk_widget_set_visible ((GtkWidget*) _tmp16_, FALSE);
		_tmp18_ = self->rtp_title;
		_tmp19_ = self->rtcp_title;
		gtk_widget_set_visible ((GtkWidget*) _tmp19_, FALSE);
		gtk_widget_set_visible ((GtkWidget*) _tmp18_, FALSE);
	}
	_tmp20_ = dino_peer_content_info_get_target_send_bytes (info);
	_tmp21_ = _tmp20_;
	if (_tmp21_ != ((guint) -1)) {
		GtkLabel* _tmp22_;
		GtkLabel* _tmp23_;
		GtkLabel* _tmp24_;
		GtkLabel* _tmp25_;
		GtkLabel* _tmp26_;
		guint _tmp27_;
		guint _tmp28_;
		gchar* _tmp29_;
		gchar* _tmp30_;
		GtkLabel* _tmp31_;
		guint _tmp32_;
		guint _tmp33_;
		gchar* _tmp34_;
		gchar* _tmp35_;
		_tmp22_ = self->target_receive_bitrate;
		_tmp23_ = self->target_send_bitrate;
		gtk_widget_set_visible ((GtkWidget*) _tmp23_, TRUE);
		gtk_widget_set_visible ((GtkWidget*) _tmp22_, TRUE);
		_tmp24_ = self->target_recv_title;
		_tmp25_ = self->target_send_title;
		gtk_widget_set_visible ((GtkWidget*) _tmp25_, TRUE);
		gtk_widget_set_visible ((GtkWidget*) _tmp24_, TRUE);
		_tmp26_ = self->target_receive_bitrate;
		_tmp27_ = dino_peer_content_info_get_target_receive_bytes (info);
		_tmp28_ = _tmp27_;
		_tmp29_ = g_strdup_printf ("<span font_family='monospace'>%u</span> kbps", _tmp28_);
		_tmp30_ = _tmp29_;
		gtk_label_set_label (_tmp26_, _tmp30_);
		_g_free0 (_tmp30_);
		_tmp31_ = self->target_send_bitrate;
		_tmp32_ = dino_peer_content_info_get_target_send_bytes (info);
		_tmp33_ = _tmp32_;
		_tmp34_ = g_strdup_printf ("<span font_family='monospace'>%u</span> kbps", _tmp33_);
		_tmp35_ = _tmp34_;
		gtk_label_set_label (_tmp31_, _tmp35_);
		_g_free0 (_tmp35_);
	} else {
		GtkLabel* _tmp36_;
		GtkLabel* _tmp37_;
		GtkLabel* _tmp38_;
		GtkLabel* _tmp39_;
		_tmp36_ = self->target_receive_bitrate;
		_tmp37_ = self->target_send_bitrate;
		gtk_widget_set_visible ((GtkWidget*) _tmp37_, FALSE);
		gtk_widget_set_visible ((GtkWidget*) _tmp36_, FALSE);
		_tmp38_ = self->target_recv_title;
		_tmp39_ = self->target_send_title;
		gtk_widget_set_visible ((GtkWidget*) _tmp39_, FALSE);
		gtk_widget_set_visible ((GtkWidget*) _tmp38_, FALSE);
	}
	_tmp40_ = self->codec;
	_tmp41_ = dino_peer_content_info_get_codec (info);
	_tmp42_ = _tmp41_;
	_tmp43_ = g_strconcat (_tmp42_, " ", NULL);
	_tmp44_ = _tmp43_;
	_tmp45_ = dino_peer_content_info_get_clockrate (info);
	_tmp46_ = _tmp45_;
	_tmp47_ = g_strdup_printf ("%u", _tmp46_);
	_tmp48_ = _tmp47_;
	_tmp49_ = g_strconcat (_tmp44_, _tmp48_, NULL);
	_tmp50_ = _tmp49_;
	gtk_label_set_label (_tmp40_, _tmp50_);
	_g_free0 (_tmp50_);
	_g_free0 (_tmp48_);
	_g_free0 (_tmp44_);
	_tmp51_ = self->priv->prev_info;
	if (_tmp51_ != NULL) {
		gulong audio_sent_kbps = 0UL;
		gulong* _tmp52_;
		gulong* _tmp53_;
		DinoPeerContentInfo* _tmp54_;
		gulong* _tmp55_;
		gulong* _tmp56_;
		GtkLabel* _tmp57_;
		gchar* _tmp58_;
		gchar* _tmp59_;
		gulong audio_recv_kbps = 0UL;
		gulong* _tmp60_;
		gulong* _tmp61_;
		DinoPeerContentInfo* _tmp62_;
		gulong* _tmp63_;
		gulong* _tmp64_;
		GtkLabel* _tmp65_;
		gchar* _tmp66_;
		gchar* _tmp67_;
		_tmp52_ = dino_peer_content_info_get_bytes_sent (info);
		_tmp53_ = _tmp52_;
		_tmp54_ = self->priv->prev_info;
		_tmp55_ = dino_peer_content_info_get_bytes_sent (_tmp54_);
		_tmp56_ = _tmp55_;
		audio_sent_kbps = (((*_tmp53_) - (*_tmp56_)) * 8) / 1000;
		_tmp57_ = self->sent_bps;
		_tmp58_ = g_strdup_printf ("<span font_family='monospace'>%lu</span> kbps", audio_sent_kbps);
		_tmp59_ = _tmp58_;
		gtk_label_set_label (_tmp57_, _tmp59_);
		_g_free0 (_tmp59_);
		_tmp60_ = dino_peer_content_info_get_bytes_received (info);
		_tmp61_ = _tmp60_;
		_tmp62_ = self->priv->prev_info;
		_tmp63_ = dino_peer_content_info_get_bytes_received (_tmp62_);
		_tmp64_ = _tmp63_;
		audio_recv_kbps = (((*_tmp61_) - (*_tmp64_)) * 8) / 1000;
		_tmp65_ = self->recv_bps;
		_tmp66_ = g_strdup_printf ("<span font_family='monospace'>%lu</span> kbps", audio_recv_kbps);
		_tmp67_ = _tmp66_;
		gtk_label_set_label (_tmp65_, _tmp67_);
		_g_free0 (_tmp67_);
	}
	_tmp68_ = _dino_peer_content_info_ref0 (info);
	_dino_peer_content_info_unref0 (self->priv->prev_info);
	self->priv->prev_info = _tmp68_;
}

static void
dino_ui_call_content_details_put_row (DinoUiCallContentDetails* self,
                                      const gchar* label)
{
	GtkLabel* _tmp0_ = NULL;
	GtkLabel* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (label != NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new (label);
	gtk_label_set_xalign (_tmp0_, (gfloat) 0);
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp1_, 0, self->priv->row_at, 1, 1);
	_g_object_unref0 (_tmp1_);
}

static void
dino_ui_call_content_details_class_init (DinoUiCallContentDetailsClass * klass,
                                         gpointer klass_data)
{
	dino_ui_call_content_details_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiCallContentDetails_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dino_ui_call_content_details_finalize;
}

static void
dino_ui_call_content_details_instance_init (DinoUiCallContentDetails * self,
                                            gpointer klass)
{
	GtkLabel* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkLabel* _tmp2_ = NULL;
	GtkLabel* _tmp3_ = NULL;
	GtkLabel* _tmp4_ = NULL;
	GtkLabel* _tmp5_ = NULL;
	GtkLabel* _tmp6_ = NULL;
	GtkLabel* _tmp7_ = NULL;
	GtkLabel* _tmp8_ = NULL;
	GtkLabel* _tmp9_ = NULL;
	GtkLabel* _tmp10_ = NULL;
	self->priv = dino_ui_call_content_details_get_instance_private (self);
	_tmp0_ = (GtkLabel*) gtk_label_new ("RTP");
	gtk_label_set_xalign (_tmp0_, (gfloat) 0);
	g_object_ref_sink (_tmp0_);
	self->rtp_title = _tmp0_;
	_tmp1_ = (GtkLabel*) gtk_label_new ("RTCP");
	gtk_label_set_xalign (_tmp1_, (gfloat) 0);
	g_object_ref_sink (_tmp1_);
	self->rtcp_title = _tmp1_;
	_tmp2_ = (GtkLabel*) gtk_label_new ("Target receive bitrate");
	gtk_label_set_xalign (_tmp2_, (gfloat) 0);
	g_object_ref_sink (_tmp2_);
	self->target_recv_title = _tmp2_;
	_tmp3_ = (GtkLabel*) gtk_label_new ("Target send bitrate");
	gtk_label_set_xalign (_tmp3_, (gfloat) 0);
	g_object_ref_sink (_tmp3_);
	self->target_send_title = _tmp3_;
	_tmp4_ = (GtkLabel*) gtk_label_new ("?");
	gtk_label_set_xalign (_tmp4_, (gfloat) 0);
	g_object_ref_sink (_tmp4_);
	self->rtp_ready = _tmp4_;
	_tmp5_ = (GtkLabel*) gtk_label_new ("?");
	gtk_label_set_xalign (_tmp5_, (gfloat) 0);
	g_object_ref_sink (_tmp5_);
	self->rtcp_ready = _tmp5_;
	_tmp6_ = (GtkLabel*) gtk_label_new ("?");
	gtk_label_set_use_markup (_tmp6_, TRUE);
	gtk_label_set_xalign (_tmp6_, (gfloat) 0);
	g_object_ref_sink (_tmp6_);
	self->sent_bps = _tmp6_;
	_tmp7_ = (GtkLabel*) gtk_label_new ("?");
	gtk_label_set_use_markup (_tmp7_, TRUE);
	gtk_label_set_xalign (_tmp7_, (gfloat) 0);
	g_object_ref_sink (_tmp7_);
	self->recv_bps = _tmp7_;
	_tmp8_ = (GtkLabel*) gtk_label_new ("?");
	gtk_label_set_xalign (_tmp8_, (gfloat) 0);
	g_object_ref_sink (_tmp8_);
	self->codec = _tmp8_;
	_tmp9_ = (GtkLabel*) gtk_label_new ("n/a");
	gtk_label_set_use_markup (_tmp9_, TRUE);
	gtk_label_set_xalign (_tmp9_, (gfloat) 0);
	g_object_ref_sink (_tmp9_);
	self->target_receive_bitrate = _tmp9_;
	_tmp10_ = (GtkLabel*) gtk_label_new ("n/a");
	gtk_label_set_use_markup (_tmp10_, TRUE);
	gtk_label_set_xalign (_tmp10_, (gfloat) 0);
	g_object_ref_sink (_tmp10_);
	self->target_send_bitrate = _tmp10_;
	self->priv->prev_info = NULL;
	self->priv->row_at = 0;
}

static void
dino_ui_call_content_details_finalize (GObject * obj)
{
	DinoUiCallContentDetails * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_CALL_CONTENT_DETAILS, DinoUiCallContentDetails);
	_g_object_unref0 (self->rtp_title);
	_g_object_unref0 (self->rtcp_title);
	_g_object_unref0 (self->target_recv_title);
	_g_object_unref0 (self->target_send_title);
	_g_object_unref0 (self->rtp_ready);
	_g_object_unref0 (self->rtcp_ready);
	_g_object_unref0 (self->sent_bps);
	_g_object_unref0 (self->recv_bps);
	_g_object_unref0 (self->codec);
	_g_object_unref0 (self->target_receive_bitrate);
	_g_object_unref0 (self->target_send_bitrate);
	_dino_peer_content_info_unref0 (self->priv->prev_info);
	G_OBJECT_CLASS (dino_ui_call_content_details_parent_class)->finalize (obj);
}

static GType
dino_ui_call_content_details_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiCallContentDetailsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_call_content_details_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiCallContentDetails), 0, (GInstanceInitFunc) dino_ui_call_content_details_instance_init, NULL };
	GType dino_ui_call_content_details_type_id;
	dino_ui_call_content_details_type_id = g_type_register_static (gtk_grid_get_type (), "DinoUiCallContentDetails", &g_define_type_info, 0);
	DinoUiCallContentDetails_private_offset = g_type_add_instance_private (dino_ui_call_content_details_type_id, sizeof (DinoUiCallContentDetailsPrivate));
	return dino_ui_call_content_details_type_id;
}

GType
dino_ui_call_content_details_get_type (void)
{
	static volatile gsize dino_ui_call_content_details_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_call_content_details_type_id__once)) {
		GType dino_ui_call_content_details_type_id;
		dino_ui_call_content_details_type_id = dino_ui_call_content_details_get_type_once ();
		g_once_init_leave (&dino_ui_call_content_details_type_id__once, dino_ui_call_content_details_type_id);
	}
	return dino_ui_call_content_details_type_id__once;
}

