summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJulien Isorce <[email protected]>2019-05-08 12:40:50 -0700
committerJulien Isorce <[email protected]>2019-05-10 17:13:31 +0000
commit98b852cd07a80fa42336031f089bdac6e7c617d3 (patch)
tree66d9741655b5bf65b25888dfd20b4fb7ce05490b /src/gallium
parent292187afcc9f32bde54fc1a94d81066e8bed194f (diff)
st/va: set the visible image dimensions in vlVaDeriveImage
This fixes video being rendered incorrectly. User wants height of 360 but internally pipe_video_buffer 's height is 368 in the test below. Test: GST_GL_PLATFORM=egl gst-launch-1.0 videotestsrc ! video/x-raw, width=868, height=360, format=NV12 ! vaapipostproc ! glimagesink Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110443 Signed-off-by: Julien Isorce <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Leo Liu <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/va/image.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c
index d4b9ce5596d..9e3a49f1996 100644
--- a/src/gallium/state_trackers/va/image.c
+++ b/src/gallium/state_trackers/va/image.c
@@ -236,10 +236,12 @@ vlVaDeriveImage(VADriverContextP ctx, VASurfaceID surface, VAImage *image)
img->format.fourcc = PipeFormatToVaFourcc(surf->buffer->buffer_format);
img->buf = VA_INVALID_ID;
- img->width = surf->buffer->width;
- img->height = surf->buffer->height;
+ /* Use the visible dimensions. */
+ img->width = surf->templat.width;
+ img->height = surf->templat.height;
img->num_palette_entries = 0;
img->entry_bytes = 0;
+ /* Image data size is computed using internal dimensions. */
w = align(surf->buffer->width, 2);
h = align(surf->buffer->height, 2);