Avoid taking the global quark lock for every single buffer.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/295>
gboolean use_default_pad_acceptcaps;
};
+/* cached quark to avoid contention on the global quark table lock */
+#define META_TAG_AUDIO meta_tag_audio_quark
+static GQuark meta_tag_audio_quark;
+
static void gst_audio_decoder_finalize (GObject * object);
static void gst_audio_decoder_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
GST_DEBUG_FUNCPTR (gst_audio_decoder_src_query_default);
audiodecoder_class->transform_meta =
GST_DEBUG_FUNCPTR (gst_audio_decoder_transform_meta_default);
+
+ meta_tag_audio_quark = g_quark_from_static_string (GST_META_TAG_AUDIO_STR);
}
static void
tags = gst_meta_api_type_get_tags (info->api);
if (!tags || (g_strv_length ((gchar **) tags) == 1
- && gst_meta_api_type_has_tag (info->api,
- g_quark_from_string (GST_META_TAG_AUDIO_STR))))
+ && gst_meta_api_type_has_tag (info->api, META_TAG_AUDIO)))
return TRUE;
return FALSE;
static GstElementClass *parent_class = NULL;
static gint private_offset = 0;
+/* cached quark to avoid contention on the global quark table lock */
+#define META_TAG_AUDIO meta_tag_audio_quark
+static GQuark meta_tag_audio_quark;
+
static void gst_audio_encoder_class_init (GstAudioEncoderClass * klass);
static void gst_audio_encoder_init (GstAudioEncoder * parse,
GstAudioEncoderClass * klass);
klass->decide_allocation = gst_audio_encoder_decide_allocation_default;
klass->negotiate = gst_audio_encoder_negotiate_default;
klass->transform_meta = gst_audio_encoder_transform_meta_default;
+
+ meta_tag_audio_quark = g_quark_from_static_string (GST_META_TAG_AUDIO_STR);
}
static void
tags = gst_meta_api_type_get_tags (info->api);
if (!tags || (g_strv_length ((gchar **) tags) == 1
- && gst_meta_api_type_has_tag (info->api,
- g_quark_from_string (GST_META_TAG_AUDIO_STR))))
+ && gst_meta_api_type_has_tag (info->api, META_TAG_AUDIO)))
return TRUE;
return FALSE;
GST_DEBUG_CATEGORY_STATIC (audiofilter_dbg);
#define GST_CAT_DEFAULT audiofilter_dbg
+/* cached quark to avoid contention on the global quark table lock */
+#define META_TAG_AUDIO meta_tag_audio_quark
+static GQuark meta_tag_audio_quark;
+
static GstStateChangeReturn gst_audio_filter_change_state (GstElement * element,
GstStateChange transition);
static gboolean gst_audio_filter_set_caps (GstBaseTransform * btrans,
tags = gst_meta_api_type_get_tags (info->api);
if (!tags || (g_strv_length ((gchar **) tags) == 1
- && gst_meta_api_type_has_tag (info->api,
- g_quark_from_string (GST_META_TAG_AUDIO_STR))))
+ && gst_meta_api_type_has_tag (info->api, META_TAG_AUDIO)))
return TRUE;
return
GST_DEBUG_FUNCPTR (gst_audio_filter_get_unit_size);
basetrans_class->transform_meta = gst_audio_filter_transform_meta;
basetrans_class->submit_input_buffer = gst_audio_filter_submit_input_buffer;
+
+ meta_tag_audio_quark = g_quark_from_static_string (GST_META_TAG_AUDIO_STR);
}
static void
static gboolean gst_rtp_base_payload_audio_sink_event (GstRTPBasePayload
* payload, GstEvent * event);
+/* cached quark to avoid contention on the global quark table lock */
+#define META_TAG_AUDIO meta_tag_audio_quark
+static GQuark meta_tag_audio_quark;
+
#define gst_rtp_base_audio_payload_parent_class parent_class
G_DEFINE_TYPE_WITH_PRIVATE (GstRTPBaseAudioPayload, gst_rtp_base_audio_payload,
GST_TYPE_RTP_BASE_PAYLOAD);
GstElementClass *gstelement_class;
GstRTPBasePayloadClass *gstrtpbasepayload_class;
+ meta_tag_audio_quark = g_quark_from_static_string (GST_META_TAG_AUDIO_STR);
+
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstrtpbasepayload_class = (GstRTPBasePayloadClass *) klass;
const gchar *const *tags = gst_meta_api_type_get_tags (info->api);
if (info->transform_func && (!tags || (g_strv_length ((gchar **) tags) == 1
- && gst_meta_api_type_has_tag (info->api,
- g_quark_from_string (GST_META_TAG_AUDIO_STR))))) {
+ && gst_meta_api_type_has_tag (info->api, META_TAG_AUDIO)))) {
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
GST_DEBUG_OBJECT (pay, "copy metadata %s", g_type_name (info->api));
/* simply copy then */
static GstElementClass *parent_class = NULL;
static gint private_offset = 0;
+/* cached quark to avoid contention on the global quark table lock */
+#define META_TAG_VIDEO meta_tag_video_quark
+static GQuark meta_tag_video_quark;
+
static void gst_video_decoder_class_init (GstVideoDecoderClass * klass);
static void gst_video_decoder_init (GstVideoDecoder * dec,
GstVideoDecoderClass * klass);
"Max consecutive decoder errors before returning flow error",
-1, G_MAXINT, DEFAULT_MAX_ERRORS,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ meta_tag_video_quark = g_quark_from_static_string (GST_META_TAG_VIDEO_STR);
}
static void
tags = gst_meta_api_type_get_tags (info->api);
if (!tags || (g_strv_length ((gchar **) tags) == 1
- && gst_meta_api_type_has_tag (info->api,
- g_quark_from_string (GST_META_TAG_VIDEO_STR))))
+ && gst_meta_api_type_has_tag (info->api, META_TAG_VIDEO)))
return TRUE;
return FALSE;
static GstElementClass *parent_class = NULL;
static gint private_offset = 0;
+/* cached quark to avoid contention on the global quark table lock */
+#define META_TAG_VIDEO meta_tag_video_quark
+static GQuark meta_tag_video_quark;
+
static void gst_video_encoder_class_init (GstVideoEncoderClass * klass);
static void gst_video_encoder_init (GstVideoEncoder * enc,
GstVideoEncoderClass * klass);
"Minimum interval between force-keyunit requests in nanoseconds", 0,
G_MAXUINT64, DEFAULT_MIN_FORCE_KEY_UNIT_INTERVAL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ meta_tag_video_quark = g_quark_from_static_string (GST_META_TAG_VIDEO_STR);
}
static GList *
tags = gst_meta_api_type_get_tags (info->api);
if (!tags || (g_strv_length ((gchar **) tags) == 1
- && gst_meta_api_type_has_tag (info->api,
- g_quark_from_string (GST_META_TAG_VIDEO_STR))))
+ && gst_meta_api_type_has_tag (info->api, META_TAG_VIDEO)))
return TRUE;
return FALSE;
G_DEFINE_ABSTRACT_TYPE (GstVideoFilter, gst_video_filter,
GST_TYPE_BASE_TRANSFORM);
+/* cached quark to avoid contention on the global quark table lock */
+#define META_TAG_VIDEO meta_tag_video_quark
+static GQuark meta_tag_video_quark;
+
/* Answer the allocation query downstream. */
static gboolean
gst_video_filter_propose_allocation (GstBaseTransform * trans,
tags = gst_meta_api_type_get_tags (info->api);
if (!tags || (g_strv_length ((gchar **) tags) == 1
- && gst_meta_api_type_has_tag (info->api,
- g_quark_from_string (GST_META_TAG_VIDEO_STR))))
+ && gst_meta_api_type_has_tag (info->api, META_TAG_VIDEO)))
return TRUE;
return GST_BASE_TRANSFORM_CLASS (parent_class)->transform_meta (trans, inbuf,
GST_DEBUG_CATEGORY_INIT (gst_video_filter_debug, "videofilter", 0,
"videofilter");
+
+ meta_tag_video_quark = g_quark_from_static_string (GST_META_TAG_VIDEO_STR);
}
static void
GST_PAD_ALWAYS,
STATIC_CAPS);
+/* cached quark to avoid contention on the global quark table lock */
+#define META_TAG_AUDIO meta_tag_audio_quark
+static GQuark meta_tag_audio_quark;
/*** TYPE FUNCTIONS ***********************************************************/
static void
GST_DEBUG_FUNCPTR (gst_audio_convert_prepare_output_buffer);
basetransform_class->transform_ip_on_passthrough = FALSE;
+
+ meta_tag_audio_quark = g_quark_from_static_string (GST_META_TAG_AUDIO_STR);
}
static void
tags = gst_meta_api_type_get_tags (info->api);
if (!tags || (g_strv_length ((gchar **) tags) == 1
- && gst_meta_api_type_has_tag (info->api,
- g_quark_from_string (GST_META_TAG_AUDIO_STR))))
+ && gst_meta_api_type_has_tag (info->api, META_TAG_AUDIO)))
return TRUE;
return FALSE;
GST_PAD_ALWAYS,
GST_STATIC_CAPS (SUPPORTED_CAPS));
+/* cached quark to avoid contention on the global quark table lock */
+#define META_TAG_AUDIO meta_tag_audio_quark
+static GQuark meta_tag_audio_quark;
+
static void gst_audio_resample_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_audio_resample_get_property (GObject * object,
gst_type_mark_as_plugin_api (GST_TYPE_AUDIO_RESAMPLER_FILTER_INTERPOLATION,
0);
gst_type_mark_as_plugin_api (GST_TYPE_AUDIO_RESAMPLER_FILTER_MODE, 0);
+
+ meta_tag_audio_quark = g_quark_from_static_string (GST_META_TAG_AUDIO_STR);
}
static void
tags = gst_meta_api_type_get_tags (info->api);
if (!tags || (g_strv_length ((gchar **) tags) == 1
- && gst_meta_api_type_has_tag (info->api,
- g_quark_from_string (GST_META_TAG_AUDIO_STR))))
+ && gst_meta_api_type_has_tag (info->api, META_TAG_AUDIO)))
return TRUE;
return FALSE;