~ubuntu-dev/mplayer/ubuntu-feisty

« back to all changes in this revision

Viewing changes to libvo/vo_xvmc.c

  • Committer: William Grant
  • Date: 2007-02-03 03:16:07 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: william.grant@ubuntu.org.au-20070203031607-08gc2ompbz6spt9i
Update to 1.0rc1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
static int first_frame;//draw colorkey on first frame
52
52
static int use_queue;
53
53
static int xv_port_request = 0;
 
54
static int bob_deinterlace;
 
55
static int top_field_first;
54
56
 
55
57
static int image_width,image_height;
56
58
static uint32_t  drwX,drwY;
345
347
// the surface have passed vf system without been skiped, it will be displayed
346
348
   rndr->state |= MP_XVMC_STATE_DISPLAY_PENDING;
347
349
   p_render_surface_to_show = rndr;
 
350
   top_field_first = mpi->fields & MP_IMGFIELD_TOP_FIRST;
348
351
   return VO_TRUE;
349
352
}
350
353
 
363
366
  {  "benchmark", OPT_ARG_BOOL, &benchmark,       NULL },
364
367
  {  "sleep",     OPT_ARG_BOOL, &use_sleep,       NULL },
365
368
  {  "queue",     OPT_ARG_BOOL, &use_queue,       NULL },
 
369
  {  "bobdeint",  OPT_ARG_BOOL, &bob_deinterlace, NULL },
366
370
  {  NULL }
367
371
};
368
372
 
400
404
   benchmark = 0; //disable PutImageto allow faster display than screen refresh
401
405
   use_sleep = 0;
402
406
   use_queue = 0;
 
407
   bob_deinterlace = 0;
403
408
 
404
409
   /* parse suboptions */
405
410
   if ( subopt_parse( arg, subopts ) != 0 )
701
706
         XSetStandardProperties(mDisplay, vo_window, hello, hello, None, NULL, 0, &hint);
702
707
         XSetWMNormalHints( mDisplay,vo_window,&hint );
703
708
         XMapWindow(mDisplay, vo_window);
 
709
         vo_x11_nofs_sizepos(hint.x, hint.y, hint.width, hint.height);
704
710
         if ( flags&VOFLAG_FULLSCREEN ) vo_x11_fullscreen();
705
711
         else {
706
712
            vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );
708
714
      } else {
709
715
        // vo_fs set means we were already at fullscreen
710
716
         vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );
711
 
         if ( !vo_fs ) XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height );
 
717
         vo_x11_nofs_sizepos(hint.x, hint.y, hint.width, hint.height);
712
718
         if ( flags&VOFLAG_FULLSCREEN && !vo_fs ) vo_x11_fullscreen(); // handle -fs on non-first file
713
719
      }
714
720
 
778
784
 
779
785
      snum = subpicture.num_palette_entries;
780
786
      seb = subpicture.entry_bytes;
781
 
      palette = (char*)malloc(snum*seb);//check fail
 
787
      palette = malloc(snum*seb);//check fail
782
788
      if(palette == NULL) return;
783
789
      for(i=0; i<snum; i++){
784
790
         // 0-black max-white the other are gradients
1013
1019
static void put_xvmc_image(xvmc_render_state_t * p_render_surface, int draw_ck){
1014
1020
int rez;
1015
1021
int clipX,clipY,clipW,clipH;
 
1022
int i;
1016
1023
 
1017
1024
   if(p_render_surface == NULL)
1018
1025
      return;
1028
1035
   if(benchmark)
1029
1036
      return;
1030
1037
 
 
1038
   for (i = 1; i <= bob_deinterlace + 1; i++) {
 
1039
   int field = top_field_first ? i : i ^ 3;
1031
1040
   rez = XvMCPutSurface(mDisplay, p_render_surface->p_surface, 
1032
1041
                        vo_window,
1033
1042
                        0, 0, image_width, image_height,
1034
1043
                        clipX, clipY, clipW, clipH,
1035
 
                        3);//p_render_surface_to_show->display_flags);
 
1044
                        bob_deinterlace ? field : 3);
 
1045
                        //p_render_surface_to_show->display_flags);
1036
1046
   if(rez != Success){
1037
1047
      printf("vo_xvmc: PutSurface failer, critical error %d!\n",rez);
1038
1048
      assert(0);
1039
1049
   }
 
1050
   }
1040
1051
   XFlush(mDisplay);
1041
1052
}
1042
1053