diff options
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/audio_decoder.c | 51 | ||||
-rw-r--r-- | src/xine-engine/audio_out.c | 9 | ||||
-rw-r--r-- | src/xine-engine/configfile.c | 44 | ||||
-rw-r--r-- | src/xine-engine/demux.c | 63 | ||||
-rw-r--r-- | src/xine-engine/input_rip.c | 9 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 40 | ||||
-rw-r--r-- | src/xine-engine/metronom.c | 3 | ||||
-rw-r--r-- | src/xine-engine/osd.c | 11 | ||||
-rw-r--r-- | src/xine-engine/scratch.c | 19 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.c | 57 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 157 | ||||
-rw-r--r-- | src/xine-engine/vo_scale.c | 23 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 7 |
13 files changed, 208 insertions, 285 deletions
diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 58db274df..480a6e205 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_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: audio_decoder.c,v 1.114 2003/11/22 11:58:05 f1rmb Exp $ + * $Id: audio_decoder.c,v 1.115 2003/11/26 19:43:38 f1rmb Exp $ * * * functions that implement audio decoding @@ -35,13 +35,15 @@ #define XINE_ENGINE_INTERNAL -#include "xine_internal.h" -#include "xineutils.h" - +#define LOG_MODULE "audio_decoder" +#define LOG_VERBOSE /* #define LOG */ +#include "xine_internal.h" +#include "xineutils.h" + static void *audio_decoder_loop (void *stream_gen) { buf_element_t *buf; @@ -55,17 +57,11 @@ static void *audio_decoder_loop (void *stream_gen) { while (running) { -#ifdef LOG - printf ("audio_loop: waiting for package...\n"); -#endif + lprintf ("audio_loop: waiting for package...\n"); buf = stream->audio_fifo->get (stream->audio_fifo); - -#ifdef LOG - printf ("audio_loop: got package pts = %lld, type = %08x\n", - buf->pts, buf->type); -#endif + lprintf ("audio_loop: got package pts = %lld, type = %08x\n", buf->pts, buf->type); _x_extra_info_merge( stream->audio_decoder_extra_info, buf->extra_info ); stream->audio_decoder_extra_info->seek_count = stream->video_seek_count; @@ -99,15 +95,11 @@ static void *audio_decoder_loop (void *stream_gen) { case BUF_CONTROL_START: -#ifdef LOG - printf ("audio_decoder: start\n"); -#endif + lprintf ("start\n"); if (stream->audio_decoder_plugin) { -#ifdef LOG - printf ("audio_decoder: close old decoder\n"); -#endif + lprintf ("close old decoder\n"); _x_free_audio_decoder (stream, stream->audio_decoder_plugin); stream->audio_decoder_plugin = NULL; @@ -127,10 +119,7 @@ static void *audio_decoder_loop (void *stream_gen) { stream->finished_count_audio++; -#ifdef LOG - printf ("audio_decoder: reached end marker # %d\n", - stream->finished_count_audio); -#endif + lprintf ("reached end marker # %d\n", stream->finished_count_audio); pthread_cond_broadcast (&stream->counter_changed); @@ -169,9 +158,8 @@ static void *audio_decoder_loop (void *stream_gen) { break; case BUF_CONTROL_RESET_DECODER: -#ifdef LOG - printf ("audio_decoder: reset\n"); -#endif + lprintf ("reset\n"); + _x_extra_info_reset( stream->audio_decoder_extra_info ); if (stream->audio_decoder_plugin) stream->audio_decoder_plugin->reset (stream->audio_decoder_plugin); @@ -245,11 +233,9 @@ static void *audio_decoder_loop (void *stream_gen) { /* find out which audio type to decode */ -#ifdef LOG - printf ("audio_decoder: audio_channel_user = %d, map[0]=%08x\n", - stream->audio_channel_user, - stream->audio_track_map[0]); -#endif + lprintf ("audio_channel_user = %d, map[0]=%08x\n", + stream->audio_channel_user, + stream->audio_track_map[0]); if (stream->audio_channel_user > -2) { @@ -257,10 +243,7 @@ static void *audio_decoder_loop (void *stream_gen) { /* auto */ -#ifdef LOG - printf ("audio_decoder: audio_channel_auto = %d\n", - stream->audio_channel_auto); -#endif + lprintf ("audio_channel_auto = %d\n", stream->audio_channel_auto); if (stream->audio_channel_auto>=0) { diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 62140b326..05b9f7fd3 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -17,7 +17,7 @@ * along with self program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_out.c,v 1.152 2003/11/16 23:33:48 f1rmb Exp $ + * $Id: audio_out.c,v 1.153 2003/11/26 19:43:38 f1rmb Exp $ * * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver. * (c) 2001 Andy Lo A Foe <andy@alsaplayer.org> @@ -80,11 +80,12 @@ #define XINE_ENABLE_EXPERIMENTAL_FEATURES #define XINE_ENGINE_INTERNAL -/********** logging **********/ #define LOG_MODULE "audio_out" -/* #define LOG_VERBOSE */ +#define LOG_VERBOSE +/* +#define LOG +*/ -/* #define LOG */ #define LOG_RESAMPLE_SYNC 0 #include "xine_internal.h" diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index b171fd751..823e9cab9 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.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: configfile.c,v 1.56 2003/11/16 23:33:48 f1rmb Exp $ + * $Id: configfile.c,v 1.57 2003/11/26 19:43:38 f1rmb Exp $ * * config object (was: file) management - implementation * @@ -34,13 +34,15 @@ #include <stdlib.h> #include <string.h> #include "configfile.h" -#include "xineutils.h" -#include "xine_internal.h" -/* +#define LOG_MODULE "configfile" +#define LOG_VERBOSE +/* #define LOG */ +#include "xineutils.h" +#include "xine_internal.h" static int config_section_enum(const char *sect) { static char *known_section[] = { @@ -159,7 +161,7 @@ static cfg_entry_t *__config_add (config_values_t *this, const char *key, int ex config_insert(this, entry); - lprintf ("configfile: add entry key=%s\n", key); + lprintf ("add entry key=%s\n", key); return entry; } @@ -204,7 +206,7 @@ static char *__config_register_string (config_values_t *this, XINE_ASSERT(key, "Register key is NULL. This is a required argument."); XINE_ASSERT(def_value, "Default value is NULL. This is a required argument."); - lprintf ("configfile: registering %s\n", key); + lprintf ("registering %s\n", key); /* make sure this entry exists, create it if not */ pthread_mutex_lock(&this->config_lock); @@ -266,7 +268,7 @@ static int __config_register_num (config_values_t *this, cfg_entry_t *entry, *prev; XINE_ASSERT(key, "Register key is NULL. This is a required argument."); - lprintf ("configfile: registering %s\n", key); + lprintf ("registering %s\n", key); /* make sure this entry exists, create it if not */ pthread_mutex_lock(&this->config_lock); @@ -331,7 +333,7 @@ static int __config_register_bool (config_values_t *this, cfg_entry_t *entry, *prev; XINE_ASSERT(key, "Register key is NULL. This is a required argument."); - lprintf ("configfile: registering %s\n", key); + lprintf ("registering %s\n", key); /* make sure this entry exists, create it if not */ pthread_mutex_lock(&this->config_lock); @@ -397,7 +399,7 @@ static int __config_register_range (config_values_t *this, cfg_entry_t *entry, *prev; XINE_ASSERT(key, "Register key is NULL. This is a required argument."); - lprintf ("configfile: registering range %s\n", key); + lprintf ("registering range %s\n", key); /* make sure this entry exists, create it if not */ pthread_mutex_lock(&this->config_lock); @@ -462,7 +464,7 @@ static int __config_parse_enum (const char *str, char **values) { while (*value) { - lprintf ("configfile: parse enum, >%s< ?= >%s<\n", *value, str); + lprintf ("parse enum, >%s< ?= >%s<\n", *value, str); if (!strcmp (*value, str)) return i; @@ -471,7 +473,7 @@ static int __config_parse_enum (const char *str, char **values) { i++; } - lprintf ("configfile: warning, >%s< is not a valid enum here, using 0\n", str); + lprintf ("warning, >%s< is not a valid enum here, using 0\n", str); return 0; } @@ -490,7 +492,7 @@ static int __config_register_enum (config_values_t *this, XINE_ASSERT(key, "Register key is NULL. This is a required argument."); XINE_ASSERT(values, "Argument 'values' is NULL. This is a required argument."); - lprintf ("configfile: registering enum %s\n", key); + lprintf ("registering enum %s\n", key); /* make sure this entry exists, create it if not */ pthread_mutex_lock(&this->config_lock); @@ -570,11 +572,11 @@ static void __config_update_num (config_values_t *this, entry = this->lookup_entry (this, key); - lprintf ("configfile: updating %s to %d\n", key, value); + lprintf ("updating %s to %d\n", key, value); if (!entry) { - lprintf ("configfile: WARNING! tried to update unknown key %s (to %d)\n", key, value); + lprintf ("WARNING! tried to update unknown key %s (to %d)\n", key, value); return; @@ -607,7 +609,7 @@ static void __config_update_string (config_values_t *this, cfg_entry_t *entry; char *str_free = NULL; - lprintf ("configfile: updating %s to %s\n", key, value); + lprintf ("updating %s to %s\n", key, value); entry = this->lookup_entry (this, key); @@ -651,7 +653,7 @@ void xine_config_load (xine_t *xine, const char *filename) { config_values_t *this = xine->config; FILE *f_config; - lprintf ("configfile: reading from file '%s'\n", filename); + lprintf ("reading from file '%s'\n", filename); f_config = fopen (filename, "r"); @@ -731,7 +733,7 @@ void xine_config_save (xine_t *xine, const char *filename) { if (stat(temp, &backup_stat) != 0) { char line[1024]; - lprintf("configfile: backing up configfile to %s\n", temp); + lprintf("backing up configfile to %s\n", temp); f_backup = fopen(temp, "w"); f_config = fopen(filename, "r"); @@ -766,7 +768,7 @@ void xine_config_save (xine_t *xine, const char *filename) { return; } - lprintf ("configfile: writing config file to %s\n", filename); + lprintf ("writing config file to %s\n", filename); f_config = fopen(filename, "w"); @@ -784,7 +786,7 @@ void xine_config_save (xine_t *xine, const char *filename) { while (entry) { - lprintf ("configfile: saving key '%s'\n", entry->key); + lprintf ("saving key '%s'\n", entry->key); if (entry->description) fprintf (f_config, "# %s\n", entry->description); @@ -878,7 +880,7 @@ static void __config_dispose (config_values_t *this) { pthread_mutex_lock(&this->config_lock); entry = this->first; - lprintf ("configfile: dispose\n"); + lprintf ("dispose\n"); while (entry) { last = entry; @@ -958,7 +960,7 @@ int _x_config_change_opt(config_values_t *config, const char *opt) { cfg_entry_t *entry; int handled = 0; - lprintf ("configfile: change_opt '%s'\n", opt); + lprintf ("change_opt '%s'\n", opt); if(config && opt) { char *key, *value; diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index f17ef910c..e49a93fba 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -20,7 +20,7 @@ * Demuxer helper functions * hide some xine engine details from demuxers and reduce code duplication * - * $Id: demux.c,v 1.41 2003/11/20 00:42:14 tmattern Exp $ + * $Id: demux.c,v 1.42 2003/11/26 19:43:38 f1rmb Exp $ */ @@ -35,6 +35,12 @@ #define XINE_ENGINE_INTERNAL +#define LOG_MODULE "demux" +#define LOG_VERBOSE +/* +#define LOG +*/ + #include "xine_internal.h" #include "demuxers/demux.h" #include "buffer.h" @@ -48,10 +54,6 @@ #endif #define MIN(a,b) ( (a) < (b) ) ? (a) : (b) -/* -#define LOG -*/ - /* * Flush audio and video buffers. It is called from demuxers on * seek/stop, and may be useful when user input changes a stream and @@ -150,20 +152,20 @@ void _x_demux_control_headers_done (xine_stream_t *stream) { (stream->header_count_video<header_count_video)) { struct timeval tv; struct timespec ts; -#ifdef LOG - printf ("xine: waiting for headers. v:%d %d a:%d %d\n", - stream->header_count_video, header_count_video, - stream->header_count_audio, header_count_audio); -#endif + + lprintf ("waiting for headers. v:%d %d a:%d %d\n", + stream->header_count_video, header_count_video, + stream->header_count_audio, header_count_audio); + gettimeofday(&tv, NULL); ts.tv_sec = tv.tv_sec + 1; ts.tv_nsec = tv.tv_usec * 1000; /* use timedwait to workaround buggy pthread broadcast implementations */ pthread_cond_timedwait (&stream->counter_changed, &stream->counter_lock, &ts); } -#ifdef LOG - printf ("xine: headers processed.\n"); -#endif + + lprintf ("headers processed.\n"); + pthread_mutex_unlock (&stream->counter_lock); } @@ -215,9 +217,7 @@ static void *demux_loop (void *stream_gen) { xine_stream_t *stream = (xine_stream_t *)stream_gen; int status; -#ifdef LOG - printf ("demux: loop starting...\n"); -#endif + lprintf ("loop starting...\n"); pthread_mutex_lock( &stream->demux_lock ); @@ -233,17 +233,15 @@ static void *demux_loop (void *stream_gen) { /* someone may want to interrupt us */ if( stream->demux_action_pending ) { pthread_mutex_unlock( &stream->demux_lock ); -#ifdef LOG - printf ("demux: sched_yield\n"); -#endif + + lprintf ("sched_yield\n"); + sched_yield(); pthread_mutex_lock( &stream->demux_lock ); } } -#ifdef LOG - printf ("demux: main demuxer loop finished (status: %d)\n", status); -#endif + lprintf ("main demuxer loop finished (status: %d)\n", status); /* tell to the net_buf_ctrl that we are at the end of the stream * then the net_buf_ctrl will not pause @@ -263,9 +261,7 @@ static void *demux_loop (void *stream_gen) { } while( status == DEMUX_OK && stream->demux_thread_running ); -#ifdef LOG - printf ("demux: loop finished (status: %d)\n", status); -#endif + lprintf ("loop finished (status: %d)\n", status); /* demux_thread_running is zero if demux loop has being stopped by user */ if (stream->demux_thread_running) { @@ -274,9 +270,8 @@ static void *demux_loop (void *stream_gen) { _x_demux_control_end(stream, BUF_FLAG_END_USER); } -#ifdef LOG - printf ("demux: loop finished, end buffer sent\n"); -#endif + lprintf ("loop finished, end buffer sent\n"); + stream->demux_thread_running = 0; pthread_mutex_unlock( &stream->demux_lock ); @@ -288,9 +283,7 @@ int _x_demux_start_thread (xine_stream_t *stream) { int err; -#ifdef LOG - printf ("demux: start thread called\n"); -#endif + lprintf ("start thread called\n"); stream->demux_action_pending = 1; pthread_mutex_lock( &stream->demux_lock ); @@ -315,9 +308,7 @@ int _x_demux_stop_thread (xine_stream_t *stream) { void *p; -#ifdef LOG - printf ("demux: stop thread called\n"); -#endif + lprintf ("stop thread called\n"); stream->demux_action_pending = 1; pthread_mutex_lock( &stream->demux_lock ); @@ -325,9 +316,7 @@ int _x_demux_stop_thread (xine_stream_t *stream) { stream->demux_action_pending = 0; pthread_mutex_unlock( &stream->demux_lock ); -#ifdef LOG - printf ("demux: joining thread %ld\n", stream->demux_thread ); -#endif + lprintf ("joining thread %ld\n", stream->demux_thread ); /* FIXME: counter_lock isn't meant to protect demux_thread update. however we can't use demux_lock here. should we create a new lock? */ diff --git a/src/xine-engine/input_rip.c b/src/xine-engine/input_rip.c index cefe5e4cb..b5525d384 100644 --- a/src/xine-engine/input_rip.c +++ b/src/xine-engine/input_rip.c @@ -29,7 +29,7 @@ * - it's possible speeder saving streams in the xine without playing: * xine stream_mrl#save:file.raw\;noaudio\;novideo * - * $Id: input_rip.c,v 1.17 2003/11/24 22:52:15 valtri Exp $ + * $Id: input_rip.c,v 1.18 2003/11/26 19:43:38 f1rmb Exp $ */ /* TODO: @@ -49,9 +49,12 @@ #include <string.h> #include <errno.h> -/* logging */ -/*#define LOG 1*/ #define LOG_MODULE "input_rip" +#define LOG_VERBOSE +/* +#define LOG +*/ + #define CLR_FAIL "\e[1;31m" #define CLR_RST "\e[0;39m" diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 2844faaee..15e614f4d 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.164 2003/11/26 19:32:27 mroi Exp $ + * $Id: load_plugins.c,v 1.165 2003/11/26 19:43:38 f1rmb Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -42,7 +42,9 @@ #define LOG_MODULE "load_plugins" #define LOG_VERBOSE -/* #define LOG */ +/* +#define LOG +*/ #define XINE_ENABLE_EXPERIMENTAL_FEATURES 1 #include "xine_internal.h" @@ -127,7 +129,7 @@ static void map_decoders (xine_t *this) { plugin_node_t *node; int i, pos; - lprintf ("load_plugins: map_decoders\n"); + lprintf ("map_decoders\n"); /* clean up */ @@ -147,7 +149,7 @@ static void map_decoders (xine_t *this) { int *type = ((decoder_info_t *)node->info->special_info)->supported_types; int priority = get_decoder_priority(this, node); - lprintf ("load_plugins: mapping decoder %s\n", node->info->id); + lprintf ("mapping decoder %s\n", node->info->id); while (type && (*type)) { @@ -168,7 +170,7 @@ static void map_decoders (xine_t *this) { /* insert new decoder */ catalog->audio_decoder_map[streamtype][pos] = node; - lprintf("load_plugins: decoder inserted in decoder map at %d\n", pos); + lprintf("decoder inserted in decoder map at %d\n", pos); type++; } @@ -186,7 +188,7 @@ static void map_decoders (xine_t *this) { int *type = ((decoder_info_t *)node->info->special_info)->supported_types; int priority = get_decoder_priority(this, node); - lprintf ("load_plugins: mapping decoder %s\n", node->info->id); + lprintf ("mapping decoder %s\n", node->info->id); while (type && (*type)) { @@ -206,7 +208,7 @@ static void map_decoders (xine_t *this) { /* insert new decoder */ catalog->video_decoder_map[streamtype][pos] = node; - lprintf("load_plugins: decoder inserted in decoder map at %d\n", pos); + lprintf("decoder inserted in decoder map at %d\n", pos); type++; } @@ -224,7 +226,7 @@ static void map_decoders (xine_t *this) { int *type = ((decoder_info_t *)node->info->special_info)->supported_types; int priority = get_decoder_priority(this, node); - lprintf ("load_plugins: mapping decoder %s\n", node->info->id); + lprintf ("mapping decoder %s\n", node->info->id); while (type && (*type)) { @@ -245,7 +247,7 @@ static void map_decoders (xine_t *this) { /* insert new decoder */ catalog->spu_decoder_map[streamtype][pos] = node; - lprintf("load_plugins: decoder inserted in decoder map at %d\n", pos); + lprintf("decoder inserted in decoder map at %d\n", pos); type++; } @@ -412,7 +414,7 @@ static void collect_plugins(xine_t *this, char *path){ DIR *dir; - lprintf ("load_plugins: collect_plugins in %s\n", path); + lprintf ("collect_plugins in %s\n", path); dir = opendir(path); if (dir) { @@ -632,7 +634,7 @@ static void _load_required_plugins(xine_t *this, xine_list_t *list) { if( load && !node->plugin_class ) { - lprintf("load_plugins: preload plugin %s from %s\n", node->info->id, node->filename); + lprintf("preload plugin %s from %s\n", node->info->id, node->filename); node->plugin_class = _load_plugin_class (this, node->filename, node->info, NULL); @@ -941,7 +943,7 @@ void _x_scan_plugins (xine_t *this) { int i,j; int lenpluginpath; - lprintf("load_plugins: _x_scan_plugins()\n"); + lprintf("_x_scan_plugins()\n"); /* TODO - This needs to be fixed for WIN32 */ #ifndef WIN32 @@ -1156,7 +1158,7 @@ demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const cha while (node) { - lprintf ("load_plugins: probing demux '%s'\n", node->info->id); + lprintf ("probing demux '%s'\n", node->info->id); if (strcasecmp(node->info->id, last_demux_name) == 0) { last_demux = node; @@ -1355,7 +1357,7 @@ xine_video_port_t *xine_open_video_driver (xine_t *this, pthread_mutex_unlock (&catalog->lock); if (!driver) { - lprintf ("load_plugins: failed to load video output plugin <%s>\n", id); + lprintf ("failed to load video output plugin <%s>\n", id); return NULL; } @@ -1392,7 +1394,7 @@ xine_video_port_t *xine_new_framegrab_video_port (xine_t *this) { pthread_mutex_unlock (&catalog->lock); if (!driver) { - lprintf ("load_plugins: failed to load video output plugin <%s>\n", id); + lprintf ("failed to load video output plugin <%s>\n", id); return NULL; } @@ -1434,7 +1436,7 @@ static ao_driver_t *_load_audio_driver (xine_t *this, plugin_node_t *node, node->plugin_class = _load_plugin_class (this, node->filename, node->info, data); if (!node->plugin_class) { - lprintf ("load_plugins: failed to load plugin class %s\n", node->info->id); + lprintf ("failed to load plugin class %s\n", node->info->id); return NULL; } @@ -1590,7 +1592,7 @@ video_decoder_t *_x_get_video_decoder (xine_stream_t *stream, uint8_t stream_typ int i, j; plugin_catalog_t *catalog = stream->xine->plugin_catalog; - lprintf ("load_plugins: looking for video decoder for streamtype %02x\n", stream_type); + lprintf ("looking for video decoder for streamtype %02x\n", stream_type); pthread_mutex_lock (&catalog->lock); @@ -1666,7 +1668,7 @@ audio_decoder_t *_x_get_audio_decoder (xine_stream_t *stream, uint8_t stream_typ int i, j; plugin_catalog_t *catalog = stream->xine->plugin_catalog; - lprintf ("load_plugins: looking for audio decoder for streamtype %02x\n", stream_type); + lprintf ("looking for audio decoder for streamtype %02x\n", stream_type); pthread_mutex_lock (&catalog->lock); @@ -1739,7 +1741,7 @@ spu_decoder_t *_x_get_spu_decoder (xine_stream_t *stream, uint8_t stream_type) { int i, j; plugin_catalog_t *catalog = stream->xine->plugin_catalog; - lprintf ("load_plugins: looking for spu decoder for streamtype %02x\n", stream_type); + lprintf ("looking for spu decoder for streamtype %02x\n", stream_type); pthread_mutex_lock (&catalog->lock); diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 374f616e0..69a1939d1 100644 --- a/src/xine-engine/metronom.c +++ b/src/xine-engine/metronom.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: metronom.c,v 1.129 2003/11/20 00:42:14 tmattern Exp $ + * $Id: metronom.c,v 1.130 2003/11/26 19:43:38 f1rmb Exp $ */ #ifdef HAVE_CONFIG_H @@ -34,6 +34,7 @@ #include <errno.h> #define LOG_MODULE "metronom" +#define LOG_VERBOSE /* #define LOG #define LOG_AUDIO diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index dc8383de6..4d04c3f61 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -22,11 +22,6 @@ #define __OSD_C__ -/* -#define LOG_VERBOSE 1 -#define LOG 1 -*/ - #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -47,6 +42,12 @@ #include <langinfo.h> #endif +#define LOG_MODULE "osd" +#define LOG_VERBOSE +/* +#define LOG +*/ + #include "xine_internal.h" #include "video_out/alphablend.h" #include "xine-engine/bswap.h" diff --git a/src/xine-engine/scratch.c b/src/xine-engine/scratch.c index 55cd0d281..4a34a0ad2 100644 --- a/src/xine-engine/scratch.c +++ b/src/xine-engine/scratch.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: scratch.c,v 1.10 2003/11/11 18:45:01 f1rmb Exp $ + * $Id: scratch.c,v 1.11 2003/11/26 19:43:38 f1rmb Exp $ * * top-level xine functions * @@ -31,21 +31,20 @@ #include <stdarg.h> #include <string.h> /* For memset */ -#include "scratch.h" -#include "xineutils.h" - +#define LOG_MODULE "scratch" +#define LOG_VERBOSE /* #define LOG */ +#include "scratch.h" +#include "xineutils.h" + static void scratch_printf (scratch_buffer_t *this, const char *format, va_list argp) { vsnprintf (this->lines[this->cur], 1023, format, argp); -#ifdef LOG - printf ("scratch: printing format %s to line %d\n", - format, this->cur); -#endif + lprintf ("printing format %s to line %d\n", format, this->cur); this->cur = (this->cur + 1) % this->num_lines; } @@ -61,9 +60,7 @@ static const char **scratch_get_content (scratch_buffer_t *this) { this->ordered[i] = this->lines[j]; -#ifdef LOG - printf ("scratch: line %d contains >%s<\n", i , this->lines[j]); -#endif + lprintf ("line %d contains >%s<\n", i , this->lines[j]); } diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index 493716fbc..f4226a7d5 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.140 2003/11/20 00:42:14 tmattern Exp $ + * $Id: video_decoder.c,v 1.141 2003/11/26 19:43:38 f1rmb Exp $ * */ @@ -31,14 +31,16 @@ #define XINE_ENGINE_INTERNAL -#include "xine_internal.h" -#include "xineutils.h" -#include <sched.h> - +#define LOG_MODULE "video_decoder" +#define LOG_VERBOSE /* #define LOG */ +#include "xine_internal.h" +#include "xineutils.h" +#include <sched.h> + static void update_spu_decoder (xine_stream_t *stream, int type) { int streamtype = (type>>16) & 0xFF; @@ -73,17 +75,13 @@ static void *video_decoder_loop (void *stream_gen) { while (running) { -#ifdef LOG - printf ("video_decoder: getting buffer...\n"); -#endif + lprintf ("getting buffer...\n"); buf = stream->video_fifo->get (stream->video_fifo); _x_extra_info_merge( stream->video_decoder_extra_info, buf->extra_info ); stream->video_decoder_extra_info->seek_count = stream->video_seek_count; -#ifdef LOG - printf ("video_decoder: got buffer 0x%08x\n", buf->type); -#endif + lprintf ("got buffer 0x%08x\n", buf->type); /* check for a new port to use */ if (stream->next_video_port) { @@ -159,10 +157,8 @@ static void *video_decoder_loop (void *stream_gen) { stream->finished_count_video++; -#ifdef LOG - printf ("video_decoder: reached end marker # %d\n", - stream->finished_count_video); -#endif + lprintf ("reached end marker # %d\n", + stream->finished_count_video); pthread_cond_broadcast (&stream->counter_changed); @@ -226,9 +222,8 @@ static void *video_decoder_loop (void *stream_gen) { break; case BUF_CONTROL_DISCONTINUITY: -#ifdef LOG - printf ("video_decoder: discontinuity ahead\n"); -#endif + lprintf ("discontinuity ahead\n"); + if (stream->video_decoder_plugin) { /* it might be a long time before we get back from a discontinuity, so we better flush * the decoder before */ @@ -241,9 +236,8 @@ static void *video_decoder_loop (void *stream_gen) { break; case BUF_CONTROL_NEWPTS: -#ifdef LOG - printf ("video_decoder: new pts %lld\n", buf->disc_off); -#endif + lprintf ("new pts %lld\n", buf->disc_off); + if (stream->video_decoder_plugin) { /* it might be a long time before we get back from a discontinuity, so we better flush * the decoder before */ @@ -440,28 +434,25 @@ void _x_video_decoder_shutdown (xine_stream_t *stream) { buf_element_t *buf; void *p; -#ifdef LOG - printf ("video_decoder: shutdown...\n"); -#endif + lprintf ("shutdown...\n"); if (stream->video_thread) { /* stream->video_fifo->clear(stream->video_fifo); */ buf = stream->video_fifo->buffer_pool_alloc (stream->video_fifo); -#ifdef LOG - printf ("video_decoder: shutdown...2\n"); -#endif + + lprintf ("shutdown...2\n"); + buf->type = BUF_CONTROL_QUIT; stream->video_fifo->put (stream->video_fifo, buf); -#ifdef LOG - printf ("video_decoder: shutdown...3\n"); -#endif + + lprintf ("shutdown...3\n"); pthread_join (stream->video_thread, &p); -#ifdef LOG - printf ("video_decoder: shutdown...4\n"); -#endif + + lprintf ("shutdown...4\n"); + } stream->video_fifo->dispose (stream->video_fifo); diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index 3d051d2ea..18bfa8300 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.180 2003/11/19 12:05:26 mroi Exp $ + * $Id: video_out.c,v 1.181 2003/11/26 19:43:38 f1rmb Exp $ * * frame allocation / queuing / scheduling / output functions */ @@ -39,15 +39,17 @@ #define XINE_ENABLE_EXPERIMENTAL_FEATURES #define XINE_ENGINE_INTERNAL +#define LOG_MODULE "video_out" +#define LOG_VERBOSE +/* +#define LOG +*/ + #include "xine_internal.h" #include "video_out.h" #include "metronom.h" #include "xineutils.h" -/* -#define LOG -*/ - #define NUM_FRAME_BUFFERS 15 typedef struct { @@ -277,15 +279,11 @@ static vo_frame_t *vo_get_frame (xine_video_port_t *this_gen, vo_frame_t *img; vos_t *this = (vos_t *) this_gen; -#ifdef LOG - printf ("video_out: get_frame (%d x %d)\n", width, height); -#endif + lprintf ("get_frame (%d x %d)\n", width, height); img = vo_remove_from_img_buf_queue (this->free_img_buf_queue); -#ifdef LOG - printf ("video_out: got a frame -> pthread_mutex_lock (&img->mutex)\n"); -#endif + lprintf ("got a frame -> pthread_mutex_lock (&img->mutex)\n"); /* some decoders report strange ratios */ if (ratio <= 0.0) @@ -313,9 +311,7 @@ static vo_frame_t *vo_get_frame (xine_video_port_t *this_gen, pthread_mutex_unlock (&img->mutex); -#ifdef LOG - printf ("video_out: get_frame (%d x %d) done\n", width, height); -#endif + lprintf ("get_frame (%d x %d) done\n", width, height); return img; } @@ -346,10 +342,8 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) { cur_vpts = this->clock->get_current_time(this->clock); this->last_delivery_pts = cur_vpts; -#ifdef LOG - printf ("video_out: got image at master vpts %lld. vpts for picture is %lld (pts was %lld)\n", - cur_vpts, pic_vpts, img->pts); -#endif + lprintf ("got image at master vpts %lld. vpts for picture is %lld (pts was %lld)\n", + cur_vpts, pic_vpts, img->pts); this->num_frames_delivered++; @@ -382,18 +376,15 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) { frames_to_skip = 0; if (this->discard_frames) { -#ifdef LOG - printf ("video_out: i'm in flush mode, not appending this frame to queue\n"); -#endif + lprintf ("i'm in flush mode, not appending this frame to queue\n"); + return 0; } } -#ifdef LOG - printf ("video_out: delivery diff : %lld, current vpts is %lld, %d frames to skip\n", - diff, cur_vpts, frames_to_skip); -#endif + lprintf ("delivery diff : %lld, current vpts is %lld, %d frames to skip\n", + diff, cur_vpts, frames_to_skip); if (!img->bad_frame) { @@ -405,9 +396,7 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) { * put frame into FIFO-Buffer */ -#ifdef LOG - printf ("video_out: frame is ok => appending to display buffer\n"); -#endif + lprintf ("frame is ok => appending to display buffer\n"); /* * check for first frame after seek and mark it @@ -420,9 +409,8 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) { if (stream->first_frame_flag == 2) { stream->first_frame_flag = (this->grab_only)?0:1; img->is_first = 1; -#ifdef LOG - printf ("video_out: get_next_video_frame first_frame_reached\n"); -#endif + + lprintf ("get_next_video_frame first_frame_reached\n"); } pthread_mutex_unlock (&stream->first_frame_lock); } @@ -432,9 +420,8 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *stream) { vo_append_to_img_buf_queue (this->display_img_buf_queue, img); } else { -#ifdef LOG - printf ("video_out: bad_frame\n"); -#endif + lprintf ("bad_frame\n"); + if (stream) { pthread_mutex_lock( &stream->current_extra_info_lock ); _x_extra_info_merge( stream->current_extra_info, img->extra_info ); @@ -608,9 +595,8 @@ static void expire_frames (vos_t *this, int64_t cur_vpts) { while (img && (diff > img->duration || this->discard_frames)) { if (img->is_first) { -#ifdef LOG - printf("video_out: expire_frames: first_frame !\n"); -#endif + lprintf("expire_frames: first_frame !\n"); + /* * before displaying the first frame without * "metronom prebuffering" we should make sure it's @@ -660,14 +646,12 @@ static void expire_frames (vos_t *this, int64_t cur_vpts) { if (!this->display_img_buf_queue->first) { if (this->img_backup) { -#ifdef LOG - printf("video_out: overwriting frame backup\n"); -#endif + lprintf("overwriting frame backup\n"); + vo_frame_dec_lock( this->img_backup ); } -#ifdef LOG - printf("video_out: possible still frame (old)\n"); -#endif + + lprintf("possible still frame (old)\n"); this->img_backup = img; @@ -702,16 +686,12 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts) { if (!img) { pthread_mutex_unlock(&this->display_img_buf_queue->mutex); -#ifdef LOG - printf ("video_out: no frame\n"); -#endif + + lprintf ("no frame\n"); if (this->img_backup && (this->redraw_needed==1)) { -#ifdef LOG - printf("video_out: generating still frame (cur_vpts = %lld) \n", - cur_vpts); -#endif + lprintf("generating still frame (cur_vpts = %lld) \n", cur_vpts); /* keep playing still frames */ pthread_mutex_lock( &this->free_img_buf_queue->mutex ); @@ -729,9 +709,8 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts) { if( this->redraw_needed ) this->redraw_needed--; -#ifdef LOG - printf ("video_out: no frame, but no backup frame\n"); -#endif + + lprintf ("no frame, but no backup frame\n"); return NULL; } @@ -745,9 +724,7 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts) { * time to display frame "img" ? */ -#ifdef LOG - printf ("video_out: diff %lld\n", diff); -#endif + lprintf ("diff %lld\n", diff); if (diff < 0) { pthread_mutex_unlock(&this->display_img_buf_queue->mutex); @@ -755,9 +732,8 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts) { } if (this->img_backup) { -#ifdef LOG - printf("video_out: freeing frame backup\n"); -#endif + lprintf("freeing frame backup\n"); + vo_frame_dec_lock( this->img_backup ); this->img_backup = NULL; } @@ -772,9 +748,8 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts) { _x_stream_info_get(img->stream, XINE_STREAM_INFO_VIDEO_HAS_STILL) || img->stream->video_fifo->size(img->stream->video_fifo) < 10) { -#ifdef LOG - printf ("video_out: possible still frame\n"); -#endif + lprintf ("possible still frame\n"); + this->img_backup = duplicate_frame (this, img); } } @@ -795,10 +770,7 @@ static void overlay_and_display_frame (vos_t *this, vo_frame_t *img, int64_t vpts) { xine_stream_t *stream; -#ifdef LOG - printf ("video_out: displaying image with vpts = %lld\n", - img->vpts); -#endif + lprintf ("displaying image with vpts = %lld\n", img->vpts); /* no, this is not were proc_*() is usually called. * it's just to catch special cases like late or duplicated frames. @@ -942,9 +914,7 @@ static void *video_out_loop (void *this_gen) { next_frame_vpts = this->clock->get_current_time (this->clock); -#ifdef LOG - printf ("video_out: loop starting...\n"); -#endif + lprintf ("loop starting...\n"); while ( this->video_loop_running ) { @@ -953,9 +923,9 @@ static void *video_out_loop (void *this_gen) { */ vpts = this->clock->get_current_time (this->clock); -#ifdef LOG - printf ("video_out: loop iteration at %lld\n", vpts); -#endif + + lprintf ("loop iteration at %lld\n", vpts); + expire_frames (this, vpts); img = get_next_frame (this, vpts); @@ -964,9 +934,8 @@ static void *video_out_loop (void *this_gen) { */ if (img) { -#ifdef LOG - printf ("video_out: displaying frame (id=%d)\n", img->id); -#endif + lprintf ("displaying frame (id=%d)\n", img->id); + overlay_and_display_frame (this, img, vpts); } else { @@ -990,9 +959,7 @@ static void *video_out_loop (void *this_gen) { if (stream->video_decoder_plugin && stream->video_fifo) { buf_element_t *buf; -#ifdef LOG - printf ("video_out: flushing current video decoder plugin\n"); -#endif + lprintf ("flushing current video decoder plugin\n"); buf = stream->video_fifo->buffer_pool_try_alloc (stream->video_fifo); if( buf ) { @@ -1017,9 +984,7 @@ static void *video_out_loop (void *this_gen) { next_frame_vpts += 1000; } -#ifdef LOG - printf ("video_out: next_frame_vpts is %lld\n", next_frame_vpts); -#endif + lprintf ("next_frame_vpts is %lld\n", next_frame_vpts); do { vpts = this->clock->get_current_time (this->clock); @@ -1029,10 +994,7 @@ static void *video_out_loop (void *this_gen) { usec_to_sleep = (next_frame_vpts - vpts) * 100 / 9; -#ifdef LOG - printf ("video_out: %lld usec to sleep at master vpts %lld\n", - usec_to_sleep, vpts); -#endif + lprintf ("%lld usec to sleep at master vpts %lld\n", usec_to_sleep, vpts); if ( (next_frame_vpts - vpts) > 2*90000 ) printf("video_out: vpts/clock error, next_vpts=%lld cur_vpts=%lld\n", @@ -1096,11 +1058,9 @@ int xine_get_next_video_frame (xine_video_port_t *this_gen, /* FIXME: ugly, use conditions and locks instead */ -#ifdef LOG - printf ("video_out: get_next_video_frame demux status = %d, fifo_size=%d\n", - stream->demux_plugin->get_status (stream->demux_plugin), - stream->video_fifo->fifo_size); -#endif + lprintf ("get_next_video_frame demux status = %d, fifo_size=%d\n", + stream->demux_plugin->get_status (stream->demux_plugin), + stream->video_fifo->fifo_size); while ( !img && (stream->video_fifo->fifo_size || (stream->demux_plugin->get_status (stream->demux_plugin)==DEMUX_OK))) { @@ -1161,9 +1121,8 @@ static void vo_open (xine_video_port_t *this_gen, xine_stream_t *stream) { vos_t *this = (vos_t *) this_gen; -#ifdef LOG - printf("video_out: vo_open\n"); -#endif + lprintf("vo_open\n"); + this->video_opened = 1; this->discard_frames = 0; this->last_delivery_pts = 0; @@ -1266,9 +1225,7 @@ static int vo_set_property (xine_video_port_t *this_gen, int property, int value while ((img = this->display_img_buf_queue->first)) { -#ifdef LOG - printf ("video_out: flushing out frame\n"); -#endif + lprintf ("flushing out frame\n"); img = vo_remove_from_img_buf_queue_int (this->display_img_buf_queue); @@ -1363,9 +1320,7 @@ static void vo_exit (xine_video_port_t *this_gen) { vos_t *this = (vos_t *) this_gen; -#ifdef LOG - printf ("video_out: vo_exit...\n"); -#endif + lprintf ("vo_exit...\n"); if (this->video_loop_running) { void *p; @@ -1379,9 +1334,7 @@ static void vo_exit (xine_video_port_t *this_gen) { this->driver->dispose (this->driver); -#ifdef LOG - printf ("video_out: vo_exit... done\n"); -#endif + lprintf ("vo_exit... done\n"); if (this->overlay_source) { this->overlay_source->dispose (this->overlay_source); diff --git a/src/xine-engine/vo_scale.c b/src/xine-engine/vo_scale.c index d915382d7..170e3158a 100644 --- a/src/xine-engine/vo_scale.c +++ b/src/xine-engine/vo_scale.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: vo_scale.c,v 1.26 2003/11/11 18:45:01 f1rmb Exp $ + * $Id: vo_scale.c,v 1.27 2003/11/26 19:43:38 f1rmb Exp $ * * Contains common code to calculate video scaling parameters. * In short, it will map frame dimensions to screen/window size. @@ -28,14 +28,16 @@ #include <string.h> #include <math.h> -#include "xine_internal.h" -#include "video_out.h" -#include "vo_scale.h" - +#define LOG_MODULE "vo_scale" +#define LOG_VERBOSE /* #define LOG */ +#include "xine_internal.h" +#include "video_out.h" +#include "vo_scale.h" + /* * convert delivered height/width to ideal width/height * taking into account aspect ratio and zoom factor @@ -175,13 +177,10 @@ void _x_vo_scale_compute_output_size (vo_scale_t *this) { this->displayed_xoffset = (this->delivered_width - this->displayed_width) / 2; this->displayed_yoffset = (this->delivered_height - this->displayed_height) / 2; -#ifdef LOG - printf ("vo_scale: frame source %d x %d (%d x %d) => screen output %d x %d\n", - this->delivered_width, this->delivered_height, - this->displayed_width, this->displayed_height, - this->output_width, this->output_height); -#endif - + lprintf ("frame source %d x %d (%d x %d) => screen output %d x %d\n", + this->delivered_width, this->delivered_height, + this->displayed_width, this->displayed_height, + this->output_width, this->output_height); /* calculate borders */ if (this->output_height < this->gui_height) { diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 18972acc7..a8e7d5587 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.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: xine.c,v 1.271 2003/11/26 13:33:55 miguelfreitas Exp $ + * $Id: xine.c,v 1.272 2003/11/26 19:43:38 f1rmb Exp $ */ /* @@ -46,10 +46,11 @@ #include <locale.h> #endif -/********** logging **********/ #define LOG_MODULE "xine" #define LOG_VERBOSE -/* #define LOG */ +/* +#define LOG +*/ #define XINE_ENABLE_EXPERIMENTAL_FEATURES #define XINE_ENGINE_INTERNAL |