summaryrefslogtreecommitdiff
path: root/src/video_out
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-10-22 00:52:09 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-10-22 00:52:09 +0000
commit1daeddffa3521a15493dbbd57ea8847f09d931b1 (patch)
tree94435a387eb7e44bd3255faffd36ad6bfaa68a8b /src/video_out
parent66c7a3a86eebc9850ff3aa908ca0acc171450f77 (diff)
downloadxine-lib-1daeddffa3521a15493dbbd57ea8847f09d931b1.tar.gz
xine-lib-1daeddffa3521a15493dbbd57ea8847f09d931b1.tar.bz2
introducing libxineutils and a this pointer for video_out_x11 callbacks
CVS patchset: 852 CVS date: 2001/10/22 00:52:09
Diffstat (limited to 'src/video_out')
-rw-r--r--src/video_out/Makefile.am9
-rw-r--r--src/video_out/deinterlace.c37
-rw-r--r--src/video_out/video_out_syncfb.c8
-rw-r--r--src/video_out/video_out_x11.h10
-rw-r--r--src/video_out/video_out_xshm.c20
-rw-r--r--src/video_out/video_out_xv.c14
6 files changed, 63 insertions, 35 deletions
diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am
index 908d9d1e5..2d3eeab22 100644
--- a/src/video_out/Makefile.am
+++ b/src/video_out/Makefile.am
@@ -26,19 +26,20 @@ endif
lib_LTLIBRARIES = $(xv_module) $(syncfb_module) $(xshm_module) $(aa_module)
xineplug_vo_out_xv_la_SOURCES = deinterlace.c alphablend.c video_out_xv.c
-xineplug_vo_out_xv_la_LIBADD = $(XV_LIB) $(X_LIBS) -lXext
+xineplug_vo_out_xv_la_LIBADD = $(XV_LIB) $(X_LIBS) -lXext $(top_builddir)/src/xine-utils/libxineutils.la
xineplug_vo_out_xv_la_LDFLAGS = -avoid-version -module
xineplug_vo_out_xshm_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \
alphablend.c video_out_xshm.c
-xineplug_vo_out_xshm_la_LIBADD = $(X_LIBS) -lXext
+xineplug_vo_out_xshm_la_LIBADD = $(X_LIBS) -lXext $(top_builddir)/src/xine-utils/libxineutils.la
xineplug_vo_out_xshm_la_LDFLAGS = -avoid-version -module
-xineplug_vo_out_syncfb_la_SOURCES = video_out_syncfb.c
+xineplug_vo_out_syncfb_la_SOURCES = video_out_syncfb.c
+xineplug_vo_out_syncfb_la_LIBADD = $(top_builddir)/src/xine-utils/libxineutils.la
xineplug_vo_out_syncfb_la_LDFLAGS = -avoid-version -module
xineplug_vo_out_aa_la_SOURCES = video_out_aa.c
-xineplug_vo_out_aa_la_LIBADD = $(AALIB_LIBS)
+xineplug_vo_out_aa_la_LIBADD = $(AALIB_LIBS) $(top_builddir)/src/xine-utils/libxineutils.la
xineplug_vo_out_aa_la_LDFLAGS = -avoid-version -module
noinst_HEADERS = yuv2rgb.h video_out_syncfb.h alphablend.h deinterlace.h
diff --git a/src/video_out/deinterlace.c b/src/video_out/deinterlace.c
index afdc320bb..540941c20 100644
--- a/src/video_out/deinterlace.c
+++ b/src/video_out/deinterlace.c
@@ -27,10 +27,11 @@
#include <stdio.h>
#include <string.h>
#include "xine_internal.h"
-#include "cpu_accel.h"
#include "deinterlace.h"
#include "memcpy.h"
+#include "cpu_accel.c"
+#include "memcpy.c"
/*
DeinterlaceFieldBob algorithm
@@ -329,15 +330,17 @@ static int deinterlace_weave_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
psubsw_r2r ( mm4, mm5 ); // mm5 = Oold - O
psraw_i2r ( 1, mm5 ); // XXX
pmullw_r2r ( mm5, mm5 ); // mm5 = (Oold - O) ^ 2
- psubusw_r2r ( mm5, mm3 ); // mm0 = TT - (Oold - O) ^ 2, or 0 if that's negative
+ psubusw_r2r ( mm5, mm3 ); /* mm0 = TT - (Oold - O) ^ 2, or 0 if that's negative */
paddusw_r2r ( mm3, mm7 ); // mm7 = our magic number
- // Now compare the similarity totals against our threshold. The pcmpgtw
- // instruction will populate the target register with a bunch of mask bits,
- // filling words where the comparison is true with 1s and ones where it's
- // false with 0s. A few ANDs and NOTs and an OR later, we have bobbed
- // values for pixels under the similarity threshold and weaved ones for
- // pixels over the threshold.
+ /*
+ * Now compare the similarity totals against our threshold. The pcmpgtw
+ * instruction will populate the target register with a bunch of mask bits,
+ * filling words where the comparison is true with 1s and ones where it's
+ * false with 0s. A few ANDs and NOTs and an OR later, we have bobbed
+ * values for pixels under the similarity threshold and weaved ones for
+ * pixels over the threshold.
+ */
pcmpgtw_m2r( *&qwThreshold, mm7 ); // mm7 = 0xffff where we're greater than the threshold, 0 elsewhere
movq_r2r ( mm7, mm6 ); // mm6 = 0xffff where we're greater than the threshold, 0 elsewhere
@@ -521,7 +524,7 @@ static int deinterlace_greedy_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
}
}
- // Copy last odd line if we're processing an Odd field.
+ /* Copy last odd line if we're processing an Odd field. */
if (IsOdd)
{
fast_memcpy(pdst + (height * 2 - 1) * LineLength,
@@ -529,7 +532,7 @@ static int deinterlace_greedy_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
LineLength);
}
- // clear out the MMX registers ready for doing floating point again
+ /* clear out the MMX registers ready for doing floating point again */
emms();
#endif
@@ -559,8 +562,11 @@ static void deinterlace_onefield_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
static mmx_t Mask = {ub:{0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
- // copy first even line no matter what, and the first odd line if we're
- // processing an odd field.
+ /*
+ * copy first even line no matter what, and the first odd line if we're
+ * processing an odd field.
+ */
+
fast_memcpy(pdst, pEvenLines, LineLength);
if (IsOdd)
fast_memcpy(pdst + LineLength, pOddLines, LineLength);
@@ -601,7 +607,7 @@ static void deinterlace_onefield_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
}
}
- // Copy last odd line if we're processing an even field.
+ /* Copy last odd line if we're processing an even field. */
if (! IsOdd)
{
fast_memcpy(pdst + (height * 2 - 1) * LineLength,
@@ -609,8 +615,9 @@ static void deinterlace_onefield_yuv_mmx( uint8_t *pdst, uint8_t *psrc[],
LineLength);
}
- // clear out the MMX registers ready for doing floating point
- // again
+ /* clear out the MMX registers ready for doing floating point
+ * again
+ */
emms();
#endif
}
diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c
index 645b9f50b..a2226db8c 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.15 2001/10/14 23:19:59 f1rmb Exp $
+ * $Id: video_out_syncfb.c,v 1.16 2001/10/22 00:52:10 guenter Exp $
*
* video_out_syncfb.c, Matrox G400 video extension interface for xine
*
@@ -143,8 +143,11 @@ typedef struct _mga_globals {
int overlay_state;
+ void *user_data;
+
/* gui callback */
- void (*request_dest_size) (int video_width, int video_height,
+ void (*request_dest_size) (void *user_data,
+ int video_width, int video_height,
int *dest_x, int *dest_y,
int *dest_height, int *dest_width);
@@ -927,6 +930,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual) {
_mga_priv.user_ratio_changed = 0 ;
_mga_priv.fourcc_format = 0;
_mga_priv.request_dest_size = ((x11_visual_t*) visual)->request_dest_size;
+ _mga_priv.user_data = ((x11_visual_t*) visual)->user_data;
_window.clasped_window = 0;
_display.default_screen = DefaultScreen(_mga_priv.lDisplay);
diff --git a/src/video_out/video_out_x11.h b/src/video_out/video_out_x11.h
index faedf511e..a98ca612b 100644
--- a/src/video_out/video_out_x11.h
+++ b/src/video_out/video_out_x11.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_x11.h,v 1.7 2001/10/10 10:06:59 jkeil Exp $
+ * $Id: video_out_x11.h,v 1.8 2001/10/22 00:52:10 guenter Exp $
*
* structs and defines specific to all x11 related output plugins
* (any x11 base xine ui should include this)
@@ -52,6 +52,8 @@ typedef struct {
/* drawable to display the video in/on */
Drawable d;
+
+ void *user_data;
/*
* calc dest size
@@ -62,7 +64,8 @@ typedef struct {
* video out area, just do some calculations and return
* the size
*/
- void (*calc_dest_size) (int video_width, int video_height,
+ void (*calc_dest_size) (void *user_data,
+ int video_width, int video_height,
int *dest_width, int *dest_height);
/*
@@ -78,7 +81,8 @@ typedef struct {
* preserving aspect ration and stuff).
*/
- void (*request_dest_size) (int video_width, int video_height,
+ void (*request_dest_size) (void *user_data,
+ int video_width, int video_height,
int *dest_x, int *dest_y,
int *dest_width, int *dest_height);
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index c46c8d75b..f6e02a773 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.47 2001/10/20 13:40:20 miguelfreitas Exp $
+ * $Id: video_out_xshm.c,v 1.48 2001/10/22 00:52:10 guenter Exp $
*
* video_out_xshm.c, X11 shared memory extension interface for xine
*
@@ -137,13 +137,17 @@ typedef struct xshm_driver_s {
/* profiler */
int prof_yuv2rgb;
+ void *user_data;
+
/* gui callbacks */
- void (*request_dest_size) (int video_width, int video_height,
+ void (*request_dest_size) (void *user_data,
+ int video_width, int video_height,
int *dest_x, int *dest_y,
int *dest_height, int *dest_width);
- void (*calc_dest_size) (int video_width, int video_height,
+ void (*calc_dest_size) (void *user_data,
+ int video_width, int video_height,
int *dest_width, int *dest_height);
} xshm_driver_t;
@@ -445,7 +449,8 @@ static void xshm_calc_output_size (xshm_driver_t *this) {
this->output_height = this->delivered_height;
this->ratio_factor = 1.0;
- this->calc_dest_size (this->output_width, this->output_height,
+ this->calc_dest_size (this->user_data,
+ this->output_width, this->output_height,
&dest_width, &dest_height);
} else {
@@ -528,7 +533,8 @@ static void xshm_calc_output_size (xshm_driver_t *this) {
ideal_height != this->delivered_height )
ideal_width &= ~7;
- this->calc_dest_size (ideal_width, ideal_height,
+ this->calc_dest_size (this->user_data,
+ ideal_width, ideal_height,
&dest_width, &dest_height);
/*
@@ -776,7 +782,8 @@ static void xshm_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
xprintf (VIDEO, "video_out_xshm: requesting dest size of %d x %d \n",
frame->rgb_width, frame->rgb_height);
- this->request_dest_size (frame->rgb_width, frame->rgb_height,
+ this->request_dest_size (this->user_data,
+ frame->rgb_width, frame->rgb_height,
&this->dest_x, &this->dest_y,
&this->gui_width, &this->gui_height);
/* for fullscreen modes, clear unused areas of old video area */
@@ -1174,6 +1181,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
this->display_ratio = visual->display_ratio;
this->request_dest_size = visual->request_dest_size;
this->calc_dest_size = visual->calc_dest_size;
+ this->user_data = visual->user_data;
this->output_width = 0;
this->output_height = 0;
this->output_scale_factor = 1.0;
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index cdbbcd030..30bc08e70 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.69 2001/10/15 12:20:01 jkeil Exp $
+ * $Id: video_out_xv.c,v 1.70 2001/10/22 00:52:10 guenter Exp $
*
* video_out_xv.c, X11 video extension interface for xine
*
@@ -51,7 +51,6 @@
#include <string.h>
#include "monitor.h"
-#include "utils.h"
#include "video_out.h"
#include "video_out_x11.h"
#include "xine_internal.h"
@@ -131,9 +130,12 @@ typedef struct {
double display_ratio; /* given by visual parameter
from init function */
+ void *user_data;
+
/* gui callback */
- void (*request_dest_size) (int video_width, int video_height,
+ void (*request_dest_size) (void *user_data,
+ int video_width, int video_height,
int *dest_x, int *dest_y,
int *dest_height, int *dest_width);
@@ -331,7 +333,7 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,
char *data;
- data = xmalloc (width * height * 3/2);
+ data = malloc (width * height * 3/2);
image = XvCreateImage (this->display, this->xv_port,
xv_format, data, width, height);
@@ -605,7 +607,8 @@ static void xv_calc_format (xv_driver_t *this,
* ask gui to adapt to this size
*/
- this->request_dest_size (ideal_width, ideal_height,
+ this->request_dest_size (this->user_data,
+ ideal_width, ideal_height,
&dest_x, &dest_y, &dest_width, &dest_height);
xv_adapt_to_output_area (this, dest_x, dest_y, dest_width, dest_height);
@@ -1025,6 +1028,7 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
this->screen = visual->screen;
this->display_ratio = visual->display_ratio;
this->request_dest_size = visual->request_dest_size;
+ this->user_data = visual->user_data;
this->output_xoffset = 0;
this->output_yoffset = 0;
this->output_width = 0;