sip: codestyle changes

Shuffle the code around and make use of docstrings to conform to
the newly introduced coding style as described in `HACKING.md`

This commit also introduces docstrings describing each source file.
This commit is contained in:
Evangelos Ribeiro Tzaras
2021-04-11 00:25:13 +02:00
parent 765cd2ebb9
commit 7ed1ee2502
5 changed files with 135 additions and 82 deletions

View File

@@ -24,17 +24,34 @@
#define G_LOG_DOMAIN "CallsSipCall"
#include "calls-sip-call.h"
#include "calls-call.h"
#include "calls-message-source.h"
#include "calls-sip-call.h"
#include "calls-sip-media-manager.h"
#include "calls-sip-media-pipeline.h"
#include "calls-sip-util.h"
#include "calls-call.h"
#include <glib/gi18n.h>
#include <sofia-sip/nua.h>
/**
* SECTION:sip-call
* @short_description: A #CallsCall for the SIP protocol
* @Title: CallsSipCall
*
* #CallsSipCall derives from #CallsCall. Apart from allowing call control
* like answering and hanging up it also coordinates with #CallsSipMediaManager
* to prepare and control appropriate #CallsSipMediaPipeline objects.
*/
enum {
PROP_0,
PROP_CALL_HANDLE,
PROP_LAST_PROP
};
static GParamSpec *props[PROP_LAST_PROP];
struct _CallsSipCall
{
@@ -62,14 +79,6 @@ G_DEFINE_TYPE_WITH_CODE (CallsSipCall, calls_sip_call, CALLS_TYPE_CALL,
G_IMPLEMENT_INTERFACE (CALLS_TYPE_MESSAGE_SOURCE,
calls_sip_call_message_source_interface_init))
enum {
PROP_0,
PROP_CALL_HANDLE,
PROP_LAST_PROP
};
static GParamSpec *props[PROP_LAST_PROP];
static gboolean
try_setting_up_media_pipeline (CallsSipCall *self)
{
@@ -115,6 +124,7 @@ calls_sip_call_get_number (CallsCall *call)
return self->number;
}
static CallsCallState
calls_sip_call_get_state (CallsCall *call)
{
@@ -123,6 +133,7 @@ calls_sip_call_get_state (CallsCall *call)
return self->state;
}
static gboolean
calls_sip_call_get_inbound (CallsCall *call)
{
@@ -131,6 +142,7 @@ calls_sip_call_get_inbound (CallsCall *call)
return self->inbound;
}
static void
calls_sip_call_answer (CallsCall *call)
{
@@ -169,6 +181,7 @@ calls_sip_call_answer (CallsCall *call)
calls_sip_call_set_state (self, CALLS_CALL_STATE_ACTIVE);
}
static void
calls_sip_call_hang_up (CallsCall *call)
{
@@ -205,6 +218,7 @@ calls_sip_call_hang_up (CallsCall *call)
}
}
static void
calls_sip_call_set_property (GObject *object,
guint property_id,
@@ -287,6 +301,7 @@ calls_sip_call_class_init (CallsSipCallClass *klass)
g_object_class_install_property (object_class, PROP_CALL_HANDLE, props[PROP_CALL_HANDLE]);
}
static void
calls_sip_call_message_source_interface_init (CallsMessageSourceInterface *iface)
{