Initialize Tizen 2.3
[framework/multimedia/gst-plugins-ext0.10.git] / wearable / avsystem / src / gstavsysaudiosrc.h
1 /*
2  * avsystem
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>
7  *
8  * This library is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License as published by the
10  * Free Software Foundation; either version 2.1 of the License, or (at your option)
11  * any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
14  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; if not, write to the Free Software Foundation, Inc., 51
20  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23
24 #ifndef __GST_AVSYS_AUDIO_SRC_H__
25 #define __GST_AVSYS_AUDIO_SRC_H__
26
27 //#undef  _MMCAMCORDER_MERGE_TEMP 
28
29 #include <gst/audio/gstaudiosrc.h>
30 #include <glib.h>
31
32 #include <avsys-audio.h>
33
34 G_BEGIN_DECLS
35
36 #define GST_TYPE_AVSYS_AUDIO_SRC            (gst_avsysaudiosrc_get_type())
37 #define GST_AVSYS_AUDIO_SRC(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AVSYS_AUDIO_SRC,GstAvsysAudioSrc))
38 #define GST_AVSYS_AUDIO_SRC_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AVSYS_AUDIO_SRC,GstAvsysAudioSrcClass))
39 #define GST_IS_AVSYS_AUDIO_SRC(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AVSYS_AUDIO_SRC))
40 #define GST_IS_AVSYS_AUDIO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AVSYS_AUDIO_SRC))
41 #define GST_AVSYS_AUDIO_SRC_CAST(obj)       ((GstAvsysAudioSrc *)(obj))
42
43 #define GST_AVSYS_AUDIO_SRC_GET_LOCK(obj)  (GST_AVSYS_AUDIO_SRC_CAST (obj)->avsysaudio_lock)
44 #define GST_AVSYS_AUDIO_SRC_LOCK(obj)      (g_mutex_lock (GST_AVSYS_AUDIO_SRC_GET_LOCK (obj)))
45 #define GST_AVSYS_AUDIO_SRC_UNLOCK(obj)    (g_mutex_unlock (GST_AVSYS_AUDIO_SRC_GET_LOCK (obj)))
46
47 typedef struct _GstAvsysAudioSrc GstAvsysAudioSrc;
48 typedef struct _GstAvsysAudioSrcClass GstAvsysAudioSrcClass;
49
50 typedef enum {
51         AVSYSAUDIOSRC_LATENCY_LOW = 0,
52         AVSYSAUDIOSRC_LATENCY_MID,
53         AVSYSAUDIOSRC_LATENCY_HIGH,
54 }GstAvsysAudioSrcAudioLatency;
55
56 #define GST_AVSYS_AUDIO_SRC_LATENCY     (gst_avsysaudiosrc_audio_latency_get_type())
57
58
59
60 /**
61  * GstAvsysAudioSrc:
62  *
63  * Opaque data structure
64  */
65 struct _GstAvsysAudioSrc {
66         GstAudioSrc                                     src;
67
68         avsys_handle_t                          audio_handle;
69         avsys_audio_param_t             audio_param;
70
71         gint                                            buffer_size;
72         GstCaps                                         *cached_caps;
73         GMutex                                          *avsysaudio_lock;
74
75         gint                                            media_call;
76         gint                                            bytes_per_sample;
77         gint                                            latency;
78
79 };
80
81 struct _GstAvsysAudioSrcClass {
82         GstAudioSrcClass parent_class;
83 };
84
85
86 GType gst_avsysaudiosrc_get_type (void);
87 GType gst_avsysaudiosrc_audio_latency_get_type(void);
88
89 G_END_DECLS
90
91 #endif /* __GST_AVSYS_AUDIO_SRC_H__ */