1 /* GStreamer
2  * Copyright (C) <2013> Sreerenj Balachandran <sreerenj.balachandran@intel.com>
3  * Copyright (C) <2013> Intel Corporation
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 #ifndef __GST_WEBP_DEC_H__
22 #define __GST_WEBP_DEC_H__
23 
24 #include <gst/gst.h>
25 #include <gst/video/video.h>
26 #include <gst/video/gstvideodecoder.h>
27 #include <gst/base/gstadapter.h>
28 #include <gst/base/gstbytereader.h>
29 
30 #include <stdio.h>
31 #include <webp/decode.h>
32 
33 G_BEGIN_DECLS
34 
35 #define GST_TYPE_WEBP_DEC \
36   (gst_webp_dec_get_type())
37 #define GST_WEBP_DEC(obj) \
38   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WEBP_DEC,GstWebPDec))
39 #define GST_WEBP_DEC_CLASS(klass) \
40   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_WEBP_DEC,GstWebPDecClass))
41 #define GST_IS_WEBP_DEC(obj) \
42   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WEBP_DEC))
43 #define GST_IS_WEBP_DEC_CLASS(klass) \
44   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_WEBP_DEC))
45 
46 typedef struct _GstWebPDec           GstWebPDec;
47 typedef struct _GstWebPDecClass      GstWebPDecClass;
48 
49 struct _GstWebPDec {
50   GstVideoDecoder decoder;
51 
52   GstVideoCodecState *input_state;
53   GstVideoCodecState *output_state;
54 
55   gboolean saw_header;
56   guint frame_size;
57 
58   /* properties */
59   gboolean bypass_filtering;
60   gboolean no_fancy_upsampling;
61   gboolean use_threads;
62 
63   WEBP_CSP_MODE colorspace;
64   WebPDecoderConfig config;
65 };
66 
67 struct _GstWebPDecClass {
68   GstVideoDecoderClass decoder_class;
69 };
70 
71 GType gst_webp_dec_get_type (void);
72 gboolean gst_webp_dec_register (GstPlugin * plugin);
73 
74 G_END_DECLS
75 
76 #endif /* __GST_WEBP_DEC_H__ */
77