mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
omxvideoenc: Remove spurious locking
The method we call in the context of pushing a buffer are all thread safe. Holding a lock would prevent input buffers from being queued while pushing. https://bugzilla.gnome.org/show_bug.cgi?id=715192
This commit is contained in:
parent
d80504afcc
commit
a84badc5c4
1 changed files with 3 additions and 7 deletions
|
@ -1534,7 +1534,6 @@ gst_omx_video_enc_loop (GstOMXVideoEnc * self)
|
||||||
gst_omx_buffer_flags_to_string (buf->omx_buf->nFlags),
|
gst_omx_buffer_flags_to_string (buf->omx_buf->nFlags),
|
||||||
(guint64) GST_OMX_GET_TICKS (buf->omx_buf->nTimeStamp));
|
(guint64) GST_OMX_GET_TICKS (buf->omx_buf->nTimeStamp));
|
||||||
|
|
||||||
GST_VIDEO_ENCODER_STREAM_LOCK (self);
|
|
||||||
frame = gst_omx_video_find_nearest_frame (buf,
|
frame = gst_omx_video_find_nearest_frame (buf,
|
||||||
gst_video_encoder_get_frames (GST_VIDEO_ENCODER (self)));
|
gst_video_encoder_get_frames (GST_VIDEO_ENCODER (self)));
|
||||||
|
|
||||||
|
@ -1547,15 +1546,15 @@ gst_omx_video_enc_loop (GstOMXVideoEnc * self)
|
||||||
if (err != OMX_ErrorNone)
|
if (err != OMX_ErrorNone)
|
||||||
goto release_error;
|
goto release_error;
|
||||||
|
|
||||||
|
GST_VIDEO_ENCODER_STREAM_LOCK (self);
|
||||||
self->downstream_flow_ret = flow_ret;
|
self->downstream_flow_ret = flow_ret;
|
||||||
|
GST_VIDEO_ENCODER_STREAM_UNLOCK (self);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "Read frame from component");
|
GST_DEBUG_OBJECT (self, "Read frame from component");
|
||||||
|
|
||||||
if (flow_ret != GST_FLOW_OK)
|
if (flow_ret != GST_FLOW_OK)
|
||||||
goto flow_error;
|
goto flow_error;
|
||||||
|
|
||||||
GST_VIDEO_ENCODER_STREAM_UNLOCK (self);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
component_error:
|
component_error:
|
||||||
|
@ -1592,13 +1591,12 @@ eos:
|
||||||
|
|
||||||
GST_VIDEO_ENCODER_STREAM_LOCK (self);
|
GST_VIDEO_ENCODER_STREAM_LOCK (self);
|
||||||
self->downstream_flow_ret = flow_ret;
|
self->downstream_flow_ret = flow_ret;
|
||||||
|
GST_VIDEO_ENCODER_STREAM_UNLOCK (self);
|
||||||
|
|
||||||
/* Here we fallback and pause the task for the EOS case */
|
/* Here we fallback and pause the task for the EOS case */
|
||||||
if (flow_ret != GST_FLOW_OK)
|
if (flow_ret != GST_FLOW_OK)
|
||||||
goto flow_error;
|
goto flow_error;
|
||||||
|
|
||||||
GST_VIDEO_ENCODER_STREAM_UNLOCK (self);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
flow_error:
|
flow_error:
|
||||||
|
@ -1618,7 +1616,6 @@ flow_error:
|
||||||
GST_DEBUG_OBJECT (self, "Flushing -- stopping task");
|
GST_DEBUG_OBJECT (self, "Flushing -- stopping task");
|
||||||
}
|
}
|
||||||
gst_omx_video_enc_pause_loop (self, flow_ret);
|
gst_omx_video_enc_pause_loop (self, flow_ret);
|
||||||
GST_VIDEO_ENCODER_STREAM_UNLOCK (self);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
reconfigure_error:
|
reconfigure_error:
|
||||||
|
@ -1643,7 +1640,6 @@ release_error:
|
||||||
gst_omx_error_to_string (err), err));
|
gst_omx_error_to_string (err), err));
|
||||||
gst_pad_push_event (GST_VIDEO_ENCODER_SRC_PAD (self), gst_event_new_eos ());
|
gst_pad_push_event (GST_VIDEO_ENCODER_SRC_PAD (self), gst_event_new_eos ());
|
||||||
gst_omx_video_enc_pause_loop (self, GST_FLOW_ERROR);
|
gst_omx_video_enc_pause_loop (self, GST_FLOW_ERROR);
|
||||||
GST_VIDEO_ENCODER_STREAM_UNLOCK (self);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue