Fix seek issue
[profile/ivi/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/vaapi/gstvaapidisplay.h>
29 #include <gst/vaapi/gstvaapidecoder.h>
30
31 G_BEGIN_DECLS
32
33 #define GST_TYPE_VAAPIDECODE \
34     (gst_vaapidecode_get_type())
35
36 #define GST_VAAPIDECODE(obj)                            \
37     (G_TYPE_CHECK_INSTANCE_CAST((obj),                  \
38                                 GST_TYPE_VAAPIDECODE,   \
39                                 GstVaapiDecode))
40
41 #define GST_VAAPIDECODE_CLASS(klass)                    \
42     (G_TYPE_CHECK_CLASS_CAST((klass),                   \
43                              GST_TYPE_VAAPIDECODE,      \
44                              GstVaapiDecodeClass))
45
46 #define GST_IS_VAAPIDECODE(obj) \
47     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_VAAPIDECODE))
48
49 #define GST_IS_VAAPIDECODE_CLASS(klass) \
50     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VAAPIDECODE))
51
52 #define GST_VAAPIDECODE_GET_CLASS(obj)                  \
53     (G_TYPE_INSTANCE_GET_CLASS((obj),                   \
54                                GST_TYPE_VAAPIDECODE,    \
55                                GstVaapiDecodeClass))
56
57 typedef struct _GstVaapiDecode                  GstVaapiDecode;
58 typedef struct _GstVaapiDecodeClass             GstVaapiDecodeClass;
59
60 struct _GstVaapiDecode {
61     /*< private >*/
62     GstElement          parent_instance;
63
64     GstPad             *sinkpad;
65     GstCaps            *sinkpad_caps;
66     GstPad             *srcpad;
67     GstCaps            *srcpad_caps;
68     GstVaapiDisplay    *display;
69     GstVaapiDecoder    *decoder;
70     GMutex              decoder_mutex;
71     GCond               decoder_ready;
72     GstCaps            *decoder_caps;
73     GstCaps            *allowed_caps;
74     GstEvent           *delayed_new_seg;
75     GstSegment          segment;
76     gint64              render_time_base;
77     GstClockTime        last_buffer_time;
78     unsigned int        is_ready        : 1;
79     // escape decoding (blocked by hw resource) when there is _flush event, usually happens during seek.
80     unsigned int        escape_decoding : 1;
81 };
82
83 struct _GstVaapiDecodeClass {
84     /*< private >*/
85     GstElementClass     parent_class;
86 };
87
88 GType
89 gst_vaapidecode_get_type(void) G_GNUC_CONST;
90
91 G_END_DECLS
92
93 #endif /* GST_VAAPIDECODE_H */