summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio_out/audio_oss_out.c104
-rw-r--r--src/libmpeg2/idct.c10
-rw-r--r--src/libmpeg2/motion_comp.c12
-rw-r--r--src/video_out/deinterlace.c2
-rw-r--r--src/video_out/deinterlace.h2
-rw-r--r--src/video_out/video_out_aa.c4
-rw-r--r--src/video_out/video_out_directfb.c4
-rw-r--r--src/video_out/video_out_pgx64.c4
-rw-r--r--src/video_out/video_out_xshm.c70
-rw-r--r--src/video_out/video_out_xv.c107
-rw-r--r--src/video_out/yuv2rgb.c17
-rw-r--r--src/video_out/yuv2rgb_mlib.c2
-rw-r--r--src/xine-engine/demux.c4
-rw-r--r--src/xine-engine/load_plugins.c13
-rw-r--r--src/xine-engine/metronom.c44
-rw-r--r--src/xine-engine/video_out.c4
-rw-r--r--src/xine-engine/xine.c84
17 files changed, 316 insertions, 171 deletions
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c
index 2a25ec6ba..fac4816f4 100644
--- a/src/audio_out/audio_oss_out.c
+++ b/src/audio_out/audio_oss_out.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: audio_oss_out.c,v 1.86 2003/02/08 15:14:45 miguelfreitas Exp $
+ * $Id: audio_oss_out.c,v 1.87 2003/03/06 16:49:30 guenter Exp $
*
* 20-8-2001 First implementation of Audio sync and Audio driver separation.
* Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk
@@ -142,12 +142,14 @@ typedef struct oss_driver_s {
struct timeval start_time;
+ xine_t *xine;
} oss_driver_t;
typedef struct {
- audio_driver_class_t driver_class;
+ audio_driver_class_t driver_class;
- config_values_t *config;
+ config_values_t *config;
+ xine_t *xine;
} oss_class_t;
/*
@@ -159,8 +161,9 @@ static int ao_oss_open(ao_driver_t *this_gen,
oss_driver_t *this = (oss_driver_t *) this_gen;
int tmp;
- printf ("audio_oss_out: ao_open rate=%d, mode=%d, dev=%s\n",
- rate, mode, this->audio_dev);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("audio_oss_out: ao_open rate=%d, mode=%d, dev=%s\n",
+ rate, mode, this->audio_dev);
if ( (mode & this->capabilities) == 0 ) {
printf ("audio_oss_out: unsupported mode %08x\n", mode);
@@ -188,7 +191,7 @@ static int ao_oss_open(ao_driver_t *this_gen,
*/
this->audio_fd=open(this->audio_dev,O_WRONLY|O_NONBLOCK);
- if(this->audio_fd < 0) {
+ if (this->audio_fd < 0) {
printf("audio_oss_out: Opening audio device %s: %s\n",
this->audio_dev, strerror(errno));
return 0;
@@ -211,7 +214,8 @@ static int ao_oss_open(ao_driver_t *this_gen,
tmp = this->input_sample_rate;
if (ioctl(this->audio_fd,SNDCTL_DSP_SPEED, &tmp) == -1) {
- printf ("audio_oss_out: warning: sampling rate %d Hz not supported, trying 44100 Hz\n", this->input_sample_rate);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("audio_oss_out: warning: sampling rate %d Hz not supported, trying 44100 Hz\n", this->input_sample_rate);
tmp = 44100;
if (ioctl(this->audio_fd,SNDCTL_DSP_SPEED, &tmp) == -1) {
@@ -221,8 +225,9 @@ static int ao_oss_open(ao_driver_t *this_gen,
}
this->output_sample_rate = tmp;
this->output_sample_k_rate = this->output_sample_rate / 1000;
- printf ("audio_oss_out: audio rate : %d requested, %d provided by device/sec\n",
- this->input_sample_rate, this->output_sample_rate);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("audio_oss_out: audio rate : %d requested, %d provided by device/sec\n",
+ this->input_sample_rate, this->output_sample_rate);
}
/*
* set number of channels / a52 passthrough
@@ -260,11 +265,13 @@ static int ao_oss_open(ao_driver_t *this_gen,
this->num_channels = 2; /* FIXME: is this correct ? */
this->output_sample_rate = this->input_sample_rate;
this->output_sample_k_rate = this->output_sample_rate / 1000;
- printf ("audio_oss_out: AO_CAP_MODE_A52\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("audio_oss_out: AO_CAP_MODE_A52\n");
break;
}
- printf ("audio_oss_out: %d channels output\n",this->num_channels);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("audio_oss_out: %d channels output\n",this->num_channels);
this->bytes_per_frame=(this->bits_per_sample*this->num_channels)/8;
/*
@@ -577,8 +584,8 @@ static int ao_oss_set_property (ao_driver_t *this_gen, int property, int value)
}
else
- printf("%s(): open() %s failed: %s\n",
- __XINE_FUNCTION__, this->mixer.name, strerror(errno));
+ printf("audio_oss_out: open() %s failed: %s\n",
+ this->mixer.name, strerror(errno));
}
else
this->mixer.volume = value;
@@ -613,8 +620,8 @@ static int ao_oss_set_property (ao_driver_t *this_gen, int property, int value)
}
else
- printf("%s(): open() %s failed: %s\n",
- __XINE_FUNCTION__, this->mixer.name, strerror(errno));
+ printf("audio_oss_out: open() %s failed: %s\n",
+ this->mixer.name, strerror(errno));
}
else
(void) ao_oss_set_property(&this->ao_driver, this->mixer.prop, this->mixer.volume);
@@ -695,7 +702,8 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
* find best device driver/channel
*/
- printf ("audio_oss_out: Opening audio device...\n");
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("audio_oss_out: Opening audio device...\n");
best_rate = 0;
devnum = config->register_num (config, "audio.oss_device_num", -1,
@@ -739,12 +747,13 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
* open that device
*/
- printf ("audio_oss_out: using device >%s<\n",
- this->audio_dev);
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("audio_oss_out: using device >%s<\n",
+ this->audio_dev);
audio_fd=open(this->audio_dev, O_WRONLY|O_NONBLOCK);
- if(audio_fd < 0) {
+ if (audio_fd < 0) {
printf("audio_oss_out: opening audio device %s failed:\n%s\n",
this->audio_dev, strerror(errno));
@@ -779,10 +788,12 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
*/
if (ioctl(audio_fd, SNDCTL_DSP_GETODELAY, &info) != -1) {
- printf("audio_oss_out: using SNDCTL_DSP_GETODELAY\n");
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("audio_oss_out: using SNDCTL_DSP_GETODELAY\n");
this->sync_method = OSS_SYNC_GETODELAY;
} else if (ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &info) != -1) {
- printf("audio_oss_out: using SNDCTL_DSP_GETOPTR\n");
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("audio_oss_out: using SNDCTL_DSP_GETOPTR\n");
this->sync_method = OSS_SYNC_GETOPTR;
} else {
this->sync_method = OSS_SYNC_SOFTSYNC;
@@ -790,9 +801,11 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
}
if (this->sync_method == OSS_SYNC_SOFTSYNC) {
- printf ("audio_oss_out: Audio driver realtime sync disabled...\n");
- printf ("audio_oss_out: ...will use system real-time clock for soft-sync instead\n");
- printf ("audio_oss_out: ...there may be audio/video synchronization issues\n");
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf ("audio_oss_out: Audio driver realtime sync disabled...\n");
+ printf ("audio_oss_out: ...will use system real-time clock for soft-sync instead\n");
+ printf ("audio_oss_out: ...there may be audio/video synchronization issues\n");
+ }
gettimeofday(&this->start_time, NULL);
}
@@ -801,8 +814,10 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
char *buf;
int c;
- printf ("audio_oss_out: Audio driver realtime sync disabled...\n");
- printf ("audio_oss_out: ...probing output buffer size: ");
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf ("audio_oss_out: Audio driver realtime sync disabled...\n");
+ printf ("audio_oss_out: ...probing output buffer size: ");
+ }
this->buffer_size = 0;
if( (buf=malloc(1024)) != NULL ) {
@@ -817,9 +832,11 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
free(buf);
}
close(audio_fd);
- printf ("%d bytes\n", this->buffer_size );
- printf ("audio_oss_out: ...there may be audio/video synchronization issues\n");
-
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf ("%d bytes\n", this->buffer_size );
+ printf ("audio_oss_out: ...there may be audio/video synchronization issues\n");
+ }
+
audio_fd=open(this->audio_dev, O_WRONLY|O_NONBLOCK);
if(audio_fd < 0)
@@ -852,18 +869,21 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
return NULL;
}
- printf ("audio_oss_out: supported modes are ");
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("audio_oss_out: supported modes are ");
num_channels = 1;
status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);
if ( (status != -1) && (num_channels==1) ) {
this->capabilities |= AO_CAP_MODE_MONO;
- printf ("mono ");
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("mono ");
}
num_channels = 2;
status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);
if ( (status != -1) && (num_channels==2) ) {
this->capabilities |= AO_CAP_MODE_STEREO;
- printf ("stereo ");
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("stereo ");
}
num_channels = 4;
status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);
@@ -872,8 +892,9 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
_("Enable 4.0 channel analog surround output"),
NULL, 0, NULL, NULL)) {
this->capabilities |= AO_CAP_MODE_4CHANNEL;
- printf ("4-channel ");
- } else
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("4-channel ");
+ } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
printf ("(4-channel not enabled in xine config) " );
}
num_channels = 5;
@@ -883,8 +904,9 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
_("Enable 5.0 channel analog surround output"),
NULL, 0, NULL, NULL)) {
this->capabilities |= AO_CAP_MODE_5CHANNEL;
- printf ("5-channel ");
- } else
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("5-channel ");
+ } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
printf ("(5-channel not enabled in xine config) " );
}
num_channels = 6;
@@ -894,8 +916,9 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
_("Enable 5.1 channel analog surround output"),
NULL, 0, NULL, NULL)) {
this->capabilities |= AO_CAP_MODE_5_1CHANNEL;
- printf ("5.1-channel ");
- } else
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("5.1-channel ");
+ } else if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
printf ("(5.1-channel not enabled in xine config) " );
}
@@ -911,7 +934,8 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
printf ("(a/52-pass-through not enabled in xine config)");
}
- printf ("\n");
+ if (class->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("\n");
/*
* mixer initialisation.
@@ -965,6 +989,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
this->output_sample_rate = 0;
this->output_sample_k_rate = 0;
this->audio_fd = -1;
+ this->xine = class->xine;
this->config = config;
this->ao_driver.get_capabilities = ao_oss_get_capabilities;
@@ -1014,6 +1039,7 @@ static void *init_class (xine_t *xine, void *data) {
this->driver_class.dispose = dispose_class;
this->config = xine->config;
+ this->xine = xine;
return this;
}
diff --git a/src/libmpeg2/idct.c b/src/libmpeg2/idct.c
index abc87a0a1..645fc03c1 100644
--- a/src/libmpeg2/idct.c
+++ b/src/libmpeg2/idct.c
@@ -264,12 +264,16 @@ void mpeg2_idct_init (uint32_t mm_accel)
{
#ifdef ARCH_X86
if (mm_accel & MM_ACCEL_X86_MMXEXT) {
+#ifdef LOG
fprintf (stderr, "Using MMXEXT for IDCT transform\n");
+#endif
mpeg2_idct_copy = mpeg2_idct_copy_mmxext;
mpeg2_idct_add = mpeg2_idct_add_mmxext;
mpeg2_idct_mmx_init ();
} else if (mm_accel & MM_ACCEL_X86_MMX) {
+#ifdef LOG
fprintf (stderr, "Using MMX for IDCT transform\n");
+#endif
mpeg2_idct_copy = mpeg2_idct_copy_mmx;
mpeg2_idct_add = mpeg2_idct_add_mmx;
mpeg2_idct_mmx_init ();
@@ -277,7 +281,9 @@ void mpeg2_idct_init (uint32_t mm_accel)
#endif
#ifdef ARCH_PPC
if (mm_accel & MM_ACCEL_PPC_ALTIVEC) {
+#ifdef LOG
fprintf (stderr, "Using altivec for IDCT transform\n");
+#endif
mpeg2_idct_copy = mpeg2_idct_copy_altivec;
mpeg2_idct_add = mpeg2_idct_add_altivec;
mpeg2_idct_altivec_init ();
@@ -290,7 +296,9 @@ void mpeg2_idct_init (uint32_t mm_accel)
env_var = getenv ("MLIB_NON_IEEE");
if (env_var == NULL) {
+#ifdef LOG
fprintf (stderr, "Using mlib for IDCT transform\n");
+#endif
mpeg2_idct_add = mpeg2_idct_add_mlib;
} else {
fprintf (stderr, "Using non-IEEE mlib for IDCT transform\n");
@@ -302,7 +310,9 @@ void mpeg2_idct_init (uint32_t mm_accel)
{
int i;
+#ifdef LOG
fprintf (stderr, "No accelerated IDCT transform found\n");
+#endif
mpeg2_idct_copy = mpeg2_idct_copy_c;
mpeg2_idct_add = mpeg2_idct_add_c;
for (i = -384; i < 640; i++)
diff --git a/src/libmpeg2/motion_comp.c b/src/libmpeg2/motion_comp.c
index 21ec09a3d..e461dc749 100644
--- a/src/libmpeg2/motion_comp.c
+++ b/src/libmpeg2/motion_comp.c
@@ -35,30 +35,42 @@ void mpeg2_mc_init (uint32_t mm_accel)
{
#ifdef ARCH_X86
if (mm_accel & MM_ACCEL_X86_MMXEXT) {
+#ifdef LOG
fprintf (stderr, "Using MMXEXT for motion compensation\n");
+#endif
mpeg2_mc = mpeg2_mc_mmxext;
} else if (mm_accel & MM_ACCEL_X86_3DNOW) {
+#ifdef LOG
fprintf (stderr, "Using 3DNOW for motion compensation\n");
+#endif
mpeg2_mc = mpeg2_mc_3dnow;
} else if (mm_accel & MM_ACCEL_X86_MMX) {
+#ifdef LOG
fprintf (stderr, "Using MMX for motion compensation\n");
+#endif
mpeg2_mc = mpeg2_mc_mmx;
} else
#endif
#ifdef ARCH_PPC
if (mm_accel & MM_ACCEL_PPC_ALTIVEC) {
+#ifdef LOG
fprintf (stderr, "Using altivec for motion compensation\n");
+#endif
mpeg2_mc = mpeg2_mc_altivec;
} else
#endif
#ifdef LIBMPEG2_MLIB
if (mm_accel & MM_ACCEL_MLIB) {
+#ifdef LOG
fprintf (stderr, "Using mlib for motion compensation\n");
+#endif
mpeg2_mc = mpeg2_mc_mlib;
} else
#endif
{
+#ifdef LOG
fprintf (stderr, "No accelerated motion compensation found\n");
+#endif
mpeg2_mc = mpeg2_mc_c;
}
}
diff --git a/src/video_out/deinterlace.c b/src/video_out/deinterlace.c
index 28a054572..fac701b79 100644
--- a/src/video_out/deinterlace.c
+++ b/src/video_out/deinterlace.c
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2001 the xine project
*
- * This file is part of xine, a unix video player.
+ * This file is part of xine, a free 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
diff --git a/src/video_out/deinterlace.h b/src/video_out/deinterlace.h
index 4381701f5..9cdbab1dd 100644
--- a/src/video_out/deinterlace.h
+++ b/src/video_out/deinterlace.h
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2001 the xine project
*
- * This file is part of xine, a unix video player.
+ * This file is part of xine, a free 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
diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c
index 17cb93280..a164fcecd 100644
--- a/src/video_out/video_out_aa.c
+++ b/src/video_out/video_out_aa.c
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2000-2001 the xine project
*
- * This file is part of xine, a unix video player.
+ * This file is part of xine, a free 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
@@ -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.33 2002/12/21 12:56:49 miguelfreitas Exp $
+ * $Id: video_out_aa.c,v 1.34 2003/03/06 16:49:31 guenter Exp $
*
* video_out_aa.c, ascii-art output plugin for xine
*
diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c
index 4ddda3eb0..e64cb667b 100644
--- a/src/video_out/video_out_directfb.c
+++ b/src/video_out/video_out_directfb.c
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2000, 2001 the xine project
*
- * This file is part of xine, a unix video player.
+ * This file is part of xine, a free 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
@@ -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.15 2003/02/28 02:51:51 storri Exp $
+ * $Id: video_out_directfb.c,v 1.16 2003/03/06 16:49:31 guenter Exp $
*
* DirectFB based output plugin.
* Rich Wareham <richwareham@users.sourceforge.net>
diff --git a/src/video_out/video_out_pgx64.c b/src/video_out/video_out_pgx64.c
index 44bc0029c..cec39f13e 100644
--- a/src/video_out/video_out_pgx64.c
+++ b/src/video_out/video_out_pgx64.c
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2000-2002 the xine project
*
- * This file is part of xine, a unix video player.
+ * This file is part of xine, a free 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
@@ -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_pgx64.c,v 1.23 2002/12/22 00:35:05 komadori Exp $
+ * $Id: video_out_pgx64.c,v 1.24 2003/03/06 16:49:31 guenter Exp $
*
* video_out_pgx64.c, Sun PGX64/PGX24 output plugin for xine
*
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index fc95264e0..c3c7dff07 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2002 the xine project
+ * Copyright (C) 2000-2003 the xine project
*
* This file is part of xine, a free video player.
*
@@ -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.107 2003/02/22 16:56:01 hadess Exp $
+ * $Id: video_out_xshm.c,v 1.108 2003/03/06 16:49:32 guenter Exp $
*
* video_out_xshm.c, X11 shared memory extension interface for xine
*
@@ -123,12 +123,14 @@ typedef struct xshm_driver_s {
int (*x11_old_error_handler) (Display *, XErrorEvent *);
+ xine_t *xine;
} xshm_driver_t;
typedef struct {
video_driver_class_t driver_class;
config_values_t *config;
+ xine_t *xine;
} xshm_class_t;
@@ -143,7 +145,7 @@ static int HandleXError (Display *display, XErrorEvent *xevent) {
XGetErrorText (display, xevent->error_code, str, 1024);
- printf ("received X error event: %s\n", str);
+ printf ("video_out_xshm: received X error event: %s\n", str);
gX11Fail = 1;
return 0;
@@ -191,8 +193,10 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,
height);
if (myimage == NULL ) {
- printf ("video_out_xshm: shared memory error when allocating image\n");
- printf ("video_out_xshm: => not using MIT Shared Memory extension.\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf ("video_out_xshm: shared memory error when allocating image\n");
+ printf ("video_out_xshm: => not using MIT Shared Memory extension.\n");
+ }
this->use_shm = 0;
goto finishShmTesting;
}
@@ -206,8 +210,10 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,
IPC_CREAT | 0777);
if (shminfo->shmid < 0 ) {
- printf ("video_out_xshm: %s: allocating image\n",strerror(errno));
- printf ("video_out_xshm: => not using MIT Shared Memory extension.\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf ("video_out_xshm: %s: allocating image\n",strerror(errno));
+ printf ("video_out_xshm: => not using MIT Shared Memory extension.\n");
+ }
this->use_shm = 0;
goto finishShmTesting;
}
@@ -215,8 +221,10 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,
shminfo->shmaddr = (char *) shmat(shminfo->shmid, 0, 0);
if (shminfo->shmaddr == ((char *) -1)) {
- printf ("video_out_xshm: shared memory error (address error) when allocating image \n");
- printf ("video_out_xshm: => not using MIT Shared Memory extension.\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf ("video_out_xshm: shared memory error (address error) when allocating image \n");
+ printf ("video_out_xshm: => not using MIT Shared Memory extension.\n");
+ }
shmctl (shminfo->shmid, IPC_RMID, 0);
shminfo->shmid = -1;
this->use_shm = 0;
@@ -231,8 +239,10 @@ static XImage *create_ximage (xshm_driver_t *this, XShmSegmentInfo *shminfo,
XSync(this->display, False);
if (gX11Fail) {
- printf ("video_out_xshm: x11 error during shared memory XImage creation\n");
- printf ("video_out_xshm: => not using MIT Shared Memory extension.\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf ("video_out_xshm: x11 error during shared memory XImage creation\n");
+ printf ("video_out_xshm: => not using MIT Shared Memory extension.\n");
+ }
shmdt (shminfo->shmaddr);
shmctl (shminfo->shmid, IPC_RMID, 0);
shminfo->shmid = -1;
@@ -836,8 +846,10 @@ static int xshm_set_property (vo_driver_t *this_gen,
if (value>=NUM_ASPECT_RATIOS)
value = ASPECT_AUTO;
this->sc.user_ratio = value;
- printf ("video_out_xshm: aspect ratio changed to %s\n",
- vo_scale_aspect_ratio_name(value));
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf ("video_out_xshm: aspect ratio changed to %s\n",
+ vo_scale_aspect_ratio_name(value));
+ }
} else if (property == VO_PROP_BRIGHTNESS) {
@@ -1126,6 +1138,7 @@ static vo_driver_t *xshm_open_plugin (video_driver_class_t *class_gen, const voi
0, NULL);
this->x11_old_error_handler = NULL;
+ this->xine = class->xine;
this->vo_driver.get_capabilities = xshm_get_capabilities;
this->vo_driver.alloc_frame = xshm_alloc_frame;
@@ -1162,12 +1175,13 @@ static vo_driver_t *xshm_open_plugin (video_driver_class_t *class_gen, const voi
this->visual = attribs.visual;
this->depth = attribs.depth;
- if (this->depth>16)
- printf ("\n\n"
- "WARNING: current display depth is %d. For better performance\n"
- "a depth of 16 bpp is recommended!\n\n",
- this->depth);
-
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ if (this->depth>16)
+ printf ("\n\n"
+ "WARNING: current display depth is %d. For better performance\n"
+ "a depth of 16 bpp is recommended!\n\n",
+ this->depth);
+ }
/*
* check for X shared memory support
@@ -1176,7 +1190,8 @@ static vo_driver_t *xshm_open_plugin (video_driver_class_t *class_gen, const voi
if (XShmQueryExtension(display)) {
this->use_shm = 1;
} else {
- printf ("video_out_xshm: MIT shared memory extension not present on display.\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("video_out_xshm: MIT shared memory extension not present on display.\n");
this->use_shm = 0;
}
@@ -1200,12 +1215,14 @@ static vo_driver_t *xshm_open_plugin (video_driver_class_t *class_gen, const voi
cpu_byte_order = htonl(1) == 1 ? MSBFirst : LSBFirst;
swapped = cpu_byte_order != this->image_byte_order;
- printf ("video_out_xshm: video mode depth is %d (%d bpp), %s, %sswapped,\n"
- "\tred: %08lx, green: %08lx, blue: %08lx\n",
- this->depth, this->bpp,
- visual_class_name(this->visual),
- swapped ? "" : "not ",
- this->visual->red_mask, this->visual->green_mask, this->visual->blue_mask);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf ("video_out_xshm: video mode depth is %d (%d bpp), %s, %sswapped,\n"
+ "\tred: %08lx, green: %08lx, blue: %08lx\n",
+ this->depth, this->bpp,
+ visual_class_name(this->visual),
+ swapped ? "" : "not ",
+ this->visual->red_mask, this->visual->green_mask, this->visual->blue_mask);
+ }
mode = 0;
@@ -1312,6 +1329,7 @@ static void *xshm_init_class (xine_t *xine, void *visual_gen) {
this->driver_class.dispose = xshm_dispose_class;
this->config = xine->config;
+ this->xine = xine;
return this;
}
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index 477e032c8..647c348e5 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2002 the xine project
+ * Copyright (C) 2000-2003 the xine project
*
* This file is part of xine, a free video player.
*
@@ -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.160 2003/03/05 22:12:48 esnel Exp $
+ * $Id: video_out_xv.c,v 1.161 2003/03/06 16:49:32 guenter Exp $
*
* video_out_xv.c, X11 video extension interface for xine
*
@@ -137,6 +137,8 @@ struct xv_driver_s {
uint32_t colorkey;
int (*x11_old_error_handler) (Display *, XErrorEvent *);
+
+ xine_t *xine;
};
typedef struct {
@@ -146,6 +148,7 @@ typedef struct {
XvPortID xv_port;
XvAdaptorInfo *adaptor_info;
unsigned int adaptor_num;
+ xine_t *xine;
} xv_class_t;
int gX11Fail;
@@ -274,8 +277,10 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,
width, height, shminfo);
if (image == NULL ) {
- printf("video_out_xv: XvShmCreateImage failed\n");
- printf("video_out_xv: => not using MIT Shared Memory extension.\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf("video_out_xv: XvShmCreateImage failed\n");
+ printf("video_out_xv: => not using MIT Shared Memory extension.\n");
+ }
this->use_shm = 0;
goto finishShmTesting;
}
@@ -285,15 +290,19 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,
IPC_CREAT | 0777);
if (image->data_size==0) {
- printf("video_out_xv: XvShmCreateImage returned a zero size\n");
- printf("video_out_xv: => not using MIT Shared Memory extension.\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf("video_out_xv: XvShmCreateImage returned a zero size\n");
+ printf("video_out_xv: => not using MIT Shared Memory extension.\n");
+ }
this->use_shm = 0;
goto finishShmTesting;
}
if (shminfo->shmid < 0 ) {
- perror("video_out_xv: shared memory error in shmget: ");
- printf("video_out_xv: => not using MIT Shared Memory extension.\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ perror("video_out_xv: shared memory error in shmget: ");
+ printf("video_out_xv: => not using MIT Shared Memory extension.\n");
+ }
this->use_shm = 0;
goto finishShmTesting;
}
@@ -301,13 +310,15 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,
shminfo->shmaddr = (char *) shmat(shminfo->shmid, 0, 0);
if (shminfo->shmaddr == NULL) {
- printf("video_out_xv: shared memory error (address error NULL)\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("video_out_xv: shared memory error (address error NULL)\n");
this->use_shm = 0;
goto finishShmTesting;
}
if (shminfo->shmaddr == ((char *) -1)) {
- printf("video_out_xv: shared memory error (address error)\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("video_out_xv: shared memory error (address error)\n");
this->use_shm = 0;
goto finishShmTesting;
}
@@ -321,8 +332,10 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo,
shmctl(shminfo->shmid, IPC_RMID, 0);
if (gX11Fail) {
- printf ("video_out_xv: x11 error during shared memory XImage creation\n");
- printf ("video_out_xv: => not using MIT Shared Memory extension.\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf ("video_out_xv: x11 error during shared memory XImage creation\n");
+ printf ("video_out_xv: => not using MIT Shared Memory extension.\n");
+ }
shmdt (shminfo->shmaddr);
shmctl (shminfo->shmid, IPC_RMID, 0);
shminfo->shmid = -1;
@@ -775,8 +788,9 @@ static int xv_get_property (vo_driver_t *this_gen, int property) {
xv_driver_t *this = (xv_driver_t *) this_gen;
- printf ("video_out_xv: property #%d = %d\n", property,
- this->props[property].value);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("video_out_xv: property #%d = %d\n", property,
+ this->props[property].value);
return this->props[property].value;
}
@@ -818,8 +832,10 @@ static int xv_set_property (vo_driver_t *this_gen,
case VO_PROP_INTERLACED:
this->props[property].value = value;
- printf("video_out_xv: VO_PROP_INTERLACED(%d)\n",
- this->props[property].value);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf("video_out_xv: VO_PROP_INTERLACED(%d)\n",
+ this->props[property].value);
+ }
this->deinterlace_enabled = value;
if (this->deinterlace_method == DEINTERLACE_ONEFIELDXV) {
xv_compute_ideal_size (this);
@@ -832,8 +848,10 @@ static int xv_set_property (vo_driver_t *this_gen,
value = ASPECT_AUTO;
this->props[property].value = value;
- printf("video_out_xv: VO_PROP_ASPECT_RATIO(%d)\n",
- this->props[property].value);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf("video_out_xv: VO_PROP_ASPECT_RATIO(%d)\n",
+ this->props[property].value);
+ }
this->sc.user_ratio = value;
xv_compute_ideal_size (this);
@@ -844,8 +862,9 @@ static int xv_set_property (vo_driver_t *this_gen,
if ((value >= VO_ZOOM_MIN) && (value <= VO_ZOOM_MAX)) {
this->props[property].value = value;
- printf ("video_out_xv: VO_PROP_ZOOM_X = %d\n",
- this->props[property].value);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("video_out_xv: VO_PROP_ZOOM_X = %d\n",
+ this->props[property].value);
this->sc.zoom_factor_x = (double)value / (double)VO_ZOOM_STEP;
@@ -858,8 +877,9 @@ static int xv_set_property (vo_driver_t *this_gen,
if ((value >= VO_ZOOM_MIN) && (value <= VO_ZOOM_MAX)) {
this->props[property].value = value;
- printf ("video_out_xv: VO_PROP_ZOOM_Y = %d\n",
- this->props[property].value);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("video_out_xv: VO_PROP_ZOOM_Y = %d\n",
+ this->props[property].value);
this->sc.zoom_factor_y = (double)value / (double)VO_ZOOM_STEP;
@@ -1054,8 +1074,9 @@ static void xv_check_capability (xv_driver_t *this,
XvGetPortAttribute (this->display, this->xv_port,
this->props[property].atom, &int_default);
- printf ("video_out_xv: port attribute %s (%d) value is %d\n",
- str_prop, property, int_default);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("video_out_xv: port attribute %s (%d) value is %d\n",
+ str_prop, property, int_default);
if (config_name) {
/* is this a boolean property ? */
@@ -1111,7 +1132,8 @@ static void xv_update_XV_FILTER(void *this_gen, xine_cfg_entry_t *entry) {
atom = XInternAtom (this->display, "XV_FILTER", False);
XvSetPortAttribute (this->display, this->xv_port, atom, xv_filter);
- printf("video_out_xv: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("video_out_xv: bilinear scaling mode (XV_FILTER) = %d\n",xv_filter);
}
static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) {
@@ -1124,7 +1146,8 @@ static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry)
atom = XInternAtom (this->display, "XV_DOUBLE_BUFFER", False);
XvSetPortAttribute (this->display, this->xv_port, atom, xv_double_buffer);
- printf("video_out_xv: double buffering mode = %d\n",xv_double_buffer);
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("video_out_xv: double buffering mode = %d\n",xv_double_buffer);
}
static void xv_update_xv_pitch_alignment(void *this_gen, xine_cfg_entry_t *entry) {
@@ -1152,8 +1175,6 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
display = visual->display;
- printf ("video_out_xv: open_plugin\n");
-
this = malloc (sizeof (xv_driver_t));
if (!this) {
@@ -1173,16 +1194,17 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
this->sc.frame_output_cb = visual->frame_output_cb;
this->sc.user_data = visual->user_data;
- this->drawable = visual->d;
- this->gc = XCreateGC (this->display, this->drawable, 0, NULL);
- this->capabilities = 0;
- this->expecting_event = 0;
- this->use_shm = 1;
- this->deinterlace_method = 0;
+ this->drawable = visual->d;
+ this->gc = XCreateGC (this->display, this->drawable, 0, NULL);
+ this->capabilities = 0;
+ this->expecting_event = 0;
+ this->use_shm = 1;
+ this->deinterlace_method = 0;
this->deinterlace_frame.image = NULL;
- this->use_colorkey = 0;
- this->colorkey = 0;
- this->x11_old_error_handler = NULL;
+ this->use_colorkey = 0;
+ this->colorkey = 0;
+ this->x11_old_error_handler = NULL;
+ this->xine = class->xine;
XAllocNamedColor (this->display,
DefaultColormap(this->display, this->screen),
@@ -1286,7 +1308,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
}
}
XFree(attr);
- } else {
+ } else if (this->xine->verbosity >= XINE_VERBOSITY_DEBUG) {
printf("video_out_xv: no port attributes defined.\n");
}
@@ -1308,11 +1330,13 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
if (fo[i].id == XINE_IMGFMT_YV12) {
this->xv_format_yv12 = fo[i].id;
this->capabilities |= VO_CAP_YV12;
- printf("video_out_xv: this adaptor supports the yv12 format.\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("video_out_xv: this adaptor supports the yv12 format.\n");
} else if (fo[i].id == XINE_IMGFMT_YUY2) {
this->xv_format_yuy2 = fo[i].id;
this->capabilities |= VO_CAP_YUY2;
- printf("video_out_xv: this adaptor supports the yuy2 format.\n");
+ if (this->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("video_out_xv: this adaptor supports the yuy2 format.\n");
}
}
@@ -1427,7 +1451,7 @@ static void *init_class (xine_t *xine, void *visual_gen) {
"driver doesn't support Xv?!\n");
/* XvFreeAdaptorInfo (adaptor_info); this crashed on me (gb)*/
return NULL;
- } else
+ } else if (xine->verbosity >= XINE_VERBOSITY_LOG)
printf ("video_out_xv: using Xv port %ld from adaptor %s for hardware "
"colorspace conversion and scaling.\n", xv_port,
adaptor_info[adaptor_num].name);
@@ -1447,6 +1471,7 @@ static void *init_class (xine_t *xine, void *visual_gen) {
this->xv_port = xv_port;
this->adaptor_info = adaptor_info;
this->adaptor_num = adaptor_num;
+ this->xine = xine;
return this;
}
diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c
index 63674e675..a34541030 100644
--- a/src/video_out/yuv2rgb.c
+++ b/src/video_out/yuv2rgb.c
@@ -1,7 +1,8 @@
/*
* yuv2rgb.c
*
- * This file is part of xine, a unix video player.
+ * Copyright (C) 2003 the xine project
+ * This file is part of xine, a free video player.
*
* based on work from mpeg2dec:
* Copyright (C) 1999-2001 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
@@ -22,7 +23,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.40 2003/02/02 17:27:45 esnel Exp $
+ * $Id: yuv2rgb.c,v 1.41 2003/03/06 16:49:32 guenter Exp $
*/
#include "config.h"
@@ -35,7 +36,9 @@
#include "yuv2rgb.h"
#include "xineutils.h"
+/*
#define LOG
+*/
static int prof_scale_line = -1;
@@ -2391,7 +2394,7 @@ static void yuv2rgb_set_csc_levels (yuv2rgb_factory_t *this,
default:
- fprintf (stderr, "mode %d not supported by yuv2rgb\n", mode);
+ printf ("yuv2rgb: mode %d not supported by yuv2rgb\n", mode);
abort();
}
@@ -3184,16 +3187,20 @@ yuv2rgb_factory_t* yuv2rgb_factory_init (int mode, int swapped,
yuv2rgb_init_mmxext (this);
+#ifdef LOG
if (this->yuv2rgb_fun != NULL)
printf ("yuv2rgb: using MMXEXT for colorspace transform\n");
+#endif
}
if ((this->yuv2rgb_fun == NULL) && (mm & MM_ACCEL_X86_MMX)) {
yuv2rgb_init_mmx (this);
+#ifdef LOG
if (this->yuv2rgb_fun != NULL)
printf ("yuv2rgb: using MMX for colorspace transform\n");
+#endif
}
#endif
#if HAVE_MLIB
@@ -3201,12 +3208,16 @@ yuv2rgb_factory_t* yuv2rgb_factory_init (int mode, int swapped,
yuv2rgb_init_mlib (this);
+#ifdef LOG
if (this->yuv2rgb_fun != NULL)
printf ("yuv2rgb: using medialib for colorspace transform\n");
+#endif
}
#endif
if (this->yuv2rgb_fun == NULL) {
+#ifdef LOG
printf ("yuv2rgb: no accelerated colorspace conversion found\n");
+#endif
yuv2rgb_c_init (this);
}
diff --git a/src/video_out/yuv2rgb_mlib.c b/src/video_out/yuv2rgb_mlib.c
index 5cac646dd..e1a7cba7d 100644
--- a/src/video_out/yuv2rgb_mlib.c
+++ b/src/video_out/yuv2rgb_mlib.c
@@ -5,7 +5,7 @@
*
* Author: Juergen Keil <jk@tools.de>
*
- * This file is part of xine, a free unix video player.
+ * This file is part of xine, a free 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
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index 9ef4c6a69..e2f7c671c 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2002 the xine project
+ * Copyright (C) 2000-2003 the xine project
*
* This file is part of xine, a free video player.
*
@@ -31,7 +31,9 @@
#include "demuxers/demux.h"
#include "buffer.h"
+/*
#define LOG
+*/
/* internal use only - called from demuxers on seek/stop
* warning: after clearing decoders fifos an absolute discontinuity
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index d01d919a2..ca0d91fa9 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.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: load_plugins.c,v 1.141 2003/02/23 21:32:48 guenter Exp $
+ * $Id: load_plugins.c,v 1.142 2003/03/06 16:49:32 guenter Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -150,7 +150,7 @@ static void _insert_plugin (xine_t *this,
int i;
if (info->API != api_version) {
- if (this->verbosity)
+ if (this->verbosity >= XINE_VERBOSITY_DEBUG)
printf ("load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n",
info->id, info->API, api_version);
return;
@@ -296,7 +296,7 @@ static void collect_plugins(xine_t *this, char *path){
if(!info && !(lib = dlopen (str, RTLD_LAZY | RTLD_GLOBAL))) {
- if (this->verbosity) {
+ if (this->verbosity >= XINE_VERBOSITY_DEBUG) {
char *dl_error_msg = dlerror();
/* too noisy -- but good to catch unresolved references */
printf ("load_plugins: cannot open plugin lib %s:\n%s\n",
@@ -1034,8 +1034,6 @@ static demux_plugin_t *probe_demux (xine_stream_t *stream, int method1, int meth
printf ("load_plugins: probing demux '%s'\n", node->info->id);
#endif
if ((plugin = ((demux_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) {
- if (stream->xine->verbosity)
- printf ("load_plugins: using demuxer '%s'\n", node->info->id);
pthread_mutex_unlock (&catalog->lock);
return plugin;
}
@@ -1627,7 +1625,7 @@ video_decoder_t *get_video_decoder (xine_stream_t *stream, uint8_t stream_type)
if (!node->plugin_class) {
/* remove non working plugin from catalog */
- if (stream->xine->verbosity)
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
printf("load_plugins: plugin %s failed to init its class.\n",
node->info->id);
for (j = i + 1; j < PLUGINS_PER_TYPE; j++)
@@ -1647,7 +1645,8 @@ video_decoder_t *get_video_decoder (xine_stream_t *stream, uint8_t stream_type)
return vd;
} else {
/* remove non working plugin from catalog */
- printf("load_plugins: plugin %s failed to instantiate itself.\n", node->info->id);
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf("load_plugins: plugin %s failed to instantiate itself.\n", node->info->id);
for (j = i + 1; j < PLUGINS_PER_TYPE; j++)
catalog->video_decoder_map[stream_type][j - 1] =
catalog->video_decoder_map[stream_type][j];
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index 71e057f78..775fcd0f1 100644
--- a/src/xine-engine/metronom.c
+++ b/src/xine-engine/metronom.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2002 the xine project
+ * Copyright (C) 2000-2003 the xine project
*
* This file is part of xine, a free video player.
*
@@ -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: metronom.c,v 1.112 2003/02/28 02:51:51 storri Exp $
+ * $Id: metronom.c,v 1.113 2003/03/06 16:49:33 guenter Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -289,15 +289,17 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type,
this->video_discontinuity_count++;
pthread_cond_signal (&this->video_discontinuity_reached);
- printf ("metronom: video discontinuity #%d, type is %d, disc_off is %lld\n",
- this->video_discontinuity_count, type, disc_off);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: video discontinuity #%d, type is %d, disc_off is %lld\n",
+ this->video_discontinuity_count, type, disc_off);
if (this->have_audio) {
while (this->audio_discontinuity_count <
this->video_discontinuity_count) {
- printf ("metronom: waiting for audio discontinuity #%d\n",
- this->video_discontinuity_count);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: waiting for audio discontinuity #%d\n",
+ this->video_discontinuity_count);
pthread_cond_wait (&this->audio_discontinuity_reached, &this->lock);
}
@@ -306,12 +308,16 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type,
if ( this->video_vpts < this->clock->get_current_time(this->clock) ||
type == DISC_STREAMSTART || type == DISC_STREAMSEEK ) {
this->video_vpts = PREBUFFER_PTS_OFFSET + this->clock->get_current_time(this->clock);
- printf ("metronom: video vpts adjusted with prebuffer to %lld\n", this->video_vpts);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: video vpts adjusted with prebuffer to %lld\n",
+ this->video_vpts);
}
if ( this->audio_vpts < this->clock->get_current_time(this->clock) ||
type == DISC_STREAMSTART || type == DISC_STREAMSEEK ) {
this->audio_vpts = PREBUFFER_PTS_OFFSET + this->clock->get_current_time(this->clock);
- printf ("metronom: audio vpts adjusted with prebuffer to %lld\n", this->audio_vpts);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: audio vpts adjusted with prebuffer to %lld\n",
+ this->audio_vpts);
}
#ifdef LOG
@@ -421,7 +427,8 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) {
this->video_vpts = vpts;
this->video_drift = 0;
- printf ("metronom: video jump\n");
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: video jump\n");
} else {
@@ -471,15 +478,17 @@ static void metronom_handle_audio_discontinuity (metronom_t *this, int type,
this->audio_discontinuity_count++;
pthread_cond_signal (&this->audio_discontinuity_reached);
- printf ("metronom: audio discontinuity #%d, type is %d, disc_off %lld\n",
- this->audio_discontinuity_count, type, disc_off);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: audio discontinuity #%d, type is %d, disc_off %lld\n",
+ this->audio_discontinuity_count, type, disc_off);
/* next_vpts_offset, in_discontinuity is handled in expect_video_discontinuity */
while ( this->audio_discontinuity_count >
this->discontinuity_handled_count ) {
- printf ("metronom: waiting for in_discontinuity update #%d\n",
- this->audio_discontinuity_count);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("metronom: waiting for in_discontinuity update #%d\n",
+ this->audio_discontinuity_count);
pthread_cond_wait (&this->video_discontinuity_reached, &this->lock);
}
@@ -511,7 +520,8 @@ static int64_t metronom_got_audio_samples (metronom_t *this, int64_t pts,
this->force_audio_jump = 0;
this->audio_vpts = vpts;
this->audio_drift_step = 0;
- printf("metronom: audio jump, diff=%lld\n", diff);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf("metronom: audio jump, diff=%lld\n", diff);
}
else {
if( this->audio_samples ) {
@@ -566,11 +576,13 @@ static void metronom_set_option (metronom_t *this, int option, int64_t value) {
switch (option) {
case METRONOM_AV_OFFSET:
this->av_offset = value;
- printf ("metronom: av_offset=%lld pts\n", this->av_offset);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("metronom: av_offset=%lld pts\n", this->av_offset);
break;
case METRONOM_SPU_OFFSET:
this->spu_offset = value;
- printf ("metronom: spu_offset=%lld pts\n", this->spu_offset);
+ if (this->stream->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf ("metronom: spu_offset=%lld pts\n", this->spu_offset);
break;
case METRONOM_ADJ_VPTS_OFFSET:
this->audio_vpts += value;
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 7f4001ed8..9e0fd35b5 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.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.c,v 1.147 2003/02/28 02:51:51 storri Exp $
+ * $Id: video_out.c,v 1.148 2003/03/06 16:49:33 guenter Exp $
*
* frame allocation / queuing / scheduling / output functions
*/
@@ -1447,7 +1447,7 @@ xine_video_port_t *vo_new_port (xine_t *xine, vo_driver_t *driver,
/* FIXME: how does this happen ? */
printf (_("video_out: sorry, this should not happen. please restart xine.\n"));
abort();
- } else
+ } else if (xine->verbosity >= XINE_VERBOSITY_DEBUG)
printf ("video_out: thread created\n");
}
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index c4e675fa7..e5c9a6442 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2002 the xine project
+ * Copyright (C) 2000-2003 the xine project
*
* This file is part of xine, a free video player.
*
@@ -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: xine.c,v 1.232 2003/03/05 23:55:06 siggi Exp $
+ * $Id: xine.c,v 1.233 2003/03/06 16:49:33 guenter Exp $
*
* top-level xine functions
*
@@ -348,7 +348,8 @@ xine_stream_t *xine_stream_new (xine_t *this,
xine_stream_t *stream;
int i;
- printf ("xine: xine_stream_new\n");
+ if (this->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: xine_stream_new\n");
/*
* create a new stream object
@@ -524,11 +525,6 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
= strdup (stream->input_plugin->input_class->get_identifier (stream->input_plugin->input_class));
free(input_source);
-#ifdef LOG
- printf ("xine: input plugin %s found\n",
- stream->input_plugin->input_class->get_identifier(stream->input_plugin->input_class));
-#endif
-
while (stream_setup && *stream_setup && *(++stream_setup)) {
if (strncasecmp(stream_setup, "demux", 5) == 0) {
if (*(stream_setup += 5) == ':') {
@@ -554,9 +550,6 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
free(demux_name);
return 0;
}
-#ifdef LOG
- printf ("xine: demux and input plugin found\n");
-#endif
stream->meta_info[XINE_META_INFO_SYSTEMLAYER]
= strdup (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class));
@@ -618,7 +611,8 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
stream->status = XINE_STATUS_STOP;
return 0;
}
- printf("xine: ignoring video\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("xine: ignoring video\n");
continue;
}
if (strncasecmp(stream_setup, "noaudio", 7) == 0) {
@@ -631,7 +625,8 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
stream->status = XINE_STATUS_STOP;
return 0;
}
- printf("xine: ignoring audio\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("xine: ignoring audio\n");
continue;
}
if (strncasecmp(stream_setup, "nospu", 5) == 0) {
@@ -644,7 +639,8 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
stream->status = XINE_STATUS_STOP;
return 0;
}
- printf("xine: ignoring subpicture\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("xine: ignoring subpicture\n");
continue;
}
if (strncasecmp(stream_setup, "volume", 6) == 0) {
@@ -715,7 +711,8 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
stream->slave = xine_stream_new (stream->xine, NULL, stream->video_out );
stream->slave_affection = XINE_MASTER_SLAVE_PLAY | XINE_MASTER_SLAVE_STOP;
if( xine_open( stream->slave, subtitle_mrl ) ) {
- printf("xine: subtitle mrl opened\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_LOG)
+ printf("xine: subtitle mrl opened\n");
stream->slave->master = stream;
stream->slave_is_subtitle = 1;
} else {
@@ -800,8 +797,10 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
= strdup (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class));
}
- printf("xine: found input plugin : %s\n",stream->input_plugin->input_class->get_description(stream->input_plugin->input_class));
- printf("xine: found demuxer plugin: %s\n",stream->demux_plugin->demux_class->get_description(stream->demux_plugin->demux_class));
+ if (stream->xine->verbosity >= XINE_VERBOSITY_LOG) {
+ printf("xine: found input plugin : %s\n",stream->input_plugin->input_class->get_description(stream->input_plugin->input_class));
+ printf("xine: found demuxer plugin: %s\n",stream->demux_plugin->demux_class->get_description(stream->demux_plugin->demux_class));
+ }
extra_info_reset( stream->current_extra_info );
extra_info_reset( stream->video_decoder_extra_info );
@@ -826,7 +825,8 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
stream->demux_plugin->dispose (stream->demux_plugin);
stream->demux_plugin = NULL;
- printf ("xine: demux disposed\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: demux disposed\n");
stream->input_plugin->dispose (stream->input_plugin);
stream->input_plugin = NULL;
@@ -840,7 +840,8 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
stream->status = XINE_STATUS_STOP;
- printf ("xine: return from xine_open_internal\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: return from xine_open_internal\n");
return 0;
}
@@ -877,7 +878,8 @@ static int xine_play_internal (xine_stream_t *stream, int start_pos, int start_t
off_t pos, len;
int demux_status;
- printf ("xine: xine_play\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: xine_play\n");
if (stream->xine->clock->speed != XINE_SPEED_NORMAL)
xine_set_speed_internal (stream, XINE_SPEED_NORMAL);
@@ -947,7 +949,8 @@ static int xine_play_internal (xine_stream_t *stream, int start_pos, int start_t
extra_info_reset( stream->current_extra_info );
pthread_mutex_unlock( &stream->current_extra_info_lock );
- printf ("xine: xine_play_internal ...done\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: xine_play_internal ...done\n");
return 1;
}
@@ -991,7 +994,8 @@ int xine_eject (xine_stream_t *stream) {
void xine_dispose (xine_stream_t *stream) {
- printf ("xine: xine_dispose\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: xine_dispose\n");
stream->status = XINE_STATUS_QUIT;
@@ -1004,11 +1008,13 @@ void xine_dispose (xine_stream_t *stream) {
stream->slave->master = NULL;
}
- printf ("xine_exit: shutdown audio\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine_exit: shutdown audio\n");
audio_decoder_shutdown (stream);
- printf ("xine_exit: shutdown video\n");
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine_exit: shutdown video\n");
video_decoder_shutdown (stream);
@@ -1034,7 +1040,8 @@ void xine_exit (xine_t *this) {
int i;
- printf ("xine_exit: bye!\n");
+ if (this->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine_exit: bye!\n");
for (i = 0; i < XINE_LOG_NUM; i++)
this->log_buffers[i]->dispose (this->log_buffers[i]);
@@ -1090,6 +1097,16 @@ xine_t *xine_new (void) {
pthread_mutex_init (&this->streams_lock, NULL);
+ /*
+ * verbose setting
+ */
+
+ this->verbosity = this->config->register_num (this->config,
+ "misc.verbosity",
+ XINE_VERBOSITY_NONE,
+ "default verbosity setting",
+ NULL, 40, NULL, NULL);
+
return this;
}
@@ -1098,6 +1115,19 @@ void xine_init (xine_t *this) {
static char *demux_strategies[] = {"default", "reverse", "content",
"extension", NULL};
+ /*
+ * frontends don't have a chance to set xine parameters at this point
+ * so read verbosity setting from config values
+ */
+ {
+ cfg_entry_t *verbose_entry;
+ verbose_entry = this->config->lookup_entry (this->config, "misc.verbosity");
+ if (verbose_entry) {
+ this->verbosity = verbose_entry->num_value;
+ }
+ }
+
+
/* initialize color conversion tables and functions */
init_yuv_conversion();
@@ -1226,7 +1256,8 @@ void xine_set_speed (xine_stream_t *stream, int speed) {
else if (speed > XINE_SPEED_FAST_4)
speed = XINE_SPEED_FAST_4;
- printf ("xine: set_speed %d\n", speed);
+ if (stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ printf ("xine: set_speed %d\n", speed);
xine_set_speed_internal (stream, speed);
pthread_mutex_unlock (&stream->frontend_lock);
@@ -1481,4 +1512,3 @@ int xine_stream_master_slave(xine_stream_t *master, xine_stream_t *slave,
slave->master = master->master;
return 1;
}
-