diff options
author | Wim Taymans <wtaymans@redhat.com> | 2020-01-03 09:33:20 +0100 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2020-01-03 09:33:20 +0100 |
commit | 73cc2e054c7c50344348ecde7c4bc4f56fa0a5b1 (patch) | |
tree | 10db748a2b6734a9ca6504f03933745f76dff5c9 | |
parent | df519ee3b36f08a692407d0b22692c0aac1b584f (diff) |
examples: pause timer in PAUSED
-rw-r--r-- | src/examples/local-v4l2.c | 1 | ||||
-rw-r--r-- | src/examples/video-dsp-play.c | 9 | ||||
-rw-r--r-- | src/examples/video-src-alloc.c | 4 | ||||
-rw-r--r-- | src/examples/video-src.c | 6 |
4 files changed, 8 insertions, 12 deletions
diff --git a/src/examples/local-v4l2.c b/src/examples/local-v4l2.c index a8e5ac35..f1d910e4 100644 --- a/src/examples/local-v4l2.c +++ b/src/examples/local-v4l2.c @@ -47,7 +47,6 @@ struct data { SDL_Texture *texture; struct pw_main_loop *loop; - struct spa_source *timer; struct pw_context *context; struct pw_core *core; diff --git a/src/examples/video-dsp-play.c b/src/examples/video-dsp-play.c index 4d251b8e..39fbca21 100644 --- a/src/examples/video-dsp-play.c +++ b/src/examples/video-dsp-play.c @@ -234,7 +234,6 @@ static const struct pw_filter_events filter_events = { int main(int argc, char *argv[]) { struct data data = { 0, }; - const struct spa_pod *params[1]; pw_init(&argc, &argv); @@ -276,10 +275,8 @@ int main(int argc, char *argv[]) return -1; } - /* build the extra parameters to connect with. To connect, we can provide - * a list of supported formats. We use a builder that writes the param - * object to the stack. */ - + /* Make a new DSP port. This will automatically set up the right + * parameters for the port */ data.in_port = pw_filter_add_port(data.filter, PW_DIRECTION_INPUT, PW_FILTER_PORT_FLAG_MAP_BUFFERS, @@ -288,7 +285,7 @@ int main(int argc, char *argv[]) PW_KEY_FORMAT_DSP, "32 bit float RGBA video", PW_KEY_PORT_NAME, "input", NULL), - params, 1); + NULL, 0); pw_filter_connect(data.filter, 0, diff --git a/src/examples/video-src-alloc.c b/src/examples/video-src-alloc.c index 32558c29..0c00f3af 100644 --- a/src/examples/video-src-alloc.c +++ b/src/examples/video-src-alloc.c @@ -190,6 +190,8 @@ static void on_stream_state_changed(void *_data, enum pw_stream_state old, enum switch (state) { case PW_STREAM_STATE_PAUSED: printf("node id: %d\n", pw_stream_get_node_id(data->stream)); + pw_loop_update_timer(pw_main_loop_get_loop(data->loop), + data->timer, NULL, NULL, false); break; case PW_STREAM_STATE_STREAMING: { @@ -205,8 +207,6 @@ static void on_stream_state_changed(void *_data, enum pw_stream_state old, enum break; } default: - pw_loop_update_timer(pw_main_loop_get_loop(data->loop), - data->timer, NULL, NULL, false); break; } } diff --git a/src/examples/video-src.c b/src/examples/video-src.c index 23de7473..f45e6abf 100644 --- a/src/examples/video-src.c +++ b/src/examples/video-src.c @@ -192,6 +192,8 @@ static void on_stream_state_changed(void *_data, enum pw_stream_state old, enum case PW_STREAM_STATE_PAUSED: printf("node id: %d\n", pw_stream_get_node_id(data->stream)); + pw_loop_update_timer(pw_main_loop_get_loop(data->loop), + data->timer, NULL, NULL, false); break; case PW_STREAM_STATE_STREAMING: { @@ -207,8 +209,6 @@ static void on_stream_state_changed(void *_data, enum pw_stream_state old, enum break; } default: - pw_loop_update_timer(pw_main_loop_get_loop(data->loop), - data->timer, NULL, NULL, false); break; } } @@ -302,7 +302,7 @@ int main(int argc, char *argv[]) &SPA_RECTANGLE(320, 240), &SPA_RECTANGLE(1, 1), &SPA_RECTANGLE(4096, 4096)), - SPA_FORMAT_VIDEO_framerate, SPA_POD_Fraction(&SPA_FRACTION(25, 1))); + SPA_FORMAT_VIDEO_framerate, SPA_POD_Fraction(&SPA_FRACTION(25, 1))); pw_stream_add_listener(data.stream, &data.stream_listener, |