• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  * Copyright (C) 2004 Benjamin Otte <in7y118@public.uni-hamburg.de>
3  * Copyright (c) 2012 Collabora Ltd.
4  *	Author : Edward Hervey <edward@collabora.com>
5  *      Author : Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef __GST_THEORADEC_H__
24 #define __GST_THEORADEC_H__
25 
26 #ifdef HAVE_CONFIG_H
27 #  include "config.h"
28 #endif
29 
30 #include <gst/gst.h>
31 #include <gst/video/gstvideodecoder.h>
32 #include <theora/theoradec.h>
33 #include <string.h>
34 
35 G_BEGIN_DECLS
36 
37 #define GST_TYPE_THEORA_DEC \
38   (gst_theora_dec_get_type())
39 #define GST_THEORA_DEC(obj) \
40   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_THEORA_DEC,GstTheoraDec))
41 #define GST_THEORA_DEC_CLASS(klass) \
42   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_THEORA_DEC,GstTheoraDecClass))
43 #define GST_IS_THEORA_DEC(obj) \
44   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_THEORA_DEC))
45 #define GST_IS_THEORA_DEC_CLASS(klass) \
46   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_THEORA_DEC))
47 
48 typedef struct _GstTheoraDec GstTheoraDec;
49 typedef struct _GstTheoraDecClass GstTheoraDecClass;
50 
51 /**
52  * GstTheoraDec:
53  *
54  * Opaque object data structure.
55  */
56 struct _GstTheoraDec
57 {
58   GstVideoDecoder element;
59 
60   /* theora decoder state */
61   th_dec_ctx *decoder;
62   //theora_state state;
63   th_setup_info *setup;
64   th_info info;
65   th_comment comment;
66 
67   gboolean have_header;
68 
69   gboolean need_keyframe;
70   GstVideoCodecState *input_state;
71   GstVideoCodecState *output_state;
72 
73   /* telemetry debugging options */
74   gint telemetry_mv;
75   gint telemetry_mbmode;
76   gint telemetry_qi;
77   gint telemetry_bits;
78 
79   gboolean can_crop;
80   GstVideoInfo uncropped_info;
81 };
82 
83 struct _GstTheoraDecClass
84 {
85   GstVideoDecoderClass parent_class;
86 };
87 
88 GType gst_theora_dec_get_type (void);
89 
90 GST_ELEMENT_REGISTER_DECLARE (theoradec);
91 
92 G_END_DECLS
93 
94 #endif /* __GST_THEORADEC_H__ */
95