[libcamera-devel] [RFC PATCH] gstreamer: Drop libcamera_private dependency

Barnabás Pőcze pobrn at protonmail.com
Mon Jun 26 23:52:18 CEST 2023


Hi


2023. június 26., hétfő 23:17 keltezéssel, Umang Jain via libcamera-devel <libcamera-devel at lists.libcamera.org> írta:

> Drop libcamera_private dependency entirely as to avoid libcamerasrc
> getting more dependent on it. In order to achieve that, one of the
> mutex locks in GstLibcameraSrcState needs to be replaced with GMutex.
> 
> However doing so, this won't let us to use the clang's thread annotation
> macros in libcamera (which should be fine as libcamerasrc would move
> out of libcamera repo once matured).
> 
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
>  src/gstreamer/gstlibcamerasrc.cpp | 20 ++++++++------------
>  src/gstreamer/meson.build         |  2 +-
>  2 files changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
> index 11f15068..fda5610f 100644
> --- a/src/gstreamer/gstlibcamerasrc.cpp
> +++ b/src/gstreamer/gstlibcamerasrc.cpp
> @@ -32,8 +32,6 @@
>  #include <queue>
>  #include <vector>
> 
> -#include <libcamera/base/mutex.h>
> -
>  #include <libcamera/camera.h>
>  #include <libcamera/camera_manager.h>
>  #include <libcamera/control_ids.h>
> @@ -125,11 +123,9 @@ struct GstLibcameraSrcState {
>  	 * be held while calling into other graph elements (e.g. when calling
>  	 * gst_pad_query()).
>  	 */
> -	Mutex lock_;
> -	std::queue<std::unique_ptr<RequestWrap>> queuedRequests_
> -		LIBCAMERA_TSA_GUARDED_BY(lock_);
> -	std::queue<std::unique_ptr<RequestWrap>> completedRequests_
> -		LIBCAMERA_TSA_GUARDED_BY(lock_);
> +	GMutex lock_;
> [...]

Shouldn't this be initialized? i.e. `g_mutex_init()`?


Regards,
Barnabás Pőcze


More information about the libcamera-devel mailing list