Publish the audio and video input ports via Avahi #219
+349
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had a go at implementing https://github.com/timvideos/gst-switch/issues/194. This branch adds the Avahi client libraries as a dependency, but the resulting binaries should still run if the Avahi service isn't running (it will just fail to publish the service).
It publishes two services of the types
_gstswitch-video._tcp
and_gstswitch-audio._tcp
that match the two listening ports. Each service has two TXT records attached:GstCaps
expected for data sent to this port.This should be enough for a smart capture client to notice when the server appears on the network, and what format data to send. It could also automatically reconnect if the server changes IP address.
By default the server will use the name
gst-switch
, but this can be changed using the--service-name
command line option. If there are name conflicts, it will use Avahi's standard name conflict resolution method.The code is based on the example from the Avahi documentation:
http://git.0pointer.net/avahi.git/tree/examples/client-publish-service.c
As an example, here is the
avahi-browse
output watching the audio service when I start and kill the server: