[MOVED FROM BAD 123/134] vp8: Use pkg-config file for getting the LIBS and CFLAGS
[platform/upstream/gstreamer.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 GType
50 gst_jack_transport_get_type (void)
51 {
52   static volatile gsize type = 0;
53
54   if (g_once_init_enter (&type)) {
55     static const GFlagsValue flag_values[] = {
56       {GST_JACK_TRANSPORT_MASTER,
57           "Start and stop transport with state changes", "master"},
58       {GST_JACK_TRANSPORT_SLAVE,
59           "Follow transport state changes", "slave"},
60       {0, NULL, NULL},
61     };
62     GType tmp = g_flags_register_static ("GstJackTransport", flag_values);
63     g_once_init_leave (&type, tmp);
64   }
65   return (GType) type;
66 }
67
68
69 static gpointer
70 gst_jack_client_copy (gpointer jclient)
71 {
72   return jclient;
73 }
74
75
76 static void
77 gst_jack_client_free (gpointer jclient)
78 {
79   return;
80 }
81
82
83 GType
84 gst_jack_client_get_type (void)
85 {
86   static volatile gsize jack_client_type = 0;
87
88   if (g_once_init_enter (&jack_client_type)) {
89     /* hackish, but makes it show up nicely in gst-inspect */
90     GType tmp = g_boxed_type_register_static ("JackClient",
91         (GBoxedCopyFunc) gst_jack_client_copy,
92         (GBoxedFreeFunc) gst_jack_client_free);
93     g_once_init_leave (&jack_client_type, tmp);
94   }
95
96   return (GType) jack_client_type;
97 }
98
99 static gboolean
100 plugin_init (GstPlugin * plugin)
101 {
102   if (!gst_element_register (plugin, "jackaudiosrc", GST_RANK_PRIMARY,
103           GST_TYPE_JACK_AUDIO_SRC))
104     return FALSE;
105   if (!gst_element_register (plugin, "jackaudiosink", GST_RANK_PRIMARY,
106           GST_TYPE_JACK_AUDIO_SINK))
107     return FALSE;
108
109   return TRUE;
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)