diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvav1enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvav1enc.cpp index 3744328741..f9b2f2ce51 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvav1enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvav1enc.cpp @@ -316,13 +316,11 @@ gst_qsv_av1_enc_check_update_uint (GstQsvAV1Enc * self, guint * old_val, if (*old_val == new_val) return; - g_mutex_lock (&self->prop_lock); *old_val = new_val; if (is_bitrate_param) self->bitrate_updated = TRUE; else self->property_updated = TRUE; - g_mutex_unlock (&self->prop_lock); } static void @@ -332,10 +330,8 @@ gst_qsv_av1_enc_check_update_enum (GstQsvAV1Enc * self, mfxU16 * old_val, if (*old_val == (mfxU16) new_val) return; - g_mutex_lock (&self->prop_lock); *old_val = (mfxU16) new_val; self->property_updated = TRUE; - g_mutex_unlock (&self->prop_lock); } static void @@ -344,6 +340,7 @@ gst_qsv_av1_enc_set_property (GObject * object, guint prop_id, { GstQsvAV1Enc *self = GST_QSV_AV1_ENC (object); + g_mutex_lock (&self->prop_lock); switch (prop_id) { case PROP_QP_I: gst_qsv_av1_enc_check_update_uint (self, &self->qp_i, @@ -377,6 +374,7 @@ gst_qsv_av1_enc_set_property (GObject * object, guint prop_id, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } + g_mutex_unlock (&self->prop_lock); } static void @@ -385,6 +383,7 @@ gst_qsv_av1_enc_get_property (GObject * object, guint prop_id, GValue * value, { GstQsvAV1Enc *self = GST_QSV_AV1_ENC (object); + g_mutex_lock (&self->prop_lock); switch (prop_id) { case PROP_QP_I: g_value_set_uint (value, self->qp_i); @@ -411,6 +410,7 @@ gst_qsv_av1_enc_get_property (GObject * object, guint prop_id, GValue * value, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } + g_mutex_unlock (&self->prop_lock); } static void diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp index 86ba144795..38f6b30a23 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp @@ -858,13 +858,11 @@ gst_qsv_h264_enc_check_update_uint (GstQsvH264Enc * self, guint * old_val, if (*old_val == new_val) return; - g_mutex_lock (&self->prop_lock); *old_val = new_val; if (is_bitrate_param) self->bitrate_updated = TRUE; else self->property_updated = TRUE; - g_mutex_unlock (&self->prop_lock); } static void @@ -874,10 +872,8 @@ gst_qsv_h264_enc_check_update_enum (GstQsvH264Enc * self, mfxU16 * old_val, if (*old_val == (mfxU16) new_val) return; - g_mutex_lock (&self->prop_lock); *old_val = (mfxU16) new_val; self->property_updated = TRUE; - g_mutex_unlock (&self->prop_lock); } static void @@ -887,10 +883,8 @@ gst_qsv_h264_enc_check_update_boolean (GstQsvH264Enc * self, gboolean * old_val, if (*old_val == new_val) return; - g_mutex_lock (&self->prop_lock); *old_val = new_val; self->property_updated = TRUE; - g_mutex_unlock (&self->prop_lock); } static void @@ -899,6 +893,7 @@ gst_qsv_h264_enc_set_property (GObject * object, guint prop_id, { GstQsvH264Enc *self = GST_QSV_H264_ENC (object); + g_mutex_lock (&self->prop_lock); switch (prop_id) { case PROP_CABAC: gst_qsv_h264_enc_check_update_enum (self, &self->cabac, @@ -1041,6 +1036,7 @@ gst_qsv_h264_enc_set_property (GObject * object, guint prop_id, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } + g_mutex_unlock (&self->prop_lock); } static void @@ -1049,6 +1045,7 @@ gst_qsv_h264_enc_get_property (GObject * object, guint prop_id, GValue * value, { GstQsvH264Enc *self = GST_QSV_H264_ENC (object); + g_mutex_lock (&self->prop_lock); switch (prop_id) { case PROP_CABAC: g_value_set_enum (value, self->cabac); @@ -1156,6 +1153,7 @@ gst_qsv_h264_enc_get_property (GObject * object, guint prop_id, GValue * value, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } + g_mutex_unlock (&self->prop_lock); } static gboolean diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp index 53ea934f52..121b452bb9 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp @@ -538,13 +538,11 @@ gst_qsv_h265_enc_check_update_uint (GstQsvH265Enc * self, guint * old_val, if (*old_val == new_val) return; - g_mutex_lock (&self->prop_lock); *old_val = new_val; if (is_bitrate_param) self->bitrate_updated = TRUE; else self->property_updated = TRUE; - g_mutex_unlock (&self->prop_lock); } static void @@ -554,10 +552,8 @@ gst_qsv_h265_enc_check_update_enum (GstQsvH265Enc * self, mfxU16 * old_val, if (*old_val == (mfxU16) new_val) return; - g_mutex_lock (&self->prop_lock); *old_val = (mfxU16) new_val; self->property_updated = TRUE; - g_mutex_unlock (&self->prop_lock); } static void @@ -567,10 +563,8 @@ gst_qsv_h265_enc_check_update_boolean (GstQsvH265Enc * self, gboolean * old_val, if (*old_val == new_val) return; - g_mutex_lock (&self->prop_lock); *old_val = new_val; self->property_updated = TRUE; - g_mutex_unlock (&self->prop_lock); } static void @@ -579,6 +573,7 @@ gst_qsv_h265_enc_set_property (GObject * object, guint prop_id, { GstQsvH265Enc *self = GST_QSV_H265_ENC (object); + g_mutex_lock (&self->prop_lock); switch (prop_id) { case PROP_MIN_QP_I: gst_qsv_h265_enc_check_update_uint (self, &self->min_qp_i, @@ -664,6 +659,7 @@ gst_qsv_h265_enc_set_property (GObject * object, guint prop_id, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } + g_mutex_unlock (&self->prop_lock); } static void @@ -672,6 +668,7 @@ gst_qsv_h265_enc_get_property (GObject * object, guint prop_id, GValue * value, { GstQsvH265Enc *self = GST_QSV_H265_ENC (object); + g_mutex_lock (&self->prop_lock); switch (prop_id) { case PROP_MIN_QP_I: g_value_set_uint (value, self->min_qp_i); @@ -737,6 +734,7 @@ gst_qsv_h265_enc_get_property (GObject * object, guint prop_id, GValue * value, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } + g_mutex_unlock (&self->prop_lock); } static gboolean diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp index 685bc0d088..01e0c238a6 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp @@ -216,10 +216,8 @@ gst_qsv_jpeg_enc_check_update_uint (GstQsvJpegEnc * self, guint * old_val, if (*old_val == new_val) return; - g_mutex_lock (&self->prop_lock); *old_val = new_val; self->property_updated = TRUE; - g_mutex_unlock (&self->prop_lock); } static void @@ -228,6 +226,7 @@ gst_qsv_jpeg_enc_set_property (GObject * object, guint prop_id, { GstQsvJpegEnc *self = GST_QSV_JPEG_ENC (object); + g_mutex_lock (&self->prop_lock); switch (prop_id) { case PROP_QUALITY: gst_qsv_jpeg_enc_check_update_uint (self, &self->quality, @@ -237,6 +236,7 @@ gst_qsv_jpeg_enc_set_property (GObject * object, guint prop_id, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } + g_mutex_unlock (&self->prop_lock); } static void @@ -245,6 +245,7 @@ gst_qsv_jpeg_enc_get_property (GObject * object, guint prop_id, GValue * value, { GstQsvJpegEnc *self = GST_QSV_JPEG_ENC (object); + g_mutex_lock (&self->prop_lock); switch (prop_id) { case PROP_QUALITY: g_value_set_uint (value, self->quality); @@ -253,6 +254,7 @@ gst_qsv_jpeg_enc_get_property (GObject * object, guint prop_id, GValue * value, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } + g_mutex_unlock (&self->prop_lock); } static gboolean diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp index cf9f2126d3..aaae359934 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp @@ -341,13 +341,11 @@ gst_qsv_vp9_enc_check_update_uint (GstQsvVP9Enc * self, guint * old_val, if (*old_val == new_val) return; - g_mutex_lock (&self->prop_lock); *old_val = new_val; if (is_bitrate_param) self->bitrate_updated = TRUE; else self->property_updated = TRUE; - g_mutex_unlock (&self->prop_lock); } static void @@ -357,10 +355,8 @@ gst_qsv_vp9_enc_check_update_enum (GstQsvVP9Enc * self, mfxU16 * old_val, if (*old_val == (mfxU16) new_val) return; - g_mutex_lock (&self->prop_lock); *old_val = (mfxU16) new_val; self->property_updated = TRUE; - g_mutex_unlock (&self->prop_lock); } static void @@ -369,6 +365,7 @@ gst_qsv_vp9_enc_set_property (GObject * object, guint prop_id, { GstQsvVP9Enc *self = GST_QSV_VP9_ENC (object); + g_mutex_lock (&self->prop_lock); switch (prop_id) { case PROP_QP_I: gst_qsv_vp9_enc_check_update_uint (self, &self->qp_i, @@ -406,6 +403,7 @@ gst_qsv_vp9_enc_set_property (GObject * object, guint prop_id, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } + g_mutex_unlock (&self->prop_lock); } static void @@ -414,6 +412,7 @@ gst_qsv_vp9_enc_get_property (GObject * object, guint prop_id, GValue * value, { GstQsvVP9Enc *self = GST_QSV_VP9_ENC (object); + g_mutex_lock (&self->prop_lock); switch (prop_id) { case PROP_QP_I: g_value_set_uint (value, self->qp_i); @@ -443,6 +442,7 @@ gst_qsv_vp9_enc_get_property (GObject * object, guint prop_id, GValue * value, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } + g_mutex_unlock (&self->prop_lock); } static GstCaps *