summaryrefslogtreecommitdiff
path: root/src/xine-engine
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 /src/xine-engine
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
Diffstat (limited to 'src/xine-engine')
-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
3 files changed, 47 insertions, 9 deletions
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
}