vaapidecode: move to GstVideoDecoder base class.
[vaapi:gstreamer-vaapi.git] / gst / vaapi / gstvaapidecode.h
1 /*
2  *  gstvaapidecode.h - VA-API video decoder
3  *
4  *  Copyright (C) 2010-2011 Splitted-Desktop Systems
5  *  Copyright (C) 2011 Intel Corporation
6  *
7  *  This library is free software; you can redistribute it and/or
8  *  modify it under the terms of the GNU Lesser General Public License
9  *  as published by the Free Software Foundation; either version 2.1
10  *  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  *  Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public
18  *  License along with this library; if not, write to the Free
19  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  *  Boston, MA 02110-1301 USA
21  */
22
23 #ifndef GST_VAAPIDECODE_H
24 #define GST_VAAPIDECODE_H
25
26 #include <gst/gst.h>
27 #include <gst/gsttask.h>
28 #include <gst/video/gstvideodecoder.h>
29 #include <gst/vaapi/gstvaapidisplay.h>
30 #include <gst/vaapi/gstvaapidecoder.h>
31
32 G_BEGIN_DECLS
33
34 #define GST_TYPE_VAAPIDECODE \
35     (gst_vaapidecode_get_type())
36
37 #define GST_VAAPIDECODE(obj)                            \
38     (G_TYPE_CHECK_INSTANCE_CAST((obj),                  \
39                                 GST_TYPE_VAAPIDECODE,   \
40                                 GstVaapiDecode))
41
42 #define GST_VAAPIDECODE_CLASS(klass)                    \
43     (G_TYPE_CHECK_CLASS_CAST((klass),                   \
44                              GST_TYPE_VAAPIDECODE,      \
45                              GstVaapiDecodeClass))
46
47 #define GST_IS_VAAPIDECODE(obj) \
48     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_VAAPIDECODE))
49
50 #define GST_IS_VAAPIDECODE_CLASS(klass) \
51     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VAAPIDECODE))
52
53 #define GST_VAAPIDECODE_GET_CLASS(obj)                  \
54     (G_TYPE_INSTANCE_GET_CLASS((obj),                   \
55                                GST_TYPE_VAAPIDECODE,    \
56                                GstVaapiDecodeClass))
57
58 typedef struct _GstVaapiDecode                  GstVaapiDecode;
59 typedef struct _GstVaapiDecodeClass             GstVaapiDecodeClass;
60
61 struct _GstVaapiDecode {
62     /*< private >*/
63     GstVideoDecoder     parent_instance;
64
65     GstPad             *sinkpad;
66     GstCaps            *sinkpad_caps;
67     GstPadQueryFunction sinkpad_query;
68     GstPad             *srcpad;
69     GstCaps            *srcpad_caps;
70     GstPadQueryFunction srcpad_query;
71     GstVaapiDisplay    *display;
72     GstVaapiDecoder    *decoder;
73     GMutex              decoder_mutex;
74     GCond               decoder_ready;
75     GstCaps            *decoder_caps;
76     GstCaps            *allowed_caps;
77     gint64              render_time_base;
78     GstClockTime        last_buffer_time;
79     unsigned int        is_ready        : 1;
80 };
81
82 struct _GstVaapiDecodeClass {
83     /*< private >*/
84     GstVideoDecoderClass parent_class;
85 };
86
87 GType
88 gst_vaapidecode_get_type(void) G_GNUC_CONST;
89
90 G_END_DECLS
91
92 #endif /* GST_VAAPIDECODE_H */