summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaihua Hu <jared.hu@nxp.com>2017-09-12 15:46:01 +0800
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2017-12-01 09:44:47 -0500
commitff9a4390cbd7795d43d15bedcc6781a3ca679ce1 (patch)
tree58427034f4c244c6ec5c13107e8e7aab59f7ca90
parentbeb32ab37de5a488f6f06dd1384dbb5e99ec652b (diff)
kmssink: add can-scale property
https://bugzilla.gnome.org/show_bug.cgi?id=784599
-rw-r--r--sys/kms/gstkmssink.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c
index 9415f53da..d3c1533c0 100644
--- a/sys/kms/gstkmssink.c
+++ b/sys/kms/gstkmssink.c
@@ -79,6 +79,7 @@ enum
PROP_CONNECTOR_ID,
PROP_PLANE_ID,
PROP_FORCE_MODESETTING,
+ PROP_CAN_SCALE,
PROP_N
};
@@ -525,8 +526,6 @@ gst_kms_sink_start (GstBaseSink * bsink)
if (!get_drm_caps (self))
goto bail;
- self->can_scale = TRUE;
-
res = drmModeGetResources (self->fd);
if (!res)
goto resources_failed;
@@ -1410,6 +1409,9 @@ gst_kms_sink_set_property (GObject * object, guint prop_id,
case PROP_FORCE_MODESETTING:
sink->modesetting_enabled = g_value_get_boolean (value);
break;
+ case PROP_CAN_SCALE:
+ sink->can_scale = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1440,6 +1442,9 @@ gst_kms_sink_get_property (GObject * object, guint prop_id,
case PROP_FORCE_MODESETTING:
g_value_set_boolean (value, sink->modesetting_enabled);
break;
+ case PROP_CAN_SCALE:
+ g_value_set_boolean (value, sink->can_scale);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1465,6 +1470,7 @@ gst_kms_sink_init (GstKMSSink * sink)
sink->fd = -1;
sink->conn_id = -1;
sink->plane_id = -1;
+ sink->can_scale = TRUE;
gst_poll_fd_init (&sink->pollfd);
sink->poll = gst_poll_new (TRUE);
gst_video_info_init (&sink->vinfo);
@@ -1561,6 +1567,16 @@ gst_kms_sink_class_init (GstKMSSinkClass * klass)
"When enabled, the sink try to configure the display mode", FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT);
+ /**
+ * kmssink:can-scale:
+ *
+ * User can tell kmssink if the driver can support scale.
+ */
+ g_properties[PROP_CAN_SCALE] =
+ g_param_spec_boolean ("can-scale", "can scale",
+ "User can tell kmssink if the driver can support scale", TRUE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT);
+
g_object_class_install_properties (gobject_class, PROP_N, g_properties);
}