diff --git a/spa/examples/example-control.c b/spa/examples/example-control.c index 8132a9781..6a4709b26 100644 --- a/spa/examples/example-control.c +++ b/spa/examples/example-control.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #define M_PI_M2 ( M_PI + M_PI ) diff --git a/spa/include/spa/buffer/meta.h b/spa/include/spa/buffer/meta.h index 822067897..1775b25a9 100644 --- a/spa/include/spa/buffer/meta.h +++ b/spa/include/spa/buffer/meta.h @@ -30,6 +30,7 @@ extern "C" { #endif #include +#include /** \page page_meta Metadata * @@ -42,6 +43,8 @@ enum spa_meta_type { SPA_META_VideoDamage, SPA_META_Bitmap, SPA_META_Cursor, + SPA_META_Control, /**< metadata contains a spa_pod_sequence + * associated with the data */ SPA_META_LAST, /**< not part of ABI/API */ }; @@ -134,6 +137,11 @@ struct spa_meta_cursor { * struct spa_meta_bitmap at the offset. */ }; +/** a timed set of events associated with the buffer */ +struct spa_meta_control { + struct spa_pod_sequence sequence; +}; + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/spa/include/spa/control/control.h b/spa/include/spa/control/control.h index 09a3be215..b355259b4 100644 --- a/spa/include/spa/control/control.h +++ b/spa/include/spa/control/control.h @@ -39,8 +39,10 @@ extern "C" { /** Different Control types */ enum spa_control_type { SPA_CONTROL_Invalid, - SPA_CONTROL_Properties, - SPA_CONTROL_Midi, + SPA_CONTROL_Properties, /**< data contains a SPA_TYPE_OBJECT_Props */ + SPA_CONTROL_Midi, /**< data contains a spa_pod_bytes with raw midi data */ + SPA_CONTROL_OSC, /**< data contains a spa_pod_bytes with an OSC packet */ + SPA_CONTROL_LAST, /**< not part of ABI */ }; diff --git a/spa/include/spa/control/type-info.h b/spa/include/spa/control/type-info.h index 5cad93361..ae3f149bf 100644 --- a/spa/include/spa/control/type-info.h +++ b/spa/include/spa/control/type-info.h @@ -41,6 +41,7 @@ static const struct spa_type_info spa_type_control[] = { { SPA_CONTROL_Invalid, SPA_TYPE_Int, SPA_TYPE_INFO_CONTROL_BASE "Invalid", NULL }, { SPA_CONTROL_Properties, SPA_TYPE_Int, SPA_TYPE_INFO_CONTROL_BASE "Properties", NULL }, { SPA_CONTROL_Midi, SPA_TYPE_Int, SPA_TYPE_INFO_CONTROL_BASE "Midi", NULL }, + { SPA_CONTROL_OSC, SPA_TYPE_Int, SPA_TYPE_INFO_CONTROL_BASE "OSC", NULL }, { 0, 0, NULL, NULL }, }; diff --git a/spa/include/spa/node/io.h b/spa/include/spa/node/io.h index aee57c794..086be0046 100644 --- a/spa/include/spa/node/io.h +++ b/spa/include/spa/node/io.h @@ -46,8 +46,12 @@ enum spa_io_type { SPA_IO_Range, /**< expected byte range */ SPA_IO_Clock, /**< area to update clock information */ SPA_IO_Latency, /**< latency reporting */ - SPA_IO_Control, /**< area for control messages */ - SPA_IO_Notify, /**< area for notify messages */ + SPA_IO_Control, /**< area for control messages, control messages + * contain an input spa_pod_sequence of timed + * events. */ + SPA_IO_Notify, /**< area for notify messages, notify messages + * contain an output spa_pod_sequence of timed + * events to be sent to listeners. */ SPA_IO_Position, /**< position information in the graph */ SPA_IO_RateMatch, /**< rate matching between nodes */ }; @@ -104,7 +108,7 @@ struct spa_io_latency { uint64_t max; /**< max latency */ }; -/** control stream */ +/** control stream, io area for SPA_IO_Control and SPA_IO_Notify */ struct spa_io_sequence { struct spa_pod_sequence sequence; /**< sequence of timed events */ }; diff --git a/spa/plugins/alsa/alsa-utils.c b/spa/plugins/alsa/alsa-utils.c index 01406ca65..7cf1d0d23 100644 --- a/spa/plugins/alsa/alsa-utils.c +++ b/spa/plugins/alsa/alsa-utils.c @@ -10,7 +10,6 @@ #include #include -#include #include "alsa-utils.h" diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index edae5f82b..42e077451 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -896,12 +896,6 @@ impl_node_port_enum_params(void *object, int seq, SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_buffers))); break; case 1: - param = spa_pod_builder_add_object(&b, - SPA_TYPE_OBJECT_ParamIO, id, - SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Control), - SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_sequence))); - break; - case 2: param = spa_pod_builder_add_object(&b, SPA_TYPE_OBJECT_ParamIO, id, SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_RateMatch), @@ -1032,9 +1026,6 @@ impl_node_port_set_io(void *object, case SPA_IO_RateMatch: res = spa_node_port_set_io(this->resample, direction, 0, id, data, size); break; - case SPA_IO_Control: - res = spa_node_port_set_io(this->channelmix, direction, 0, id, data, size); - break; default: if (IS_MONITOR_PORT(this, direction, port_id)) target = this->fmt[SPA_DIRECTION_INPUT]; diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index ec0daee01..65a524a2d 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include "channelmix-ops.h" @@ -90,7 +89,6 @@ struct port { struct spa_param_info params[8]; struct spa_io_buffers *io; - struct spa_io_sequence *control; bool have_format; struct spa_audio_info format; @@ -604,12 +602,6 @@ impl_node_port_enum_params(void *object, int seq, SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Buffers), SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_buffers))); break; - case 1: - param = spa_pod_builder_add_object(&b, - SPA_TYPE_OBJECT_ParamIO, id, - SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Control), - SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_sequence))); - break; default: return 0; } @@ -800,9 +792,6 @@ impl_node_port_set_io(void *object, case SPA_IO_Buffers: port->io = data; break; - case SPA_IO_Control: - port->control = data; - break; default: return -ENOENT; } @@ -848,22 +837,6 @@ static int impl_node_port_reuse_buffer(void *object, uint32_t port_id, uint32_t return 0; } -static int process_control(struct impl *this, struct port *port, struct spa_pod_sequence *sequence) -{ - struct spa_pod_control *c; - - SPA_POD_SEQUENCE_FOREACH(sequence, c) { - switch (c->type) { - case SPA_CONTROL_Properties: - apply_props(this, (const struct spa_pod *) &c->value); - break; - default: - break; - } - } - return 0; -} - static int impl_node_process(void *object) { struct impl *this = object; @@ -884,9 +857,6 @@ static int impl_node_process(void *object) spa_log_trace_fp(this->log, NAME " %p: status %d %d", this, inio->status, outio->status); - if (outport->control) - process_control(this, outport, &outport->control->sequence); - if (outio->status == SPA_STATUS_HAVE_DATA) goto done; diff --git a/spa/plugins/audioconvert/test-source.c b/spa/plugins/audioconvert/test-source.c index 745e1fa40..95234736b 100644 --- a/spa/plugins/audioconvert/test-source.c +++ b/spa/plugins/audioconvert/test-source.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #define NAME "test-source" diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c index f99ef4b85..2624c6945 100644 --- a/spa/plugins/audiomixer/audiomixer.c +++ b/spa/plugins/audiomixer/audiomixer.c @@ -416,12 +416,6 @@ impl_node_port_enum_params(void *object, int seq, SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Buffers), SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_buffers))); break; - case 1: - param = spa_pod_builder_add_object(&b, - SPA_TYPE_OBJECT_ParamIO, id, - SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Control), - SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_sequence))); - break; default: return 0; } diff --git a/spa/plugins/v4l2/v4l2-source.c b/spa/plugins/v4l2/v4l2-source.c index a957873a5..8b263a346 100644 --- a/spa/plugins/v4l2/v4l2-source.c +++ b/spa/plugins/v4l2/v4l2-source.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include "v4l2.h" diff --git a/spa/tests/test-cpp.cpp b/spa/tests/test-cpp.cpp index ff78b20bf..911466873 100644 --- a/spa/tests/test-cpp.cpp +++ b/spa/tests/test-cpp.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/src/examples/export-sink.c b/src/examples/export-sink.c index 167d0a8f0..781e6d70a 100644 --- a/src/examples/export-sink.c +++ b/src/examples/export-sink.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/src/pipewire/stream.c b/src/pipewire/stream.c index 4f5a959cc..3466d9145 100644 --- a/src/pipewire/stream.c +++ b/src/pipewire/stream.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include