diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.h b/subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.h index 8b5138fe0c..89bf2e74ab 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.h +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvdecoder.h @@ -66,7 +66,7 @@ struct _GstQsvDecoderClass gint64 adapter_luid; /* VA display device path, for Linux */ - gchar display_path[64]; + gchar *display_path; }; GType gst_qsv_decoder_get_type (void); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.h b/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.h index e0ed95b2b9..2f301bac8a 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.h +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvencoder.h @@ -66,7 +66,7 @@ struct _GstQsvEncoderClass gint64 adapter_luid; /* VA display device path, for Linux */ - gchar display_path[64]; + gchar *display_path; gboolean (*set_format) (GstQsvEncoder * encoder, GstVideoCodecState * state, diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264dec.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264dec.cpp index 80f53842ae..d17f0b0289 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264dec.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264dec.cpp @@ -54,10 +54,7 @@ gst_qsv_h264_dec_class_init (GstQsvH264DecClass * klass, gpointer data) qsvdec_class->codec_id = MFX_CODEC_AVC; qsvdec_class->impl_index = cdata->impl_index; qsvdec_class->adapter_luid = cdata->adapter_luid; - if (cdata->display_path) { - strncpy (qsvdec_class->display_path, cdata->display_path, - sizeof (qsvdec_class->display_path)); - } + qsvdec_class->display_path = cdata->display_path; gst_element_class_set_static_metadata (element_class, "Intel Quick Sync Video H.264 Decoder", @@ -74,7 +71,6 @@ gst_qsv_h264_dec_class_init (GstQsvH264DecClass * klass, gpointer data) gst_caps_unref (cdata->sink_caps); gst_caps_unref (cdata->src_caps); - g_free (cdata->display_path); g_free (cdata); } diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp index 53e1794d67..8184739ad8 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp @@ -272,8 +272,7 @@ gst_qsv_h264_enc_class_init (GstQsvH264EncClass * klass, gpointer data) qsvenc_class->codec_id = MFX_CODEC_AVC; qsvenc_class->impl_index = cdata->impl_index; qsvenc_class->adapter_luid = cdata->adapter_luid; - if (cdata->display_path) - strcpy (qsvenc_class->display_path, cdata->display_path); + qsvenc_class->display_path = cdata->display_path; object_class->finalize = gst_qsv_h264_enc_finalize; object_class->set_property = gst_qsv_h264_enc_set_property; @@ -452,7 +451,6 @@ gst_qsv_h264_enc_class_init (GstQsvH264EncClass * klass, gpointer data) gst_caps_unref (cdata->sink_caps); gst_caps_unref (cdata->src_caps); - g_free (cdata->display_path); g_free (cdata); } diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp index b01e801d10..1fd726d801 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp @@ -192,8 +192,7 @@ gst_qsv_h265_enc_class_init (GstQsvH265EncClass * klass, gpointer data) qsvenc_class->codec_id = MFX_CODEC_AVC; qsvenc_class->impl_index = cdata->impl_index; qsvenc_class->adapter_luid = cdata->adapter_luid; - if (cdata->display_path) - strcpy (qsvenc_class->display_path, cdata->display_path); + qsvenc_class->display_path = cdata->display_path; object_class->finalize = gst_qsv_h265_enc_finalize; object_class->set_property = gst_qsv_h265_enc_set_property; @@ -280,7 +279,6 @@ gst_qsv_h265_enc_class_init (GstQsvH265EncClass * klass, gpointer data) gst_caps_unref (cdata->sink_caps); gst_caps_unref (cdata->src_caps); - g_free (cdata->display_path); g_free (cdata); } diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp index 8dfc55f566..c3ed19c11c 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp @@ -146,8 +146,7 @@ gst_qsv_vp9_enc_class_init (GstQsvVP9EncClass * klass, gpointer data) qsvenc_class->codec_id = MFX_CODEC_VP9; qsvenc_class->impl_index = cdata->impl_index; qsvenc_class->adapter_luid = cdata->adapter_luid; - if (cdata->display_path) - strcpy (qsvenc_class->display_path, cdata->display_path); + qsvenc_class->display_path = cdata->display_path; object_class->finalize = gst_qsv_vp9_enc_finalize; object_class->set_property = gst_qsv_vp9_enc_set_property; @@ -220,7 +219,6 @@ gst_qsv_vp9_enc_class_init (GstQsvVP9EncClass * klass, gpointer data) gst_caps_unref (cdata->sink_caps); gst_caps_unref (cdata->src_caps); - g_free (cdata->display_path); g_free (cdata); }