pipewire/src/modules/module-rtp
Carlos Rafael Giani d8f5ed0c13 module-rtp-sink: Add ability to add / remove receivers through commands
This makes it possible to dynamically add / remove receivers, which is
necesary for sending to multiple receivers. Mixed multi- and unicast
receivers are possible. Example pw-cli calls (56 is the ID of the RTP
sink node):

pw-cli c 56 User '{ extra="{ \"command.id\" : \"add-receiver\" , \"destination.ip\" : \"10.42.0.1\", \"destination.port\" : 55001 }" }'
pw-cli c 56 User '{ extra="{ \"command.id\" : \"remove-receiver\", \"destination.ip\" : \"10.42.0.1\" }" }'
pw-cli c 56 User '{ extra="{ \"command.id\" : \"clear-receivers\" }" }'

Commands and their arguments:

* "add-receiver" : Adds a receiver to the sink's list. If the given
  IP address <-> port combination was already added, the command is
  logged, but otherwise ignored. Arguments:
  - "destination.ip" : IP address to send data to. Can be a uni- or
    multicast address, but must be a valid address.
  - "destination.port" : Port to send data to. Must be valid.
  - "local.ifname", "source.ip", "net.ttl", "net.dscp", "net.loop" :
    These are all optional, and work just like in the RTP sink
    module's properties.

* "remove-receiver" : Removes a receiver from the sink's list. The
  receiver is identified by the given IP address. A port can optionally
  be specified as well. If it isn't, then the first receiver with that IP
  address is removed. If no matching receiver is in the sink's list,
  this command does nothing. Arguments:
  - "destination.ip" : IP address to send data to. Can be a uni- or
    multicast address, but must be a valid address.
  - "destination.port" : Port to send data to. This is optional. But, if
    it is set, it must be a valid port number.

* "clear-receivers" : Removes all receivers from the sink's list. If the
  list is empty, this does nothing. This command has no arguments.

If the RTP sink module is created with the "destination.ip" and
"destination.port" properties set, it behaves as if "add-receiver" were
called right after the module was initialized. This means that if none
of these commands are used, the module behaves just as it did prior to
this patch. Note that the "remove-receivers" command can remove this
initial receiver as well.

If no receivers are added, the module continues to work normally.
Adding and removing receivers mid-operation is supported.

NOTE: "destination.ip") handling in stream_props_changed() is removed,
since it never really did anything other than change the param value.
2026-06-23 10:47:36 +00:00
..
apple-midi.h Merge branch 'master' into 'fix_san_build' 2023-03-10 10:10:25 +00:00
audio.c module-rtp: Move incoming RTP packet checks to rtp_stream_receive_packet() 2026-06-14 22:05:30 +02:00
midi.c module-rtp: Move incoming RTP packet checks to rtp_stream_receive_packet() 2026-06-14 22:05:30 +02:00
opus.c module-rtp: Move incoming RTP packet checks to rtp_stream_receive_packet() 2026-06-14 22:05:30 +02:00
ptp.h module-rtp-sap: review 2024-01-22 16:41:06 +00:00
rtp.h module-rtp: Add calculate_seqnum_delta() utility function 2026-06-14 12:01:34 +02:00
sap.h
stream.c module-rtp-sink: Add ability to add / remove receivers through commands 2026-06-23 10:47:36 +00:00
stream.h module-rtp-sink: Add ability to add / remove receivers through commands 2026-06-23 10:47:36 +00:00