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.
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
[x] Create a new module roc_address.
[x] Move packet::Address to address::SocketAddr - a class representing a parsed socket address, which consists of:
resolved ip
tcp or udp port
optional resolved multicast address
[x] Move protocol definitions from roc_pipeline to roc_address.
[x] Add address::EndpointURI - a class representing a parsed endpoint URI, which consists of:
protocol (scheme)
unresolved hostname
port number
optional path
[x] Add address::IoURI - a class representing a parsed file/device URI, which consists of: 2
driver name
device of file name
[x] Add address::parse_endpoint_uri() and address::format_endpoint_uri(). The former will replace pipeline::parse_port(). In contrast to parse_port(), it will not allow empty ip/host. This function does not perform any resolving.
[x] Add address::parse_io_uri() and address::format_io_uri().
[x] Migrate from packet::Address to address::SocketAddr.
[x] Migrate from driver name + device name in roc_sndio to address::IoURI.
[x] Hide concept of audio drivers from user. The user will operate with URIs, and how URIs are mapped to drivers will become an implementation detail.
[x] Use address::parse_io_uri() in tools.
[x] Migrate roc_pipeline to endpoints. Don't use pipeline::PortConfig in roc_peer. Use it only in tests and tools.
[x] Add address::Endpoint.
[x] Add netio::Resolver. Add netio::EventLoop::resolve_endpoint_address() that accepts Endpoint and returns resolved SocketAddr.
[x] Add roc_endpoint to API. Provide two ways to initialize it: field-by-filed, or parse from an URI.
[x] Use Endpoint and resolve_endpoint_address in roc_peer. Get rid of pipeline::PortConfig and corresponding parsing and formatting functions.
[x] Migrate API from roc_address to roc_endpoint.
[x] Migrate tools from ports to endpoints.
[x] Update documentation (doxygen, running tools, manuals). Update API examples and tests.
Overview
Currently we have a "port" concept, which has the following notation:
Now we're adding RTSP support which will operate with URIs like:
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:
To make things even more unified, we will also use URIs for audio devices, so that this:
will become this:
Implementation
[x] Create a new module
roc_address
.[x] Move
packet::Address
toaddress::SocketAddr
- a class representing a parsed socket address, which consists of:[x] Move protocol definitions from
roc_pipeline
toroc_address
.[x] Add
address::EndpointURI
- a class representing a parsed endpoint URI, which consists of:[x] Add
address::IoURI
- a class representing a parsed file/device URI, which consists of: 2[x] Add
address::parse_endpoint_uri()
andaddress::format_endpoint_uri()
. The former will replacepipeline::parse_port()
. In contrast toparse_port()
, it will not allow empty ip/host. This function does not perform any resolving.[x] Add
address::parse_io_uri()
andaddress::format_io_uri()
.[x] Migrate from
packet::Address
toaddress::SocketAddr
.[x] Migrate from driver name + device name in
roc_sndio
toaddress::IoURI
.[x] Hide concept of audio drivers from user. The user will operate with URIs, and how URIs are mapped to drivers will become an implementation detail.
[x] Use
address::parse_io_uri()
in tools.[x] Migrate
roc_pipeline
to endpoints. Don't usepipeline::PortConfig
inroc_peer
. Use it only in tests and tools.[x] Add
address::Endpoint
.[x] Add
netio::Resolver
. Addnetio::EventLoop::resolve_endpoint_address()
that acceptsEndpoint
and returns resolvedSocketAddr
.[x] Add
roc_endpoint
to API. Provide two ways to initialize it: field-by-filed, or parse from an URI.[x] Use
Endpoint
andresolve_endpoint_address
inroc_peer
. Get rid ofpipeline::PortConfig
and corresponding parsing and formatting functions.[x] Migrate API from
roc_address
toroc_endpoint
.[x] Migrate tools from ports to endpoints.
[x] Update documentation (doxygen, running tools, manuals). Update API examples and tests.