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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
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 "pulsedeviceprovider.h"
31 
32 GST_DEBUG_CATEGORY (pulse_debug);
33 
34 static gboolean
plugin_init(GstPlugin * plugin)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   if (!gst_device_provider_register (plugin, "pulsedeviceprovider",
53           GST_RANK_PRIMARY, GST_TYPE_PULSE_DEVICE_PROVIDER))
54     return FALSE;
55 
56   GST_DEBUG_CATEGORY_INIT (pulse_debug, "pulse", 0, "PulseAudio elements");
57   return TRUE;
58 }
59 
60 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
61     GST_VERSION_MINOR,
62     pulseaudio,
63     "PulseAudio plugin library",
64     plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
65