Tizen 2.0 Release
[framework/multimedia/gst-plugins-bad0.10.git] / ext / sdl / sdlaudiosink.h
1 /* GStreamer
2  * Copyright (C) <2005> Edgard Lima <edgard.lima@indt.org.br>
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 
13  */
14
15 #ifndef __GST_SDLAUDIOSINK_H__
16 #define __GST_SDLAUDIOSINK_H__
17
18
19 #include <gst/gst.h>
20 #include <gst/audio/gstaudiosink.h>
21
22 #include <SDL.h>
23 #include <SDL_audio.h>
24
25 G_BEGIN_DECLS
26
27 #define GST_TYPE_SDLAUDIOSINK            (gst_sdlaudio_sink_get_type())
28 #define GST_SDLAUDIOSINK(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SDLAUDIOSINK,GstSDLAudioSink))
29 #define GST_SDLAUDIOSINK_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SDLAUDIOSINK,GstSDLAudioSinkClass))
30 #define GST_IS_SDLAUDIOSINK(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SDLAUDIOSINK))
31 #define GST_IS_SDLAUDIOSINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SDLAUDIOSINK))
32
33 typedef struct _GstSDLAudioSink GstSDLAudioSink;
34 typedef struct _GstSDLAudioSinkClass GstSDLAudioSinkClass;
35
36 typedef struct _gstsdl_semaphore {
37   GCond *cond;
38   GMutex *mutex;
39   gboolean mutexflag;
40
41 } gstsdl_semaphore;
42
43 struct _GstSDLAudioSink {
44   GstAudioSink    sink;
45
46   SDL_AudioSpec fmt;
47   guint8 *buffer;
48
49   gstsdl_semaphore semA;
50
51   gstsdl_semaphore semB;
52
53   gboolean eos;
54
55 };
56
57 struct _GstSDLAudioSinkClass {
58   GstAudioSinkClass parent_class;
59 };
60
61 GType gst_sdlaudio_sink_get_type(void);
62
63 G_END_DECLS
64
65 #endif /* __GST_SDLAUDIOSINK_H__ */