edd9c1487d4704ceaf970ba25ab095ee13164d2b
[platform/upstream/gstreamer-vaapi.git] / gst / vaapi / gstvaapisink.h
1 /*
2  *  gstvaapisink.h - VA-API video sink
3  *
4  *  Copyright (C) 2010-2011 Splitted-Desktop Systems
5  *    Author: Gwenole Beauchesne <gwenole.beauchesne@splitted-desktop.com>
6  *  Copyright (C) 2011-2014 Intel Corporation
7  *    Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
8  *
9  *  This library is free software; you can redistribute it and/or
10  *  modify it under the terms of the GNU Lesser General Public License
11  *  as published by the Free Software Foundation; either version 2.1
12  *  of the License, or (at your option) any later version.
13  *
14  *  This library is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  *  Lesser General Public License for more details.
18  *
19  *  You should have received a copy of the GNU Lesser General Public
20  *  License along with this library; if not, write to the Free
21  *  Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  *  Boston, MA 02110-1301 USA
23 */
24
25 #ifndef GST_VAAPISINK_H
26 #define GST_VAAPISINK_H
27
28 #include "gstvaapipluginbase.h"
29 #include <gst/vaapi/gstvaapiwindow.h>
30 #if USE_GLX
31 #include <gst/vaapi/gstvaapitexture.h>
32 #endif
33 #include "gstvaapipluginutil.h"
34
35 G_BEGIN_DECLS
36
37 #define GST_TYPE_VAAPISINK \
38     (gst_vaapisink_get_type())
39
40 #define GST_VAAPISINK(obj)                              \
41     (G_TYPE_CHECK_INSTANCE_CAST((obj),                  \
42                                 GST_TYPE_VAAPISINK,     \
43                                 GstVaapiSink))
44
45 #define GST_VAAPISINK_CLASS(klass)                      \
46     (G_TYPE_CHECK_CLASS_CAST((klass),                   \
47                              GST_TYPE_VAAPISINK,        \
48                              GstVaapiSinkClass))
49
50 #define GST_IS_VAAPISINK(obj) \
51     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_VAAPISINK))
52
53 #define GST_IS_VAAPISINK_CLASS(klass) \
54     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VAAPISINK))
55
56 #define GST_VAAPISINK_GET_CLASS(obj)                    \
57     (G_TYPE_INSTANCE_GET_CLASS((obj),                   \
58                                GST_TYPE_VAAPISINK,      \
59                                GstVaapiSinkClass))
60
61 typedef struct _GstVaapiSink                    GstVaapiSink;
62 typedef struct _GstVaapiSinkClass               GstVaapiSinkClass;
63 #if !USE_GLX
64 typedef struct _GstVaapiTexture                 GstVaapiTexture;
65 #endif
66
67 struct _GstVaapiSink {
68     /*< private >*/
69     GstVaapiPluginBase  parent_instance;
70
71     GstCaps            *caps;
72     GstVaapiWindow     *window;
73     guint               window_width;
74     guint               window_height;
75     GstVaapiTexture    *texture;
76 #if GST_CHECK_VERSION(1,0,0)
77     GstBufferPool      *video_buffer_pool;
78 #endif
79     guint               video_buffer_size;
80     GstBuffer          *video_buffer;
81     guint               video_width;
82     guint               video_height;
83     gint                video_par_n;
84     gint                video_par_d;
85     GstVideoInfo        video_info;
86     GstVaapiRectangle   display_rect;
87     GstVaapiRotation    rotation;
88     GstVaapiRotation    rotation_req;
89     guint               color_standard;
90     guint               foreign_window  : 1;
91     guint               fullscreen      : 1;
92     guint               synchronous     : 1;
93     guint               use_glx         : 1;
94     guint               use_reflection  : 1;
95     guint               use_overlay     : 1;
96     guint               use_rotation    : 1;
97     guint               keep_aspect     : 1;
98 };
99
100 struct _GstVaapiSinkClass {
101     /*< private >*/
102     GstVaapiPluginBaseClass parent_class;
103 };
104
105 GType
106 gst_vaapisink_get_type(void) G_GNUC_CONST;
107
108 G_END_DECLS
109
110 #endif /* GST_VAAPISINK_H */