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.c63
1 files changed, 30 insertions, 33 deletions
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);
}
}
}