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()
73 * vimc_streamer_pipeline_init - Initializes the stream structure
75 * @stream: the pointer to the stream structure to be initialized
76 * @ved: the pointer to the vimc entity initializing the stream
78 * Initializes the stream structure. Walks through the entity graph to
80 * Calls vimc_streamer_s_stream() to enable stream in all entities of
85 static int vimc_streamer_pipeline_init(struct vimc_stream *stream, in vimc_streamer_pipeline_init() argument
93 stream->pipe_size = 0; in vimc_streamer_pipeline_init()
94 while (stream->pipe_size < VIMC_STREAMER_PIPELINE_MAX_SIZE) { in vimc_streamer_pipeline_init()
96 vimc_streamer_pipeline_terminate(stream); in vimc_streamer_pipeline_init()
99 stream->ved_pipeline[stream->pipe_size++] = ved; in vimc_streamer_pipeline_init()
107 vimc_streamer_pipeline_terminate(stream); in vimc_streamer_pipeline_init()
120 vimc_streamer_pipeline_terminate(stream); in vimc_streamer_pipeline_init()
138 vimc_streamer_pipeline_terminate(stream); in vimc_streamer_pipeline_init()
145 * @data: vimc_stream struct of the current stream
156 struct vimc_stream *stream = data; in vimc_streamer_thread() local
167 for (i = stream->pipe_size - 1; i >= 0; i--) { in vimc_streamer_thread()
168 frame = stream->ved_pipeline[i]->process_frame( in vimc_streamer_thread()
169 stream->ved_pipeline[i], frame); in vimc_streamer_thread()
184 * @stream: the pointer to the stream structure of the current stream
185 * @ved: pointer to the vimc entity of the entity of the stream
186 * @enable: flag to determine if stream should start/stop
188 * When starting, check if there is no ``stream->kthread`` allocated. This
189 * should indicate that a stream is already running. Then, it initializes the
191 * When stopping, analogously check if there is a stream running, stop the
196 int vimc_streamer_s_stream(struct vimc_stream *stream, in vimc_streamer_s_stream() argument
202 if (!stream || !ved) in vimc_streamer_s_stream()
206 if (stream->kthread) in vimc_streamer_s_stream()
209 ret = vimc_streamer_pipeline_init(stream, ved); in vimc_streamer_s_stream()
213 stream->kthread = kthread_run(vimc_streamer_thread, stream, in vimc_streamer_s_stream()
216 if (IS_ERR(stream->kthread)) { in vimc_streamer_s_stream()
217 ret = PTR_ERR(stream->kthread); in vimc_streamer_s_stream()
219 vimc_streamer_pipeline_terminate(stream); in vimc_streamer_s_stream()
220 stream->kthread = NULL; in vimc_streamer_s_stream()
225 if (!stream->kthread) in vimc_streamer_s_stream()
228 ret = kthread_stop(stream->kthread); in vimc_streamer_s_stream()
232 * a chance to run. Ignore errors to stop the stream in the in vimc_streamer_s_stream()
238 stream->kthread = NULL; in vimc_streamer_s_stream()
240 vimc_streamer_pipeline_terminate(stream); in vimc_streamer_s_stream()