summaryrefslogtreecommitdiffstats
path: root/libvo/vo_xmga.c
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-08 01:06:03 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-03-08 01:06:03 +0000
commit838cf97bcb165bff85a3b0f69e4bf416ecc415cf (patch)
treea9a82e31f4ab18cf35df42a5391592d54cd2d823 /libvo/vo_xmga.c
parent376833ee20e3426caee972e69bcf922486f4aaf8 (diff)
downloadmpv-838cf97bcb165bff85a3b0f69e4bf416ecc415cf.tar.bz2
mpv-838cf97bcb165bff85a3b0f69e4bf416ecc415cf.tar.xz
mga_vid fixes, code cleanup
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@57 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_xmga.c')
-rw-r--r--libvo/vo_xmga.c45
1 files changed, 12 insertions, 33 deletions
diff --git a/libvo/vo_xmga.c b/libvo/vo_xmga.c
index ee91a2e231..ca857001d0 100644
--- a/libvo/vo_xmga.c
+++ b/libvo/vo_xmga.c
@@ -53,11 +53,6 @@ static vo_info_t vo_info =
""
};
-static mga_vid_config_t mga_vid_config;
-static uint8_t * vid_data;
-static uint8_t * frames[4];
-static int f;
-
static Display * mDisplay;
static Window mWindow;
static GC mGC;
@@ -142,7 +137,7 @@ static void flip_page(void){
static uint32_t init( uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format )
{
char * frame_mem;
- uint32_t frame_size;
+// uint32_t frame_size;
int mScreen;
unsigned int fg, bg;
char * mTitle=(title == NULL) ? "XMGA render" : title;
@@ -163,8 +158,14 @@ static uint32_t init( uint32_t width, uint32_t height, uint32_t d_width, uint32_
switch(format)
{
- case IMGFMT_YV12: mga_vid_config.format=MGA_VID_FORMAT_YV12; break;
- case IMGFMT_YUY2: mga_vid_config.format=MGA_VID_FORMAT_YUY2; break;
+ case IMGFMT_YV12:
+ mga_vid_config.format=MGA_VID_FORMAT_YV12;
+ mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2;
+ break;
+ case IMGFMT_YUY2:
+ mga_vid_config.format=MGA_VID_FORMAT_YUY2;
+ mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height * 2;
+ break;
default: fprintf(stderr,"mga: invalid output format %0X\n",format); return (-1);
}
@@ -253,10 +254,10 @@ static uint32_t init( uint32_t width, uint32_t height, uint32_t d_width, uint32_
mga_vid_config.src_width=width;
mga_vid_config.src_height=height;
- mga_vid_config.x_org=drwcX;
- mga_vid_config.y_org=drwcY;
mga_vid_config.dest_width=drwWidth;
mga_vid_config.dest_height=drwHeight;
+ mga_vid_config.x_org=drwcX;
+ mga_vid_config.y_org=drwcY;
fprintf( stderr,"[xmga] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
@@ -265,30 +266,11 @@ static uint32_t init( uint32_t width, uint32_t height, uint32_t d_width, uint32_
mga_vid_config.colkey_green=0;
mga_vid_config.colkey_blue=255;
-#if 1
- if ( ioctl( f,MGA_VID_CONFIG,&mga_vid_config ) )
- {
- fprintf( stderr,"Error in mga_vid_config ioctl" );
- return -1;
- }
- ioctl( f,MGA_VID_ON,0 );
-#endif
-
- frame_size=( ( width + 31 ) & ~31 ) * height + ( ( ( width + 31 ) & ~31 ) * height ) / 2;
- frame_mem=(char*)mmap( 0,frame_size*4,PROT_WRITE,MAP_SHARED,f,0 );
- frames[0] = frame_mem;
- frames[1] = frame_mem + 1*frame_size;
- frames[2] = frame_mem + 2*frame_size;
- frames[3] = frame_mem + 3*frame_size;
- mga_next_frame=0;
- vid_data=frames[mga_next_frame];
- memset( frame_mem,0x80,frame_size * 4 );
+ if(mga_init()) return -1;
XFlush( mDisplay );
XSync( mDisplay,False );
-// vo_initthread( mThread );
-
return 0;
}
@@ -302,6 +284,3 @@ uninit(void)
ioctl( f,MGA_VID_OFF,0 );
printf("vo: uninit!\n");
}
-
-
-