comparison libvo/vo_x11.c @ 7683:2f802d9323de

- implemented draw_image() - removed unneeded if(!gui) from preinit
author arpi
date Wed, 09 Oct 2002 20:32:41 +0000
parents 56ea9db91251
children 39e62d6592ca
comparison
equal deleted inserted replaced
7682:71758531a52d 7683:2f802d9323de
1
2 /*
3 * video_out_x11.c,X11 interface
4 *
5 *
6 * Copyright ( C ) 1996,MPEG Software Simulation Group. All Rights Reserved.
7 *
8 * Hacked into mpeg2dec by
9 *
10 * Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
11 *
12 * 15 & 16 bpp support added by Franck Sicard <Franck.Sicard@solsoft.fr>
13 * use swScaler instead of lots of tricky converters by Michael Niedermayer <michaelni@gmx.at>
14 * runtime fullscreen switching by alex
15 *
16 */
17 1
18 #include <stdio.h> 2 #include <stdio.h>
19 #include <stdlib.h> 3 #include <stdlib.h>
20 #include <string.h> 4 #include <string.h>
21 #include <signal.h> 5 #include <signal.h>
529 } 513 }
530 return 0; 514 return 0;
531 } 515 }
532 516
533 static uint32_t draw_frame( uint8_t *src[] ){ 517 static uint32_t draw_frame( uint8_t *src[] ){
518 #if 0
534 int stride[3]= {0,0,0}; 519 int stride[3]= {0,0,0};
535 520
536 if (in_format==IMGFMT_YUY2) stride[0]=srcW*2; 521 if (in_format==IMGFMT_YUY2) stride[0]=srcW*2;
537 else if(in_format==IMGFMT_BGR8) stride[0]=srcW; 522 else if(in_format==IMGFMT_BGR8) stride[0]=srcW;
538 else if(in_format==IMGFMT_BGR15) stride[0]=srcW*2; 523 else if(in_format==IMGFMT_BGR15) stride[0]=srcW*2;
539 else if(in_format==IMGFMT_BGR16) stride[0]=srcW*2; 524 else if(in_format==IMGFMT_BGR16) stride[0]=srcW*2;
540 else if(in_format==IMGFMT_BGR24) stride[0]=srcW*3; 525 else if(in_format==IMGFMT_BGR24) stride[0]=srcW*3;
541 else if(in_format==IMGFMT_BGR32) stride[0]=srcW*4; 526 else if(in_format==IMGFMT_BGR32) stride[0]=srcW*4;
542 527
543 return draw_slice(src, stride, srcW, srcH, 0, 0); 528 return draw_slice(src, stride, srcW, srcH, 0, 0);
529 #else
530 printf("draw_frame() called!!!!!!\n");
531 return -1;
532 #endif
533 }
534
535 static uint32_t draw_image(mp_image_t *mpi){
536 // if -dr or -slices then do nothing:
537 if(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK)) return VO_TRUE;
538 draw_slice(mpi->planes,mpi->stride,mpi->w,mpi->h,0,0);
539 return VO_TRUE;
544 } 540 }
545 541
546 static uint32_t get_image(mp_image_t *mpi) 542 static uint32_t get_image(mp_image_t *mpi)
547 { 543 {
548 if (zoomFlag || 544 if (zoomFlag ||
600 } 596 }
601 return 0; 597 return 0;
602 } 598 }
603 599
604 600
605 static void 601 static void uninit(void)
606 uninit(void)
607 { 602 {
608 if(!myximage) return; 603 if(!myximage) return;
609 604
610 freeMyXImage(); 605 freeMyXImage();
611 saver_on(mDisplay); // screen saver back on 606 saver_on(mDisplay); // screen saver back on
626 { 621 {
627 mp_msg(MSGT_VO,MSGL_ERR,"vo_x11: Unknown subdevice: %s\n",arg); 622 mp_msg(MSGT_VO,MSGL_ERR,"vo_x11: Unknown subdevice: %s\n",arg);
628 return ENOSYS; 623 return ENOSYS;
629 } 624 }
630 625
631 #ifdef HAVE_NEW_GUI 626 if( !vo_init() ) return -1; // Can't open X11
632 if ( !use_gui )
633 #endif
634 if( !vo_init() ) return -1; // Can't open X11
635
636 return 0; 627 return 0;
637 } 628 }
638 629
639 static uint32_t control(uint32_t request, void *data, ...) 630 static uint32_t control(uint32_t request, void *data, ...)
640 { 631 {
643 return query_format(*((uint32_t*)data)); 634 return query_format(*((uint32_t*)data));
644 case VOCTRL_GUISUPPORT: 635 case VOCTRL_GUISUPPORT:
645 return VO_TRUE; 636 return VO_TRUE;
646 case VOCTRL_GET_IMAGE: 637 case VOCTRL_GET_IMAGE:
647 return get_image(data); 638 return get_image(data);
639 case VOCTRL_DRAW_IMAGE:
640 return draw_image(data);
648 case VOCTRL_FULLSCREEN: 641 case VOCTRL_FULLSCREEN:
649 vo_x11_fullscreen(); 642 vo_x11_fullscreen();
650 return VO_TRUE; 643 return VO_TRUE;
651 } 644 }
652 return VO_NOTIMPL; 645 return VO_NOTIMPL;