mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 04:50:11 +01:00
st/vdpau: Respect source_rect in VideoMixerRender
Fixing a bug reported by Andy Furniss.
This commit is contained in:
parent
efb4872a9d
commit
ddd25cfbb0
1 changed files with 11 additions and 1 deletions
|
|
@ -139,6 +139,8 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer,
|
|||
uint32_t layer_count,
|
||||
VdpLayer const *layers)
|
||||
{
|
||||
struct pipe_video_rect src_rect, *p_src_rect = NULL;
|
||||
|
||||
vlVdpVideoMixer *vmixer;
|
||||
vlVdpSurface *surf;
|
||||
vlVdpOutputSurface *dst;
|
||||
|
|
@ -155,8 +157,16 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer,
|
|||
if (!dst)
|
||||
return VDP_STATUS_INVALID_HANDLE;
|
||||
|
||||
if (video_source_rect) {
|
||||
src_rect.x = MIN2(video_source_rect->x1, video_source_rect->x0);
|
||||
src_rect.y = MIN2(video_source_rect->y1, video_source_rect->y0);
|
||||
src_rect.w = abs(video_source_rect->x1 - video_source_rect->x0);
|
||||
src_rect.h = abs(video_source_rect->y1 - video_source_rect->y0);
|
||||
p_src_rect = &src_rect;
|
||||
}
|
||||
|
||||
vl_compositor_clear_layers(&vmixer->compositor);
|
||||
vl_compositor_set_buffer_layer(&vmixer->compositor, 0, surf->video_buffer, NULL, NULL);
|
||||
vl_compositor_set_buffer_layer(&vmixer->compositor, 0, surf->video_buffer, p_src_rect, NULL);
|
||||
vl_compositor_render(&vmixer->compositor, dst->surface, NULL, NULL);
|
||||
|
||||
return VDP_STATUS_OK;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue