From 2df32360b2e27b59e38ad26a6ee807c4b9256ef5 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Tue, 12 Apr 2022 11:20:00 +0200 Subject: [PATCH] amfcodec: fix setting quality presets Part-of: --- subprojects/gst-plugins-bad/sys/amfcodec/gstamfh264enc.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh264enc.cpp b/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh264enc.cpp index fbc64af..1d27513 100644 --- a/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh264enc.cpp +++ b/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh264enc.cpp @@ -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 %" -- 2.7.4