From: James Courtier-D. <jcd...@us...> - 2001-10-23 21:51:14
|
Update of /cvsroot/xine/xine-lib/src/libspudec In directory usw-pr-cvs1:/tmp/cvs-serv4486/xine-lib/src/libspudec Modified Files: spu.c xine_decoder.c Log Message: Changed debug printf to xprintf. Added a comment in load_plugins. Index: spu.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/libspudec/spu.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- spu.c 2001/10/23 00:50:47 1.18 +++ spu.c 2001/10/23 21:51:11 1.19 @@ -51,6 +51,7 @@ #include "spu.h" #include "video_out/alphablend.h" +#include "monitor.h" #define LOG_DEBUG 1 @@ -76,8 +77,8 @@ /* Return value: reassembly complete = 1 */ int spu_reassembly (spu_seq_t *seq, int start, uint8_t *pkt_data, u_int pkt_len) { - LOG (LOG_DEBUG, "pkt_len: %d\n", pkt_len); - LOG (LOG_DEBUG, "Reassembly: start=%d seq=%p\n", start,seq); + xprintf (VERBOSE|SPU, "pkt_len: %d\n", pkt_len); + xprintf (VERBOSE|SPU, "Reassembly: start=%d seq=%p\n", start,seq); if (start) { seq->seq_len = (((u_int)pkt_data[0])<<8) | pkt_data[1]; @@ -92,8 +93,8 @@ } seq->ra_offs = 0; - LOG (LOG_DEBUG, "buf_len: %d\n", seq->buf_len); - LOG (LOG_DEBUG, "cmd_off: %d\n", seq->cmd_offs); + xprintf (VERBOSE|SPU, "buf_len: %d\n", seq->buf_len); + xprintf (VERBOSE|SPU, "cmd_off: %d\n", seq->cmd_offs); } if (seq->ra_offs < seq->buf_len) { @@ -140,10 +141,10 @@ uint8_t *buf = state->cmd_ptr; uint8_t *next_seq; - LOG (LOG_DEBUG, "SPU EVENT\n"); + xprintf (VERBOSE|SPU, "SPU EVENT\n"); state->delay = (buf[0] << 8) + buf[1]; - LOG (LOG_DEBUG, "\tdelay=%d\n",state->delay); + xprintf (VERBOSE|SPU, "\tdelay=%d\n",state->delay); next_seq = seq->buf + (buf[2] << 8) + buf[3]; buf += 4; @@ -157,13 +158,13 @@ while (buf < next_seq && *buf != CMD_SPU_EOF) { switch (*buf) { case CMD_SPU_SHOW: /* show subpicture */ - LOG (LOG_DEBUG, "\tshow subpicture\n"); + xprintf (VERBOSE|SPU, "\tshow subpicture\n"); state->visible = 1; buf++; break; case CMD_SPU_HIDE: /* hide subpicture */ - LOG (LOG_DEBUG, "\thide subpicture\n"); + xprintf (VERBOSE|SPU, "\thide subpicture\n"); state->visible = 2; buf++; break; @@ -181,7 +182,7 @@ ovl->color[2] = state->clut[clut->entry1]; ovl->color[1] = state->clut[clut->entry2]; ovl->color[0] = state->clut[clut->entry3]; - LOG (LOG_DEBUG, "\tclut [%x %x %x %x]\n", + xprintf (VERBOSE|SPU, "\tclut [%x %x %x %x]\n", ovl->color[0], ovl->color[1], ovl->color[2], ovl->color[3]); state->modified = 1; buf += 3; @@ -195,7 +196,7 @@ ovl->trans[2] = trans->entry1; ovl->trans[1] = trans->entry2; ovl->trans[0] = trans->entry3; - LOG (LOG_DEBUG, "\ttrans [%d %d %d %d]\n", + xprintf (VERBOSE|SPU, "\ttrans [%d %d %d %d]\n", ovl->trans[0], ovl->trans[1], ovl->trans[2], ovl->trans[3]); state->modified = 1; buf += 3; @@ -218,7 +219,7 @@ ovl->clip_left = 0; ovl->clip_right = ovl->width - 1; - LOG (LOG_DEBUG, "\tx = %d y = %d width = %d height = %d\n", + xprintf (VERBOSE|SPU, "\tx = %d y = %d width = %d height = %d\n", ovl->x, ovl->y, ovl->width, ovl->height ); state->modified = 1; buf += 7; @@ -227,14 +228,14 @@ case CMD_SPU_SET_PXD_OFFSET: /* image top[0] field / image bottom[1] field*/ state->field_offs[0] = (((u_int)buf[1]) << 8) | buf[2]; state->field_offs[1] = (((u_int)buf[3]) << 8) | buf[4]; - LOG (LOG_DEBUG, "\toffset[0] = %d offset[1] = %d\n", + xprintf (VERBOSE|SPU, "\toffset[0] = %d offset[1] = %d\n", state->field_offs[0], state->field_offs[1]); state->modified = 1; buf += 5; break; case CMD_SPU_MENU: - LOG (LOG_DEBUG, "\tForce Display/Menu\n"); + xprintf (VERBOSE|SPU, "\tForce Display/Menu\n"); state->menu = 1; buf++; break; @@ -297,7 +298,7 @@ field ^= 1; // Toggle fields if (put_y >= spu->height) { - LOG (LOG_DEBUG, "put_y >= spu->height\n"); + xprintf (VERBOSE|SPU, "put_y >= spu->height\n"); return -1; } return 0; Index: xine_decoder.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/libspudec/xine_decoder.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- xine_decoder.c 2001/10/23 10:49:22 1.23 +++ xine_decoder.c 2001/10/23 21:51:11 1.24 @@ -37,8 +37,8 @@ #include "xine_internal.h" #include "video_out/alphablend.h" #include "xine-engine/bswap.h" +#include "monitor.h" - void print_overlay( vo_overlay_t *ovl ); #define LOG_DEBUG 1 @@ -285,7 +285,7 @@ found=1; break; } - LOG (LOG_DEBUG, "this_event=%d vpts %d\n",this_event, this->spu_events[this_event].event->vpts); + xprintf (VERBOSE|SPU, "this_event=%d vpts %d\n",this_event, this->spu_events[this_event].event->vpts); if (this->spu_events[this_event].event->vpts > event->vpts ) { found=2; break; @@ -334,7 +334,7 @@ /* FIXME:Get Handle after we have found if "Forced display" is set or not. */ - LOG (LOG_DEBUG, "Found SPU from stream %d pts=%d vpts=%d\n",stream_id, + xprintf (VERBOSE|SPU, "Found SPU from stream %d pts=%d vpts=%d\n",stream_id, this->spu_stream_state[stream_id].pts, this->spu_stream_state[stream_id].vpts); this->state.cmd_ptr = this->cur_seq->buf + this->cur_seq->cmd_offs; @@ -361,7 +361,7 @@ */ if ((this->xine->spu_channel != stream_id) && (this->state.menu == 0) ) { - LOG (LOG_DEBUG, "Dropping SPU channel %d\n", stream_id); + xprintf (VERBOSE|SPU, "Dropping SPU channel %d\n", stream_id); spu_free_handle(this, handle); return; } @@ -485,14 +485,14 @@ } void print_overlay( vo_overlay_t *ovl ) { - LOG (LOG_DEBUG, "OVERLAY to show\n"); - LOG (LOG_DEBUG, "\tx = %d y = %d width = %d height = %d\n", + xprintf (VERBOSE|SPU, "OVERLAY to show\n"); + xprintf (VERBOSE|SPU, "\tx = %d y = %d width = %d height = %d\n", ovl->x, ovl->y, ovl->width, ovl->height ); - LOG (LOG_DEBUG, "\tclut [%x %x %x %x]\n", + xprintf (VERBOSE|SPU, "\tclut [%x %x %x %x]\n", ovl->color[0], ovl->color[1], ovl->color[2], ovl->color[3]); - LOG (LOG_DEBUG, "\ttrans [%d %d %d %d]\n", + xprintf (VERBOSE|SPU, "\ttrans [%d %d %d %d]\n", ovl->trans[0], ovl->trans[1], ovl->trans[2], ovl->trans[3]); - LOG (LOG_DEBUG, "\tclip top=%d bottom=%d left=%d right=%d\n", + xprintf (VERBOSE|SPU, "\tclip top=%d bottom=%d left=%d right=%d\n", ovl->clip_top, ovl->clip_bottom, ovl->clip_left, ovl->clip_right); return; } @@ -512,13 +512,10 @@ return; } - printf("show event: event_vpts=%d actual_vpts=%d\n", this->spu_events[this_event].event->vpts,vpts ); - printf("Process_event called\n"); - handle=this->spu_events[this_event].event->object.handle; switch( this->spu_events[this_event].event->event_type ) { case EVENT_SHOW_SPU: - LOG (LOG_DEBUG, "SHOW SPU NOW\n"); + xprintf (VERBOSE|SPU, "SHOW SPU NOW\n"); if (this->spu_events[this_event].event->object.overlay != NULL) { this->spu_objects[handle].handle = handle; this->spu_objects[handle].overlay = this->spu_events[this_event].event->object.overlay; @@ -527,7 +524,7 @@ break; case EVENT_HIDE_SPU: - LOG (LOG_DEBUG, "HIDE SPU NOW\n"); + xprintf (VERBOSE|SPU, "HIDE SPU NOW\n"); this->spu_showing[1].handle = -1; if(this->spu_objects[handle].overlay->rle) { free(this->spu_objects[handle].overlay->rle); @@ -539,19 +536,19 @@ break; case EVENT_HIDE_MENU: - LOG (LOG_DEBUG, "HIDE MENU NOW\n"); + xprintf (VERBOSE|SPU, "HIDE MENU NOW\n"); this->spu_showing[1].handle = -1; /* spu_free_handle( this, handle ); */ break; case EVENT_MENU_SPU: - LOG (LOG_DEBUG, "MENU SPU NOW\n"); + xprintf (VERBOSE|SPU, "MENU SPU NOW\n"); if (this->spu_events[this_event].event->object.overlay != NULL) { vo_overlay_t *overlay = this->spu_objects[handle].overlay; vo_overlay_t *event_overlay = this->spu_events[this_event].event->object.overlay; - LOG (LOG_DEBUG, "event_overlay\n"); + xprintf (VERBOSE|SPU, "event_overlay\n"); print_overlay(event_overlay); - LOG (LOG_DEBUG, "overlay\n"); + xprintf (VERBOSE|SPU, "overlay\n"); print_overlay(overlay); this->spu_objects[handle].handle = handle; /* This should not change for menus */ @@ -569,7 +566,7 @@ event_overlay->color[1] + event_overlay->color[2] + event_overlay->color[3]) > 0 ) { - LOG (LOG_DEBUG, "mixing clut\n"); + xprintf (VERBOSE|SPU, "mixing clut\n"); overlay->color[0] = event_overlay->color[0]; overlay->color[1] = event_overlay->color[1]; overlay->color[2] = event_overlay->color[2]; @@ -579,7 +576,7 @@ event_overlay->trans[1] + event_overlay->trans[2] + event_overlay->trans[3]) > 0 ) { - LOG (LOG_DEBUG, "mixing trans\n"); + xprintf (VERBOSE|SPU, "mixing trans\n"); overlay->trans[0] = event_overlay->trans[0]; overlay->trans[1] = event_overlay->trans[1]; overlay->trans[2] = event_overlay->trans[2]; @@ -588,19 +585,19 @@ this->spu_showing[1].handle = handle; if (event_overlay) free(event_overlay); /* Free should set pointer to NULL, but we should check this */ - LOG (LOG_DEBUG, "overlay after\n"); + xprintf (VERBOSE|SPU, "overlay after\n"); print_overlay(overlay); } break; case EVENT_MENU_BUTTON: - LOG (LOG_DEBUG, "MENU BUTTON NOW\n"); + xprintf (VERBOSE|SPU, "MENU BUTTON NOW\n"); if (this->spu_events[this_event].event->object.overlay != NULL) { vo_overlay_t *overlay = this->spu_objects[handle].overlay; vo_overlay_t *event_overlay = this->spu_events[this_event].event->object.overlay; - LOG (LOG_DEBUG, "event_overlay\n"); + xprintf (VERBOSE|SPU, "event_overlay\n"); print_overlay(event_overlay); - LOG (LOG_DEBUG, "overlay\n"); + xprintf (VERBOSE|SPU, "overlay\n"); print_overlay(overlay); this->spu_objects[handle].handle = handle; /* This should not change for menus */ overlay->clip_top = event_overlay->clip_top; @@ -612,7 +609,7 @@ event_overlay->color[1] + event_overlay->color[2] + event_overlay->color[3]) > 0 ) { - LOG (LOG_DEBUG, "mixing clut\n"); + xprintf (VERBOSE|SPU, "mixing clut\n"); overlay->color[0] = event_overlay->color[0]; overlay->color[1] = event_overlay->color[1]; overlay->color[2] = event_overlay->color[2]; @@ -622,20 +619,20 @@ event_overlay->trans[1] + event_overlay->trans[2] + event_overlay->trans[3]) > 0 ) { - LOG (LOG_DEBUG, "mixing trans\n"); + xprintf (VERBOSE|SPU, "mixing trans\n"); overlay->trans[0] = event_overlay->trans[0]; overlay->trans[1] = event_overlay->trans[1]; overlay->trans[2] = event_overlay->trans[2]; overlay->trans[3] = event_overlay->trans[3]; } this->spu_showing[1].handle = handle; - LOG (LOG_DEBUG, "overlay after\n"); + xprintf (VERBOSE|SPU, "overlay after\n"); print_overlay(overlay); } break; default: - LOG (LOG_DEBUG, "Unhandled event type\n"); + xprintf (VERBOSE|SPU, "Unhandled event type\n"); break; } @@ -694,13 +691,13 @@ overlay = malloc (sizeof(vo_overlay_t)); overlay_event->object.overlay=overlay; - LOG (LOG_DEBUG, "BUTTON\n"); - LOG (LOG_DEBUG, "\tshow=%d\n",but->show); - LOG (LOG_DEBUG, "\tclut [%x %x %x %x]\n", + xprintf (VERBOSE|SPU, "BUTTON\n"); + xprintf (VERBOSE|SPU, "\tshow=%d\n",but->show); + xprintf (VERBOSE|SPU, "\tclut [%x %x %x %x]\n", but->color[0], but->color[1], but->color[2], but->color[3]); - LOG (LOG_DEBUG, "\ttrans [%d %d %d %d]\n", + xprintf (VERBOSE|SPU, "\ttrans [%d %d %d %d]\n", but->trans[0], but->trans[1], but->trans[2], but->trans[3]); - LOG (LOG_DEBUG, "\tleft = %d right = %d top = %d bottom = %d\n", + xprintf (VERBOSE|SPU, "\tleft = %d right = %d top = %d bottom = %d\n", but->left, but->right, but->top, but->bottom ); if (!this->state.menu) return; |