[libcamera-devel,00/10] Rework request completion handling
mbox series

Message ID 20190228162913.6508-1-laurent.pinchart@ideasonboard.com
Headers show
Series
  • Rework request completion handling
Related show

Message

Laurent Pinchart Feb. 28, 2019, 4:29 p.m. UTC
Hello,

This patch series reworks request completion handling to make it
explicitly handled by pipeline handlers. The main reason for this is to
guarantee that requests will complete in the order they're queued, while
giving an option to pipeline handlers to delay request completion until
all metadata is available.

Patch 01/10 fixes a double release of media devices in pipeline
handlers. Patches 02/10 to 06/10 make pipeline-specific camera data
mandatory in pipeline handlers in order to simplify the API and store
more information in the base CameraData class. Patches 07/10 and 08/10
then add buffer and request completion status support, and patch 09/10
performs the bulk of the request completion handling rework. Finally
patch 10/10 prevents requeuing requests when the stream stops in the cam
application.

This series fixes leak of allocated requests that are not freed at
stream stop time, leaving only two memory leaks in the cam application
that are due to libudev.

Laurent Pinchart (10):
  libcamera: pipeline: Fix double release of media devices
  libcamera: pipeline: uvcvideo: Create UVCCameraData
  libcamera: pipeline: vimc: Create VimcCameraData
  libcamera: pipeline_handler: Pass a non-const Camera to methods
  libcamera: pipeline_handler: Store pipe and camera in CameraData
  libcamera: pipeline_handler: Make pipeline-specific data mandatory
  libcamera: buffer: Add buffer completion status
  libcamera: request: Add request completion status
  libcamera: Handle request completion explicitly in pipeline handlers
  cam: Don't requeue requests when stopping stream

 include/libcamera/buffer.h               |  15 +-
 include/libcamera/camera.h               |   3 +
 include/libcamera/request.h              |  16 ++-
 src/cam/main.cpp                         |   3 +
 src/libcamera/buffer.cpp                 |  40 +++++-
 src/libcamera/camera.cpp                 |  21 +++
 src/libcamera/include/pipeline_handler.h |  25 +++-
 src/libcamera/pipeline/ipu3/ipu3.cpp     |  70 +++++----
 src/libcamera/pipeline/uvcvideo.cpp      | 105 ++++++++++----
 src/libcamera/pipeline/vimc.cpp          | 102 ++++++++++----
 src/libcamera/pipeline_handler.cpp       | 172 ++++++++++++++++++-----
 src/libcamera/request.cpp                |  66 ++++++---
 src/libcamera/v4l2_device.cpp            |   5 +-
 13 files changed, 483 insertions(+), 160 deletions(-)