[libcamera-devel,1/2] Revert "gstreamer: Implement element EOS handling"
diff mbox series

Message ID 20231123044811.70703-2-umang.jain@ideasonboard.com
State Rejected
Headers show
Series
  • gstreamer: Fix EOS clang build breakage
Related show

Commit Message

Umang Jain Nov. 23, 2023, 4:48 a.m. UTC
This reverts commit fd84180d7a09eb9f4891f740735b28af68c201af.

The commit fd84180d7a09("gstreamer: Implement element EOS handling")
introduced a compile breakage on clang:

../../src/gstreamer/gstlibcamerasrc.cpp:768:23: error: unused variable 'oldEvent' [-Werror,-Wunused-variable]
                g_autoptr(GstEvent) oldEvent = self->pending_eos.exchange(event);
                                    ^

Although it is a false-positive build warning, revert this until
a proper solution is implemented.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
---
 src/gstreamer/gstlibcamerasrc.cpp | 36 +------------------------------
 1 file changed, 1 insertion(+), 35 deletions(-)

Patch
diff mbox series

diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
index 767017db..63d99571 100644
--- a/src/gstreamer/gstlibcamerasrc.cpp
+++ b/src/gstreamer/gstlibcamerasrc.cpp
@@ -9,6 +9,7 @@ 
 /**
  * \todo The following is a list of items that needs implementation in the GStreamer plugin
  *  - Implement GstElement::send_event
+ *    + Allowing application to send EOS
  *    + Allowing application to use FLUSH/FLUSH_STOP
  *    + Prevent the main thread from accessing streaming thread
  *  - Implement renegotiation (even if slow)
@@ -28,7 +29,6 @@ 
 
 #include "gstlibcamerasrc.h"
 
-#include <atomic>
 #include <queue>
 #include <vector>
 
@@ -144,8 +144,6 @@  struct _GstLibcameraSrc {
 	gchar *camera_name;
 	controls::AfModeEnum auto_focus_mode = controls::AfModeManual;
 
-	std::atomic<GstEvent *> pending_eos;
-
 	GstLibcameraSrcState *state;
 	GstLibcameraAllocator *allocator;
 	GstFlowCombiner *flow_combiner;
@@ -399,14 +397,6 @@  gst_libcamera_src_task_run(gpointer user_data)
 
 	bool doResume = false;
 
-	g_autoptr(GstEvent) event = self->pending_eos.exchange(nullptr);
-	if (event) {
-		for (GstPad *srcpad : state->srcpads_)
-			gst_pad_push_event(srcpad, gst_event_ref(event));
-
-		return;
-	}
-
 	/*
 	 * Create and queue one request. If no buffers are available the
 	 * function returns -ENOBUFS, which we ignore here as that's not a
@@ -757,27 +747,6 @@  gst_libcamera_src_change_state(GstElement *element, GstStateChange transition)
 	return ret;
 }
 
-static gboolean
-gst_libcamera_src_send_event(GstElement *element, GstEvent *event)
-{
-	GstLibcameraSrc *self = GST_LIBCAMERA_SRC(element);
-	gboolean ret = FALSE;
-
-	switch (GST_EVENT_TYPE(event)) {
-	case GST_EVENT_EOS: {
-		g_autoptr(GstEvent) oldEvent = self->pending_eos.exchange(event);
-
-		ret = TRUE;
-		break;
-	}
-	default:
-		gst_event_unref(event);
-		break;
-	}
-
-	return ret;
-}
-
 static void
 gst_libcamera_src_finalize(GObject *object)
 {
@@ -810,8 +779,6 @@  gst_libcamera_src_init(GstLibcameraSrc *self)
 	state->srcpads_.push_back(gst_pad_new_from_template(templ, "src"));
 	gst_element_add_pad(GST_ELEMENT(self), state->srcpads_.back());
 
-	GST_OBJECT_FLAG_SET(self, GST_ELEMENT_FLAG_SOURCE);
-
 	/* C-style friend. */
 	state->src_ = self;
 	self->state = state;
@@ -877,7 +844,6 @@  gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)
 	element_class->request_new_pad = gst_libcamera_src_request_new_pad;
 	element_class->release_pad = gst_libcamera_src_release_pad;
 	element_class->change_state = gst_libcamera_src_change_state;
-	element_class->send_event = gst_libcamera_src_send_event;
 
 	gst_element_class_set_metadata(element_class,
 				       "libcamera Source", "Source/Video",