summaryrefslogtreecommitdiffstats
path: root/libvo/vosub_vidix.c
diff options
context:
space:
mode:
authornick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-31 08:53:58 +0000
committernick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-31 08:53:58 +0000
commit5b6b17489f7a4b5c9ec094c79b3cc72fe4b26d7e (patch)
treec8cd35dd9f70f8d8efddfa63bd828196e84c576e /libvo/vosub_vidix.c
parent2db1bb26e843bb397f020f7cf16e767e33c624bd (diff)
downloadmpv-5b6b17489f7a4b5c9ec094c79b3cc72fe4b26d7e.tar.bz2
mpv-5b6b17489f7a4b5c9ec094c79b3cc72fe4b26d7e.tar.xz
IMGFMT_RGBxx experimental support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4431 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vosub_vidix.c')
-rw-r--r--libvo/vosub_vidix.c81
1 files changed, 79 insertions, 2 deletions
diff --git a/libvo/vosub_vidix.c b/libvo/vosub_vidix.c
index 196d58096b..a921fe4430 100644
--- a/libvo/vosub_vidix.c
+++ b/libvo/vosub_vidix.c
@@ -259,7 +259,7 @@ void vidix_term( void )
vdlClose(vidix_handler);
}
-uint32_t vidix_draw_slice_420(uint8_t *image[], int stride[], int w,int h,int x,int y)
+static uint32_t vidix_draw_slice_420(uint8_t *image[], int stride[], int w,int h,int x,int y)
{
uint8_t *src;
uint8_t *dest;
@@ -313,7 +313,7 @@ uint32_t vidix_draw_slice_420(uint8_t *image[], int stride[], int w,int h,int x,
return 0;
}
-uint32_t vidix_draw_slice_422(uint8_t *image[], int stride[], int w,int h,int x,int y)
+static uint32_t vidix_draw_slice_422(uint8_t *image[], int stride[], int w,int h,int x,int y)
{
uint8_t *src;
uint8_t *dest;
@@ -333,6 +333,45 @@ uint32_t vidix_draw_slice_422(uint8_t *image[], int stride[], int w,int h,int x,
return 0;
}
+static uint32_t vidix_draw_slice_32(uint8_t *image[], int stride[], int w,int h,int x,int y)
+{
+ uint8_t *src;
+ uint8_t *dest;
+ unsigned bespitch,apitch;
+ int i;
+ apitch = vidix_play.dest.pitch.y-1;
+ bespitch = (w*4 + apitch) & ~apitch;
+ dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y;
+ dest += bespitch*y + x;
+ src = image[0];
+ for(i=0;i<h;i++){
+ memcpy(dest,src,w*4);
+ src+=stride[0];
+ dest += bespitch;
+ }
+
+ return 0;
+}
+
+static uint32_t vidix_draw_slice_24(uint8_t *image[], int stride[], int w,int h,int x,int y)
+{
+ uint8_t *src;
+ uint8_t *dest;
+ unsigned bespitch,apitch;
+ int i;
+ apitch = vidix_play.dest.pitch.y-1;
+ bespitch = (w*3 + apitch) & ~apitch;
+ dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y;
+ dest += bespitch*y + x;
+ src = image[0];
+ for(i=0;i<h;i++){
+ memcpy(dest,src,w*3);
+ src+=stride[0];
+ dest += bespitch;
+ }
+
+ return 0;
+}
uint32_t vidix_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y)
{
@@ -340,6 +379,12 @@ uint32_t vidix_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int
if(src_format == IMGFMT_YV12 || src_format == IMGFMT_I420 || src_format == IMGFMT_IYUV)
vidix_draw_slice_420(image,stride,w,h,x,y);
else
+ if(src_format == IMGFMT_RGB32 || src_format == IMGFMT_BGR32)
+ vidix_draw_slice_32(image,stride,w,h,x,y);
+ else
+ if(src_format == IMGFMT_RGB24 || src_format == IMGFMT_BGR24)
+ vidix_draw_slice_24(image,stride,w,h,x,y);
+ else
vidix_draw_slice_422(image,stride,w,h,x,y);
return 0;
}
@@ -355,6 +400,22 @@ uint32_t vidix_draw_frame(uint8_t *image[])
exit( EXIT_FAILURE );
}
else
+ if(src_format == IMGFMT_RGB32 || src_format == IMGFMT_BGR32)
+ {
+ int stride[1];
+ stride[0] = vidix_play.src.w*4;
+ vidix_draw_slice_32(image,stride,vidix_play.src.w,vidix_play.src.h,
+ vidix_play.src.x,vidix_play.src.y);
+ }
+ else
+ if(src_format == IMGFMT_RGB24 || src_format == IMGFMT_BGR24)
+ {
+ int stride[1];
+ stride[0] = vidix_play.src.w*3;
+ vidix_draw_slice_24(image,stride,vidix_play.src.w,vidix_play.src.h,
+ vidix_play.src.x,vidix_play.src.y);
+ }
+ else
{
int stride[1];
stride[0] = vidix_play.src.w*2;
@@ -404,6 +465,22 @@ static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned
case IMGFMT_UYVY:
vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+2*(bespitch*y0+x0)+1,2*bespitch);
break;
+ case IMGFMT_RGB32:
+ case IMGFMT_BGR32:
+ vo_draw_alpha_rgb32(w,h,src,srca,stride,lvo_mem+4*(y0*bespitch+x0),4*bespitch);
+ break;
+ case IMGFMT_RGB24:
+ case IMGFMT_BGR24:
+ vo_draw_alpha_rgb24(w,h,src,srca,stride,lvo_mem+3*(y0*bespitch+x0),3*bespitch);
+ break;
+ case IMGFMT_RGB16:
+ case IMGFMT_BGR16:
+ vo_draw_alpha_rgb16(w,h,src,srca,stride,lvo_mem+2*(y0*bespitch+x0),2*bespitch);
+ break;
+ case IMGFMT_RGB15:
+ case IMGFMT_BGR15:
+ vo_draw_alpha_rgb15(w,h,src,srca,stride,lvo_mem+2*(y0*bespitch+x0),2*bespitch);
+ break;
default:
draw_alpha_null(x0,y0,w,h,src,srca,stride);
}