tizen 2.3 release
[framework/multimedia/gst-plugins-base0.10.git] / gst / playback / gstplaysinkconvertbin.h
1 /* GStreamer
2  * Copyright (C) <2011> Sebastian Dröge <sebastian.droege@collabora.co.uk>
3  * Copyright (C) <2011> Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
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., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #include <gst/gst.h>
22
23 #ifndef __GST_PLAY_SINK_CONVERT_BIN_H__
24 #define __GST_PLAY_SINK_CONVERT_BIN_H__
25
26 G_BEGIN_DECLS
27 #define GST_TYPE_PLAY_SINK_CONVERT_BIN \
28   (gst_play_sink_convert_bin_get_type())
29 #define GST_PLAY_SINK_CONVERT_BIN(obj) \
30   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAY_SINK_CONVERT_BIN, GstPlaySinkConvertBin))
31 #define GST_PLAY_SINK_CONVERT_BIN_CAST(obj) \
32   ((GstPlaySinkConvertBin *) obj)
33 #define GST_PLAY_SINK_CONVERT_BIN_CLASS(klass) \
34   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLAY_SINK_CONVERT_BIN, GstPlaySinkConvertBinClass))
35 #define GST_IS_PLAY_SINK_CONVERT_BIN(obj) \
36   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLAY_SINK_CONVERT_BIN))
37 #define GST_IS_PLAY_SINK_CONVERT_BIN_CLASS(klass) \
38   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLAY_SINK_CONVERT_BIN))
39
40 #define GST_PLAY_SINK_CONVERT_BIN_LOCK(obj) G_STMT_START {                   \
41     GST_LOG_OBJECT (obj,                                                \
42                     "locking from thread %p",                           \
43                     g_thread_self ());                                  \
44     g_mutex_lock (GST_PLAY_SINK_CONVERT_BIN_CAST(obj)->lock);                \
45     GST_LOG_OBJECT (obj,                                                \
46                     "locked from thread %p",                            \
47                     g_thread_self ());                                  \
48 } G_STMT_END
49
50 #define GST_PLAY_SINK_CONVERT_BIN_UNLOCK(obj) G_STMT_START {                 \
51     GST_LOG_OBJECT (obj,                                                \
52                     "unlocking from thread %p",                         \
53                     g_thread_self ());                                  \
54     g_mutex_unlock (GST_PLAY_SINK_CONVERT_BIN_CAST(obj)->lock);              \
55 } G_STMT_END
56
57 typedef struct _GstPlaySinkConvertBin GstPlaySinkConvertBin;
58 typedef struct _GstPlaySinkConvertBinClass GstPlaySinkConvertBinClass;
59
60 struct _GstPlaySinkConvertBin
61 {
62   GstBin parent;
63
64   /* < private > */
65   GMutex *lock;
66
67   GstPad *sinkpad, *sink_proxypad;
68   gboolean sink_proxypad_blocked;
69   GstSegment segment;
70
71   GstPad *srcpad;
72
73   gboolean raw;
74   GList *conversion_elements;
75   GstElement *identity;
76
77   GstCaps *converter_caps;
78
79   /* configuration for derived classes */
80   gboolean audio;
81 };
82
83 struct _GstPlaySinkConvertBinClass
84 {
85   GstBinClass parent;
86 };
87
88 GType gst_play_sink_convert_bin_get_type (void);
89 GstElement *
90 gst_play_sink_convert_bin_add_conversion_element_factory (GstPlaySinkConvertBin *self,
91     const char *factory, const char *name);
92 void
93 gst_play_sink_convert_bin_add_conversion_element (GstPlaySinkConvertBin *self,
94     GstElement *el);
95 void
96 gst_play_sink_convert_bin_cache_converter_caps (GstPlaySinkConvertBin * self);
97 void
98 gst_play_sink_convert_bin_remove_elements (GstPlaySinkConvertBin * self);
99 void
100 gst_play_sink_convert_bin_add_identity (GstPlaySinkConvertBin * self);
101
102 G_END_DECLS
103 #endif /* __GST_PLAY_SINK_CONVERT_BIN_H__ */