diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264encoder.cpp b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264encoder.cpp index 3381547614..21dc5baa6b 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264encoder.cpp +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264encoder.cpp @@ -1877,6 +1877,7 @@ gst_nv_h264_encoder_create_class_data (GstObject * device, gpointer session, if (device_mode == GST_NV_ENCODER_DEVICE_CUDA) g_object_get (device, "cuda-device-id", &cdata->cuda_device_id, nullptr); + /* class data will be leaked if the element never gets instantiated */ GST_MINI_OBJECT_FLAG_SET (cdata->sink_caps, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); GST_MINI_OBJECT_FLAG_SET (cdata->src_caps, @@ -2185,6 +2186,12 @@ gst_nv_h264_encoder_register_auto_select (GstPlugin * plugin, memcpy (&cdata->cuda_device_id_list, cuda_device_id_list, sizeof (cuda_device_id_list)); + /* class data will be leaked if the element never gets instantiated */ + GST_MINI_OBJECT_FLAG_SET (cdata->sink_caps, + GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); + GST_MINI_OBJECT_FLAG_SET (cdata->src_caps, + GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); + GType type; GTypeInfo type_info = { sizeof (GstNvH264EncoderClass), diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265encoder.cpp b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265encoder.cpp index 6361300871..3d6b7795cf 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265encoder.cpp +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh265encoder.cpp @@ -1888,6 +1888,7 @@ gst_nv_h265_encoder_create_class_data (GstObject * device, gpointer session, if (device_mode == GST_NV_ENCODER_DEVICE_CUDA) g_object_get (device, "cuda-device-id", &cdata->cuda_device_id, nullptr); + /* class data will be leaked if the element never gets instantiated */ GST_MINI_OBJECT_FLAG_SET (cdata->sink_caps, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); GST_MINI_OBJECT_FLAG_SET (cdata->src_caps, @@ -2191,6 +2192,12 @@ gst_nv_h265_encoder_register_auto_select (GstPlugin * plugin, memcpy (&cdata->cuda_device_id_list, cuda_device_id_list, sizeof (cuda_device_id_list)); + /* class data will be leaked if the element never gets instantiated */ + GST_MINI_OBJECT_FLAG_SET (cdata->sink_caps, + GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); + GST_MINI_OBJECT_FLAG_SET (cdata->src_caps, + GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); + GType type; GTypeInfo type_info = { sizeof (GstNvH265EncoderClass),