summaryrefslogtreecommitdiff
path: root/src/gstreamer/gstlibcamerasrc.cpp
diff options
context:
space:
mode:
authorUmang Jain <umang.jain@ideasonboard.com>2022-06-30 12:04:43 +0530
committerUmang Jain <umang.jain@ideasonboard.com>2022-07-19 21:50:21 +0530
commit62e32042aee4042b6a931bc27a6ad11384b521f5 (patch)
treea8ce86f8633ea437f28a6f99091b8aa131b8270c /src/gstreamer/gstlibcamerasrc.cpp
parent9eb8211160de2e0a879cc5e0b38f50137df989ce (diff)
gstreamer: Be pedantic on srcpads access
Use the std::vector::back() instead of [0] index which corresponds to std::vector::push_back() for tracking of pads. This doesn't introduce a functional change as the gst_libcamera_src_init() will only add one pad but it helps with readability. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/gstreamer/gstlibcamerasrc.cpp')
-rw-r--r--src/gstreamer/gstlibcamerasrc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
index 3d3efc0c..16d70fea 100644
--- a/src/gstreamer/gstlibcamerasrc.cpp
+++ b/src/gstreamer/gstlibcamerasrc.cpp
@@ -746,7 +746,7 @@ gst_libcamera_src_init(GstLibcameraSrc *self)
gst_task_set_lock(self->task, &self->stream_lock);
state->srcpads_.push_back(gst_pad_new_from_template(templ, "src"));
- gst_element_add_pad(GST_ELEMENT(self), state->srcpads_[0]);
+ gst_element_add_pad(GST_ELEMENT(self), state->srcpads_.back());
/* C-style friend. */
state->src_ = self;