comparison libvo/vo_xv.c @ 4426:1ceadec3ea67

using the common -vm code, patch by Santi Bjar <tiarda@yahoo.es>
author arpi
date Thu, 31 Jan 2002 00:37:59 +0000
parents d8e5237af111
children df8e0f71cc3c
comparison
equal deleted inserted replaced
4425:6144f63cbaa1 4426:1ceadec3ea67
320 XvPortID xv_p; 320 XvPortID xv_p;
321 321
322 XGCValues xgcv; 322 XGCValues xgcv;
323 XSetWindowAttributes xswa; 323 XSetWindowAttributes xswa;
324 unsigned long xswamask; 324 unsigned long xswamask;
325 #ifdef HAVE_XF86VM
326 int vm=0;
327 unsigned int modeline_width, modeline_height;
328 static uint32_t vm_width;
329 static uint32_t vm_height;
330 #endif
325 331
326 aspect_save_orig(width,height); 332 aspect_save_orig(width,height);
327 aspect_save_prescale(d_width,d_height); 333 aspect_save_prescale(d_width,d_height);
328 334
329 image_height = height; 335 image_height = height;
334 mdwidth=width; 340 mdwidth=width;
335 mdheight=height; 341 mdheight=height;
336 #endif 342 #endif
337 343
338 mFullscreen=flags&1; 344 mFullscreen=flags&1;
345 if( flags&0x02 ) vm = 1;
339 num_buffers=vo_doublebuffering?NUM_BUFFERS:1; 346 num_buffers=vo_doublebuffering?NUM_BUFFERS:1;
340 347
341 if (!vo_init()) return -1; 348 if (!vo_init()) return -1;
342 349
343 aspect_save_screenres(vo_screenwidth,vo_screenheight); 350 aspect_save_screenres(vo_screenwidth,vo_screenheight);
349 hint.x = 0; 356 hint.x = 0;
350 hint.y = 0; 357 hint.y = 0;
351 hint.width = d_width; 358 hint.width = d_width;
352 hint.height = d_height; 359 hint.height = d_height;
353 aspect(&d_width,&d_height,A_NOZOOM); 360 aspect(&d_width,&d_height,A_NOZOOM);
354 361 #ifdef HAVE_XF86VM
362 if ( vm )
363 {
364 if ((d_width==0) && (d_height==0))
365 { vm_width=image_width; vm_height=image_height; }
366 else
367 { vm_width=d_width; vm_height=d_height; }
368 vo_vm_switch(vm_width, vm_height,&modeline_width, &modeline_height);
369 hint.x=(vo_screenwidth-modeline_width)/2;
370 hint.y=(vo_screenheight-modeline_height)/2;
371 hint.width=modeline_width;
372 hint.height=modeline_height;
373 }
374 else
375 #endif
355 if ( mFullscreen ) 376 if ( mFullscreen )
356 { 377 {
357 hint.width=vo_screenwidth; 378 hint.width=vo_screenwidth;
358 hint.height=vo_screenheight; 379 hint.height=vo_screenheight;
359 #ifdef X11_FULLSCREEN 380 #ifdef X11_FULLSCREEN
400 vo_x11_xinerama_move(mDisplay,mywindow); 421 vo_x11_xinerama_move(mDisplay,mywindow);
401 #endif 422 #endif
402 mygc = XCreateGC(mDisplay, mywindow, 0L, &xgcv); 423 mygc = XCreateGC(mDisplay, mywindow, 0L, &xgcv);
403 XFlush(mDisplay); 424 XFlush(mDisplay);
404 XSync(mDisplay, False); 425 XSync(mDisplay, False);
426 #ifdef HAVE_XF86VM
427 if ( vm )
428 {
429 /* Grab the mouse pointer in our window */
430 XGrabPointer(mDisplay, mywindow, True, 0,
431 GrabModeAsync, GrabModeAsync,
432 mywindow, None, CurrentTime);
433 XSetInputFocus(mDisplay, mywindow, RevertToNone, CurrentTime);
434 }
435 #endif
436
405 #ifdef HAVE_NEW_GUI 437 #ifdef HAVE_NEW_GUI
406 } 438 }
407 else 439 else
408 { 440 {
409 mywindow=vo_window; 441 mywindow=vo_window;
719 #endif 751 #endif
720 { 752 {
721 XDestroyWindow( mDisplay,mywindow ); 753 XDestroyWindow( mDisplay,mywindow );
722 } 754 }
723 for( i=0;i<num_buffers;i++ ) deallocate_xvimage( i ); 755 for( i=0;i<num_buffers;i++ ) deallocate_xvimage( i );
756 #ifdef HAVE_XF86VM
757 vo_vm_close(mDisplay);
758 #endif
759
724 } 760 }
725 761
726 static uint32_t preinit(const char *arg) 762 static uint32_t preinit(const char *arg)
727 { 763 {
728 return 0; 764 return 0;