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