[libcamera-devel,RFC,v1,2/2] gstreamer: Replace code to push the stream start with factored out function
diff mbox series

Message ID 20210720173548.313901-2-vedantparanjape160201@gmail.com
State Superseded
Headers show
Series
  • [libcamera-devel,RFC,v1,1/2] gstreamer: Factor out _pad_push_stream_start from _task_enter
Related show

Commit Message

Vedant Paranjape July 20, 2021, 5:35 p.m. UTC
Update functional code in gst_libcamera_src_task_enter(), which creates stream
id and pushes the stream start with the refactored function
gst_libcamera_pad_push_stream_start().

Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
---
 src/gstreamer/gstlibcamerasrc.cpp | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Patch
diff mbox series

diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
index b18f1efb..bb8ea07a 100644
--- a/src/gstreamer/gstlibcamerasrc.cpp
+++ b/src/gstreamer/gstlibcamerasrc.cpp
@@ -361,15 +361,10 @@  gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,
 
 	GST_DEBUG_OBJECT(self, "Streaming thread has started");
 
-	gint stream_id_num = 0;
 	StreamRoles roles;
 	for (GstPad *srcpad : state->srcpads_) {
 		/* Create stream-id and push stream-start. */
-		g_autofree gchar *stream_id_intermediate = g_strdup_printf("%i%i", state->group_id_, stream_id_num++);
-		g_autofree gchar *stream_id = gst_pad_create_stream_id(srcpad, GST_ELEMENT(self), stream_id_intermediate);
-		GstEvent *event = gst_event_new_stream_start(stream_id);
-		gst_event_set_group_id(event, state->group_id_);
-		gst_pad_push_event(srcpad, event);
+		gst_libcamera_pad_push_stream_start(srcpad, state->group_id_);
 
 		/* Collect the streams roles for the next iteration. */
 		roles.push_back(gst_libcamera_pad_get_role(srcpad));