From: Nicolas Dufresne Date: Thu, 9 Oct 2014 16:15:05 +0000 (-0400) Subject: v4l2sink: Implement unlock/unlock_stop X-Git-Tag: 1.19.3~509^2~4093 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc709d06de2607a81513a6b2e2496e183f7fd5e0;p=platform%2Fupstream%2Fgstreamer.git 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 --- diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c index 3327d8a..f6ed3ba 100644 --- a/sys/v4l2/gstv4l2sink.c +++ b/sys/v4l2/gstv4l2sink.c @@ -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); +}