Tizen 2.0 Release
[framework/multimedia/gst-plugins-good0.10.git] / ext / jack / gstjack.c
1 /* GStreamer Jack plugins
2  * Copyright (C) 2006 Wim Taymans <wim@fluendo.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23
24 #include "gstjackaudiosrc.h"
25 #include "gstjackaudiosink.h"
26
27 GType
28 gst_jack_connect_get_type (void)
29 {
30   static volatile gsize jack_connect_type = 0;
31
32   if (g_once_init_enter (&jack_connect_type)) {
33     static const GEnumValue jack_connect_enums[] = {
34       {GST_JACK_CONNECT_NONE,
35           "Don't automatically connect ports to physical ports", "none"},
36       {GST_JACK_CONNECT_AUTO,
37           "Automatically connect ports to physical ports", "auto"},
38       {GST_JACK_CONNECT_AUTO_FORCED,
39             "Automatically connect ports to as many physical ports as possible",
40           "auto-forced"},
41       {0, NULL, NULL},
42     };
43     GType tmp = g_enum_register_static ("GstJackConnect", jack_connect_enums);
44     g_once_init_leave (&jack_connect_type, tmp);
45   }
46   return (GType) jack_connect_type;
47 }
48
49
50 static gpointer
51 gst_jack_client_copy (gpointer jclient)
52 {
53   return jclient;
54 }
55
56
57 static void
58 gst_jack_client_free (gpointer jclient)
59 {
60   return;
61 }
62
63
64 GType
65 gst_jack_client_get_type (void)
66 {
67   static volatile gsize jack_client_type = 0;
68
69   if (g_once_init_enter (&jack_client_type)) {
70     /* hackish, but makes it show up nicely in gst-inspect */
71     GType tmp = g_boxed_type_register_static ("JackClient",
72         (GBoxedCopyFunc) gst_jack_client_copy,
73         (GBoxedFreeFunc) gst_jack_client_free);
74     g_once_init_leave (&jack_client_type, tmp);
75   }
76
77   return (GType) jack_client_type;
78 }
79
80 static gboolean
81 plugin_init (GstPlugin * plugin)
82 {
83   if (!gst_element_register (plugin, "jackaudiosrc", GST_RANK_PRIMARY,
84           GST_TYPE_JACK_AUDIO_SRC))
85     return FALSE;
86   if (!gst_element_register (plugin, "jackaudiosink", GST_RANK_PRIMARY,
87           GST_TYPE_JACK_AUDIO_SINK))
88     return FALSE;
89
90   return TRUE;
91 }
92
93 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
94     GST_VERSION_MINOR,
95     "jack",
96     "JACK audio elements",
97     plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)