mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
kmssink: if the plane can not scale, retry without scaling and remember
Retry the drmModeSetPlane call without scaling if the first try fails, and remember not to scale anymore. https://bugzilla.gnome.org/show_bug.cgi?id=781188
This commit is contained in:
parent
e0e1db212f
commit
9ed9c14eb5
2 changed files with 11 additions and 2 deletions
|
@ -517,6 +517,8 @@ 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;
|
||||
|
@ -1261,7 +1263,8 @@ gst_kms_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
|||
dst.w = self->hdisplay;
|
||||
dst.h = self->vdisplay;
|
||||
|
||||
gst_video_sink_center_rect (src, dst, &result, TRUE);
|
||||
retry_set_plane:
|
||||
gst_video_sink_center_rect (src, dst, &result, self->can_scale);
|
||||
|
||||
if (crop) {
|
||||
src.w = crop->width;
|
||||
|
@ -1279,8 +1282,13 @@ gst_kms_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
|||
result.x, result.y, result.w, result.h,
|
||||
/* source/cropping coordinates are given in Q16 */
|
||||
src.x << 16, src.y << 16, src.w << 16, src.h << 16);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
if (self->can_scale) {
|
||||
self->can_scale = FALSE;
|
||||
goto retry_set_plane;
|
||||
}
|
||||
goto set_plane_failed;
|
||||
}
|
||||
|
||||
sync_frame:
|
||||
/* Wait for the previous frame to complete redraw */
|
||||
|
|
|
@ -61,6 +61,7 @@ struct _GstKMSSink {
|
|||
/* capabilities */
|
||||
gboolean has_prime_import;
|
||||
gboolean has_async_page_flip;
|
||||
gboolean can_scale;
|
||||
|
||||
gboolean modesetting_enabled;
|
||||
|
||||
|
|
Loading…
Reference in a new issue