Mercurial > mplayer.hg
comparison libvo/vo_xv.c @ 26730:41794a5fb100
Add a new suboption to -vo xv and -vo xvmc that allows selection
of XVideo adaptor to be used (instead of default one, which is #0).
This is useful for example if you'd rather like to use the original
Overlay renderer of your GPU instead of the texture blitting engine
(which is usually default), which is number one cause of nasty
video tearing effects.
author | ben |
---|---|
date | Tue, 13 May 2008 17:52:25 +0000 |
parents | 4f59356268a0 |
children | 46f0b4d34fa1 |
comparison
equal
deleted
inserted
replaced
26729:581d694db6a4 | 26730:41794a5fb100 |
---|---|
722 XvPortID xv_p; | 722 XvPortID xv_p; |
723 int busy_ports = 0; | 723 int busy_ports = 0; |
724 unsigned int i; | 724 unsigned int i; |
725 strarg_t ck_src_arg = { 0, NULL }; | 725 strarg_t ck_src_arg = { 0, NULL }; |
726 strarg_t ck_method_arg = { 0, NULL }; | 726 strarg_t ck_method_arg = { 0, NULL }; |
727 int xv_adaptor = -1; | |
727 | 728 |
728 opt_t subopts[] = | 729 opt_t subopts[] = |
729 { | 730 { |
730 /* name arg type arg var test */ | 731 /* name arg type arg var test */ |
731 { "port", OPT_ARG_INT, &xv_port, (opt_test_f)int_pos }, | 732 { "port", OPT_ARG_INT, &xv_port, (opt_test_f)int_pos }, |
733 { "adaptor", OPT_ARG_INT, &xv_adaptor, (opt_test_f)int_non_neg }, | |
732 { "ck", OPT_ARG_STR, &ck_src_arg, xv_test_ck }, | 734 { "ck", OPT_ARG_STR, &ck_src_arg, xv_test_ck }, |
733 { "ck-method", OPT_ARG_STR, &ck_method_arg, xv_test_ckm }, | 735 { "ck-method", OPT_ARG_STR, &ck_method_arg, xv_test_ckm }, |
734 { NULL } | 736 { NULL } |
735 }; | 737 }; |
736 | 738 |
797 } | 799 } |
798 } | 800 } |
799 | 801 |
800 for (i = 0; i < adaptors && xv_port == 0; i++) | 802 for (i = 0; i < adaptors && xv_port == 0; i++) |
801 { | 803 { |
804 /* check if adaptor number has been specified */ | |
805 if (xv_adaptor != -1 && xv_adaptor != i) | |
806 continue; | |
807 | |
802 if ((ai[i].type & XvInputMask) && (ai[i].type & XvImageMask)) | 808 if ((ai[i].type & XvInputMask) && (ai[i].type & XvImageMask)) |
803 { | 809 { |
804 for (xv_p = ai[i].base_id; | 810 for (xv_p = ai[i].base_id; |
805 xv_p < ai[i].base_id + ai[i].num_ports; ++xv_p) | 811 xv_p < ai[i].base_id + ai[i].num_ports; ++xv_p) |
806 if (!XvGrabPort(mDisplay, xv_p, CurrentTime)) | 812 if (!XvGrabPort(mDisplay, xv_p, CurrentTime)) |
807 { | 813 { |
808 xv_port = xv_p; | 814 xv_port = xv_p; |
815 mp_msg(MSGT_VO, MSGL_INFO, | |
816 MSGTR_LIBVO_XV_Adaptor, i, ai[i].name); | |
809 break; | 817 break; |
810 } else | 818 } else |
811 { | 819 { |
812 mp_msg(MSGT_VO, MSGL_WARN, | 820 mp_msg(MSGT_VO, MSGL_WARN, |
813 MSGTR_LIBVO_XV_CouldNotGrabPort, (int) xv_p); | 821 MSGTR_LIBVO_XV_CouldNotGrabPort, (int) xv_p); |