[farsight2/master] Indent fs-msn-conference properly
Olivier Crête
olivier.crete at collabora.co.uk
Tue Jul 14 09:50:27 PDT 2009
---
gst/fsmsnconference/fs-msn-conference.c | 209 +++++++++++--------------------
gst/fsmsnconference/fs-msn-conference.h | 14 +-
2 files changed, 81 insertions(+), 142 deletions(-)
diff --git a/gst/fsmsnconference/fs-msn-conference.c b/gst/fsmsnconference/fs-msn-conference.c
index 3987f17..b90eeae 100644
--- a/gst/fsmsnconference/fs-msn-conference.c
+++ b/gst/fsmsnconference/fs-msn-conference.c
@@ -68,35 +68,36 @@ static GstElementDetails fs_msn_conference_details =
static GstStaticPadTemplate fs_msn_conference_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink_%d",
- GST_PAD_SINK,
- GST_PAD_SOMETIMES,
- GST_STATIC_CAPS_ANY);
+ GST_PAD_SINK,
+ GST_PAD_SOMETIMES,
+ GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate fs_msn_conference_src_template =
GST_STATIC_PAD_TEMPLATE ("src_%d_%d_%d",
- GST_PAD_SRC,
- GST_PAD_SOMETIMES,
- GST_STATIC_CAPS_ANY);
+ GST_PAD_SRC,
+ GST_PAD_SOMETIMES,
+ GST_STATIC_CAPS_ANY);
#define FS_MSN_CONFERENCE_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((obj), FS_TYPE_MSN_CONFERENCE, FsMsnConferencePrivate))
+ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), FS_TYPE_MSN_CONFERENCE, \
+ FsMsnConferencePrivate))
struct _FsMsnConferencePrivate
- {
- gboolean disposed;
- gchar *local_address;
- /* Protected by GST_OBJECT_LOCK */
- GList *sessions;
- guint max_session_id;
- GList *participants;
- };
+{
+ gboolean disposed;
+ gchar *local_address;
+ /* Protected by GST_OBJECT_LOCK */
+ GList *sessions;
+ guint max_session_id;
+ GList *participants;
+};
static void fs_msn_conference_do_init (GType type);
GST_BOILERPLATE_FULL (FsMsnConference, fs_msn_conference, FsBaseConference,
- FS_TYPE_BASE_CONFERENCE, fs_msn_conference_do_init);
+ FS_TYPE_BASE_CONFERENCE, fs_msn_conference_do_init);
static void fs_msn_conference_get_property (GObject *object,
guint prop_id,
@@ -119,21 +120,12 @@ static FsParticipant *fs_msn_conference_new_participant (FsBaseConference *conf,
GError **error);
static FsMsnSession *fs_msn_conference_get_session_by_id_locked (
- FsMsnConference *self, guint session_id);
+ FsMsnConference *self, guint session_id);
static void _remove_session (gpointer user_data,
- GObject *where_the_object_was);
+ GObject *where_the_object_was);
static void _remove_participant (gpointer user_data,
- GObject *where_the_object_was);
-
-static void fs_msn_conference_handle_message (
- GstBin * bin,
- GstMessage * message);
-
-static GstStateChangeReturn fs_msn_conference_change_state (
- GstElement *element,
- GstStateChange transition);
-
+ GObject *where_the_object_was);
static void
fs_msn_conference_do_init (GType type)
@@ -186,7 +178,6 @@ fs_msn_conference_class_init (FsMsnConferenceClass * klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
FsBaseConferenceClass *baseconf_class = FS_BASE_CONFERENCE_CLASS (klass);
- GstBinClass *gstbin_class = GST_BIN_CLASS (klass);
g_type_class_add_private (klass, sizeof (FsMsnConferencePrivate));
@@ -197,12 +188,6 @@ fs_msn_conference_class_init (FsMsnConferenceClass * klass)
baseconf_class->new_participant =
GST_DEBUG_FUNCPTR (fs_msn_conference_new_participant);
- gstbin_class->handle_message =
- GST_DEBUG_FUNCPTR (fs_msn_conference_handle_message);
-
- gstelement_class->change_state =
- GST_DEBUG_FUNCPTR (fs_msn_conference_change_state);
-
gobject_class->finalize = GST_DEBUG_FUNCPTR (fs_msn_conference_finalize);
gobject_class->dispose = GST_DEBUG_FUNCPTR (fs_msn_conference_dispose);
gobject_class->set_property =
@@ -213,14 +198,14 @@ fs_msn_conference_class_init (FsMsnConferenceClass * klass)
gst_element_class_set_details (gstelement_class, &fs_msn_conference_details);
gst_element_class_add_pad_template (gstelement_class,
- gst_static_pad_template_get (&fs_msn_conference_sink_template));
+ gst_static_pad_template_get (&fs_msn_conference_sink_template));
gst_element_class_add_pad_template (gstelement_class,
- gst_static_pad_template_get (&fs_msn_conference_src_template));
+ gst_static_pad_template_get (&fs_msn_conference_src_template));
g_object_class_install_property (gobject_class,PROP_LOCAL_MSNADD,
- g_param_spec_string ("local_address", "Msn Address",
- "The local contact address for the MSN sessions",
- NULL, G_PARAM_READWRITE));
+ g_param_spec_string ("local_address", "Msn Address",
+ "The local contact address for the MSN sessions",
+ NULL, G_PARAM_READWRITE));
}
static void
@@ -249,14 +234,14 @@ fs_msn_conference_get_property (GObject *object,
FsMsnConference *self = FS_MSN_CONFERENCE (object);
switch (prop_id)
- {
- case PROP_LOCAL_MSNADD:
- g_value_set_string (value,self->priv->local_address);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
+ {
+ case PROP_LOCAL_MSNADD:
+ g_value_set_string (value,self->priv->local_address);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
}
static void
fs_msn_conference_set_property (GObject *object,
@@ -267,14 +252,14 @@ fs_msn_conference_set_property (GObject *object,
FsMsnConference *self = FS_MSN_CONFERENCE (object);
switch (prop_id)
- {
- case PROP_LOCAL_MSNADD:
- self->priv->local_address = g_value_dup_string (value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
+ {
+ case PROP_LOCAL_MSNADD:
+ self->priv->local_address = g_value_dup_string (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
}
@@ -297,15 +282,15 @@ fs_msn_conference_get_session_by_id_locked (FsMsnConference *self,
for (item = g_list_first (self->priv->sessions);
item;
item = g_list_next (item))
- {
- FsMsnSession *session = item->data;
+ {
+ FsMsnSession *session = item->data;
- if (session->id == session_id)
- {
- g_object_ref (session);
- break;
- }
+ if (session->id == session_id)
+ {
+ g_object_ref (session);
+ break;
}
+ }
if (item)
return FS_MSN_SESSION (item->data);
@@ -349,19 +334,19 @@ fs_msn_conference_new_session (FsBaseConference *conf,
GST_OBJECT_LOCK (self);
do
- {
- id = self->priv->max_session_id++;
- }
+ {
+ id = self->priv->max_session_id++;
+ }
while (fs_msn_conference_get_session_by_id_locked (self, id));
GST_OBJECT_UNLOCK (self);
new_session = FS_SESSION_CAST (fs_msn_session_new (media_type, self, id,
- error));
+ error));
if (!new_session)
- {
- return NULL;
- }
+ {
+ return NULL;
+ }
GST_OBJECT_LOCK (self);
self->priv->sessions = g_list_append (self->priv->sessions, new_session);
@@ -383,35 +368,35 @@ fs_msn_conference_new_participant (FsBaseConference *conf,
GList *item = NULL;
if (!cname)
- {
- g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
- "Invalid NULL cname");
- return NULL;
- }
+ {
+ g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
+ "Invalid NULL cname");
+ return NULL;
+ }
GST_OBJECT_LOCK (self);
for (item = g_list_first (self->priv->participants);
item;
item = g_list_next (item))
+ {
+ gchar *lcname;
+
+ g_object_get (item->data, "cname", &lcname, NULL);
+ if (!strcmp (lcname, cname))
{
- gchar *lcname;
-
- g_object_get (item->data, "cname", &lcname, NULL);
- if (!strcmp (lcname, cname))
- {
- g_free (lcname);
- break;
- }
g_free (lcname);
+ break;
}
+ g_free (lcname);
+ }
GST_OBJECT_UNLOCK (self);
if (item)
- {
- g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
- "There is already a participant with this cname");
- return NULL;
- }
+ {
+ g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
+ "There is already a participant with this cname");
+ return NULL;
+ }
new_participant = FS_PARTICIPANT_CAST (fs_msn_participant_new (cname));
@@ -419,56 +404,10 @@ fs_msn_conference_new_participant (FsBaseConference *conf,
GST_OBJECT_LOCK (self);
self->priv->participants = g_list_append (self->priv->participants,
- new_participant);
+ new_participant);
GST_OBJECT_UNLOCK (self);
g_object_weak_ref (G_OBJECT (new_participant), _remove_participant, self);
return new_participant;
}
-
-static void
-fs_msn_conference_handle_message (
- GstBin * bin,
- GstMessage * message)
-{
- switch (GST_MESSAGE_TYPE (message))
- {
- case GST_MESSAGE_ELEMENT:
- {
-
- }
- default:
- {
- GST_BIN_CLASS (parent_class)->handle_message (bin, message);
- break;
- }
- }
-}
-
-static GstStateChangeReturn
-fs_msn_conference_change_state (GstElement *element, GstStateChange transition)
-{
- GstStateChangeReturn result;
-
- switch (transition)
- {
- case GST_STATE_CHANGE_NULL_TO_READY:
- break;
- default:
- break;
- }
-
- if ((result =
- GST_ELEMENT_CLASS (parent_class)->change_state (element,
- transition)) == GST_STATE_CHANGE_FAILURE)
- goto failure;
-
- return result;
-
-failure:
- {
- GST_ERROR_OBJECT (element, "parent failed state change");
- return result;
- }
-}
diff --git a/gst/fsmsnconference/fs-msn-conference.h b/gst/fsmsnconference/fs-msn-conference.h
index 75c6ed4..6ed74cc 100644
--- a/gst/fsmsnconference/fs-msn-conference.h
+++ b/gst/fsmsnconference/fs-msn-conference.h
@@ -50,15 +50,15 @@ typedef struct _FsMsnConferenceClass FsMsnConferenceClass;
typedef struct _FsMsnConferencePrivate FsMsnConferencePrivate;
struct _FsMsnConference
- {
- FsBaseConference parent;
- FsMsnConferencePrivate *priv;
- };
+{
+ FsBaseConference parent;
+ FsMsnConferencePrivate *priv;
+};
struct _FsMsnConferenceClass
- {
- FsBaseConferenceClass parent_class;
- };
+{
+ FsBaseConferenceClass parent_class;
+};
GType fs_msn_conference_get_type (void);
--
1.5.6.5
More information about the farsight-commits
mailing list