[libcamera-devel,RFC,v1,0/2] MediaDevice enumeration helper
mbox series

Message ID 20220113102529.3163441-1-naush@raspberrypi.com
Headers show
Series
  • MediaDevice enumeration helper
Related show

Message

Naushir Patuck Jan. 13, 2022, 10:25 a.m. UTC
Hi,

As discussed some time back, I've created a helper to enumerate media device
topologies so we don't have to implement similar functions in each pipeline
handler.

Patch 1 adds a MediaDevice::enumerateMediaWalks() helper function that does
the enumeration and returns a vector of "MediaWalks" which pipeline handlers
may use to configure the media device topology.  Patch 2 updates the RPi pipeline
handler to use this helper and remove the existing media device enumeration code.

I'm sure this may need to be tweaked for use in other pipeline handlers, and
getting feedback on this would be useful.  The Simple pipeline handler is an
obvious candidate, and after having a brief look through the code, I think the
helper introduced here could simplify the Simple(!) pipeline handler as well.
However, before committing to changing that code over, I wanted to ensure I was
on the right path, and I don't have any means to test any of these changes on
other platforms.

Thanks,
Naush

Naushir Patuck (2):
  libcamera: media_device: Add enumerateMediaWalks() helper
  pipeline: raspberrypi: Use MediaDevice::enumerateMediaWalks()

 include/libcamera/internal/media_device.h     |  12 ++
 src/libcamera/media_device.cpp                | 135 +++++++++++++++++
 .../pipeline/raspberrypi/raspberrypi.cpp      | 142 ++++--------------
 3 files changed, 179 insertions(+), 110 deletions(-)