summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2008-12-28 00:00:02 +0000
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2008-12-28 00:00:02 +0000
commit77d2945bb960d4d90bdb1fe85889a2e41a160bd4 (patch)
treea697c4f5d614aafa87b8b435c7541db7d0fbcd6d /src
parent7716f3ae5d537addf193961cc2a8041364f7f10c (diff)
parent953615d01307263853aab6130bce1fc9d816ca34 (diff)
downloadxine-lib-77d2945bb960d4d90bdb1fe85889a2e41a160bd4.tar.gz
xine-lib-77d2945bb960d4d90bdb1fe85889a2e41a160bd4.tar.bz2
Merge from 1.1.
--HG-- rename : src/combined/demux_flac.c => src/combined/flac_demuxer.c rename : src/libspudvb/xine_spudvb_decoder.c => src/spu_dec/spudvb_decoder.c
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_mpeg.c6
-rw-r--r--src/input/input_dvb.c2
-rw-r--r--src/video_out/video_out_xcbxv.c74
-rw-r--r--src/video_out/video_out_xv.c63
-rw-r--r--src/video_out/video_out_xxmc.c41
-rw-r--r--src/video_out/xv_common.h10
6 files changed, 96 insertions, 100 deletions
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c
index 39d4a575d..2c47a71a0 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/input/input_dvb.c b/src/input/input_dvb.c
index d1b23d5da..ac8de3680 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -296,7 +296,7 @@ typedef struct {
xine_t *xine;
- const char *mrls[5];
+ const char *mrls[6];
int numchannels;
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c
index 7b6ab6677..c4c188ed4 100644
--- a/src/video_out/video_out_xcbxv.c
+++ b/src/video_out/video_out_xcbxv.c
@@ -133,6 +133,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;
@@ -152,6 +154,8 @@ typedef struct {
} xv_class_t;
static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES;
+static const char *const bicubic_types[] = VIDEO_DEVICE_XV_BICUBIC_TYPES;
+static const char *const sync_atoms[] = VIDEO_DEVICE_XV_VSYNC_ATOMS;
static uint32_t xv_get_capabilities (vo_driver_t *this_gen) {
xv_driver_t *this = (xv_driver_t *) this_gen;
@@ -1048,66 +1052,43 @@ static void xv_check_capability (xv_driver_t *this,
this->props[property].value = int_default;
}
-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,
- LOG_MODULE ": 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,
- LOG_MODULE ": 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;
@@ -1150,8 +1131,6 @@ static xcb_xv_port_t xv_autodetect_port(xv_driver_t *this,
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 &&
(prefer_type == xv_prefer_none ||
@@ -1376,7 +1355,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,
@@ -1388,6 +1368,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 5d53fa95b..6d8771781 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.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;
@@ -165,6 +167,8 @@ typedef struct {
static int gX11Fail;
static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES;
+static const char *const bicubic_types[] = VIDEO_DEVICE_XV_BICUBIC_TYPES;
+static const char *const sync_atoms[] = VIDEO_DEVICE_XV_VSYNC_ATOMS;
static uint32_t xv_get_capabilities (vo_driver_t *this_gen) {
xv_driver_t *this = (xv_driver_t *) this_gen;
@@ -1100,52 +1104,38 @@ static void xv_check_capability (xv_driver_t *this,
this->props[property].value = int_default;
}
-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,
- LOG_MODULE ": 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,
- LOG_MODULE ": 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) {
@@ -1418,7 +1408,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,
@@ -1430,6 +1421,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 ba83b7fe7..71bd01020 100644
--- a/src/video_out/video_out_xxmc.c
+++ b/src/video_out/video_out_xxmc.c
@@ -46,6 +46,7 @@ static void dispose_ximage (xxmc_driver_t *this, XShmSegmentInfo *shminfo,
XvImage *myimage);
static const char *const prefer_types[] = VIDEO_DEVICE_XV_PREFER_TYPES;
+static const char *const bicubic_types[] = VIDEO_DEVICE_XV_BICUBIC_TYPES;
/*
* Acceleration level priority. Static for now. It may well turn out that IDCT
@@ -2169,36 +2170,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,
- LOG_MODULE ": 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,
- LOG_MODULE ": 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) {
@@ -2642,6 +2639,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..e24728cdd 100644
--- a/src/video_out/xv_common.h
+++ b/src/video_out/xv_common.h
@@ -57,6 +57,9 @@
_("pitch alignment workaround"), \
_("Some buggy video drivers need a workaround to function properly.")
+#define VIDEO_DEVICE_XV_VSYNC_ATOMS \
+ { "XV_SYNC_TO_VBLANK", "XV_VSYNC" }
+
typedef enum {
xv_prefer_none, xv_prefer_overlay, xv_prefer_textured
} xv_prefertype;
@@ -67,3 +70,10 @@ typedef enum {
_("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_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.")