Merging gst-plugins-ugly
[platform/upstream/gstreamer.git] / gst / dvdsub / gstdvdsubdec.h
1 /* GStreamer
2  * Copyright (C) <2005> Jan Schmidt <jan@fluendo.com>
3  * Copyright (C) <2002> Wim Taymans <wim@fluendo.com>
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., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 #ifndef __GST_DVDSUBDEC_H__
21 #define __GST_DVDSUBDEC_H__
22
23 #include <gst/gst.h>
24 #include <gst/video/video.h>
25
26 G_BEGIN_DECLS
27
28 #define GST_TYPE_DVD_SUB_DEC             (gst_dvd_sub_dec_get_type())
29 #define GST_DVD_SUB_DEC(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DVD_SUB_DEC,GstDvdSubDec))
30 #define GST_DVD_SUB_DEC_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DVD_SUB_DEC,GstDvdSubDecClass))
31 #define GST_IS_DVD_SUB_DEC(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DVD_SUB_DEC))
32 #define GST_IS_DVD_SUB_DEC_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DVD_SUB_DEC))
33
34 typedef struct _GstDvdSubDec GstDvdSubDec;
35 typedef struct _GstDvdSubDecClass GstDvdSubDecClass;
36
37 /* Hold premultimplied colour values */
38 typedef struct Color_val
39 {
40   guchar Y_R;
41   guchar U_G;
42   guchar V_B;
43   guchar A;
44
45 } Color_val;
46
47 struct _GstDvdSubDec
48 {
49   GstElement element;
50
51   GstPad *sinkpad;
52   GstPad *srcpad;
53
54   gint in_width, in_height;
55
56   /* Collect together subtitle buffers until we have a full control sequence */
57   GstBuffer *partialbuf;
58   GstMapInfo partialmap;
59   gboolean have_title;
60
61   guchar subtitle_index[4];
62   guchar menu_index[4];
63   guchar subtitle_alpha[4];
64   guchar menu_alpha[4];
65
66   guint32 current_clut[16];
67   Color_val palette_cache_yuv[4];
68   Color_val hl_palette_cache_yuv[4];
69
70   Color_val palette_cache_rgb[4];
71   Color_val hl_palette_cache_rgb[4];
72
73   GstVideoInfo info;
74   gboolean use_ARGB;
75   GstClockTime next_ts;
76
77   /*
78    * State info for the current subpicture
79    * buffer
80    */
81   guchar *parse_pos;
82
83   guint16 packet_size;
84   guint16 data_size;
85
86   gint offset[2];
87
88   gboolean forced_display;
89   gboolean visible;
90
91   gint left, top, right, bottom;
92   gint hl_left, hl_top, hl_right, hl_bottom;
93
94   gint current_button;
95
96   GstClockTime next_event_ts;
97
98   gboolean buf_dirty;
99 };
100
101 struct _GstDvdSubDecClass
102 {
103   GstElementClass parent_class;
104 };
105
106 GType gst_dvd_sub_dec_get_type (void);
107 GST_ELEMENT_REGISTER_DECLARE (dvdsubdec);
108
109 G_END_DECLS
110
111 #endif /* __GST_DVDSUBDEC_H__ */