v4l2sink: Implement unlock/unlock_stop

This will prevent deadlocks, but will also properly flush the pool and allocator
when going to READY state. It should also fix issues reported on mailing list
when seeking is performed.

https://bugzilla.gnome.org/show_bug.cgi?id=738152
This commit is contained in:
Nicolas Dufresne 2014-10-09 12:15:05 -04:00
parent 31b8cfecc2
commit cc709d06de

View file

@ -116,6 +116,8 @@ static GstCaps *gst_v4l2sink_get_caps (GstBaseSink * bsink, GstCaps * filter);
static gboolean gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps);
static GstFlowReturn gst_v4l2sink_show_frame (GstVideoSink * bsink,
GstBuffer * buf);
static gboolean gst_v4l2sink_unlock (GstBaseSink * sink);
static gboolean gst_v4l2sink_unlock_stop (GstBaseSink * sink);
static void
gst_v4l2sink_class_init (GstV4l2SinkClass * klass)
@ -185,6 +187,8 @@ gst_v4l2sink_class_init (GstV4l2SinkClass * klass)
basesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_v4l2sink_set_caps);
basesink_class->propose_allocation =
GST_DEBUG_FUNCPTR (gst_v4l2sink_propose_allocation);
basesink_class->unlock = GST_DEBUG_FUNCPTR (gst_v4l2sink_unlock);
basesink_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_v4l2sink_unlock_stop);
videosink_class->show_frame = GST_DEBUG_FUNCPTR (gst_v4l2sink_show_frame);
@ -608,3 +612,17 @@ activate_failed:
return GST_FLOW_ERROR;
}
}
static gboolean
gst_v4l2sink_unlock (GstBaseSink * sink)
{
GstV4l2Sink *v4l2sink = GST_V4L2SINK (sink);
return gst_v4l2_object_unlock (v4l2sink->v4l2object);
}
static gboolean
gst_v4l2sink_unlock_stop (GstBaseSink * sink)
{
GstV4l2Sink *v4l2sink = GST_V4L2SINK (sink);
return gst_v4l2_object_unlock_stop (v4l2sink->v4l2object);
}