[Mplayer-cvslog] CVS: main/libvo vo_tdfxfb.c,1.12,1.13
JALH CVS (Mark Zealey)
mark at mplayer.dev.hu
Sat Apr 13 12:04:35 CEST 2002
Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv13113/libvo
Modified Files:
vo_tdfxfb.c
Log Message:
Misc cleanups of the code
Index: vo_tdfxfb.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_tdfxfb.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- vo_tdfxfb.c 13 Apr 2002 00:14:59 -0000 1.12
+++ vo_tdfxfb.c 13 Apr 2002 10:04:22 -0000 1.13
@@ -14,6 +14,7 @@
* as the background, or not.
* 13/04/02: Fix rough OSD stuff by rendering it straight onto the output
* buffer. Added double-buffering. Supports hardware zoom/reduce zoom modes.
+ * 13/04/02: Misc cleanups of the code.
*
* Hints and tricks:
* - Use -dr to get direct rendering
@@ -62,8 +63,6 @@
char V[0x0100000];
};
-extern int verbose;
-
static int fd;
static struct fb_fix_screeninfo fb_finfo;
static struct fb_var_screeninfo fb_vinfo;
@@ -162,9 +161,11 @@
}
/* Setup output screen dimensions etc */
-static uint32_t setup_screen(uint32_t full)
+static void setup_screen(uint32_t full)
{
- if(full) { /* Full screen */
+ fs = full;
+
+ if(fs) { /* Full screen */
double ratio = (double)in_width / in_height;
vidwidth = screenwidth;
vidheight = screenheight;
@@ -177,26 +178,20 @@
vidx = (screenwidth - vidwidth) / 2;
vidy = (screenheight - vidheight) / 2;
} else { /* Reset to normal size */
- if(r_width > screenwidth || r_height > screenheight) {
- printf("tdfxfb: your resolution is too small to play the movie...\n");
- return -1;
- }
+ if(r_width > screenwidth || r_height > screenheight)
+ printf("tdfxfb: your resolution is too small to display "
+ "the whole movie...\n");
vidwidth = r_width;
vidheight = r_height;
- vidx = 0;
- vidy = 0;
+ vidx = vidy = 0;
}
clear_screen();
-
- fs = full;
-
- return 0;
}
static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height,
- uint32_t flags, char *title, uint32_t format,const vo_tune_info_t *info)
+ uint32_t flags, char *title, uint32_t format, const vo_tune_info_t *info)
{
screenwidth = fb_vinfo.xres;
screenheight = fb_vinfo.yres;
@@ -275,9 +270,8 @@
if(vo_doublebuffering) {
vidpageoffset = screenwidth * screenheight * screendepth;
hidpageoffset = vidpageoffset + screenwidth * screenheight * screendepth;
- } else {
+ } else
vidpageoffset = hidpageoffset = 0; /* Console background */
- }
inpageoffset = hidpageoffset + screenwidth * screenheight * screendepth;
@@ -290,8 +284,7 @@
hidpage = (void *)memBase1 + (unsigned long)hidpageoffset;
inpage = (void *)memBase1 + (unsigned long)inpageoffset;
- if(setup_screen(flags & VOFLAG_FULLSCREEN) == -1)
- return -1;
+ setup_screen(flags & VOFLAG_FULLSCREEN);
memset(inpage, 0, in_width * in_height * in_depth);
@@ -396,7 +389,6 @@
static uint32_t draw_frame(uint8_t *src[])
{
mem2agpcpy(inpage, src[0], in_width * in_depth * in_height);
-
return 0;
}
@@ -412,22 +404,17 @@
mem2agpcpy_pic(YUV->Y, i[0], s[0], h , YUV_STRIDE, s[0]);
mem2agpcpy_pic(YUV->U, i[1], s[1], h / 2, YUV_STRIDE, s[1]);
mem2agpcpy_pic(YUV->V, i[2], s[2], h / 2, YUV_STRIDE, s[2]);
-
return 0;
}
-/* Attempt to start doing DR (Copied mostly from mga_common.c) */
+/* Attempt to start doing DR */
static uint32_t get_image(mp_image_t *mpi)
{
static int enabled = 0;
- if(!enabled) {
- if(mpi->flags & MP_IMGFLAG_READABLE) /* slow video ram */
+ if(!enabled && mpi->flags & MP_IMGFLAG_READABLE) /* slow video ram */
return VO_FALSE;
- /* More one-time only checks go here */
- }
-
switch(in_format) {
case IMGFMT_YUY2:
case IMGFMT_BGR16:
@@ -456,7 +443,6 @@
if(!enabled) {
printf("tdfxfb: get_image() SUCCESS -> Direct Rendering ENABLED\n");
-
enabled = 1;
}
@@ -488,7 +474,8 @@
return 0; /* Not supported */
case VOCTRL_FULLSCREEN:
- return setup_screen(!fs);
+ setup_screen(!fs);
+ return 0;
}
return VO_NOTIMPL;
More information about the MPlayer-cvslog
mailing list