summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMaarten Lankhorst <[email protected]>2011-12-19 10:16:06 +0100
committerChristian König <[email protected]>2011-12-19 13:46:51 +0100
commitd6942f781f9cf741e7013f01c2af31f0a5867cc9 (patch)
tree893976ea7c385d954ac1f28fce90b491d0085926 /src/gallium
parente8e0756bd35e5e3b70a0eee323f5aaa3707fe11d (diff)
vdpau: Add background surface support
Sets rgba layer as zeroth layer if a custom background_surface is specified. Signed-off-by: Maarten Lankhorst <[email protected]> Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/vdpau/mixer.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c
index b0d48f0daf6..898c50ed878 100644
--- a/src/gallium/state_trackers/vdpau/mixer.c
+++ b/src/gallium/state_trackers/vdpau/mixer.c
@@ -196,6 +196,7 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer,
VdpLayer const *layers)
{
struct pipe_video_rect src_rect, dst_rect, dst_clip;
+ unsigned layer = 0;
vlVdpVideoMixer *vmixer;
vlVdpSurface *surf;
@@ -224,8 +225,16 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer,
if (!dst)
return VDP_STATUS_INVALID_HANDLE;
+ if (background_surface != VDP_INVALID_HANDLE) {
+ vlVdpOutputSurface *bg = vlGetDataHTAB(background_surface);
+ if (!bg)
+ return VDP_STATUS_INVALID_HANDLE;
+ vl_compositor_set_rgba_layer(&vmixer->compositor, layer++, bg->sampler_view,
+ RectToPipe(background_source_rect, &src_rect), NULL);
+ }
+
vl_compositor_clear_layers(&vmixer->compositor);
- vl_compositor_set_buffer_layer(&vmixer->compositor, 0, surf->video_buffer,
+ vl_compositor_set_buffer_layer(&vmixer->compositor, layer++, surf->video_buffer,
RectToPipe(video_source_rect, &src_rect), NULL);
vl_compositor_render(&vmixer->compositor, dst->surface,
RectToPipe(destination_video_rect, &dst_rect),