mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
stream: pass target id as uint32_t
This commit is contained in:
parent
8089d856c8
commit
b905b70a76
7 changed files with 12 additions and 11 deletions
|
|
@ -120,7 +120,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
pw_stream_connect(data.stream,
|
pw_stream_connect(data.stream,
|
||||||
PW_DIRECTION_OUTPUT,
|
PW_DIRECTION_OUTPUT,
|
||||||
argc > 1 ? argv[1] : NULL,
|
argc > 1 ? atoi(argv[1]) : SPA_ID_INVALID,
|
||||||
PW_STREAM_FLAG_AUTOCONNECT |
|
PW_STREAM_FLAG_AUTOCONNECT |
|
||||||
PW_STREAM_FLAG_MAP_BUFFERS |
|
PW_STREAM_FLAG_MAP_BUFFERS |
|
||||||
PW_STREAM_FLAG_RT_PROCESS,
|
PW_STREAM_FLAG_RT_PROCESS,
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
pw_stream_connect(data.stream,
|
pw_stream_connect(data.stream,
|
||||||
PW_DIRECTION_INPUT,
|
PW_DIRECTION_INPUT,
|
||||||
data.path,
|
data.path ? atoi(data.path) : SPA_ID_INVALID,
|
||||||
PW_STREAM_FLAG_AUTOCONNECT |
|
PW_STREAM_FLAG_AUTOCONNECT |
|
||||||
PW_STREAM_FLAG_INACTIVE |
|
PW_STREAM_FLAG_INACTIVE |
|
||||||
PW_STREAM_FLAG_EXCLUSIVE |
|
PW_STREAM_FLAG_EXCLUSIVE |
|
||||||
|
|
|
||||||
|
|
@ -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_stream_connect(data->stream,
|
||||||
PW_DIRECTION_OUTPUT,
|
PW_DIRECTION_OUTPUT,
|
||||||
NULL, PW_STREAM_FLAG_DRIVER,
|
SPA_ID_INVALID, PW_STREAM_FLAG_DRIVER,
|
||||||
params, 1);
|
params, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -528,7 +528,7 @@ gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
||||||
|
|
||||||
pw_stream_connect (pwsink->stream,
|
pw_stream_connect (pwsink->stream,
|
||||||
PW_DIRECTION_OUTPUT,
|
PW_DIRECTION_OUTPUT,
|
||||||
pwsink->path,
|
pwsink->path ? atoi(pwsink->path) : SPA_ID_INVALID,
|
||||||
flags,
|
flags,
|
||||||
(const struct spa_pod **) possible->pdata,
|
(const struct spa_pod **) possible->pdata,
|
||||||
possible->len);
|
possible->len);
|
||||||
|
|
|
||||||
|
|
@ -614,7 +614,7 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc)
|
||||||
GST_DEBUG_OBJECT (basesrc, "connect capture with path %s", pwsrc->path);
|
GST_DEBUG_OBJECT (basesrc, "connect capture with path %s", pwsrc->path);
|
||||||
pw_stream_connect (pwsrc->stream,
|
pw_stream_connect (pwsrc->stream,
|
||||||
PW_DIRECTION_INPUT,
|
PW_DIRECTION_INPUT,
|
||||||
pwsrc->path,
|
pwsrc->path ? atoi(pwsrc->path) : SPA_ID_INVALID,
|
||||||
PW_STREAM_FLAG_AUTOCONNECT,
|
PW_STREAM_FLAG_AUTOCONNECT,
|
||||||
(const struct spa_pod **)possible->pdata,
|
(const struct spa_pod **)possible->pdata,
|
||||||
possible->len);
|
possible->len);
|
||||||
|
|
|
||||||
|
|
@ -1062,7 +1062,7 @@ static void add_controls(struct pw_stream *stream)
|
||||||
int
|
int
|
||||||
pw_stream_connect(struct pw_stream *stream,
|
pw_stream_connect(struct pw_stream *stream,
|
||||||
enum pw_direction direction,
|
enum pw_direction direction,
|
||||||
const char *port_path,
|
uint32_t target_id,
|
||||||
enum pw_stream_flags flags,
|
enum pw_stream_flags flags,
|
||||||
const struct spa_pod **params,
|
const struct spa_pod **params,
|
||||||
uint32_t n_params)
|
uint32_t n_params)
|
||||||
|
|
@ -1071,7 +1071,7 @@ pw_stream_connect(struct pw_stream *stream,
|
||||||
enum pw_remote_state state;
|
enum pw_remote_state state;
|
||||||
int i, res;
|
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 =
|
impl->direction =
|
||||||
direction == PW_DIRECTION_INPUT ? SPA_DIRECTION_INPUT : SPA_DIRECTION_OUTPUT;
|
direction == PW_DIRECTION_INPUT ? SPA_DIRECTION_INPUT : SPA_DIRECTION_OUTPUT;
|
||||||
impl->flags = flags;
|
impl->flags = flags;
|
||||||
|
|
@ -1084,8 +1084,8 @@ pw_stream_connect(struct pw_stream *stream,
|
||||||
|
|
||||||
stream_set_state(stream, PW_STREAM_STATE_CONNECTING, NULL);
|
stream_set_state(stream, PW_STREAM_STATE_CONNECTING, NULL);
|
||||||
|
|
||||||
if (port_path)
|
if (target_id != SPA_ID_INVALID)
|
||||||
pw_properties_set(stream->properties, PW_NODE_PROP_TARGET_NODE, port_path);
|
pw_properties_setf(stream->properties, PW_NODE_PROP_TARGET_NODE, "%d", target_id);
|
||||||
if (flags & PW_STREAM_FLAG_AUTOCONNECT)
|
if (flags & PW_STREAM_FLAG_AUTOCONNECT)
|
||||||
pw_properties_set(stream->properties, PW_NODE_PROP_AUTOCONNECT, "1");
|
pw_properties_set(stream->properties, PW_NODE_PROP_AUTOCONNECT, "1");
|
||||||
pw_properties_set(stream->properties, "node.stream", "1");
|
pw_properties_set(stream->properties, "node.stream", "1");
|
||||||
|
|
|
||||||
|
|
@ -268,8 +268,9 @@ int pw_stream_update_properties(struct pw_stream *stream, const struct spa_dict
|
||||||
int
|
int
|
||||||
pw_stream_connect(struct pw_stream *stream, /**< a \ref pw_stream */
|
pw_stream_connect(struct pw_stream *stream, /**< a \ref pw_stream */
|
||||||
enum pw_direction direction, /**< the stream direction */
|
enum pw_direction direction, /**< the stream direction */
|
||||||
const char *port_path, /**< the port path to connect to or NULL
|
uint32_t target_id, /**< the target node to connect to or
|
||||||
* to let the server choose a port */
|
* SPA_ID_INVALID to let the manager
|
||||||
|
* select a node. */
|
||||||
enum pw_stream_flags flags, /**< stream flags */
|
enum pw_stream_flags flags, /**< stream flags */
|
||||||
const struct spa_pod **params, /**< an array with params. The params
|
const struct spa_pod **params, /**< an array with params. The params
|
||||||
* should ideally contain supported
|
* should ideally contain supported
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue