mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
xvimagesink: calculate target rectangle correctly
Use the negotiated size and PAR to center the image into the target window. See https://bugzilla.gnome.org/show_bug.cgi?id=680093
This commit is contained in:
parent
17ff2b0643
commit
9572ec0481
1 changed files with 8 additions and 1 deletions
|
@ -333,10 +333,17 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink, GstBuffer * xvimage)
|
|||
}
|
||||
|
||||
if (xvimagesink->keep_aspect) {
|
||||
GstVideoRectangle s;
|
||||
|
||||
/* We take the size of the source material as it was negotiated and
|
||||
* corrected for DAR. This size can be different from the cropped size in
|
||||
* which case the image will be scaled to fit the negotiated size. */
|
||||
s.w = GST_VIDEO_SINK_WIDTH (xvimagesink);
|
||||
s.h = GST_VIDEO_SINK_HEIGHT (xvimagesink);
|
||||
dst.w = xvimagesink->render_rect.w;
|
||||
dst.h = xvimagesink->render_rect.h;
|
||||
|
||||
gst_video_sink_center_rect (src, dst, &result, TRUE);
|
||||
gst_video_sink_center_rect (s, dst, &result, TRUE);
|
||||
result.x += xvimagesink->render_rect.x;
|
||||
result.y += xvimagesink->render_rect.y;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue