From 937a1567dd1d070911668fc0a96d04ef56c09c6c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 21 Jun 2017 15:14:25 +0200 Subject: [PATCH] stream: constify format array because we copy --- pipewire/client/stream.c | 4 ++-- pipewire/client/stream.h | 2 +- pipewire/examples/video-play.c | 2 +- pipewire/examples/video-src.c | 2 +- pipewire/gst/gstpipewiresink.c | 2 +- pipewire/gst/gstpipewiresrc.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pipewire/client/stream.c b/pipewire/client/stream.c index 993084812..c45ee2d04 100644 --- a/pipewire/client/stream.c +++ b/pipewire/client/stream.c @@ -250,7 +250,7 @@ static void unhandle_socket(struct pw_stream *stream) static void set_possible_formats(struct pw_stream *stream, - int n_possible_formats, struct spa_format **possible_formats) + int n_possible_formats, const struct spa_format **possible_formats) { struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this); int i; @@ -888,7 +888,7 @@ pw_stream_connect(struct pw_stream *stream, const char *port_path, enum pw_stream_flags flags, uint32_t n_possible_formats, - struct spa_format **possible_formats) + const struct spa_format **possible_formats) { struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this); diff --git a/pipewire/client/stream.h b/pipewire/client/stream.h index c34107236..df4d2f4f3 100644 --- a/pipewire/client/stream.h +++ b/pipewire/client/stream.h @@ -262,7 +262,7 @@ pw_stream_connect(struct pw_stream *stream, /**< a \ref pw_stream */ * to let the server choose a port */ enum pw_stream_flags flags, /**< stream flags */ uint32_t n_possible_formats, /**< number of items in \a possible_formats */ - struct spa_format **possible_formats /**< an array with possible accepted formats */); + const struct spa_format **possible_formats /**< an array with possible accepted formats */); /** Disconnect \a stream \memberof pw_stream */ void pw_stream_disconnect(struct pw_stream *stream); diff --git a/pipewire/examples/video-play.c b/pipewire/examples/video-play.c index fb548337e..8acc7a352 100644 --- a/pipewire/examples/video-play.c +++ b/pipewire/examples/video-play.c @@ -299,7 +299,7 @@ static void on_state_changed(struct pw_listener *listener, struct pw_context *co case PW_CONTEXT_STATE_CONNECTED: { - struct spa_format *formats[1]; + const struct spa_format *formats[1]; uint8_t buffer[1024]; struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); struct spa_pod_frame f[2]; diff --git a/pipewire/examples/video-src.c b/pipewire/examples/video-src.c index 1d6bdc29b..0a8f05a57 100644 --- a/pipewire/examples/video-src.c +++ b/pipewire/examples/video-src.c @@ -219,7 +219,7 @@ static void on_state_changed(struct pw_listener *listener, struct pw_context *co case PW_CONTEXT_STATE_CONNECTED: { - struct spa_format *formats[1]; + const struct spa_format *formats[1]; uint8_t buffer[1024]; struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); struct spa_pod_frame f[2]; diff --git a/pipewire/gst/gstpipewiresink.c b/pipewire/gst/gstpipewiresink.c index ddf7836f0..08673c39b 100644 --- a/pipewire/gst/gstpipewiresink.c +++ b/pipewire/gst/gstpipewiresink.c @@ -643,7 +643,7 @@ gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps) pwsink->path, flags, possible->len, - (struct spa_format **) possible->pdata); + (const struct spa_format **) possible->pdata); while (TRUE) { state = pwsink->stream->state; diff --git a/pipewire/gst/gstpipewiresrc.c b/pipewire/gst/gstpipewiresrc.c index 34de48169..5b296b887 100644 --- a/pipewire/gst/gstpipewiresrc.c +++ b/pipewire/gst/gstpipewiresrc.c @@ -665,7 +665,7 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc) pwsrc->path, PW_STREAM_FLAG_AUTOCONNECT, possible->len, - (struct spa_format **)possible->pdata); + (const struct spa_format **)possible->pdata); g_ptr_array_free (possible, TRUE); while (TRUE) {