summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2002-11-22 18:06:09 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2002-11-22 18:06:09 +0000
commit8cee0fd2910cbdafe45e1c5d43fa930d367cec47 (patch)
treeff10bebf427b3f9211e0a473ecc58b7eeb8b1c0f
parenteef61f25b051865c9554514a66cb9b45c6a5f4bd (diff)
downloadxine-lib-8cee0fd2910cbdafe45e1c5d43fa930d367cec47.tar.gz
xine-lib-8cee0fd2910cbdafe45e1c5d43fa930d367cec47.tar.bz2
when the image does not fit the viewport and black bars need to be added, their
size ratio and therefore the position of the image is now configurable (I remembered my arts lessons at school where the teacher told us that images look more pleasing when the lower border is twice the size of the upper and set the default accordingly. ;) CVS patchset: 3337 CVS date: 2002/11/22 18:06:09
-rw-r--r--src/dxr3/video_out_dxr3.c6
-rw-r--r--src/video_out/alphablend.c2
-rw-r--r--src/video_out/video_out_aa.c4
-rw-r--r--src/video_out/video_out_none.c4
-rw-r--r--src/video_out/video_out_opengl.c6
-rw-r--r--src/video_out/video_out_pgx64.c8
-rw-r--r--src/video_out/video_out_syncfb.c4
-rw-r--r--src/video_out/video_out_vidix.c6
-rw-r--r--src/video_out/video_out_xshm.c6
-rw-r--r--src/video_out/video_out_xv.c6
-rw-r--r--src/xine-engine/video_out.h4
-rw-r--r--src/xine-engine/vo_scale.c39
-rw-r--r--src/xine-engine/vo_scale.h13
13 files changed, 73 insertions, 35 deletions
diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c
index 735dc9e40..663be6cd0 100644
--- a/src/dxr3/video_out_dxr3.c
+++ b/src/dxr3/video_out_dxr3.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_dxr3.c,v 1.62 2002/11/22 16:20:33 mroi Exp $
+ * $Id: video_out_dxr3.c,v 1.63 2002/11/22 18:06:09 mroi Exp $
*/
/* mpeg1 encoding video out plugin for the dxr3.
@@ -75,7 +75,7 @@ static vo_info_t vo_info_dxr3 = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 11, "dxr3", XINE_VERSION_CODE, &vo_info_dxr3, &dxr3_vo_init_plugin },
+ { PLUGIN_VIDEO_OUT, 12, "dxr3", XINE_VERSION_CODE, &vo_info_dxr3, &dxr3_vo_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
@@ -216,7 +216,7 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v
pthread_mutex_init(&this->spu_device_lock, NULL);
- vo_scale_init(&this->scale, 0, 0);
+ vo_scale_init(&this->scale, 0, 0, config);
this->class = class;
this->swap_fields = config->register_bool(config,
diff --git a/src/video_out/alphablend.c b/src/video_out/alphablend.c
index 207352cf2..b0ef47813 100644
--- a/src/video_out/alphablend.c
+++ b/src/video_out/alphablend.c
@@ -30,8 +30,8 @@
/*
#define LOG_BLEND_YUV
-*/
#define LOG_BLEND_RGB16
+*/
#include <string.h>
#include <stdlib.h>
diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c
index f1fb360e2..64b625fb9 100644
--- a/src/video_out/video_out_aa.c
+++ b/src/video_out/video_out_aa.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_aa.c,v 1.30 2002/11/20 11:57:48 mroi Exp $
+ * $Id: video_out_aa.c,v 1.31 2002/11/22 18:06:17 mroi Exp $
*
* video_out_aa.c, ascii-art output plugin for xine
*
@@ -328,6 +328,6 @@ static vo_info_t vo_info_aa = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 11, "aa", XINE_VERSION_CODE, &vo_info_aa, init_class },
+ { PLUGIN_VIDEO_OUT, 12, "aa", XINE_VERSION_CODE, &vo_info_aa, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_none.c b/src/video_out/video_out_none.c
index e29caa502..92cb0ea99 100644
--- a/src/video_out/video_out_none.c
+++ b/src/video_out/video_out_none.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_none.c,v 1.3 2002/11/20 11:57:48 mroi Exp $
+ * $Id: video_out_none.c,v 1.4 2002/11/22 18:06:18 mroi Exp $
*
* Was originally part of toxine frontend.
*/
@@ -297,6 +297,6 @@ static vo_info_t vo_info_none = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 11, "none", XINE_VERSION_CODE, &vo_info_none, init_class },
+ { PLUGIN_VIDEO_OUT, 12, "none", XINE_VERSION_CODE, &vo_info_none, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c
index f6c1ce3b7..5952f485a 100644
--- a/src/video_out/video_out_opengl.c
+++ b/src/video_out/video_out_opengl.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_opengl.c,v 1.19 2002/11/21 23:24:50 mshopf Exp $
+ * $Id: video_out_opengl.c,v 1.20 2002/11/22 18:06:19 mroi Exp $
*
* video_out_glut.c, glut based OpenGL rendering interface for xine
* Matthias Hopf <mat@mshopf.de>
@@ -913,7 +913,7 @@ static vo_driver_t *opengl_open_plugin (video_driver_class_t *class_gen,
this->display = visual->display;
this->screen = visual->screen;
- vo_scale_init (&this->sc, 0, 0);
+ vo_scale_init (&this->sc, 0, 0, class->config);
this->sc.frame_output_cb = visual->frame_output_cb;
this->sc.dest_size_cb = visual->dest_size_cb;
@@ -993,7 +993,7 @@ static vo_info_t vo_info_opengl = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 11, "opengl", XINE_VERSION_CODE,
+ { PLUGIN_VIDEO_OUT, 12, "opengl", XINE_VERSION_CODE,
&vo_info_opengl, opengl_init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_pgx64.c b/src/video_out/video_out_pgx64.c
index b59e623e3..749d1ce1c 100644
--- a/src/video_out/video_out_pgx64.c
+++ b/src/video_out/video_out_pgx64.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_pgx64.c,v 1.14 2002/11/20 11:57:48 mroi Exp $
+ * $Id: video_out_pgx64.c,v 1.15 2002/11/22 18:06:20 mroi Exp $
*
* video_out_pgx64.c, Sun PGX64/PGX24 output plugin for xine
*
@@ -689,7 +689,7 @@ static pgx64_driver_t* init_driver(pgx64_driver_class_t *class)
this->fb_width = attr.fbtype.fb_width;
this->fb_height = attr.fbtype.fb_height;
- vo_scale_init(&this->vo_scale, 0, 0);
+ vo_scale_init(&this->vo_scale, 0, 0, this->class->config);
this->vo_scale.user_ratio = ASPECT_AUTO;
set_reg_bits(this, BUS_CNTL, BUS_EXT_REG_EN);
@@ -833,8 +833,8 @@ static pgx64_driver_class_t* pgx64fb_init_class(xine_t *xine, void *visual_gen)
plugin_info_t xine_plugin_info[] = {
#ifdef HAVE_X11
- {PLUGIN_VIDEO_OUT, 11, "pgx64", XINE_VERSION_CODE, &vo_info_pgx64, (void*)pgx64_init_class},
+ {PLUGIN_VIDEO_OUT, 12, "pgx64", XINE_VERSION_CODE, &vo_info_pgx64, (void*)pgx64_init_class},
#endif
- {PLUGIN_VIDEO_OUT, 11, "pgx64fb", XINE_VERSION_CODE, &vo_info_pgx64fb, (void*)pgx64fb_init_class},
+ {PLUGIN_VIDEO_OUT, 12, "pgx64fb", XINE_VERSION_CODE, &vo_info_pgx64fb, (void*)pgx64fb_init_class},
{PLUGIN_NONE, 0, "", 0, NULL, NULL}
};
diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c
index f321e10f4..45bb855af 100644
--- a/src/video_out/video_out_syncfb.c
+++ b/src/video_out/video_out_syncfb.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_syncfb.c,v 1.79 2002/11/20 11:57:48 mroi Exp $
+ * $Id: video_out_syncfb.c,v 1.80 2002/11/22 18:06:20 mroi Exp $
*
* video_out_syncfb.c, SyncFB (for Matrox G200/G400 cards) interface for xine
*
@@ -949,7 +949,7 @@ static void *init_video_out_plugin(config_values_t *config, void *visual_gen)
this->drawable = visual->d;
this->gc = XCreateGC (this->display, this->drawable, 0, NULL);
- vo_scale_init( &this->sc, visual->display_ratio, 1, 0 );
+ vo_scale_init( &this->sc, visual->display_ratio, 1, 0, config );
this->sc.frame_output_cb = visual->frame_output_cb;
this->sc.user_data = visual->user_data;
diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c
index 3f598f6d3..f7caff158 100644
--- a/src/video_out/video_out_vidix.c
+++ b/src/video_out/video_out_vidix.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_vidix.c,v 1.14 2002/11/20 11:57:48 mroi Exp $
+ * $Id: video_out_vidix.c,v 1.15 2002/11/22 18:06:22 mroi Exp $
*
* video_out_vidix.c
*
@@ -694,7 +694,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
this->screen = visual->screen;
this->drawable = visual->d;
- vo_scale_init( &this->sc, 1, /*this->vidix_cap.flags & FLAG_UPSCALER,*/ 0 );
+ vo_scale_init( &this->sc, 1, /*this->vidix_cap.flags & FLAG_UPSCALER,*/ 0, config );
this->sc.frame_output_cb = visual->frame_output_cb;
this->sc.user_data = visual->user_data;
this->zoom_x = this->zoom_y = 100;
@@ -796,6 +796,6 @@ static vo_info_t vo_info_vidix = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 11, "vidix", XINE_VERSION_CODE, &vo_info_vidix, init_class },
+ { PLUGIN_VIDEO_OUT, 12, "vidix", XINE_VERSION_CODE, &vo_info_vidix, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index 291918f6a..699451138 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_xshm.c,v 1.95 2002/11/20 11:57:49 mroi Exp $
+ * $Id: video_out_xshm.c,v 1.96 2002/11/22 18:06:22 mroi Exp $
*
* video_out_xshm.c, X11 shared memory extension interface for xine
*
@@ -1054,7 +1054,7 @@ static vo_driver_t *xshm_open_plugin (video_driver_class_t *class_gen, const voi
this->display = visual->display;
this->screen = visual->screen;
- vo_scale_init( &this->sc, 0, 0 );
+ vo_scale_init( &this->sc, 0, 0, config );
this->sc.frame_output_cb = visual->frame_output_cb;
this->sc.dest_size_cb = visual->dest_size_cb;
this->sc.user_data = visual->user_data;
@@ -1265,6 +1265,6 @@ static vo_info_t vo_info_xshm = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 11, "xshm", XINE_VERSION_CODE, &vo_info_xshm, xshm_init_class },
+ { PLUGIN_VIDEO_OUT, 12, "xshm", XINE_VERSION_CODE, &vo_info_xshm, xshm_init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index ef4e04a6e..c0cff2042 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_xv.c,v 1.150 2002/11/20 11:57:49 mroi Exp $
+ * $Id: video_out_xv.c,v 1.151 2002/11/22 18:06:26 mroi Exp $
*
* video_out_xv.c, X11 video extension interface for xine
*
@@ -1109,7 +1109,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
this->xv_port = class->xv_port;
this->config = config;
- vo_scale_init (&this->sc, 1, 0 );
+ vo_scale_init (&this->sc, 1, 0, config );
this->sc.frame_output_cb = visual->frame_output_cb;
this->sc.user_data = visual->user_data;
@@ -1388,7 +1388,7 @@ static vo_info_t vo_info_xv = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 11, "xv", XINE_VERSION_CODE, &vo_info_xv, init_class },
+ { PLUGIN_VIDEO_OUT, 12, "xv", XINE_VERSION_CODE, &vo_info_xv, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h
index e011b2788..15d21035d 100644
--- a/src/xine-engine/video_out.h
+++ b/src/xine-engine/video_out.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out.h,v 1.70 2002/11/20 11:57:49 mroi Exp $
+ * $Id: video_out.h,v 1.71 2002/11/22 18:06:11 mroi Exp $
*
*
* xine version of video_out.h
@@ -234,7 +234,7 @@ struct xine_video_port_s {
* from generic vo functions.
*/
-#define VIDEO_OUT_DRIVER_IFACE_VERSION 11
+#define VIDEO_OUT_DRIVER_IFACE_VERSION 12
struct vo_driver_s {
diff --git a/src/xine-engine/vo_scale.c b/src/xine-engine/vo_scale.c
index aa9c851ba..940e9a096 100644
--- a/src/xine-engine/vo_scale.c
+++ b/src/xine-engine/vo_scale.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: vo_scale.c,v 1.15 2002/10/24 16:43:07 mroi Exp $
+ * $Id: vo_scale.c,v 1.16 2002/11/22 18:06:13 mroi Exp $
*
* Contains common code to calculate video scaling parameters.
* In short, it will map frame dimensions to screen/window size.
@@ -190,8 +190,10 @@ void vo_scale_compute_output_size (vo_scale_t *this) {
this->displayed_height = this->delivered_height;
}
}
- this->output_xoffset = (this->gui_width - this->output_width) / 2 + this->gui_x;
- this->output_yoffset = (this->gui_height - this->output_height) / 2 + this->gui_y;
+ this->output_xoffset =
+ (this->gui_width - this->output_width) * this->output_horizontal_position + this->gui_x;
+ this->output_yoffset =
+ (this->gui_height - this->output_height) * this->output_vertical_position + this->gui_y;
this->displayed_xoffset = (this->delivered_width - this->displayed_width) / 2;
this->displayed_yoffset = (this->delivered_height - this->displayed_height) / 2;
@@ -338,11 +340,30 @@ char *vo_scale_aspect_ratio_name(int a) {
}
+/*
+ * config callbacks
+ */
+static void vo_scale_horizontal_pos_changed(void *data, xine_cfg_entry_t *entry) {
+ vo_scale_t *this = (vo_scale_t *)data;
+
+ this->output_horizontal_position = entry->num_value / 100.0;
+ this->force_redraw = 1;
+}
+
+static void vo_scale_vertical_pos_changed(void *data, xine_cfg_entry_t *entry) {
+ vo_scale_t *this = (vo_scale_t *)data;
+
+ this->output_vertical_position = entry->num_value / 100.0;
+ this->force_redraw = 1;
+}
+
+
/*
* initialize rescaling struct
*/
-void vo_scale_init(vo_scale_t *this, int support_zoom, int scaling_disabled ) {
+void vo_scale_init(vo_scale_t *this, int support_zoom, int scaling_disabled,
+ config_values_t *config ) {
memset( this, 0, sizeof(vo_scale_t) );
this->support_zoom = support_zoom;
@@ -352,5 +373,13 @@ void vo_scale_init(vo_scale_t *this, int support_zoom, int scaling_disabled ) {
this->zoom_factor_y = 1.0;
this->gui_pixel_aspect = 1.0;
this->user_ratio = ASPECT_AUTO;
+
+ this->output_horizontal_position =
+ config->register_range(config, "video.horizontal_position", 50, 0, 100,
+ _("horizontal image position in the output window"), NULL, 0,
+ vo_scale_horizontal_pos_changed, this) / 100.0;
+ this->output_vertical_position =
+ config->register_range(config, "video.vertical_position", 33, 0, 100,
+ _("vertical image position in the output window"), NULL, 0,
+ vo_scale_vertical_pos_changed, this) / 100.0;
}
-
diff --git a/src/xine-engine/vo_scale.h b/src/xine-engine/vo_scale.h
index 953134512..6cb2474cc 100644
--- a/src/xine-engine/vo_scale.h
+++ b/src/xine-engine/vo_scale.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: vo_scale.h,v 1.4 2002/09/08 16:52:57 mroi Exp $
+ * $Id: vo_scale.h,v 1.5 2002/11/22 18:06:14 mroi Exp $
*
* vo_scale.h
*
@@ -104,6 +104,7 @@ struct vo_scale_s {
int output_height;
int output_xoffset;
int output_yoffset;
+
/* */
int force_redraw;
@@ -128,6 +129,14 @@ struct vo_scale_s {
/* borders */
vo_scale_rect_t border[4];
+
+ /*
+ * border ratios to determine image position in the
+ * viewport; these are set by user config
+ */
+ double output_horizontal_position;
+ double output_vertical_position;
+
};
typedef struct vo_scale_s vo_scale_t;
@@ -172,7 +181,7 @@ char *vo_scale_aspect_ratio_name(int a);
* initialize rescaling struct
*/
-void vo_scale_init(vo_scale_t *this, int support_zoom, int scaling_disabled );
+void vo_scale_init(vo_scale_t *this, int support_zoom, int scaling_disabled, config_values_t *config );
#ifdef __cplusplus
}