mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
basesink: remove obsolete code
Remove some more code now that the render_object ethod is only called with buffers or bufferlsts.
This commit is contained in:
parent
0e38f0dad0
commit
cc8359259b
1 changed files with 39 additions and 44 deletions
|
@ -2775,6 +2775,7 @@ gst_base_sink_render_object (GstBaseSink * basesink,
|
||||||
{
|
{
|
||||||
GstFlowReturn ret;
|
GstFlowReturn ret;
|
||||||
GstBaseSinkClass *bclass;
|
GstBaseSinkClass *bclass;
|
||||||
|
gint do_qos;
|
||||||
gboolean late, step_end;
|
gboolean late, step_end;
|
||||||
gpointer sync_obj;
|
gpointer sync_obj;
|
||||||
GstBaseSinkPrivate *priv;
|
GstBaseSinkPrivate *priv;
|
||||||
|
@ -2800,60 +2801,52 @@ again:
|
||||||
if (G_UNLIKELY (ret != GST_FLOW_OK))
|
if (G_UNLIKELY (ret != GST_FLOW_OK))
|
||||||
goto sync_failed;
|
goto sync_failed;
|
||||||
|
|
||||||
/* and now render, event or buffer/buffer list. */
|
/* drop late buffers unconditionally, let's hope it's unlikely */
|
||||||
if (G_LIKELY (OBJ_IS_BUFFERFULL (obj_type))) {
|
if (G_UNLIKELY (late))
|
||||||
/* drop late buffers unconditionally, let's hope it's unlikely */
|
goto dropped;
|
||||||
if (G_UNLIKELY (late))
|
|
||||||
goto dropped;
|
|
||||||
|
|
||||||
bclass = GST_BASE_SINK_GET_CLASS (basesink);
|
bclass = GST_BASE_SINK_GET_CLASS (basesink);
|
||||||
|
|
||||||
if (G_LIKELY ((OBJ_IS_BUFFERLIST (obj_type) && bclass->render_list) ||
|
/* read once, to get same value before and after */
|
||||||
(!OBJ_IS_BUFFERLIST (obj_type) && bclass->render))) {
|
do_qos = g_atomic_int_get (&priv->qos_enabled);
|
||||||
gint do_qos;
|
|
||||||
|
|
||||||
/* read once, to get same value before and after */
|
GST_DEBUG_OBJECT (basesink, "rendering object %p", obj);
|
||||||
do_qos = g_atomic_int_get (&priv->qos_enabled);
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (basesink, "rendering object %p", obj);
|
/* record rendering time for QoS and stats */
|
||||||
|
if (do_qos)
|
||||||
|
gst_base_sink_do_render_stats (basesink, TRUE);
|
||||||
|
|
||||||
/* record rendering time for QoS and stats */
|
if (!OBJ_IS_BUFFERLIST (obj_type)) {
|
||||||
if (do_qos)
|
GstBuffer *buf;
|
||||||
gst_base_sink_do_render_stats (basesink, TRUE);
|
|
||||||
|
|
||||||
if (!OBJ_IS_BUFFERLIST (obj_type)) {
|
/* For buffer lists do not set last buffer. Creating buffer
|
||||||
GstBuffer *buf;
|
* with meaningful data can be done only with memcpy which will
|
||||||
|
* significantly affect performance */
|
||||||
|
buf = GST_BUFFER_CAST (obj);
|
||||||
|
gst_base_sink_set_last_buffer (basesink, buf);
|
||||||
|
|
||||||
/* For buffer lists do not set last buffer. Creating buffer
|
if (bclass->render)
|
||||||
* with meaningful data can be done only with memcpy which will
|
ret = bclass->render (basesink, buf);
|
||||||
* significantly affect performance */
|
|
||||||
buf = GST_BUFFER_CAST (obj);
|
|
||||||
gst_base_sink_set_last_buffer (basesink, buf);
|
|
||||||
|
|
||||||
ret = bclass->render (basesink, buf);
|
|
||||||
} else {
|
|
||||||
GstBufferList *buflist;
|
|
||||||
|
|
||||||
buflist = GST_BUFFER_LIST_CAST (obj);
|
|
||||||
|
|
||||||
ret = bclass->render_list (basesink, buflist);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (do_qos)
|
|
||||||
gst_base_sink_do_render_stats (basesink, FALSE);
|
|
||||||
|
|
||||||
if (ret == GST_FLOW_STEP)
|
|
||||||
goto again;
|
|
||||||
|
|
||||||
if (G_UNLIKELY (basesink->flushing))
|
|
||||||
goto flushing;
|
|
||||||
|
|
||||||
priv->rendered++;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
g_return_val_if_reached (GST_FLOW_ERROR);
|
GstBufferList *buflist;
|
||||||
|
|
||||||
|
buflist = GST_BUFFER_LIST_CAST (obj);
|
||||||
|
|
||||||
|
if (bclass->render_list)
|
||||||
|
ret = bclass->render_list (basesink, buflist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (do_qos)
|
||||||
|
gst_base_sink_do_render_stats (basesink, FALSE);
|
||||||
|
|
||||||
|
if (ret == GST_FLOW_STEP)
|
||||||
|
goto again;
|
||||||
|
|
||||||
|
if (G_UNLIKELY (basesink->flushing))
|
||||||
|
goto flushing;
|
||||||
|
|
||||||
|
priv->rendered++;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (step_end) {
|
if (step_end) {
|
||||||
/* the step ended, check if we need to activate a new step */
|
/* the step ended, check if we need to activate a new step */
|
||||||
|
@ -2867,6 +2860,7 @@ done:
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (basesink, "object unref after render %p", obj);
|
GST_DEBUG_OBJECT (basesink, "object unref after render %p", obj);
|
||||||
gst_mini_object_unref (GST_MINI_OBJECT_CAST (obj));
|
gst_mini_object_unref (GST_MINI_OBJECT_CAST (obj));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
@ -3358,6 +3352,7 @@ gst_base_sink_chain_unlocked (GstBaseSink * basesink, GstPad * pad,
|
||||||
/* now we can process the buffer in the queue, this function takes ownership
|
/* now we can process the buffer in the queue, this function takes ownership
|
||||||
* of the buffer */
|
* of the buffer */
|
||||||
result = gst_base_sink_render_object (basesink, obj_type, obj);
|
result = gst_base_sink_render_object (basesink, obj_type, obj);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
|
Loading…
Reference in a new issue