roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.06k stars 213 forks source link

URIs and endpoints #258

Closed gavv closed 4 years ago

gavv commented 5 years ago

Overview

Currently we have a "port" concept, which has the following notation:

protocol:ip:port

Now we're adding RTSP support which will operate with URIs like:

protocol://host:port/path

To keep things unified we're migrating from the concept of "port" to a concept of "endpoint".

Endpoint is something, identified by an URI, to which we can connect and then retrieve a stream from it and/or send a stream to it.

Both senders and receivers will be able to act as servers and clients. The server binds to an endpoint; the client connects to it; this forms a unidirectional or bidirectional stream (depending on the protocol and configuration). Then they start transmitting traffic over this stream.

RTP and FECFRAME endpoints will be used to transmit the traffic directly. RTSP endpoint will be used to establish an RTSP session and internally allocate additional RTP and FECFRAME endpoints for actual data transfer.

The user may either create two RTP and FECFRAME endpoints and connect to them manually, or create a single RTSP endpoint and connect to it, allowing Roc to do the rest.

Examples of new syntax for RTP and FECFRAME:

roc-recv -s rtp+rs8m://0.0.0.0:10001 -r rs8m://0.0.0.0:10002
roc-recv -s rtp+rs8m://[::]:10001 -r rs8m://[::]:10002

To make things even more unified, we will also use URIs for audio devices, so that this:

-d alsa -i card0

will become this:

-i alsa://card0

Implementation

gavv commented 4 years ago

Done.