From 37f97e1753af20a7161f61e99cb203b214e00641 Mon Sep 17 00:00:00 2001 From: Christian König Date: Fri, 10 Feb 2012 14:32:16 +0100 Subject: vl: add support for bob deinterlacing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2: return VDP_STATUS_INVALID_VIDEO_MIXER_PICTURE_STRUCTURE for unknown picture structure. Signed-off-by: Christian König --- src/gallium/state_trackers/vdpau/mixer.c | 21 ++++++++++++++++++++- src/gallium/state_trackers/xorg/xvmc/surface.c | 3 ++- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'src/gallium/state_trackers') diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c index f1c5a57d33e..df6750d5698 100644 --- a/src/gallium/state_trackers/vdpau/mixer.c +++ b/src/gallium/state_trackers/vdpau/mixer.c @@ -204,6 +204,7 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, VdpLayer const *layers) { struct pipe_video_rect src_rect, dst_rect, dst_clip; + enum vl_compositor_deinterlace deinterlace; unsigned layer = 0; vlVdpVideoMixer *vmixer; @@ -242,8 +243,26 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, } vl_compositor_clear_layers(&vmixer->compositor); + + switch (current_picture_structure) { + case VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD: + deinterlace = VL_COMPOSITOR_BOB_TOP; + break; + + case VDP_VIDEO_MIXER_PICTURE_STRUCTURE_BOTTOM_FIELD: + deinterlace = VL_COMPOSITOR_BOB_BOTTOM; + break; + + case VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME: + deinterlace = VL_COMPOSITOR_WEAVE; + break; + + default: + return VDP_STATUS_INVALID_VIDEO_MIXER_PICTURE_STRUCTURE; + }; vl_compositor_set_buffer_layer(&vmixer->compositor, layer++, surf->video_buffer, - RectToPipe(video_source_rect, &src_rect), NULL); + RectToPipe(video_source_rect, &src_rect), NULL, + deinterlace); vl_compositor_render(&vmixer->compositor, dst->surface, RectToPipe(destination_video_rect, &dst_rect), RectToPipe(destination_rect, &dst_clip), diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c index 024612e7414..7f7eeadcbc6 100644 --- a/src/gallium/state_trackers/xorg/xvmc/surface.c +++ b/src/gallium/state_trackers/xorg/xvmc/surface.c @@ -406,7 +406,8 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable, context_priv->decoder->flush(context_priv->decoder); vl_compositor_clear_layers(compositor); - vl_compositor_set_buffer_layer(compositor, 0, surface_priv->video_buffer, &src_rect, NULL); + vl_compositor_set_buffer_layer(compositor, 0, surface_priv->video_buffer, + &src_rect, NULL, VL_COMPOSITOR_WEAVE); if (subpicture_priv) { XVMC_MSG(XVMC_TRACE, "[XvMC] Surface %p has subpicture %p.\n", surface, surface_priv->subpicture); -- cgit v1.2.3