summaryrefslogtreecommitdiff
path: root/include/linux
AgeCommit message (Expand)Author
2021-11-02include: drm_fourcc: Add R10 and R12 FourCCLaurent Pinchart
2021-10-06ipa: ipu3: Replace ipa::ipu3::algorithms::Ipu3AwbCellJean-Michel Hautbois
2021-03-03include: linux: Update Linux headers to v5.12-rc1Laurent Pinchart
2021-02-09uapi: raspberrypi: Update the bcm2835-isp header definitionNaushir Patuck
2021-02-05include: linux: Add ipu3 kernel header and format definitionsNiklas Söderlund
2020-10-19include: linux: Update V4L2_CID_USER_BCM2835_ISP_BASE to match upstream treeNaushir Patuck
2020-09-29include: linux: Update rkisp1 headerNiklas Söderlund
2020-07-27include: drm_fourcc: Add 16-bit Bayer FourCCNiklas Söderlund
2020-07-17libcamera: pipeline: ipa: raspberrypi: Use dma heap allocs for LS tablesNaushir Patuck
2020-07-17include: linux: Add dma-buf.h and dma-heap.h UAPI headersNaushir Patuck
2020-06-18include: linux: Remove drm.h and drm_mode.hLaurent Pinchart
2020-06-09libcamera: Add missing SPDX headers to miscellaneous small filesLaurent Pinchart
2020-05-21include: linux: Update v4l2 ctrls for propertiesJacopo Mondi
2020-05-11include: uapi: Add header definitions for BCM2835 Unicam and ISP blocksNaushir Patuck
2020-05-10include: linux: Extend VIDIOC_ENUM_FMT to support MC-centric devicesLaurent Pinchart
2020-03-27include: drm_fourcc: Add Bayer FourCC and modifiersNiklas Söderlund
2020-02-14include: linux: Update v4l2-controls.hJacopo Mondi
2019-12-08include: linux: Update Linux headers readme to v5.2Paul Elder
2019-10-28include: drm_fourcc: Add Motion-JPEG FourCCJacopo Mondi
2019-10-28include: linux: Import DRM/KMS headers from Linux v5.2Jacopo Mondi
2019-10-28include: linux: Update headers to Linux v5.2Jacopo Mondi
2019-10-11include: linux: Add rkisp1 kernel header and format definitionsNiklas Söderlund
2019-06-02include: linux: Update Linux headers to v5.1Jacopo Mondi
2019-01-17include: linux: Import V4L2 uAPI headers from Linux v4.19Kieran Bingham
2018-12-19libcamera: include: Import media.h from Linux v4.19Jacopo Mondi
NE_TYPE(GstLibcameraPool, gst_libcamera_pool, GST_TYPE_BUFFER_POOL) static GstFlowReturn gst_libcamera_pool_acquire_buffer(GstBufferPool *pool, GstBuffer **buffer, [[maybe_unused]] GstBufferPoolAcquireParams *params) { GstLibcameraPool *self = GST_LIBCAMERA_POOL(pool); GstBuffer *buf = GST_BUFFER(gst_atomic_queue_pop(self->queue)); if (!buf) return GST_FLOW_ERROR; if (!gst_libcamera_allocator_prepare_buffer(self->allocator, self->stream, buf)) { gst_atomic_queue_push(self->queue, buf); return GST_FLOW_ERROR; } *buffer = buf; return GST_FLOW_OK; } static void gst_libcamera_pool_reset_buffer(GstBufferPool *pool, GstBuffer *buffer) { GstBufferPoolClass *klass = GST_BUFFER_POOL_CLASS(gst_libcamera_pool_parent_class); /* Clears all the memories and only pool the GstBuffer objects */ gst_buffer_remove_all_memory(buffer); klass->reset_buffer(pool, buffer); GST_BUFFER_FLAGS(buffer) = 0; } static void gst_libcamera_pool_release_buffer(GstBufferPool *pool, GstBuffer *buffer) { GstLibcameraPool *self = GST_LIBCAMERA_POOL(pool); bool do_notify = gst_atomic_queue_length(self->queue) == 0; gst_atomic_queue_push(self->queue, buffer); if (do_notify) g_signal_emit(self, signals[SIGNAL_BUFFER_NOTIFY], 0); } static void gst_libcamera_pool_init(GstLibcameraPool *self) { self->queue = gst_atomic_queue_new(4); } static void gst_libcamera_pool_finalize(GObject *object) { GstLibcameraPool *self = GST_LIBCAMERA_POOL(object); GstBuffer *buf; while ((buf = GST_BUFFER(gst_atomic_queue_pop(self->queue)))) gst_buffer_unref(buf); gst_atomic_queue_unref(self->queue); g_object_unref(self->allocator); G_OBJECT_CLASS(gst_libcamera_pool_parent_class)->finalize(object); } static void gst_libcamera_pool_class_init(GstLibcameraPoolClass *klass) { auto *object_class = G_OBJECT_CLASS(klass); auto *pool_class = GST_BUFFER_POOL_CLASS(klass); object_class->finalize = gst_libcamera_pool_finalize; pool_class->start = nullptr; pool_class->acquire_buffer = gst_libcamera_pool_acquire_buffer; pool_class->reset_buffer = gst_libcamera_pool_reset_buffer; pool_class->release_buffer = gst_libcamera_pool_release_buffer; signals[SIGNAL_BUFFER_NOTIFY] = g_signal_new("buffer-notify", G_OBJECT_CLASS_TYPE(klass), G_SIGNAL_RUN_LAST, 0, nullptr, nullptr, nullptr, G_TYPE_NONE, 0); } GstLibcameraPool * gst_libcamera_pool_new(GstLibcameraAllocator *allocator, Stream *stream) { auto *pool = GST_LIBCAMERA_POOL(g_object_new(GST_TYPE_LIBCAMERA_POOL, nullptr)); pool->allocator = GST_LIBCAMERA_ALLOCATOR(g_object_ref(allocator)); pool->stream = stream; gsize pool_size = gst_libcamera_allocator_get_pool_size(allocator, stream); for (gsize i = 0; i < pool_size; i++) { GstBuffer *buffer = gst_buffer_new(); gst_atomic_queue_push(pool->queue, buffer); } return pool; } Stream * gst_libcamera_pool_get_stream(GstLibcameraPool *self) { return self->stream; } FrameBuffer * gst_libcamera_buffer_get_frame_buffer(GstBuffer *buffer) { GstMemory *mem = gst_buffer_peek_memory(buffer, 0); return gst_libcamera_memory_get_frame_buffer(mem); }