summaryrefslogtreecommitdiff
path: root/src/video_out/video_out_xv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_out/video_out_xv.c')
-rw-r--r--src/video_out/video_out_xv.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index edb275eb2..8f5da8ea0 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -169,6 +169,8 @@ typedef struct {
static int gX11Fail;
+static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES;
+
static uint32_t xv_get_capabilities (vo_driver_t *this_gen) {
xv_driver_t *this = (xv_driver_t *) this_gen;
@@ -1347,11 +1349,15 @@ static XvPortID xv_autodetect_port(xv_driver_t *this,
unsigned int adaptors,
XvAdaptorInfo *adaptor_info,
unsigned int *adaptor_num,
- XvPortID base) {
+ XvPortID base,
+ xv_prefertype prefer_type)
+{
unsigned int an, j;
for (an = 0; an < adaptors; an++)
- if (adaptor_info[an].type & XvImageMask)
+ if (adaptor_info[an].type & XvImageMask &&
+ (prefer_type == xv_prefer_none ||
+ strcasestr (adaptor_info[an].name, prefer_types[prefer_type])))
for (j = 0; j < adaptor_info[an].num_ports; j++) {
XvPortID port = adaptor_info[an].base_id + j;
if (port >= base && xv_open_port(this, port)) {
@@ -1381,6 +1387,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
XvPortID xv_port;
XvAdaptorInfo *adaptor_info;
unsigned int adaptor_num;
+ xv_prefertype prefer_type;
this = (xv_driver_t *) calloc(1, sizeof(xv_driver_t));
if (!this)
@@ -1420,19 +1427,24 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
xv_port = config->register_num (config, "video.device.xv_port", 0,
VIDEO_DEVICE_XV_PORT_HELP,
- 10, NULL, NULL);
+ 20, NULL, NULL);
+ prefer_type = config->register_enum (config, "video.device.xv_preferred_method", 0,
+ prefer_types, VIDEO_DEVICE_XV_PREFER_TYPE_HELP,
+ 10, NULL, NULL);
if (xv_port != 0) {
if (! xv_open_port(this, xv_port)) {
xprintf(class->xine, XINE_VERBOSITY_NONE,
_("%s: could not open Xv port %d - autodetecting\n"),
LOG_MODULE, xv_port);
- xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, xv_port);
+ xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, xv_port, prefer_type);
} else
adaptor_num = xv_find_adaptor_by_port (xv_port, adaptors, adaptor_info);
}
if (!xv_port)
- xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, 0);
+ xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, 0, prefer_type);
+ if (!xv_port)
+ xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, 0, xv_prefer_none);
if (!xv_port) {
xprintf(class->xine, XINE_VERBOSITY_LOG,