Lucas A. M. Magalhães | adc589d | 2019-01-21 20:05:01 -0500 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * vimc-streamer.h Virtual Media Controller Driver |
| 4 | * |
| 5 | * Copyright (C) 2018 Lucas A. M. Magalhães <lucmaga@gmail.com> |
| 6 | * |
| 7 | */ |
| 8 | |
| 9 | #ifndef _VIMC_STREAMER_H_ |
| 10 | #define _VIMC_STREAMER_H_ |
| 11 | |
| 12 | #include <media/media-device.h> |
| 13 | |
| 14 | #include "vimc-common.h" |
| 15 | |
| 16 | #define VIMC_STREAMER_PIPELINE_MAX_SIZE 16 |
| 17 | |
Helen Fornazier | 43e3b72 | 2019-03-06 17:42:42 -0500 | [diff] [blame] | 18 | /** |
| 19 | * struct vimc_stream - struct that represents a stream in the pipeline |
| 20 | * |
| 21 | * @pipe: the media pipeline object associated with this stream |
| 22 | * @ved_pipeline: array containing all the entities participating in the |
Mauro Carvalho Chehab | e671ed9 | 2020-04-14 12:09:12 +0200 | [diff] [blame] | 23 | * stream. The order is from a video device (usually a |
| 24 | * capture device) where stream_on was called, to the |
| 25 | * entity generating the first base image to be |
| 26 | * processed in the pipeline. |
Helen Fornazier | 43e3b72 | 2019-03-06 17:42:42 -0500 | [diff] [blame] | 27 | * @pipe_size: size of @ved_pipeline |
| 28 | * @kthread: thread that generates the frames of the stream. |
| 29 | * |
| 30 | * When the user call stream_on in a video device, struct vimc_stream is |
| 31 | * used to keep track of all entities and subdevices that generates and |
| 32 | * process frames for the stream. |
| 33 | */ |
Lucas A. M. Magalhães | adc589d | 2019-01-21 20:05:01 -0500 | [diff] [blame] | 34 | struct vimc_stream { |
| 35 | struct media_pipeline pipe; |
| 36 | struct vimc_ent_device *ved_pipeline[VIMC_STREAMER_PIPELINE_MAX_SIZE]; |
| 37 | unsigned int pipe_size; |
Lucas A. M. Magalhães | adc589d | 2019-01-21 20:05:01 -0500 | [diff] [blame] | 38 | struct task_struct *kthread; |
Lucas A. M. Magalhães | adc589d | 2019-01-21 20:05:01 -0500 | [diff] [blame] | 39 | }; |
| 40 | |
Lucas A. M. Magalhães | adc589d | 2019-01-21 20:05:01 -0500 | [diff] [blame] | 41 | int vimc_streamer_s_stream(struct vimc_stream *stream, |
| 42 | struct vimc_ent_device *ved, |
| 43 | int enable); |
| 44 | |
| 45 | #endif //_VIMC_STREAMER_H_ |