nvcodec: fix caps leaks in nvh264/h265encoder

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2850>
This commit is contained in:
Corentin Damman 2022-08-09 12:24:53 +02:00 committed by GStreamer Marge Bot
parent 0f0441564d
commit 0d5d94aabd
2 changed files with 14 additions and 0 deletions

View file

@ -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),

View file

@ -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),