18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * vimc-streamer.h Virtual Media Controller Driver 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2018 Lucas A. M. Magalhães <lucmaga@gmail.com> 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci */ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#ifndef _VIMC_STREAMER_H_ 108c2ecf20Sopenharmony_ci#define _VIMC_STREAMER_H_ 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include <media/media-device.h> 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#include "vimc-common.h" 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#define VIMC_STREAMER_PIPELINE_MAX_SIZE 16 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci/** 198c2ecf20Sopenharmony_ci * struct vimc_stream - struct that represents a stream in the pipeline 208c2ecf20Sopenharmony_ci * 218c2ecf20Sopenharmony_ci * @pipe: the media pipeline object associated with this stream 228c2ecf20Sopenharmony_ci * @ved_pipeline: array containing all the entities participating in the 238c2ecf20Sopenharmony_ci * stream. The order is from a video device (usually a 248c2ecf20Sopenharmony_ci * capture device) where stream_on was called, to the 258c2ecf20Sopenharmony_ci * entity generating the first base image to be 268c2ecf20Sopenharmony_ci * processed in the pipeline. 278c2ecf20Sopenharmony_ci * @pipe_size: size of @ved_pipeline 288c2ecf20Sopenharmony_ci * @kthread: thread that generates the frames of the stream. 298c2ecf20Sopenharmony_ci * 308c2ecf20Sopenharmony_ci * When the user call stream_on in a video device, struct vimc_stream is 318c2ecf20Sopenharmony_ci * used to keep track of all entities and subdevices that generates and 328c2ecf20Sopenharmony_ci * process frames for the stream. 338c2ecf20Sopenharmony_ci */ 348c2ecf20Sopenharmony_cistruct vimc_stream { 358c2ecf20Sopenharmony_ci struct media_pipeline pipe; 368c2ecf20Sopenharmony_ci struct vimc_ent_device *ved_pipeline[VIMC_STREAMER_PIPELINE_MAX_SIZE]; 378c2ecf20Sopenharmony_ci unsigned int pipe_size; 388c2ecf20Sopenharmony_ci struct task_struct *kthread; 398c2ecf20Sopenharmony_ci}; 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ciint vimc_streamer_s_stream(struct vimc_stream *stream, 428c2ecf20Sopenharmony_ci struct vimc_ent_device *ved, 438c2ecf20Sopenharmony_ci int enable); 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci#endif //_VIMC_STREAMER_H_ 46