diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/video_out/video_out_xxmc.c | 44 | ||||
-rw-r--r-- | src/video_out/xxmc.h | 4 |
2 files changed, 43 insertions, 5 deletions
diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index b6cf74d10..2607d7b2a 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -18,7 +18,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_xxmc.c,v 1.12 2005/02/22 18:31:58 totte67 Exp $ + * $Id: video_out_xxmc.c,v 1.13 2005/04/09 11:47:43 totte67 Exp $ * * video_out_xxmc.c, X11 decoding accelerated video extension interface for xine * @@ -39,6 +39,7 @@ #include "xxmc.h" +#include <unistd.h> static int gX11Fail; static void xxmc_frame_updates(xxmc_driver_t *driver, xxmc_frame_t *frame); @@ -1458,6 +1459,7 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) xxmc_driver_t *this = (xxmc_driver_t *) this_gen; xxmc_frame_t *frame = (xxmc_frame_t *) frame_gen; xine_xxmc_t *xxmc = &frame->xxmc_data; + int first_field; /* * queue frames (deinterlacing) @@ -1493,6 +1495,10 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) * ask for offset and output size */ + first_field = (frame->vo_frame.top_field_first) ? XVMC_TOP_FIELD : XVMC_BOTTOM_FIELD; + first_field = (this->bob) ? first_field : XVMC_TOP_FIELD; + this->cur_field = (this->deinterlace_enabled) ? first_field : XVMC_FRAME_PICTURE; + xxmc_redraw_needed (this_gen); if (frame->format == XINE_IMGFMT_XXMC) { XVMCLOCKDISPLAY( this->display ); @@ -1502,9 +1508,24 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) this->sc.displayed_width, this->sc.displayed_height, this->sc.output_xoffset, this->sc.output_yoffset, this->sc.output_width, this->sc.output_height, - ((this->deinterlace_enabled) ? - XVMC_TOP_FIELD : XVMC_FRAME_PICTURE)); + this->cur_field); XVMCUNLOCKDISPLAY( this->display ); + if (this->deinterlace_enabled && this->bob) { + unsigned + ms_per_field = 500 * frame->vo_frame.duration / 90000 - 2; + + usleep(ms_per_field*1000); + this->cur_field = (frame->vo_frame.top_field_first) ? XVMC_BOTTOM_FIELD : XVMC_TOP_FIELD; + + XVMCLOCKDISPLAY( this->display ); + XvMCPutSurface( this->display, frame->xvmc_surf , this->drawable, + this->sc.displayed_xoffset, this->sc.displayed_yoffset, + this->sc.displayed_width, this->sc.displayed_height, + this->sc.output_xoffset, this->sc.output_yoffset, + this->sc.output_width, this->sc.output_height, + this->cur_field); + XVMCUNLOCKDISPLAY( this->display ); + } } else { XLockDisplay (this->display); if (this->use_shm) { @@ -1699,7 +1720,7 @@ static int xxmc_gui_data_exchange (vo_driver_t *this_gen, this->sc.displayed_width, this->sc.displayed_height, this->sc.output_xoffset, this->sc.output_yoffset, this->sc.output_width, this->sc.output_height, - ((this->deinterlace_enabled) ? XVMC_TOP_FIELD : XVMC_FRAME_PICTURE)); + this->cur_field); XVMCUNLOCKDISPLAY( this->display ); } else { XLockDisplay (this->display); @@ -1950,6 +1971,12 @@ static void xxmc_update_nvidia_fix(void *this_gen, xine_cfg_entry_t *entry) { this->reverse_nvidia_palette = entry->num_value; } +static void xxmc_update_bob(void *this_gen, xine_cfg_entry_t *entry) { + xxmc_driver_t *this = (xxmc_driver_t *) this_gen; + + this->bob = entry->num_value; +} + static void checkXvMCCap( xxmc_driver_t *this, XvPortID xv_port) { @@ -2412,7 +2439,16 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi _("There's a bug in NVIDIA's XvMC lib that makes red OSD colors\n" "look blue and vice versa. This option provides a workaround.\n"), 10, xxmc_update_nvidia_fix, this); + this->bob = + config->register_bool (config, "video.device.xvmc_bob_deinterlacing", 0, + _("Use bob as accelerated deinterlace method."), + _("When interlacing is enabled for hardware accelerated frames,\n" + "Alternate between top and bottom field at double the frame rate.\n"), + 10, xxmc_update_bob, this); + this->deinterlace_enabled = 0; + this->cur_field = XVMC_FRAME_PICTURE; + #ifdef HAVE_VLDXVMC printf("video_out_xxmc: Unichrome CPU saving is %s.\n", (this->cpu_save_enabled) ? "on":"off"); diff --git a/src/video_out/xxmc.h b/src/video_out/xxmc.h index 645fd9269..27103dea7 100644 --- a/src/video_out/xxmc.h +++ b/src/video_out/xxmc.h @@ -18,7 +18,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: xxmc.h,v 1.6 2004/11/24 16:11:10 mroi Exp $ + * $Id: xxmc.h,v 1.7 2005/04/09 11:47:43 totte67 Exp $ * * video_out_xxmc.c, X11 decoding accelerated video extension interface for xine * @@ -204,6 +204,8 @@ struct xxmc_driver_s { uint32_t capabilities; xxmc_frame_t *recent_frames[VO_NUM_RECENT_FRAMES]; xxmc_frame_t *cur_frame; + int cur_field; + int bob; x11osd *xoverlay; int xv_xoverlay_type; int xoverlay_type; |