libcamera v0.7.2 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
media_pipeline.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2024, Ideas on Board Oy
4 *
5 * Media pipeline support
6 */
7
8#pragma once
9
10#include <list>
11#include <string>
12
13#include <libcamera/base/log.h>
14
15 namespace libcamera {
16
17 class CameraSensor;
18 class MediaEntity;
19 class MediaLink;
20 class MediaPad;
21 struct V4L2SubdeviceFormat;
22
23 class MediaPipeline
24{
25 public:
26 struct Entity {
27 MediaEntity *entity;
28 bool supportsRouting;
29 const MediaPad *sink;
30 const MediaPad *source;
31 MediaLink *sourceLink;
32 };
33
34 int init(MediaEntity *source, std::string_view sink);
35 int initLinks();
36 int configure(CameraSensor *sensor, V4L2SubdeviceFormat *);
37
38 const std::list<Entity> &entities() const { return entities_; }
39
40 private:
41 std::list<Entity> entities_;
42};
43
44} /* namespace libcamera */
libcamera::CameraSensor
A abstract camera sensor.
Definition camera_sensor.h:40
libcamera::MediaEntity
The MediaEntity represents an entity in the media graph.
Definition media_object.h:97
libcamera::MediaLink
The MediaLink represents a link between two pads in the media graph.
Definition media_object.h:44
libcamera::MediaPad
The MediaPad represents a pad of an entity in the media graph.
Definition media_object.h:69
libcamera::MediaPipeline
The MediaPipeline represents a set of entities that together form a data path for stream data.
Definition media_pipeline.h:24
libcamera::MediaPipeline::configure
int configure(CameraSensor *sensor, V4L2SubdeviceFormat *)
Configure the entities of this MediaPipeline.
Definition media_pipeline.cpp:295
libcamera::MediaPipeline::entities
const std::list< Entity > & entities() const
Retrieve list of entities composing the media pipeline.
Definition media_pipeline.h:38
libcamera::MediaPipeline::init
int init(MediaEntity *source, std::string_view sink)
Find the path from source to sink.
Definition media_pipeline.cpp:151
libcamera::MediaPipeline::initLinks
int initLinks()
Initialise and enable all links through the MediaPipeline.
Definition media_pipeline.cpp:261
log.h
Logging infrastructure.
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17
libcamera::MediaPipeline::Entity
A node composing the media pipeline.
Definition media_pipeline.h:26
libcamera::MediaPipeline::Entity::entity
MediaEntity * entity
Pointer to the libcamera::MediaEntity, always valid.
Definition media_pipeline.h:27
libcamera::MediaPipeline::Entity::supportsRouting
bool supportsRouting
Whether or not the entity is a subdev that supports the routing API.
Definition media_pipeline.h:28
libcamera::MediaPipeline::Entity::sink
const MediaPad * sink
The local libcamera::MediaPad sink pad connected to the upstream entity, null for the camera sensor a...
Definition media_pipeline.h:29
libcamera::MediaPipeline::Entity::sourceLink
MediaLink * sourceLink
The link on the libcamera::MediaLink source pad, to the downstream entity, null for the last node at ...
Definition media_pipeline.h:31
libcamera::MediaPipeline::Entity::source
const MediaPad * source
The local libcamera::MediaPad source pad connected to the upstream entity, null for the last node at ...
Definition media_pipeline.h:30
libcamera::V4L2SubdeviceFormat
The V4L2 sub-device image format and sizes.
Definition v4l2_subdevice.h:65