From 0767718887a63d09429722faf1c1a6c7ca66de6f Mon Sep 17 00:00:00 2001 From: Julien Moutte Date: Mon, 28 Nov 2005 14:32:48 +0000 Subject: [PATCH] sys/xvimage/xvimagesink.c: Fix navigation events coordinates translation with pixel aspect ratios. Original commit message from CVS: 2005-11-28 Julien MOUTTE * sys/xvimage/xvimagesink.c: (gst_xvimagesink_navigation_send_event): Fix navigation events coordinates translation with pixel aspect ratios. --- ChangeLog | 6 ++++++ common | 2 +- sys/xvimage/xvimagesink.c | 8 ++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5752de7..acb2531 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2005-11-28 Julien MOUTTE + * sys/xvimage/xvimagesink.c: + (gst_xvimagesink_navigation_send_event): Fix navigation events + coordinates translation with pixel aspect ratios. + +2005-11-28 Julien MOUTTE + * sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put): Use calculated video geometry from _setcaps instead of buffer caps to respect pixel aspect ratio. (fixes #322388) diff --git a/common b/common index c04ad83..b0b08bc 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit c04ad83a0c184fcd311de39371570b9e773a60d0 +Subproject commit b0b08bcd66ca385364b6f90663585b09693aec67 diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 5178586..0d00da4 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -1884,6 +1884,8 @@ gst_xvimagesink_navigation_send_event (GstNavigation * navigation, return; } + /* We get the frame position using the calculated geometry from _setcaps + that respect pixel aspect ratios */ src.w = GST_VIDEO_SINK_WIDTH (xvimagesink); src.h = GST_VIDEO_SINK_HEIGHT (xvimagesink); dst.w = xvimagesink->xwindow->width; @@ -1899,8 +1901,10 @@ gst_xvimagesink_navigation_send_event (GstNavigation * navigation, result.h = dst.h; } - xscale = (gdouble) GST_VIDEO_SINK_WIDTH (xvimagesink) / result.w; - yscale = (gdouble) GST_VIDEO_SINK_HEIGHT (xvimagesink) / result.h; + /* We calculate scaling using the original video frames geometry to include + pixel aspect ratio scaling. */ + xscale = (gdouble) xvimagesink->video_width / result.w; + yscale = (gdouble) xvimagesink->video_height / result.h; /* Converting pointer coordinates to the non scaled geometry */ if (gst_structure_get_double (structure, "pointer_x", &x)) { -- 2.7.4