mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
libs: encoder: Consider vp9 profiles based on input format.
Only support GST_VAAPI_PROFILE_VP9_0 and GST_VAAPI_PROFILE_VP9_2 now. Fix: #184
This commit is contained in:
parent
e48b0a90f1
commit
0afc813123
1 changed files with 14 additions and 2 deletions
|
@ -149,8 +149,20 @@ ensure_bitrate (GstVaapiEncoderVP9 * encoder)
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue