Added gst-plugins-base-subtitles0.10-0.10.34 for Meego Harmattan 1.2
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / gst / playback / gstsubtitleoverlay.h
1 /* GStreamer
2  * Copyright (C) 2009 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 #ifndef __GST_SUBTITLE_OVERLAY_H__
21 #define __GST_SUBTITLE_OVERLAY_H__
22
23 #include <gst/gst.h>
24
25 G_BEGIN_DECLS
26 #define GST_TYPE_SUBTITLE_OVERLAY \
27   (gst_subtitle_overlay_get_type())
28 #define GST_SUBTITLE_OVERLAY(obj) \
29   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SUBTITLE_OVERLAY, GstSubtitleOverlay))
30 #define GST_SUBTITLE_OVERLAY_CAST(obj) \
31   ((GstSubtitleOverlay *) obj)
32 #define GST_SUBTITLE_OVERLAY_CLASS(klass) \
33   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SUBTITLE_OVERLAY, GstSubtitleOverlayClass))
34 #define GST_IS_SUBTITLE_OVERLAY(obj) \
35   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SUBTITLE_OVERLAY))
36 #define GST_IS_SUBTITLE_OVERLAY_CLASS(klass) \
37   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SUBTITLE_OVERLAY))
38
39 #define GST_SUBTITLE_OVERLAY_LOCK(obj) G_STMT_START {                   \
40     GST_LOG_OBJECT (obj,                                                \
41                     "locking from thread %p",                           \
42                     g_thread_self ());                                  \
43     g_mutex_lock (GST_SUBTITLE_OVERLAY_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_SUBTITLE_OVERLAY_UNLOCK(obj) G_STMT_START {                 \
50     GST_LOG_OBJECT (obj,                                                \
51                     "unlocking from thread %p",                         \
52                     g_thread_self ());                                  \
53     g_mutex_unlock (GST_SUBTITLE_OVERLAY_CAST(obj)->lock);              \
54 } G_STMT_END
55
56 typedef struct _GstSubtitleOverlay GstSubtitleOverlay;
57 typedef struct _GstSubtitleOverlayClass GstSubtitleOverlayClass;
58
59 struct _GstSubtitleOverlay
60 {
61   GstBin parent;
62
63   gboolean silent;
64   gchar *font_desc;
65   gchar *encoding;
66
67   /* < private > */
68   gboolean do_async;
69
70   GstPad *srcpad;
71   GstPadEventFunction src_proxy_event;
72   GstPadChainFunction src_proxy_chain;
73   gboolean downstream_chain_error;
74
75   GstPad *video_sinkpad;
76   GstPad *video_block_pad;
77   GstPadSetCapsFunction video_sink_setcaps;
78   GstPadEventFunction video_sink_event;
79   GstPadChainFunction video_sink_chain;
80   gboolean video_sink_blocked;
81   GstSegment video_segment;
82   gint fps_n, fps_d;
83
84   GstPad *subtitle_sinkpad;
85   GstPad *subtitle_block_pad;
86   GstPadLinkFunction subtitle_sink_link;
87   GstPadUnlinkFunction subtitle_sink_unlink;
88   GstPadEventFunction subtitle_sink_event;
89   GstPadChainFunction subtitle_sink_chain;
90   GstPadSetCapsFunction subtitle_sink_setcaps;
91   gboolean subtitle_sink_blocked;
92   GstSegment subtitle_segment;
93   gboolean subtitle_flush;
94   gboolean subtitle_error;
95
96   GMutex *factories_lock;
97   GList *factories;
98   guint32 factories_cookie;
99   GstCaps *factory_caps;
100
101   GMutex *lock;
102   GstCaps *subcaps;
103
104   GstElement *passthrough_identity;
105
106   GstElement *pre_colorspace;
107   GstElement *post_colorspace;
108
109   GstElement *parser;
110   GstElement *overlay;
111
112   GstElement *renderer;
113
114   const gchar *silent_property;
115   gboolean silent_property_invert;
116 };
117
118 struct _GstSubtitleOverlayClass
119 {
120   GstBinClass parent;
121 };
122
123 GType gst_subtitle_overlay_get_type (void);
124 gboolean gst_subtitle_overlay_plugin_init (GstPlugin * plugin);
125
126 GstCaps *gst_subtitle_overlay_create_factory_caps (void);
127
128 G_END_DECLS
129 #endif /* __GST_SUBTITLE_OVERLAY_H__ */