Skip to content

Commit

Permalink
lavc/vaapi_encode: Don't pass VAConfigAttribEncPackedHeaders with val…
Browse files Browse the repository at this point in the history
…ue set to 0

Recent Intel i965 driver commit strictly disallows application to set
unsupported attribute values, VA_ENC_PACKED_HEADER_NONE (0) is not used
in Intel i965 driver, so application shouldn't pass this value to the
driver. On the other hand, VA_ENC_PACKED_HEADER_NONE (0) means the
driver doesn't support any packed header mode, so application also
shouldn't pass packed header to driver if a driver returns
VA_ENC_PACKED_HEADER_NONE (0), the driver should work without
VAConfigAttribEncPackedHeaders set for this case.

In addition, VA_ATTRIB_NOT_SUPPORTED and VA_ENC_PACKED_HEADER_NONE make
thing messy, we will deprecate VA_ENC_PACKED_HEADER_NONE in the
future. See intel/libva#178 for more information.

This fixes broken vp9 encoder on Kably Lake with Intel I965 driver.

Signed-off-by: Haihao Xiang <[email protected]>
  • Loading branch information
xhaihao committed Mar 27, 2018
1 parent 8a0e5cb commit ed6d92e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libavcodec/vaapi_encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,10 @@ static av_cold int vaapi_encode_config_attributes(AVCodecContext *avctx)
ctx->va_packed_headers, attr[i].value);
ctx->va_packed_headers &= attr[i].value;
}

if (!ctx->va_packed_headers)
continue;

ctx->config_attributes[ctx->nb_config_attributes++] =
(VAConfigAttrib) {
.type = VAConfigAttribEncPackedHeaders,
Expand Down

0 comments on commit ed6d92e

Please sign in to comment.