Message ID | 20250616220607.31416-1-laurent.pinchart@ideasonboard.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
Hi, Le mardi 17 juin 2025 à 01:06 +0300, Laurent Pinchart a écrit : > g_steal_pointer) only preserves the type since glib 2.68, requiring > casts. Use std::exchange() instead. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> > --- > src/gstreamer/gstlibcamerasrc.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp > index ebea34e47b4d..e56cee282c59 100644 > --- a/src/gstreamer/gstlibcamerasrc.cpp > +++ b/src/gstreamer/gstlibcamerasrc.cpp > @@ -1085,7 +1085,7 @@ gst_libcamera_src_request_new_pad(GstElement *element, GstPadTemplate *templ, > > gst_child_proxy_child_added(GST_CHILD_PROXY(self), G_OBJECT(pad), GST_OBJECT_NAME(pad)); > > - return reinterpret_cast<GstPad *>(g_steal_pointer(&pad)); > + return std::exchange(pad, nullptr); > } > > static void > > base-commit: b3ff75d7589a263412ad63008b3c8518d40e6316
2025. 06. 17. 0:06 keltezéssel, Laurent Pinchart írta: > g_steal_pointer) only preserves the type since glib 2.68, requiring > casts. Use std::exchange() instead. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > --- > src/gstreamer/gstlibcamerasrc.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp > index ebea34e47b4d..e56cee282c59 100644 > --- a/src/gstreamer/gstlibcamerasrc.cpp > +++ b/src/gstreamer/gstlibcamerasrc.cpp > @@ -1085,7 +1085,7 @@ gst_libcamera_src_request_new_pad(GstElement *element, GstPadTemplate *templ, > > gst_child_proxy_child_added(GST_CHILD_PROXY(self), G_OBJECT(pad), GST_OBJECT_NAME(pad)); > > - return reinterpret_cast<GstPad *>(g_steal_pointer(&pad)); > + return std::exchange(pad, nullptr); > } > > static void > > base-commit: b3ff75d7589a263412ad63008b3c8518d40e6316
diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index ebea34e47b4d..e56cee282c59 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -1085,7 +1085,7 @@ gst_libcamera_src_request_new_pad(GstElement *element, GstPadTemplate *templ, gst_child_proxy_child_added(GST_CHILD_PROXY(self), G_OBJECT(pad), GST_OBJECT_NAME(pad)); - return reinterpret_cast<GstPad *>(g_steal_pointer(&pad)); + return std::exchange(pad, nullptr); } static void
g_steal_pointer) only preserves the type since glib 2.68, requiring casts. Use std::exchange() instead. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- src/gstreamer/gstlibcamerasrc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: b3ff75d7589a263412ad63008b3c8518d40e6316