Tizen 2.0 Release
[framework/multimedia/gst-plugins-good0.10.git] / ext / pulse / plugin.c
1 /*
2  *  GStreamer pulseaudio plugin
3  *
4  *  Copyright (c) 2004-2008 Lennart Poettering
5  *
6  *  gst-pulse is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU Lesser General Public License as
8  *  published by the Free Software Foundation; either version 2.1 of the
9  *  License, or (at your option) any later version.
10  *
11  *  gst-pulse is distributed in the hope that it will be useful, but
12  *  WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  *  Lesser General Public License for more details.
15  *
16  *  You should have received a copy of the GNU Lesser General Public
17  *  License along with gst-pulse; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  *  USA.
20  */
21
22 #ifdef HAVE_CONFIG_H
23 #include "config.h"
24 #endif
25
26 #include <gst/gst-i18n-plugin.h>
27
28 #include "pulsesink.h"
29 #include "pulsesrc.h"
30 #include "pulsemixer.h"
31
32 GST_DEBUG_CATEGORY (pulse_debug);
33
34 static gboolean
35 plugin_init (GstPlugin * plugin)
36 {
37 #ifdef ENABLE_NLS
38   GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
39       LOCALEDIR);
40   bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
41   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
42 #endif
43
44   if (!gst_element_register (plugin, "pulsesink", GST_RANK_PRIMARY + 10,
45           GST_TYPE_PULSESINK))
46     return FALSE;
47
48   if (!gst_element_register (plugin, "pulsesrc", GST_RANK_PRIMARY + 10,
49           GST_TYPE_PULSESRC))
50     return FALSE;
51
52 #ifdef HAVE_PULSE_1_0
53   if (!gst_element_register (plugin, "pulseaudiosink", GST_RANK_MARGINAL - 1,
54           GST_TYPE_PULSE_AUDIO_SINK))
55     return FALSE;
56 #endif
57
58   if (!gst_element_register (plugin, "pulsemixer", GST_RANK_NONE,
59           GST_TYPE_PULSEMIXER))
60     return FALSE;
61
62   GST_DEBUG_CATEGORY_INIT (pulse_debug, "pulse", 0, "PulseAudio elements");
63   return TRUE;
64 }
65
66 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
67     GST_VERSION_MINOR,
68     "pulseaudio",
69     "PulseAudio plugin library",
70     plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)