GstBaseParse *parse = GST_BASE_PARSE (object);
GstEvent **p_ev;
- g_mutex_free (parse->parse_lock);
g_object_unref (parse->adapter);
if (parse->pending_segment) {
gst_element_add_pad (GST_ELEMENT (parse), parse->srcpad);
GST_DEBUG_OBJECT (parse, "src created");
- parse->parse_lock = g_mutex_new ();
parse->adapter = gst_adapter_new ();
parse->priv->pad_mode = GST_ACTIVATE_NONE;
/* Synchronization loop */
for (;;) {
- GST_BASE_PARSE_LOCK (parse);
min_size = parse->priv->min_frame_size;
- GST_BASE_PARSE_UNLOCK (parse);
if (G_UNLIKELY (parse->priv->drain)) {
min_size = gst_adapter_available (parse->adapter);
while (TRUE) {
- GST_BASE_PARSE_LOCK (parse);
min_size = parse->priv->min_frame_size;
- GST_BASE_PARSE_UNLOCK (parse);
ret = gst_base_parse_pull_range (parse, min_size, &buffer);
if (ret != GST_FLOW_OK)
{
g_return_if_fail (parse != NULL);
- GST_BASE_PARSE_LOCK (parse);
if (parse->priv->upstream_has_duration) {
GST_DEBUG_OBJECT (parse, "using upstream duration; discarding update");
goto exit;
GST_DEBUG_OBJECT (parse, "set update interval: %d", interval);
parse->priv->update_interval = interval;
exit:
- GST_BASE_PARSE_UNLOCK (parse);
+ return;
}
/**
{
g_return_if_fail (parse != NULL);
- GST_BASE_PARSE_LOCK (parse);
parse->priv->min_frame_size = min_size;
GST_LOG_OBJECT (parse, "set frame_min_size: %d", min_size);
- GST_BASE_PARSE_UNLOCK (parse);
}
/**
{
g_return_if_fail (parse != NULL);
- GST_BASE_PARSE_LOCK (parse);
parse->priv->passthrough = passthrough;
GST_LOG_OBJECT (parse, "set passthrough: %d", passthrough);
- GST_BASE_PARSE_UNLOCK (parse);
}
/**
{
g_return_if_fail (parse != NULL);
- GST_BASE_PARSE_LOCK (parse);
parse->priv->fps_num = fps_num;
parse->priv->fps_den = fps_den;
if (!fps_num || !fps_den) {
"lead out: %d frames = %" G_GUINT64_FORMAT " ms",
lead_in, parse->priv->lead_in_ts / GST_MSECOND,
lead_out, parse->priv->lead_out_ts / GST_MSECOND);
- GST_BASE_PARSE_UNLOCK (parse);
}
/**
g_return_val_if_fail (parse != NULL, FALSE);
- GST_BASE_PARSE_LOCK (parse);
/* losing sync is pretty much a discont (and vice versa), no ? */
ret = !parse->priv->discont;
- GST_BASE_PARSE_UNLOCK (parse);
GST_DEBUG_OBJECT (parse, "sync: %d", ret);
return ret;
g_return_val_if_fail (parse != NULL, FALSE);
- GST_BASE_PARSE_LOCK (parse);
/* losing sync is pretty much a discont (and vice versa), no ? */
ret = parse->priv->drain;
- GST_BASE_PARSE_UNLOCK (parse);
GST_DEBUG_OBJECT (parse, "drain: %d", ret);
return ret;
GST_DEBUG_OBJECT (parse, "position query");
gst_query_parse_position (query, &format, NULL);
- g_mutex_lock (parse->parse_lock);
+ GST_OBJECT_LOCK (parse);
if (format == GST_FORMAT_BYTES) {
dest_value = parse->priv->offset;
res = TRUE;
dest_value = parse->segment.last_stop;
res = TRUE;
}
- g_mutex_unlock (parse->parse_lock);
+ GST_OBJECT_UNLOCK (parse);
if (res)
gst_query_set_position (query, format, dest_value);
if (!res) {
/* no precise result, upstream no idea either, then best estimate */
/* priv->offset is updated in both PUSH/PULL modes */
- g_mutex_lock (parse->parse_lock);
res = gst_base_parse_convert (parse,
GST_FORMAT_BYTES, parse->priv->offset, format, &dest_value);
- g_mutex_unlock (parse->parse_lock);
}
}
break;
/* otherwise best estimate from us */
if (!res) {
- g_mutex_lock (parse->parse_lock);
res = gst_base_parse_get_duration (parse, format, &duration);
- g_mutex_unlock (parse->parse_lock);
if (res)
gst_query_set_duration (query, format, duration);
}