[{"id":32094,"web_url":"https://patchwork.libcamera.org/comment/32094/","msgid":"<173131741340.3109090.14147718071752655329@ping.linuxembedded.co.uk>","date":"2024-11-11T09:30:13","subject":"Re: [PATCH v2] gstreamer: Add GstVideoMeta support","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Qi,\n\nQuoting Hou Qi (2024-11-08 09:21:13)\n> GStreamer video-info calculated stride and offset may differ from\n> those used by the camera.\n> \n> This patch enhances downstream plugin's support for videometa by\n> adding videometa support for libcamerasrc. It ensures that when\n> downstream plugin supports videometa by allocation query, libcamerasrc\n> also attaches videometa to buffer, preventing discrepancies\n> between the stride and offset calculated by video-info and camera.\n\nThanks for the v2, this looks like interesting work.\n\nUnfortunately the CI isn't clear on this one yet:\n\nhttps://gitlab.freedesktop.org/camera/libcamera/-/jobs/66327653\n\nAny idea what's happening here? It looks like this only failed on one\ncompiler:\n\n[443/641] Generating src/py/libcamera/py_gen_formats with a custom command\n[444/641] Compiling C++ object src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\nFAILED: src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\ng++-9 -Isrc/gstreamer/libgstlibcamera.so.p -Isrc/gstreamer -I../src/gstreamer -Iinclude -I../include -Iinclude/libcamera -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/include/x86_64-linux-gnu -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c++17 -O0 -g -Wmissing-declarations -Wshadow -include /builds/camera/libcamera/build/config.h -fPIC -pthread '-DVERSION=\"0.3.2+1-edf89091-nvm\"' '-DPACKAGE=\"libcamera\"' -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -MD -MQ src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o -MF src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o.d -o src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o -c ../src/gstreamer/gstlibcamerapool.cpp\n../src/gstreamer/gstlibcamerapool.cpp: In function ‘GstLibcameraPool* gst_libcamera_pool_new(GstLibcameraAllocator*, const libcamera::StreamConfiguration&, GstCaps*, gboolean)’:\n../src/gstreamer/gstlibcamerapool.cpp:151:13: error: ‘gst_video_format_info_extrapolate_stride’ was not declared in this scope; did you mean ‘gst_video_format_info_component’?\n  151 |    stride = gst_video_format_info_extrapolate_stride(info.finfo, k, stream_cfg.stride);\n      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n      |             gst_video_format_info_component\n[445/641] Compiling C++ object src/apps/qcam/qcam.p/viewfinder_qt.cpp.o\n\nSo perhaps we're hitting a requirement to have a specific gstreamer\nversion that isn't being catered for ?\n\n--\nKieran\n\n\n> \n> Signed-off-by: Hou Qi <qi.hou@nxp.com>\n> ---\n>  src/gstreamer/gstlibcamerapool.cpp | 28 ++++++++++++++++++++++++----\n>  src/gstreamer/gstlibcamerapool.h   |  2 +-\n>  src/gstreamer/gstlibcamerasrc.cpp  | 14 +++++++++++++-\n>  3 files changed, 38 insertions(+), 6 deletions(-)\n> \n> diff --git a/src/gstreamer/gstlibcamerapool.cpp b/src/gstreamer/gstlibcamerapool.cpp\n> index 9cd7eccb..6593b3ca 100644\n> --- a/src/gstreamer/gstlibcamerapool.cpp\n> +++ b/src/gstreamer/gstlibcamerapool.cpp\n> @@ -135,16 +135,36 @@ gst_libcamera_pool_class_init(GstLibcameraPoolClass *klass)\n>  }\n>  \n>  GstLibcameraPool *\n> -gst_libcamera_pool_new(GstLibcameraAllocator *allocator, Stream *stream)\n> +gst_libcamera_pool_new(GstLibcameraAllocator *allocator, const StreamConfiguration &stream_cfg,\n> +                      GstCaps *caps, gboolean add_video_meta)\n>  {\n>         auto *pool = GST_LIBCAMERA_POOL(g_object_new(GST_TYPE_LIBCAMERA_POOL, nullptr));\n> +       GstVideoInfo info;\n>  \n>         pool->allocator = GST_LIBCAMERA_ALLOCATOR(g_object_ref(allocator));\n> -       pool->stream = stream;\n> -\n> -       gsize pool_size = gst_libcamera_allocator_get_pool_size(allocator, stream);\n> +       pool->stream = stream_cfg.stream();\n> +\n> +       if (caps && gst_video_info_from_caps(&info, caps)) {\n> +               guint k, stride;\n> +               gsize offset = 0;\n> +               for (k = 0; k < GST_VIDEO_INFO_N_PLANES(&info); k++) {\n> +                       stride = gst_video_format_info_extrapolate_stride(info.finfo, k, stream_cfg.stride);\n> +                       info.stride[k] = stride;\n> +                       info.offset[k] = offset;\n> +                       offset += stride * GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT(info.finfo, k, GST_VIDEO_INFO_HEIGHT(&info));\n> +               }\n> +       } else\n> +               add_video_meta = false;\n> +\n> +       gsize pool_size = gst_libcamera_allocator_get_pool_size(allocator, stream_cfg.stream());\n>         for (gsize i = 0; i < pool_size; i++) {\n>                 GstBuffer *buffer = gst_buffer_new();\n> +               if (add_video_meta) {\n> +                       gst_buffer_add_video_meta_full(buffer, GST_VIDEO_FRAME_FLAG_NONE,\n> +                                                      GST_VIDEO_INFO_FORMAT(&info), GST_VIDEO_INFO_WIDTH(&info),\n> +                                                      GST_VIDEO_INFO_HEIGHT(&info), GST_VIDEO_INFO_N_PLANES(&info),\n> +                                                      info.offset, info.stride);\n> +               }\n>                 pool->queue->push_back(buffer);\n>         }\n>  \n> diff --git a/src/gstreamer/gstlibcamerapool.h b/src/gstreamer/gstlibcamerapool.h\n> index 2a7a9c77..8ad87cab 100644\n> --- a/src/gstreamer/gstlibcamerapool.h\n> +++ b/src/gstreamer/gstlibcamerapool.h\n> @@ -21,7 +21,7 @@\n>  G_DECLARE_FINAL_TYPE(GstLibcameraPool, gst_libcamera_pool, GST_LIBCAMERA, POOL, GstBufferPool)\n>  \n>  GstLibcameraPool *gst_libcamera_pool_new(GstLibcameraAllocator *allocator,\n> -                                        libcamera::Stream *stream);\n> +                                        const libcamera::StreamConfiguration &stream_cfg, GstCaps *caps, gboolean add_video_meta);\n>  \n>  libcamera::Stream *gst_libcamera_pool_get_stream(GstLibcameraPool *self);\n>  \n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\n> index 8efa25f4..c05a31e7 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -497,9 +497,21 @@ gst_libcamera_src_negotiate(GstLibcameraSrc *self)\n>         for (gsize i = 0; i < state->srcpads_.size(); i++) {\n>                 GstPad *srcpad = state->srcpads_[i];\n>                 const StreamConfiguration &stream_cfg = state->config_->at(i);\n> +               GstQuery *query = NULL;\n> +               gboolean add_video_meta = false;\n> +\n> +               g_autoptr(GstCaps) caps = gst_libcamera_stream_configuration_to_caps(stream_cfg);\n> +               gst_libcamera_framerate_to_caps(caps, element_caps);\n> +\n> +               query = gst_query_new_allocation(caps, false);\n> +               if (!gst_pad_peer_query(srcpad, query))\n> +                       GST_DEBUG_OBJECT(self, \"didn't get downstream ALLOCATION hints\");\n> +               else\n> +                       add_video_meta = gst_query_find_allocation_meta(query, GST_VIDEO_META_API_TYPE, NULL);\n> +               gst_query_unref(query);\n>  \n>                 GstLibcameraPool *pool = gst_libcamera_pool_new(self->allocator,\n> -                                                               stream_cfg.stream());\n> +                                                               stream_cfg, caps, add_video_meta);\n>                 g_signal_connect_swapped(pool, \"buffer-notify\",\n>                                          G_CALLBACK(gst_task_resume), self->task);\n>  \n> -- \n> 2.34.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6DFD4BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 11 Nov 2024 09:30:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6C392657C6;\n\tMon, 11 Nov 2024 10:30:19 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2E58660355\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 11 Nov 2024 10:30:17 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 31868A98;\n\tMon, 11 Nov 2024 10:30:05 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"RY9myVMT\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731317405;\n\tbh=5CwtSkMLz3nB5XHA5g/DBu/gYCgI+xYiYmDxla6etdw=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=RY9myVMTNY8hSAL+dlaF8S9QIBa0koH9t6PnJgEn36QQMS+bz3OREUf28W/Zs9I34\n\tkXqRJRB4a4rK4n37zGr7wA1/RKU0GAnbFQB6mP3URdrZre3akMiEcvS6E//2e9falb\n\tU3PNc3b0FIFqv5B1YlpM5KmStmROBYVxFbu2axXY=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241108092113.3769844-1-qi.hou@nxp.com>","References":"<20241108092113.3769844-1-qi.hou@nxp.com>","Subject":"Re: [PATCH v2] gstreamer: Add GstVideoMeta support","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"jared.hu@nxp.com, qi.hou@nxp.com, julien.vuillaumier@nxp.com","To":"Hou Qi <qi.hou@nxp.com>, libcamera-devel@lists.libcamera.org","Date":"Mon, 11 Nov 2024 09:30:13 +0000","Message-ID":"<173131741340.3109090.14147718071752655329@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32106,"web_url":"https://patchwork.libcamera.org/comment/32106/","msgid":"<PAXPR04MB8285C2DC4DD55C092EA0354E97592@PAXPR04MB8285.eurprd04.prod.outlook.com>","date":"2024-11-12T02:06:44","subject":"RE: [EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support","submitter":{"id":195,"url":"https://patchwork.libcamera.org/api/people/195/","name":"Qi Hou","email":"qi.hou@nxp.com"},"content":"Hi Kieran,\n\n\"gst_video_format_info_extrapolate_stride\" is defined since gstreamer 1.22. I think it causes build fail on old compiler with gstreamer version lower than 1.22.\nDo I need to add GST_CHECK_VERSION(1, 22, 0) to uses this function for gstreamer version >=1.22.0, and fallback to uses other functions for gstreamer version <1.22.0 ?\n\nRegards,\nQi Hou\n\n-----Original Message-----\nFrom: Kieran Bingham <kieran.bingham@ideasonboard.com>\nSent: 2024年11月11日 17:30\nTo: Qi Hou <qi.hou@nxp.com>; libcamera-devel@lists.libcamera.org\nCc: Jared Hu <jared.hu@nxp.com>; Qi Hou <qi.hou@nxp.com>; Julien Vuillaumier <julien.vuillaumier@nxp.com>\nSubject: [EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support\n\nCaution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button\n\n\nHi Qi,\n\nQuoting Hou Qi (2024-11-08 09:21:13)\n> GStreamer video-info calculated stride and offset may differ from\n> those used by the camera.\n>\n> This patch enhances downstream plugin's support for videometa by\n> adding videometa support for libcamerasrc. It ensures that when\n> downstream plugin supports videometa by allocation query, libcamerasrc\n> also attaches videometa to buffer, preventing discrepancies between\n> the stride and offset calculated by video-info and camera.\n\nThanks for the v2, this looks like interesting work.\n\nUnfortunately the CI isn't clear on this one yet:\n\nhttps://gitlab.freedesktop.org/camera/libcamera/-/jobs/66327653\n\nAny idea what's happening here? It looks like this only failed on one\ncompiler:\n\n[443/641] Generating src/py/libcamera/py_gen_formats with a custom command [444/641] Compiling C++ object src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\nFAILED: src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\ng++-9 -Isrc/gstreamer/libgstlibcamera.so.p -Isrc/gstreamer\ng++-I../src/gstreamer -Iinclude -I../include -Iinclude/libcamera\ng++-I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4\ng++-I/usr/include/x86_64-linux-gnu -I/usr/include/glib-2.0\ng++-I/usr/lib/x86_64-linux-gnu/glib-2.0/include\ng++-fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch\ng++-Wextra -Werror -std=c++17 -O0 -g -Wmissing-declarations -Wshadow\ng++-include /builds/camera/libcamera/build/config.h -fPIC -pthread\ng++'-DVERSION=\"0.3.2+1-edf89091-nvm\"' '-DPACKAGE=\"libcamera\"'\ng++-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -MD -MQ\ng++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o -MF\ng++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o.d -o\ng++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o -c\ng++../src/gstreamer/gstlibcamerapool.cpp\n../src/gstreamer/gstlibcamerapool.cpp: In function ‘GstLibcameraPool* gst_libcamera_pool_new(GstLibcameraAllocator*, const libcamera::StreamConfiguration&, GstCaps*, gboolean)’:\n../src/gstreamer/gstlibcamerapool.cpp:151:13: error: ‘gst_video_format_info_extrapolate_stride’ was not declared in this scope; did you mean ‘gst_video_format_info_component’?\n  151 |    stride = gst_video_format_info_extrapolate_stride(info.finfo, k, stream_cfg.stride);\n      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n      |             gst_video_format_info_component\n[445/641] Compiling C++ object src/apps/qcam/qcam.p/viewfinder_qt.cpp.o\n\nSo perhaps we're hitting a requirement to have a specific gstreamer version that isn't being catered for ?\n\n--\nKieran\n\n\n>\n> Signed-off-by: Hou Qi <qi.hou@nxp.com>\n> ---\n>  src/gstreamer/gstlibcamerapool.cpp | 28 ++++++++++++++++++++++++----\n>  src/gstreamer/gstlibcamerapool.h   |  2 +-\n>  src/gstreamer/gstlibcamerasrc.cpp  | 14 +++++++++++++-\n>  3 files changed, 38 insertions(+), 6 deletions(-)\n>\n> diff --git a/src/gstreamer/gstlibcamerapool.cpp\n> b/src/gstreamer/gstlibcamerapool.cpp\n> index 9cd7eccb..6593b3ca 100644\n> --- a/src/gstreamer/gstlibcamerapool.cpp\n> +++ b/src/gstreamer/gstlibcamerapool.cpp\n> @@ -135,16 +135,36 @@\n> gst_libcamera_pool_class_init(GstLibcameraPoolClass *klass)  }\n>\n>  GstLibcameraPool *\n> -gst_libcamera_pool_new(GstLibcameraAllocator *allocator, Stream\n> *stream)\n> +gst_libcamera_pool_new(GstLibcameraAllocator *allocator, const StreamConfiguration &stream_cfg,\n> +                      GstCaps *caps, gboolean add_video_meta)\n>  {\n>         auto *pool =\n> GST_LIBCAMERA_POOL(g_object_new(GST_TYPE_LIBCAMERA_POOL, nullptr));\n> +       GstVideoInfo info;\n>\n>         pool->allocator = GST_LIBCAMERA_ALLOCATOR(g_object_ref(allocator));\n> -       pool->stream = stream;\n> -\n> -       gsize pool_size = gst_libcamera_allocator_get_pool_size(allocator, stream);\n> +       pool->stream = stream_cfg.stream();\n> +\n> +       if (caps && gst_video_info_from_caps(&info, caps)) {\n> +               guint k, stride;\n> +               gsize offset = 0;\n> +               for (k = 0; k < GST_VIDEO_INFO_N_PLANES(&info); k++) {\n> +                       stride = gst_video_format_info_extrapolate_stride(info.finfo, k, stream_cfg.stride);\n> +                       info.stride[k] = stride;\n> +                       info.offset[k] = offset;\n> +                       offset += stride * GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT(info.finfo, k, GST_VIDEO_INFO_HEIGHT(&info));\n> +               }\n> +       } else\n> +               add_video_meta = false;\n> +\n> +       gsize pool_size =\n> + gst_libcamera_allocator_get_pool_size(allocator,\n> + stream_cfg.stream());\n>         for (gsize i = 0; i < pool_size; i++) {\n>                 GstBuffer *buffer = gst_buffer_new();\n> +               if (add_video_meta) {\n> +                       gst_buffer_add_video_meta_full(buffer, GST_VIDEO_FRAME_FLAG_NONE,\n> +                                                      GST_VIDEO_INFO_FORMAT(&info), GST_VIDEO_INFO_WIDTH(&info),\n> +                                                      GST_VIDEO_INFO_HEIGHT(&info), GST_VIDEO_INFO_N_PLANES(&info),\n> +                                                      info.offset, info.stride);\n> +               }\n>                 pool->queue->push_back(buffer);\n>         }\n>\n> diff --git a/src/gstreamer/gstlibcamerapool.h\n> b/src/gstreamer/gstlibcamerapool.h\n> index 2a7a9c77..8ad87cab 100644\n> --- a/src/gstreamer/gstlibcamerapool.h\n> +++ b/src/gstreamer/gstlibcamerapool.h\n> @@ -21,7 +21,7 @@\n>  G_DECLARE_FINAL_TYPE(GstLibcameraPool, gst_libcamera_pool,\n> GST_LIBCAMERA, POOL, GstBufferPool)\n>\n>  GstLibcameraPool *gst_libcamera_pool_new(GstLibcameraAllocator *allocator,\n> -                                        libcamera::Stream *stream);\n> +                                        const\n> + libcamera::StreamConfiguration &stream_cfg, GstCaps *caps, gboolean\n> + add_video_meta);\n>\n>  libcamera::Stream *gst_libcamera_pool_get_stream(GstLibcameraPool\n> *self);\n>\n> diff --git a/src/gstreamer/gstlibcamerasrc.cpp\n> b/src/gstreamer/gstlibcamerasrc.cpp\n> index 8efa25f4..c05a31e7 100644\n> --- a/src/gstreamer/gstlibcamerasrc.cpp\n> +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> @@ -497,9 +497,21 @@ gst_libcamera_src_negotiate(GstLibcameraSrc *self)\n>         for (gsize i = 0; i < state->srcpads_.size(); i++) {\n>                 GstPad *srcpad = state->srcpads_[i];\n>                 const StreamConfiguration &stream_cfg =\n> state->config_->at(i);\n> +               GstQuery *query = NULL;\n> +               gboolean add_video_meta = false;\n> +\n> +               g_autoptr(GstCaps) caps = gst_libcamera_stream_configuration_to_caps(stream_cfg);\n> +               gst_libcamera_framerate_to_caps(caps, element_caps);\n> +\n> +               query = gst_query_new_allocation(caps, false);\n> +               if (!gst_pad_peer_query(srcpad, query))\n> +                       GST_DEBUG_OBJECT(self, \"didn't get downstream ALLOCATION hints\");\n> +               else\n> +                       add_video_meta = gst_query_find_allocation_meta(query, GST_VIDEO_META_API_TYPE, NULL);\n> +               gst_query_unref(query);\n>\n>                 GstLibcameraPool *pool = gst_libcamera_pool_new(self->allocator,\n> -                                                               stream_cfg.stream());\n> +\n> + stream_cfg, caps, add_video_meta);\n>                 g_signal_connect_swapped(pool, \"buffer-notify\",\n>                                          G_CALLBACK(gst_task_resume),\n> self->task);\n>\n> --\n> 2.34.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 34036C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 12 Nov 2024 02:06:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5E93C657DD;\n\tTue, 12 Nov 2024 03:06:49 +0100 (CET)","from PA4PR04CU001.outbound.protection.outlook.com\n\t(mail-francecentralazlp170130007.outbound.protection.outlook.com\n\t[IPv6:2a01:111:f403:c20a::7])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1E60D618BE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 Nov 2024 03:06:46 +0100 (CET)","from PAXPR04MB8285.eurprd04.prod.outlook.com\n\t(2603:10a6:102:1ca::15)\n\tby PA4PR04MB7518.eurprd04.prod.outlook.com (2603:10a6:102:e4::10)\n\twith Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28;\n\tTue, 12 Nov 2024 02:06:44 +0000","from PAXPR04MB8285.eurprd04.prod.outlook.com\n\t([fe80::e003:8fb:64ea:acfd]) by\n\tPAXPR04MB8285.eurprd04.prod.outlook.com\n\t([fe80::e003:8fb:64ea:acfd%3]) with mapi id 15.20.8137.027;\n\tTue, 12 Nov 2024 02:06:44 +0000"],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"V0x3Rw78\";\n\tdkim-atps=neutral","dkim=none (message not signed)\n\theader.d=none;dmarc=none action=none header.from=nxp.com;"],"ARC-Seal":"i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n\tb=F22muuNNkNhHDCYhQoMRHuGkmsyzBxSObH13gGdrQYEumGJPz9DSzOSmt1dK+THip5Lqngoq1/WCl15d0CvedI7ZkWxW+1UypDpds52pJ+RJJItXtfHp+MlVxvwgGzxL/x8TCeUu+aDXfDAtDGbMzAnAmbhAEQddlbUEGocBR9adCYY4XiiuZmVdSUf8ULEO/O2tDnx6tUaEiVFI8aC6RDrJGmov74JiDCxdb9jpRRf0uQ0cTcsBPitmxpgJPQjZ1HsMWOdLKToIiDte4+v2A2S0upvD2l45kB/3D0d8yt/jJZuFCPZB7Gh6X/Fm+Do/yyPGMT3GYP9vTJdAk4flTQ==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n\ts=arcselector10001;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n\tbh=/fjqxQSSRip2tQQHnq0mea3mDeTUPwgOEqrDtRr5+kU=;\n\tb=eGDxr7cuxDttTRFfVTB/aLlivqRg9kDIBkY/Rzvx3xOJ7GnDQcB886kzyT7gu9R/9m9UpbklJqTEJAZJivNnAEfyXMO9u/YmESz+DaxNHEc7bW9y+LgpKV9+xrbdmADR5Qhsp3Kg7hhMGkEQJBhDtDhKBnmDcfNJPVJjErRpT8cOIp2AolL1wzAmBVI779Gi6LomYmmYQzFDEG6wsQEvx29XfbDK9yBnR/HbLb+wCZfOmNz5+LLIAF5i/gQNAG2NT+YkePFFY/tJ2UIwzcpixQKU9cyecfk8yLTvCSX5qaMA2dHhmcmp6GbP/LaSzn9na70UJ1+8wDoFE87zPfLa8A==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass\n\tsmtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com;\n\tdkim=pass header.d=nxp.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=/fjqxQSSRip2tQQHnq0mea3mDeTUPwgOEqrDtRr5+kU=;\n\tb=V0x3Rw78eQhWQDdXZjWzLQi+IYuaWtgWKxwr8FOOMEX3uWLOpkDMwrau53DNX9hG0/0KhIxLbGZplRsJxWZTBkzYGv/A6UwlD9JoAQswG5thj7+9eR6oppoCIVt4giqYNFjbZwzDfNJ+IJTSn3GeQYC3Pf698ELYDMYuB2rwcVaDw2vLt4U6aOHlw2Q3tB/6NwNNdCwQsU5LEQfpe3eLa5bzmaRqeCfgAp9qkD4HA0hMGmU0XPjHstmnpxtkwlYbqn1N+rRPzW1RnnaiTmBfVS7bl1t8lmSL3v2B7LM7v8+ucC/Chw9c102SvMj/4JEu1JS9+sKqcYMIpCBPjrSLQg==","From":"Qi Hou <qi.hou@nxp.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\t\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>","CC":"Jared Hu <jared.hu@nxp.com>, Julien Vuillaumier\n\t<julien.vuillaumier@nxp.com>","Subject":"RE: [EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support","Thread-Topic":"[EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support","Thread-Index":"AQHbMb+W/Xm+cWvMKEmN7I73I8j/QbKx1R+AgAET1cA=","Date":"Tue, 12 Nov 2024 02:06:44 +0000","Message-ID":"<PAXPR04MB8285C2DC4DD55C092EA0354E97592@PAXPR04MB8285.eurprd04.prod.outlook.com>","References":"<20241108092113.3769844-1-qi.hou@nxp.com>\n\t<173131741340.3109090.14147718071752655329@ping.linuxembedded.co.uk>","In-Reply-To":"<173131741340.3109090.14147718071752655329@ping.linuxembedded.co.uk>","Accept-Language":"zh-CN, en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"V0x3Rw78\";\n\tdkim-atps=neutral","dkim=none (message not signed)\n\theader.d=none;dmarc=none action=none header.from=nxp.com;"],"x-ms-publictraffictype":"Email","x-ms-traffictypediagnostic":"PAXPR04MB8285:EE_|PA4PR04MB7518:EE_","x-ms-office365-filtering-correlation-id":"c460cb06-f969-4e0b-5ff4-08dd02bea83a","x-ms-exchange-senderadcheck":"1","x-ms-exchange-antispam-relay":"0","x-microsoft-antispam":"BCL:0;\n\tARA:13230040|376014|1800799024|366016|38070700018; ","x-microsoft-antispam-message-info":"=?gb2312?b?YThZYjB5TjFLRVhVbnFkdFpa?=\n\t=?gb2312?b?M2h1L3VrMy8yL3c4c1ZXSkxWRzF2RnpPbW03Z3FYVVVZM3pUbVNX?=\n\t=?gb2312?b?bTBzQTZBMGh6K0IxVDh2bjhITmZNNE5uc2thdlh5dWNiYnMyZUJB?=\n\t=?gb2312?b?TEhHSS8xeFVQRzEweVBGbEZtRDdDYzgxMW9QL2hOVmR3d2pwK1lJ?=\n\t=?gb2312?b?S29MSGFocHBMZG9Ba1k0NlhCd0Y0YWQ1ckhpLzlpUGppdTdBTUZM?=\n\t=?gb2312?b?WmpyUjJoZ1ZRMjc5T3NIelZvZTdUaFhXc0xGNEdmZUp2UWk5THBx?=\n\t=?gb2312?b?SXkzN2p6byt0NVNsT1hMd2hFcXVZUUg2b3lOUk90Z3QzWGZlRHZ5?=\n\t=?gb2312?b?c0hDb3RlNnZSaWJEbFJ5TFBOdUhmMTVqUGVqS0ZEVEdiM0hZcmsx?=\n\t=?gb2312?b?QUFGVmdKRGx3L3ltWjJucG1RUGlRZjhiR3JGakpONzBjY3A3d3Rv?=\n\t=?gb2312?b?RnYwckZHZXdYMUdXbXZiUXNPbld4bnltbnU2Q2ZOKys4UE1xdkFD?=\n\t=?gb2312?b?cVNkelRPaDk3SW55YzJjNmlkSkdlazZVb3JXOWgrZjhxN2VOMlg1?=\n\t=?gb2312?b?NjQ0RmVtWlJDSHFDTzZmbjdLTy9TMTBGSHJsdGtOSVd2U0NCWi9U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U5OMmZxdXFmeWVCd0RwU2RkZmFQ?=\n\t=?gb2312?b?NzJPdDltUmVBUFpGeWFwOTRxRE5mVDl6T2xyeDJtaUJ4QllNRXkz?=\n\t=?gb2312?b?czF6QzRqYWZzbHpYTmlpWHpjbUlUdVVOWmtaZkIxVzN1a2sraXFu?=\n\t=?gb2312?b?U3B3YkZja1pXTUtLdlNVcjRLTWhWLy9vR3hkVDBwbnNteEdDRHRu?=\n\t=?gb2312?b?NWsrZ0UyNTNBcHU5NVZEM09wUzZVN1FQQzh2VElQajNmakpnZFEr?=\n\t=?gb2312?b?OS9IS1FTL3Y2Z0RtTGVNaFZES2g0SHQ2WEVBS0tLTTQ5aDZKT1hu?=\n\t=?gb2312?b?N2RQeWJMVXVYcG4wS2J0aGhrUUF4cTVMc1hlVk5IV0ZhVnFwOHdz?=\n\t=?gb2312?b?dTgwaTFiYTBKSGVDMnJXejAvMG8xTVlHUHlmbkdSU3FnUDEzTlR5?=","x-forefront-antispam-report":"CIP:255.255.255.255; CTRY:; LANG:zh-cn; SCL:1; \n\tSRV:; IPV:NLI; SFV:NSPM;\n\tH:PAXPR04MB8285.eurprd04.prod.outlook.com; PTR:; \n\tCAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018);\n\tDIR:OUT; SFP:1101; ","x-ms-exchange-antispam-messagedata-chunkcount":"1","x-ms-exchange-antispam-messagedata-0":"=?gb2312?b?SXQ3OHVCZG5BTWFxOWZkOENj?=\n\t=?gb2312?b?OFNGZ3RMUllCWVFWNEVyVHBSS3ROeGpwVjV4L3d2MnNWWUt6dXZq?=\n\t=?gb2312?b?MElDdFoxd2EzQkNMeFoyeTdycWZtSUp2YnNnVnNxMlZRSjlRd2lo?=\n\t=?gb2312?b?bnE0clNOYjA5b3RVOFJoWG5iUmNXTkh5eDhHeThhbTdaOEQ4UGx2?=\n\t=?gb2312?b?SXZCYzJvbXJLbEFjcS9VdjhieWlEaUQ0RW45R3ljbnBrRXZ5NXFl?=\n\t=?gb2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b2312?b?SW1ndGZLMnJsRWxsdElyVnN2UzI5bWdFM0R4bm1raWREZ0pUOFpi?=\n\t=?gb2312?b?b1hOeEtYUHo5VEVaaVFZRHJKeXJPcTh3cGROUVZBd0VQQkVrZWhm?=\n\t=?gb2312?b?T3V5a3F6SzdMUXdyQ0FtM0RGWTRsR2FGWEsyMDl6cnFBWmZtK1Ja?=\n\t=?gb2312?b?Sk1NWnhmS0dtQmJBVzF2TjJpcm1FYXV4aXZMTmprSTZ6ZWRhLzJ1?=\n\t=?gb2312?b?azVrSkdoa01idStpUHU5c2VUMmdkWmRqUjFoRXNrMXBLL2xDVDk0?=\n\t=?gb2312?b?bz0=?=","Content-Type":"text/plain; charset=\"gb2312\"","Content-Transfer-Encoding":"base64","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-AuthSource":"PAXPR04MB8285.eurprd04.prod.outlook.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"c460cb06-f969-4e0b-5ff4-08dd02bea83a","X-MS-Exchange-CrossTenant-originalarrivaltime":"12 Nov 2024 02:06:44.5326\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-CrossTenant-mailboxtype":"HOSTED","X-MS-Exchange-CrossTenant-userprincipalname":"ve31ILsFFhuA/DzdiaTiee3eDEFp0TgMMBm4caoG7wpJXHYZ7pQdnDaVMeY6Z7Nq","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"PA4PR04MB7518","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32107,"web_url":"https://patchwork.libcamera.org/comment/32107/","msgid":"<20241112053335.GB5877@pendragon.ideasonboard.com>","date":"2024-11-12T05:33:35","subject":"Re: [EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Qi,\n\nOn Tue, Nov 12, 2024 at 02:06:44AM +0000, Qi Hou wrote:\n> Hi Kieran,\n> \n> \"gst_video_format_info_extrapolate_stride\" is defined since gstreamer\n> 1.22. I think it causes build fail on old compiler with gstreamer\n> version lower than 1.22. Do I need to add GST_CHECK_VERSION(1, 22, 0)\n> to uses this function for gstreamer version >=1.22.0, and fallback to\n> uses other functions for gstreamer version <1.22.0 ?\n\nI'd like to keep supporting 1.18 if possible as it's still shipped by\nDebian Bullseye. A version check is fine, it will clearly mark the\nbackward compatibility code, and allow us to remove it once we'll bump\nthe minimum GStreamer version.\n\n> On 2024年11月11日 17:30, Kieran Bingham wrote:\n> > Quoting Hou Qi (2024-11-08 09:21:13)\n> > > GStreamer video-info calculated stride and offset may differ from\n> > > those used by the camera.\n> > >\n> > > This patch enhances downstream plugin's support for videometa by\n> > > adding videometa support for libcamerasrc. It ensures that when\n> > > downstream plugin supports videometa by allocation query, libcamerasrc\n> > > also attaches videometa to buffer, preventing discrepancies between\n> > > the stride and offset calculated by video-info and camera.\n> > \n> > Thanks for the v2, this looks like interesting work.\n> > \n> > Unfortunately the CI isn't clear on this one yet:\n> > \n> > https://gitlab.freedesktop.org/camera/libcamera/-/jobs/66327653\n> > \n> > Any idea what's happening here? It looks like this only failed on one\n> > compiler:\n> > \n> > [443/641] Generating src/py/libcamera/py_gen_formats with a custom command [444/641] Compiling C++ object src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\n> > FAILED: src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\n> > g++-9 -Isrc/gstreamer/libgstlibcamera.so.p -Isrc/gstreamer\n> > g++-I../src/gstreamer -Iinclude -I../include -Iinclude/libcamera\n> > g++-I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4\n> > g++-I/usr/include/x86_64-linux-gnu -I/usr/include/glib-2.0\n> > g++-I/usr/lib/x86_64-linux-gnu/glib-2.0/include\n> > g++-fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch\n> > g++-Wextra -Werror -std=c++17 -O0 -g -Wmissing-declarations -Wshadow\n> > g++-include /builds/camera/libcamera/build/config.h -fPIC -pthread\n> > g++'-DVERSION=\"0.3.2+1-edf89091-nvm\"' '-DPACKAGE=\"libcamera\"'\n> > g++-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -MD -MQ\n> > g++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o -MF\n> > g++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o.d -o\n> > g++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o -c\n> > g++../src/gstreamer/gstlibcamerapool.cpp\n> > ../src/gstreamer/gstlibcamerapool.cpp: In function ‘GstLibcameraPool* gst_libcamera_pool_new(GstLibcameraAllocator*, const libcamera::StreamConfiguration&, GstCaps*, gboolean)’:\n> > ../src/gstreamer/gstlibcamerapool.cpp:151:13: error: ‘gst_video_format_info_extrapolate_stride’ was not declared in this scope; did you mean ‘gst_video_format_info_component’?\n> >   151 |    stride = gst_video_format_info_extrapolate_stride(info.finfo, k, stream_cfg.stride);\n> >       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n> >       |             gst_video_format_info_component\n> > [445/641] Compiling C++ object src/apps/qcam/qcam.p/viewfinder_qt.cpp.o\n> > \n> > So perhaps we're hitting a requirement to have a specific gstreamer version that isn't being catered for ?\n> > \n> > --\n> > Kieran\n> > \n> > > Signed-off-by: Hou Qi <qi.hou@nxp.com>\n> > > ---\n> > >  src/gstreamer/gstlibcamerapool.cpp | 28 ++++++++++++++++++++++++----\n> > >  src/gstreamer/gstlibcamerapool.h   |  2 +-\n> > >  src/gstreamer/gstlibcamerasrc.cpp  | 14 +++++++++++++-\n> > >  3 files changed, 38 insertions(+), 6 deletions(-)\n> > >\n> > > diff --git a/src/gstreamer/gstlibcamerapool.cpp\n> > > b/src/gstreamer/gstlibcamerapool.cpp\n> > > index 9cd7eccb..6593b3ca 100644\n> > > --- a/src/gstreamer/gstlibcamerapool.cpp\n> > > +++ b/src/gstreamer/gstlibcamerapool.cpp\n> > > @@ -135,16 +135,36 @@\n> > > gst_libcamera_pool_class_init(GstLibcameraPoolClass *klass)  }\n> > >\n> > >  GstLibcameraPool *\n> > > -gst_libcamera_pool_new(GstLibcameraAllocator *allocator, Stream\n> > > *stream)\n> > > +gst_libcamera_pool_new(GstLibcameraAllocator *allocator, const StreamConfiguration &stream_cfg,\n> > > +                      GstCaps *caps, gboolean add_video_meta)\n> > >  {\n> > >         auto *pool = GST_LIBCAMERA_POOL(g_object_new(GST_TYPE_LIBCAMERA_POOL, nullptr));\n> > > +       GstVideoInfo info;\n> > >\n> > >         pool->allocator = GST_LIBCAMERA_ALLOCATOR(g_object_ref(allocator));\n> > > -       pool->stream = stream;\n> > > -\n> > > -       gsize pool_size = gst_libcamera_allocator_get_pool_size(allocator, stream);\n> > > +       pool->stream = stream_cfg.stream();\n> > > +\n> > > +       if (caps && gst_video_info_from_caps(&info, caps)) {\n> > > +               guint k, stride;\n> > > +               gsize offset = 0;\n> > > +               for (k = 0; k < GST_VIDEO_INFO_N_PLANES(&info); k++) {\n> > > +                       stride = gst_video_format_info_extrapolate_stride(info.finfo, k, stream_cfg.stride);\n> > > +                       info.stride[k] = stride;\n> > > +                       info.offset[k] = offset;\n> > > +                       offset += stride * GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT(info.finfo, k, GST_VIDEO_INFO_HEIGHT(&info));\n> > > +               }\n> > > +       } else\n> > > +               add_video_meta = false;\n> > > +\n> > > +       gsize pool_size = gst_libcamera_allocator_get_pool_size(allocator, stream_cfg.stream());\n> > >         for (gsize i = 0; i < pool_size; i++) {\n> > >                 GstBuffer *buffer = gst_buffer_new();\n> > > +               if (add_video_meta) {\n> > > +                       gst_buffer_add_video_meta_full(buffer, GST_VIDEO_FRAME_FLAG_NONE,\n> > > +                                                      GST_VIDEO_INFO_FORMAT(&info), GST_VIDEO_INFO_WIDTH(&info),\n> > > +                                                      GST_VIDEO_INFO_HEIGHT(&info), GST_VIDEO_INFO_N_PLANES(&info),\n> > > +                                                      info.offset, info.stride);\n> > > +               }\n> > >                 pool->queue->push_back(buffer);\n> > >         }\n> > >\n> > > diff --git a/src/gstreamer/gstlibcamerapool.h\n> > > b/src/gstreamer/gstlibcamerapool.h\n> > > index 2a7a9c77..8ad87cab 100644\n> > > --- a/src/gstreamer/gstlibcamerapool.h\n> > > +++ b/src/gstreamer/gstlibcamerapool.h\n> > > @@ -21,7 +21,7 @@\n> > >  G_DECLARE_FINAL_TYPE(GstLibcameraPool, gst_libcamera_pool, GST_LIBCAMERA, POOL, GstBufferPool)\n> > >\n> > >  GstLibcameraPool *gst_libcamera_pool_new(GstLibcameraAllocator *allocator,\n> > > -                                        libcamera::Stream *stream);\n> > > +                                        const\n> > > + libcamera::StreamConfiguration &stream_cfg, GstCaps *caps, gboolean\n> > > + add_video_meta);\n> > >\n> > >  libcamera::Stream *gst_libcamera_pool_get_stream(GstLibcameraPool *self);\n> > >\n> > > diff --git a/src/gstreamer/gstlibcamerasrc.cpp\n> > > b/src/gstreamer/gstlibcamerasrc.cpp\n> > > index 8efa25f4..c05a31e7 100644\n> > > --- a/src/gstreamer/gstlibcamerasrc.cpp\n> > > +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> > > @@ -497,9 +497,21 @@ gst_libcamera_src_negotiate(GstLibcameraSrc *self)\n> > >         for (gsize i = 0; i < state->srcpads_.size(); i++) {\n> > >                 GstPad *srcpad = state->srcpads_[i];\n> > >                 const StreamConfiguration &stream_cfg = state->config_->at(i);\n> > > +               GstQuery *query = NULL;\n> > > +               gboolean add_video_meta = false;\n> > > +\n> > > +               g_autoptr(GstCaps) caps = gst_libcamera_stream_configuration_to_caps(stream_cfg);\n> > > +               gst_libcamera_framerate_to_caps(caps, element_caps);\n> > > +\n> > > +               query = gst_query_new_allocation(caps, false);\n> > > +               if (!gst_pad_peer_query(srcpad, query))\n> > > +                       GST_DEBUG_OBJECT(self, \"didn't get downstream ALLOCATION hints\");\n> > > +               else\n> > > +                       add_video_meta = gst_query_find_allocation_meta(query, GST_VIDEO_META_API_TYPE, NULL);\n> > > +               gst_query_unref(query);\n> > >\n> > >                 GstLibcameraPool *pool = gst_libcamera_pool_new(self->allocator,\n> > > -                                                               stream_cfg.stream());\n> > > +\n> > > + stream_cfg, caps, add_video_meta);\n> > >                 g_signal_connect_swapped(pool, \"buffer-notify\",\n> > >                                          G_CALLBACK(gst_task_resume), self->task);\n> > >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 068A6BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 12 Nov 2024 05:33:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3485F657DD;\n\tTue, 12 Nov 2024 06:33:47 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E134C618BE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 Nov 2024 06:33:44 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 45653512;\n\tTue, 12 Nov 2024 06:33:31 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"gMnQKTDz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731389611;\n\tbh=4q5rWC8MNWVy5a2SwMpzwMy5XVygYIsoAV9sLAn6g2o=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=gMnQKTDzXiZOP7MBjFGvCtyqqjTb+pZ5lSDiAJmCX6tdwnrgbWQmNrl7rlCK1qVDn\n\tTCricaQQgAx7Zcixi0FamSiXQVZR2e4vGMVRwdNHLQsFSSkt+7BOpnLMGQrTH4Du28\n\tsxfrGoM+FG+yVkGOG0B/sKDdyXAmA1Fm1zjdgfeA=","Date":"Tue, 12 Nov 2024 07:33:35 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Qi Hou <qi.hou@nxp.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\t\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>, Jared Hu <jared.hu@nxp.com>,\n\tJulien Vuillaumier <julien.vuillaumier@nxp.com>","Subject":"Re: [EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support","Message-ID":"<20241112053335.GB5877@pendragon.ideasonboard.com>","References":"<20241108092113.3769844-1-qi.hou@nxp.com>\n\t<173131741340.3109090.14147718071752655329@ping.linuxembedded.co.uk>\n\t<PAXPR04MB8285C2DC4DD55C092EA0354E97592@PAXPR04MB8285.eurprd04.prod.outlook.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<PAXPR04MB8285C2DC4DD55C092EA0354E97592@PAXPR04MB8285.eurprd04.prod.outlook.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32128,"web_url":"https://patchwork.libcamera.org/comment/32128/","msgid":"<a5b87c25b19259ed93714bd07dbb2cf0794dfdd2.camel@ndufresne.ca>","date":"2024-11-12T18:27:12","subject":"Re: [EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support","submitter":{"id":30,"url":"https://patchwork.libcamera.org/api/people/30/","name":"Nicolas Dufresne","email":"nicolas@ndufresne.ca"},"content":"Le mardi 12 novembre 2024 à 07:33 +0200, Laurent Pinchart a écrit :\n> Hi Qi,\n> \n> On Tue, Nov 12, 2024 at 02:06:44AM +0000, Qi Hou wrote:\n> > Hi Kieran,\n> > \n> > \"gst_video_format_info_extrapolate_stride\" is defined since gstreamer\n> > 1.22. I think it causes build fail on old compiler with gstreamer\n> > version lower than 1.22. Do I need to add GST_CHECK_VERSION(1, 22, 0)\n> > to uses this function for gstreamer version >=1.22.0, and fallback to\n> > uses other functions for gstreamer version <1.22.0 ?\n> \n> I'd like to keep supporting 1.18 if possible as it's still shipped by\n> Debian Bullseye. A version check is fine, it will clearly mark the\n\nFun fact, Debian Bullseye will never be updated to ship a newer GStreamer.\nDebian never updates major GStreamer version in stable. Though, it seems very\nup-to-date on security fixes, which I can see in some of the logs (these are\nfixes that upstream did not backport and release, because we only go back 2\nversions):\n\nhttps://metadata.ftp-master.debian.org/changelogs//main/g/gst-plugins-good1.0/gst-plugins-good1.0_1.18.4-2+deb11u2_changelog\n\nMy understanding is that this is EOL 5 years after the .0 release, so in August\n2026. Is it your plan to drop it at the time ? Its quite unusable to see\nlibraries keeping backward support for that long. But it would be nice to have\nthis officially stated somewhere.\n\n> backward compatibility code, and allow us to remove it once we'll bump\n> the minimum GStreamer version.\n\nThat function only depends on 1.18 internally, so yes, that's an option:\n\n#if < 1.22\n\ngint                                                                           \ngst_video_format_info_extrapolate_stride (const GstVideoFormatInfo * finfo,    \n    gint plane, gint stride)                                                   \n{                                                                              \n  gint estride;                                                                \n  gint comp[GST_VIDEO_MAX_COMPONENTS];                                         \n  gint i;                                                                      \n                                                                               \n  /* there is nothing to extrapolate on first plane */                         \n  if (plane == 0)                                                              \n    return stride;                                                             \n                                                                               \n  gst_video_format_info_component (finfo, plane, comp);                        \n                                                                               \n  /* For now, all planar formats have a single component on first plane, but   \n   * if there was a planar format with more, we'd have to make a ratio of the  \n   * number of component on the first plane against the number of component on \n   * the current plane. */                                                     \n  estride = 0;                                                                 \n  for (i = 0; i < GST_VIDEO_MAX_COMPONENTS && comp[i] >= 0; i++)               \n    estride += GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, comp[i], stride);     \n                                                                               \n  return estride;                                                              \n}  \n#endif\n\nDon't forget to refer it and copy over the copyright:\n\n\n * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>                    \n * Library       <2002> Ronald Bultje <rbultje@ronald.bitfreak.net>            \n * Copyright (C) 2007 David A. Schleef <ds@schleef.org>                         \n\nThis code is LGPL V2.\n\nNicolas\n\n> \n> > On 2024年11月11日 17:30, Kieran Bingham wrote:\n> > > Quoting Hou Qi (2024-11-08 09:21:13)\n> > > > GStreamer video-info calculated stride and offset may differ from\n> > > > those used by the camera.\n> > > > \n> > > > This patch enhances downstream plugin's support for videometa by\n> > > > adding videometa support for libcamerasrc. It ensures that when\n> > > > downstream plugin supports videometa by allocation query, libcamerasrc\n> > > > also attaches videometa to buffer, preventing discrepancies between\n> > > > the stride and offset calculated by video-info and camera.\n> > > \n> > > Thanks for the v2, this looks like interesting work.\n> > > \n> > > Unfortunately the CI isn't clear on this one yet:\n> > > \n> > > https://gitlab.freedesktop.org/camera/libcamera/-/jobs/66327653\n> > > \n> > > Any idea what's happening here? It looks like this only failed on one\n> > > compiler:\n> > > \n> > > [443/641] Generating src/py/libcamera/py_gen_formats with a custom command [444/641] Compiling C++ object src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\n> > > FAILED: src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\n> > > g++-9 -Isrc/gstreamer/libgstlibcamera.so.p -Isrc/gstreamer\n> > > g++-I../src/gstreamer -Iinclude -I../include -Iinclude/libcamera\n> > > g++-I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4\n> > > g++-I/usr/include/x86_64-linux-gnu -I/usr/include/glib-2.0\n> > > g++-I/usr/lib/x86_64-linux-gnu/glib-2.0/include\n> > > g++-fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch\n> > > g++-Wextra -Werror -std=c++17 -O0 -g -Wmissing-declarations -Wshadow\n> > > g++-include /builds/camera/libcamera/build/config.h -fPIC -pthread\n> > > g++'-DVERSION=\"0.3.2+1-edf89091-nvm\"' '-DPACKAGE=\"libcamera\"'\n> > > g++-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -MD -MQ\n> > > g++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o -MF\n> > > g++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o.d -o\n> > > g++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o -c\n> > > g++../src/gstreamer/gstlibcamerapool.cpp\n> > > ../src/gstreamer/gstlibcamerapool.cpp: In function ‘GstLibcameraPool* gst_libcamera_pool_new(GstLibcameraAllocator*, const libcamera::StreamConfiguration&, GstCaps*, gboolean)’:\n> > > ../src/gstreamer/gstlibcamerapool.cpp:151:13: error: ‘gst_video_format_info_extrapolate_stride’ was not declared in this scope; did you mean ‘gst_video_format_info_component’?\n> > >   151 |    stride = gst_video_format_info_extrapolate_stride(info.finfo, k, stream_cfg.stride);\n> > >       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n> > >       |             gst_video_format_info_component\n> > > [445/641] Compiling C++ object src/apps/qcam/qcam.p/viewfinder_qt.cpp.o\n> > > \n> > > So perhaps we're hitting a requirement to have a specific gstreamer version that isn't being catered for ?\n> > > \n> > > --\n> > > Kieran\n> > > \n> > > > Signed-off-by: Hou Qi <qi.hou@nxp.com>\n> > > > ---\n> > > >  src/gstreamer/gstlibcamerapool.cpp | 28 ++++++++++++++++++++++++----\n> > > >  src/gstreamer/gstlibcamerapool.h   |  2 +-\n> > > >  src/gstreamer/gstlibcamerasrc.cpp  | 14 +++++++++++++-\n> > > >  3 files changed, 38 insertions(+), 6 deletions(-)\n> > > > \n> > > > diff --git a/src/gstreamer/gstlibcamerapool.cpp\n> > > > b/src/gstreamer/gstlibcamerapool.cpp\n> > > > index 9cd7eccb..6593b3ca 100644\n> > > > --- a/src/gstreamer/gstlibcamerapool.cpp\n> > > > +++ b/src/gstreamer/gstlibcamerapool.cpp\n> > > > @@ -135,16 +135,36 @@\n> > > > gst_libcamera_pool_class_init(GstLibcameraPoolClass *klass)  }\n> > > > \n> > > >  GstLibcameraPool *\n> > > > -gst_libcamera_pool_new(GstLibcameraAllocator *allocator, Stream\n> > > > *stream)\n> > > > +gst_libcamera_pool_new(GstLibcameraAllocator *allocator, const StreamConfiguration &stream_cfg,\n> > > > +                      GstCaps *caps, gboolean add_video_meta)\n> > > >  {\n> > > >         auto *pool = GST_LIBCAMERA_POOL(g_object_new(GST_TYPE_LIBCAMERA_POOL, nullptr));\n> > > > +       GstVideoInfo info;\n> > > > \n> > > >         pool->allocator = GST_LIBCAMERA_ALLOCATOR(g_object_ref(allocator));\n> > > > -       pool->stream = stream;\n> > > > -\n> > > > -       gsize pool_size = gst_libcamera_allocator_get_pool_size(allocator, stream);\n> > > > +       pool->stream = stream_cfg.stream();\n> > > > +\n> > > > +       if (caps && gst_video_info_from_caps(&info, caps)) {\n> > > > +               guint k, stride;\n> > > > +               gsize offset = 0;\n> > > > +               for (k = 0; k < GST_VIDEO_INFO_N_PLANES(&info); k++) {\n> > > > +                       stride = gst_video_format_info_extrapolate_stride(info.finfo, k, stream_cfg.stride);\n> > > > +                       info.stride[k] = stride;\n> > > > +                       info.offset[k] = offset;\n> > > > +                       offset += stride * GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT(info.finfo, k, GST_VIDEO_INFO_HEIGHT(&info));\n> > > > +               }\n> > > > +       } else\n> > > > +               add_video_meta = false;\n> > > > +\n> > > > +       gsize pool_size = gst_libcamera_allocator_get_pool_size(allocator, stream_cfg.stream());\n> > > >         for (gsize i = 0; i < pool_size; i++) {\n> > > >                 GstBuffer *buffer = gst_buffer_new();\n> > > > +               if (add_video_meta) {\n> > > > +                       gst_buffer_add_video_meta_full(buffer, GST_VIDEO_FRAME_FLAG_NONE,\n> > > > +                                                      GST_VIDEO_INFO_FORMAT(&info), GST_VIDEO_INFO_WIDTH(&info),\n> > > > +                                                      GST_VIDEO_INFO_HEIGHT(&info), GST_VIDEO_INFO_N_PLANES(&info),\n> > > > +                                                      info.offset, info.stride);\n> > > > +               }\n> > > >                 pool->queue->push_back(buffer);\n> > > >         }\n> > > > \n> > > > diff --git a/src/gstreamer/gstlibcamerapool.h\n> > > > b/src/gstreamer/gstlibcamerapool.h\n> > > > index 2a7a9c77..8ad87cab 100644\n> > > > --- a/src/gstreamer/gstlibcamerapool.h\n> > > > +++ b/src/gstreamer/gstlibcamerapool.h\n> > > > @@ -21,7 +21,7 @@\n> > > >  G_DECLARE_FINAL_TYPE(GstLibcameraPool, gst_libcamera_pool, GST_LIBCAMERA, POOL, GstBufferPool)\n> > > > \n> > > >  GstLibcameraPool *gst_libcamera_pool_new(GstLibcameraAllocator *allocator,\n> > > > -                                        libcamera::Stream *stream);\n> > > > +                                        const\n> > > > + libcamera::StreamConfiguration &stream_cfg, GstCaps *caps, gboolean\n> > > > + add_video_meta);\n> > > > \n> > > >  libcamera::Stream *gst_libcamera_pool_get_stream(GstLibcameraPool *self);\n> > > > \n> > > > diff --git a/src/gstreamer/gstlibcamerasrc.cpp\n> > > > b/src/gstreamer/gstlibcamerasrc.cpp\n> > > > index 8efa25f4..c05a31e7 100644\n> > > > --- a/src/gstreamer/gstlibcamerasrc.cpp\n> > > > +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> > > > @@ -497,9 +497,21 @@ gst_libcamera_src_negotiate(GstLibcameraSrc *self)\n> > > >         for (gsize i = 0; i < state->srcpads_.size(); i++) {\n> > > >                 GstPad *srcpad = state->srcpads_[i];\n> > > >                 const StreamConfiguration &stream_cfg = state->config_->at(i);\n> > > > +               GstQuery *query = NULL;\n> > > > +               gboolean add_video_meta = false;\n> > > > +\n> > > > +               g_autoptr(GstCaps) caps = gst_libcamera_stream_configuration_to_caps(stream_cfg);\n> > > > +               gst_libcamera_framerate_to_caps(caps, element_caps);\n> > > > +\n> > > > +               query = gst_query_new_allocation(caps, false);\n> > > > +               if (!gst_pad_peer_query(srcpad, query))\n> > > > +                       GST_DEBUG_OBJECT(self, \"didn't get downstream ALLOCATION hints\");\n> > > > +               else\n> > > > +                       add_video_meta = gst_query_find_allocation_meta(query, GST_VIDEO_META_API_TYPE, NULL);\n> > > > +               gst_query_unref(query);\n> > > > \n> > > >                 GstLibcameraPool *pool = gst_libcamera_pool_new(self->allocator,\n> > > > -                                                               stream_cfg.stream());\n> > > > +\n> > > > + stream_cfg, caps, add_video_meta);\n> > > >                 g_signal_connect_swapped(pool, \"buffer-notify\",\n> > > >                                          G_CALLBACK(gst_task_resume), self->task);\n> > > > \n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 7C173C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 12 Nov 2024 18:27:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AA9C7657F9;\n\tTue, 12 Nov 2024 19:27:19 +0100 (CET)","from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com\n\t[IPv6:2607:f8b0:4864:20::f35])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D6F2B657B0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 Nov 2024 19:27:17 +0100 (CET)","by mail-qv1-xf35.google.com with SMTP id\n\t6a1803df08f44-6cbd092f7f0so40399096d6.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 Nov 2024 10:27:17 -0800 (PST)","from nicolas-tpx395.localdomain ([2606:6d00:15:862e::580])\n\tby smtp.gmail.com with ESMTPSA id\n\t6a1803df08f44-6d3966303dbsm73867516d6.98.2024.11.12.10.27.13\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 12 Nov 2024 10:27:16 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=ndufresne-ca.20230601.gappssmtp.com\n\theader.i=@ndufresne-ca.20230601.gappssmtp.com\n\theader.b=\"x3i0SfCm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ndufresne-ca.20230601.gappssmtp.com; s=20230601; t=1731436036;\n\tx=1732040836; darn=lists.libcamera.org; \n\th=mime-version:user-agent:content-transfer-encoding:references\n\t:in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=HMfZxFO7HAKx/iJJpT6gc4n3GCvnM6pp5ofONu+/nHI=;\n\tb=x3i0SfCmaGRRFWFYuQdyR0lsk5jPLmSmN2c1+AroG8hZG+VXD3v7zR9IIOhGD0s0Cu\n\tYuctALoaTmFTGYohQ2EO9/fwzrMkbHoZkzdXAEp/NMkpVM+FHEoJE12txx0DML6gsBmQ\n\tuhzSd4VxiTSM800fsWDnjzXd1ZGI8520Fr2uYgJNChkXjoBhEb85iqOMaRM8aqf2mLZc\n\testfmv+g5RXzKBNNu+IR0s8hp6pobge+UvU9bB5a4oeiVQjb/rQl1HG/+PkA2GaTPHkG\n\tLfm2e+SwvozsQlTM1yT0bRrD9qtcTXFlG+DaVTpdlUc4luTO5MTi4A+dCSS/FWL3USs0\n\tOxEQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1731436036; x=1732040836;\n\th=mime-version:user-agent:content-transfer-encoding:references\n\t:in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state\n\t:from:to:cc:subject:date:message-id:reply-to;\n\tbh=HMfZxFO7HAKx/iJJpT6gc4n3GCvnM6pp5ofONu+/nHI=;\n\tb=LmG52qPD6i9NcWut5PnZLj0JKhiJuIThh4AmPMowB8Lp7+gpagChf7uMgSOjJCLY8k\n\tkj/xPtfcoAhyWTPwN5SuGbfVDQ+8T0zc1EHghWuRI1afpjejHE1lPT0SLVySsu5kIWv1\n\trulzwf0bBJXLZMuAhKyGTIW6jVjrlTCAew/lN+4Holn1hHk4Q8AFNW0CufOqAhOCE9r2\n\t0kadN6g0jYakoB8Vsy3LwXpI15LIzM4hT0/uA6POUaKxi1ht4kRKz6/7sfdhU/p8Rkcw\n\tKIdj6Xfg/4nYfhCpfRRdFfdnS2STj4EmKWIA/XMy36UxbHhHTDe2HmDmOOi5nFldry9I\n\taDNw==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCUOc1QIrJedNjAUUVC2J4J3fVcJ2F5sjmR+TD/ssiW33L1VmCB1fbqrG/4VSzoUGhRYUxorKbx0J5qmc8V+4sQ=@lists.libcamera.org","X-Gm-Message-State":"AOJu0Yym8+4HOh43JIm/jEnpzizcRkJ8xd3QvTKhaACJNwf9ASycwEq7\n\t+6TDwzc48GWyvRO38rkKkxl9CKNkmG55dn4cQAv5dbyCHg3vTrLMZWsw9/TSnus=","X-Google-Smtp-Source":"AGHT+IF4lpG7cDu3Cv7YHu4M2VaGQBMwz6azY3aLlu6LkaLDfhlelZ18zAHcVMIa2S35A/2yxMsT+Q==","X-Received":"by 2002:a05:6214:4521:b0:6d3:45cb:40eb with SMTP id\n\t6a1803df08f44-6d3d008e9f8mr52041496d6.10.1731436036634; \n\tTue, 12 Nov 2024 10:27:16 -0800 (PST)","Message-ID":"<a5b87c25b19259ed93714bd07dbb2cf0794dfdd2.camel@ndufresne.ca>","Subject":"Re: [EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support","From":"Nicolas Dufresne <nicolas@ndufresne.ca>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Qi Hou\n\t<qi.hou@nxp.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>, \n\t\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>, Jared Hu <jared.hu@nxp.com>,\n\tJulien Vuillaumier <julien.vuillaumier@nxp.com>","Date":"Tue, 12 Nov 2024 13:27:12 -0500","In-Reply-To":"<20241112053335.GB5877@pendragon.ideasonboard.com>","References":"<20241108092113.3769844-1-qi.hou@nxp.com>\n\t<173131741340.3109090.14147718071752655329@ping.linuxembedded.co.uk>\n\t<PAXPR04MB8285C2DC4DD55C092EA0354E97592@PAXPR04MB8285.eurprd04.prod.outlook.com>\n\t<20241112053335.GB5877@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","User-Agent":"Evolution 3.54.1 (3.54.1-1.fc41) ","MIME-Version":"1.0","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32129,"web_url":"https://patchwork.libcamera.org/comment/32129/","msgid":"<20241112184310.GI17916@pendragon.ideasonboard.com>","date":"2024-11-12T18:43:10","subject":"Re: [EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Nicolas,\n\nOn Tue, Nov 12, 2024 at 01:27:12PM -0500, Nicolas Dufresne wrote:\n> Le mardi 12 novembre 2024 à 07:33 +0200, Laurent Pinchart a écrit :\n> > On Tue, Nov 12, 2024 at 02:06:44AM +0000, Qi Hou wrote:\n> > > Hi Kieran,\n> > > \n> > > \"gst_video_format_info_extrapolate_stride\" is defined since gstreamer\n> > > 1.22. I think it causes build fail on old compiler with gstreamer\n> > > version lower than 1.22. Do I need to add GST_CHECK_VERSION(1, 22, 0)\n> > > to uses this function for gstreamer version >=1.22.0, and fallback to\n> > > uses other functions for gstreamer version <1.22.0 ?\n> > \n> > I'd like to keep supporting 1.18 if possible as it's still shipped by\n> > Debian Bullseye. A version check is fine, it will clearly mark the\n> \n> Fun fact, Debian Bullseye will never be updated to ship a newer GStreamer.\n> Debian never updates major GStreamer version in stable.\n\nI know. I didn't imply they would update.\n\n> Though, it seems very\n> up-to-date on security fixes, which I can see in some of the logs (these are\n> fixes that upstream did not backport and release, because we only go back 2\n> versions):\n> \n> https://metadata.ftp-master.debian.org/changelogs//main/g/gst-plugins-good1.0/gst-plugins-good1.0_1.18.4-2+deb11u2_changelog\n> \n> My understanding is that this is EOL 5 years after the .0 release, so in August\n> 2026. Is it your plan to drop it at the time ? Its quite unusable to see\n> libraries keeping backward support for that long. But it would be nice to have\n> this officially stated somewhere.\n\nWe try to support the current and previous versions of major\ndistributions when possible. For Debian, this is also due to using\nbullseye in CI to test compilation with gcc 9 and gcc 10.\n\n> > backward compatibility code, and allow us to remove it once we'll bump\n> > the minimum GStreamer version.\n> \n> That function only depends on 1.18 internally, so yes, that's an option:\n> \n> #if < 1.22\n> \n> gint                                                                           \n> gst_video_format_info_extrapolate_stride (const GstVideoFormatInfo * finfo,    \n>     gint plane, gint stride)                                                   \n> {                                                                              \n>   gint estride;                                                                \n>   gint comp[GST_VIDEO_MAX_COMPONENTS];                                         \n>   gint i;                                                                      \n>                                                                                \n>   /* there is nothing to extrapolate on first plane */                         \n>   if (plane == 0)                                                              \n>     return stride;                                                             \n>                                                                                \n>   gst_video_format_info_component (finfo, plane, comp);                        \n>                                                                                \n>   /* For now, all planar formats have a single component on first plane, but   \n>    * if there was a planar format with more, we'd have to make a ratio of the  \n>    * number of component on the first plane against the number of component on \n>    * the current plane. */                                                     \n>   estride = 0;                                                                 \n>   for (i = 0; i < GST_VIDEO_MAX_COMPONENTS && comp[i] >= 0; i++)               \n>     estride += GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, comp[i], stride);     \n>                                                                                \n>   return estride;                                                              \n> }  \n> #endif\n> \n> Don't forget to refer it and copy over the copyright:\n> \n> \n>  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>                    \n>  * Library       <2002> Ronald Bultje <rbultje@ronald.bitfreak.net>            \n>  * Copyright (C) 2007 David A. Schleef <ds@schleef.org>                         \n> \n> This code is LGPL V2.\n> \n> > > On 2024年11月11日 17:30, Kieran Bingham wrote:\n> > > > Quoting Hou Qi (2024-11-08 09:21:13)\n> > > > > GStreamer video-info calculated stride and offset may differ from\n> > > > > those used by the camera.\n> > > > > \n> > > > > This patch enhances downstream plugin's support for videometa by\n> > > > > adding videometa support for libcamerasrc. It ensures that when\n> > > > > downstream plugin supports videometa by allocation query, libcamerasrc\n> > > > > also attaches videometa to buffer, preventing discrepancies between\n> > > > > the stride and offset calculated by video-info and camera.\n> > > > \n> > > > Thanks for the v2, this looks like interesting work.\n> > > > \n> > > > Unfortunately the CI isn't clear on this one yet:\n> > > > \n> > > > https://gitlab.freedesktop.org/camera/libcamera/-/jobs/66327653\n> > > > \n> > > > Any idea what's happening here? It looks like this only failed on one\n> > > > compiler:\n> > > > \n> > > > [443/641] Generating src/py/libcamera/py_gen_formats with a custom command [444/641] Compiling C++ object src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\n> > > > FAILED: src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\n> > > > g++-9 -Isrc/gstreamer/libgstlibcamera.so.p -Isrc/gstreamer\n> > > > g++-I../src/gstreamer -Iinclude -I../include -Iinclude/libcamera\n> > > > g++-I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4\n> > > > g++-I/usr/include/x86_64-linux-gnu -I/usr/include/glib-2.0\n> > > > g++-I/usr/lib/x86_64-linux-gnu/glib-2.0/include\n> > > > g++-fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch\n> > > > g++-Wextra -Werror -std=c++17 -O0 -g -Wmissing-declarations -Wshadow\n> > > > g++-include /builds/camera/libcamera/build/config.h -fPIC -pthread\n> > > > g++'-DVERSION=\"0.3.2+1-edf89091-nvm\"' '-DPACKAGE=\"libcamera\"'\n> > > > g++-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -MD -MQ\n> > > > g++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o -MF\n> > > > g++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o.d -o\n> > > > g++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o -c\n> > > > g++../src/gstreamer/gstlibcamerapool.cpp\n> > > > ../src/gstreamer/gstlibcamerapool.cpp: In function ‘GstLibcameraPool* gst_libcamera_pool_new(GstLibcameraAllocator*, const libcamera::StreamConfiguration&, GstCaps*, gboolean)’:\n> > > > ../src/gstreamer/gstlibcamerapool.cpp:151:13: error: ‘gst_video_format_info_extrapolate_stride’ was not declared in this scope; did you mean ‘gst_video_format_info_component’?\n> > > >   151 |    stride = gst_video_format_info_extrapolate_stride(info.finfo, k, stream_cfg.stride);\n> > > >       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n> > > >       |             gst_video_format_info_component\n> > > > [445/641] Compiling C++ object src/apps/qcam/qcam.p/viewfinder_qt.cpp.o\n> > > > \n> > > > So perhaps we're hitting a requirement to have a specific gstreamer version that isn't being catered for ?\n> > > > \n> > > > --\n> > > > Kieran\n> > > > \n> > > > > Signed-off-by: Hou Qi <qi.hou@nxp.com>\n> > > > > ---\n> > > > >  src/gstreamer/gstlibcamerapool.cpp | 28 ++++++++++++++++++++++++----\n> > > > >  src/gstreamer/gstlibcamerapool.h   |  2 +-\n> > > > >  src/gstreamer/gstlibcamerasrc.cpp  | 14 +++++++++++++-\n> > > > >  3 files changed, 38 insertions(+), 6 deletions(-)\n> > > > > \n> > > > > diff --git a/src/gstreamer/gstlibcamerapool.cpp\n> > > > > b/src/gstreamer/gstlibcamerapool.cpp\n> > > > > index 9cd7eccb..6593b3ca 100644\n> > > > > --- a/src/gstreamer/gstlibcamerapool.cpp\n> > > > > +++ b/src/gstreamer/gstlibcamerapool.cpp\n> > > > > @@ -135,16 +135,36 @@\n> > > > > gst_libcamera_pool_class_init(GstLibcameraPoolClass *klass)  }\n> > > > > \n> > > > >  GstLibcameraPool *\n> > > > > -gst_libcamera_pool_new(GstLibcameraAllocator *allocator, Stream *stream)\n> > > > > +gst_libcamera_pool_new(GstLibcameraAllocator *allocator, const StreamConfiguration &stream_cfg,\n> > > > > +                      GstCaps *caps, gboolean add_video_meta)\n> > > > >  {\n> > > > >         auto *pool = GST_LIBCAMERA_POOL(g_object_new(GST_TYPE_LIBCAMERA_POOL, nullptr));\n> > > > > +       GstVideoInfo info;\n> > > > > \n> > > > >         pool->allocator = GST_LIBCAMERA_ALLOCATOR(g_object_ref(allocator));\n> > > > > -       pool->stream = stream;\n> > > > > -\n> > > > > -       gsize pool_size = gst_libcamera_allocator_get_pool_size(allocator, stream);\n> > > > > +       pool->stream = stream_cfg.stream();\n> > > > > +\n> > > > > +       if (caps && gst_video_info_from_caps(&info, caps)) {\n> > > > > +               guint k, stride;\n> > > > > +               gsize offset = 0;\n> > > > > +               for (k = 0; k < GST_VIDEO_INFO_N_PLANES(&info); k++) {\n> > > > > +                       stride = gst_video_format_info_extrapolate_stride(info.finfo, k, stream_cfg.stride);\n> > > > > +                       info.stride[k] = stride;\n> > > > > +                       info.offset[k] = offset;\n> > > > > +                       offset += stride * GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT(info.finfo, k, GST_VIDEO_INFO_HEIGHT(&info));\n> > > > > +               }\n> > > > > +       } else\n> > > > > +               add_video_meta = false;\n\nI think there are a few coding style issues that checkstyle.py could\nhave caught. See https://libcamera.org/coding-style.html#tools for more\ninformation, especially the last paragraph that explains how to use the\ngit commit hook.\n\n> > > > > +\n> > > > > +       gsize pool_size = gst_libcamera_allocator_get_pool_size(allocator, stream_cfg.stream());\n> > > > >         for (gsize i = 0; i < pool_size; i++) {\n> > > > >                 GstBuffer *buffer = gst_buffer_new();\n> > > > > +               if (add_video_meta) {\n> > > > > +                       gst_buffer_add_video_meta_full(buffer, GST_VIDEO_FRAME_FLAG_NONE,\n> > > > > +                                                      GST_VIDEO_INFO_FORMAT(&info), GST_VIDEO_INFO_WIDTH(&info),\n> > > > > +                                                      GST_VIDEO_INFO_HEIGHT(&info), GST_VIDEO_INFO_N_PLANES(&info),\n> > > > > +                                                      info.offset, info.stride);\n> > > > > +               }\n> > > > >                 pool->queue->push_back(buffer);\n> > > > >         }\n> > > > > \n> > > > > diff --git a/src/gstreamer/gstlibcamerapool.h\n> > > > > b/src/gstreamer/gstlibcamerapool.h\n> > > > > index 2a7a9c77..8ad87cab 100644\n> > > > > --- a/src/gstreamer/gstlibcamerapool.h\n> > > > > +++ b/src/gstreamer/gstlibcamerapool.h\n> > > > > @@ -21,7 +21,7 @@\n> > > > >  G_DECLARE_FINAL_TYPE(GstLibcameraPool, gst_libcamera_pool, GST_LIBCAMERA, POOL, GstBufferPool)\n> > > > > \n> > > > >  GstLibcameraPool *gst_libcamera_pool_new(GstLibcameraAllocator *allocator,\n> > > > > -                                        libcamera::Stream *stream);\n> > > > > +                                        const\n> > > > > + libcamera::StreamConfiguration &stream_cfg, GstCaps *caps, gboolean\n> > > > > + add_video_meta);\n> > > > > \n> > > > >  libcamera::Stream *gst_libcamera_pool_get_stream(GstLibcameraPool *self);\n> > > > > \n> > > > > diff --git a/src/gstreamer/gstlibcamerasrc.cpp\n> > > > > b/src/gstreamer/gstlibcamerasrc.cpp\n> > > > > index 8efa25f4..c05a31e7 100644\n> > > > > --- a/src/gstreamer/gstlibcamerasrc.cpp\n> > > > > +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> > > > > @@ -497,9 +497,21 @@ gst_libcamera_src_negotiate(GstLibcameraSrc *self)\n> > > > >         for (gsize i = 0; i < state->srcpads_.size(); i++) {\n> > > > >                 GstPad *srcpad = state->srcpads_[i];\n> > > > >                 const StreamConfiguration &stream_cfg = state->config_->at(i);\n> > > > > +               GstQuery *query = NULL;\n> > > > > +               gboolean add_video_meta = false;\n> > > > > +\n> > > > > +               g_autoptr(GstCaps) caps = gst_libcamera_stream_configuration_to_caps(stream_cfg);\n> > > > > +               gst_libcamera_framerate_to_caps(caps, element_caps);\n> > > > > +\n> > > > > +               query = gst_query_new_allocation(caps, false);\n> > > > > +               if (!gst_pad_peer_query(srcpad, query))\n> > > > > +                       GST_DEBUG_OBJECT(self, \"didn't get downstream ALLOCATION hints\");\n> > > > > +               else\n> > > > > +                       add_video_meta = gst_query_find_allocation_meta(query, GST_VIDEO_META_API_TYPE, NULL);\n> > > > > +               gst_query_unref(query);\n> > > > > \n> > > > >                 GstLibcameraPool *pool = gst_libcamera_pool_new(self->allocator,\n> > > > > -                                                               stream_cfg.stream());\n> > > > > +\n> > > > > + stream_cfg, caps, add_video_meta);\n> > > > >                 g_signal_connect_swapped(pool, \"buffer-notify\",\n> > > > >                                          G_CALLBACK(gst_task_resume), self->task);\n> > > > >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 8DE95BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 12 Nov 2024 18:43:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 80D5D657F8;\n\tTue, 12 Nov 2024 19:43:20 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BF3A0657F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 Nov 2024 19:43:18 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BD106710;\n\tTue, 12 Nov 2024 19:43:05 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"DfN3TFoD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731436986;\n\tbh=qKe4lvo+dW//jjOA5X0qKiU0vxPaDba3WZC3s9dnbas=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=DfN3TFoDPCSoTuGkhRRkwofzsuVGwA2YNHDh6nj+6f121e7/bafCfxRZChZDRMkwi\n\t1at/a7+Sb+OYNtLXRS2M7FwyTjKT5oiOdnChnuMaT//VXs0J+hNXzQRpSgI9VBNiy1\n\tMcBJZ4gsEULcCZgsYSHlmlkVOWzNaB1roAkYl5+s=","Date":"Tue, 12 Nov 2024 20:43:10 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Nicolas Dufresne <nicolas@ndufresne.ca>","Cc":"Qi Hou <qi.hou@nxp.com>, Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\t\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>, Jared Hu <jared.hu@nxp.com>,\n\tJulien Vuillaumier <julien.vuillaumier@nxp.com>","Subject":"Re: [EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support","Message-ID":"<20241112184310.GI17916@pendragon.ideasonboard.com>","References":"<20241108092113.3769844-1-qi.hou@nxp.com>\n\t<173131741340.3109090.14147718071752655329@ping.linuxembedded.co.uk>\n\t<PAXPR04MB8285C2DC4DD55C092EA0354E97592@PAXPR04MB8285.eurprd04.prod.outlook.com>\n\t<20241112053335.GB5877@pendragon.ideasonboard.com>\n\t<a5b87c25b19259ed93714bd07dbb2cf0794dfdd2.camel@ndufresne.ca>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<a5b87c25b19259ed93714bd07dbb2cf0794dfdd2.camel@ndufresne.ca>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32132,"web_url":"https://patchwork.libcamera.org/comment/32132/","msgid":"<PAXPR04MB8285502064AC5888C32D8F1C975A2@PAXPR04MB8285.eurprd04.prod.outlook.com>","date":"2024-11-13T07:34:12","subject":"RE: [EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support","submitter":{"id":195,"url":"https://patchwork.libcamera.org/api/people/195/","name":"Qi Hou","email":"qi.hou@nxp.com"},"content":"Hi Laurent Pinchart and Nicolas,\n\nThank you both. I have sent out v3 for review. Please correct me if need improvement.\n\nRegards,\nQi Hou\n\n-----Original Message-----\nFrom: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSent: 2024年11月13日 2:43\nTo: Nicolas Dufresne <nicolas@ndufresne.ca>\nCc: Qi Hou <qi.hou@nxp.com>; Kieran Bingham <kieran.bingham@ideasonboard.com>; libcamera-devel@lists.libcamera.org; Jared Hu <jared.hu@nxp.com>; Julien Vuillaumier <julien.vuillaumier@nxp.com>\nSubject: Re: [EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support\n\nCaution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button\n\n\nHi Nicolas,\n\nOn Tue, Nov 12, 2024 at 01:27:12PM -0500, Nicolas Dufresne wrote:\n> Le mardi 12 novembre 2024 à 07:33 +0200, Laurent Pinchart a écrit :\n> > On Tue, Nov 12, 2024 at 02:06:44AM +0000, Qi Hou wrote:\n> > > Hi Kieran,\n> > >\n> > > \"gst_video_format_info_extrapolate_stride\" is defined since\n> > > gstreamer 1.22. I think it causes build fail on old compiler with\n> > > gstreamer version lower than 1.22. Do I need to add\n> > > GST_CHECK_VERSION(1, 22, 0) to uses this function for gstreamer\n> > > version >=1.22.0, and fallback to uses other functions for gstreamer version <1.22.0 ?\n> >\n> > I'd like to keep supporting 1.18 if possible as it's still shipped\n> > by Debian Bullseye. A version check is fine, it will clearly mark\n> > the\n>\n> Fun fact, Debian Bullseye will never be updated to ship a newer GStreamer.\n> Debian never updates major GStreamer version in stable.\n\nI know. I didn't imply they would update.\n\n> Though, it seems very\n> up-to-date on security fixes, which I can see in some of the logs\n> (these are fixes that upstream did not backport and release, because\n> we only go back 2\n> versions):\n>\n> https://meta/\n> data.ftp-master.debian.org%2Fchangelogs%2F%2Fmain%2Fg%2Fgst-plugins-go\n> od1.0%2Fgst-plugins-good1.0_1.18.4-2%2Bdeb11u2_changelog&data=05%7C02%\n> 7Cqi.hou%40nxp.com%7C107b6b68583749d3275608dd0349e0ab%7C686ea1d3bc2b4c\n> 6fa92cd99c5c301635%7C0%7C0%7C638670338070753380%7CUnknown%7CTWFpbGZsb3\n> d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoi\n> TWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=qviS2QbkjVxChmr%2Bf%2BWgcV\n> 13XPhKAduO7RaEumh3Tvg%3D&reserved=0\n>\n> My understanding is that this is EOL 5 years after the .0 release, so\n> in August 2026. Is it your plan to drop it at the time ? Its quite\n> unusable to see libraries keeping backward support for that long. But\n> it would be nice to have this officially stated somewhere.\n\nWe try to support the current and previous versions of major distributions when possible. For Debian, this is also due to using bullseye in CI to test compilation with gcc 9 and gcc 10.\n\n> > backward compatibility code, and allow us to remove it once we'll\n> > bump the minimum GStreamer version.\n>\n> That function only depends on 1.18 internally, so yes, that's an option:\n>\n> #if < 1.22\n>\n> gint\n> gst_video_format_info_extrapolate_stride (const GstVideoFormatInfo * finfo,\n>     gint plane, gint stride)\n> {\n>   gint estride;\n>   gint comp[GST_VIDEO_MAX_COMPONENTS];\n>   gint i;\n>\n>   /* there is nothing to extrapolate on first plane */\n>   if (plane == 0)\n>     return stride;\n>\n>   gst_video_format_info_component (finfo, plane, comp);\n>\n>   /* For now, all planar formats have a single component on first plane, but\n>    * if there was a planar format with more, we'd have to make a ratio of the\n>    * number of component on the first plane against the number of component on\n>    * the current plane. */\n>   estride = 0;\n>   for (i = 0; i < GST_VIDEO_MAX_COMPONENTS && comp[i] >= 0; i++)\n>     estride += GST_VIDEO_FORMAT_INFO_SCALE_WIDTH (finfo, comp[i],\n> stride);\n>\n>   return estride;\n> }\n> #endif\n>\n> Don't forget to refer it and copy over the copyright:\n>\n>\n>  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>\n>  * Library       <2002> Ronald Bultje <rbultje@ronald.bitfreak.net>\n>  * Copyright (C) 2007 David A. Schleef <ds@schleef.org>\n>\n> This code is LGPL V2.\n>\n> > > On 2024年11月11日 17:30, Kieran Bingham wrote:\n> > > > Quoting Hou Qi (2024-11-08 09:21:13)\n> > > > > GStreamer video-info calculated stride and offset may differ\n> > > > > from those used by the camera.\n> > > > >\n> > > > > This patch enhances downstream plugin's support for videometa\n> > > > > by adding videometa support for libcamerasrc. It ensures that\n> > > > > when downstream plugin supports videometa by allocation query,\n> > > > > libcamerasrc also attaches videometa to buffer, preventing\n> > > > > discrepancies between the stride and offset calculated by video-info and camera.\n> > > >\n> > > > Thanks for the v2, this looks like interesting work.\n> > > >\n> > > > Unfortunately the CI isn't clear on this one yet:\n> > > >\n> > > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%25\n> > > > 2Fgitlab.freedesktop.org%2Fcamera%2Flibcamera%2F-%2Fjobs%2F66327\n> > > > 653&data=05%7C02%7Cqi.hou%40nxp.com%7C107b6b68583749d3275608dd03\n> > > > 49e0ab%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638670338070\n> > > > 783724%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwL\n> > > > jAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%\n> > > > 7C%7C%7C&sdata=0YiVVZn3QlJQmdf8YElnAo%2B0flzOC53cjW7HRUQVx5w%3D&\n> > > > reserved=0\n> > > >\n> > > > Any idea what's happening here? It looks like this only failed\n> > > > on one\n> > > > compiler:\n> > > >\n> > > > [443/641] Generating src/py/libcamera/py_gen_formats with a\n> > > > custom command [444/641] Compiling C++ object\n> > > > src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\n> > > > FAILED:\n> > > > src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\n> > > > g++-9 -Isrc/gstreamer/libgstlibcamera.so.p -Isrc/gstreamer\n> > > > g++-I../src/gstreamer -Iinclude -I../include -Iinclude/libcamera\n> > > > g++-I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4\n> > > > g++-I/usr/include/x86_64-linux-gnu -I/usr/include/glib-2.0\n> > > > g++-I/usr/lib/x86_64-linux-gnu/glib-2.0/include\n> > > > g++-fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall\n> > > > g++-Winvalid-pch -Wextra -Werror -std=c++17 -O0 -g\n> > > > g++-Wmissing-declarations -Wshadow -include\n> > > > g++/builds/camera/libcamera/build/config.h -fPIC -pthread '-DVERSION=\"0.3.2+1-edf89091-nvm\"' '-DPACKAGE=\"libcamera\"'\n> > > > g++-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -MD -MQ\n> > > > g++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o -MF\n> > > > g++src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o.d\n> > > > g++-o src/gstreamer/libgstlibcamera.so.p/gstlibcamerapool.cpp.o\n> > > > g++-c ../src/gstreamer/gstlibcamerapool.cpp\n> > > > ../src/gstreamer/gstlibcamerapool.cpp: In function ‘GstLibcameraPool* gst_libcamera_pool_new(GstLibcameraAllocator*, const libcamera::StreamConfiguration&, GstCaps*, gboolean)’:\n> > > > ../src/gstreamer/gstlibcamerapool.cpp:151:13: error: ‘gst_video_format_info_extrapolate_stride’ was not declared in this scope; did you mean ‘gst_video_format_info_component’?\n> > > >   151 |    stride = gst_video_format_info_extrapolate_stride(info.finfo, k, stream_cfg.stride);\n> > > >       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n> > > >       |             gst_video_format_info_component\n> > > > [445/641] Compiling C++ object\n> > > > src/apps/qcam/qcam.p/viewfinder_qt.cpp.o\n> > > >\n> > > > So perhaps we're hitting a requirement to have a specific gstreamer version that isn't being catered for ?\n> > > >\n> > > > --\n> > > > Kieran\n> > > >\n> > > > > Signed-off-by: Hou Qi <qi.hou@nxp.com>\n> > > > > ---\n> > > > >  src/gstreamer/gstlibcamerapool.cpp | 28 ++++++++++++++++++++++++----\n> > > > >  src/gstreamer/gstlibcamerapool.h   |  2 +-\n> > > > >  src/gstreamer/gstlibcamerasrc.cpp  | 14 +++++++++++++-\n> > > > >  3 files changed, 38 insertions(+), 6 deletions(-)\n> > > > >\n> > > > > diff --git a/src/gstreamer/gstlibcamerapool.cpp\n> > > > > b/src/gstreamer/gstlibcamerapool.cpp\n> > > > > index 9cd7eccb..6593b3ca 100644\n> > > > > --- a/src/gstreamer/gstlibcamerapool.cpp\n> > > > > +++ b/src/gstreamer/gstlibcamerapool.cpp\n> > > > > @@ -135,16 +135,36 @@\n> > > > > gst_libcamera_pool_class_init(GstLibcameraPoolClass *klass)  }\n> > > > >\n> > > > >  GstLibcameraPool *\n> > > > > -gst_libcamera_pool_new(GstLibcameraAllocator *allocator,\n> > > > > Stream *stream)\n> > > > > +gst_libcamera_pool_new(GstLibcameraAllocator *allocator, const StreamConfiguration &stream_cfg,\n> > > > > +                      GstCaps *caps, gboolean add_video_meta)\n> > > > >  {\n> > > > >         auto *pool =\n> > > > > GST_LIBCAMERA_POOL(g_object_new(GST_TYPE_LIBCAMERA_POOL,\n> > > > > nullptr));\n> > > > > +       GstVideoInfo info;\n> > > > >\n> > > > >         pool->allocator = GST_LIBCAMERA_ALLOCATOR(g_object_ref(allocator));\n> > > > > -       pool->stream = stream;\n> > > > > -\n> > > > > -       gsize pool_size = gst_libcamera_allocator_get_pool_size(allocator, stream);\n> > > > > +       pool->stream = stream_cfg.stream();\n> > > > > +\n> > > > > +       if (caps && gst_video_info_from_caps(&info, caps)) {\n> > > > > +               guint k, stride;\n> > > > > +               gsize offset = 0;\n> > > > > +               for (k = 0; k < GST_VIDEO_INFO_N_PLANES(&info); k++) {\n> > > > > +                       stride = gst_video_format_info_extrapolate_stride(info.finfo, k, stream_cfg.stride);\n> > > > > +                       info.stride[k] = stride;\n> > > > > +                       info.offset[k] = offset;\n> > > > > +                       offset += stride * GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT(info.finfo, k, GST_VIDEO_INFO_HEIGHT(&info));\n> > > > > +               }\n> > > > > +       } else\n> > > > > +               add_video_meta = false;\n\nI think there are a few coding style issues that checkstyle.py could have caught. See https://libcamera.org/coding-style.html#tools for more information, especially the last paragraph that explains how to use the git commit hook.\n\n> > > > > +\n> > > > > +       gsize pool_size =\n> > > > > + gst_libcamera_allocator_get_pool_size(allocator,\n> > > > > + stream_cfg.stream());\n> > > > >         for (gsize i = 0; i < pool_size; i++) {\n> > > > >                 GstBuffer *buffer = gst_buffer_new();\n> > > > > +               if (add_video_meta) {\n> > > > > +                       gst_buffer_add_video_meta_full(buffer, GST_VIDEO_FRAME_FLAG_NONE,\n> > > > > +                                                      GST_VIDEO_INFO_FORMAT(&info), GST_VIDEO_INFO_WIDTH(&info),\n> > > > > +                                                      GST_VIDEO_INFO_HEIGHT(&info), GST_VIDEO_INFO_N_PLANES(&info),\n> > > > > +                                                      info.offset, info.stride);\n> > > > > +               }\n> > > > >                 pool->queue->push_back(buffer);\n> > > > >         }\n> > > > >\n> > > > > diff --git a/src/gstreamer/gstlibcamerapool.h\n> > > > > b/src/gstreamer/gstlibcamerapool.h\n> > > > > index 2a7a9c77..8ad87cab 100644\n> > > > > --- a/src/gstreamer/gstlibcamerapool.h\n> > > > > +++ b/src/gstreamer/gstlibcamerapool.h\n> > > > > @@ -21,7 +21,7 @@\n> > > > >  G_DECLARE_FINAL_TYPE(GstLibcameraPool, gst_libcamera_pool,\n> > > > > GST_LIBCAMERA, POOL, GstBufferPool)\n> > > > >\n> > > > >  GstLibcameraPool *gst_libcamera_pool_new(GstLibcameraAllocator *allocator,\n> > > > > -                                        libcamera::Stream *stream);\n> > > > > +                                        const\n> > > > > + libcamera::StreamConfiguration &stream_cfg, GstCaps *caps,\n> > > > > + gboolean add_video_meta);\n> > > > >\n> > > > >  libcamera::Stream\n> > > > > *gst_libcamera_pool_get_stream(GstLibcameraPool *self);\n> > > > >\n> > > > > diff --git a/src/gstreamer/gstlibcamerasrc.cpp\n> > > > > b/src/gstreamer/gstlibcamerasrc.cpp\n> > > > > index 8efa25f4..c05a31e7 100644\n> > > > > --- a/src/gstreamer/gstlibcamerasrc.cpp\n> > > > > +++ b/src/gstreamer/gstlibcamerasrc.cpp\n> > > > > @@ -497,9 +497,21 @@ gst_libcamera_src_negotiate(GstLibcameraSrc *self)\n> > > > >         for (gsize i = 0; i < state->srcpads_.size(); i++) {\n> > > > >                 GstPad *srcpad = state->srcpads_[i];\n> > > > >                 const StreamConfiguration &stream_cfg =\n> > > > > state->config_->at(i);\n> > > > > +               GstQuery *query = NULL;\n> > > > > +               gboolean add_video_meta = false;\n> > > > > +\n> > > > > +               g_autoptr(GstCaps) caps = gst_libcamera_stream_configuration_to_caps(stream_cfg);\n> > > > > +               gst_libcamera_framerate_to_caps(caps,\n> > > > > + element_caps);\n> > > > > +\n> > > > > +               query = gst_query_new_allocation(caps, false);\n> > > > > +               if (!gst_pad_peer_query(srcpad, query))\n> > > > > +                       GST_DEBUG_OBJECT(self, \"didn't get downstream ALLOCATION hints\");\n> > > > > +               else\n> > > > > +                       add_video_meta = gst_query_find_allocation_meta(query, GST_VIDEO_META_API_TYPE, NULL);\n> > > > > +               gst_query_unref(query);\n> > > > >\n> > > > >                 GstLibcameraPool *pool = gst_libcamera_pool_new(self->allocator,\n> > > > > -                                                               stream_cfg.stream());\n> > > > > +\n> > > > > + stream_cfg, caps, add_video_meta);\n> > > > >                 g_signal_connect_swapped(pool, \"buffer-notify\",\n> > > > >\n> > > > > G_CALLBACK(gst_task_resume), self->task);\n> > > > >\n\n--\nRegards,\n\nLaurent Pinchart","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 822F2BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 13 Nov 2024 07:34:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7C70665800;\n\tWed, 13 Nov 2024 08:34:17 +0100 (CET)","from EUR05-VI1-obe.outbound.protection.outlook.com\n\t(mail-vi1eur05on2061f.outbound.protection.outlook.com\n\t[IPv6:2a01:111:f403:2613::61f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 69245657FF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Nov 2024 08:34:16 +0100 (CET)","from PAXPR04MB8285.eurprd04.prod.outlook.com\n\t(2603:10a6:102:1ca::15)\n\tby AS8PR04MB8499.eurprd04.prod.outlook.com (2603:10a6:20b:342::15)\n\twith Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17;\n\tWed, 13 Nov 2024 07:34:12 +0000","from PAXPR04MB8285.eurprd04.prod.outlook.com\n\t([fe80::e003:8fb:64ea:acfd]) by\n\tPAXPR04MB8285.eurprd04.prod.outlook.com\n\t([fe80::e003:8fb:64ea:acfd%3]) with mapi id 15.20.8158.013;\n\tWed, 13 Nov 2024 07:34:12 +0000"],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"iWtmSvg7\";\n\tdkim-atps=neutral","dkim=none (message not signed)\n\theader.d=none;dmarc=none action=none header.from=nxp.com;"],"ARC-Seal":"i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n\tb=SSbicQpP4CeDfE2GyHlJhQ5Kex93Oe4/W0ZeylLxbQtEVNjnB7lOIek9YptQaCJ718wD5I+V86jWdXiXYena9CBsYIE9UlEblBd6AH4BA0FnjPJ+NGbsOdVdPWW/NTMZNNXSUS60pQOA75IERNP1VUUyQlrYmmCteHprmvQyqeaRJHmLlUcDJVj3/dZsQ4N8JVc5JqptNHJP+VrXsntvNoRK6JbYGKWZSryPyg2svzd0zHJUo3dlt2RBm4HvqQWABwgvmzntJUu+YV5hiluc6pA+LTjz6k7PPGXoMO+LTxwuGLa+eE4ILJMnGGMbZEObtC8ZcTJBNL6v2xdyl0MqgQ==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n\ts=arcselector10001;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n\tbh=1btjjA9B7YB9BDnIRctAf3sdqrDxvcJEm7TXdzQu6mI=;\n\tb=wpOxE0ExOgCPEy3WqhlzcIqg/pDJIGX/ubZSi14vVwacNIWoCbg8ReiswfAU7pCvJh7WJGkk11BeMrS5HBBV5ZgJcLA6rOFHEzcKHNcr8wTb96FJ0mFWR5Ca/X2Yr53DyQzoUtZrTQ5llzcBtlc3+ajq8hNiKYD47wblsEGlfAf+5C1Jj1XwXDdO/O6Gkhrt446aghQKXAZD4EetVdhZjDjIzkaWJ7Xm91ON/wExKzCE41asRhTD4AuEGJVh/jeNkqA8VhuOmhN8fTyu0iEMgwMPee/dXIty2ePvEjYrQwHrUljFslr28cmvK/J/EWxqHFBmcs8Si+cLp9ZKcwVpBA==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass\n\tsmtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com;\n\tdkim=pass header.d=nxp.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=1btjjA9B7YB9BDnIRctAf3sdqrDxvcJEm7TXdzQu6mI=;\n\tb=iWtmSvg7jyWuxR292Q3OQcoVrdLaRRNe+AD4jvJzd+0dsB5BT6j0yKVSFWXh1UPH35L63qNwXUhKr6fD0psSAv34Xq7c41MBRT0xK9bA2s543o1FfHgtdgInVqhLNE3bGDVTgQGulMKU5Eu+Ogeh3jtPRtC6lWUUwhi7p7W29hams+/YEnDYmkWnuGOcPERaBnU3EnZy4ClN0WX/LsRi348t1Qrijc8opKu24Z+hzzi/X0T42ciudi1NFtOKoazP9xbY8v2lvAXWxb0Qw1JMHq54wDATPuC0coPMueyEMni3CShoCKnEbsl+e8Ed5R5hHy/yuZYeUGS5utvoM+h8dA==","From":"Qi Hou <qi.hou@nxp.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Nicolas Dufresne\n\t<nicolas@ndufresne.ca>","CC":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\t\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>, Jared Hu <jared.hu@nxp.com>,\n\tJulien Vuillaumier <julien.vuillaumier@nxp.com>","Subject":"RE: [EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support","Thread-Topic":"[EXT] Re: [PATCH v2] gstreamer: Add GstVideoMeta support","Thread-Index":"AQHbMb+W/Xm+cWvMKEmN7I73I8j/QbKx1R+AgAET1cCAADxigIAA2CYAgAAEdgCAANZ+QA==","Date":"Wed, 13 Nov 2024 07:34:12 +0000","Message-ID":"<PAXPR04MB8285502064AC5888C32D8F1C975A2@PAXPR04MB8285.eurprd04.prod.outlook.com>","References":"<20241108092113.3769844-1-qi.hou@nxp.com>\n\t<173131741340.3109090.14147718071752655329@ping.linuxembedded.co.uk>\n\t<PAXPR04MB8285C2DC4DD55C092EA0354E97592@PAXPR04MB8285.eurprd04.prod.outlook.com>\n\t<20241112053335.GB5877@pendragon.ideasonboard.com>\n\t<a5b87c25b19259ed93714bd07dbb2cf0794dfdd2.camel@ndufresne.ca>\n\t<20241112184310.GI17916@pendragon.ideasonboard.com>","In-Reply-To":"<20241112184310.GI17916@pendragon.ideasonboard.com>","Accept-Language":"zh-CN, en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"iWtmSvg7\";\n\tdkim-atps=neutral","dkim=none (message not signed)\n\theader.d=none;dmarc=none action=none header.from=nxp.com;"],"x-ms-publictraffictype":"Email","x-ms-traffictypediagnostic":"PAXPR04MB8285:EE_|AS8PR04MB8499:EE_","x-ms-office365-filtering-correlation-id":"d7a2135c-64a3-4283-d29f-08dd03b591da","x-ld-processed":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr","x-ms-exchange-senderadcheck":"1","x-ms-exchange-antispam-relay":"0","x-microsoft-antispam":"BCL:0;\n\tARA:13230040|1800799024|376014|366016|38070700018; ","x-microsoft-antispam-message-info":"=?gb2312?b?QURxZVB4NmNKcmxXVFBLV3JN?=\n\t=?gb2312?b?ak9NOFNPREZGZEdDYURTR0swcjg4UHdqUVEyWnBidnZqYlI4M3RJ?=\n\t=?gb2312?b?bXNzNmlwS3J6eTZsMHRFbk0xQnE0ODdBTmhkNWdSbmJCR242dzhS?=\n\t=?gb2312?b?dW44SVpwSGgxemtTMk9xM3NzeEVlWTNkeXNkdklVRnc1RHR3WTRZ?=\n\t=?gb2312?b?Z1JUbDNpcEpCRVRiRTVxUzB6Q0RTZlRKbVNiLzduSENqR3JoK2Fz?=\n\t=?gb2312?b?Q0p1cnFFaHVsWEE0Y0xZK3lRRHBhcHNDcTBrMFBsNnNKcGlLdFJi?=\n\t=?gb2312?b?MDlORXFUNUF5Uk9IZm1MTXFhUkU5eDJZTFFPQWFMdFFXK3p0Q2Fr?=\n\t=?gb2312?b?TWlER1Fnbk5HZzZqb24yNkJGdjZPcHRCVysvSmQyajdtU3FiYUtP?=\n\t=?gb2312?b?NmJpTnlnSndyd0hMWjI0dFh6V3doSUh1Z3BOdnBXZ1hsakliRW5Q?=\n\t=?gb2312?b?K2pGTitvQ3ZBTVMwOEsrak1FdDVWSnZiR3pnUUgrdGpNZUVUMGM4?=\n\t=?gb2312?b?eENFYmpOUzA3Q2tTYk9MMkc2c0RwRnZqTW0xckQxamJTemY5d3Vt?=\n\t=?gb2312?b?QzR0UCt6R05XTUMrRFNaZHFZYW1sVEtWNlJIbVpRejZkZmRoS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ESW45Q1orNlZEckVYQklxakl1TzJMMklDblRr?=\n\t=?gb2312?b?alJKNEVXaEVZOSsxZjBBSWRxaG1DMm40UHB4dDNrZUZqL1FuUXZX?=\n\t=?gb2312?b?cWlUazlveG1qa0JqZDE1VnRJYUxlV09kN1lvbkVnaUh4SjArdWZQ?=\n\t=?gb2312?b?bDRIVGVOWTJaYTRCTCtJVlB5MVlBTkZYbmI0c1IvcW5raXZJL0hz?=\n\t=?gb2312?b?UG5LcGIvVnpVOE5WZk1Ebmt0RG1QemNYZGwrWGtTMHlQSWgzalJx?=\n\t=?gb2312?b?MER0QkxCMjlidGdkTFhOR3JoOEZLN1Rldi9PUUZ2NzBFT1l4bGc5?=\n\t=?gb2312?b?VTRMZ0xvM1ZmNEFRNVpjZnNaTVB3bTJMOWZqdmplVDVuWTFBMzJq?=\n\t=?gb2312?b?ZEtoS29rZDZ6RzQxSUY4akcvSVhVaXIwUERsNjFYV3B2d3FTZzRq?=","x-forefront-antispam-report":"CIP:255.255.255.255; CTRY:; LANG:zh-cn; SCL:1; \n\tSRV:; IPV:NLI; SFV:NSPM;\n\tH:PAXPR04MB8285.eurprd04.prod.outlook.com; PTR:; \n\tCAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(38070700018);\n\tDIR:OUT; SFP:1101; ","x-ms-exchange-antispam-messagedata-chunkcount":"1","x-ms-exchange-antispam-messagedata-0":"=?gb2312?b?TmpXcDd1eG56cmg4SEhEUExI?=\n\t=?gb2312?b?U3ltdVVVcEZEYzV0YWpnTVRNMjdXc0hBYXQrdFArUi82YzlQN242?=\n\t=?gb2312?b?NEU0UCtueW9iUFV3Y1Z6bmJSL2lsckJlbEZQOVBUUUFISU9LQXRS?=\n\t=?gb2312?b?TGZWMjRmUVBtQ0lVYi9JL3pXbnQrR2g3K2VJMThQZjIydlhacVpn?=\n\t=?gb2312?b?R2ExUUpGYmR5NkpCSVcrWWt5Y0pvSG1FZG11SkhJdk5ZNjdzQytE?=\n\t=?gb2312?b?bU45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4Vk4zQkl0L2NpbkdzWmJxWDdDTk1JWktF?=\n\t=?gb2312?b?K1JNRCtHQUZodEJNRHpkUUNYUjBjaG54RnZSRlNWbWFoTTFBc25R?=\n\t=?gb2312?b?d0NFRDNaNE1pWVlkVXBqRXp2L2N0VlpnMllLNEo2TWM3MXZuUVQ4?=\n\t=?gb2312?b?YmErWDlsenZDT1FkUFc4aVhKdEN1SVFxTDRqRnhvMzdDbXdvcXlS?=\n\t=?gb2312?b?elZrRHJOOUpubWFjbjBveGpVT1FHejQ3ZmRUOFl1bVRUdVNNQkpX?=\n\t=?gb2312?b?cz0=?=","Content-Type":"text/plain; charset=\"gb2312\"","Content-Transfer-Encoding":"base64","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-AuthSource":"PAXPR04MB8285.eurprd04.prod.outlook.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"d7a2135c-64a3-4283-d29f-08dd03b591da","X-MS-Exchange-CrossTenant-originalarrivaltime":"13 Nov 2024 07:34:12.7155\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-CrossTenant-mailboxtype":"HOSTED","X-MS-Exchange-CrossTenant-userprincipalname":"hb1+df/cSWEkNxk+eHGAT22M41IKn5qxoqh+nBSWLq1WZhn3/FOMsD1829/hIcLo","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"AS8PR04MB8499","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]