diff options
-rw-r--r-- | src/libvdpau/vdpau_mpeg12.c | 3 | ||||
-rw-r--r-- | src/video_out/video_out_vdpau.c | 37 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 7 | ||||
-rw-r--r-- | src/xine-engine/video_out.h | 3 |
4 files changed, 38 insertions, 12 deletions
diff --git a/src/libvdpau/vdpau_mpeg12.c b/src/libvdpau/vdpau_mpeg12.c index 66d451c12..763d3ff17 100644 --- a/src/libvdpau/vdpau_mpeg12.c +++ b/src/libvdpau/vdpau_mpeg12.c @@ -127,8 +127,7 @@ typedef struct { typedef struct { uint32_t coded_width; uint32_t coded_height; - uint32_t display_width; - uint32_t display_height; + uint64_t video_step; /* frame duration in pts units */ double ratio; VdpDecoderProfile profile; diff --git a/src/video_out/video_out_vdpau.c b/src/video_out/video_out_vdpau.c index 645ff7301..918af6762 100644 --- a/src/video_out/video_out_vdpau.c +++ b/src/video_out/video_out_vdpau.c @@ -49,7 +49,7 @@ #include <vdpau/vdpau_x11.h> #include "accel_vdpau.h" -#define NUM_FRAMES_BACK 1 +#define NUM_FRAMES_BACK 2 VdpOutputSurfaceRenderBlendState blend = { VDP_OUTPUT_SURFACE_RENDER_BLEND_STATE_VERSION, @@ -712,6 +712,7 @@ static void vdpau_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_ //printf("vo_vdpau: allocated_surfaces=%d\n", this->allocated_surfaces ); frame->ratio = ratio; + frame->vo_frame.future_frame = NULL; } @@ -744,6 +745,22 @@ static void vdpau_release_back_frames( vo_driver_t *this_gen ) +static void vdpau_backup_frame( vo_driver_t *this_gen, vo_frame_t *frame_gen ) +{ + vdpau_driver_t *this = (vdpau_driver_t *) this_gen; + vdpau_frame_t *frame = (vdpau_frame_t *) frame_gen; + + int i; + if ( this->back_frame[NUM_FRAMES_BACK-1]) { + this->back_frame[NUM_FRAMES_BACK-1]->vo_frame.free (&this->back_frame[NUM_FRAMES_BACK-1]->vo_frame); + } + for ( i=NUM_FRAMES_BACK-1; i>0; i-- ) + this->back_frame[i] = this->back_frame[i-1]; + this->back_frame[0] = frame; +} + + + static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { vdpau_driver_t *this = (vdpau_driver_t *) this_gen; @@ -896,6 +913,8 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) 2, past, surface, 1, future, &vid_source, this->output_surface[this->current_output_surface], &out_dest, &vid_dest, layer_count, layer_count?layer:NULL ); if ( st != VDP_STATUS_OK ) printf( "vo_vdpau: vdp_video_mixer_render error : %s\n", vdp_get_error_string( st ) ); + else + printf( "vo_vdpau: vdp_video_mixer_render: top_field, past1=%d, past0=%d, current=%d, future=%d\n", past[1], past[0], surface, future[0] ); vdp_queue_get_time( vdp_queue, ¤t_time ); vdp_queue_display( vdp_queue, this->output_surface[this->current_output_surface], 0, 0, current_time ); @@ -918,11 +937,17 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) } past[0] = surface; - future[0] = VDP_INVALID_HANDLE; + if ( frame->vo_frame.future_frame!=NULL ) + future[0] = ((vdpau_frame_t*)(frame->vo_frame.future_frame))->vdpau_accel_data.surface; + else + future[0] = VDP_INVALID_HANDLE; + st = vdp_video_mixer_render( this->video_mixer, VDP_INVALID_HANDLE, 0, frame->vo_frame.progressive_frame || frame->vo_frame.top_field_first ? VDP_VIDEO_MIXER_PICTURE_STRUCTURE_BOTTOM_FIELD : VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD, 2, past, surface, 1, future, &vid_source, this->output_surface[this->current_output_surface], &out_dest, &vid_dest, layer_count, layer_count?layer:NULL ); if ( st != VDP_STATUS_OK ) printf( "vo_vdpau: vdp_video_mixer_render error : %s\n", vdp_get_error_string( st ) ); + else + printf( "vo_vdpau: vdp_video_mixer_render: bottom_field, past1=%d, past0=%d, current=%d, future=%d\n", past[1], past[0], surface, future[0] ); /* calculate delay for second field: there should be no delay for still images otherwise, take replay speed into account */ if (stream_speed > 0) @@ -947,13 +972,7 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) XUnlockDisplay( this->display ); - int i; - if ( this->back_frame[NUM_FRAMES_BACK-1]) { - this->back_frame[NUM_FRAMES_BACK-1]->vo_frame.free (&this->back_frame[NUM_FRAMES_BACK-1]->vo_frame); - } - for ( i=NUM_FRAMES_BACK-1; i>0; i-- ) - this->back_frame[i] = this->back_frame[i-1]; - this->back_frame[0] = frame; + vdpau_backup_frame( this_gen, frame_gen ); } diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index be062cc5d..6b0353bee 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -931,7 +931,7 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts, /* extra info of the backup is thrown away, because it is not up to date */ _x_extra_info_reset(img->extra_info); } - + img->future_frame = NULL; return img; } else { @@ -989,6 +989,11 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts, /* * remove frame from display queue and show it */ + + if ( img->next ) + img->future_frame = img->next; + else + img->future_frame = NULL; img = vo_remove_from_img_buf_queue_int (this->display_img_buf_queue, 1, 0, 0, 0, 0, 0); pthread_mutex_unlock(&this->display_img_buf_queue->mutex); diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index 7fa34ac8b..76b347a41 100644 --- a/src/xine-engine/video_out.h +++ b/src/xine-engine/video_out.h @@ -149,6 +149,9 @@ struct vo_frame_s { /* displacement for overlays */ int overlay_offset_x, overlay_offset_y; + + /* pointer to the next frame in display order, used by some vo deint */ + struct vo_frame_s *future_frame; /* * that part is used only by video_out.c for frame management |