summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThijs Vermeir <thijsvermeir@gmail.com>2008-05-22 18:30:15 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-05-22 18:30:15 +0000
commit88b1e8efcf776d5e1800e843b4251ab3520dbc70 (patch)
tree823a13555d7f7c636f30f89633af0a884457b95c
parent1c424d9d931a72b3d4a46be9a1e5ed27303f7b7d (diff)
downloadgstreamer-plugins-base-88b1e8efcf776d5e1800e843b4251ab3520dbc70.tar.gz
gst/videotestsrc/videotestsrc.c: Fix generation of NV12/NV21 frames. Fixes bug #532454.
Original commit message from CVS: Patch by: Thijs Vermeir <thijsvermeir@gmail.com> * gst/videotestsrc/videotestsrc.c: (paint_hline_NV12_NV21): Fix generation of NV12/NV21 frames. Fixes bug #532454.
-rw-r--r--ChangeLog7
-rw-r--r--gst/videotestsrc/videotestsrc.c13
2 files changed, 15 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index a785bf535..d3953bf2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-05-22 Sebastian Dröge <slomo@circular-chaos.org>
+
+ Patch by: Thijs Vermeir <thijsvermeir@gmail.com>
+
+ * gst/videotestsrc/videotestsrc.c: (paint_hline_NV12_NV21):
+ Fix generation of NV12/NV21 frames. Fixes bug #532454.
+
2008-05-22 Wim Taymans <wim.taymans@collabora.co.uk>
Patch by: Sjoerd Simons <sjoerd at luon dot net>
diff --git a/gst/videotestsrc/videotestsrc.c b/gst/videotestsrc/videotestsrc.c
index 6e85b820f..32a2cced3 100644
--- a/gst/videotestsrc/videotestsrc.c
+++ b/gst/videotestsrc/videotestsrc.c
@@ -1070,14 +1070,17 @@ paint_hline_I420 (paintinfo * p, int x, int y, int w)
static void
paint_hline_NV12_NV21 (paintinfo * p, int x, int y, int w)
{
- int x1 = x / 2;
- int x2 = (x + w) / 2;
+ int x1 = GST_ROUND_UP_2 (x) / 2;
+ int x2 = GST_ROUND_UP_2 (x + w) / 2;
int offset = y * p->ystride;
- int offsetuv = (y / 2) * p->ustride + x;
+ int offsetuv = GST_ROUND_UP_2 ((y / 2) * p->ustride + x);
+ int uvlength = x2 - x1;
oil_splat_u8_ns (p->yp + offset + x, &p->color->Y, w);
- oil_splat_u8 (p->up + offsetuv, 2, &p->color->U, x2 - x1);
- oil_splat_u8 (p->vp + offsetuv, 2, &p->color->V, x2 - x1);
+ if (uvlength) {
+ oil_splat_u8 (p->up + offsetuv, 2, &p->color->U, x2 - x1);
+ oil_splat_u8 (p->vp + offsetuv, 2, &p->color->V, x2 - x1);
+ }
}
static void