Tizen 2.0 Release
[framework/multimedia/gst-plugins-bad0.10.git] / ext / openal / gstopenalsrc.h
1 /*\r
2  * GStreamer\r
3  * Copyright (C) 2005 Thomas Vander Stichele <thomas@apestaart.org>\r
4  * Copyright (C) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>\r
5  * Copyright (C) 2008 Victor Lin <bornstub@gmail.com>\r
6  *\r
7  * Permission is hereby granted, free of charge, to any person obtaining a\r
8  * copy of this software and associated documentation files (the "Software"),\r
9  * to deal in the Software without restriction, including without limitation\r
10  * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
11  * and/or sell copies of the Software, and to permit persons to whom the\r
12  * Software is furnished to do so, subject to the following conditions:\r
13  *\r
14  * The above copyright notice and this permission notice shall be included in\r
15  * all copies or substantial portions of the Software.\r
16  *\r
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
22  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
23  * DEALINGS IN THE SOFTWARE.\r
24  *\r
25  * Alternatively, the contents of this file may be used under the\r
26  * GNU Lesser General Public License Version 2.1 (the "LGPL"), in\r
27  * which case the following provisions apply instead of the ones\r
28  * mentioned above:\r
29  *\r
30  * This library is free software; you can redistribute it and/or\r
31  * modify it under the terms of the GNU Library General Public\r
32  * License as published by the Free Software Foundation; either\r
33  * version 2 of the License, or (at your option) any later version.\r
34  *\r
35  * This library is distributed in the hope that it will be useful,\r
36  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
37  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
38  * Library General Public License for more details.\r
39  *\r
40  * You should have received a copy of the GNU Library General Public\r
41  * License along with this library; if not, write to the\r
42  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,\r
43  * Boston, MA 02111-1307, USA.\r
44  */\r
45 \r
46 #ifndef __GST_OPENAL_SRC_H__\r
47 #define __GST_OPENAL_SRC_H__\r
48 \r
49 #include <gst/gst.h>\r
50 #include <gst/audio/gstaudiosrc.h>\r
51 \r
52 #ifdef _WIN32\r
53 #include <al.h>\r
54 #include <alc.h>\r
55 #include <alext.h>\r
56 #elif defined(__APPLE__)\r
57 #include <OpenAL/al.h>\r
58 #include <OpenAL/alc.h>\r
59 #include <OpenAL/alext.h>\r
60 #else\r
61 #include <AL/al.h>\r
62 #include <AL/alc.h>\r
63 #include <AL/alext.h>\r
64 #endif\r
65 \r
66 G_BEGIN_DECLS\r
67 \r
68 #define GST_TYPE_OPENAL_SRC \\r
69   (gst_openal_src_get_type())\r
70 #define GST_OPENAL_SRC(obj) \\r
71   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OPENAL_SRC,GstOpenalSrc))\r
72 #define GST_OPENAL_SRC_CLASS(klass) \\r
73   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OPENAL_SRC,GstOpenalSrcClass))\r
74 #define GST_IS_OPENAL_SRC(obj) \\r
75   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OPENAL_SRC))\r
76 #define GST_IS_OPENAL_SRC_CLASS(klass) \\r
77   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPENAL_SRC))\r
78 \r
79 typedef struct _GstOpenalSrc      GstOpenalSrc;\r
80 typedef struct _GstOpenalSrcClass GstOpenalSrcClass;\r
81 \r
82 struct _GstOpenalSrc {\r
83         GstAudioSrc element;\r
84         GstPad *srcpad;\r
85         gboolean silent;\r
86 \r
87         /* readable name of device */\r
88         gchar *deviceName;\r
89         /* name of device to open, default is a NULL pointer to get default device */\r
90         gchar *device;\r
91         /* OpenAL device handle */\r
92         ALCdevice *deviceHandle;\r
93 \r
94         guint bytes_per_sample;\r
95 };\r
96 \r
97 struct _GstOpenalSrcClass {\r
98         GstAudioSrcClass parent_class;\r
99 };\r
100 \r
101 GType gst_openal_src_get_type (void);\r
102 \r
103 G_END_DECLS\r
104 \r
105 #endif /* __GST_OPENAL_SRC_H__ */\r