Merge branch 'master' into 0.11
[platform/upstream/gst-plugins-base.git] / gst / playback / gstplaysinkaudioconvert.h
1 /* GStreamer
2  * Copyright (C) <2011> Sebastian Dröge <sebastian.droege@collabora.co.uk>
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 #include <gst/gst.h>
21
22 #ifndef __GST_PLAY_SINK_AUDIO_CONVERT_H__
23 #define __GST_PLAY_SINK_AUDIO_CONVERT_H__
24
25 G_BEGIN_DECLS
26 #define GST_TYPE_PLAY_SINK_AUDIO_CONVERT \
27   (gst_play_sink_audio_convert_get_type())
28 #define GST_PLAY_SINK_AUDIO_CONVERT(obj) \
29   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAY_SINK_AUDIO_CONVERT, GstPlaySinkAudioConvert))
30 #define GST_PLAY_SINK_AUDIO_CONVERT_CAST(obj) \
31   ((GstPlaySinkAudioConvert *) obj)
32 #define GST_PLAY_SINK_AUDIO_CONVERT_CLASS(klass) \
33   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLAY_SINK_AUDIO_CONVERT, GstPlaySinkAudioConvertClass))
34 #define GST_IS_PLAY_SINK_AUDIO_CONVERT(obj) \
35   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLAY_SINK_AUDIO_CONVERT))
36 #define GST_IS_PLAY_SINK_AUDIO_CONVERT_CLASS(klass) \
37   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLAY_SINK_AUDIO_CONVERT))
38
39 #define GST_PLAY_SINK_AUDIO_CONVERT_LOCK(obj) G_STMT_START {                   \
40     GST_LOG_OBJECT (obj,                                                \
41                     "locking from thread %p",                           \
42                     g_thread_self ());                                  \
43     g_mutex_lock (GST_PLAY_SINK_AUDIO_CONVERT_CAST(obj)->lock);                \
44     GST_LOG_OBJECT (obj,                                                \
45                     "locked from thread %p",                            \
46                     g_thread_self ());                                  \
47 } G_STMT_END
48
49 #define GST_PLAY_SINK_AUDIO_CONVERT_UNLOCK(obj) G_STMT_START {                 \
50     GST_LOG_OBJECT (obj,                                                \
51                     "unlocking from thread %p",                         \
52                     g_thread_self ());                                  \
53     g_mutex_unlock (GST_PLAY_SINK_AUDIO_CONVERT_CAST(obj)->lock);              \
54 } G_STMT_END
55
56 typedef struct _GstPlaySinkAudioConvert GstPlaySinkAudioConvert;
57 typedef struct _GstPlaySinkAudioConvertClass GstPlaySinkAudioConvertClass;
58
59 struct _GstPlaySinkAudioConvert
60 {
61   GstBin parent;
62
63   /* < private > */
64   GMutex *lock;
65
66   GstPad *sinkpad, *sink_proxypad;
67   gulong sink_proxypad_block_id;
68   GstSegment segment;
69
70   GstPad *srcpad;
71
72   gboolean raw;
73   GstElement *conv, *resample;
74
75   /* < pseudo public > */
76   GstElement *volume;
77   gboolean use_volume;
78   gboolean use_converters;
79 };
80
81 struct _GstPlaySinkAudioConvertClass
82 {
83   GstBinClass parent;
84 };
85
86 GType gst_play_sink_audio_convert_get_type (void);
87
88 G_END_DECLS
89 #endif /* __GST_PLAY_SINK_AUDIO_CONVERT_H__ */