Coverage Report

Created: 2025-07-11 06:16

/src/vlc/modules/demux/windows_audio_commons.h
Line
Count
Source (jump to first uncovered line)
1
/*****************************************************************************
2
 * windows_audio_common.h: Windows Audio common code
3
 *****************************************************************************
4
 * Copyright (C) 2001-2013 VideoLAN
5
 *
6
 * Authors: Denis Charmet <typx@videolan.org>
7
 *
8
 * This program is free software; you can redistribute it and/or modify it
9
 * under the terms of the GNU Lesser General Public License as published by
10
 * the Free Software Foundation; either version 2.1 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public License
19
 * along with this program; if not, write to the Free Software Foundation,
20
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21
 *****************************************************************************/
22
#ifndef DMX_WINDOWS_AUDIO_COMMONS_H
23
#define DMX_WINDOWS_AUDIO_COMMONS_H
24
25
#include <vlc_aout.h>
26
#include <vlc_codecs.h>
27
28
static const uint32_t pi_channels_src[] = {
29
    WAVE_SPEAKER_FRONT_LEFT, WAVE_SPEAKER_FRONT_RIGHT,
30
    WAVE_SPEAKER_FRONT_CENTER, WAVE_SPEAKER_LOW_FREQUENCY,
31
    WAVE_SPEAKER_BACK_LEFT, WAVE_SPEAKER_BACK_RIGHT, WAVE_SPEAKER_BACK_CENTER,
32
    WAVE_SPEAKER_SIDE_LEFT, WAVE_SPEAKER_SIDE_RIGHT,
33
    0
34
};
35
36
static const uint32_t pi_channels_aout[] = {
37
    AOUT_CHAN_LEFT, AOUT_CHAN_RIGHT,
38
    AOUT_CHAN_CENTER, AOUT_CHAN_LFE,
39
    AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT, AOUT_CHAN_REARCENTER,
40
    AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT,
41
    0
42
};
43
44
static inline unsigned getChannelMask( uint32_t * wvfextChannelMask, int i_channels, int * i_match )
45
0
{
46
0
    unsigned i_channel_mask = 0;
47
0
    *i_match = 0;
48
0
    for( unsigned i = 0;
49
0
         i < sizeof(pi_channels_src)/sizeof(*pi_channels_src) &&
50
0
         *i_match < i_channels; i++ )
51
0
    {
52
0
        if( *wvfextChannelMask & pi_channels_src[i] )
53
0
        {
54
0
            if( !( i_channel_mask & pi_channels_aout[i] ) )
55
0
                 *i_match += 1;
56
57
0
            *wvfextChannelMask &= ~pi_channels_src[i];
58
0
            i_channel_mask |= pi_channels_aout[i];
59
0
        }
60
0
    }
61
0
    return i_channel_mask;
62
0
}
Unexecuted instantiation: wav.c:getChannelMask
Unexecuted instantiation: matroska_segment_parse.cpp:getChannelMask(unsigned int*, int, int*)
63
64
#endif /*DMX_WINDOWS_AUDIO_COMMONS_H*/