sys/xvimage/xvimagesink.c: Fix navigation events coordinates translation with pixel...
authorJulien Moutte <julien@moutte.net>
Mon, 28 Nov 2005 14:32:48 +0000 (14:32 +0000)
committerJulien Moutte <julien@moutte.net>
Mon, 28 Nov 2005 14:32:48 +0000 (14:32 +0000)
Original commit message from CVS:
2005-11-28  Julien MOUTTE  <julien@moutte.net>

* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event): Fix navigation events
coordinates translation with pixel aspect ratios.

ChangeLog
common
sys/xvimage/xvimagesink.c

index 5752de7..acb2531 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2005-11-28  Julien MOUTTE  <julien@moutte.net>
 
+       * sys/xvimage/xvimagesink.c:
+       (gst_xvimagesink_navigation_send_event): Fix navigation events
+       coordinates translation with pixel aspect ratios.
+
+2005-11-28  Julien MOUTTE  <julien@moutte.net>
+
        * 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 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit c04ad83a0c184fcd311de39371570b9e773a60d0
+Subproject commit b0b08bcd66ca385364b6f90663585b09693aec67
index 5178586..0d00da4 100644 (file)
@@ -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)) {