summaryrefslogtreecommitdiff
path: root/src/video_out
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_out')
-rw-r--r--src/video_out/video_out_aa.c18
-rw-r--r--src/video_out/video_out_directfb.c6
-rw-r--r--src/video_out/video_out_fb.c24
-rw-r--r--src/video_out/video_out_opengl.c14
-rw-r--r--src/video_out/video_out_sdl.c5
-rw-r--r--src/video_out/video_out_syncfb.c14
-rw-r--r--src/video_out/video_out_vidix.c15
-rw-r--r--src/video_out/video_out_xshm.c24
-rw-r--r--src/video_out/video_out_xv.c5
9 files changed, 75 insertions, 50 deletions
diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c
index 92e3d87d6..48e168e38 100644
--- a/src/video_out/video_out_aa.c
+++ b/src/video_out/video_out_aa.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_aa.c,v 1.21 2002/07/12 20:19:20 f1rmb Exp $
+ * $Id: video_out_aa.c,v 1.22 2002/07/15 21:42:34 esnel Exp $
*
* video_out_aa.c, ascii-art output plugin for xine
*
@@ -128,8 +128,6 @@ static void aa_update_frame_format (vo_driver_t *this, vo_frame_t *img,
uint32_t width, uint32_t height,
int ratio_code, int format, int flags) {
- int image_size;
-
aa_frame_t *frame = (aa_frame_t *) img;
/* printf ("aa_update_format...\n"); */
@@ -157,16 +155,18 @@ static void aa_update_frame_format (vo_driver_t *this, vo_frame_t *img,
if (format == IMGFMT_YV12) {
- image_size = width * height;
- frame->vo_frame.base[0] = malloc_aligned(16,image_size, (void**) &frame->mem[0]);
- frame->vo_frame.base[1] = malloc_aligned(16,image_size/4, (void**) &frame->mem[1]);
- frame->vo_frame.base[2] = malloc_aligned(16,image_size/4, (void**) &frame->mem[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] = malloc_aligned(16, frame->vo_frame.pitches[0] * height, (void**) &frame->mem[0]);
+ frame->vo_frame.base[1] = malloc_aligned(16, frame->vo_frame.pitches[1] * ((height+1)/2), (void**) &frame->mem[1]);
+ frame->vo_frame.base[2] = malloc_aligned(16, frame->vo_frame.pitches[2] * ((height+1)/2), (void**) &frame->mem[2]);
/* printf ("allocated yuv memory for %d x %d image\n", width, height); */
} else if (format == IMGFMT_YUY2) {
- image_size = width * 2 * height;
- frame->vo_frame.base[0] = malloc_aligned(16,image_size, (void**) &frame->mem[0]);
+ frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
+ frame->vo_frame.base[0] = malloc_aligned(16, frame->vo_frame.pitches[0] * height, (void**) &frame->mem[0]);
} else {
printf ("alert! unsupported image format %04x\n", format);
abort();
diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c
index 4dba74ab6..56e9951b2 100644
--- a/src/video_out/video_out_directfb.c
+++ b/src/video_out/video_out_directfb.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_directfb.c,v 1.9 2002/06/12 12:22:38 f1rmb Exp $
+ * $Id: video_out_directfb.c,v 1.10 2002/07/15 21:42:34 esnel Exp $
*
* DirectFB based output plugin.
* Rich Wareham <richwareham@users.sourceforge.net>
@@ -303,11 +303,15 @@ static void directfb_update_frame_format (vo_driver_t *this_gen,
frame->locked = 1;
switch(frame->format) {
case IMGFMT_YV12:
+ frame->vo_frame.pitches[0] = pitch;
+ frame->vo_frame.pitches[1] = pitch/2;
+ frame->vo_frame.pitches[2] = pitch/2;
frame->vo_frame.base[0] = data;
frame->vo_frame.base[1] = data + pitch*height;
frame->vo_frame.base[2] = data + pitch*height + pitch*height/4;
break;
case IMGFMT_YUY2:
+ frame->vo_frame.pitches[0] = 2*pitch;
frame->vo_frame.base[0] = data;
frame->vo_frame.base[1] = data;
frame->vo_frame.base[2] = data;
diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c
index 3f407a401..fb37f295d 100644
--- a/src/video_out/video_out_fb.c
+++ b/src/video_out/video_out_fb.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_fb.c,v 1.12 2002/07/10 14:04:41 mroi Exp $
+ * $Id: video_out_fb.c,v 1.13 2002/07/15 21:42:34 esnel Exp $
*
* video_out_fb.c, frame buffer xine driver by Miguel Freitas
*
@@ -409,16 +409,18 @@ static void fb_update_frame_format (vo_driver_t *this_gen,
this->bytes_per_pixel );
if (format == IMGFMT_YV12) {
- int image_size = frame->width * frame->height;
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, image_size,
+ 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] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height,
(void **)&frame->chunk[0]);
- frame->vo_frame.base[1] = xine_xmalloc_aligned (16, image_size/4,
+ frame->vo_frame.base[1] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[1] * ((height+1)/2),
(void **)&frame->chunk[1]);
- frame->vo_frame.base[2] = xine_xmalloc_aligned (16, image_size/4,
+ frame->vo_frame.base[2] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[2] * ((height+1)/2),
(void **)&frame->chunk[2]);
} else {
- int image_size = frame->width * frame->height;
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, image_size*2,
+ frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
+ frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height,
(void **)&frame->chunk[0]);
frame->chunk[1] = NULL;
frame->chunk[2] = NULL;
@@ -441,8 +443,8 @@ static void fb_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->bytes_per_line*2);
@@ -452,8 +454,8 @@ static void fb_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->bytes_per_line);
diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c
index b7d376fbc..93d7c39d3 100644
--- a/src/video_out/video_out_opengl.c
+++ b/src/video_out/video_out_opengl.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_opengl.c,v 1.13 2002/07/10 14:04:41 mroi Exp $
+ * $Id: video_out_opengl.c,v 1.14 2002/07/15 21:42:34 esnel Exp $
*
* video_out_glut.c, glut based OpenGL rendering interface for xine
* Matthias Hopf <mat@mshopf.de>
@@ -358,15 +358,19 @@ static void opengl_update_frame_format (vo_driver_t *this_gen,
switch (format) {
case IMGFMT_YV12:
- frame->vo_frame.base[0] = my_malloc_aligned(16,image_size,
+ 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,image_size/4,
+ 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,image_size/4,
+ frame->vo_frame.base[2] = my_malloc_aligned(16, frame->vo_frame.pitches[2] * ((height+1)/2),
&frame->chunk[2]);
break;
case IMGFMT_YUY2:
- frame->vo_frame.base[0] = my_malloc_aligned(16,image_size*2,
+ 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]);
break;
default:
diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c
index 6123190e1..0ef1508a6 100644
--- a/src/video_out/video_out_sdl.c
+++ b/src/video_out/video_out_sdl.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_sdl.c,v 1.9 2002/07/10 14:04:41 mroi Exp $
+ * $Id: video_out_sdl.c,v 1.10 2002/07/15 21:42:34 esnel Exp $
*
* video_out_sdl.c, Simple DirectMedia Layer
*
@@ -345,6 +345,9 @@ static void sdl_update_frame_format (vo_driver_t *this_gen,
if (frame->overlay == NULL)
return;
+ frame->vo_frame.pitches[0] = frame->overlay->pitches[0];
+ frame->vo_frame.pitches[1] = frame->overlay->pitches[2];
+ frame->vo_frame.pitches[2] = frame->overlay->pitches[1];
frame->vo_frame.base[0] = frame->overlay->pixels[0];
frame->vo_frame.base[1] = frame->overlay->pixels[2];
frame->vo_frame.base[2] = frame->overlay->pixels[1];
diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c
index 2ab83e291..8fcb91e41 100644
--- a/src/video_out/video_out_syncfb.c
+++ b/src/video_out/video_out_syncfb.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_syncfb.c,v 1.72 2002/07/10 14:04:41 mroi Exp $
+ * $Id: video_out_syncfb.c,v 1.73 2002/07/15 21:42:34 esnel Exp $
*
* video_out_syncfb.c, SyncFB (for Matrox G200/G400 cards) interface for xine
*
@@ -682,13 +682,17 @@ static void syncfb_update_frame_format(vo_driver_t* this_gen,
/* frame->vo_frame.base[0] = xine_xmalloc_aligned(16, frame_size, (void **)&frame->data_mem[0]);
frame->vo_frame.base[1] = xine_xmalloc_aligned(16, frame_size/4, (void **)&frame->data_mem[1]);
frame->vo_frame.base[2] = xine_xmalloc_aligned(16, frame_size/4, (void **)&frame->data_mem[2]);*/
- frame->vo_frame.base[0] = malloc(frame_size);
- frame->vo_frame.base[1] = malloc(frame_size/4);
- frame->vo_frame.base[2] = malloc(frame_size/4);
+ 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] = malloc(frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = malloc(frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = malloc(frame->vo_frame.pitches[2] * ((height+1)/2));
break;
case IMGFMT_YUY2:
/* frame->vo_frame.base[0] = xine_xmalloc_aligned(16, (frame_size*2), (void **)&frame->data_mem[0]);*/
- frame->vo_frame.base[0] = malloc(frame_size*2);
+ frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
+ frame->vo_frame.base[0] = malloc(frame->vo_frame.pitches[0] * height);
frame->vo_frame.base[1] = NULL;
frame->vo_frame.base[2] = NULL;
break;
diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c
index 9f7ff09cd..92e29bd7c 100644
--- a/src/video_out/video_out_vidix.c
+++ b/src/video_out/video_out_vidix.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_vidix.c,v 1.6 2002/07/12 20:36:04 f1rmb Exp $
+ * $Id: video_out_vidix.c,v 1.7 2002/07/15 21:42:34 esnel Exp $
*
* video_out_vidix.c
*
@@ -558,7 +558,6 @@ static void vidix_update_frame_format (vo_driver_t *this_gen,
int ratio_code, int format, int flags) {
vidix_frame_t *frame = (vidix_frame_t *) frame_gen;
- uint32_t frame_size = width*height;
if ((frame->width != width)
|| (frame->height != height)
@@ -576,12 +575,16 @@ static void vidix_update_frame_format (vo_driver_t *this_gen,
switch(format) {
case IMGFMT_YV12:
- frame->vo_frame.base[0] = malloc(frame_size);
- frame->vo_frame.base[1] = malloc(frame_size/4);
- frame->vo_frame.base[2] = malloc(frame_size/4);
+ 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] = malloc(frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = malloc(frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = malloc(frame->vo_frame.pitches[2] * ((height+1)/2));
break;
case IMGFMT_YUY2:
- frame->vo_frame.base[0] = malloc(frame_size*2);
+ frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
+ frame->vo_frame.base[0] = malloc(frame->vo_frame.pitches[0] * height);
frame->vo_frame.base[1] = NULL;
frame->vo_frame.base[2] = NULL;
break;
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);
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index ad685093f..c6a4e3a82 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.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_xv.c,v 1.122 2002/07/10 14:04:42 mroi Exp $
+ * $Id: video_out_xv.c,v 1.123 2002/07/15 21:42:34 esnel Exp $
*
* video_out_xv.c, X11 video extension interface for xine
*
@@ -463,6 +463,9 @@ static void xv_update_frame_format (vo_driver_t *this_gen,
frame->image = create_ximage (this, &frame->shminfo, width, height, format);
+ frame->vo_frame.pitches[0] = frame->image->pitches[0];
+ frame->vo_frame.pitches[1] = frame->image->pitches[2];
+ frame->vo_frame.pitches[2] = frame->image->pitches[1];
frame->vo_frame.base[0] = frame->image->data + frame->image->offsets[0];
frame->vo_frame.base[1] = frame->image->data + frame->image->offsets[2];
frame->vo_frame.base[2] = frame->image->data + frame->image->offsets[1];