tizen 2.0 init
[framework/multimedia/gst-plugins-good0.10.git] / sys / ximage / gstximagesrc.h
1 /* screenshotsrc: Screenshot plugin for GStreamer
2  * 
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Library General Public
5  * License as published by the Free Software Foundation; either
6  * version 2 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Library General Public License for more details.
12  *
13  * You should have received a copy of the GNU Library General Public
14  * License along with this library; if not, write to the
15  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16  * Boston, MA 02111-1307, USA.
17  */
18
19 #ifndef __GST_XIMAGE_SRC_H__
20 #define __GST_XIMAGE_SRC_H__
21
22 #include <gst/gst.h>
23 #include <gst/base/gstpushsrc.h>
24 #include "ximageutil.h"
25
26 #ifdef HAVE_XFIXES
27 #include <X11/extensions/Xfixes.h>
28 #endif
29 #ifdef HAVE_XDAMAGE
30 #include <X11/extensions/Xdamage.h>
31 #endif
32
33 G_BEGIN_DECLS
34
35 #define GST_TYPE_XIMAGE_SRC (gst_ximage_src_get_type())
36 #define GST_XIMAGE_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_XIMAGE_SRC,GstXImageSrc))
37 #define GST_XIMAGE_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_XIMAGE_SRC,GstXImageSrc))
38 #define GST_IS_XIMAGE_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_XIMAGE_SRC))
39 #define GST_IS_XIMAGE_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_XIMAGE_SRC))
40
41 typedef struct _GstXImageSrc GstXImageSrc;
42 typedef struct _GstXImageSrcClass GstXImageSrcClass;
43
44 GType gst_ximage_src_get_type (void) G_GNUC_CONST;
45
46 struct _GstXImageSrc
47 {
48   GstPushSrc parent;
49
50   /* Information on display */
51   GstXContext *xcontext;
52   gint width;
53   gint height;
54
55   Window xwindow;
56   gchar *display_name;
57   guint screen_num;
58
59   /* Window selection */
60   guint64 xid;
61   gchar *xname;
62
63   /* Desired output framerate */
64   gint fps_n;
65   gint fps_d;
66
67   /* for framerate sync */
68   GstClockID clock_id;
69   gint64 last_frame_no;
70
71   /* Protect X Windows calls */
72   GMutex *x_lock;
73
74   /* Gathered pool of emitted buffers */
75   GMutex *pool_lock;
76   GSList *buffer_pool;
77
78   /* XFixes and XDamage support */
79   gboolean have_xfixes;
80   gboolean have_xdamage;
81   gboolean show_pointer;
82   gboolean use_damage;
83
84   /* co-ordinates for start and end */
85   guint startx;
86   guint starty;
87   guint endx;
88   guint endy;
89
90   /* whether to use remote friendly calls */
91   gboolean remote;
92
93 #ifdef HAVE_XFIXES
94   int fixes_event_base;
95   XFixesCursorImage *cursor_image;
96 #endif
97 #ifdef HAVE_XDAMAGE
98   Damage damage;
99   int damage_event_base;
100   XserverRegion damage_region;
101   GC damage_copy_gc;
102   GstXImageSrcBuffer *last_ximage;
103 #endif
104 };
105
106 struct _GstXImageSrcClass
107 {
108   GstPushSrcClass parent_class;
109 };
110
111 G_END_DECLS
112
113 #endif /* __GST_XIMAGE_SRC_H__ */