diff options
author | Jan Schmidt <thaytan@mad.scientist.com> | 2008-04-07 22:37:26 +0000 |
---|---|---|
committer | Jan Schmidt <thaytan@mad.scientist.com> | 2008-04-07 22:37:26 +0000 |
commit | cd933152c7cb45343df4b253370091f68d86a419 (patch) | |
tree | e1dde0736d02f97dd1b91aecc60c26c408288d30 /sys | |
parent | de732ef41f2fbfc3a2b1d14c148f4de4cccc9ebd (diff) |
Fix calculation of 'expected size' for YV12 buffers.
Original commit message from CVS:
2008-04-07 Jan Schmidt <jan.schmidt@sun.com>
* sys/xvimage/xvimagesink.c (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_buffer_alloc):
Fix calculation of 'expected size' for YV12 buffers.
Be a little more verbose in the debug output for buffer-alloc'ed
buffers which turn out to have the wrong size.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/xvimage/xvimagesink.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index a3a490f7..76290b35 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -579,6 +579,7 @@ gst_xvimagesink_xvimage_new (GstXvImageSink * xvimagesink, GstCaps * caps) * number we get from X. */ 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 += @@ -586,7 +587,6 @@ gst_xvimagesink_xvimage_new (GstXvImageSink * xvimagesink, GstCaps * caps) 2; break; case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'): expected_size = xvimage->height * GST_ROUND_UP_4 (xvimage->width * 2); break; @@ -2266,9 +2266,9 @@ gst_xvimagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size, goto reuse_last_caps; } - GST_DEBUG_OBJECT (xvimagesink, "buffer alloc requested with caps %" - GST_PTR_FORMAT ", intersecting with our caps %" GST_PTR_FORMAT, caps, - xvimagesink->xcontext->caps); + GST_DEBUG_OBJECT (xvimagesink, "buffer alloc requested size %d with caps %" + GST_PTR_FORMAT ", intersecting with our caps %" GST_PTR_FORMAT, size, + caps, xvimagesink->xcontext->caps); /* Check the caps against our xcontext */ intersection = gst_caps_intersect (xvimagesink->xcontext->caps, caps); @@ -2387,6 +2387,8 @@ reuse_last_caps: xvimage = gst_xvimagesink_xvimage_new (xvimagesink, intersection); if (xvimage && xvimage->size < size) { /* This image is unusable. Destroying... */ + GST_LOG_OBJECT (xvimagesink, "Discarding allocated buffer as unsuitable. " + "Falling back to normal buffer"); gst_xvimage_buffer_free (xvimage); xvimage = NULL; } |