From 83ba83924af53ad06e2a1a0f945508e22704f879 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Wed, 13 Apr 2022 01:46:34 +0900 Subject: [PATCH] amfh265enc: Handle preset option Add missing preset option handling Part-of: --- subprojects/gst-plugins-bad/sys/amfcodec/gstamfh265enc.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh265enc.cpp b/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh265enc.cpp index e231e98..a31fca0 100644 --- a/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh265enc.cpp +++ b/subprojects/gst-plugins-bad/sys/amfcodec/gstamfh265enc.cpp @@ -669,6 +669,16 @@ gst_amf_h265_enc_set_format (GstAmfEncoder * encoder, goto error; } + if (self->preset > AMF_VIDEO_ENCODER_HEVC_QUALITY_PRESET_UNKNOWN) { + result = comp->SetProperty (AMF_VIDEO_ENCODER_HEVC_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_HEVC_PROFILE, (amf_int64) AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN); if (result != AMF_OK) { -- 2.7.4