From dad9986cb4646c0090a9c8408c1a1d9e00869ae2 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 22 Nov 2005 20:07:47 +0000 Subject: Convert to fractional framerates. Original commit message from CVS: * ext/aalib/gstaasink.c: (gst_aasink_fixate): * gst/debug/gstnavigationtest.c: (gst_navigationtest_handle_src_event): * gst/videofilter/gstvideofilter.c: (gst_videofilter_format_get_structure), (gst_videofilter_setcaps), (gst_videofilter_init): * gst/videofilter/gstvideofilter.h: Convert to fractional framerates. --- gst/debug/gstnavigationtest.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gst/debug/gstnavigationtest.c') diff --git a/gst/debug/gstnavigationtest.c b/gst/debug/gstnavigationtest.c index 9b40fc1e..220947a8 100644 --- a/gst/debug/gstnavigationtest.c +++ b/gst/debug/gstnavigationtest.c @@ -147,6 +147,12 @@ gst_navigationtest_handle_src_event (GstPad * pad, GstEvent * event) case GST_EVENT_NAVIGATION: { const GstStructure *s = gst_event_get_structure (event); + gint fps_n, fps_d; + + fps_n = gst_value_get_fraction_numerator ( + (&GST_VIDEOFILTER (navtest)->framerate)); + fps_d = gst_value_get_fraction_denominator ( + (&GST_VIDEOFILTER (navtest)->framerate)); type = gst_structure_get_string (s, "event"); if (g_str_equal (type, "mouse-move")) { @@ -157,7 +163,7 @@ gst_navigationtest_handle_src_event (GstPad * pad, GstEvent * event) gst_structure_get_double (s, "pointer_x", &click->x); gst_structure_get_double (s, "pointer_y", &click->y); - click->images_left = ceil (GST_VIDEOFILTER (navtest)->framerate); + click->images_left = (fps_n + fps_d - 1) / fps_d; /* green */ click->cy = 150; click->cu = 46; @@ -168,7 +174,7 @@ gst_navigationtest_handle_src_event (GstPad * pad, GstEvent * event) gst_structure_get_double (s, "pointer_x", &click->x); gst_structure_get_double (s, "pointer_y", &click->y); - click->images_left = ceil (GST_VIDEOFILTER (navtest)->framerate); + click->images_left = (fps_n + fps_d - 1) / fps_d; /* red */ click->cy = 76; click->cu = 85; -- cgit