diff options
-rw-r--r-- | xine_fbfe_frontend.c | 8 | ||||
-rw-r--r-- | xine_frontend.c | 32 | ||||
-rw-r--r-- | xine_sxfe_frontend.c | 13 |
3 files changed, 37 insertions, 16 deletions
diff --git a/xine_fbfe_frontend.c b/xine_fbfe_frontend.c index 6d3d50a0..473f3065 100644 --- a/xine_fbfe_frontend.c +++ b/xine_fbfe_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_fbfe_frontend.c,v 1.33 2008-06-19 20:43:35 phintuka Exp $ + * $Id: xine_fbfe_frontend.c,v 1.34 2008-11-11 12:38:00 phintuka Exp $ * */ @@ -29,12 +29,6 @@ # include <linux/kd.h> #endif -#ifdef boolean -# define HAVE_BOOLEAN -#endif -#include <jpeglib.h> -#undef boolean - /* framegrab ports */ #define XINE_ENABLE_EXPERIMENTAL_FEATURES diff --git a/xine_frontend.c b/xine_frontend.c index d09a5047..b9c8cb03 100644 --- a/xine_frontend.c +++ b/xine_frontend.c @@ -4,12 +4,20 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_frontend.c,v 1.73 2008-11-10 23:59:35 phintuka Exp $ + * $Id: xine_frontend.c,v 1.74 2008-11-11 12:38:00 phintuka Exp $ * */ #include "features.h" +#ifdef HAVE_LIBJPEG +# ifdef boolean +# define HAVE_BOOLEAN +# endif +# include <jpeglib.h> +# undef boolean +#endif + #ifndef XINE_VERSION_CODE # define XINE_VERSION_CODE (XINE_MAJOR_VERSION*10000 + \ XINE_MINOR_VERSION*100 + \ @@ -22,6 +30,10 @@ #include "xine_frontend_internal.h" #include "xine/post.h" +#undef MIN +#define MIN(a,b) ( (a) < (b) ? (a) : (b)) +#undef MAX +#define MAX(a,b) ( (a) > (b) ? (a) : (b)) static int verbose_xine_log = 0; @@ -1362,6 +1374,8 @@ static void *fe_control(frontend_t *this_gen, const char *cmd) * - move to xine_input_vdr ? */ +#ifdef HAVE_LIBJPEG + #define JPEGCOMPRESSMEM 500000 typedef struct tJpegCompressData_s { @@ -1407,17 +1421,28 @@ static void JpegCompressTermDestination(const j_compress_ptr cinfo) } } +#endif /* HAVE_LIBJPEG */ + static char *fe_grab(frontend_t *this_gen, int *size, int jpeg, int quality, int width, int height) { +#ifdef HAVE_LIBJPEG struct jpeg_destination_mgr jdm; struct jpeg_compress_struct cinfo; struct jpeg_error_mgr jerr; tJpegCompressData jcd; +#endif fe_t *this = (fe_t*)this_gen; vo_frame_t *frame, *img; +#ifndef HAVE_LIBJPEG + if(jpeg) { + LOGMSG("fe_grab: JPEG grab support was not compiled in"); + return 0; + } +#endif /* HAVE_LIBJPEG */ + #ifndef PPM_SUPPORTED if(!jpeg) { LOGMSG("fe_grab: PPM grab not implemented"); @@ -1473,6 +1498,8 @@ static char *fe_grab(frontend_t *this_gen, int *size, int jpeg, frame = img; } +#ifdef HAVE_LIBJPEG + /* #warning TODO: no scaling implemented */ if(width != frame->width) width = frame->width; @@ -1564,6 +1591,9 @@ static char *fe_grab(frontend_t *this_gen, int *size, int jpeg, *size = jcd.size; return (char*) jcd.mem; +#else /* HAVE_LIBJPEG */ + return NULL; +#endif } diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c index 9d27f4ab..49a19ee2 100644 --- a/xine_sxfe_frontend.c +++ b/xine_sxfe_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_sxfe_frontend.c,v 1.93 2008-11-10 21:30:28 phintuka Exp $ + * $Id: xine_sxfe_frontend.c,v 1.94 2008-11-11 12:38:00 phintuka Exp $ * */ @@ -29,6 +29,7 @@ #include <sys/shm.h> #include <math.h> +/* X11 */ #include <X11/Xlib.h> #include <X11/Xatom.h> #include <X11/keysym.h> @@ -52,11 +53,6 @@ # include <X11/extensions/Xinerama.h> #endif -#ifdef boolean -# define HAVE_BOOLEAN -#endif -#include <jpeglib.h> -#undef boolean /* framegrab ports */ #define XINE_ENABLE_EXPERIMENTAL_FEATURES @@ -73,6 +69,7 @@ #include <xine/input_plugin.h> #include <xine/plugin_catalog.h> + #include "xine_input_vdr.h" #include "xine_osd_command.h" @@ -1404,7 +1401,7 @@ static void sxfe_interrupt(frontend_t *this_gen) .format = 32, }; XLockDisplay (this->display); - if(!XSendEvent(event.display, event.window, TRUE, /*KeyPressMask*/0, (XEvent *)&event)) + if(!XSendEvent(event.display, event.window, 1, /*KeyPressMask*/0, (XEvent *)&event)) LOGERR("sxfe_interrupt: XSendEvent(ClientMessage) FAILED\n"); XFlush(this->display); @@ -1688,7 +1685,7 @@ static void sxfe_display_close(frontend_t *this_gen) #endif #ifdef HAVE_XDPMS - if(this->dpms_state == TRUE) + if(this->dpms_state) DPMSEnable(this->display); #endif if(this->window_id <= 0) { |