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