[libcamera-devel,0/2] Add MediaDevice and associated MediaObjects

Message ID 1545324285-16730-1-git-send-email-jacopo@jmondi.org
Headers show
Series
  • Add MediaDevice and associated MediaObjects
Related show

Message

Jacopo Mondi Dec. 20, 2018, 4:44 p.m. UTC
Hello,
   this two patches add a class hierarcy to represent the media device objects
registered in a media graph.

The first patch adds the hierarcy used to represent media entities, pads and
links, while the second one adds a class that handles the media graph making
use of the here introduced MediaObjects.

The MediaDevice class allows enumerations of all media objects in the media
graph and supports handling of pad-2-pad links.

This classes will be used by pipeline managers to setup the media graph
for the selected use case, and they've been tested with a sketched pipeline
manager targetting Intel's IPU3 platforms.

As of now, the media device depends on receiving a static map that associates
each entity with its video subdevice path. This might be modified once a media
enumerator is available, and will provide said map by inspecting what's
available in the system.

For this reason, I have a unit test I'm not sharing yet as it needs to
hardcode the entity-path map for the platform I'm currently developing for.

As a minor side note: comments. This code is over-commented, I know. I don't
think that's a bad thing in general, but as this aims to be the reference
implementation, I felt like it was worth commenting everything I could.
We decided to comment as much as we can in the .cpp file, to keep headers
simple and clean. I still tend to agree with this, but I'm open to discuss it
if necessary.

Thanks
   j

Jacopo Mondi (2):
  libcamera: Add MediaObject class hierarchy
  libcamera: Add MediaDevice class

 src/libcamera/include/media_device.h |  72 +++++
 src/libcamera/include/media_object.h | 119 +++++++
 src/libcamera/media_device.cpp       | 603 +++++++++++++++++++++++++++++++++++
 src/libcamera/media_object.cpp       | 302 ++++++++++++++++++
 src/libcamera/meson.build            |   2 +
 5 files changed, 1098 insertions(+)
 create mode 100644 src/libcamera/include/media_device.h
 create mode 100644 src/libcamera/include/media_object.h
 create mode 100644 src/libcamera/media_device.cpp
 create mode 100644 src/libcamera/media_object.cpp

--
2.7.4