4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hyunil Park <hyunil46.park@samsung.com>
8 * This library is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU Lesser General Public License as published by the
10 * Free Software Foundation; either version 2.1 of the License, or (at your option)
13 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
14 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 * License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, write to the Free Software Foundation, Inc., 51
20 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef __GST_XV_IMAGE_SRC_H__
24 #define __GST_XV_IMAGE_SRC_H__
27 #include <gst/base/gstpushsrc.h>
37 #include <sys/types.h>
42 #include <X11/Xutil.h>
43 #include <X11/extensions/Xvlib.h>
44 #include <X11/extensions/Xvproto.h>
45 #include <X11/extensions/XShm.h>
46 #include <X11/extensions/Xdamage.h>
48 #include <dri2.h> //libdri2-dev, libdrm-dev
49 #include <tbm_bufmgr.h>
53 #define C(b,m) (((b) >> (m)) & 0xFF)
54 #define B(c,s) ((((unsigned int)(c)) & 0xff) << (s))
55 #define FOURCC(a,b,c,d) (B(d,24) | B(c,16) | B(b,8) | B(a,0))
56 #define FOURCC_RGB32 FOURCC('R','G','B','4')
57 #define FOURCC_I420 FOURCC('I','4','2','0')
58 #define FOURCC_SN12 FOURCC('S','N','1','2')
59 #define FOURCC_ST12 FOURCC('S','T','1','2')
63 #define GST_TYPE_XV_IMAGE_SRC \
64 (gst_xv_image_src_get_type())
65 #define GST_XV_IMAGE_SRC(obj) \
66 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_XV_IMAGE_SRC,GstXVImageSrc))
67 #define GST_XV_IMAGE_SRC_CLASS(klass) \
68 (G_TYPE_CHECK_CLASS_CAST((klass), \
69 GST_TYPE_XV_IMAGE_SRC,GstXVImageSrcClass))
70 #define GST_IS_XV_IMAGE_SRC(obj) \
71 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_XV_IMAGE_SRC))
72 #define GST_IS_XV_IMAGE_SRC_CLASS(klass) \
73 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_XV_IMAGE_SRC))
75 typedef struct _GstXVImageSrc GstXVImageSrc;
76 typedef struct _GstXVImageSrcClass GstXVImageSrcClass;
78 struct _GstXVImageSrc {
86 unsigned int framesize;
90 unsigned int evt_base;
94 DRI2Buffer* dri2_buffers;
97 guint64 frame_duration;
100 gint rate_denominator;
101 GThread *updates_thread;
102 gboolean thread_return;
108 gboolean pause_cond_var;
110 GMutex *pause_cond_lock;
111 GMutex *buffer_cond_lock;
114 int current_data_type;
116 double get_image_overtime;
117 int get_image_overtime_cnt;
123 struct _GstXVImageSrcClass {
124 GstPushSrcClass parent_class;
127 void (*video_with_ui) (void *data);
128 void (*video_only) (void *data);
131 GType gst_xv_image_src_get_type (void);
135 #endif /* __GST_XV_IMAGE_SRC_H__ */