mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
Simple upmix of stereo inputs up to 7.1 output
This commit is contained in:
parent
5712992fc9
commit
4d21b5f8bd
1 changed files with 14 additions and 0 deletions
|
|
@ -155,6 +155,8 @@ static const struct channelmix_info *find_channelmix_info(uint32_t src_chan, uin
|
|||
|
||||
#define _MASK(ch) (1ULL << SPA_AUDIO_CHANNEL_ ## ch)
|
||||
#define STEREO (_MASK(FL)|_MASK(FR))
|
||||
#define DUAL_STEREO (_MASK(RL)|_MASK(RR))
|
||||
#define QUAD_STEREO (_MASK(SL)|_MASK(SR))
|
||||
|
||||
static int make_matrix(struct channelmix *mix)
|
||||
{
|
||||
|
|
@ -218,6 +220,18 @@ static int make_matrix(struct channelmix *mix)
|
|||
}
|
||||
}
|
||||
|
||||
if (mix->src_chan <= 3 && (src_mask & STEREO) == STEREO && (dst_mask & DUAL_STEREO) == DUAL_STEREO) {
|
||||
spa_log_debug(mix->log, "copy STEREO to REAR");
|
||||
if ((src_mask & _MASK(RL)) == 0) matrix[RL][FL] = 1.0f;
|
||||
if ((src_mask & _MASK(RR)) == 0) matrix[RR][FR] = 1.0f;
|
||||
|
||||
if ((dst_mask & QUAD_STEREO) == QUAD_STEREO) {
|
||||
spa_log_debug(mix->log, "copy STEREO to SIDES");
|
||||
if ((src_mask & _MASK(SL)) == 0) matrix[SL][FL] = 1.0f;
|
||||
if ((src_mask & _MASK(SR)) == 0) matrix[SR][FR] = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (unassigned & STEREO){
|
||||
if (dst_mask & _MASK(FC)) {
|
||||
spa_log_debug(mix->log, "assign STEREO to FC");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue