mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-04 14:38:48 +00:00
glimagesink: only update the output info iff there's a valid display_rect
Attempting to use the MAX(1, display_rect) would result in the overlay composition attempting to draw into 1x1 buffer and calculate some grossly incorrect sizes. previously failing case: gltestsrc ! textoverlay text=GStreamer ! glimagesinkelement
This commit is contained in:
parent
f960beaa98
commit
57f07fcbd4
1 changed files with 21 additions and 19 deletions
|
@ -1426,8 +1426,9 @@ update_output_format (GstGLImageSink * glimage_sink)
|
||||||
* view parity properly for line-by-line modes, because that
|
* view parity properly for line-by-line modes, because that
|
||||||
* depends on the window being placed correctly.
|
* depends on the window being placed correctly.
|
||||||
* FIXME: Should this rescaling be configurable? */
|
* FIXME: Should this rescaling be configurable? */
|
||||||
new_w = MAX (1, glimage_sink->display_rect.w);
|
if (glimage_sink->display_rect.w > 0 && glimage_sink->display_rect.h > 0) {
|
||||||
new_h = MAX (1, glimage_sink->display_rect.h);
|
new_w = glimage_sink->display_rect.w;
|
||||||
|
new_h = glimage_sink->display_rect.h;
|
||||||
if (new_w != out_info->width || new_h != out_info->height) {
|
if (new_w != out_info->width || new_h != out_info->height) {
|
||||||
/* Recalculate PAR if rescaling */
|
/* Recalculate PAR if rescaling */
|
||||||
gint from_dar_n, from_dar_d;
|
gint from_dar_n, from_dar_d;
|
||||||
|
@ -1445,9 +1446,10 @@ update_output_format (GstGLImageSink * glimage_sink)
|
||||||
out_info->height = new_h;
|
out_info->height = new_h;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (glimage_sink, "Set 3D output scale to %d,%d PAR %d/%d",
|
GST_LOG_OBJECT (glimage_sink, "Set 3D output scale to %dx%d PAR %d/%d",
|
||||||
out_info->width, out_info->height, out_info->par_n, out_info->par_d);
|
out_info->width, out_info->height, out_info->par_n, out_info->par_d);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
s = gst_caps_get_structure (glimage_sink->in_caps, 0);
|
s = gst_caps_get_structure (glimage_sink->in_caps, 0);
|
||||||
target_str = gst_structure_get_string (s, "texture-target");
|
target_str = gst_structure_get_string (s, "texture-target");
|
||||||
|
|
Loading…
Reference in a new issue