1 /* GStreamer
2  * Copyright (C) 2015 Centricular Ltd.
3  * Author: Arun Raghavan <arun@centricular.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef __OPENSLESCOMMON_H__
22 #define __OPENSLESCOMMON_H__
23 
24 #include <gst/gst.h>
25 
26 #include <SLES/OpenSLES.h>
27 #include <SLES/OpenSLES_Android.h>
28 /* This is needed explicitly for API level < 14 */
29 #include <SLES/OpenSLES_AndroidConfiguration.h>
30 
31 G_BEGIN_DECLS
32 
33 typedef enum {
34   GST_OPENSLES_RECORDING_PRESET_NONE,
35   GST_OPENSLES_RECORDING_PRESET_GENERIC,
36   GST_OPENSLES_RECORDING_PRESET_CAMCORDER,
37   GST_OPENSLES_RECORDING_PRESET_VOICE_RECOGNITION,
38   GST_OPENSLES_RECORDING_PRESET_VOICE_COMMUNICATION,
39 } GstOpenSLESRecordingPreset;
40 
41 #define GST_TYPE_OPENSLES_RECORDING_PRESET \
42   (gst_opensles_recording_preset_get_type())
43 
44 GType gst_opensles_recording_preset_get_type (void);
45 
46 SLint32 gst_to_opensles_recording_preset (GstOpenSLESRecordingPreset preset);
47 
48 typedef enum {
49   GST_OPENSLES_STREAM_TYPE_VOICE,
50   GST_OPENSLES_STREAM_TYPE_SYSTEM,
51   GST_OPENSLES_STREAM_TYPE_RING,
52   GST_OPENSLES_STREAM_TYPE_MEDIA,
53   GST_OPENSLES_STREAM_TYPE_ALARM,
54   GST_OPENSLES_STREAM_TYPE_NOTIFICATION,
55   GST_OPENSLES_STREAM_TYPE_NONE = -1, /* If we don't want to set a type */
56 } GstOpenSLESStreamType;
57 
58 #define GST_TYPE_OPENSLES_STREAM_TYPE \
59   (gst_opensles_stream_type_get_type())
60 
61 GType gst_opensles_stream_type_get_type (void);
62 
63 SLint32 gst_to_opensles_stream_type (GstOpenSLESStreamType stream_type);
64 
65 G_END_DECLS
66 
67 #endif /* __OPENSLESCOMMON_H__ */
68