libcamera  v0.5.0+51-0069b9ce
Supporting cameras in Linux since 2019
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
24 {
25 public:
26  int init(MediaEntity *source, std::string_view sink);
27  int initLinks();
29 
30 private:
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 */
int initLinks()
Initialise and enable all links through the MediaPipeline.
Definition: media_pipeline.cpp:215
The MediaPipeline represents a set of entities that together form a data path for stream data...
Definition: media_pipeline.h:23
Top-level libcamera namespace.
Definition: backtrace.h:17
int configure(CameraSensor *sensor, V4L2SubdeviceFormat *)
Configure the entities of this MediaPipeline.
Definition: media_pipeline.cpp:249
The MediaEntity represents an entity in the media graph.
Definition: media_object.h:96
A abstract camera sensor.
Definition: camera_sensor.h:38
The V4L2 sub-device image format and sizes.
Definition: v4l2_subdevice.h:64
int init(MediaEntity *source, std::string_view sink)
Find the path from source to sink.
Definition: media_pipeline.cpp:105
Logging infrastructure.
The MediaPad represents a pad of an entity in the media graph.
Definition: media_object.h:68