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., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23
24 #include "gstjack.h"
25
26 GType
gst_jack_connect_get_type(void)27 gst_jack_connect_get_type (void)
28 {
29 static gsize jack_connect_type = 0;
30
31 if (g_once_init_enter (&jack_connect_type)) {
32 static const GEnumValue jack_connect_enums[] = {
33 {GST_JACK_CONNECT_NONE,
34 "Don't automatically connect ports to physical ports", "none"},
35 {GST_JACK_CONNECT_AUTO,
36 "Automatically connect ports to physical ports", "auto"},
37 {GST_JACK_CONNECT_AUTO_FORCED,
38 "Automatically connect ports to as many physical ports as possible",
39 "auto-forced"},
40 {GST_JACK_CONNECT_EXPLICIT,
41 "Connect ports to explicitly requested physical ports",
42 "explicit"},
43 {0, NULL, NULL},
44 };
45 GType tmp = g_enum_register_static ("GstJackConnect", jack_connect_enums);
46 g_once_init_leave (&jack_connect_type, tmp);
47 }
48 return (GType) jack_connect_type;
49 }
50
51 GType
gst_jack_transport_get_type(void)52 gst_jack_transport_get_type (void)
53 {
54 static gsize type = 0;
55
56 if (g_once_init_enter (&type)) {
57 static const GFlagsValue flag_values[] = {
58 {GST_JACK_TRANSPORT_MASTER,
59 "Start and stop transport with state changes", "master"},
60 {GST_JACK_TRANSPORT_SLAVE,
61 "Follow transport state changes", "slave"},
62 {0, NULL, NULL},
63 };
64 GType tmp = g_flags_register_static ("GstJackTransport", flag_values);
65 g_once_init_leave (&type, tmp);
66 }
67 return (GType) type;
68 }
69
70
71 static gpointer
gst_jack_client_copy(gpointer jclient)72 gst_jack_client_copy (gpointer jclient)
73 {
74 return jclient;
75 }
76
77
78 static void
gst_jack_client_free(gpointer jclient)79 gst_jack_client_free (gpointer jclient)
80 {
81 return;
82 }
83
84
85 GType
gst_jack_client_get_type(void)86 gst_jack_client_get_type (void)
87 {
88 static gsize jack_client_type = 0;
89
90 if (g_once_init_enter (&jack_client_type)) {
91 /* hackish, but makes it show up nicely in gst-inspect */
92 GType tmp = g_boxed_type_register_static ("JackClient",
93 (GBoxedCopyFunc) gst_jack_client_copy,
94 (GBoxedFreeFunc) gst_jack_client_free);
95 g_once_init_leave (&jack_client_type, tmp);
96 }
97
98 return (GType) jack_client_type;
99 }
100
101 static gboolean
plugin_init(GstPlugin * plugin)102 plugin_init (GstPlugin * plugin)
103 {
104 gboolean ret = FALSE;
105
106 ret |= GST_ELEMENT_REGISTER (jackaudiosrc, plugin);
107 ret |= GST_ELEMENT_REGISTER (jackaudiosink, plugin);
108
109 return ret;
110 }
111
112 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
113 GST_VERSION_MINOR,
114 jack,
115 "JACK audio elements",
116 plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
117