static GstVaapiEncoderStatus
ensure_profile (GstVaapiEncoderVP9 * encoder)
{
- /* Always start from "simple" profile for maximum compatibility */
- encoder->profile = GST_VAAPI_PROFILE_VP9_0;
+ /*
+ Profile Color | Depth Chroma | Subsampling
+ 0 | 8 bit/sample | 4:2:0
+ 1 | 8 bit | 4:2:2, 4:4:4
+ 2 | 10 or 12 bit | 4:2:0
+ 3 | 10 or 12 bit | 4:2:2, 4:4:4 */
+ const GstVideoFormat format =
+ GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder));
+ if (format == GST_VIDEO_FORMAT_P010_10LE)
+ encoder->profile = GST_VAAPI_PROFILE_VP9_2;
+ else if (format == GST_VIDEO_FORMAT_NV12)
+ encoder->profile = GST_VAAPI_PROFILE_VP9_0;
+ else
+ return GST_VAAPI_ENCODER_STATUS_ERROR_UNSUPPORTED_PROFILE;
/* Ensure bitrate if not set already */
ensure_bitrate (encoder);