diff --git a/ChangeLog b/ChangeLog index a11af7ec45..78008c7066 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-07-20 Andy Wingo + + * gst/videoscale/vs_image.c (vs_image_scale_nearest_YUYV): Typo + fix (?), fixes a seggie mcfalterson (#310894). + 2005-07-20 Ronald S. Bultje * ext/ogg/gstoggmux.c: (gst_ogg_mux_get_headers), diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index 9efef8356f..28130a1342 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -149,6 +149,7 @@ static GstCaps *gst_videoscale_transform_caps (GstBaseTransform * trans, GstPad * pad, GstCaps * caps); static gboolean gst_videoscale_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out); +static guint gst_videoscale_get_size (GstBaseTransform * trans); static GstFlowReturn gst_videoscale_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out); @@ -216,6 +217,7 @@ gst_videoscale_class_init (GstVideoscaleClass * klass) trans_class->transform_caps = gst_videoscale_transform_caps; trans_class->set_caps = gst_videoscale_set_caps; + trans_class->get_size = gst_videoscale_get_size; trans_class->transform = gst_videoscale_transform; parent_class = g_type_class_peek_parent (klass); @@ -418,6 +420,18 @@ gst_videoscale_prepare_sizes (GstVideoscale * videoscale, VSImage * src, return size; } +static guint +gst_videoscale_get_size (GstBaseTransform * trans) +{ + GstVideoscale *videoscale; + VSImage dest; + VSImage src; + + videoscale = GST_VIDEOSCALE (trans); + + return (guint) gst_videoscale_prepare_sizes (videoscale, &src, &dest, TRUE); +} + static void gst_videoscale_prepare_images (GstVideoscale * videoscale, GstBuffer * in, GstBuffer * out, VSImage * src, VSImage * src_u, VSImage * src_v, @@ -475,9 +489,6 @@ gst_videoscale_transform (GstBaseTransform * trans, GstBuffer * in, gst_buffer_stamp (out, in); - /* output size could have changed, prepare again */ - gst_videoscale_prepare_sizes (videoscale, &src, &dest, FALSE); - gst_videoscale_prepare_images (videoscale, in, out, &src, &src_u, &src_v, &dest, &dest_u, &dest_v); diff --git a/gst/videoscale/vs_image.c b/gst/videoscale/vs_image.c index 2efe40f416..758362a6ed 100644 --- a/gst/videoscale/vs_image.c +++ b/gst/videoscale/vs_image.c @@ -284,7 +284,7 @@ vs_image_scale_nearest_YUYV (const VSImage * dest, const VSImage * src, y_increment = ((src->height - 1) << 16) / (dest->height - 1); x_increment = ((src->width - 1) << 16) / (dest->width - 1); - n_quads = ROUND_UP_2 (dest->width); + n_quads = ROUND_UP_2 (dest->width) / 2; acc = 0; for (i = 0; i < dest->height; i++) { j = acc >> 16;