summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-05-08 23:00:03 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-05-08 23:00:03 +0000
commitaa0169595e98abfc47eba8bc9eb6023860138039 (patch)
tree1468c32a7e64dc92dd4e76b3ace4f2bb4bf2169b
parent4d828f7458427a4c4af4e77d57924c1a593e6739 (diff)
downloadxine-lib-aa0169595e98abfc47eba8bc9eb6023860138039.tar.gz
xine-lib-aa0169595e98abfc47eba8bc9eb6023860138039.tar.bz2
some more video_out fixes
CVS patchset: 71 CVS date: 2001/05/08 23:00:03
-rw-r--r--src/video_out/Makefile.am23
-rw-r--r--src/video_out/video_out_x11.h88
-rw-r--r--src/video_out/video_out_xv.c87
3 files changed, 123 insertions, 75 deletions
diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am
index f78d10ed5..90cf8f3e4 100644
--- a/src/video_out/Makefile.am
+++ b/src/video_out/Makefile.am
@@ -33,10 +33,33 @@ xineplug_vo_out_xv_la_LDFLAGS = -avoid-version -module
noinst_HEADERS = yuv2rgb.h video_out_syncfb.h
+include_HEADERS = video_out_x11.h
debug:
$(MAKE) CFLAGS="$(DEBUG_CFLAGS)"
+###
+# Install header files (default=$includedir/xine)
+#
+install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(includedir)/xine
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/xine/$$p"; \
+ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/xine/$$p; \
+ done
+
+
+###
+# Remove them
+#
+uninstall-includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ list='$(include_HEADERS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(includedir)/xine/$$p; \
+ done
+
mostlyclean-generic:
-rm -f *~ \#* .*~ .\#*
diff --git a/src/video_out/video_out_x11.h b/src/video_out/video_out_x11.h
new file mode 100644
index 000000000..62a15211f
--- /dev/null
+++ b/src/video_out/video_out_x11.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2000-2001 the xine project
+ *
+ * This file is part of xine, a unix video player.
+ *
+ * xine is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * xine is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * 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_x11.h,v 1.1 2001/05/08 23:00:03 guenter Exp $
+ *
+ * structs and defines specific to all x11 related output plugins
+ * (any x11 base xine ui should include this)
+ */
+
+#ifndef HAVE_VIDEO_OUT_X11_H
+#define HAVE_VIDEO_OUT_X11_H
+
+/*
+ * this is the visual data struct any x11 gui should supply
+ * (pass this to init_video_out_plugin or the xine_load_video_output_plugin
+ * utility function)
+ */
+
+typedef struct {
+
+ /* some information about the display */
+ Display *display;
+ int screen;
+ double display_ratio;
+
+ /* drawable to display the video in/on */
+ Drawable d;
+
+ /* area of that drawable to be used by video */
+ int x,y,w,h;
+
+ /*
+ * calc dest size
+ *
+ * this will be called by the video driver to find out
+ * how big the video output area size will be for a
+ * given video size. The ui should _not_ adjust it's
+ * video out area, just do some calculations and return
+ * the size
+ */
+ void (*calc_dest_size) (int video_width, int video_height,
+ int *dest_width, int *dest_height);
+
+ /*
+ * request dest size
+ *
+ * this will be called by the video driver to request
+ * the video output area to be resized to fit the video.
+ * note: the ui doesn't have to adjust itself to this
+ * size, this is just to be taken as a hint.
+ * ui must return the actual size of the video output
+ * area and the video output driver will do it's best
+ * to adjust the video frames to that size (while
+ * preserving aspect ration and stuff).
+ */
+
+ void (*reques_dest_size) (int video_width, int video_height,
+ int *dest_x, int *dest_y,
+ int *dest_height, int *dest_width);
+
+} x11_visual_t;
+
+/*
+ * constants for gui_data_exhange's data_type parameter
+ */
+
+#define GUI_DATA_EX_DEST_POS_SIZE_CHANGED 0
+#define GUI_DATA_EX_COMPLETION_EVENT 1
+
+
+#endif
+
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index 48736d9cd..45b83725b 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.13 2001/05/06 14:25:42 guenter Exp $
+ * $Id: video_out_xv.c,v 1.14 2001/05/08 23:00:03 guenter Exp $
*
* video_out_xv.c, X11 video extension interface for xine
*
@@ -53,6 +53,7 @@
#include "monitor.h"
#include "video_out.h"
+#include "video_out_x11.h"
#include "xine_internal.h"
uint32_t xine_debug;
@@ -109,9 +110,6 @@ typedef struct xv_driver_s {
/* display anatomy */
double display_ratio; /* calced from display resolution */
- int fullscreen_width; /* this is basically how big the screen is */
- int fullscreen_height;
- int in_fullscreen; /* is the window in fullscreen mode? */
} xv_driver_t;
@@ -466,7 +464,7 @@ static void xv_check_capability (xv_driver_t *this,
}
-vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual) {
+vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
xv_driver_t *this;
Display *display = NULL;
@@ -480,13 +478,15 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual) {
double res_h, res_v;
XColor ignored;
int dummy_a, dummy_b;
+ x11_visual_t *visual;
#ifdef HAVE_XINERAMA
int screens;
XineramaScreenInfo *screeninfo = NULL;
#endif
- display = (Display *) visual;
+ visual = (x11_visual_t *) visual_gen;
+ display = visual->display;
xine_debug = config->lookup_int (config, "xine_debug", 0);
/*
@@ -545,11 +545,12 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual) {
memset (this, 0, sizeof(xv_driver_t));
- this->display = display;
- this->screen = DefaultScreen(display);
- this->xv_port = xv_port;
- this->capabilities = 0;
- this->config = config;
+ this->display = display;
+ this->screen = visual->screen;
+ this->xv_port = xv_port;
+ this->capabilities = 0;
+ this->config = config;
+ this->display_ratio = visual->display_ratio;
this->vo_driver.get_capabilities = xv_get_capabilities;
this->vo_driver.alloc_frame = xv_alloc_frame;
@@ -572,9 +573,6 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual) {
this->props[i].atom = 0;
}
- this->props[VO_PROP_WINDOW_VISIBLE].value = 1;
- this->props[VO_PROP_CURSOR_VISIBLE].value = 1;
- this->props[VO_PROP_FULLSCREEN].value = 0;
this->props[VO_PROP_INTERLACED].value = 0;
this->props[VO_PROP_ASPECT_RATIO].value = ASPECT_AUTO;
@@ -642,67 +640,6 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual) {
}
}
- /*
- * find out screen dimensions
- */
-
-#ifdef HAVE_XINERAMA
- /* Spark
- * some Xinerama stuff
- * I want to figure out what fullscreen means for this setup
- */
-
- if ((XineramaQueryExtension (display, &dummy_a, &dummy_b))
- && (screeninfo = XineramaQueryScreens(display, &screens))) {
- /* Xinerama Detected */
- xprintf (VERBOSE|VIDEO,
- "Display is using Xinerama with %d screens\n", screens);
- xprintf (VERBOSE|VIDEO,
- " going to assume we are using the first screen.\n");
- xprintf (VERBOSE|VIDEO, " size of the first screen is %dx%d.\n",
- screeninfo[0].width, screeninfo[0].height);
-
- if (XineramaIsActive(display)) {
- this->fullscreen_width = screeninfo[0].width;
- this->fullscreen_height = screeninfo[0].height;
- } else {
- this->fullscreen_width = DisplayWidth (display, this->screen);
- this->fullscreen_height = DisplayHeight (display, this->screen);
- }
-
- } else {
- /* no Xinerama */
- xprintf (VERBOSE|VIDEO, "Display is not using Xinerama.\n");
- this->fullscreen_width = DisplayWidth (display, this->screen);
- this->fullscreen_height = DisplayHeight (display, this->screen);
- }
-#else
- this->fullscreen_width = DisplayWidth (display, this->screen);
- this->fullscreen_height = DisplayHeight (display, this->screen);
-#endif
-
- res_h = (this->fullscreen_width*1000 / DisplayWidthMM (display, this->screen));
- res_v = (this->fullscreen_height*1000 / DisplayHeightMM (display, this->screen));
- this->display_ratio = res_h / res_v;
-
-/* printf ("video_out_xv: fullscreen_width = %d, fullscreen_height = %d, res_h = %f, res_v = %f\n",this->fullscreen_width, this->fullscreen_height, res_h, res_v); */
-
-
- /*
- * init window
- */
-
-
- xv_calc_format (this, 720, 576, 2);
- xv_setup_window (this);
-
- /*
- * Create cursors, then display the current one.
- */
- xv_create_cursors(this);
- xv_display_cursor(&this->vo_driver,
- this->props[VO_PROP_CURSOR_VISIBLE].value);
-
return &this->vo_driver;
}