<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 6 févr. 2020 10 h 05, Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com">kieran.bingham@ideasonboard.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The FrameBufferAllocator must be deleted and reconstructed before performing<br>
any reconfiguration of the stream.<br>
<br>
Construct the allocator at startCapture, and destroy it during stopCapture so<br>
that we can successfully stop and restart the stream.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Can you explain why adding this limitation. We have fixed this issue in v4l with buffer orphaning, so I don't understand why introducing it again in software.</div><div dir="auto"><br></div><div dir="auto">Not being able to orphan the buffer pool actually prevents zero-copy renegotiation. Consider the case where the framebuffer is being used as your display scan out. You need to reconfigure and produce a new buffer before this framebuffer can be returned.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Signed-off-by: Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com" target="_blank" rel="noreferrer">kieran.bingham@ideasonboard.com</a>><br>
---<br>
 src/qcam/main_window.cpp | 5 +++--<br>
 1 file changed, 3 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp<br>
index df51fa888342..38bc04a23b86 100644<br>
--- a/src/qcam/main_window.cpp<br>
+++ b/src/qcam/main_window.cpp<br>
@@ -37,7 +37,6 @@ MainWindow::MainWindow(CameraManager *cm, const OptionsParser::Options &options)<br>
<br>
        ret = openCamera(cm);<br>
        if (!ret) {<br>
-               allocator_ = FrameBufferAllocator::create(camera_);<br>
                ret = startCapture();<br>
        }<br>
<br>
@@ -50,7 +49,6 @@ MainWindow::~MainWindow()<br>
 {<br>
        if (camera_) {<br>
                stopCapture();<br>
-               delete allocator_;<br>
                camera_->release();<br>
                camera_.reset();<br>
        }<br>
@@ -171,6 +169,7 @@ int MainWindow::startCapture()<br>
<br>
        adjustSize();<br>
<br>
+       allocator_ = FrameBufferAllocator::create(camera_);<br>
        ret = allocator_->allocate(stream);<br>
        if (ret < 0) {<br>
                std::cerr << "Failed to allocate capture buffers" << std::endl;<br>
@@ -255,6 +254,8 @@ void MainWindow::stopCapture()<br>
        }<br>
        mappedBuffers_.clear();<br>
<br>
+       delete allocator_;<br>
+<br>
        isCapturing_ = false;<br>
<br>
        config_.reset();<br>
-- <br>
2.20.1<br>
<br>
_______________________________________________<br>
libcamera-devel mailing list<br>
<a href="mailto:libcamera-devel@lists.libcamera.org" target="_blank" rel="noreferrer">libcamera-devel@lists.libcamera.org</a><br>
<a href="https://lists.libcamera.org/listinfo/libcamera-devel" rel="noreferrer noreferrer" target="_blank">https://lists.libcamera.org/listinfo/libcamera-devel</a><br>
</blockquote></div></div></div>