LinuxTV Patchwork qv4l2: Fix GL Capture not redrawing after close

login
register
mail settings
Submitter Tasos Sahanidis
Date May 9, 2019, 12:47 p.m.
Message ID <f319b41a-f364-8b0a-6e99-ede0f22c8e25@tasossah.com>
Download mbox | patch
Permalink /patch/56080/
State New
Delegated to: Hans Verkuil
Headers show

Comments

Tasos Sahanidis - May 9, 2019, 12:47 p.m.
Closing the GL capture window and then reopening it would cause it
to become blank and not render any frames.

This is fixed by ignoring the close event and hiding the widget
manually in the event handler.

Signed-off-by: Tasos Sahanidis <tasos@tasossah.com>
---
 utils/qv4l2/capture-win-gl.cpp | 7 +++++++
 utils/qv4l2/capture-win-gl.h   | 1 +
 2 files changed, 8 insertions(+)

Patch

diff --git a/utils/qv4l2/capture-win-gl.cpp b/utils/qv4l2/capture-win-gl.cpp
index fc8e7f45..05659259 100644
--- a/utils/qv4l2/capture-win-gl.cpp
+++ b/utils/qv4l2/capture-win-gl.cpp
@@ -44,6 +44,13 @@  void CaptureWinGL::stop()
 #endif
 }
 
+void CaptureWinGL::closeEvent(QCloseEvent *event)
+{
+	this->hide();
+	event->ignore();
+	emit close();
+}
+
 void CaptureWinGL::resizeEvent(QResizeEvent *event)
 {
 #ifdef HAVE_QTGL
diff --git a/utils/qv4l2/capture-win-gl.h b/utils/qv4l2/capture-win-gl.h
index 63b7c65f..35235d7a 100644
--- a/utils/qv4l2/capture-win-gl.h
+++ b/utils/qv4l2/capture-win-gl.h
@@ -139,6 +139,7 @@  public:
 protected:
 	void resizeEvent(QResizeEvent *event);
 	void setRenderFrame();
+	void closeEvent(QCloseEvent *event);
 
 private:
 #ifdef HAVE_QTGL

Privacy Policy