Tizen 2.0 Release
[framework/multimedia/gst-plugins-bad0.10.git] / ext / jp2k / gstjasperenc.h
1 /* GStreamer Jasper based j2k image encoder
2  * Copyright (C) 2008 Mark Nauwelaerts <mnauw@users.sf.net>
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_JASPER_ENC_H__
21 #define __GST_JASPER_ENC_H__
22
23 #include <gst/gst.h>
24 #include <gst/video/video.h>
25
26 #include <jasper/jasper.h>
27
28 G_BEGIN_DECLS
29
30 /* #define's don't like whitespacey bits */
31 #define GST_TYPE_JASPER_ENC                     \
32   (gst_jasper_enc_get_type())
33 #define GST_JASPER_ENC(obj)                                             \
34   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_JASPER_ENC,GstJasperEnc))
35 #define GST_JASPER_ENC_CLASS(klass)                                     \
36   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_JASPER_ENC,GstJasperEncClass))
37 #define GST_IS_JASPER_ENC(obj)                                  \
38   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_JASPER_ENC))
39 #define GST_IS_JASPER_ENC_CLASS(klass)                          \
40   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_JASPER_ENC))
41
42 typedef struct _GstJasperEnc      GstJasperEnc;
43 typedef struct _GstJasperEncClass GstJasperEncClass;
44
45 enum {
46   GST_JP2ENC_MODE_J2C = 0,
47   GST_JP2ENC_MODE_JPC,
48   GST_JP2ENC_MODE_JP2
49 };
50
51 #define GST_JASPER_ENC_MAX_COMPONENT  4
52
53 struct _GstJasperEnc
54 {
55   GstElement element;
56
57   GstPad *sinkpad, *srcpad;
58
59   jas_image_t *image;
60   glong *buf;
61
62   /* jasper image fmt */
63   gint fmt;
64   gint mode;
65   jas_clrspc_t clrspc;
66
67   /* stream/image properties */
68   GstVideoFormat format;
69   gint width;
70   gint height;
71   gint channels;
72   gint fps_num, fps_den;
73   gint par_num, par_den;
74   /* standard video_format indexed */
75   gint stride[GST_JASPER_ENC_MAX_COMPONENT];
76   gint offset[GST_JASPER_ENC_MAX_COMPONENT];
77   gint inc[GST_JASPER_ENC_MAX_COMPONENT];
78   gint cwidth[GST_JASPER_ENC_MAX_COMPONENT];
79   gint cheight[GST_JASPER_ENC_MAX_COMPONENT];
80 };
81
82 struct _GstJasperEncClass
83 {
84   GstElementClass parent_class;
85 };
86
87 GType gst_jasper_enc_get_type (void);
88
89 G_END_DECLS
90
91 #endif /* __GST_JASPER_ENC_H__ */