From 20c7083ccdb9f873c5635b0f5444d8f7c88085d2 Mon Sep 17 00:00:00 2001 From: Julien Moutte Date: Thu, 24 Nov 2005 12:50:28 +0000 Subject: gst/: Handle strides correctly, fix identity flipping, convert navigation event correctly again. Original commit message from CVS: 2005-11-24 Julien MOUTTE * gst/debug/gstnavigationtest.c: (draw_box_planar411): * gst/videofilter/gstvideoflip.c: (gst_videoflip_method_get_type), (gst_videoflip_set_caps), (gst_videoflip_transform_caps), (gst_videoflip_get_unit_size), (gst_videoflip_flip), (gst_videoflip_transform), (gst_videoflip_handle_src_event), (gst_videoflip_set_property), (gst_videoflip_base_init), (gst_videoflip_class_init), (gst_videoflip_init): Handle strides correctly, fix identity flipping, convert navigation event correctly again. --- gst/debug/gstnavigationtest.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'gst/debug/gstnavigationtest.c') diff --git a/gst/debug/gstnavigationtest.c b/gst/debug/gstnavigationtest.c index a88583b5..c0339727 100644 --- a/gst/debug/gstnavigationtest.c +++ b/gst/debug/gstnavigationtest.c @@ -169,6 +169,7 @@ draw_box_planar411 (guint8 * dest, int width, int height, int x, int y, guint8 colory, guint8 coloru, guint8 colorv) { int x1, x2, y1, y2; + guint8 *d = dest; if (x < 0 || y < 0 || x >= width || y >= height) return; @@ -180,27 +181,25 @@ draw_box_planar411 (guint8 * dest, int width, int height, int x, int y, for (y = y1; y < y2; y++) { for (x = x1; x < x2; x++) { - ((guint8 *) dest)[y * width + x] = colory; + ((guint8 *) d)[y * GST_VIDEO_I420_Y_ROWSTRIDE (width) + x] = colory; } } - dest += height * width; - width /= 2; - height /= 2; + d = dest + GST_VIDEO_I420_U_OFFSET (width, height); x1 /= 2; x2 /= 2; y1 /= 2; y2 /= 2; for (y = y1; y < y2; y++) { for (x = x1; x < x2; x++) { - ((guint8 *) dest)[y * width + x] = coloru; + ((guint8 *) d)[y * GST_VIDEO_I420_U_ROWSTRIDE (width) + x] = coloru; } } - dest += height * width; + d = dest + GST_VIDEO_I420_V_OFFSET (width, height); for (y = y1; y < y2; y++) { for (x = x1; x < x2; x++) { - ((guint8 *) dest)[y * width + x] = colorv; + ((guint8 *) d)[y * GST_VIDEO_I420_V_ROWSTRIDE (width) + x] = colorv; } } } -- cgit