• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef foostreamutilhfoo
2 #define foostreamutilhfoo
3 
4 /***
5   This file is part of PulseAudio.
6 
7   Copyright 2013 Intel Corporation
8 
9   PulseAudio is free software; you can redistribute it and/or modify
10   it under the terms of the GNU Lesser General Public License as published
11   by the Free Software Foundation; either version 2.1 of the License,
12   or (at your option) any later version.
13 
14   PulseAudio is distributed in the hope that it will be useful, but
15   WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17   General Public License for more details.
18 
19   You should have received a copy of the GNU Lesser General Public License
20   along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
21 ***/
22 
23 #include <pulse/format.h>
24 #include <pulse/volume.h>
25 
26 /* This is a helper function that is called from pa_sink_input_new() and
27  * pa_source_output_new(). The job of this function is to figure out what
28  * channel map should be used for interpreting the volume that was set for the
29  * stream. The channel map that the client intended for the volume may be
30  * different than the final stream channel map, because the client may want the
31  * server to decide the stream channel map.
32  *
33  * volume is the volume for which the channel map should be figured out.
34  *
35  * original_map is the channel map that is set in the new data struct's
36  * channel_map field. If the channel map hasn't been set in the new data, then
37  * original_map should be NULL.
38  *
39  * format is the negotiated format for the stream. It's used as a fallback if
40  * original_map is not available.
41  *
42  * On success, the result is saved in volume_map. It's possible that this
43  * function fails to figure out the right channel map for the volume, in which
44  * case a negative error code is returned. */
45 int pa_stream_get_volume_channel_map(const pa_cvolume *volume, const pa_channel_map *original_map, const pa_format_info *format,
46                                      pa_channel_map *volume_map);
47 
48 #endif
49