summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio_out/Makefile.am4
-rw-r--r--src/combined/demux_flac.c10
-rw-r--r--src/demuxers/Makefile.am6
-rw-r--r--src/demuxers/demux_mpeg.c6
-rw-r--r--src/libmpeg2/Makefile.am2
-rw-r--r--src/libspudec/Makefile.am4
-rw-r--r--src/libxineadec/Makefile.am2
-rw-r--r--src/libxinevdec/Makefile.am2
-rw-r--r--src/video_out/Makefile.am2
-rw-r--r--src/video_out/video_out_xcbxv.c93
-rw-r--r--src/video_out/video_out_xv.c75
-rw-r--r--src/video_out/video_out_xxmc.c53
-rw-r--r--src/video_out/xv_common.h24
13 files changed, 154 insertions, 129 deletions
diff --git a/src/audio_out/Makefile.am b/src/audio_out/Makefile.am
index b0c3d292e..8bd32e98a 100644
--- a/src/audio_out/Makefile.am
+++ b/src/audio_out/Makefile.am
@@ -110,7 +110,7 @@ xineplug_ao_out_arts_la_LDFLAGS = -avoid-version -module
xineplug_ao_out_directx_la_SOURCES = audio_directx_out.c
xineplug_ao_out_directx_la_CPPFLAGS = $(DIRECTX_CPPFLAGS)
-xineplug_ao_out_directx_la_LIBADD = $(XINE_LIB) $(DIRECTX_AUDIO_LIBS)
+xineplug_ao_out_directx_la_LIBADD = $(XINE_LIB) $(DIRECTX_AUDIO_LIBS) $(LTLIBINTL)
xineplug_ao_out_directx_la_CFLAGS = $(VISIBILITY_FLAG)
xineplug_ao_out_directx_la_LDFLAGS = -avoid-version -module
@@ -131,7 +131,7 @@ xineplug_ao_out_pulseaudio_la_LDFLAGS = -avoid-version -module
xineplug_ao_out_directx2_la_SOURCES = audio_directx2_out.c
xineplug_ao_out_directx2_la_CPPFLAGS = $(DIRECTX_CPPFLAGS)
-xineplug_ao_out_directx2_la_LIBADD = $(XINE_LIB) $(DIRECTX_AUDIO_LIBS) $(PTHREAD_LIBS)
+xineplug_ao_out_directx2_la_LIBADD = $(XINE_LIB) $(DIRECTX_AUDIO_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
xineplug_ao_out_directx2_la_CFLAGS = $(VISIBILITY_FLAG)
xineplug_ao_out_directx2_la_LDFLAGS = -avoid-version -module
diff --git a/src/combined/demux_flac.c b/src/combined/demux_flac.c
index ebba63701..fc638fe35 100644
--- a/src/combined/demux_flac.c
+++ b/src/combined/demux_flac.c
@@ -583,7 +583,7 @@ open_plugin (demux_class_t *class_gen,
}
break;
case METHOD_BY_EXTENSION: {
- char *ending, *mrl;
+ const char *ending, *mrl;
mrl = input->get_mrl (input);
@@ -715,22 +715,22 @@ open_plugin (demux_class_t *class_gen,
/* FLAC Demuxer class */
-static char *
+static const char *
get_description (demux_class_t *this_gen) {
return "FLAC demux plugin";
}
-static char *
+static const char *
get_identifier (demux_class_t *this_gen) {
return "FLAC";
}
-static char *
+static const char *
get_extensions (demux_class_t *this_gen) {
return "flac";
}
-static char *
+static const char *
get_mimetypes (demux_class_t *this_gen) {
return "audio/x-flac: flac: FLAC Audio;"
"audio/flac: flac: FLAC Audio;";
diff --git a/src/demuxers/Makefile.am b/src/demuxers/Makefile.am
index 2c4b38e4a..f5b0befbe 100644
--- a/src/demuxers/Makefile.am
+++ b/src/demuxers/Makefile.am
@@ -70,10 +70,10 @@ xineplug_dmx_mpeg_pes_la_SOURCES = demux_mpeg_pes.c
xineplug_dmx_mpeg_pes_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
xineplug_dmx_mpeg_ts_la_SOURCES = demux_ts.c
-xineplug_dmx_mpeg_ts_la_LIBADD = $(XINE_LIB)
+xineplug_dmx_mpeg_ts_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
xineplug_dmx_qt_la_SOURCES = demux_qt.c
-xineplug_dmx_qt_la_LIBADD = $(XINE_LIB) $(ZLIB_LIBS)
+xineplug_dmx_qt_la_LIBADD = $(XINE_LIB) $(ZLIB_LIBS) $(LTLIBINTL)
xineplug_dmx_qt_la_CPPFLAGS = $(ZLIB_CPPFLAGS)
xineplug_dmx_asf_la_SOURCES = demux_asf.c asfheader.c
@@ -130,7 +130,7 @@ xineplug_dmx_nsv_la_SOURCES = demux_nsv.c
xineplug_dmx_nsv_la_LIBADD = $(XINE_LIB)
xineplug_dmx_matroska_la_SOURCES = demux_matroska.c ebml.c
-xineplug_dmx_matroska_la_LIBADD = $(XINE_LIB) $(ZLIB_LIBS)
+xineplug_dmx_matroska_la_LIBADD = $(XINE_LIB) $(ZLIB_LIBS) $(LTLIBINTL)
xineplug_dmx_matroska_la_CPPFLAGS = $(ZLIB_CPPFLAGS)
xineplug_dmx_matroska_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c
index 388be2140..fa167c70e 100644
--- a/src/demuxers/demux_mpeg.c
+++ b/src/demuxers/demux_mpeg.c
@@ -330,7 +330,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
if((this->dummy_space[0] & 0xf0) == 0x80) {
/* read rest of header - AC3 */
- i = this->input->read (this->input, this->dummy_space+1, 3);
+ this->input->read (this->input, this->dummy_space+1, 3);
/* contents */
for (i = len - 4; i > 0; i -= (this->audio_fifo)
@@ -431,7 +431,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
header_len -= 5 ;
}
- i = this->input->read (this->input, this->dummy_space, header_len);
+ this->input->read (this->input, this->dummy_space, header_len);
for (i = len; i > 0; i -= (this->audio_fifo)
? this->audio_fifo->buffer_pool_buf_size : this->video_fifo->buffer_pool_buf_size) {
@@ -503,7 +503,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
}
/* read rest of header */
- i = this->input->read (this->input, this->dummy_space, header_len);
+ this->input->read (this->input, this->dummy_space, header_len);
/* contents */
diff --git a/src/libmpeg2/Makefile.am b/src/libmpeg2/Makefile.am
index 9895aa5d7..5a9f1302c 100644
--- a/src/libmpeg2/Makefile.am
+++ b/src/libmpeg2/Makefile.am
@@ -22,7 +22,7 @@ xineplug_decode_mpeg2_la_SOURCES = \
xine_mpeg2_decoder.c \
libmpeg2_accel.c
-xineplug_decode_mpeg2_la_LIBADD = $(XINE_LIB) $(MLIB_LIBS) -lm
+xineplug_decode_mpeg2_la_LIBADD = $(XINE_LIB) $(MLIB_LIBS) $(LTLIBINTL) -lm
xineplug_decode_mpeg2_la_CFLAGS = $(VISIBILITY_FLAG) $(LIBMPEG2_CFLAGS)
xineplug_decode_mpeg2_la_LDFLAGS = $(xineplug_ldflags)
diff --git a/src/libspudec/Makefile.am b/src/libspudec/Makefile.am
index 208d994f5..7c0dcd78d 100644
--- a/src/libspudec/Makefile.am
+++ b/src/libspudec/Makefile.am
@@ -7,7 +7,7 @@ if HAVE_DVDNAV
xineplug_decode_spu_la_SOURCES = \
spu.c \
xine_spu_decoder.c
-xineplug_decode_spu_la_LIBADD = $(XINE_LIB) $(DVDNAV_LIBS) $(PTHREAD_LIBS)
+xineplug_decode_spu_la_LIBADD = $(XINE_LIB) $(DVDNAV_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
else
@@ -16,7 +16,7 @@ xineplug_decode_spu_la_SOURCES = \
spu.c \
xine_spu_decoder.c
AM_CPPFLAGS = -I$(top_srcdir)/src/input/libdvdnav
-xineplug_decode_spu_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS)
+xineplug_decode_spu_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
endif
diff --git a/src/libxineadec/Makefile.am b/src/libxineadec/Makefile.am
index d502b7955..a97cd1934 100644
--- a/src/libxineadec/Makefile.am
+++ b/src/libxineadec/Makefile.am
@@ -39,7 +39,7 @@ xineplug_decode_lpcm_la_CFLAGS = $(VISIBILITY_FLAG)
xineplug_decode_lpcm_la_LIBADD = $(XINE_LIB)
xineplug_decode_vorbis_la_SOURCES = xine_vorbis_decoder.c
-xineplug_decode_vorbis_la_LIBADD = $(XINE_LIB) $(VORBIS_LIBS) $(OGG_LIBS)
+xineplug_decode_vorbis_la_LIBADD = $(XINE_LIB) $(VORBIS_LIBS) $(OGG_LIBS) $(LTLIBINTL)
xineplug_decode_vorbis_la_CFLAGS = $(VISIBILITY_FLAG) $(VORBIS_CFLAGS)
xineplug_decode_speex_la_SOURCES = xine_speex_decoder.c
diff --git a/src/libxinevdec/Makefile.am b/src/libxinevdec/Makefile.am
index 9805eb09e..81219d67e 100644
--- a/src/libxinevdec/Makefile.am
+++ b/src/libxinevdec/Makefile.am
@@ -43,4 +43,4 @@ xineplug_decode_gdk_pixbuf_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS) $(GDK_PIXB
xineplug_decode_theora_la_SOURCES = xine_theora_decoder.c
xineplug_decode_theora_la_CFLAGS = $(AM_CFLAGS) $(OGG_CFLAGS) $(THEORA_CFLAGS)
-xineplug_decode_theora_la_LIBADD = $(XINE_LIB) $(OGG_LIBS) $(THEORA_LIBS)
+xineplug_decode_theora_la_LIBADD = $(XINE_LIB) $(OGG_LIBS) $(THEORA_LIBS) $(LTLIBINTL)
diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am
index 80dd1e92c..f8ce7fc1f 100644
--- a/src/video_out/Makefile.am
+++ b/src/video_out/Makefile.am
@@ -184,7 +184,7 @@ xineplug_vo_out_stk_la_CFLAGS = $(VISIBILITY_FLAG) $(LIBSTK_CFLAGS)
xineplug_vo_out_directx_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c video_out_directx.c
xineplug_vo_out_directx_la_CPPFLAGS = $(AM_CPPFLAGS) $(DIRECTX_CPPFLAGS)
-xineplug_vo_out_directx_la_LIBADD = $(XINE_LIB) $(DIRECTX_VIDEO_LIBS) $(PTHREAD_LIBS)
+xineplug_vo_out_directx_la_LIBADD = $(XINE_LIB) $(DIRECTX_VIDEO_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
xineplug_vo_out_directx_la_CFLAGS = $(VISIBILITY_FLAG)
xineplug_vo_out_none_la_SOURCES = video_out_none.c
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c
index be218658c..1e6e2b663 100644
--- a/src/video_out/video_out_xcbxv.c
+++ b/src/video_out/video_out_xcbxv.c
@@ -138,6 +138,8 @@ struct xv_driver_s {
int use_colorkey;
uint32_t colorkey;
+ int sync_is_vsync;
+
/* hold initial port attributes values to restore on exit */
xine_list_t *port_attributes;
@@ -156,7 +158,9 @@ typedef struct {
xine_t *xine;
} xv_class_t;
-static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES;
+VIDEO_DEVICE_XV_DECL_BICUBIC_TYPES;
+VIDEO_DEVICE_XV_DECL_PREFER_TYPES;
+VIDEO_DEVICE_XV_DECL_SYNC_ATOMS;
static uint32_t xv_get_capabilities (vo_driver_t *this_gen) {
xv_driver_t *this = (xv_driver_t *) this_gen;
@@ -1212,66 +1216,43 @@ static void xv_update_deinterlace(void *this_gen, xine_cfg_entry_t *entry) {
this->deinterlace_method = entry->num_value;
}
-static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {
+static void xv_update_attr (void *this_gen, xine_cfg_entry_t *entry,
+ const char *atomstr, const char *debugstr)
+{
xv_driver_t *this = (xv_driver_t *) this_gen;
- int xv_filter;
xcb_intern_atom_cookie_t atom_cookie;
xcb_intern_atom_reply_t *atom_reply;
- xv_filter = entry->num_value;
-
pthread_mutex_lock(&this->main_mutex);
- atom_cookie = xcb_intern_atom(this->connection, 0, sizeof("XV_FILTER"), "XV_FILTER");
+ atom_cookie = xcb_intern_atom(this->connection, 0, strlen (atomstr), atomstr);
atom_reply = xcb_intern_atom_reply(this->connection, atom_cookie, NULL);
- xcb_xv_set_port_attribute(this->connection, this->xv_port, atom_reply->atom, xv_filter);
+ xcb_xv_set_port_attribute(this->connection, this->xv_port, atom_reply->atom, entry->num_value);
free(atom_reply);
pthread_mutex_unlock(&this->main_mutex);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbxv: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter);
+ LOG_MODULE ": %s = %d\n", debugstr, entry->num_value);
}
-static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) {
- xv_driver_t *this = (xv_driver_t *) this_gen;
- int xv_double_buffer;
-
- xcb_intern_atom_cookie_t atom_cookie;
- xcb_intern_atom_reply_t *atom_reply;
-
- xv_double_buffer = entry->num_value;
-
- pthread_mutex_lock(&this->main_mutex);
- atom_cookie = xcb_intern_atom(this->connection, 0, sizeof("XV_DOUBLE_BUFFER"), "XV_DOUBLE_BUFFER");
- atom_reply = xcb_intern_atom_reply(this->connection, atom_cookie, NULL);
- xcb_xv_set_port_attribute(this->connection, this->xv_port, atom_reply->atom, xv_double_buffer);
- free(atom_reply);
- pthread_mutex_unlock(&this->main_mutex);
+static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {
+ xv_update_attr (this_gen, entry, "XV_FILTER", "bilinear scaling mode");
+}
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbxv: double buffering mode = %d\n", xv_double_buffer);
+static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) {
+ xv_update_attr (this_gen, entry, "XV_DOUBLE_BUFFER", "double buffering mode");
}
static void xv_update_XV_SYNC_TO_VBLANK(void *this_gen, xine_cfg_entry_t *entry) {
- xv_driver_t *this = (xv_driver_t *) this_gen;
- int xv_sync_to_vblank;
-
- xcb_intern_atom_cookie_t atom_cookie;
- xcb_intern_atom_reply_t *atom_reply;
-
- xv_sync_to_vblank = entry->num_value;
-
- pthread_mutex_lock(&this->main_mutex);
- atom_cookie = xcb_intern_atom(this->connection, 0, sizeof("XV_SYNC_TO_VBLANK"), "XV_SYNC_TO_VBLANK");
- atom_reply = xcb_intern_atom_reply(this->connection, atom_cookie, NULL);
- xcb_xv_set_port_attribute(this->connection, this->xv_port, atom_reply->atom, xv_sync_to_vblank);
- free(atom_reply);
- pthread_mutex_unlock(&this->main_mutex);
-
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xcbxv: sync to vblank = %d\n", xv_sync_to_vblank);
+ xv_update_attr (this_gen, entry,
+ sync_atoms[((xv_driver_t *)this_gen)->sync_is_vsync],
+ "sync to vblank");
}
+static void xv_update_XV_BICUBIC(void *this_gen, xine_cfg_entry_t *entry)
+{
+ xv_update_attr (this_gen, entry, "XV_BICUBIC", "bicubic filtering mode");
+}
static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) {
xv_driver_t *this = (xv_driver_t *) this_gen;
@@ -1317,7 +1298,7 @@ static xcb_xv_port_t xv_autodetect_port(xv_driver_t *this,
for (; adaptor_it->rem; xcb_xv_adaptor_info_next(adaptor_it))
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])))
+ strcasestr (xcb_xv_adaptor_info_name (adaptor_it->data), prefer_substrings[prefer_type])))
{
int j;
for (j = 0; j < adaptor_it->data->num_ports; ++j)
@@ -1348,7 +1329,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
xcb_xv_list_image_formats_cookie_t list_formats_cookie;
xcb_xv_list_image_formats_reply_t *list_formats_reply;
- xcb_xv_adaptor_info_iterator_t adaptor_it;
+ xcb_xv_adaptor_info_iterator_t adaptor_it, adaptor_first;
xcb_xv_image_format_info_iterator_t format_it;
this = (xv_driver_t *) calloc(1, sizeof(xv_driver_t));
@@ -1386,12 +1367,12 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
return NULL;
}
- adaptor_it = xcb_xv_query_adaptors_info_iterator(query_adaptors_reply);
+ adaptor_first = 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,
20, NULL, NULL);
prefer_type = config->register_enum (config, "video.device.xv_preferred_method", 0,
- prefer_types, VIDEO_DEVICE_XV_PREFER_TYPE_HELP,
+ prefer_labels, VIDEO_DEVICE_XV_PREFER_TYPE_HELP,
10, NULL, NULL);
if (xv_port != 0) {
@@ -1399,14 +1380,25 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
xprintf(class->xine, XINE_VERBOSITY_NONE,
_("%s: could not open Xv port %d - autodetecting\n"),
LOG_MODULE, xv_port);
+ adaptor_it = adaptor_first;
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)
+ {
+ adaptor_it = adaptor_first;
xv_port = xv_autodetect_port (this, &adaptor_it, 0, prefer_type);
+ }
if (!xv_port)
+ {
+ if (prefer_type)
+ xprintf(class->xine, XINE_VERBOSITY_NONE,
+ _("%s: no available ports of type \"%s\", defaulting...\n"),
+ LOG_MODULE, prefer_labels[prefer_type]);
+ adaptor_it = adaptor_first;
xv_port = xv_autodetect_port (this, &adaptor_it, 0, xv_prefer_none);
+ }
if (!xv_port) {
xprintf(class->xine, XINE_VERBOSITY_LOG,
@@ -1534,7 +1526,8 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
VIDEO_DEVICE_XV_DOUBLE_BUFFER_HELP,
20, xv_update_XV_DOUBLE_BUFFER, this);
config->update_num(config,"video.device.xv_double_buffer",xv_double_buffer);
- } else if(!strcmp(xcb_xv_attribute_info_name(attribute_it.data), "XV_SYNC_TO_VBLANK")) {
+ } else if(!strcmp(name, sync_atoms[this->sync_is_vsync = 0]) ||
+ !strcmp(name, sync_atoms[this->sync_is_vsync = 1])) {
int xv_sync_to_vblank;
xv_sync_to_vblank =
config->register_bool (config, "video.device.xv_sync_to_vblank", 1,
@@ -1546,6 +1539,12 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
"sync to under the XVideo Settings tab"),
20, xv_update_XV_SYNC_TO_VBLANK, this);
config->update_num(config,"video.device.xv_sync_to_vblank",xv_sync_to_vblank);
+ } else if(!strcmp(name, "XV_BICUBIC")) {
+ int xv_bicubic =
+ config->register_enum (config, "video.device.xv_bicubic", 2,
+ bicubic_types, VIDEO_DEVICE_XV_BICUBIC_HELP,
+ 20, xv_update_XV_BICUBIC, this);
+ config->update_num(config,"video.device.xv_bicubic",xv_bicubic);
}
}
}
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index a3612e3eb..f2c47ef7e 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -143,6 +143,8 @@ struct xv_driver_s {
int use_colorkey;
uint32_t colorkey;
+ int sync_is_vsync;
+
/* hold initial port attributes values to restore on exit */
xine_list_t *port_attributes;
@@ -169,7 +171,9 @@ typedef struct {
static int gX11Fail;
-static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES;
+VIDEO_DEVICE_XV_DECL_BICUBIC_TYPES;
+VIDEO_DEVICE_XV_DECL_PREFER_TYPES;
+VIDEO_DEVICE_XV_DECL_SYNC_ATOMS;
static uint32_t xv_get_capabilities (vo_driver_t *this_gen) {
xv_driver_t *this = (xv_driver_t *) this_gen;
@@ -1269,52 +1273,38 @@ static void xv_update_deinterlace(void *this_gen, xine_cfg_entry_t *entry) {
this->deinterlace_method = entry->num_value;
}
-static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {
+static void xv_update_attr (void *this_gen, xine_cfg_entry_t *entry,
+ const char *atomstr, const char *debugstr)
+{
xv_driver_t *this = (xv_driver_t *) this_gen;
Atom atom;
- int xv_filter;
-
- xv_filter = entry->num_value;
LOCK_DISPLAY(this);
- atom = XInternAtom (this->display, "XV_FILTER", False);
- XvSetPortAttribute (this->display, this->xv_port, atom, xv_filter);
+ atom = XInternAtom (this->display, atomstr, False);
+ XvSetPortAttribute (this->display, this->xv_port, atom, entry->num_value);
UNLOCK_DISPLAY(this);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xv: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter);
+ LOG_MODULE ": %s = %d\n", debugstr, entry->num_value);
}
-static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) {
- xv_driver_t *this = (xv_driver_t *) this_gen;
- Atom atom;
- int xv_double_buffer;
-
- xv_double_buffer = entry->num_value;
-
- LOCK_DISPLAY(this);
- atom = XInternAtom (this->display, "XV_DOUBLE_BUFFER", False);
- XvSetPortAttribute (this->display, this->xv_port, atom, xv_double_buffer);
- UNLOCK_DISPLAY(this);
+static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {
+ xv_update_attr (this_gen, entry, "XV_FILTER", "bilinear scaling mode");
+}
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xv: double buffering mode = %d\n", xv_double_buffer);
+static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) {
+ xv_update_attr (this_gen, entry, "XV_DOUBLE_BUFFER", "double buffering mode");
}
static void xv_update_XV_SYNC_TO_VBLANK(void *this_gen, xine_cfg_entry_t *entry) {
- xv_driver_t *this = (xv_driver_t *) this_gen;
- Atom atom;
- int xv_sync_to_vblank;
-
- xv_sync_to_vblank = entry->num_value;
-
- LOCK_DISPLAY(this);
- atom = XInternAtom (this->display, "XV_SYNC_TO_VBLANK", False);
- XvSetPortAttribute (this->display, this->xv_port, atom, xv_sync_to_vblank);
- UNLOCK_DISPLAY(this);
+ xv_update_attr (this_gen, entry,
+ sync_atoms[((xv_driver_t *)this_gen)->sync_is_vsync],
+ "sync to vblank");
+}
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xv: sync to vblank = %d\n", xv_sync_to_vblank);
+static void xv_update_XV_BICUBIC(void *this_gen, xine_cfg_entry_t *entry)
+{
+ xv_update_attr (this_gen, entry, "XV_BICUBIC", "bicubic filtering mode");
}
static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) {
@@ -1357,7 +1347,7 @@ static XvPortID xv_autodetect_port(xv_driver_t *this,
for (an = 0; an < adaptors; an++)
if (adaptor_info[an].type & XvImageMask &&
(prefer_type == xv_prefer_none ||
- strcasestr (adaptor_info[an].name, prefer_types[prefer_type])))
+ strcasestr (adaptor_info[an].name, prefer_substrings[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)) {
@@ -1429,7 +1419,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
VIDEO_DEVICE_XV_PORT_HELP,
20, NULL, NULL);
prefer_type = config->register_enum (config, "video.device.xv_preferred_method", 0,
- prefer_types, VIDEO_DEVICE_XV_PREFER_TYPE_HELP,
+ prefer_labels, VIDEO_DEVICE_XV_PREFER_TYPE_HELP,
10, NULL, NULL);
if (xv_port != 0) {
@@ -1444,7 +1434,13 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
if (!xv_port)
xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, 0, prefer_type);
if (!xv_port)
+ {
+ if (prefer_type)
+ xprintf(class->xine, XINE_VERBOSITY_NONE,
+ _("%s: no available ports of type \"%s\", defaulting...\n"),
+ LOG_MODULE, prefer_labels[prefer_type]);
xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, 0, xv_prefer_none);
+ }
if (!xv_port) {
xprintf(class->xine, XINE_VERBOSITY_LOG,
@@ -1583,7 +1579,8 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
VIDEO_DEVICE_XV_DOUBLE_BUFFER_HELP,
20, xv_update_XV_DOUBLE_BUFFER, this);
config->update_num(config,"video.device.xv_double_buffer",xv_double_buffer);
- } else if(!strcmp(attr[k].name, "XV_SYNC_TO_VBLANK")) {
+ } else if(((this->sync_is_vsync = 0), !strcmp(name, sync_atoms[0])) ||
+ ((this->sync_is_vsync = 1), !strcmp(name, sync_atoms[1]))) {
int xv_sync_to_vblank;
xv_sync_to_vblank =
config->register_bool (config, "video.device.xv_sync_to_vblank", 1,
@@ -1595,6 +1592,12 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
"sync to under the XVideo Settings tab"),
20, xv_update_XV_SYNC_TO_VBLANK, this);
config->update_num(config,"video.device.xv_sync_to_vblank",xv_sync_to_vblank);
+ } else if(!strcmp(name, "XV_BICUBIC")) {
+ int xv_bicubic =
+ config->register_enum (config, "video.device.xv_bicubic", 2,
+ bicubic_types, VIDEO_DEVICE_XV_BICUBIC_HELP,
+ 20, xv_update_XV_BICUBIC, this);
+ config->update_num(config,"video.device.xv_bicubic",xv_bicubic);
}
}
}
diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c
index b3ac39697..61e0139e3 100644
--- a/src/video_out/video_out_xxmc.c
+++ b/src/video_out/video_out_xxmc.c
@@ -45,7 +45,8 @@ 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;
+VIDEO_DEVICE_XV_DECL_BICUBIC_TYPES;
+VIDEO_DEVICE_XV_DECL_PREFER_TYPES;
/*
* Acceleration level priority. Static for now. It may well turn out that IDCT
@@ -2129,36 +2130,32 @@ static void xxmc_check_capability (xxmc_driver_t *this,
this->props[property].value = int_default;
}
-static void xxmc_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {
+static void xxmc_update_attr (void *this_gen, xine_cfg_entry_t *entry,
+ const char *atomstr, const char *debugstr)
+{
xxmc_driver_t *this = (xxmc_driver_t *) this_gen;
Atom atom;
- int xv_filter;
-
- xv_filter = entry->num_value;
XLockDisplay(this->display);
- atom = XInternAtom (this->display, "XV_FILTER", False);
- XvSetPortAttribute (this->display, this->xv_port, atom, xv_filter);
+ atom = XInternAtom (this->display, atomstr, False);
+ XvSetPortAttribute (this->display, this->xv_port, atom, entry->num_value);
XUnlockDisplay(this->display);
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter);
+ LOG_MODULE ": %s = %d\n", debugstr, entry->num_value);
}
-static void xxmc_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) {
- xxmc_driver_t *this = (xxmc_driver_t *) this_gen;
- Atom atom;
- int xv_double_buffer;
-
- xv_double_buffer = entry->num_value;
+static void xxmc_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {
+ xxmc_update_attr (this_gen, entry, "XV_FILTER", "bilinear scaling mode");
+}
- XLockDisplay(this->display);
- atom = XInternAtom (this->display, "XV_DOUBLE_BUFFER", False);
- XvSetPortAttribute (this->display, this->xv_port, atom, xv_double_buffer);
- XUnlockDisplay(this->display);
+static void xxmc_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) {
+ xxmc_update_attr (this_gen, entry, "XV_DOUBLE_BUFFER", "double buffering mode");
+}
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_xxmc: double buffering mode = %d\n", xv_double_buffer);
+static void xxmc_update_XV_BICUBIC(void *this_gen, xine_cfg_entry_t *entry)
+{
+ xxmc_update_attr (this_gen, entry, "XV_BICUBIC", "bicubic filtering mode");
}
static void xxmc_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) {
@@ -2231,7 +2228,7 @@ static XvPortID xxmc_autodetect_port(xxmc_driver_t *this,
for (an = 0; an < adaptors; an++)
if (adaptor_info[an].type & XvImageMask &&
(prefer_type == xv_prefer_none ||
- strcasestr (adaptor_info[an].name, prefer_types[prefer_type])))
+ strcasestr (adaptor_info[an].name, prefer_substrings[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)) {
@@ -2451,7 +2448,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
VIDEO_DEVICE_XV_PORT_HELP,
20, NULL, NULL);
prefer_type = config->register_enum (config, "video.device.xv_preferred_method", 0,
- prefer_types, VIDEO_DEVICE_XV_PREFER_TYPE_HELP,
+ prefer_labels, VIDEO_DEVICE_XV_PREFER_TYPE_HELP,
10, NULL, NULL);
if (xv_port != 0) {
@@ -2466,7 +2463,13 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
if (!xv_port)
xv_port = xxmc_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, 0, prefer_type);
if (!xv_port)
+ {
+ if (prefer_type)
+ xprintf(class->xine, XINE_VERBOSITY_NONE,
+ _("%s: no available ports of type \"%s\", defaulting...\n"),
+ LOG_MODULE, prefer_labels[prefer_type]);
xv_port = xxmc_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, 0, xv_prefer_none);
+ }
if (!xv_port) {
xprintf(class->xine, XINE_VERBOSITY_LOG,
@@ -2602,6 +2605,12 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
VIDEO_DEVICE_XV_DOUBLE_BUFFER_HELP,
20, xxmc_update_XV_DOUBLE_BUFFER, this);
config->update_num(config,"video.device.xv_double_buffer",xv_double_buffer);
+ } else if(!strcmp(name, "XV_BICUBIC")) {
+ int xv_bicubic =
+ config->register_enum (config, "video.device.xv_bicubic", 2,
+ bicubic_types, VIDEO_DEVICE_XV_BICUBIC_HELP,
+ 20, xxmc_update_XV_BICUBIC, this);
+ config->update_num(config,"video.device.xv_bicubic",xv_bicubic);
}
}
}
diff --git a/src/video_out/xv_common.h b/src/video_out/xv_common.h
index 259afe616..ff49286f0 100644
--- a/src/video_out/xv_common.h
+++ b/src/video_out/xv_common.h
@@ -57,13 +57,27 @@
_("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_DECL_SYNC_ATOMS \
+ static const char *const sync_atoms[] = \
+ { "XV_SYNC_TO_VBLANK", "XV_VSYNC" };
+
+#define VIDEO_DEVICE_XV_DECL_PREFER_TYPES \
+ typedef enum { \
+ xv_prefer_none, xv_prefer_overlay, xv_prefer_textured, xv_prefer_blitter, \
+ } xv_prefertype; \
+ static const char *const prefer_labels[] = \
+ { "Any", "Overlay", "Textured Video", "Blitter", NULL }; \
+ static const char prefer_substrings[][8] = \
+ { "", "Overlay", "Texture", "Blitter" };
#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.)")
+
+#define VIDEO_DEVICE_XV_DECL_BICUBIC_TYPES \
+ static const char *const bicubic_types[] = { "Off", "On", "Auto", NULL };
+#define VIDEO_DEVICE_XV_BICUBIC_HELP \
+ _("bicubic filtering"), \
+ _("This option controls bicubic filtering of the video image. " \
+ "It may be used instead of, or as well as, xine's deinterlacers.")