Lines Matching full:stream

40  * vimc_streamer_pipeline_terminate - Disable stream in all ved in stream
42 * @stream: the pointer to the stream structure with the pipeline to be
45 * Calls s_stream to disable the stream in each entity of the pipeline
48 static void vimc_streamer_pipeline_terminate(struct vimc_stream *stream) in vimc_streamer_pipeline_terminate() argument
53 while (stream->pipe_size) { in vimc_streamer_pipeline_terminate()
54 stream->pipe_size--; in vimc_streamer_pipeline_terminate()
55 ved = stream->ved_pipeline[stream->pipe_size]; in vimc_streamer_pipeline_terminate()
56 stream->ved_pipeline[stream->pipe_size] = NULL; in vimc_streamer_pipeline_terminate()
67 * vimc_streamer_pipeline_init - Initializes the stream structure
69 * @stream: the pointer to the stream structure to be initialized
70 * @ved: the pointer to the vimc entity initializing the stream
72 * Initializes the stream structure. Walks through the entity graph to
74 * Calls vimc_streamer_s_stream() to enable stream in all entities of
79 static int vimc_streamer_pipeline_init(struct vimc_stream *stream, in vimc_streamer_pipeline_init() argument
87 stream->pipe_size = 0; in vimc_streamer_pipeline_init()
88 while (stream->pipe_size < VIMC_STREAMER_PIPELINE_MAX_SIZE) { in vimc_streamer_pipeline_init()
90 vimc_streamer_pipeline_terminate(stream); in vimc_streamer_pipeline_init()
93 stream->ved_pipeline[stream->pipe_size++] = ved; in vimc_streamer_pipeline_init()
101 vimc_streamer_pipeline_terminate(stream); in vimc_streamer_pipeline_init()
114 vimc_streamer_pipeline_terminate(stream); in vimc_streamer_pipeline_init()
132 vimc_streamer_pipeline_terminate(stream); in vimc_streamer_pipeline_init()
139 * @data: vimc_stream struct of the current stream
150 struct vimc_stream *stream = data; in vimc_streamer_thread() local
161 for (i = stream->pipe_size - 1; i >= 0; i--) { in vimc_streamer_thread()
162 frame = stream->ved_pipeline[i]->process_frame( in vimc_streamer_thread()
163 stream->ved_pipeline[i], frame); in vimc_streamer_thread()
178 * @stream: the pointer to the stream structure of the current stream
179 * @ved: pointer to the vimc entity of the entity of the stream
180 * @enable: flag to determine if stream should start/stop
182 * When starting, check if there is no ``stream->kthread`` allocated. This
183 * should indicate that a stream is already running. Then, it initializes the
185 * When stopping, analogously check if there is a stream running, stop the
190 int vimc_streamer_s_stream(struct vimc_stream *stream, in vimc_streamer_s_stream() argument
196 if (!stream || !ved) in vimc_streamer_s_stream()
200 if (stream->kthread) in vimc_streamer_s_stream()
203 ret = vimc_streamer_pipeline_init(stream, ved); in vimc_streamer_s_stream()
207 stream->kthread = kthread_run(vimc_streamer_thread, stream, in vimc_streamer_s_stream()
210 if (IS_ERR(stream->kthread)) { in vimc_streamer_s_stream()
211 ret = PTR_ERR(stream->kthread); in vimc_streamer_s_stream()
213 vimc_streamer_pipeline_terminate(stream); in vimc_streamer_s_stream()
214 stream->kthread = NULL; in vimc_streamer_s_stream()
219 if (!stream->kthread) in vimc_streamer_s_stream()
222 ret = kthread_stop(stream->kthread); in vimc_streamer_s_stream()
226 * a chance to run. Ignore errors to stop the stream in the in vimc_streamer_s_stream()
232 stream->kthread = NULL; in vimc_streamer_s_stream()
234 vimc_streamer_pipeline_terminate(stream); in vimc_streamer_s_stream()