summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-01-23 11:44:53 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2009-01-23 11:44:53 +0100
commite327bbcd7dfdb2a450aad4731b61c45a4421bcff (patch)
treec240de838e78432994d2934078b6fb42de572ac4 /sys
parentcc8b9ae5e8d11d16f313cde3a74bd871052a9dec (diff)
Add some more debugging to the Xv strides
Add some more debugging to the strides as they are received from the server and the expected strides.
Diffstat (limited to 'sys')
-rw-r--r--sys/xvimage/xvimagesink.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c
index 2ba44ea6..d350633b 100644
--- a/sys/xvimage/xvimagesink.c
+++ b/sys/xvimage/xvimagesink.c
@@ -583,12 +583,26 @@ gst_xvimagesink_xvimage_new (GstXvImageSink * xvimagesink, GstCaps * caps)
switch (xvimage->im_format) {
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
- expected_size =
- GST_ROUND_UP_2 (xvimage->height) * GST_ROUND_UP_4 (xvimage->width);
- expected_size +=
- GST_ROUND_UP_2 (xvimage->height) * GST_ROUND_UP_8 (xvimage->width) /
- 2;
+ {
+ gint pitches[3];
+ gint offsets[3];
+ guint plane;
+
+ offsets[0] = 0;
+ pitches[0] = GST_ROUND_UP_4 (xvimage->width);
+ offsets[1] = offsets[0] + pitches[0] * GST_ROUND_UP_2 (xvimage->height);
+ pitches[1] = GST_ROUND_UP_8 (xvimage->width) / 2;
+ offsets[2] = offsets[1] + pitches[1] * GST_ROUND_UP_2 (xvimage->height) / 2;
+ pitches[2] = GST_ROUND_UP_8 (pitches[0]) / 2;
+
+ expected_size = offsets[2] + pitches[2] * GST_ROUND_UP_2 (xvimage->height) / 2;
+
+ for (plane = 0; plane < xvimage->xvimage->num_planes; plane++) {
+ GST_DEBUG_OBJECT (xvimagesink, "Plane %u has a expected pitch of %d bytes, "
+ "offset of %d", plane, pitches[plane], offsets[plane]);
+ }
break;
+ }
case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'):
expected_size = xvimage->height * GST_ROUND_UP_4 (xvimage->width * 2);