[empathy] Correctly register the src/sink elements
- From: Olivier Crête <Tester src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [empathy] Correctly register the src/sink elements
- Date: Thu, 6 Aug 2009 17:25:19 +0000 (UTC)
commit b1508d71bf814939e9b9818377b4fef95c6470b2
Author: Olivier Crête <olivier crete collabora co uk>
Date: Fri Jul 31 20:10:09 2009 -0400
Correctly register the src/sink elements
libempathy-gtk/empathy-audio-sink.c | 10 +++++++++-
libempathy-gtk/empathy-audio-src.c | 12 +++++++++++-
2 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/libempathy-gtk/empathy-audio-sink.c b/libempathy-gtk/empathy-audio-sink.c
index 55f64e8..1d21695 100644
--- a/libempathy-gtk/empathy-audio-sink.c
+++ b/libempathy-gtk/empathy-audio-sink.c
@@ -204,7 +204,15 @@ empathy_audio_sink_finalize (GObject *object)
GstElement *
empathy_audio_sink_new (void)
{
- return GST_ELEMENT (g_object_new (EMPATHY_TYPE_GST_AUDIO_SINK, NULL));
+ static gboolean registered = FALSE;
+
+ if (!registered) {
+ if (!gst_element_register (NULL, "empathyaudiosink",
+ GST_RANK_NONE, EMPATHY_TYPE_GST_AUDIO_SINK))
+ return NULL;
+ registered = TRUE;
+ }
+ return gst_element_factory_make ("empathyaudiosink", NULL);
}
void
diff --git a/libempathy-gtk/empathy-audio-src.c b/libempathy-gtk/empathy-audio-src.c
index 0497439..a3416f2 100644
--- a/libempathy-gtk/empathy-audio-src.c
+++ b/libempathy-gtk/empathy-audio-src.c
@@ -343,7 +343,15 @@ out:
GstElement *
empathy_audio_src_new (void)
{
- return GST_ELEMENT (g_object_new (EMPATHY_TYPE_GST_AUDIO_SRC, NULL));
+ static gboolean registered = FALSE;
+
+ if (!registered) {
+ if (!gst_element_register (NULL, "empathyaudiosrc",
+ GST_RANK_NONE, EMPATHY_TYPE_GST_AUDIO_SRC))
+ return NULL;
+ registered = TRUE;
+ }
+ return gst_element_factory_make ("empathyaudiosrc", NULL);
}
void
@@ -375,3 +383,5 @@ empathy_audio_src_get_volume (EmpathyGstAudioSrc *src)
return volume;
}
+
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]