[farsight2/master] Add id property to FsRtpSession
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:19:02 PST 2008
---
gst/fsrtpconference/fs-rtp-conference.c | 3 ++-
gst/fsrtpconference/fs-rtp-session.c | 20 +++++++++++++++++---
gst/fsrtpconference/fs-rtp-session.h | 2 +-
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/gst/fsrtpconference/fs-rtp-conference.c b/gst/fsrtpconference/fs-rtp-conference.c
index c8d2a1f..b9e14f9 100644
--- a/gst/fsrtpconference/fs-rtp-conference.c
+++ b/gst/fsrtpconference/fs-rtp-conference.c
@@ -280,8 +280,9 @@ fs_rtp_conference_new_session (FsBaseConference *conf,
{
FsRtpConference *self = FS_RTP_CONFERENCE (conf);
FsSession *new_session = NULL;
+ guint id = 0;
- new_session = FS_SESSION_CAST (fs_rtp_session_new (media_type));
+ new_session = FS_SESSION_CAST (fs_rtp_session_new (media_type, id));
GST_OBJECT_LOCK (self);
self->priv->sessions = g_list_append (self->priv->sessions, new_session);
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 953e36c..ea4be3f 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -50,6 +50,7 @@ enum
{
PROP_0,
PROP_MEDIA_TYPE,
+ PROP_ID,
PROP_SINK_PAD,
PROP_NATIVE_CODECS,
PROP_NATIVE_CODECS_CONFIG,
@@ -60,6 +61,7 @@ enum
struct _FsRtpSessionPrivate
{
FsMediaType media_type;
+ guint id;
gboolean disposed;
};
@@ -145,10 +147,13 @@ fs_rtp_session_class_init (FsRtpSessionClass *klass)
session_class->stop_telephony_event = fs_rtp_session_stop_telephony_event;
session_class->set_send_codec = fs_rtp_session_set_send_codec;
- g_object_class_override_property (gobject_class,
+ g_object_class_override_property (gobject_class,
PROP_MEDIA_TYPE,
"media-type");
g_object_class_override_property (gobject_class,
+ PROP_ID,
+ "id");
+ g_object_class_override_property (gobject_class,
PROP_SINK_PAD,
"sink-pad");
g_object_class_override_property (gobject_class,
@@ -212,6 +217,9 @@ fs_rtp_session_get_property (GObject *object,
case PROP_MEDIA_TYPE:
g_value_set_enum (value, self->priv->media_type);
break;
+ case PROP_ID:
+ g_value_set_uint (value, self->priv->id);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -230,6 +238,9 @@ fs_rtp_session_set_property (GObject *object,
case PROP_MEDIA_TYPE:
self->priv->media_type = g_value_get_enum (value);
break;
+ case PROP_ID:
+ self->priv->id = g_value_get_uint (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -338,9 +349,12 @@ fs_rtp_session_set_send_codec (FsSession *session, FsCodec *send_codec,
}
FsRtpSession *
-fs_rtp_session_new (FsMediaType media_type)
+fs_rtp_session_new (FsMediaType media_type, guint id)
{
- return g_object_new (FS_TYPE_RTP_SESSION, "media-type", media_type, NULL);
+ return g_object_new (FS_TYPE_RTP_SESSION,
+ "media-type", media_type,
+ "id", id,
+ NULL);
}
diff --git a/gst/fsrtpconference/fs-rtp-session.h b/gst/fsrtpconference/fs-rtp-session.h
index 0cc4d1e..39279fb 100644
--- a/gst/fsrtpconference/fs-rtp-session.h
+++ b/gst/fsrtpconference/fs-rtp-session.h
@@ -66,7 +66,7 @@ struct _FsRtpSession
GType fs_rtp_session_get_type (void);
-FsRtpSession *fs_rtp_session_new (FsMediaType media_type);
+FsRtpSession *fs_rtp_session_new (FsMediaType media_type, guint id);
GstCaps *fs_rtp_session_request_pt_map (FsRtpSession *session, guint pt);
--
1.5.6.5
More information about the farsight-commits
mailing list