Tizen 2.0 Release
[framework/multimedia/gst-plugins-good0.10.git] / ext / annodex / gstcmmldec.h
1 /*
2  * gstcmmldec.h - GStreamer annodex CMML decoder
3  * Copyright (C) 2005 Alessandro Decina
4  * 
5  * Authors:
6  *   Alessandro Decina <alessandro@nnva.org>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #ifndef __GST_CMML_DEC_H__
25 #define __GST_CMML_DEC_H__
26
27 #include <gst/gst.h>
28 #include <gst/gstformat.h>
29 #include <gst/controller/gstcontroller.h>
30
31 #include "gstcmmlparser.h"
32
33 /* GstCmmlDec */
34 #define GST_TYPE_CMML_DEC (gst_cmml_dec_get_type())
35 #define GST_CMML_DEC(obj) \
36     (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_CMML_DEC, GstCmmlDec))
37 #define GST_CMML_DEC_CLASS(klass) \
38     (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_CMML_DEC, GstCmmlDecClass))
39 #define GST_IS_CMML_DEC(obj) \
40     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_CMML_DEC))
41 #define GST_IS_CMML_DEC_CLASS(klass) \
42     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_CMML_DEC))
43 #define GST_CMML_DEC_GET_CLASS(klass) \
44     (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_CMML_DEC, GstCmmlDecClass))
45
46 typedef struct _GstCmmlDec GstCmmlDec;
47 typedef struct _GstCmmlDecClass GstCmmlDecClass;
48 typedef enum _GstCmmlPacketType GstCmmlPacketType;
49
50 enum _GstCmmlPacketType
51 {
52   GST_CMML_PACKET_UNKNOWN,
53   GST_CMML_PACKET_IDENT_HEADER,
54   GST_CMML_PACKET_FIRST_HEADER,
55   GST_CMML_PACKET_SECOND_HEADER,
56   GST_CMML_PACKET_CLIP
57 };
58
59 struct _GstCmmlDec
60 {
61   GstElement element;
62
63   /* element part */
64   GstPad *sinkpad;
65   GstPad *srcpad;
66
67   /* bitstream part */
68   gint16 major;                 /* bitstream version major */
69   gint16 minor;                 /* bitstream version minor */
70   gint64 granulerate_n;         /* bitrstream granulerate numerator */
71   gint64 granulerate_d;         /* bitstream granulerate denominator */
72   gint8 granuleshift;           /* bitstreamgranuleshift */
73   gint64 granulepos;            /* bitstream granule position */
74   GstClockTime timestamp;       /* timestamp of the last buffer */
75
76   /* decoder part */
77   GstCmmlParser *parser;        /* cmml parser */
78   gboolean sent_root;
79   GstFlowReturn flow_return;   /* _chain return value */
80   gboolean wait_clip_end;        /* when TRUE, the GST_TAG_MESSAGE for a
81                                  * clip is sent when the next clip (or EOS)
82                                  * is found, so that the clip end-time is
83                                  * known. This is useful for pre-extracting
84                                  * the clips.
85                                  */
86   GHashTable *tracks;
87 };
88
89 struct _GstCmmlDecClass
90 {
91   GstElementClass parent_class;
92 };
93
94 GType gst_cmml_dec_get_type (void);
95
96 gboolean gst_cmml_dec_plugin_init (GstPlugin * plugin);
97
98 #endif /* __GST_CMML_DEC_H__ */