amfcodec: fix setting quality presets

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2159>
This commit is contained in:
Andoni Morales Alastruey 2022-04-12 11:20:00 +02:00 committed by Nacho Garcia
parent 25b37c33dd
commit 2df32360b2

View file

@ -849,6 +849,16 @@ gst_amf_h264_enc_set_format (GstAmfEncoder * encoder,
goto error;
}
if (self->preset > AMF_VIDEO_ENCODER_QUALITY_PRESET_UNKNOWN) {
result = comp->SetProperty (AMF_VIDEO_ENCODER_QUALITY_PRESET,
(amf_int64) self->preset);
if (result != AMF_OK) {
GST_ERROR_OBJECT (self, "Failed to set quality preset, result %"
GST_AMF_RESULT_FORMAT, GST_AMF_RESULT_ARGS (result));
goto error;
}
}
result = comp->SetProperty (AMF_VIDEO_ENCODER_PROFILE, (amf_int64) profile);
if (result != AMF_OK) {
GST_ERROR_OBJECT (self, "Failed to set profile, result %"