nvencoder: Fix CQP option setting

... and zero initialize LUID and CUDA device list to address
coverity issue

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4215>
This commit is contained in:
Seungha Yang 2023-03-18 01:33:20 +09:00 committed by GStreamer Marge Bot
parent 735dac9d2f
commit fed252cabd
2 changed files with 6 additions and 6 deletions

View file

@ -1301,7 +1301,7 @@ gst_nv_h264_encoder_set_format (GstNvEncoder * encoder,
rc_params->constQP.qpIntra = self->qp_i; rc_params->constQP.qpIntra = self->qp_i;
if (self->qp_p >= 0) if (self->qp_p >= 0)
rc_params->constQP.qpInterP = self->qp_p; rc_params->constQP.qpInterP = self->qp_p;
if (self->qp_p >= 0) if (self->qp_b >= 0)
rc_params->constQP.qpInterB = self->qp_b; rc_params->constQP.qpInterB = self->qp_b;
} }
@ -2219,9 +2219,9 @@ gst_nv_h264_encoder_register_auto_select (GstPlugin * plugin,
std::string resolution_str; std::string resolution_str;
GList *iter; GList *iter;
guint adapter_luid_size = 0; guint adapter_luid_size = 0;
gint64 adapter_luid_list[8]; gint64 adapter_luid_list[8] = { 0, };
guint cuda_device_id_size = 0; guint cuda_device_id_size = 0;
guint cuda_device_id_list[8]; guint cuda_device_id_list[8] = { 0, };
GstNvEncoderDeviceCaps dev_caps; GstNvEncoderDeviceCaps dev_caps;
GstNvEncoderClassData *cdata; GstNvEncoderClassData *cdata;
GstCaps *sink_caps = nullptr; GstCaps *sink_caps = nullptr;

View file

@ -1276,7 +1276,7 @@ gst_nv_h265_encoder_set_format (GstNvEncoder * encoder,
rc_params->constQP.qpIntra = self->qp_i; rc_params->constQP.qpIntra = self->qp_i;
if (self->qp_p >= 0) if (self->qp_p >= 0)
rc_params->constQP.qpInterP = self->qp_p; rc_params->constQP.qpInterP = self->qp_p;
if (self->qp_p >= 0) if (self->qp_b >= 0)
rc_params->constQP.qpInterB = self->qp_b; rc_params->constQP.qpInterB = self->qp_b;
} }
@ -2236,9 +2236,9 @@ gst_nv_h265_encoder_register_auto_select (GstPlugin * plugin,
std::string resolution_str; std::string resolution_str;
GList *iter; GList *iter;
guint adapter_luid_size = 0; guint adapter_luid_size = 0;
gint64 adapter_luid_list[8]; gint64 adapter_luid_list[8] = { 0, };
guint cuda_device_id_size = 0; guint cuda_device_id_size = 0;
guint cuda_device_id_list[8]; guint cuda_device_id_list[8] = { 0, };
GstNvEncoderDeviceCaps dev_caps; GstNvEncoderDeviceCaps dev_caps;
GstNvEncoderClassData *cdata; GstNvEncoderClassData *cdata;
GstCaps *sink_caps = nullptr; GstCaps *sink_caps = nullptr;