aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-audio-src.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-02-03 17:02:55 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-02-03 17:02:55 +0800
commitcc5ffe66ab42ecb2fe0255b6ba0baee25624917f (patch)
tree8ef5d2f259e77850f619aa63027f46e17c3c699d /libempathy-gtk/empathy-audio-src.c
parenta7630dc453ae60fde8191beca2003b5427743b7d (diff)
downloadgsoc2013-empathy-cc5ffe66ab42ecb2fe0255b6ba0baee25624917f.tar
gsoc2013-empathy-cc5ffe66ab42ecb2fe0255b6ba0baee25624917f.tar.gz
gsoc2013-empathy-cc5ffe66ab42ecb2fe0255b6ba0baee25624917f.tar.bz2
gsoc2013-empathy-cc5ffe66ab42ecb2fe0255b6ba0baee25624917f.tar.lz
gsoc2013-empathy-cc5ffe66ab42ecb2fe0255b6ba0baee25624917f.tar.xz
gsoc2013-empathy-cc5ffe66ab42ecb2fe0255b6ba0baee25624917f.tar.zst
gsoc2013-empathy-cc5ffe66ab42ecb2fe0255b6ba0baee25624917f.zip
Add audio/video sink and source abstractions
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> svn path=/trunk/; revision=2384
Diffstat (limited to 'libempathy-gtk/empathy-audio-src.c')
-rw-r--r--libempathy-gtk/empathy-audio-src.c125
1 files changed, 125 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-audio-src.c b/libempathy-gtk/empathy-audio-src.c
new file mode 100644
index 000000000..c7437e93e
--- /dev/null
+++ b/libempathy-gtk/empathy-audio-src.c
@@ -0,0 +1,125 @@
+/*
+ * empathy-gst-audio-src.c - Source for EmpathyGstAudioSrc
+ * Copyright (C) 2008 Collabora Ltd.
+ * @author Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "empathy-audio-src.h"
+
+G_DEFINE_TYPE(EmpathyGstAudioSrc, empathy_audio_src, GST_TYPE_BIN)
+
+/* signal enum */
+#if 0
+enum
+{
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = {0};
+#endif
+
+/* private structure */
+typedef struct _EmpathyGstAudioSrcPrivate EmpathyGstAudioSrcPrivate;
+
+struct _EmpathyGstAudioSrcPrivate
+{
+ gboolean dispose_has_run;
+ GstElement *src;
+};
+
+#define EMPATHY_GST_AUDIO_SRC_GET_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMPATHY_TYPE_GST_AUDIO_SRC, \
+ EmpathyGstAudioSrcPrivate))
+
+static void
+empathy_audio_src_init (EmpathyGstAudioSrc *obj)
+{
+ EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (obj);
+ //GstElement *resample;
+ GstPad *ghost, *src;
+
+ /* allocate any data required by the object here */
+ //resample = gst_element_factory_make ("audioresample", NULL);
+
+ priv->src = gst_element_factory_make ("gconfaudiosrc", NULL);
+
+ //gst_bin_add_many (GST_BIN (obj), priv->src, resample, NULL);
+ gst_bin_add_many (GST_BIN (obj), priv->src, NULL);
+ //gst_element_link_many (priv->src, resample, NULL);
+
+ //src = gst_element_get_static_pad (resample, "src");
+ src = gst_element_get_static_pad (priv->src, "src");
+
+ ghost = gst_ghost_pad_new ("src", src);
+ gst_element_add_pad (GST_ELEMENT (obj), ghost);
+
+ gst_object_unref (G_OBJECT (src));
+}
+
+static void empathy_audio_src_dispose (GObject *object);
+static void empathy_audio_src_finalize (GObject *object);
+
+static void
+empathy_audio_src_class_init (EmpathyGstAudioSrcClass
+ *empathy_audio_src_class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (empathy_audio_src_class);
+
+ g_type_class_add_private (empathy_audio_src_class,
+ sizeof (EmpathyGstAudioSrcPrivate));
+
+ object_class->dispose = empathy_audio_src_dispose;
+ object_class->finalize = empathy_audio_src_finalize;
+}
+
+void
+empathy_audio_src_dispose (GObject *object)
+{
+ EmpathyGstAudioSrc *self = EMPATHY_GST_AUDIO_SRC (object);
+ EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self);
+
+ if (priv->dispose_has_run)
+ return;
+
+ priv->dispose_has_run = TRUE;
+
+ /* release any references held by the object here */
+
+ if (G_OBJECT_CLASS (empathy_audio_src_parent_class)->dispose)
+ G_OBJECT_CLASS (empathy_audio_src_parent_class)->dispose (object);
+}
+
+void
+empathy_audio_src_finalize (GObject *object)
+{
+ //EmpathyGstAudioSrc *self = EMPATHY_GST_AUDIO_SRC (object);
+ //EmpathyGstAudioSrcPrivate *priv = EMPATHY_GST_AUDIO_SRC_GET_PRIVATE (self);
+
+ /* free any data held directly by the object here */
+
+ G_OBJECT_CLASS (empathy_audio_src_parent_class)->finalize (object);
+}
+
+GstElement *
+empathy_audio_src_new (void)
+{
+ return GST_ELEMENT (g_object_new (EMPATHY_TYPE_GST_AUDIO_SRC, NULL));
+}