summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2014-09-11 22:19:05 +0100
committerTim-Philipp Müller <tim@centricular.com>2014-09-23 10:34:20 +0100
commitc2df24db9b8384c5cc2a11268c275d401a5c93e0 (patch)
treecf05a7ae9245f83f726c31972b7e062455d631d9
parent531fd83c40a706bed4e7a6d07aac9d28202cdd20 (diff)
xvimagesink: only try to set XV_ITURBT_709 port attribute if it exists
Don't try to set port attribute that's not advertised by the adaptor. Fixes videotestsrc ! xvimagesink aborting with X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 151 (XVideo) Minor opcode of failed request: 13 () on intel HD4600 graphics with kernel 3.16, xserver 1.15, intel driver 2.21.15.
-rw-r--r--sys/xvimage/xvcontext.c10
-rw-r--r--sys/xvimage/xvcontext.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/sys/xvimage/xvcontext.c b/sys/xvimage/xvcontext.c
index 146e4a52c..6d84e37ee 100644
--- a/sys/xvimage/xvcontext.c
+++ b/sys/xvimage/xvcontext.c
@@ -153,18 +153,20 @@ gst_xvcontext_get_xv_support (GstXvContext * context,
/* Set XV_AUTOPAINT_COLORKEY and XV_DOUBLE_BUFFER and XV_COLORKEY */
{
- int count, todo = 3;
+ int count, todo = 4;
XvAttribute *const attr = XvQueryPortAttributes (context->disp,
context->xv_port_id, &count);
static const char autopaint[] = "XV_AUTOPAINT_COLORKEY";
static const char dbl_buffer[] = "XV_DOUBLE_BUFFER";
static const char colorkey[] = "XV_COLORKEY";
+ static const char iturbt709[] = "XV_ITURBT_709";
GST_DEBUG ("Checking %d Xv port attributes", count);
context->have_autopaint_colorkey = FALSE;
context->have_double_buffer = FALSE;
context->have_colorkey = FALSE;
+ context->have_iturbt709 = FALSE;
for (i = 0; ((i < count) && todo); i++) {
GST_DEBUG ("Got attribute %s", attr[i].name);
@@ -230,6 +232,9 @@ gst_xvcontext_get_xv_support (GstXvContext * context,
}
todo--;
context->have_colorkey = TRUE;
+ } else if (!strcmp (attr[i].name, iturbt709)) {
+ todo--;
+ context->have_iturbt709 = TRUE;
}
}
@@ -891,6 +896,9 @@ gst_xvcontext_set_colorimetry (GstXvContext * context,
Atom prop_atom;
int xv_value;
+ if (!context->have_iturbt709)
+ return;
+
switch (colorimetry->matrix) {
case GST_VIDEO_COLOR_MATRIX_SMPTE240M:
case GST_VIDEO_COLOR_MATRIX_BT709:
diff --git a/sys/xvimage/xvcontext.h b/sys/xvimage/xvcontext.h
index 1bd0d978d..af67877af 100644
--- a/sys/xvimage/xvcontext.h
+++ b/sys/xvimage/xvcontext.h
@@ -156,6 +156,7 @@ struct _GstXvContext
gboolean have_autopaint_colorkey;
gboolean have_colorkey;
gboolean have_double_buffer;
+ gboolean have_iturbt709;
GList *formats_list;