• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2012 Collabora Ltd.
3  *     Author: Sebastian Dröge <sebastian.droege@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., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  *
20  */
21 
22 #ifndef __GST_OPENJPEG_DEC_H__
23 #define __GST_OPENJPEG_DEC_H__
24 
25 #include <gst/gst.h>
26 #include <gst/video/video.h>
27 #include <gst/codecparsers/gstjpeg2000sampling.h>
28 
29 #include "gstopenjpeg.h"
30 
31 G_BEGIN_DECLS
32 
33 #define GST_TYPE_OPENJPEG_DEC \
34   (gst_openjpeg_dec_get_type())
35 #define GST_OPENJPEG_DEC(obj) \
36   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OPENJPEG_DEC,GstOpenJPEGDec))
37 #define GST_OPENJPEG_DEC_CLASS(klass) \
38   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OPENJPEG_DEC,GstOpenJPEGDecClass))
39 #define GST_IS_OPENJPEG_DEC(obj) \
40   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OPENJPEG_DEC))
41 #define GST_IS_OPENJPEG_DEC_CLASS(obj) \
42   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPENJPEG_DEC))
43 
44 typedef struct _GstOpenJPEGDec GstOpenJPEGDec;
45 typedef struct _GstOpenJPEGDecClass GstOpenJPEGDecClass;
46 
47 struct _GstOpenJPEGDec
48 {
49   GstVideoDecoder parent;
50 
51   /* < private > */
52   GstVideoCodecState *input_state;
53   GstVideoCodecState *output_state;
54 
55   OPJ_CODEC_FORMAT codec_format;
56   gboolean is_jp2c;
57   OPJ_COLOR_SPACE color_space;
58   GstJPEG2000Sampling sampling;
59   gint ncomps;
60 
61   void (*fill_frame) (GstVideoFrame *frame, opj_image_t * image);
62 
63   opj_dparameters_t params;
64 };
65 
66 struct _GstOpenJPEGDecClass
67 {
68   GstVideoDecoderClass parent_class;
69 };
70 
71 GType gst_openjpeg_dec_get_type (void);
72 
73 G_END_DECLS
74 
75 #endif /* __GST_OPENJPEG_DEC_H__ */
76