diff options
-rw-r--r-- | src/libfaad/Makefile.am | 3 | ||||
-rw-r--r-- | src/video_out/Makefile.am | 3 | ||||
-rw-r--r-- | src/video_out/video_out_aa.c | 21 | ||||
-rw-r--r-- | src/video_out/video_out_directfb.c | 20 | ||||
-rw-r--r-- | src/video_out/video_out_opengl.c | 37 | ||||
-rw-r--r-- | src/video_out/video_out_xshm.c | 24 |
6 files changed, 24 insertions, 84 deletions
diff --git a/src/libfaad/Makefile.am b/src/libfaad/Makefile.am index 3dcd38753..f027a4546 100644 --- a/src/libfaad/Makefile.am +++ b/src/libfaad/Makefile.am @@ -28,7 +28,8 @@ xineplug_decode_faad_la_SOURCES = xine_decoder.c \ hcb_1.c hcb_2.c hcb_3.c hcb_4.c hcb_5.c hcb_6.c hcb_7.c hcb_8.c \ hcb_9.c hcb_10.c hcb_11.c hcb_sf.c xineplug_decode_faad_la_LDFLAGS = -avoid-version -module -xineplug_decode_faad_la_LIBADD = $(top_builddir)/src/libfaad/fftw/libfftw.la +xineplug_decode_faad_la_LIBADD = $(top_builddir)/src/libfaad/fftw/libfftw.la \ + $(top_builddir)/src/xine-utils/libxineutils.la noinst_HEADERS = analysis.h bits.h data.h decoder.h drc.h error.h \ filtbank.h huffman.h ic_predict.h is.h kbd_win.h \ diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am index a11d64bde..3b62639b5 100644 --- a/src/video_out/Makefile.am +++ b/src/video_out/Makefile.am @@ -62,7 +62,8 @@ xineplug_vo_out_xshm_la_LDFLAGS = -avoid-version -module xineplug_vo_out_opengl_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \ alphablend.c video_out_opengl.c -xineplug_vo_out_opengl_la_LIBADD = $(OPENGL_LIBS) $(GLUT_LIBS) $(GLU_LIBS) $(X_LIBS) +xineplug_vo_out_opengl_la_LIBADD = $(OPENGL_LIBS) $(GLUT_LIBS) $(GLU_LIBS) $(X_LIBS) \ + $(top_builddir)/src/xine-utils/libxineutils.la xineplug_vo_out_opengl_la_LDFLAGS = -avoid-version -module xineplug_vo_out_syncfb_la_SOURCES = alphablend.c video_out_syncfb.c diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c index 48e168e38..888ed4501 100644 --- a/src/video_out/video_out_aa.c +++ b/src/video_out/video_out_aa.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_aa.c,v 1.22 2002/07/15 21:42:34 esnel Exp $ + * $Id: video_out_aa.c,v 1.23 2002/07/16 19:33:37 esnel Exp $ * * video_out_aa.c, ascii-art output plugin for xine * @@ -42,6 +42,7 @@ #include "video_out.h" #include "xine_internal.h" +#include "xineutils.h" /* * global variables @@ -80,18 +81,6 @@ static uint32_t aa_get_capabilities (vo_driver_t *this) { return VO_CAP_YV12 | VO_CAP_YUY2; } -static void *malloc_aligned (size_t alignment, size_t size, void **mem) { - char *aligned; - - aligned = malloc (size+alignment); - *mem = aligned; - - while ((int) aligned % alignment) - aligned++; - - return aligned; -} - static void aa_dispose_frame (vo_frame_t *vo_img) { aa_frame_t *frame = (aa_frame_t *)vo_img; @@ -158,9 +147,9 @@ static void aa_update_frame_format (vo_driver_t *this, vo_frame_t *img, frame->vo_frame.pitches[0] = 8*((width + 7) / 8); frame->vo_frame.pitches[1] = 8*((width + 15) / 16); frame->vo_frame.pitches[2] = 8*((width + 15) / 16); - frame->vo_frame.base[0] = malloc_aligned(16, frame->vo_frame.pitches[0] * height, (void**) &frame->mem[0]); - frame->vo_frame.base[1] = malloc_aligned(16, frame->vo_frame.pitches[1] * ((height+1)/2), (void**) &frame->mem[1]); - frame->vo_frame.base[2] = malloc_aligned(16, frame->vo_frame.pitches[2] * ((height+1)/2), (void**) &frame->mem[2]); + frame->vo_frame.base[0] = xine_xmalloc_aligned(16, frame->vo_frame.pitches[0] * height, (void**) &frame->mem[0]); + frame->vo_frame.base[1] = xine_xmalloc_aligned(16, frame->vo_frame.pitches[1] * ((height+1)/2), (void**) &frame->mem[1]); + frame->vo_frame.base[2] = xine_xmalloc_aligned(16, frame->vo_frame.pitches[2] * ((height+1)/2), (void**) &frame->mem[2]); /* printf ("allocated yuv memory for %d x %d image\n", width, height); */ diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c index 56e9951b2..e12093e9e 100644 --- a/src/video_out/video_out_directfb.c +++ b/src/video_out/video_out_directfb.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_directfb.c,v 1.10 2002/07/15 21:42:34 esnel Exp $ + * $Id: video_out_directfb.c,v 1.11 2002/07/16 19:33:37 esnel Exp $ * * DirectFB based output plugin. * Rich Wareham <richwareham@users.sourceforge.net> @@ -125,24 +125,6 @@ typedef struct directfb_driver_s { /* - * first, some utility functions - */ -static void *my_malloc_aligned (size_t alignment, size_t size, uint8_t **chunk) { - - uint8_t *pMem; - - pMem = xine_xmalloc (size+alignment); - - *chunk = pMem; - - while ((int) pMem % alignment) - pMem++; - - return pMem; -} - - -/* * and now, the driver functions */ diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c index 93d7c39d3..5a06fbac4 100644 --- a/src/video_out/video_out_opengl.c +++ b/src/video_out/video_out_opengl.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_opengl.c,v 1.14 2002/07/15 21:42:34 esnel Exp $ + * $Id: video_out_opengl.c,v 1.15 2002/07/16 19:33:37 esnel Exp $ * * video_out_glut.c, glut based OpenGL rendering interface for xine * Matthias Hopf <mat@mshopf.de> @@ -200,25 +200,6 @@ enum { CONTEXT_BAD = 0, CONTEXT_SAME_DRAWABLE, CONTEXT_RELOAD, CONTEXT_SET }; /* - * first, some utility functions - */ - -static void *my_malloc_aligned (size_t alignment, size_t size, uint8_t **chunk) { - - uint8_t *pMem; - - pMem = xine_xmalloc (size+alignment); - - *chunk = pMem; - - while ((int) pMem % alignment) - pMem++; - - return pMem; -} - - -/* * and now, the driver functions */ @@ -361,17 +342,17 @@ static void opengl_update_frame_format (vo_driver_t *this_gen, frame->vo_frame.pitches[0] = 8*((width + 7) / 8); frame->vo_frame.pitches[1] = 8*((width + 15) / 16); frame->vo_frame.pitches[2] = 8*((width + 15) / 16); - frame->vo_frame.base[0] = my_malloc_aligned(16, frame->vo_frame.pitches[0] * height, - &frame->chunk[0]); - frame->vo_frame.base[1] = my_malloc_aligned(16, frame->vo_frame.pitches[1] * ((height+1)/2), - &frame->chunk[1]); - frame->vo_frame.base[2] = my_malloc_aligned(16, frame->vo_frame.pitches[2] * ((height+1)/2), - &frame->chunk[2]); + frame->vo_frame.base[0] = xine_xmalloc_aligned(16, frame->vo_frame.pitches[0] * height, + &frame->chunk[0]); + frame->vo_frame.base[1] = xine_xmalloc_aligned(16, frame->vo_frame.pitches[1] * ((height+1)/2), + &frame->chunk[1]); + frame->vo_frame.base[2] = xine_xmalloc_aligned(16, frame->vo_frame.pitches[2] * ((height+1)/2), + &frame->chunk[2]); break; case IMGFMT_YUY2: frame->vo_frame.pitches[0] = 8*((width + 3) / 4); - frame->vo_frame.base[0] = my_malloc_aligned(16, frame->vo_frame.pitches[0] * height, - &frame->chunk[0]); + frame->vo_frame.base[0] = xine_xmalloc_aligned(16, frame->vo_frame.pitches[0] * height, + &frame->chunk[0]); break; default: fprintf (stderr, "video_out_opengl: image format %d not supported, update video driver!\n", format); diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index 2ab6d8055..39b7b9708 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.79 2002/07/15 21:42:34 esnel Exp $ + * $Id: video_out_xshm.c,v 1.80 2002/07/16 19:33:37 esnel Exp $ * * video_out_xshm.c, X11 shared memory extension interface for xine * @@ -203,20 +203,6 @@ static void x11_DeInstallXErrorHandler (xshm_driver_t *this) XFlush (this->display); } -static void *my_malloc_aligned (size_t alignment, size_t size, uint8_t **chunk) { - - uint8_t *pMem; - - pMem = xine_xmalloc (size+alignment); - - *chunk = pMem; - - while ((int) pMem % alignment) - pMem++; - - return pMem; -} - /* * allocate an XImage, try XShm first but fall back to * plain X11 if XShm should fail @@ -673,12 +659,12 @@ static void xshm_update_frame_format (vo_driver_t *this_gen, frame->vo_frame.pitches[0] = 8*((width + 7) / 8); frame->vo_frame.pitches[1] = 8*((width + 15) / 16); frame->vo_frame.pitches[2] = 8*((width + 15) / 16); - frame->vo_frame.base[0] = my_malloc_aligned (16, frame->vo_frame.pitches[0] * height, &frame->chunk[0]); - frame->vo_frame.base[1] = my_malloc_aligned (16, frame->vo_frame.pitches[1] * ((height+1)/2), &frame->chunk[1]); - frame->vo_frame.base[2] = my_malloc_aligned (16, frame->vo_frame.pitches[2] * ((height+1)/2), &frame->chunk[2]); + frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, &frame->chunk[0]); + frame->vo_frame.base[1] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[1] * ((height+1)/2), &frame->chunk[1]); + frame->vo_frame.base[2] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[2] * ((height+1)/2), &frame->chunk[2]); } else { frame->vo_frame.pitches[0] = 8*((width + 3) / 4); - frame->vo_frame.base[0] = my_malloc_aligned (16, frame->vo_frame.pitches[0] * height, &frame->chunk[0]); + frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, &frame->chunk[0]); frame->chunk[1] = NULL; frame->chunk[2] = NULL; } |