diff --git a/src/config.c b/src/config.c index b4c6cfb..0ff19ea 100644 --- a/src/config.c +++ b/src/config.c @@ -36,6 +36,7 @@ #include +#include "codec.h" #include "utils.h" #include "v4l2.h" @@ -97,6 +98,16 @@ VAStatus RequestCreateConfig(VADriverContextP context, VAProfile profile, config_object->profile = profile; config_object->entrypoint = entrypoint; + /* + * iter5b-β: cache the V4L2 OUTPUT-side FOURCC for this profile so + * context.c::RequestCreateContext can read it without re-running + * the profile→pixelformat mapping. Wires up the previously-dead + * pixelformat field at config.h:46. The switch above already + * rejected unsupported profiles via VA_STATUS_ERROR_UNSUPPORTED_PROFILE, + * so pixelformat_for_profile here returns non-zero for every + * profile that reaches this assignment. + */ + config_object->pixelformat = pixelformat_for_profile(profile); config_object->attributes[0].type = VAConfigAttribRTFormat; config_object->attributes[0].value = VA_RT_FORMAT_YUV420; config_object->attributes_count = 1;