legal: add Intel copyright on modified files.
[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  *  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_VAAPISINK_H
24 #define GST_VAAPISINK_H
25
26 #include <gst/video/gstvideosink.h>
27 #include <gst/vaapi/gstvaapidisplay.h>
28 #include <gst/vaapi/gstvaapiwindow.h>
29 #if USE_VAAPISINK_GLX
30 #include <gst/vaapi/gstvaapitexture.h>
31 #endif
32 #include <X11/Xlib.h>
33
34 G_BEGIN_DECLS
35
36 #define GST_TYPE_VAAPISINK \
37     (gst_vaapisink_get_type())
38
39 #define GST_VAAPISINK(obj)                              \
40     (G_TYPE_CHECK_INSTANCE_CAST((obj),                  \
41                                 GST_TYPE_VAAPISINK,     \
42                                 GstVaapiSink))
43
44 #define GST_VAAPISINK_CLASS(klass)                      \
45     (G_TYPE_CHECK_CLASS_CAST((klass),                   \
46                              GST_TYPE_VAAPISINK,        \
47                              GstVaapiSinkClass))
48
49 #define GST_IS_VAAPISINK(obj) \
50     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_VAAPISINK))
51
52 #define GST_IS_VAAPISINK_CLASS(klass) \
53     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VAAPISINK))
54
55 #define GST_VAAPISINK_GET_CLASS(obj)                    \
56     (G_TYPE_INSTANCE_GET_CLASS((obj),                   \
57                                GST_TYPE_VAAPISINK,      \
58                                GstVaapiSinkClass))
59
60 typedef struct _GstVaapiSink                    GstVaapiSink;
61 typedef struct _GstVaapiSinkClass               GstVaapiSinkClass;
62
63 #if !USE_VAAPISINK_GLX
64 typedef struct _GstVaapiTexture                 GstVaapiTexture;
65 #endif
66
67 struct _GstVaapiSink {
68     /*< private >*/
69     GstVideoSink parent_instance;
70
71     GstVaapiDisplay    *display;
72     GstVaapiWindow     *window;
73     guint               window_width;
74     guint               window_height;
75     GstVaapiTexture    *texture;
76     guint               video_width;
77     guint               video_height;
78     gint                video_par_n;
79     gint                video_par_d;
80     GstVaapiRectangle   display_rect;
81     guint               foreign_window  : 1;
82     guint               fullscreen      : 1;
83     guint               synchronous     : 1;
84     guint               use_glx         : 1;
85     guint               use_reflection  : 1;
86 };
87
88 struct _GstVaapiSinkClass {
89     /*< private >*/
90     GstVideoSinkClass parent_class;
91 };
92
93 GType
94 gst_vaapisink_get_type(void);
95
96 G_END_DECLS
97
98 #endif /* GST_VAAPISINK_H */