summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--src/video_out/video_out_xcbxv.c23
-rw-r--r--src/video_out/video_out_xv.c22
-rw-r--r--src/video_out/video_out_xxmc.c21
-rw-r--r--src/video_out/xv_common.h11
5 files changed, 68 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 684811c00..cca0e8435 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -55,8 +55,12 @@ xine-lib (1.1.90) (Unreleased)
* Remove SyncFB video output plugin, the kernel module needed is no more
active and thus it's no more usable. If you were using SyncFB somehow,
please use DirectFB or VIDIX instead.
- * The Xv and XxMC video output plugins now support Xv port selection.
- (XvMC does not, at present.)
+ * The Xv and XxMC video output plugins now support Xv port selection via
+ two methods: port number and port type (currently "any", "overlay" and
+ "textured video"). Port number takes precedence; the plugins will fall
+ back on another port of the same type (if a type was specified) then on
+ whatever they can find.
+ XvMC does not support port selection at present.
* Report more video output capabilities via (port)->get_capabilities():
colour controls, zooming, colour keying.
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c
index d77917a70..e267f98fb 100644
--- a/src/video_out/video_out_xcbxv.c
+++ b/src/video_out/video_out_xcbxv.c
@@ -151,6 +151,8 @@ typedef struct {
xine_t *xine;
} xv_class_t;
+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;
@@ -1145,10 +1147,15 @@ xv_find_adaptor_by_port (int port, xcb_xv_adaptor_info_iterator_t *adaptor_it)
static xcb_xv_port_t xv_autodetect_port(xv_driver_t *this,
xcb_xv_adaptor_info_iterator_t *adaptor_it,
- xcb_xv_port_t base)
+ xcb_xv_port_t base,
+ xv_prefertype prefer_type)
{
+ xcb_xv_adaptor_info_iterator_t *start = adaptor_it;
+
for (; adaptor_it->rem; xcb_xv_adaptor_info_next(adaptor_it))
- if (adaptor_it->data->type & XCB_XV_TYPE_IMAGE_MASK)
+ if (adaptor_it->data->type & XCB_XV_TYPE_IMAGE_MASK &&
+ (prefer_type == xv_prefer_none ||
+ strcasestr (xcb_xv_adaptor_info_name (adaptor_it->data), prefer_types[prefer_type])))
{
int j;
for (j = 0; j < adaptor_it->data->num_ports; ++j)
@@ -1168,6 +1175,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
int i;
xcb_visual_t *visual = (xcb_visual_t *) visual_gen;
xcb_xv_port_t xv_port;
+ xv_prefertype prefer_type;
const xcb_query_extension_reply_t *query_extension_reply;
@@ -1219,19 +1227,24 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
adaptor_it = xcb_xv_query_adaptors_info_iterator(query_adaptors_reply);
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, &adaptor_it, xv_port);
+ xv_port = xv_autodetect_port (this, &adaptor_it, xv_port, prefer_type);
} else
xv_find_adaptor_by_port (xv_port, &adaptor_it);
}
if (!xv_port)
- xv_port = xv_autodetect_port (this, &adaptor_it, 0);
+ xv_port = xv_autodetect_port (this, &adaptor_it, 0, prefer_type);
+ if (!xv_port)
+ xv_port = xv_autodetect_port (this, &adaptor_it, 0, xv_prefer_none);
if (!xv_port) {
xprintf(class->xine, XINE_VERBOSITY_LOG,
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index a874e4cdf..0026bd8af 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -164,6 +164,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;
@@ -1178,11 +1180,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)) {
@@ -1212,6 +1218,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 *) xine_xmalloc (sizeof (xv_driver_t));
if (!this)
@@ -1251,19 +1258,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,
diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c
index 1ef3652a9..bd8a76046 100644
--- a/src/video_out/video_out_xxmc.c
+++ b/src/video_out/video_out_xxmc.c
@@ -45,6 +45,7 @@ static void xxmc_frame_updates(xxmc_driver_t *driver, xxmc_frame_t *frame,
static void dispose_ximage (xxmc_driver_t *this, XShmSegmentInfo *shminfo,
XvImage *myimage);
+static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES;
/*
* Acceleration level priority. Static for now. It may well turn out that IDCT
@@ -2263,11 +2264,15 @@ static XvPortID xxmc_autodetect_port(xxmc_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 && xxmc_open_port(this, port)) {
@@ -2443,6 +2448,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
XvPortID xv_port;
XvAdaptorInfo *adaptor_info;
unsigned int adaptor_num;
+ xv_prefertype prefer_type;
cfg_entry_t *entry;
int use_more_frames;
int use_unscaled;
@@ -2480,19 +2486,24 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
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 (! xxmc_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 = xxmc_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, xv_port);
+ xv_port = xxmc_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, xv_port, prefer_type);
} else
adaptor_num = xxmc_find_adaptor_by_port (xv_port, adaptors, adaptor_info);
}
if (!xv_port)
- xv_port = xxmc_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, 0);
+ xv_port = xxmc_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, 0, prefer_type);
+ if (!xv_port)
+ xv_port = xxmc_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, 0, xv_prefer_none);
if (!xv_port) {
xprintf(class->xine, XINE_VERBOSITY_LOG,
diff --git a/src/video_out/xv_common.h b/src/video_out/xv_common.h
index ee2ab9a10..259afe616 100644
--- a/src/video_out/xv_common.h
+++ b/src/video_out/xv_common.h
@@ -56,3 +56,14 @@
#define VIDEO_DEVICE_XV_PITCH_ALIGNMENT_HELP \
_("pitch alignment workaround"), \
_("Some buggy video drivers need a workaround to function properly.")
+
+typedef enum {
+ xv_prefer_none, xv_prefer_overlay, xv_prefer_textured
+} xv_prefertype;
+#define VIDEO_DEVICE_XV_PREFER_TYPES \
+ { "Any", "Overlay", "Textured Video", NULL }
+#define VIDEO_DEVICE_XV_PREFER_TYPE_HELP \
+ _("video display method preference"), \
+ _("Selects which video output method is preferred. " \
+ "Detection is done using the reported Xv adaptor names.\n" \
+ "(Only applies when auto-detecting which Xv port to use.)")