v4l2object: Orphan buffer pool on object_stop if supported

Use V4L2 buffer orphaning, on recent kernels so that
the device can be restarted immediately with
a new buffer pool during renogatiation.
This commit is contained in:
Damian Hobson-Garcia 2019-05-27 18:08:54 +09:00 committed by Nicolas Dufresne
parent 50dfbf1c0d
commit a493bcd549

View file

@ -4158,9 +4158,11 @@ gst_v4l2_object_stop (GstV4l2Object * v4l2object)
goto done;
if (v4l2object->pool) {
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "deactivating pool");
gst_buffer_pool_set_active (v4l2object->pool, FALSE);
gst_object_unref (v4l2object->pool);
if (!gst_v4l2_buffer_pool_orphan (&v4l2object->pool)) {
GST_DEBUG_OBJECT (v4l2object->dbg_obj, "deactivating pool");
gst_buffer_pool_set_active (v4l2object->pool, FALSE);
gst_object_unref (v4l2object->pool);
}
v4l2object->pool = NULL;
}