diff options
author | Wim Taymans <wtaymans@redhat.com> | 2019-05-28 14:01:18 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2019-05-28 14:01:18 +0200 |
commit | bf677d55da8c121f0eb7a21908bd493c33785361 (patch) | |
tree | 18e36f7c893a96a682f9c6c9ae9d3f109cadccf2 | |
parent | 9420497dd96a9c033afec09f592e0a28f0dd449a (diff) |
spa: implement node sync
-rw-r--r-- | spa/plugins/alsa/alsa-device.c | 12 | ||||
-rw-r--r-- | spa/plugins/alsa/alsa-sink.c | 13 | ||||
-rw-r--r-- | spa/plugins/alsa/alsa-source.c | 13 | ||||
-rw-r--r-- | spa/plugins/audioconvert/audioconvert.c | 2 | ||||
-rw-r--r-- | spa/plugins/bluez5/a2dp-sink.c | 12 | ||||
-rw-r--r-- | spa/plugins/bluez5/a2dp-source.c | 12 | ||||
-rw-r--r-- | spa/plugins/v4l2/v4l2-device.c | 12 | ||||
-rw-r--r-- | spa/plugins/v4l2/v4l2-source.c | 12 |
8 files changed, 87 insertions, 1 deletions
diff --git a/spa/plugins/alsa/alsa-device.c b/spa/plugins/alsa/alsa-device.c index 24caa649..ac1387d6 100644 --- a/spa/plugins/alsa/alsa-device.c +++ b/spa/plugins/alsa/alsa-device.c @@ -278,6 +278,17 @@ static int impl_add_listener(void *object, } +static int impl_sync(void *object, int seq) +{ + struct impl *this = object; + + spa_return_val_if_fail(this != NULL, -EINVAL); + + spa_device_emit_result(&this->hooks, seq, 0, 0, NULL); + + return 0; +} + static int impl_enum_params(void *object, int seq, uint32_t id, uint32_t start, uint32_t num, const struct spa_pod *filter) @@ -383,6 +394,7 @@ static int impl_set_param(void *object, static const struct spa_device_methods impl_device = { SPA_VERSION_DEVICE_METHODS, .add_listener = impl_add_listener, + .sync = impl_sync, .enum_params = impl_enum_params, .set_param = impl_set_param, }; diff --git a/spa/plugins/alsa/alsa-sink.c b/spa/plugins/alsa/alsa-sink.c index b69d7a4d..f05c0008 100644 --- a/spa/plugins/alsa/alsa-sink.c +++ b/spa/plugins/alsa/alsa-sink.c @@ -287,6 +287,18 @@ impl_node_set_callbacks(void *object, return 0; } +static int +impl_node_sync(void *object, int seq) +{ + struct state *this = object; + + spa_return_val_if_fail(this != NULL, -EINVAL); + + spa_node_emit_result(&this->hooks, seq, 0, 0, NULL); + + return 0; +} + static int impl_node_add_port(void *object, enum spa_direction direction, uint32_t port_id, const struct spa_dict *props) { @@ -632,6 +644,7 @@ static const struct spa_node_methods impl_node = { SPA_VERSION_NODE_METHODS, .add_listener = impl_node_add_listener, .set_callbacks = impl_node_set_callbacks, + .sync = impl_node_sync, .enum_params = impl_node_enum_params, .set_param = impl_node_set_param, .set_io = impl_node_set_io, diff --git a/spa/plugins/alsa/alsa-source.c b/spa/plugins/alsa/alsa-source.c index e3f8bbc3..9f8321ca 100644 --- a/spa/plugins/alsa/alsa-source.c +++ b/spa/plugins/alsa/alsa-source.c @@ -287,6 +287,18 @@ impl_node_set_callbacks(void *object, return 0; } +static int impl_node_sync(void *object, int seq) +{ + struct state *this = object; + + spa_return_val_if_fail(this != NULL, -EINVAL); + + spa_node_emit_result(&this->hooks, seq, 0, 0, NULL); + + return 0; +} + + static int impl_node_add_port(void *object, enum spa_direction direction, uint32_t port_id, const struct spa_dict *props) { @@ -648,6 +660,7 @@ static const struct spa_node_methods impl_node = { SPA_VERSION_NODE_METHODS, .add_listener = impl_node_add_listener, .set_callbacks = impl_node_set_callbacks, + .sync = impl_node_sync, .enum_params = impl_node_enum_params, .set_param = impl_node_set_param, .set_io = impl_node_set_io, diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index 49437aae..7a94a0df 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -647,7 +647,7 @@ impl_node_set_callbacks(void *object, const struct spa_node_callbacks *callbacks, void *user_data) { - return 0; + return -ENOTSUP; } static int impl_node_add_port(void *object, enum spa_direction direction, uint32_t port_id, diff --git a/spa/plugins/bluez5/a2dp-sink.c b/spa/plugins/bluez5/a2dp-sink.c index 548cfb26..d74dc9e9 100644 --- a/spa/plugins/bluez5/a2dp-sink.c +++ b/spa/plugins/bluez5/a2dp-sink.c @@ -965,6 +965,17 @@ impl_node_set_callbacks(void *object, return 0; } +static int impl_node_sync(void *object, int seq) +{ + struct impl *this = object; + + spa_return_val_if_fail(this != NULL, -EINVAL); + + spa_node_emit_result(&this->hooks, seq, 0, 0, NULL); + + return 0; +} + static int impl_node_add_port(void *object, enum spa_direction direction, uint32_t port_id, const struct spa_dict *props) { @@ -1330,6 +1341,7 @@ static const struct spa_node_methods impl_node = { SPA_VERSION_NODE_METHODS, .add_listener = impl_node_add_listener, .set_callbacks = impl_node_set_callbacks, + .sync = impl_node_sync, .enum_params = impl_node_enum_params, .set_param = impl_node_set_param, .set_io = impl_node_set_io, diff --git a/spa/plugins/bluez5/a2dp-source.c b/spa/plugins/bluez5/a2dp-source.c index cadb1223..f6f5ece0 100644 --- a/spa/plugins/bluez5/a2dp-source.c +++ b/spa/plugins/bluez5/a2dp-source.c @@ -618,6 +618,17 @@ impl_node_set_callbacks(void *object, return 0; } +static int impl_node_sync(void *object, int seq) +{ + struct impl *this = object; + + spa_return_val_if_fail(this != NULL, -EINVAL); + + spa_node_emit_result(&this->hooks, seq, 0, 0, NULL); + + return 0; +} + static int impl_node_add_port(void *object, enum spa_direction direction, uint32_t port_id, const struct spa_dict *props) { @@ -1011,6 +1022,7 @@ static const struct spa_node_methods impl_node = { SPA_VERSION_NODE_METHODS, .add_listener = impl_node_add_listener, .set_callbacks = impl_node_set_callbacks, + .sync = impl_node_sync, .enum_params = impl_node_enum_params, .set_param = impl_node_set_param, .set_io = impl_node_set_io, diff --git a/spa/plugins/v4l2/v4l2-device.c b/spa/plugins/v4l2/v4l2-device.c index 21c80520..c8603276 100644 --- a/spa/plugins/v4l2/v4l2-device.c +++ b/spa/plugins/v4l2/v4l2-device.c @@ -137,6 +137,17 @@ static int impl_add_listener(void *object, return res; } +static int impl_sync(void *object, int seq) +{ + struct impl *this = object; + + spa_return_val_if_fail(this != NULL, -EINVAL); + + spa_device_emit_result(&this->hooks, seq, 0, 0, NULL); + + return 0; +} + static int impl_enum_params(void *object, int seq, uint32_t id, uint32_t start, uint32_t num, const struct spa_pod *filter) @@ -154,6 +165,7 @@ static int impl_set_param(void *object, static const struct spa_device_methods impl_device = { SPA_VERSION_DEVICE_METHODS, .add_listener = impl_add_listener, + .sync = impl_sync, .enum_params = impl_enum_params, .set_param = impl_set_param, }; diff --git a/spa/plugins/v4l2/v4l2-source.c b/spa/plugins/v4l2/v4l2-source.c index 23329f2d..6433d4e1 100644 --- a/spa/plugins/v4l2/v4l2-source.c +++ b/spa/plugins/v4l2/v4l2-source.c @@ -377,6 +377,17 @@ static int impl_node_set_callbacks(void *object, return 0; } +static int impl_node_sync(void *object, int seq) +{ + struct impl *this = object; + + spa_return_val_if_fail(this != NULL, -EINVAL); + + spa_node_emit_result(&this->hooks, seq, 0, 0, NULL); + + return 0; +} + static int impl_node_add_port(void *object, enum spa_direction direction, uint32_t port_id, const struct spa_dict *props) @@ -878,6 +889,7 @@ static const struct spa_node_methods impl_node = { SPA_VERSION_NODE_METHODS, .add_listener = impl_node_add_listener, .set_callbacks = impl_node_set_callbacks, + .sync = impl_node_sync, .enum_params = impl_node_enum_params, .set_param = impl_node_set_param, .set_io = impl_node_set_io, |