summaryrefslogtreecommitdiff
path: root/src/video_out/video_out_xshm.c
diff options
context:
space:
mode:
authorEwald Snel <esnel@users.sourceforge.net>2002-07-15 21:42:33 +0000
committerEwald Snel <esnel@users.sourceforge.net>2002-07-15 21:42:33 +0000
commit76e9bd86be57306fbf3bf607d68f9f38c04b4691 (patch)
treed66dc0bb9e7653dce6ed1b38bc3c08841c61e521 /src/video_out/video_out_xshm.c
parentfbb014bfa86dd9183d53d9f2e81ac5abfa75246c (diff)
downloadxine-lib-76e9bd86be57306fbf3bf607d68f9f38c04b4691.tar.gz
xine-lib-76e9bd86be57306fbf3bf607d68f9f38c04b4691.tar.bz2
Add 'pitch' support to video decoders (pitch != width)
CVS patchset: 2282 CVS date: 2002/07/15 21:42:33
Diffstat (limited to 'src/video_out/video_out_xshm.c')
-rw-r--r--src/video_out/video_out_xshm.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index c7fd72542..2ab6d8055 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_xshm.c,v 1.78 2002/07/10 14:04:42 mroi Exp $
+ * $Id: video_out_xshm.c,v 1.79 2002/07/15 21:42:34 esnel Exp $
*
* video_out_xshm.c, X11 shared memory extension interface for xine
*
@@ -670,13 +670,15 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
XUnlockDisplay (this->display);
if (format == IMGFMT_YV12) {
- int image_size = frame->width * frame->height;
- frame->vo_frame.base[0] = my_malloc_aligned (16, image_size, &frame->chunk[0]);
- frame->vo_frame.base[1] = my_malloc_aligned (16, image_size/4, &frame->chunk[1]);
- frame->vo_frame.base[2] = my_malloc_aligned (16, image_size/4, &frame->chunk[2]);
+ frame->vo_frame.pitches[0] = 8*((width + 7) / 8);
+ frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
+ frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
+ frame->vo_frame.base[0] = my_malloc_aligned (16, frame->vo_frame.pitches[0] * height, &frame->chunk[0]);
+ frame->vo_frame.base[1] = my_malloc_aligned (16, frame->vo_frame.pitches[1] * ((height+1)/2), &frame->chunk[1]);
+ frame->vo_frame.base[2] = my_malloc_aligned (16, frame->vo_frame.pitches[2] * ((height+1)/2), &frame->chunk[2]);
} else {
- int image_size = frame->width * frame->height;
- frame->vo_frame.base[0] = my_malloc_aligned (16, image_size*2, &frame->chunk[0]);
+ frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
+ frame->vo_frame.base[0] = my_malloc_aligned (16, frame->vo_frame.pitches[0] * height, &frame->chunk[0]);
frame->chunk[1] = NULL;
frame->chunk[2] = NULL;
}
@@ -695,8 +697,8 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
frame->yuv2rgb->configure (frame->yuv2rgb,
frame->width,
16,
- frame->width*2,
- frame->width,
+ 2*frame->vo_frame.pitches[0],
+ 2*frame->vo_frame.pitches[1],
frame->output_width,
frame->stripe_height,
frame->image->bytes_per_line*2);
@@ -706,8 +708,8 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
frame->yuv2rgb->configure (frame->yuv2rgb,
frame->width,
16,
- frame->width,
- frame->width/2,
+ frame->vo_frame.pitches[0],
+ frame->vo_frame.pitches[1],
frame->output_width,
frame->stripe_height,
frame->image->bytes_per_line);