libcamera: include/libcamera/internal/media_pipeline.h Source File

libcamera v0.5.1 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
15namespace libcamera {
16
17class CameraSensor;
18class MediaEntity;
19class MediaLink;
20class MediaPad;
21struct V4L2SubdeviceFormat;
22
23 class MediaPipeline
24{
25public:
26 int init(MediaEntity *source, std::string_view sink);
27 int initLinks();
28 int configure(CameraSensor *sensor, V4L2SubdeviceFormat *);
29
30private:
31 struct Entity {
32 /* The media entity, always valid. */
33 MediaEntity *entity;
34 /*
35 * Whether or not the entity is a subdev that supports the
36 * routing API.
37 */
38 bool supportsRouting;
39 /*
40 * The local sink pad connected to the upstream entity, null for
41 * the camera sensor at the beginning of the pipeline.
42 */
43 const MediaPad *sink;
44 /*
45 * The local source pad connected to the downstream entity, null
46 * for the video node at the end of the pipeline.
47 */
48 const MediaPad *source;
49 /*
50 * The link on the source pad, to the downstream entity, null
51 * for the video node at the end of the pipeline.
52 */
53 MediaLink *sourceLink;
54 };
55
56 std::list<Entity> entities_;
57};
58
59} /* namespace libcamera */
libcamera::CameraSensor
A abstract camera sensor.
Definition camera_sensor.h:39
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:249
libcamera::MediaPipeline::init
int init(MediaEntity *source, std::string_view sink)
Find the path from source to sink.
Definition media_pipeline.cpp:105
libcamera::MediaPipeline::initLinks
int initLinks()
Initialise and enable all links through the MediaPipeline.
Definition media_pipeline.cpp:215
log.h
Logging infrastructure.
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17
libcamera::V4L2SubdeviceFormat
The V4L2 sub-device image format and sizes.
Definition v4l2_subdevice.h:64