summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Isorce <[email protected]>2016-09-03 09:10:21 +0100
committerJulien Isorce <[email protected]>2016-09-12 22:17:40 +0100
commitbf901a2f8c8954e55a3eebc6cd1b725f18802012 (patch)
treeeb0d52c5efbe3ceeec5e677d4e23e86c88386392
parent3f3640c86cd850d7d85fe83f102634af92aa894e (diff)
st/va: also honors interlaced preference when providing a video format
This fixes a crash when using the prefered video format with vaapisink on Nvidia hardwares. Also caught by the following assert: nouveau_vp3_video.c:91: Assertion `templat->interlaced' failed. TEST= gst-launch-1.0 videotestsrc ! video/x-raw, format=NV12 ! vaapisink Cc: <[email protected]> Signed-off-by: Julien Isorce <[email protected]> Tested-by: Víctor Manuel Jáquez Leal <[email protected]> Tested-by: Boyuan Zhang <[email protected]> Reviewed-by: Christian König <[email protected]>
-rw-r--r--src/gallium/state_trackers/va/surface.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c
index 3ee1cdda426..00df69db725 100644
--- a/src/gallium/state_trackers/va/surface.c
+++ b/src/gallium/state_trackers/va/surface.c
@@ -632,24 +632,26 @@ vlVaCreateSurfaces2(VADriverContextP ctx, unsigned int format,
memset(&templat, 0, sizeof(templat));
+ templat.buffer_format = pscreen->get_video_param(
+ pscreen,
+ PIPE_VIDEO_PROFILE_UNKNOWN,
+ PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+ PIPE_VIDEO_CAP_PREFERED_FORMAT
+ );
+ templat.interlaced = pscreen->get_video_param(
+ pscreen,
+ PIPE_VIDEO_PROFILE_UNKNOWN,
+ PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+ PIPE_VIDEO_CAP_PREFERS_INTERLACED
+ );
+
if (expected_fourcc) {
- templat.buffer_format = VaFourccToPipeFormat(expected_fourcc);
- templat.interlaced = 0;
- } else {
- templat.buffer_format = pscreen->get_video_param
- (
- pscreen,
- PIPE_VIDEO_PROFILE_UNKNOWN,
- PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
- PIPE_VIDEO_CAP_PREFERED_FORMAT
- );
- templat.interlaced = pscreen->get_video_param
- (
- pscreen,
- PIPE_VIDEO_PROFILE_UNKNOWN,
- PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
- PIPE_VIDEO_CAP_PREFERS_INTERLACED
- );
+ enum pipe_format expected_format = VaFourccToPipeFormat(expected_fourcc);
+
+ if (expected_format != templat.buffer_format || memory_attibute)
+ templat.interlaced = 0;
+
+ templat.buffer_format = expected_format;
}
templat.chroma_format = ChromaToPipe(format);