summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
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
}