summaryrefslogtreecommitdiff
path: root/test/utils.cpp
AgeCommit message (Expand)Author
2021-09-07libcamera: base: utils: Use size_t for index in utils::enumerate()Laurent Pinchart
2021-06-25libcamera/base: Move span to base libraryKieran Bingham
2021-06-25libcamera/base: Move utils to the base libraryKieran Bingham
2021-06-08libcamera: utils: Add helper class for std::chrono::durationNaushir Patuck
2021-05-18libcamera: utils: Add enumerate view for range-based for loopsLaurent Pinchart
2020-08-03libcamera: utils: Add alignUp and alignDown functionsJacopo Mondi
2020-07-09libcamera: utils: Add map_keys() functionLaurent Pinchart
2020-05-16libcamera: Move internal headers to include/libcamera/internal/Laurent Pinchart
2020-04-15libcamera: utils: Add string join functionLaurent Pinchart
2020-02-24libcamera: utils: Add a C++ dirname implementationKieran Bingham
2020-02-13test: Add a utils::split() testLaurent Pinchart
2019-10-15libcamera: utils: Add hex stream output helperLaurent Pinchart
/span> * Author: Nicolas Dufresne <nicolas.dufresne@collabora.com> * * gstlibcamera-utils.h - GStreamer libcamera Utility Functions */ #pragma once #include <libcamera/camera_manager.h> #include <libcamera/controls.h> #include <libcamera/stream.h> #include <gst/gst.h> #include <gst/video/video.h> GstCaps *gst_libcamera_stream_formats_to_caps(const libcamera::StreamFormats &formats); GstCaps *gst_libcamera_stream_configuration_to_caps(const libcamera::StreamConfiguration &stream_cfg); void gst_libcamera_configure_stream_from_caps(libcamera::StreamConfiguration &stream_cfg, GstCaps *caps); void gst_libcamera_get_framerate_from_caps(GstCaps *caps, GstStructure *element_caps); void gst_libcamera_clamp_and_set_frameduration(libcamera::ControlList &controls, const libcamera::ControlInfoMap &camera_controls, GstStructure *element_caps); void gst_libcamera_framerate_to_caps(GstCaps *caps, const GstStructure *element_caps); #if !GST_CHECK_VERSION(1, 17, 1) gboolean gst_task_resume(GstTask *task); #endif std::shared_ptr<libcamera::CameraManager> gst_libcamera_get_camera_manager(int &ret); /** * \class GLibLocker * \brief A simple scoped mutex locker for GMutex */ class GLibLocker { public: GLibLocker(GMutex *mutex) : mutex_(mutex) { g_mutex_lock(mutex_); } GLibLocker(GstObject *object) : mutex_(GST_OBJECT_GET_LOCK(object)) { g_mutex_lock(mutex_); } ~GLibLocker() { g_mutex_unlock(mutex_); } private: GMutex *mutex_; }; /** * \class GLibRecLocker * \brief A simple scoped mutex locker for GRecMutex */ class GLibRecLocker { public: GLibRecLocker(GRecMutex *mutex) : mutex_(mutex) { g_rec_mutex_lock(mutex_); } ~GLibRecLocker() { g_rec_mutex_unlock(mutex_); } private: GRecMutex *mutex_; };