[farsight2/master] Fix various bugs in FsRtpDtmfEventSource
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:21:38 PST 2008
---
gst/fsrtpconference/fs-rtp-dtmf-event-source.c | 14 ++++++++++++--
gst/fsrtpconference/fs-rtp-special-source.c | 5 ++++-
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/gst/fsrtpconference/fs-rtp-dtmf-event-source.c b/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
index a39ff85..c218543 100644
--- a/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
+++ b/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
@@ -144,6 +144,8 @@ fs_rtp_dtmf_event_source_class_init (FsRtpDtmfEventSourceClass *klass)
"The RTP muxer that the source is linked to",
GST_TYPE_ELEMENT,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE));
+
+ g_type_class_add_private (klass, sizeof (FsRtpDtmfEventSourcePrivate));
}
static void
@@ -276,6 +278,7 @@ fs_rtp_dtmf_event_source_class_add_blueprint (FsRtpSpecialSourceClass *klass,
GList *item;
GList *already_done = NULL;
GstElementFactory *fact = NULL;
+ GList *new_blueprints = NULL;
fact = gst_element_factory_find ("rtpdtmfsrc");
if (fact)
@@ -305,6 +308,9 @@ fs_rtp_dtmf_event_source_class_add_blueprint (FsRtpSpecialSourceClass *klass,
if (!g_ascii_strcasecmp (bp->codec->encoding_name, "telephone-event"))
continue;
+ if (bp->codec->clock_rate == 0)
+ continue;
+
for (done_item = g_list_first (already_done);
done_item;
done_item = g_list_next (done_item))
@@ -326,8 +332,10 @@ fs_rtp_dtmf_event_source_class_add_blueprint (FsRtpSpecialSourceClass *klass,
param->name = g_strdup ("");
param->value = g_strdup ("0-15");
new_bp->codec->optional_params = g_list_prepend (NULL, param);
+ new_bp->rtp_caps = fs_codec_to_gst_caps (new_bp->codec);
+ new_bp->media_caps = gst_caps_new_any ();
- blueprints = g_list_append (blueprints, new_bp);
+ new_blueprints = g_list_append (new_blueprints, new_bp);
already_done = g_list_prepend (already_done,
GUINT_TO_POINTER (bp->codec->clock_rate));
@@ -335,6 +343,8 @@ fs_rtp_dtmf_event_source_class_add_blueprint (FsRtpSpecialSourceClass *klass,
g_list_free (already_done);
+ blueprints = g_list_concat (blueprints, new_blueprints);
+
return blueprints;
}
@@ -459,7 +469,7 @@ fs_rtp_dtmf_event_source_build (FsRtpDtmfEventSource *self,
caps = fs_codec_to_gst_caps (telephony_codec);
g_object_set (capsfilter, "caps", caps, NULL);
- gst_object_unref (caps);
+ gst_caps_unref (caps);
pad = gst_element_get_static_pad (capsfilter, "src");
if (!pad)
diff --git a/gst/fsrtpconference/fs-rtp-special-source.c b/gst/fsrtpconference/fs-rtp-special-source.c
index 9968334..d012d66 100644
--- a/gst/fsrtpconference/fs-rtp-special-source.c
+++ b/gst/fsrtpconference/fs-rtp-special-source.c
@@ -83,7 +83,7 @@ register_classes (gpointer data)
my_classes = g_list_prepend (my_classes,
g_type_class_ref (FS_TYPE_RTP_DTMF_EVENT_SOURCE));
- return classes;
+ return my_classes;
}
static void
@@ -102,6 +102,8 @@ fs_rtp_special_source_class_init (FsRtpSpecialSourceClass *klass)
parent_class = fs_rtp_special_source_parent_class;
gobject_class->dispose = fs_rtp_special_source_dispose;
+
+ g_type_class_add_private (klass, sizeof (FsRtpSpecialSourcePrivate));
}
static void
@@ -160,6 +162,7 @@ fs_rtp_special_sources_add_blueprints (GList *blueprints)
item = g_list_next (item))
{
FsRtpSpecialSourceClass *klass = item->data;
+
blueprints = fs_rtp_special_source_class_add_blueprint (klass, blueprints);
}
--
1.5.6.5
More information about the farsight-commits
mailing list