Lines Matching defs: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)
53 while (stream->pipe_size) {
54 stream->pipe_size--;
55 ved = stream->ved_pipeline[stream->pipe_size];
56 stream->ved_pipeline[stream->pipe_size] = NULL;
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,
87 stream->pipe_size = 0;
88 while (stream->pipe_size < VIMC_STREAMER_PIPELINE_MAX_SIZE) {
90 vimc_streamer_pipeline_terminate(stream);
93 stream->ved_pipeline[stream->pipe_size++] = ved;
101 vimc_streamer_pipeline_terminate(stream);
114 vimc_streamer_pipeline_terminate(stream);
132 vimc_streamer_pipeline_terminate(stream);
139 * @data: vimc_stream struct of the current stream
150 struct vimc_stream *stream = data;
161 for (i = stream->pipe_size - 1; i >= 0; i--) {
162 frame = stream->ved_pipeline[i]->process_frame(
163 stream->ved_pipeline[i], frame);
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,
196 if (!stream || !ved)
200 if (stream->kthread)
203 ret = vimc_streamer_pipeline_init(stream, ved);
207 stream->kthread = kthread_run(vimc_streamer_thread, stream,
210 if (IS_ERR(stream->kthread)) {
211 ret = PTR_ERR(stream->kthread);
213 vimc_streamer_pipeline_terminate(stream);
214 stream->kthread = NULL;
219 if (!stream->kthread)
222 ret = kthread_stop(stream->kthread);
226 * a chance to run. Ignore errors to stop the stream in the
232 stream->kthread = NULL;
234 vimc_streamer_pipeline_terminate(stream);