diff options
Diffstat (limited to 'src/dxr3')
-rw-r--r-- | src/dxr3/dxr3_decode_spu.c | 44 | ||||
-rw-r--r-- | src/dxr3/dxr3_decode_video.c | 62 | ||||
-rw-r--r-- | src/dxr3/dxr3_mpeg_encoders.c | 64 | ||||
-rw-r--r-- | src/dxr3/dxr3_scr.c | 31 | ||||
-rw-r--r-- | src/dxr3/dxr3_scr.h | 3 | ||||
-rw-r--r-- | src/dxr3/dxr3_spu_encoder.c | 4 | ||||
-rw-r--r-- | src/dxr3/video_out_dxr3.c | 148 | ||||
-rw-r--r-- | src/dxr3/video_out_dxr3.h | 3 |
8 files changed, 205 insertions, 154 deletions
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c index 8721f43c2..27e696ecb 100644 --- a/src/dxr3/dxr3_decode_spu.c +++ b/src/dxr3/dxr3_decode_spu.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: dxr3_decode_spu.c,v 1.40 2003/11/26 19:43:31 f1rmb Exp $ + * $Id: dxr3_decode_spu.c,v 1.41 2003/12/05 15:54:57 f1rmb Exp $ */ /* dxr3 spu decoder plugin. @@ -146,7 +146,7 @@ static void *dxr3_spudec_init_plugin(xine_t *xine, void* data) { dxr3_spudec_class_t *this; - this = (dxr3_spudec_class_t *)malloc(sizeof(dxr3_spudec_class_t)); + this = (dxr3_spudec_class_t *)xine_xmalloc(sizeof(dxr3_spudec_class_t)); if (!this) return NULL; this->spu_decoder_class.open_plugin = dxr3_spudec_open_plugin; @@ -172,7 +172,7 @@ static spu_decoder_t *dxr3_spudec_open_plugin(spu_decoder_class_t *class_gen, xi if (class->instance) return NULL; if (!dxr3_present(stream)) return NULL; - this = (dxr3_spudec_t *)malloc(sizeof(dxr3_spudec_t)); + this = (dxr3_spudec_t *)xine_xmalloc(sizeof(dxr3_spudec_t)); if (!this) return NULL; this->spu_decoder.decode_data = dxr3_spudec_decode_data; @@ -210,8 +210,8 @@ static spu_decoder_t *dxr3_spudec_open_plugin(spu_decoder_class_t *class_gen, xi /* open dxr3 spu device */ snprintf(tmpstr, sizeof(tmpstr), "%s_sp%s", this->devname, this->devnum); if ((this->fd_spu = open(tmpstr, O_WRONLY)) < 0) { - printf("dxr3_decode_spu: Failed to open spu device %s (%s)\n", - tmpstr, strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("dxr3_decode_spu: Failed to open spu device %s (%s)\n"), tmpstr, strerror(errno)); pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock); free(this); return NULL; @@ -279,7 +279,8 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf) dxr3_swab_clut((int *)buf->content); pthread_mutex_lock(&this->dxr3_vo->spu_device_lock); if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_SETPALETTE, buf->content)) - printf("dxr3_decode_spu: failed to set CLUT (%s)\n", strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_spu: failed to set CLUT (%s)\n", strerror(errno)); /* remember clut, when video out places some overlay we may need to restore it */ memcpy(this->clut, buf->content, 16 * sizeof(uint32_t)); this->dxr3_vo->clut_cluttered = 0; @@ -328,14 +329,14 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf) if ((dxr3_spudec_copy_nav_to_btn(this, 0, &btn ) > 0)) { pthread_mutex_lock(&this->dxr3_vo->spu_device_lock); if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, &btn)) - printf("dxr3_decode_spu: failed to set spu button (%s)\n", - strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_spu: failed to set spu button (%s)\n", strerror(errno)); pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock); } else { /* current button does not exist -> use another one */ xine_event_t event; - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "requested button not available\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("requested button not available\n")); if (this->buttonN > this->pci.hli.hl_gi.btn_ns) this->buttonN = this->pci.hli.hl_gi.btn_ns; @@ -350,8 +351,8 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf) if ((dxr3_spudec_copy_nav_to_btn(this, 0, &btn ) > 0)) { pthread_mutex_lock(&this->dxr3_vo->spu_device_lock); if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, &btn)) - printf("dxr3_decode_spu: failed to set spu button (%s)\n", - strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_spu: failed to set spu button (%s)\n", strerror(errno)); pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock); } else XINE_ASSERT(0, "no working menu button found"); @@ -454,13 +455,15 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf) llprintf(LOG_PTS, "pts = %lld vpts = %lld\n", buf->pts, vpts); vpts32 = vpts; if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_SETPTS, &vpts32)) - printf("dxr3_decode_spu: spu setpts failed (%s)\n", strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_spu: spu setpts failed (%s)\n", strerror(errno)); } /* has video out tampered with our palette */ if (this->dxr3_vo->clut_cluttered) { if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_SETPALETTE, this->clut)) - printf("dxr3_decode_spu: failed to set CLUT (%s)\n", strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_spu: failed to set CLUT (%s)\n", strerror(errno)); this->dxr3_vo->clut_cluttered = 0; } @@ -468,14 +471,14 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf) llprintf(LOG_SPU, "write: SPU_FD = %i\n",this->fd_spu); written = write(this->fd_spu, buf->content, buf->size); if (written < 0) { - printf("dxr3_decode_spu: spu device write failed (%s)\n", - strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_spu: spu device write failed (%s)\n", strerror(errno)); pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock); return; } if (written != buf->size) - printf("dxr3_decode_spu: Could only write %d of %d spu bytes.\n", - written, buf->size); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_spu: Could only write %d of %d spu bytes.\n", written, buf->size); pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock); } @@ -541,8 +544,8 @@ static void dxr3_spudec_set_button(spu_decoder_t *this_gen, int32_t button, int3 (dxr3_spudec_copy_nav_to_btn(this, mode - 1, &btn ) > 0)) { pthread_mutex_lock(&this->dxr3_vo->spu_device_lock); if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, &btn)) - printf("dxr3_decode_spu: failed to set spu button (%s)\n", - strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_spu: failed to set spu button (%s)\n", strerror(errno)); pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock); } pthread_mutex_unlock(&this->pci_lock); @@ -628,7 +631,8 @@ static int dxr3_spudec_copy_nav_to_btn(dxr3_spudec_t *this, int32_t mode, em8300 } if (!button_ptr) { - printf("dxr3_decode_spu: No suitable menu button group found, using group 1.\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_spu: No suitable menu button group found, using group 1.\n"); button_ptr = &this->pci.hli.btnit[this->buttonN - 1]; } diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c index f27c58146..99d42b195 100644 --- a/src/dxr3/dxr3_decode_video.c +++ b/src/dxr3/dxr3_decode_video.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: dxr3_decode_video.c,v 1.47 2003/11/29 19:35:39 mroi Exp $ + * $Id: dxr3_decode_video.c,v 1.48 2003/12/05 15:54:57 f1rmb Exp $ */ /* dxr3 video decoder plugin. @@ -151,7 +151,7 @@ static void *dxr3_init_plugin(xine_t *xine, void *data) { dxr3_decoder_class_t *this; - this = (dxr3_decoder_class_t *)malloc(sizeof (dxr3_decoder_class_t)); + this = (dxr3_decoder_class_t *)xine_xmalloc(sizeof (dxr3_decoder_class_t)); if (!this) return NULL; this->video_decoder_class.open_plugin = dxr3_open_plugin; @@ -179,7 +179,7 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_ if (class->instance) return NULL; if (!dxr3_present(stream)) return NULL; - this = (dxr3_decoder_t *)malloc(sizeof (dxr3_decoder_t)); + this = (dxr3_decoder_t *)xine_xmalloc(sizeof (dxr3_decoder_t)); if (!this) return NULL; cfg = stream->xine->config; @@ -217,8 +217,8 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_ this->fd_video = -1; if ((this->fd_control = open(tmpstr, O_WRONLY)) < 0) { - printf("dxr3_decode_video: Failed to open control device %s (%s)\n", - tmpstr, strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("dxr3_decode_video: Failed to open control device %s (%s)\n"), tmpstr, strerror(errno)); free(this); return NULL; } @@ -495,8 +495,8 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf) /* open the device for the decoder */ snprintf (tmpstr, sizeof(tmpstr), "%s_mv%s", this->devname, this->devnum); if ((this->fd_video = open(tmpstr, O_WRONLY)) < 0) { - printf("dxr3_decode_video: Failed to open video device %s (%s)\n", - tmpstr, strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("dxr3_decode_video: Failed to open video device %s (%s)\n"), tmpstr, strerror(errno)); return; } @@ -553,8 +553,8 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf) uint32_t vpts32 = vpts; /* update the dxr3's current pts value */ if (ioctl(this->fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vpts32)) - printf("dxr3_decode_video: set video pts failed (%s)\n", - strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_video: set video pts failed (%s)\n", strerror(errno)); } if (delay >= 90000) /* frame more than 1 sec ahead */ @@ -576,17 +576,18 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf) written = write(this->fd_video, buf->content, buf->size); if (written < 0) { if (errno == EAGAIN) { - printf("dxr3_decode_video: write to device would block. flushing\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("dxr3_decode_video: write to device would block. flushing\n")); dxr3_flush(this_gen); } else { - printf("dxr3_decode_video: video device write failed (%s)\n", - strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("dxr3_decode_video: video device write failed (%s)\n"), strerror(errno)); } return; } if (written != buf->size) - printf("dxr3_decode_video: Could only write %d of %d video bytes.\n", - written, buf->size); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_video: Could only write %d of %d video bytes.\n", written, buf->size); } static void dxr3_reset(video_decoder_t *this_gen) @@ -613,7 +614,7 @@ static void dxr3_flush(video_decoder_t *this_gen) static uint8_t end_buffer[4] = { 0x00, 0x00, 0x01, 0xb7 }; write(this->fd_video, &end_buffer, 4); this->sequence_open = 0; - printf("dxr3_decode_video: WARNING: added missing end sequence\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "dxr3_decode_video: WARNING: added missing end sequence\n"); } } @@ -756,8 +757,8 @@ static int get_duration(dxr3_decoder_t *this) duration = 1500; break; default: - printf("dxr3_decode_video: WARNING: unknown frame rate code %d\n", - this->frame_rate_code); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("dxr3_decode_video: WARNING: unknown frame rate code %d\n"), this->frame_rate_code); duration = 0; break; } @@ -784,7 +785,8 @@ static int get_duration(dxr3_decoder_t *this) /* we just entered a force_duration window, so we start the correction */ metronom_t *metronom = this->stream->metronom; int64_t cur_offset; - printf("dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n")); /* those weird streams need an offset, too */ cur_offset = metronom->get_option(metronom, METRONOM_AV_OFFSET); metronom->set_option(metronom, METRONOM_AV_OFFSET, cur_offset - 28800); @@ -811,21 +813,27 @@ static int get_duration(dxr3_decoder_t *this) static void dxr3_update_sync_mode(void *this_gen, xine_cfg_entry_t *entry) { - ((dxr3_decoder_t *)this_gen)->sync_every_frame = entry->num_value; - printf("dxr3_decode_video: setting sync_every_frame to %s\n", - (entry->num_value ? "on" : "off")); + dxr3_decoder_t *this = (dxr3_decoder_t *)this_gen; + + this->sync_every_frame = entry->num_value; + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_video: setting sync_every_frame to %s\n", (entry->num_value ? "on" : "off")); } static void dxr3_update_enhanced_mode(void *this_gen, xine_cfg_entry_t *entry) { - ((dxr3_decoder_t *)this_gen)->enhanced_mode = entry->num_value; - printf("dxr3_decode_video: setting enhanced mode to %s\n", - (entry->num_value ? "on" : "off")); + dxr3_decoder_t *this = (dxr3_decoder_t *)this_gen; + + this->enhanced_mode = entry->num_value; + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_video: setting enhanced mode to %s\n", (entry->num_value ? "on" : "off")); } static void dxr3_update_correct_durations(void *this_gen, xine_cfg_entry_t *entry) { - ((dxr3_decoder_t *)this_gen)->correct_durations = entry->num_value; - printf("dxr3_decode_video: setting correct_durations mode to %s\n", - (entry->num_value ? "on" : "off")); + dxr3_decoder_t *this = (dxr3_decoder_t *)this_gen; + + this->correct_durations = entry->num_value; + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_video: setting correct_durations mode to %s\n", (entry->num_value ? "on" : "off")); } diff --git a/src/dxr3/dxr3_mpeg_encoders.c b/src/dxr3/dxr3_mpeg_encoders.c index 622e40128..e4ec99913 100644 --- a/src/dxr3/dxr3_mpeg_encoders.c +++ b/src/dxr3/dxr3_mpeg_encoders.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: dxr3_mpeg_encoders.c,v 1.14 2003/11/05 21:58:22 mroi Exp $ + * $Id: dxr3_mpeg_encoders.c,v 1.15 2003/12/05 15:54:58 f1rmb Exp $ */ /* mpeg encoders for the dxr3 video out plugin. @@ -120,13 +120,12 @@ int dxr3_rte_init(dxr3_driver_t *drv) rte_data_t* this; if (!rte_init()) { - printf("dxr3_mpeg_encoder: failed to init librte\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("dxr3_mpeg_encoder: failed to init librte\n")); return 0; } - this = malloc(sizeof(rte_data_t)); + this = xine_xmalloc(sizeof(rte_data_t)); if (!this) return 0; - memset(this, 0, sizeof(rte_data_t)); this->encoder_data.type = ENC_RTE; this->encoder_data.on_update_format = rte_on_update_format; @@ -157,7 +156,8 @@ static int rte_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame) } if ((frame->vo_frame.pitches[0] % 16 != 0) || (frame->oheight % 16 != 0)) { - printf("dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of 16\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of 16\n")); return 0; } @@ -167,7 +167,7 @@ static int rte_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame) /* create new rte context */ this->context = rte_context_new(this->width, this->height, "mp1e", drv); if (!this->context) { - printf("dxr3_mpeg_encoder: failed to get rte context.\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("dxr3_mpeg_encoder: failed to get rte context.\n")); return 0; } context = this->context; /* shortcut */ @@ -178,7 +178,7 @@ static int rte_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame) /* get mpeg codec handle */ codec = rte_codec_set(context, RTE_STREAM_VIDEO, 0, "mpeg1_video"); if (!codec) { - printf("dxr3_mpeg_encoder: could not create codec.\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("dxr3_mpeg_encoder: could not create codec.\n")); rte_context_destroy(context); this->context = 0; return 0; @@ -210,36 +210,44 @@ static int rte_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame) */ fps = 90000.0 / frame->vo_frame.duration; if (!rte_option_set(codec, "virtual_frame_rate", fps)) - printf("dxr3_mpeg_encoder: WARNING: rte_option_set failed; virtual_frame_rate = %g.\n", fps); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_mpeg_encoder: WARNING: rte_option_set failed; virtual_frame_rate = %g.\n", fps); if (!rte_option_set(codec, "coded_frame_rate", fps)) - printf("dxr3_mpeg_encoder: WARNING: rte_option_set failed; coded_frame_rate = %g.\n", fps); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_mpeg_encoder: WARNING: rte_option_set failed; coded_frame_rate = %g.\n", fps); if (!rte_option_set(codec, "bit_rate", (int)this->rte_bitrate)) - printf("dxr3_mpeg_encoder: WARNING: rte_option_set failed; bit_rate = %d.\n", (int)this->rte_bitrate); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_mpeg_encoder: WARNING: rte_option_set failed; bit_rate = %d.\n", (int)this->rte_bitrate); if (!rte_option_set(codec, "gop_sequence", "I")) - printf("dxr3_mpeg_encoder: WARNING: rte_option_set failed; gop_sequence = \"I\".\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_mpeg_encoder: WARNING: rte_option_set failed; gop_sequence = \"I\".\n"); /* just to be sure, disable motion comp (not needed in I frames) */ if (!rte_option_set(codec, "motion_compensation", 0)) - printf("dxr3_mpeg_encoder: WARNING: rte_option_set failed; motion_compensation = 0.\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_mpeg_encoder: WARNING: rte_option_set failed; motion_compensation = 0.\n"); rte_set_input(context, RTE_VIDEO, RTE_PUSH, FALSE, NULL, NULL, NULL); rte_set_output(context, mp1e_callback, NULL, NULL); if (!rte_init_context(context)) { - printf("dxr3_mpeg_encoder: cannot init the context: %s\n", context->error); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("dxr3_mpeg_encoder: cannot init the context: %s\n"), context->error); rte_context_destroy(context); this->context = 0; return 0; } /* do the sync'ing and start encoding */ if (!rte_start_encoding(context)) { - printf("dxr3_mpeg_encoder: cannot start encoding: %s\n", context->error); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("dxr3_mpeg_encoder: cannot start encoding: %s\n"), context->error); rte_context_destroy(context); this->context = 0; return 0; } this->rte_ptr = rte_push_video_data(context, NULL, 0); if (!this->rte_ptr) { - printf("dxr3_mpeg_encoder: failed to get encoder buffer pointer.\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_mpeg_encoder: failed to get encoder buffer pointer.\n"); return 0; } @@ -303,13 +311,13 @@ static void mp1e_callback(rte_context *context, void *data, ssize_t size, void * written = write(drv->fd_video, data, size); if (written < 0) { - printf("dxr3_mpeg_encoder: video device write failed (%s)\n", - strerror(errno)); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_mpeg_encoder: video device write failed (%s)\n", strerror(errno)); return; } if (written != size) - printf("dxr3_mpeg_encoder: Could only write %d of %d mpeg bytes.\n", - written, size); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_mpeg_encoder: Could only write %d of %d mpeg bytes.\n", written, size); } #endif @@ -319,9 +327,8 @@ int dxr3_fame_init(dxr3_driver_t *drv) { fame_data_t *this; - this = malloc(sizeof(fame_data_t)); + this = xine_xmalloc(sizeof(fame_data_t)); if (!this) return 0; - memset(this, 0, sizeof(fame_data_t)); this->encoder_data.type = ENC_FAME; this->encoder_data.on_update_format = fame_on_update_format; @@ -374,14 +381,16 @@ static int fame_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame) this->context = fame_open(); if (!this->context) { - printf("dxr3_mpeg_encoder: Couldn't start the FAME library\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + _("dxr3_mpeg_encoder: Couldn't start the FAME library\n")); return 0; } if (!this->buffer) this->buffer = (unsigned char *)malloc(DEFAULT_BUFFER_SIZE); if (!this->buffer) { - printf("dxr3_mpeg_encoder: Couldn't allocate temp buffer for mpeg data\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_mpeg_encoder: Couldn't allocate temp buffer for mpeg data\n"); return 0; } @@ -476,12 +485,14 @@ static int fame_on_display_frame(dxr3_driver_t *drv, dxr3_frame_t *frame) written = write(drv->fd_video, this->buffer, size); if (written < 0) { - printf("dxr3_mpeg_encoder: video device write failed (%s)\n", + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_mpeg_encoder: video device write failed (%s)\n", strerror(errno)); return 0; } if (written != size) - printf("dxr3_mpeg_encoder: Could only write %d of %d mpeg bytes.\n", + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_mpeg_encoder: Could only write %d of %d mpeg bytes.\n", written, size); return 1; } @@ -516,7 +527,8 @@ static int fame_prepare_frame(fame_data_t *this, dxr3_driver_t *drv, dxr3_frame_ if (frame->vo_frame.format == XINE_IMGFMT_YUY2) { /* need YUY2->YV12 conversion */ if (!(this->out[0] && this->out[1] && this->out[2]) ) { - printf("dxr3_mpeg_encoder: Internal YV12 buffer not created.\n"); + xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, + "dxr3_mpeg_encoder: Internal YV12 buffer not created.\n"); return 0; } y = this->out[0] + frame->vo_frame.width * drv->top_bar; diff --git a/src/dxr3/dxr3_scr.c b/src/dxr3/dxr3_scr.c index ffa289f1f..76e0d3ee4 100644 --- a/src/dxr3/dxr3_scr.c +++ b/src/dxr3/dxr3_scr.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: dxr3_scr.c,v 1.10 2003/09/11 10:01:03 mroi Exp $ + * $Id: dxr3_scr.c,v 1.11 2003/12/05 15:54:58 f1rmb Exp $ */ /* dxr3 scr plugin. @@ -60,13 +60,14 @@ dxr3_scr_t *dxr3_scr_init(xine_t *xine) dxr3_scr_t *this; const char *confstr; - this = (dxr3_scr_t *)malloc(sizeof(dxr3_scr_t)); + this = (dxr3_scr_t *)xine_xmalloc(sizeof(dxr3_scr_t)); + this->xine = xine; confstr = xine->config->register_string(xine->config, CONF_LOOKUP, CONF_DEFAULT, CONF_NAME, CONF_HELP, 0, NULL, NULL); if ((this->fd_control = open(confstr, O_WRONLY)) < 0) { - printf("dxr3_scr: Failed to open control device %s (%s)\n", - confstr, strerror(errno)); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, + "dxr3_scr: Failed to open control device %s (%s)\n", confstr, strerror(errno)); free(this); return NULL; } @@ -111,7 +112,7 @@ static void dxr3_scr_start(scr_plugin_t *scr, int64_t vpts) this->last_pts = vpts32; this->offset = vpts - ((int64_t)vpts32 << 1); if (ioctl(this->fd_control, EM8300_IOCTL_SCR_SET, &vpts32)) - printf("dxr3_scr: start failed (%s)\n", strerror(errno)); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "dxr3_scr: start failed (%s)\n", strerror(errno)); #if LOG_SCR printf("dxr3_scr: started with vpts %lld\n", vpts); #endif @@ -130,12 +131,12 @@ static int64_t dxr3_scr_get_current(scr_plugin_t *scr) pthread_mutex_lock(&this->mutex); if (ioctl(this->fd_control, EM8300_IOCTL_SCR_GET, &pts)) - printf("dxr3_scr: get current failed (%s)\n", strerror(errno)); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "dxr3_scr: get current failed (%s)\n", strerror(errno)); if (this->last_pts > 0xF0000000 && pts < 0x10000000) /* wrap around detected, compensate with offset */ this->offset += (int64_t)1 << 33; if (pts == 0) - printf("dxr3_scr: WARNING: pts dropped to zero.\n"); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "dxr3_scr: WARNING: pts dropped to zero.\n"); this->last_pts = pts; current = ((int64_t)pts << 1) + this->offset; pthread_mutex_unlock(&this->mutex); @@ -151,7 +152,7 @@ static void dxr3_scr_adjust(scr_plugin_t *scr, int64_t vpts) pthread_mutex_lock(&this->mutex); if (ioctl(this->fd_control, EM8300_IOCTL_SCR_GET, ¤t_pts32)) - printf("dxr3_scr: adjust get failed (%s)\n", strerror(errno)); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "dxr3_scr: adjust get failed (%s)\n", strerror(errno)); this->last_pts = current_pts32; this->offset = vpts - ((int64_t)current_pts32 << 1); offset32 = this->offset / 4; @@ -159,7 +160,7 @@ static void dxr3_scr_adjust(scr_plugin_t *scr, int64_t vpts) if (offset32 < -7200/4 || offset32 > 7200/4) { uint32_t vpts32 = vpts >> 1; if (ioctl(this->fd_control, EM8300_IOCTL_SCR_SET, &vpts32)) - printf("dxr3_scr: adjust set failed (%s)\n", strerror(errno)); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "dxr3_scr: adjust set failed (%s)\n", strerror(errno)); this->last_pts = vpts32; this->offset = vpts - ((int64_t)vpts32 << 1); } @@ -206,7 +207,7 @@ static int dxr3_scr_set_speed(scr_plugin_t *scr, int speed) } if (dxr3_mvcommand(this->fd_control, playmode)) - printf("dxr3_scr: failed to playmode (%s)\n", strerror(errno)); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "dxr3_scr: failed to playmode (%s)\n", strerror(errno)); if(em_speed > 0x900) this->scanning = 1; @@ -214,7 +215,7 @@ static int dxr3_scr_set_speed(scr_plugin_t *scr, int speed) this->scanning = 0; if (ioctl(this->fd_control, EM8300_IOCTL_SCR_SETSPEED, &em_speed)) - printf("dxr3_scr: failed to set speed (%s)\n", strerror(errno)); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "dxr3_scr: failed to set speed (%s)\n", strerror(errno)); #if LOG_SCR printf("dxr3_scr: speed set to mode %d\n", speed); @@ -245,7 +246,9 @@ static int dxr3_mvcommand(int fd_control, int command) static void dxr3_scr_update_priority(void *this_gen, xine_cfg_entry_t *entry) { - ((dxr3_scr_t *)this_gen)->priority = entry->num_value; - printf("dxr3_scr: setting scr priority to %d\n", - entry->num_value); + dxr3_scr_t *this = (dxr3_scr_t *)this_gen; + + this->priority = entry->num_value; + xprintf(this->xine, XINE_VERBOSITY_DEBUG, + "dxr3_scr: setting scr priority to %d\n", entry->num_value); } diff --git a/src/dxr3/dxr3_scr.h b/src/dxr3/dxr3_scr.h index ce7416627..80cc35bc7 100644 --- a/src/dxr3/dxr3_scr.h +++ b/src/dxr3/dxr3_scr.h @@ -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: dxr3_scr.h,v 1.4 2003/09/11 10:01:03 mroi Exp $ + * $Id: dxr3_scr.h,v 1.5 2003/12/05 15:54:58 f1rmb Exp $ */ #include "xine_internal.h" @@ -34,6 +34,7 @@ typedef struct dxr3_scr_s { int64_t offset; /* difference between real scr and internal dxr3 clock */ uint32_t last_pts; /* last known value of internal dxr3 clock to detect wrap around */ int scanning; /* are we in a scanning mode */ + xine_t *xine; } dxr3_scr_t; /* plugin initialization function */ diff --git a/src/dxr3/dxr3_spu_encoder.c b/src/dxr3/dxr3_spu_encoder.c index 8892db59f..7b662efbe 100644 --- a/src/dxr3/dxr3_spu_encoder.c +++ b/src/dxr3/dxr3_spu_encoder.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: dxr3_spu_encoder.c,v 1.2 2003/03/02 07:58:18 mroi Exp $ + * $Id: dxr3_spu_encoder.c,v 1.3 2003/12/05 15:54:58 f1rmb Exp $ */ #include <stdio.h> @@ -173,7 +173,7 @@ static void create_histogram(spu_encoder_t *this) for (i = 0; i < OVL_PALETTE_SIZE; i++) if (this->map[i]) printf("dxr3_spu_encoder: histogram: color #%d 0x%.8x appears %d times\n", - i, this->overlay->color[i], this->map[i]); + i, this->overlay->color[i], this->map[i]); for (i = 0; i < OVL_PALETTE_SIZE; i++) if (this->clip_map[i]) printf("dxr3_spu_encoder: histogram: clip color #%d 0x%.8x appears %d times\n", diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c index d62f07d38..0e4b5de98 100644 --- a/src/dxr3/video_out_dxr3.c +++ b/src/dxr3/video_out_dxr3.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_dxr3.c,v 1.94 2003/11/29 19:35:39 mroi Exp $ + * $Id: video_out_dxr3.c,v 1.95 2003/12/05 15:54:58 f1rmb Exp $ */ /* mpeg1 encoding video out plugin for the dxr3. @@ -170,7 +170,7 @@ static dxr3_driver_class_t *dxr3_vo_init_plugin(xine_t *xine, void *visual_gen) const char *confstr; int dashpos; - this = (dxr3_driver_class_t *)malloc(sizeof(dxr3_driver_class_t)); + this = (dxr3_driver_class_t *)xine_xmalloc(sizeof(dxr3_driver_class_t)); if (!this) return NULL; confstr = xine->config->register_string(xine->config, @@ -242,9 +242,8 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v if (class->instance) return NULL; - this = (dxr3_driver_t *)malloc(sizeof(dxr3_driver_t)); + this = (dxr3_driver_t *)xine_xmalloc(sizeof(dxr3_driver_t)); if (!this) return NULL; - memset(this, 0, sizeof(dxr3_driver_t)); this->vo_driver.get_capabilities = dxr3_get_capabilities; this->vo_driver.alloc_frame = dxr3_alloc_frame; @@ -285,16 +284,16 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v #endif if ((this->fd_control = open(tmpstr, O_WRONLY)) < 0) { - xprintf(class->xine, XINE_VERBOSITY_LOG, - "video_out_dxr3: Failed to open control device %s (%s)\n", tmpstr, strerror(errno)); + xprintf(this->class->xine, XINE_VERBOSITY_LOG, + _("video_out_dxr3: Failed to open control device %s (%s)\n"), tmpstr, strerror(errno)); return 0; } snprintf (tmpstr, sizeof(tmpstr), "%s_mv%s", class->devname, class->devnum); if ((this->fd_video = open (tmpstr, O_WRONLY | O_FSYNC )) < 0) { - printf("video_out_dxr3: Failed to open video device %s (%s)\n", - tmpstr, strerror(errno)); + xprintf(this->class->xine, XINE_VERBOSITY_LOG, + _("video_out_dxr3: Failed to open video device %s (%s)\n"), tmpstr, strerror(errno)); return 0; } /* close now and and let the decoder/encoder reopen if they want */ @@ -340,31 +339,36 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v _("Content other than mpeg has to pass an additional reencoding stage, " "because the dxr3 handles mpeg only."), 10, NULL, NULL); if ((strcmp(available_encoders[encoder], "libavcodec") == 0) && !dxr3_lavc_init(this, node)) { - printf("video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"); + xprintf(this->class->xine, XINE_VERBOSITY_LOG, + _("video_out_dxr3: Mpeg encoder libavcodec failed to init.\n")); return 0; } #ifdef HAVE_LIBRTE if ((strcmp(available_encoders[encoder], "rte") == 0) && !dxr3_rte_init(this)) { - printf("video_out_dxr3: Mpeg encoder rte failed to init.\n"); + xprintf(this->class->xine, XINE_VERBOSITY_LOG, + _("video_out_dxr3: Mpeg encoder rte failed to init.\n")); return 0; } #endif #ifdef HAVE_LIBFAME if ((strcmp(available_encoders[encoder], "fame") == 0) && !dxr3_fame_init(this)) { - printf("video_out_dxr3: Mpeg encoder fame failed to init.\n"); + xprintf(this->class->xine, XINE_VERBOSITY_LOG, + _("video_out_dxr3: Mpeg encoder fame failed to init.\n")); return 0; } #endif if (strcmp(available_encoders[encoder], "none") == 0) - printf("video_out_dxr3: Mpeg encoding disabled.\n" - "video_out_dxr3: that's ok, you don't need it for mpeg video like DVDs, but\n" - "video_out_dxr3: you will not be able to play non-mpeg content using this video out\n" - "video_out_dxr3: driver. See the README.dxr3 for details on configuring an encoder.\n"); + xprintf(this->class->xine, XINE_VERBOSITY_LOG, + _("video_out_dxr3: Mpeg encoding disabled.\n" + "video_out_dxr3: that's ok, you don't need it for mpeg video like DVDs, but\n" + "video_out_dxr3: you will not be able to play non-mpeg content using this video out\n" + "video_out_dxr3: driver. See the README.dxr3 for details on configuring an encoder.\n")); } else - printf("video_out_dxr3: No mpeg encoder compiled in.\n" - "video_out_dxr3: that's ok, you don't need it for mpeg video like DVDs, but\n" - "video_out_dxr3: you will not be able to play non-mpeg content using this video out\n" - "video_out_dxr3: driver. See the README.dxr3 for details on configuring an encoder.\n"); + xprintf(this->class->xine, XINE_VERBOSITY_LOG, + _("video_out_dxr3: No mpeg encoder compiled in.\n" + "video_out_dxr3: that's ok, you don't need it for mpeg video like DVDs, but\n" + "video_out_dxr3: you will not be able to play non-mpeg content using this video out\n" + "video_out_dxr3: driver. See the README.dxr3 for details on configuring an encoder.\n")); /* init aspect */ this->aspect = dxr3_set_property(&this->vo_driver, VO_PROP_ASPECT_RATIO, XINE_VO_ASPECT_4_3); @@ -401,6 +405,7 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v printf("video_out_dxr3: setting up overlay mode\n"); #endif gather_screen_vars(this, visual_gen); + this->overlay.xine = this->class->xine; if (dxr3_overlay_read_state(&this->overlay) == 0) { this->overlay_enabled = 1; this->tv_switchable = 1; @@ -416,7 +421,8 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v _("Crops the overlay area from top and bottom to avoid green lines"), NULL, 20, NULL, NULL); } else { - printf("video_out_dxr3: please run autocal, overlay disabled\n"); + xprintf(this->class->xine, XINE_VERBOSITY_LOG, + _("video_out_dxr3: please run autocal, overlay disabled\n")); this->overlay_enabled = 0; this->tv_switchable = 0; this->widescreen_enabled = 0; @@ -451,7 +457,8 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v } if (this->tv_mode != EM8300_VIDEOMODE_DEFAULT) if (ioctl(this->fd_control, EM8300_IOCTL_SET_VIDEOMODE, &this->tv_mode)) - printf("video_out_dxr3: setting video mode failed.\n"); + xprintf(this->class->xine, XINE_VERBOSITY_LOG, + _("video_out_dxr3: setting video mode failed.\n")); #ifdef HAVE_X11 /* initialize overlay */ @@ -476,17 +483,21 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v scr.xsize = this->overlay.screen_xres; scr.ysize = this->overlay.screen_yres; if (ioctl(this->fd_control, EM8300_IOCTL_OVERLAY_SETSCREEN, &scr)) - printf("video_out_dxr3: setting the overlay screen failed.\n"); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: setting the overlay screen failed.\n"); if (dxr3_overlay_set_keycolor(&this->overlay) != 0) - printf("video_out_dxr3: setting the overlay keycolor failed.\n"); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: setting the overlay keycolor failed.\n"); if (dxr3_overlay_set_attributes(&this->overlay) != 0) - printf("video_out_dxr3: setting an overlay attribute failed.\n"); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: setting an overlay attribute failed.\n"); /* finally switch to overlay mode */ value = EM8300_OVERLAY_MODE_OVERLAY; if (ioctl(this->fd_control, EM8300_IOCTL_OVERLAY_SETMODE, &value) != 0) - printf("video_out_dxr3: switching to overlay mode failed.\n"); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: switching to overlay mode failed.\n"); } #endif @@ -504,8 +515,7 @@ static vo_frame_t *dxr3_alloc_frame(vo_driver_t *this_gen) dxr3_frame_t *frame; dxr3_driver_t *this = (dxr3_driver_t *)this_gen; - frame = (dxr3_frame_t *)malloc(sizeof(dxr3_frame_t)); - memset(frame, 0, sizeof(dxr3_frame_t)); + frame = (dxr3_frame_t *)xine_xmalloc(sizeof(dxr3_frame_t)); pthread_mutex_init(&frame->vo_frame.mutex, NULL); @@ -626,8 +636,8 @@ static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_ge /* open the device for the encoder */ snprintf(tmpstr, sizeof(tmpstr), "%s_mv%s", this->class->devname, this->class->devnum); if ((this->fd_video = open(tmpstr, O_WRONLY)) < 0) - printf("video_out_dxr3: Failed to open video device %s (%s)\n", - tmpstr, strerror(errno)); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: Failed to open video device %s (%s)\n", tmpstr, strerror(errno)); /* start the scr plugin */ time = clock->get_current_time(clock); @@ -659,8 +669,9 @@ static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_ge /* Tell the viewers about the aspect ratio stuff. */ if (oheight - height > 0) - printf("video_out_dxr3: adding %d black lines to get %s aspect ratio.\n", - oheight - height, frame->aspect == XINE_VO_ASPECT_4_3 ? "4:3" : "16:9"); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: adding %d black lines to get %s aspect ratio.\n", + oheight - height, frame->aspect == XINE_VO_ASPECT_4_3 ? "4:3" : "16:9"); /* make top black bar multiple of 16, * so old and new macroblocks overlap */ @@ -676,8 +687,9 @@ static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_ge if (!this->enc) { /* no encoder plugin! Let's bug the user! */ - printf("video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n" - "video_out_dxr3: Read the README.dxr3 for details.\n"); + xprintf(this->class->xine, XINE_VERBOSITY_LOG, + _("video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n" + "video_out_dxr3: Read the README.dxr3 for details.\n")); } } @@ -817,9 +829,9 @@ static void dxr3_overlay_end(vo_driver_t *this_gen, vo_frame_t *frame_gen) if (!this->fd_spu) { snprintf (tmpstr, sizeof(tmpstr), "%s_sp%s", this->class->devname, this->class->devnum); if ((this->fd_spu = open (tmpstr, O_WRONLY)) < 0) { - printf("video_out_dxr3: Failed to open spu device %s (%s)\n", - tmpstr, strerror(errno)); - printf("video_out_dxr3: Overlays are not available\n"); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: Failed to open spu device %s (%s)\n" + "video_out_dxr3: Overlays are not available\n", tmpstr, strerror(errno)); pthread_mutex_unlock(&this->spu_device_lock); return; } @@ -846,16 +858,17 @@ static void dxr3_overlay_end(vo_driver_t *this_gen, vo_frame_t *frame_gen) this->spu_enc->color[7] = this->spu_enc->clip_color[3]; /* set palette */ if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_SETPALETTE, this->spu_enc->color)) - printf("video_out_dxr3: failed to set CLUT (%s)\n", strerror(errno)); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: failed to set CLUT (%s)\n", strerror(errno)); this->clut_cluttered = 1; /* write spu */ written = write(this->fd_spu, this->spu_enc->target, this->spu_enc->size); if (written < 0) - printf("video_out_dxr3: spu device write failed (%s)\n", - strerror(errno)); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: spu device write failed (%s)\n", strerror(errno)); else if (written != this->spu_enc->size) - printf("video_out_dxr3: Could only write %d of %d spu bytes.\n", - written, this->spu_enc->size); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: Could only write %d of %d spu bytes.\n", written, this->spu_enc->size); /* set clipping */ btn.color = 0x7654; btn.contrast = @@ -868,8 +881,8 @@ static void dxr3_overlay_end(vo_driver_t *this_gen, vo_frame_t *frame_gen) btn.top = this->spu_enc->overlay->y + this->spu_enc->overlay->clip_top; btn.bottom = this->spu_enc->overlay->y + this->spu_enc->overlay->clip_bottom - 2; if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, &btn)) - printf("dxr3_decode_spu: failed to set spu button (%s)\n", - strerror(errno)); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "dxr3_decode_spu: failed to set spu button (%s)\n", strerror(errno)); pthread_mutex_unlock(&this->spu_device_lock); } @@ -931,8 +944,8 @@ static void dxr3_display_frame(vo_driver_t *this_gen, vo_frame_t *frame_gen) /* inform the card on the timing */ if (ioctl(this->fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vpts32)) - printf("video_out_dxr3: set video pts failed (%s)\n", - strerror(errno)); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: set video pts failed (%s)\n", strerror(errno)); /* for non-mpeg, the encoder plugin is responsible for calling * frame_gen->free(frame_gen) ! */ this->enc->on_display_frame(this, frame); @@ -988,7 +1001,8 @@ static int dxr3_get_property(vo_driver_t *this_gen, int property) case VO_PROP_WINDOW_HEIGHT: return this->scale.gui_height; } - printf("video_out_dxr3: property %d not implemented.\n", property); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: property %d not implemented.\n", property); return 0; } @@ -1039,12 +1053,14 @@ static int dxr3_set_property(vo_driver_t *this_gen, int property, int value) } if (ioctl(this->fd_control, EM8300_IOCTL_SET_ASPECTRATIO, &val)) - printf("video_out_dxr3: failed to set aspect ratio (%s)\n", strerror(errno)); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: failed to set aspect ratio (%s)\n", strerror(errno)); this->scale.force_redraw = 1; break; case VO_PROP_COLORKEY: - printf("video_out_dxr3: VO_PROP_COLORKEY not implemented!"); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: VO_PROP_COLORKEY not implemented!"); this->overlay.colorkey = value; break; case VO_PROP_ZOOM_X: @@ -1056,7 +1072,8 @@ static int dxr3_set_property(vo_driver_t *this_gen, int property, int value) if (!this->widescreen_enabled) { val = EM8300_ASPECTRATIO_4_3; if (ioctl(this->fd_control, EM8300_IOCTL_SET_ASPECTRATIO, &val)) - printf("video_out_dxr3: failed to set aspect ratio (%s)\n", strerror(errno)); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: failed to set aspect ratio (%s)\n", strerror(errno)); dxr3_zoomTV(this); } else { /* FIXME: We should send an anamorphic hint to widescreen tvs, so they @@ -1075,17 +1092,19 @@ static int dxr3_set_property(vo_driver_t *this_gen, int property, int value) #if LOG_VID printf("video_out_dxr3: Changing TVMode to "); #endif - if (this->tv_mode == EM8300_VIDEOMODE_PAL) printf("PAL\n"); - if (this->tv_mode == EM8300_VIDEOMODE_PAL60) printf("PAL60\n"); - if (this->tv_mode == EM8300_VIDEOMODE_NTSC) printf("NTSC\n"); + if (this->tv_mode == EM8300_VIDEOMODE_PAL) xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, "PAL\n"); + if (this->tv_mode == EM8300_VIDEOMODE_PAL60) xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, "PAL60\n"); + if (this->tv_mode == EM8300_VIDEOMODE_NTSC) xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, "NTSC\n"); if (ioctl(this->fd_control, EM8300_IOCTL_SET_VIDEOMODE, &this->tv_mode)) - printf("video_out_dxr3: setting video mode failed (%s)\n", strerror(errno)); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: setting video mode failed (%s)\n", strerror(errno)); break; } if (bcs_changed) if (ioctl(this->fd_control, EM8300_IOCTL_SETBCS, &this->bcs)) - printf("video_out_dxr3: bcs set failed (%s)\n", strerror(errno)); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: bcs set failed (%s)\n", strerror(errno)); return value; } @@ -1306,7 +1325,8 @@ static int dxr3_overlay_read_state(dxr3_overlay_t *this) printf("video_out_dxr3: attempting to open %s\n", fname); #endif if (!(fp = fopen(fname, "r"))) { - printf("video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"); + xprintf(this->xine, XINE_VERBOSITY_LOG, + _("video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n")); return -1; } @@ -1395,7 +1415,8 @@ static int dxr3_overlay_set_keycolor(dxr3_overlay_t *this) attr.attribute = EM9010_ATTRIBUTE_KEYCOLOR_LOWER; attr.value = overlay_limit; if ((ret = ioctl(this->fd_control, EM8300_IOCTL_OVERLAY_SET_ATTRIBUTE, &attr)) < 0) { - printf("video_out_dxr3: WARNING: error setting overlay lower limit attribute\n"); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: WARNING: error setting overlay lower limit attribute\n"); return ret; } @@ -1409,7 +1430,8 @@ static int dxr3_overlay_set_keycolor(dxr3_overlay_t *this) attr.attribute = EM9010_ATTRIBUTE_KEYCOLOR_UPPER; attr.value = overlay_limit; if ((ret = ioctl(this->fd_control, EM8300_IOCTL_OVERLAY_SET_ATTRIBUTE, &attr)) < 0) - printf("video_out_dxr3: WARNING: error setting overlay upper limit attribute\n"); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: WARNING: error setting overlay upper limit attribute\n"); return ret; } @@ -1519,22 +1541,22 @@ static void dxr3_update_add_bars(void *data, xine_cfg_entry_t *entry) { dxr3_driver_t *this = (dxr3_driver_t *)data; this->add_bars = entry->num_value; - printf("video_out_dxr3: setting add_bars to correct aspect ratio to %s\n", - (this->add_bars ? "on" : "off")); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: setting add_bars to correct aspect ratio to %s\n", (this->add_bars ? "on" : "off")); } static void dxr3_update_swap_fields(void *data, xine_cfg_entry_t *entry) { dxr3_driver_t *this = (dxr3_driver_t *)data; this->swap_fields = entry->num_value; - printf("video_out_dxr3: setting swap fields to %s\n", - (this->swap_fields ? "on" : "off")); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: setting swap fields to %s\n", (this->swap_fields ? "on" : "off")); } static void dxr3_update_enhanced_mode(void *data, xine_cfg_entry_t *entry) { dxr3_driver_t *this = (dxr3_driver_t *)data; this->enhanced_mode = entry->num_value; - printf("video_out_dxr3: setting enhanced encoding playback to %s\n", - (this->enhanced_mode ? "on" : "off")); + xprintf(this->class->xine, XINE_VERBOSITY_DEBUG, + "video_out_dxr3: setting enhanced encoding playback to %s\n", (this->enhanced_mode ? "on" : "off")); } diff --git a/src/dxr3/video_out_dxr3.h b/src/dxr3/video_out_dxr3.h index 09af98652..e9481851f 100644 --- a/src/dxr3/video_out_dxr3.h +++ b/src/dxr3/video_out_dxr3.h @@ -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_dxr3.h,v 1.19 2003/09/11 10:01:04 mroi Exp $ + * $Id: video_out_dxr3.h,v 1.20 2003/12/05 15:54:58 f1rmb Exp $ */ #ifdef HAVE_CONFIG_H @@ -65,6 +65,7 @@ typedef struct dxr3_overlay_s { struct coeff colcal_upper[3]; struct coeff colcal_lower[3]; + xine_t *xine; } dxr3_overlay_t; typedef struct dxr3_driver_class_s { |