+no_warn_args = []
+# XKeycodeToKeysym is deprecated, but we use it when Xkb is unavailable
+if cc.has_argument ('-Wno-deprecated-declarations')
+ no_warn_args += '-Wno-deprecated-declarations'
+endif
+
gstximage = library('gstximagesink',
'ximagesink.c', 'ximage.c', 'ximagepool.c',
- c_args : gst_plugins_base_args,
+ c_args : gst_plugins_base_args + no_warn_args,
include_directories: [configinc, libsinc],
dependencies : glib_deps + [video_dep, gst_base_dep, gst_dep, x11_dep, xshm_dep],
install : true,
/* Key pressed/released over our window. We send upstream
events for interactivity/navigation */
g_mutex_lock (&ximagesink->x_lock);
- keysym = XkbKeycodeToKeysym (ximagesink->xcontext->disp,
- e.xkey.keycode, 0, 0);
+ if (ximagesink->xcontext->use_xkb) {
+ keysym = XkbKeycodeToKeysym (ximagesink->xcontext->disp,
+ e.xkey.keycode, 0, 0);
+ } else {
+ keysym = XKeycodeToKeysym (ximagesink->xcontext->disp,
+ e.xkey.keycode, 0);
+ }
if (keysym != NoSymbol) {
key_str = XKeysymToString (keysym);
} else {
gint endianness;
GstVideoFormat vformat;
guint32 alpha_mask;
+ int opcode, event, err;
+ int major = XkbMajorVersion;
+ int minor = XkbMinorVersion;
g_return_val_if_fail (GST_IS_X_IMAGE_SINK (ximagesink), NULL);
xcontext->use_xshm = FALSE;
GST_DEBUG ("ximagesink is not using XShm extension");
}
+ if (XkbQueryExtension (xcontext->disp, &opcode, &event, &err, &major, &minor)) {
+ xcontext->use_xkb = TRUE;
+ GST_DEBUG ("ximagesink is using Xkb extension");
+ } else {
+ xcontext->use_xkb = FALSE;
+ GST_DEBUG ("ximagesink is not using Xkb extension");
+ }
/* extrapolate alpha mask */
if (xcontext->depth == 32) {
* @heightmm ratio
* @use_xshm: used to known whether of not XShm extension is usable or not even
* if the Extension is present
+ * @use_xkb: used to known wether of not Xkb extension is usable or not even
+ * if the Extension is present
* @caps: the #GstCaps that Display @disp can accept
*
* Structure used to store various information collected/calculated for a
GValue *par; /* calculated pixel aspect ratio */
gboolean use_xshm;
+ gboolean use_xkb;
GstCaps *caps;
GstCaps *last_caps;
'xvimagesink.c',
]
+no_warn_args = []
+# XKeycodeToKeysym is deprecated, but we use it when Xkb is unavailable
+if cc.has_argument ('-Wno-deprecated-declarations')
+ no_warn_args += '-Wno-deprecated-declarations'
+endif
+
xvideo_dep = dependency('xv', required : get_option('xvideo'))
core_conf.set('HAVE_XVIDEO', x11_dep.found() and xvideo_dep.found())
if xvideo_dep.found()
gstxvimage = library('gstxvimagesink',
xvimage_sources,
- c_args : gst_plugins_base_args,
+ c_args : gst_plugins_base_args + no_warn_args,
include_directories: [configinc, libsinc],
dependencies : glib_deps + [video_dep, gst_base_dep, gst_dep, x11_dep, xshm_dep, xvideo_dep, libm],
install : true,
const char *channels[4] = { "XV_HUE", "XV_SATURATION",
"XV_BRIGHTNESS", "XV_CONTRAST"
};
+ int opcode, event, err;
+ int major = XkbMajorVersion;
+ int minor = XkbMinorVersion;
g_return_val_if_fail (config != NULL, NULL);
context->use_xshm = FALSE;
GST_DEBUG ("xvimagesink is not using XShm extension");
}
+ if (XkbQueryExtension (context->disp, &opcode, &event, &err, &major, &minor)) {
+ context->use_xkb = TRUE;
+ GST_DEBUG ("xvimagesink is using Xkb extension");
+ } else {
+ context->use_xkb = FALSE;
+ GST_DEBUG ("xvimagesink is not using Xkb extension");
+ }
xv_attr = XvQueryPortAttributes (context->disp, context->xv_port_id, &N_attr);
* @heightmm ratio
* @use_xshm: used to known whether of not XShm extension is usable or not even
* if the Extension is present
+ * @use_xkb: used to known wether of not Xkb extension is usable or not even
+ * if the Extension is present
* @xv_port_id: the XVideo port ID
* @im_format: used to store at least a valid format for XShm calls checks
* @formats_list: list of supported image formats on @xv_port_id
GValue *par; /* calculated pixel aspect ratio */
gboolean use_xshm;
+ gboolean use_xkb;
XvPortID xv_port_id;
guint nb_adaptors;
/* Key pressed/released over our window. We send upstream
events for interactivity/navigation */
g_mutex_lock (&xvimagesink->context->lock);
- keysym = XkbKeycodeToKeysym (xvimagesink->context->disp,
- e.xkey.keycode, 0, 0);
+ if (xvimagesink->context->use_xkb) {
+ keysym = XkbKeycodeToKeysym (xvimagesink->context->disp,
+ e.xkey.keycode, 0, 0);
+ } else {
+ keysym = XKeycodeToKeysym (xvimagesink->context->disp,
+ e.xkey.keycode, 0);
+ }
if (keysym != NoSymbol) {
key_str = XKeysymToString (keysym);
} else {