stream: pass target id as uint32_t

This commit is contained in:
Wim Taymans 2018-11-02 11:52:39 +01:00
parent 8089d856c8
commit b905b70a76
7 changed files with 12 additions and 11 deletions

View file

@ -120,7 +120,7 @@ int main(int argc, char *argv[])
pw_stream_connect(data.stream,
PW_DIRECTION_OUTPUT,
argc > 1 ? argv[1] : NULL,
argc > 1 ? atoi(argv[1]) : SPA_ID_INVALID,
PW_STREAM_FLAG_AUTOCONNECT |
PW_STREAM_FLAG_MAP_BUFFERS |
PW_STREAM_FLAG_RT_PROCESS,

View file

@ -249,7 +249,7 @@ int main(int argc, char *argv[])
pw_stream_connect(data.stream,
PW_DIRECTION_INPUT,
data.path,
data.path ? atoi(data.path) : SPA_ID_INVALID,
PW_STREAM_FLAG_AUTOCONNECT |
PW_STREAM_FLAG_INACTIVE |
PW_STREAM_FLAG_EXCLUSIVE |

View file

@ -257,7 +257,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
pw_stream_connect(data->stream,
PW_DIRECTION_OUTPUT,
NULL, PW_STREAM_FLAG_DRIVER,
SPA_ID_INVALID, PW_STREAM_FLAG_DRIVER,
params, 1);
break;
}

View file

@ -528,7 +528,7 @@ gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
pw_stream_connect (pwsink->stream,
PW_DIRECTION_OUTPUT,
pwsink->path,
pwsink->path ? atoi(pwsink->path) : SPA_ID_INVALID,
flags,
(const struct spa_pod **) possible->pdata,
possible->len);

View file

@ -614,7 +614,7 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc)
GST_DEBUG_OBJECT (basesrc, "connect capture with path %s", pwsrc->path);
pw_stream_connect (pwsrc->stream,
PW_DIRECTION_INPUT,
pwsrc->path,
pwsrc->path ? atoi(pwsrc->path) : SPA_ID_INVALID,
PW_STREAM_FLAG_AUTOCONNECT,
(const struct spa_pod **)possible->pdata,
possible->len);

View file

@ -1062,7 +1062,7 @@ static void add_controls(struct pw_stream *stream)
int
pw_stream_connect(struct pw_stream *stream,
enum pw_direction direction,
const char *port_path,
uint32_t target_id,
enum pw_stream_flags flags,
const struct spa_pod **params,
uint32_t n_params)
@ -1071,7 +1071,7 @@ pw_stream_connect(struct pw_stream *stream,
enum pw_remote_state state;
int i, res;
pw_log_debug("stream %p: connect path:%s", stream, port_path);
pw_log_debug("stream %p: connect target:%d", stream, target_id);
impl->direction =
direction == PW_DIRECTION_INPUT ? SPA_DIRECTION_INPUT : SPA_DIRECTION_OUTPUT;
impl->flags = flags;
@ -1084,8 +1084,8 @@ pw_stream_connect(struct pw_stream *stream,
stream_set_state(stream, PW_STREAM_STATE_CONNECTING, NULL);
if (port_path)
pw_properties_set(stream->properties, PW_NODE_PROP_TARGET_NODE, port_path);
if (target_id != SPA_ID_INVALID)
pw_properties_setf(stream->properties, PW_NODE_PROP_TARGET_NODE, "%d", target_id);
if (flags & PW_STREAM_FLAG_AUTOCONNECT)
pw_properties_set(stream->properties, PW_NODE_PROP_AUTOCONNECT, "1");
pw_properties_set(stream->properties, "node.stream", "1");

View file

@ -268,8 +268,9 @@ int pw_stream_update_properties(struct pw_stream *stream, const struct spa_dict
int
pw_stream_connect(struct pw_stream *stream, /**< a \ref pw_stream */
enum pw_direction direction, /**< the stream direction */
const char *port_path, /**< the port path to connect to or NULL
* to let the server choose a port */
uint32_t target_id, /**< the target node to connect to or
* SPA_ID_INVALID to let the manager
* select a node. */
enum pw_stream_flags flags, /**< stream flags */
const struct spa_pod **params, /**< an array with params. The params
* should ideally contain supported