[Mplayer-cvslog] CVS: main/libvo vo_xv.c,1.76,1.77
Alban Bedel CVS
albeu at mplayerhq.hu
Thu May 2 12:48:25 CEST 2002
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv28299/libvo
Modified Files:
vo_xv.c
Log Message:
printf to mp_msg
Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- vo_xv.c 25 Apr 2002 21:52:47 -0000 1.76
+++ vo_xv.c 2 May 2002 10:48:22 -0000 1.77
@@ -22,6 +22,7 @@
#include <string.h>
#include "config.h"
+#include "mp_msg.h"
#include "video_out.h"
#include "video_out_internal.h"
@@ -79,7 +80,7 @@
#include <X11/extensions/XShm.h>
static int Shmem_Flag;
-static int Quiet_Flag;
+//static int Quiet_Flag; <-- What is that for ? Albeu.
static XShmSegmentInfo Shminfo[NUM_BUFFERS];
static int gXErrorFlag;
static int CompletionType = -1;
@@ -125,7 +126,7 @@
if (attributes[i].flags & XvSettable && !strcmp(attributes[i].name,"XV_SET_DEFAULTS"
))
{
was_reset = 1;
- if(verbose > 1) printf("vo_xv: reset gamma correction\n");
+ mp_msg(MSGT_VO,MSGL_V,"vo_xv: reset gamma correction\n");
xv_atomka = XInternAtom(mDisplay, attributes[i].name, True);
XvSetPortAttribute(mDisplay, xv_port, xv_atomka, attributes[i].max_value);
}
@@ -181,8 +182,7 @@
port_max = xv_max;
port_mid = (port_min + port_max) / 2;
port_value = port_mid + (port_value * (port_max - port_min)) / 2000;
- if(verbose > 1)
- printf("vo_xv: set gamma %s to %i (min %i max %i mid %i)\n",attributes[i].name,port_value,port_min,port_max,port_mid);
+ mp_msg(MSGT_VO,MSGL_V,"vo_xv: set gamma %s to %i (min %i max %i mid %i)\n",attributes[i].name,port_value,port_min,port_max,port_mid);
XvSetPortAttribute(mDisplay, xv_port, xv_atomka, port_value);
}
}
@@ -216,14 +216,14 @@
{
int port_value,port_min,port_max,port_mid;
XvGetPortAttribute(mDisplay, xv_port, xv_atomka, &port_value);
- if(verbose>1) printf("vo_xv: get: %s = %i\n",attributes[i].name,port_value);
+ mp_msg(MSGT_VO,MSGL_V,"vo_xv: get: %s = %i\n",attributes[i].name,port_value);
port_min = xv_min;
port_max = xv_max;
port_mid = (port_min + port_max) / 2;
port_value = ((port_value - port_mid)*2000)/(port_max-port_min);
- if(verbose>1) printf("vo_xv: assume: %s = %i\n",attributes[i].name,port_value);
+ mp_msg(MSGT_VO,MSGL_V,"vo_xv: assume: %s = %i\n",attributes[i].name,port_value);
if(strcmp(attributes[i].name,"XV_BRIGHTNESS") == 0)
{
@@ -345,7 +345,7 @@
xv_format=0;
if(format==IMGFMT_BGR24) format=IMGFMT_YV12;
for(i = 0; i < formats; i++){
- printf("Xvideo image format: 0x%x (%4.4s) %s\n", fo[i].id,(char*)&fo[i].id, (fo[i].format == XvPacked) ? "packed" : "planar");
+ mp_msg(MSGT_VO,MSGL_V,"Xvideo image format: 0x%x (%4.4s) %s\n", fo[i].id,(char*)&fo[i].id, (fo[i].format == XvPacked) ? "packed" : "planar");
if (fo[i].id == format) xv_format = fo[i].id;
}
if (!xv_format) return -1;
@@ -446,7 +446,7 @@
}
#endif
- printf( "using Xvideo port %d for hw scaling\n",xv_port );
+ mp_msg(MSGT_VO,MSGL_V, "using Xvideo port %d for hw scaling\n",xv_port );
switch (xv_format){
case IMGFMT_YV12:
@@ -468,7 +468,7 @@
XGetGeometry( mDisplay,vo_window,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth );
drwX=0; drwY=0;
XTranslateCoordinates( mDisplay,vo_window,mRoot,0,0,&drwcX,&drwcY,&mRoot );
- printf( "[xv] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
+ mp_msg(MSGT_VO,MSGL_V, "[xv] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
aspect(&dwidth,&dheight,A_NOZOOM);
if ( vo_fs )
@@ -480,7 +480,7 @@
drwcY+=drwY;
drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth);
drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight);
- printf( "[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
+ mp_msg(MSGT_VO,MSGL_V, "[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
}
saver_off(mDisplay); // turning off screen saver
return 0;
@@ -499,7 +499,7 @@
else
{
Shmem_Flag = 0;
- if ( !Quiet_Flag ) printf( "Shared memory not supported\nReverting to normal Xv\n" );
+ mp_msg(MSGT_VO,MSGL_INFO, "Shared memory not supported\nReverting to normal Xv\n" );
}
if ( Shmem_Flag )
{
@@ -550,7 +550,7 @@
XGetGeometry( mDisplay,vo_window,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth );
drwX=0; drwY=0;
XTranslateCoordinates( mDisplay,vo_window,mRoot,0,0,&drwcX,&drwcY,&mRoot );
- printf( "[xv] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
+ mp_msg(MSGT_VO,MSGL_V, "[xv] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
aspect(&dwidth,&dheight,A_NOZOOM);
if ( vo_fs )
@@ -562,7 +562,7 @@
drwcY+=drwY;
drwWidth=(dwidth > vo_screenwidth?vo_screenwidth:dwidth);
drwHeight=(dheight > vo_screenheight?vo_screenheight:dheight);
- printf( "[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
+ mp_msg(MSGT_VO,MSGL_V, "[xv-fs] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
}
}
if ( e & VO_EVENT_EXPOSE )
@@ -796,7 +796,7 @@
XvPortID xv_p;
if(arg)
{
- printf("vo_xv: Unknown subdevice: %s\n",arg);
+ mp_msg(MSGT_VO,MSGL_ERR,"vo_xv: Unknown subdevice: %s\n",arg);
return ENOSYS;
}
if (!vo_init()) return -1;
@@ -804,30 +804,31 @@
xv_port = 0;
/* check for Xvideo extension */
if (Success != XvQueryExtension(mDisplay,&ver,&rel,&req,&ev,&err)){
- printf("Sorry, Xv not supported by this X11 version/driver\n");
- printf("******** Try with -vo x11 or -vo sdl *********\n");
+ mp_msg(MSGT_VO,MSGL_ERR,"Sorry, Xv not supported by this X11 version/driver\n");
+ mp_msg(MSGT_VO,MSGL_ERR,"******** Try with -vo x11 or -vo sdl *********\n");
return -1;
}
/* check for Xvideo support */
if (Success != XvQueryAdaptors(mDisplay,DefaultRootWindow(mDisplay), &adaptors,&ai)){
- printf("Xv: XvQueryAdaptors failed");
+ mp_msg(MSGT_VO,MSGL_ERR,"Xv: XvQueryAdaptors failed");
return -1;
}
/* check adaptors */
for (i = 0; i < adaptors && xv_port == 0; i++){
- if ((ai[i].type & XvInputMask) && (ai[i].type & XvImageMask))
+ if ((ai[i].type & XvInputMask) && (ai[i].type & XvImageMask)) {
for (xv_p = ai[i].base_id; xv_p < ai[i].base_id+ai[i].num_ports; ++xv_p)
if (!XvGrabPort(mDisplay, xv_p, CurrentTime)) {
xv_port = xv_p;
break;
} else {
- printf("Xv: could not grab port %i\n", (int)xv_p);
+ mp_msg(MSGT_VO,MSGL_ERR,"Xv: could not grab port %i\n", (int)xv_p);
}
+ }
}
if(!xv_port){
- printf("Couldn't find free Xvideo port - maybe other applications keep open it\n");
+ mp_msg(MSGT_VO,MSGL_ERR,"Couldn't find free Xvideo port - maybe other applications keep open it\n");
return -1;
}
More information about the MPlayer-cvslog
mailing list