From c2318e55f6715d474dd61243b987eddd05358cf7 Mon Sep 17 00:00:00 2001 From: Nicolas Dato Date: Sat, 19 Jul 2025 19:15:50 -0300 Subject: text wrap at 80 characters --- README.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index ebe3c4d..82f3ccb 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,11 @@ A pipeline would be: *[Source] -> [queue_1] -> [Stage_1] -> [Queue_2] -> [Stage_2] -> [...] -> [Sink]* -Each source, stage, and sink runs in a thread, reads from its imput queue and write to the output queue +Each source, stage, and sink runs in a thread, reads from its imput queue and +write to the output queue -You can ommit the source and sink, and inject or retrive elements from the pipelie +You can ommit the source and sink, and inject or retrive elements from the +pipeline ## Building, Compiling, Installing @@ -25,5 +27,32 @@ You can see some configuration options with: ## Quick Guide +See the `example/decode_resize_encode.c` and the function `do_tuberia()` + +Create a source with `tube_source_alloc()`. +If you set fetch to something, there will be a thread running fetch to inject +elements into the pipeline. +If you set fetch to NULL, you have to inject the elements with `tube_inject()`. + +Create as many stages as you need with `tube_stage_alloc()`, and append them +to the source with `tube_stage_append()`. + +Build the pipeline with `tube_alloc()`. If you set sink to something, +there will be a thread running sink to get the elements from the pipeline. +If you set sink to NULL, you have to retrieve the elements with +`tube_retrieve()`. + +The `tube_alloc()` function copies the source and all the appended stages, +so you can free the source and stages with `tube_source_and_stages_free()`. +Or, you can reutilize the same `tube_source` to build more pipelines. + +Start the pipeline with `tube_start()`. + +Free the pipeline with `tube_free()`. + + ### Quick example +```C + +``` -- cgit v1.2.3