diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-05-11 01:30:23 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-07-04 23:07:38 +0300 |
commit | 674c2bf1f15c8618f5827970443c9a93801275a9 (patch) | |
tree | 6c576172248c73748379f90683c9f853894b2c5a /src/gstreamer/gstlibcamerasrc.cpp | |
parent | 44d14d82457ce07fade85bd5bb04c8de8f277140 (diff) |
gstreamer: Pass Stream to RequestWrap::addBuffer()
For symmetry with RequestWrap::removeBuffer(), pass the Stream pointer
to addBuffer(). This handles streams at the GstPad level instead of the
GstBuffer level, which allows making the GstLibcameraPool API a bit
cleaner by removing the gst_libcamera_buffer_get_stream() helper
function.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Diffstat (limited to 'src/gstreamer/gstlibcamerasrc.cpp')
-rw-r--r-- | src/gstreamer/gstlibcamerasrc.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index dea14396..700bee2b 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -51,7 +51,7 @@ struct RequestWrap { RequestWrap(std::unique_ptr<Request> request); ~RequestWrap(); - void attachBuffer(GstBuffer *buffer); + void attachBuffer(Stream *stream, GstBuffer *buffer); GstBuffer *detachBuffer(Stream *stream); std::unique_ptr<Request> request_; @@ -71,10 +71,9 @@ RequestWrap::~RequestWrap() } } -void RequestWrap::attachBuffer(GstBuffer *buffer) +void RequestWrap::attachBuffer(Stream *stream, GstBuffer *buffer) { FrameBuffer *fb = gst_libcamera_buffer_get_frame_buffer(buffer); - Stream *stream = gst_libcamera_buffer_get_stream(buffer); request_->addBuffer(stream, fb); @@ -275,6 +274,7 @@ gst_libcamera_src_task_run(gpointer user_data) std::make_unique<RequestWrap>(std::move(request)); for (GstPad *srcpad : state->srcpads_) { + Stream *stream = gst_libcamera_pad_get_stream(srcpad); GstLibcameraPool *pool = gst_libcamera_pad_get_pool(srcpad); GstBuffer *buffer; GstFlowReturn ret; @@ -290,7 +290,7 @@ gst_libcamera_src_task_run(gpointer user_data) break; } - wrap->attachBuffer(buffer); + wrap->attachBuffer(stream, buffer); } if (wrap) { |