162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * vimc-streamer.h Virtual Media Controller Driver
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (C) 2018 Lucas A. M. Magalhães <lucmaga@gmail.com>
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifndef _VIMC_STREAMER_H_
1062306a36Sopenharmony_ci#define _VIMC_STREAMER_H_
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#include <media/media-device.h>
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#include "vimc-common.h"
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci#define VIMC_STREAMER_PIPELINE_MAX_SIZE 16
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci/**
1962306a36Sopenharmony_ci * struct vimc_stream - struct that represents a stream in the pipeline
2062306a36Sopenharmony_ci *
2162306a36Sopenharmony_ci * @pipe:		the media pipeline object associated with this stream
2262306a36Sopenharmony_ci * @ved_pipeline:	array containing all the entities participating in the
2362306a36Sopenharmony_ci * 			stream. The order is from a video device (usually a
2462306a36Sopenharmony_ci *			capture device) where stream_on was called, to the
2562306a36Sopenharmony_ci *			entity generating the first base image to be
2662306a36Sopenharmony_ci *			processed in the pipeline.
2762306a36Sopenharmony_ci * @pipe_size:		size of @ved_pipeline
2862306a36Sopenharmony_ci * @kthread:		thread that generates the frames of the stream.
2962306a36Sopenharmony_ci *
3062306a36Sopenharmony_ci * When the user call stream_on in a video device, struct vimc_stream is
3162306a36Sopenharmony_ci * used to keep track of all entities and subdevices that generates and
3262306a36Sopenharmony_ci * process frames for the stream.
3362306a36Sopenharmony_ci */
3462306a36Sopenharmony_cistruct vimc_stream {
3562306a36Sopenharmony_ci	struct media_pipeline pipe;
3662306a36Sopenharmony_ci	struct vimc_ent_device *ved_pipeline[VIMC_STREAMER_PIPELINE_MAX_SIZE];
3762306a36Sopenharmony_ci	unsigned int pipe_size;
3862306a36Sopenharmony_ci	struct task_struct *kthread;
3962306a36Sopenharmony_ci};
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ciint vimc_streamer_s_stream(struct vimc_stream *stream,
4262306a36Sopenharmony_ci			   struct vimc_ent_device *ved,
4362306a36Sopenharmony_ci			   int enable);
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci#endif  //_VIMC_STREAMER_H_
46