intel / intel/libva

[RFC]: Deprecate VA_ENC_PACKED_HEADER_NONE and similar

Open
#178 14 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
784
Forks
314
PR merge metrics
No merged PRs in 30d

Description

VAAPI provides two ways for drivers to report/handle some unsupported attributes. For example, driver can report that packed headers are unsupported by either setting the value to `VA_ATTRIB_NOT_SUPPORTED` or `VA_ENC_PACKED_HEADER_NONE`. Unfortunately, `VA_ENC_PACKED_HEADER_NONE` evaluates to zero (0) and can produce unintended results if not handled properly in both driver and middleware (since the packed header attribute is a bitfield).
`VA_ATTRIB_NOT_SUPPORTED` on the other hand is not zero and makes it suitable for simple bitwise operations on bitfield attributes. To handle both cases properly, drivers/middleware are forced to do extra work that would be unnecessary otherwise (e.g. https://github.com/intel/intel-vaapi-driver/blob/0b37282fa1c302d2b0c791fdc46c69af0d16d09b/src/i965_drv_video.c#L1418). AFAICT, having attribute values such as `VA_ENC_PACKED_HEADER_NONE=0` serves no purpose and only creates confusion and bugs.

Also, there are other bitfield attributes that have similar `_NONE = 0` usage which should also be deprecated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.