summaryrefslogtreecommitdiff
path: root/src/video_out/video_out_xv.c
diff options
context:
space:
mode:
authorJuergen Keil <jkeil@users.sourceforge.net>2001-10-10 10:06:52 +0000
committerJuergen Keil <jkeil@users.sourceforge.net>2001-10-10 10:06:52 +0000
commit55769958b7a66358490ab4b0bcbd5181da1eabc2 (patch)
tree51d898c24ee851e37cfaa429e37b9416d4c25786 /src/video_out/video_out_xv.c
parentfeadedc63a2c37d6802c9c96a2347506fa8dd3bd (diff)
downloadxine-lib-55769958b7a66358490ab4b0bcbd5181da1eabc2.tar.gz
xine-lib-55769958b7a66358490ab4b0bcbd5181da1eabc2.tar.bz2
GUI_DATA_EX_TRANSLATE_GUI_TO_VIDEO support for the XShm driver.
Prepare the other drivers for GUI_DATA_EX_TRANSLATE_GUI_TO_VIDEO support. CVS patchset: 785 CVS date: 2001/10/10 10:06:52
Diffstat (limited to 'src/video_out/video_out_xv.c')
-rw-r--r--src/video_out/video_out_xv.c51
1 files changed, 50 insertions, 1 deletions
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index 18ab8b7a1..500d17ec5 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.65 2001/10/03 14:01:03 miguelfreitas Exp $
+ * $Id: video_out_xv.c,v 1.66 2001/10/10 10:07:00 jkeil Exp $
*
* video_out_xv.c, X11 video extension interface for xine
*
@@ -776,6 +776,34 @@ static void xv_get_property_min_max (vo_driver_t *this_gen,
*max = this->props[property].max;
}
+static void xv_translate_gui2video(xv_driver_t *this,
+ int x, int y,
+ int *vid_x, int *vid_y)
+{
+ if (this->output_width > 0 && this->output_height > 0) {
+ /*
+ * 1.
+ * the xv driver may center a small output area inside a larger
+ * gui area. This is the case in fullscreen mode, where we often
+ * have black borders on the top/bottom/left/right side.
+ */
+ x -= this->output_xoffset;
+ y -= this->output_yoffset;
+
+ /*
+ * 2.
+ * the xv driver scales the delivered area into an output area.
+ * translate output area coordianates into the delivered area
+ * coordiantes.
+ */
+ x = x * this->delivered_width / this->output_width;
+ y = y * this->delivered_height / this->output_height;
+ }
+
+ *vid_x = x;
+ *vid_y = y;
+}
+
static int xv_gui_data_exchange (vo_driver_t *this_gen,
int data_type, void *data) {
@@ -837,6 +865,27 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen,
this->drawable = (Drawable) data;
this->gc = XCreateGC (this->display, this->drawable, 0, NULL);
break;
+
+ /* FIXME: implement this
+ case GUI_DATA_EX_TRANSLATE_GUI_TO_VIDEO:
+ {
+ int x1, y1, x2, y2;
+ x11_rectangle_t *rect = data;
+
+ xv_translate_gui2video(this, rect->x, rect->y,
+ &x1, &y1);
+ xv_translate_gui2video(this, rect->x + rect->w, rect->y + rect->h,
+ &x2, &y2);
+ rect->x = x1;
+ rect->y = y1;
+ rect->w = x2-x1;
+ rect->h = y2-y1;
+ }
+ break;
+ */
+
+ default:
+ return -1;
}
return 0;