roc-streaming / roc-toolkit

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

Implement channel order mapping #607

Closed gavv closed 11 months ago

gavv commented 11 months ago

For #86.

Before this commit, order of channels in surround layout was defined by ChannelPosition enum values.

After this commit, each ChannelSet (and hence SampleSpec) contains ChannelOrder enum, which defines order of surround channels in memory.

Currently two orders are supported:

ChannelMapper now takes order into account. If input & output orders differ, it automatically performs reordering.

So far surround layouts were not exposed in API and CLI. Thus, changing default order did not break anything, however all tests had to be updated to match new order.

dshil commented 11 months ago

Hi @gavv, I would suggest to simplify setup_map_matrix_().
The following things complicate the understanding of the code base:

It can be done after the PR. Suggested patch

dshil commented 11 months ago

I'll add the suggested patch in a separate PR.