diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-08-18 23:30:51 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-08-18 23:30:51 +0000 |
commit | adede32c4c69ac9faa5461011ba1df863a67a092 (patch) | |
tree | 223f2e4e9954e1d5433e6009f8fb4c45c9e774a0 | |
parent | ba9d39dfd48002c17bf17517cf75400927ba844d (diff) | |
download | xine-lib-adede32c4c69ac9faa5461011ba1df863a67a092.tar.gz xine-lib-adede32c4c69ac9faa5461011ba1df863a67a092.tar.bz2 |
various cleanups; 8 bit depth detection and handling (yuv2rgb not implemented yet), smaller memory footprint, deprecated mpg123 plugin
CVS patchset: 449
CVS date: 2001/08/18 23:30:51
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg.c | 4 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg_block.c | 4 | ||||
-rw-r--r-- | src/video_out/video_out_xshm.c | 21 | ||||
-rw-r--r-- | src/video_out/yuv2rgb.c | 140 | ||||
-rw-r--r-- | src/video_out/yuv2rgb.h | 1 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.c | 4 |
7 files changed, 166 insertions, 10 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 647961f9e..f22f2a189 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = audio_out video_out dxr3 input libmpeg2 libspudec demuxers \ - libac3 libffmpeg libmpg123 liblpcm libw32dll xine-engine libmad + libac3 libffmpeg liblpcm libw32dll xine-engine libmad debug: @list='$(SUBDIRS)'; for subdir in $$list; do \ diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index a33419515..b895ea109 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.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: demux_mpeg.c,v 1.29 2001/08/12 15:12:54 guenter Exp $ + * $Id: demux_mpeg.c,v 1.30 2001/08/18 23:30:51 guenter Exp $ * * demultiplexer for mpeg 1/2 program streams * reads streams of variable blocksizes @@ -42,7 +42,7 @@ #include "demux.h" #include "utils.h" -#define NUM_PREVIEW_BUFFERS 400 +#define NUM_PREVIEW_BUFFERS 250 static uint32_t xine_debug; diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index 69a2236ad..57e595eb4 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.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: demux_mpeg_block.c,v 1.30 2001/08/17 16:15:36 f1rmb Exp $ + * $Id: demux_mpeg_block.c,v 1.31 2001/08/18 23:30:51 guenter Exp $ * * demultiplexer for mpeg 1/2 program streams * @@ -38,7 +38,7 @@ #include "demux.h" #include "utils.h" -#define NUM_PREVIEW_BUFFERS 400 +#define NUM_PREVIEW_BUFFERS 250 static uint32_t xine_debug; diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index a0ff2a9cc..a14945968 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.25 2001/08/17 16:00:02 ehasenle Exp $ + * $Id: video_out_xshm.c,v 1.26 2001/08/18 23:30:51 guenter Exp $ * * video_out_xshm.c, X11 shared memory extension interface for xine * @@ -987,11 +987,25 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { this->depth = 24; } + XMatchVisualInfo(display, this->screen, this->depth, TrueColor, &this->vinfo); + + if (!XMatchVisualInfo(display, this->screen, this->depth, TrueColor, + &this->vinfo)) { + + printf ("video_out_xshm: couldn't find true color visual\n"); + + this->depth = 8; + if (!XMatchVisualInfo(display, this->screen, this->depth, StaticColor, + &this->vinfo)) { + printf ("video_out_xshm: couldn't find static color visual\n"); + return NULL; + } + } + if (this->depth>16) printf ("\n\nWARNING: current display depth is %d. For better performance\na depth of 16 bpp is recommended!\n\n", this->depth); - XMatchVisualInfo(display, this->screen, this->depth, TrueColor, &this->vinfo); /* * check for X shared memory support @@ -1046,6 +1060,9 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { else mode = MODE_15_BGR; break; + case 8: + mode = MODE_PALETTE; + break; } if (!mode) { diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c index d92b62839..f8a43cf2e 100644 --- a/src/video_out/yuv2rgb.c +++ b/src/video_out/yuv2rgb.c @@ -22,7 +22,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: yuv2rgb.c,v 1.11 2001/08/07 23:59:50 guenter Exp $ + * $Id: yuv2rgb.c,v 1.12 2001/08/18 23:30:51 guenter Exp $ */ #include "config.h" @@ -762,6 +762,134 @@ static void yuv2rgb_c_16 (yuv2rgb_t *this, uint8_t * _dst, } } +/* now for something different: 256 color mode */ +static void yuv2rgb_c_palette (yuv2rgb_t *this, uint8_t * _dst, + uint8_t * _py, uint8_t * _pu, uint8_t * _pv) +{ + int U, V, Y; + uint8_t * py_1, * py_2, * pu, * pv; + uint8_t * r, * g, * b; + uint8_t * dst_1, * dst_2; + int width, height; + int dy; + + if (this->do_scale) { + scale_line (_pu, this->u_buffer, + this->dest_width >> 1, this->step_dx); + scale_line (_pv, this->v_buffer, + this->dest_width >> 1, this->step_dx); + scale_line (_py, this->y_buffer, + this->dest_width, this->step_dx); + + dy = 0; + height = this->source_height; + + for (;;) { + dst_1 = _dst; + py_1 = this->y_buffer; + pu = this->u_buffer; + pv = this->v_buffer; + + width = this->dest_width >> 3; + + do { + /* FIXME + RGB(0); + DST1(0); + + RGB(1); + DST1(1); + + RGB(2); + DST1(2); + + RGB(3); + DST1(3); + */ + + pu += 4; + pv += 4; + py_1 += 8; + dst_1 += 8; + } while (--width); + + dy += this->step_dy; + _dst += this->rgb_stride; + + while (dy < 32768) { + + memcpy (_dst, (uint8_t*)_dst-this->rgb_stride, this->dest_width*2); + + dy += this->step_dy; + _dst += this->rgb_stride; + } + + if (--height <= 0) + break; + + dy -= 32768; + _py += this->y_stride; + + scale_line (_py, this->y_buffer, + this->dest_width, this->step_dx); + + if (!(height & 1)) { + _pu += this->uv_stride; + _pv += this->uv_stride; + + scale_line (_pu, this->u_buffer, + this->dest_width >> 1, this->step_dx); + scale_line (_pv, this->v_buffer, + this->dest_width >> 1, this->step_dx); + + } + } + } else { + height = this->source_height >> 1; + do { + dst_1 = _dst; + dst_2 = _dst + this->rgb_stride; + py_1 = _py; + py_2 = _py + this->y_stride; + pu = _pu; + pv = _pv; + width = this->source_width >> 3; + do { + /* + RGB(0); + DST1(0); + DST2(0); + + RGB(1); + DST2(1); + DST1(1); + + RGB(2); + DST1(2); + DST2(2); + + RGB(3); + DST2(3); + DST1(3); + */ + + pu += 4; + pv += 4; + py_1 += 8; + py_2 += 8; + dst_1 += 8; + dst_2 += 8; + } while (--width); + + _dst += 2 * this->rgb_stride; + _py += 2 * this->y_stride; + _pu += this->uv_stride; + _pv += this->uv_stride; + + } while (--height); + } +} + static int div_round (int dividend, int divisor) { if (dividend > 0) @@ -862,6 +990,12 @@ static void yuv2rgb_setup_tables (yuv2rgb_t *this, int mode) } break; + case MODE_PALETTE: + + /* FIXME: set up 256 color table */ + + break; + default: fprintf (stderr, "mode %d not supported by yuv2rgb\n", mode); exit (1); @@ -898,6 +1032,10 @@ static void yuv2rgb_c_init (yuv2rgb_t *this, int mode) this->yuv2rgb_fun = yuv2rgb_c_16; break; + case MODE_PALETTE: + this->yuv2rgb_fun = yuv2rgb_c_palette; + break; + default: fprintf (stderr, "mode %d not supported by yuv2rgb\n", mode); exit (1); diff --git a/src/video_out/yuv2rgb.h b/src/video_out/yuv2rgb.h index 6e84bd923..8efbbfbd9 100644 --- a/src/video_out/yuv2rgb.h +++ b/src/video_out/yuv2rgb.h @@ -16,6 +16,7 @@ #define MODE_24_BGR 6 #define MODE_32_RGB 7 #define MODE_32_BGR 8 +#define MODE_PALETTE 9 typedef struct yuv2rgb_s yuv2rgb_t; diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index 47937116c..6a5fe6ffc 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.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_decoder.c,v 1.39 2001/08/16 19:58:37 ehasenle Exp $ + * $Id: video_decoder.c,v 1.40 2001/08/18 23:30:51 guenter Exp $ * */ @@ -217,7 +217,7 @@ void video_decoder_init (xine_t *this) { pthread_attr_t pth_attrs; struct sched_param pth_params; - this->video_fifo = fifo_buffer_new (500, 65536); + this->video_fifo = fifo_buffer_new (500, 4096); if((xine_register_event_listener(this, spu_event_handler)) < 1) { fprintf(stderr, "xine_register_event_listener() failed.\n"); |