examples: update the examples with new lazy scheduling flags

The src can listen to RequestProcess commands and so gets the
node.supports-request = 1 property.

The play-pull example can both be a driver that listens to
RequestProcess or a lazy driver so set this in properties as well.
We can now remove the priority.driver property because automatic
priority selection will make us a driver or not.

With this change, video-src to video-play-pull will use lazy scheduling
with play-pull as the driver. video-play-pull to v4l2src will use
normal scheduling and video-src to video-play will also use normal
scheduling.
This commit is contained in:
Wim Taymans 2024-11-04 17:09:59 +01:00
parent 7abf11210d
commit f7e97ab157
2 changed files with 17 additions and 8 deletions

View file

@ -194,8 +194,13 @@ static void on_stream_state_changed(void *_data, enum pw_stream_state old, enum
interval.tv_sec = 0;
interval.tv_nsec = 40 * SPA_NSEC_PER_MSEC;
pw_loop_update_timer(pw_main_loop_get_loop(data->loop),
data->timer, &timeout, &interval, false);
printf("driving:%d lazy:%d\n",
pw_stream_is_driving(data->stream),
pw_stream_is_lazy(data->stream));
if (pw_stream_is_driving(data->stream) != pw_stream_is_lazy(data->stream))
pw_loop_update_timer(pw_main_loop_get_loop(data->loop),
data->timer, &timeout, &interval, false);
break;
}
default:
@ -305,6 +310,7 @@ int main(int argc, char *argv[])
data.stream = pw_stream_new(data.core, "video-src",
pw_properties_new(
PW_KEY_MEDIA_CLASS, "Video/Source",
PW_KEY_NODE_SUPPORTS_REQUEST, "1",
NULL));
params[0] = spa_pod_builder_add_object(&b,