mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-26 18:15:06 +03:00
Provide a MediaPipeline class to help identifing and managing pipelines across a MediaDevice graph. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
59 lines
1.2 KiB
C++
59 lines
1.2 KiB
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2024, Ideas on Board Oy
|
|
*
|
|
* Media pipeline support
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <list>
|
|
#include <string>
|
|
|
|
#include <libcamera/base/log.h>
|
|
|
|
namespace libcamera {
|
|
|
|
class CameraSensor;
|
|
class MediaEntity;
|
|
class MediaLink;
|
|
class MediaPad;
|
|
struct V4L2SubdeviceFormat;
|
|
|
|
class MediaPipeline
|
|
{
|
|
public:
|
|
int init(MediaEntity *source, std::string_view sink);
|
|
int initLinks();
|
|
int configure(CameraSensor *sensor, V4L2SubdeviceFormat *);
|
|
|
|
private:
|
|
struct Entity {
|
|
/* The media entity, always valid. */
|
|
MediaEntity *entity;
|
|
/*
|
|
* Whether or not the entity is a subdev that supports the
|
|
* routing API.
|
|
*/
|
|
bool supportsRouting;
|
|
/*
|
|
* The local sink pad connected to the upstream entity, null for
|
|
* the camera sensor at the beginning of the pipeline.
|
|
*/
|
|
const MediaPad *sink;
|
|
/*
|
|
* The local source pad connected to the downstream entity, null
|
|
* for the video node at the end of the pipeline.
|
|
*/
|
|
const MediaPad *source;
|
|
/*
|
|
* The link on the source pad, to the downstream entity, null
|
|
* for the video node at the end of the pipeline.
|
|
*/
|
|
MediaLink *sourceLink;
|
|
};
|
|
|
|
std::list<Entity> entities_;
|
|
};
|
|
|
|
} /* namespace libcamera */
|